From 2ab9d77232c4c4f76a91499166004aacff8780a6 Mon Sep 17 00:00:00 2001 From: Jake Potrebic <15055071+Machine-Maker@users.noreply.github.com> Date: Sun, 4 Oct 2020 14:04:35 -0700 Subject: [PATCH] Channel creation/manage views (#167) * most work done, 1 tiny issue * fixed the stupid issue --- src/main/frontend/.eslintrc.js | 3 + src/main/frontend/src/CreateVersion.vue | 332 ++++++++------ src/main/frontend/src/Home.vue | 18 +- src/main/frontend/src/PlatformChoice.vue | 69 --- .../frontend/src/PlatformVersionTable.vue | 7 +- src/main/frontend/src/ReleaseChannels.vue | 151 +++++++ src/main/frontend/src/UserProfile.vue | 9 +- src/main/frontend/src/VersionList.vue | 13 +- src/main/frontend/src/api.js | 16 +- .../src/components/DependencySelection.vue | 414 +++++++++--------- src/main/frontend/src/components/Editor.vue | 18 +- .../frontend/src/components/HangarModal.vue | 22 + .../frontend/src/components/NewChannel.vue | 186 ++++++++ .../frontend/src/components/PlatformTags.vue | 64 --- .../frontend/src/components/ProjectList.vue | 52 +-- .../src/entrypoints/create-version.js | 2 - .../frontend/src/entrypoints/font-awesome.js | 8 +- .../src/entrypoints/platform-choice.js | 4 - .../src/entrypoints/release-channels.js | 4 + src/main/frontend/src/js/actionLog.js | 13 +- src/main/frontend/src/js/apiKeysManagement.js | 9 +- src/main/frontend/src/js/apiRequests.js | 6 +- src/main/frontend/src/js/channelManage.js | 20 +- src/main/frontend/src/js/keyGen.js | 6 +- src/main/frontend/src/js/main.js | 4 +- src/main/frontend/src/js/membersConfig.js | 5 +- src/main/frontend/src/js/pageCollapse.js | 14 +- src/main/frontend/src/js/pageEdit.js | 12 +- src/main/frontend/src/js/projectDetail.js | 6 +- src/main/frontend/src/js/queue.js | 8 +- src/main/frontend/src/js/userAdmin.js | 6 +- src/main/frontend/src/js/userPage.js | 88 ++-- .../src/js/versionCreateChannelNew.js | 12 +- src/main/frontend/src/scss/_channel.scss | 32 ++ src/main/frontend/src/scss/_creator.scss | 35 +- src/main/frontend/src/scss/_project.scss | 22 - src/main/frontend/src/scss/main.scss | 13 +- src/main/frontend/src/utils/modelWrapper.js | 8 + .../hangar/controller/ChannelsController.java | 33 +- .../hangar/controller/HangarController.java | 1 - .../hangar/controller/VersionsController.java | 144 ------ .../hangar/db/dao/ProjectChannelDao.java | 6 +- .../java/io/papermc/hangar/model/Color.java | 22 + .../handler/PaperPluginFileHandler.java | 2 - .../service/project/ChannelService.java | 7 +- src/main/resources/templates/layout/base.ftlh | 2 +- .../templates/projects/channels/list.ftlh | 86 +--- .../templates/projects/versions/create.ftlh | 14 +- 48 files changed, 990 insertions(+), 1038 deletions(-) delete mode 100644 src/main/frontend/src/PlatformChoice.vue create mode 100644 src/main/frontend/src/ReleaseChannels.vue create mode 100644 src/main/frontend/src/components/HangarModal.vue create mode 100644 src/main/frontend/src/components/NewChannel.vue delete mode 100644 src/main/frontend/src/components/PlatformTags.vue delete mode 100644 src/main/frontend/src/entrypoints/platform-choice.js create mode 100644 src/main/frontend/src/entrypoints/release-channels.js create mode 100644 src/main/frontend/src/scss/_channel.scss create mode 100644 src/main/frontend/src/utils/modelWrapper.js diff --git a/src/main/frontend/.eslintrc.js b/src/main/frontend/.eslintrc.js index dfd45e861..8a2e2eca3 100644 --- a/src/main/frontend/.eslintrc.js +++ b/src/main/frontend/.eslintrc.js @@ -11,5 +11,8 @@ module.exports = { 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 'no-unused-vars': 'warn', + 'vue/no-unused-vars': process.env.NODE_ENV === 'production' ? 'error' : 'warn', + 'vue/no-unused-components': process.env.NODE_ENV === 'production' ? 'error' : 'warn', + 'vue/no-mutating-props': 'off', }, }; diff --git a/src/main/frontend/src/CreateVersion.vue b/src/main/frontend/src/CreateVersion.vue index 5fc3e6c73..d55efa5af 100644 --- a/src/main/frontend/src/CreateVersion.vue +++ b/src/main/frontend/src/CreateVersion.vue @@ -1,101 +1,122 @@ - diff --git a/src/main/frontend/src/PlatformVersionTable.vue b/src/main/frontend/src/PlatformVersionTable.vue index 3e025414e..88ce6ebed 100644 --- a/src/main/frontend/src/PlatformVersionTable.vue +++ b/src/main/frontend/src/PlatformVersionTable.vue @@ -27,12 +27,7 @@
-
diff --git a/src/main/frontend/src/ReleaseChannels.vue b/src/main/frontend/src/ReleaseChannels.vue new file mode 100644 index 000000000..1427bf8c0 --- /dev/null +++ b/src/main/frontend/src/ReleaseChannels.vue @@ -0,0 +1,151 @@ + + + diff --git a/src/main/frontend/src/UserProfile.vue b/src/main/frontend/src/UserProfile.vue index 0b119728a..810612dcb 100644 --- a/src/main/frontend/src/UserProfile.vue +++ b/src/main/frontend/src/UserProfile.vue @@ -1,12 +1,5 @@ diff --git a/src/main/frontend/src/components/NewChannel.vue b/src/main/frontend/src/components/NewChannel.vue new file mode 100644 index 000000000..907f1bab5 --- /dev/null +++ b/src/main/frontend/src/components/NewChannel.vue @@ -0,0 +1,186 @@ + + + diff --git a/src/main/frontend/src/components/PlatformTags.vue b/src/main/frontend/src/components/PlatformTags.vue deleted file mode 100644 index 14350f5bd..000000000 --- a/src/main/frontend/src/components/PlatformTags.vue +++ /dev/null @@ -1,64 +0,0 @@ - - diff --git a/src/main/frontend/src/components/ProjectList.vue b/src/main/frontend/src/components/ProjectList.vue index 0987b6895..c46895f5b 100644 --- a/src/main/frontend/src/components/ProjectList.vue +++ b/src/main/frontend/src/components/ProjectList.vue @@ -16,34 +16,18 @@
- +
@@ -174,17 +148,7 @@ export default { this.update(); this.debouncedUpdateProps = debounce(this.update, 500); this.$watch( - () => - [ - this.q, - this.categories, - this.tags, - this.owner, - this.sort, - this.relevance, - this.limit, - this.offset, - ].join(), + () => [this.q, this.categories, this.tags, this.owner, this.sort, this.relevance, this.limit, this.offset].join(), () => { this.debouncedUpdateProps(); } diff --git a/src/main/frontend/src/entrypoints/create-version.js b/src/main/frontend/src/entrypoints/create-version.js index 5f4f65d90..9d66abd73 100644 --- a/src/main/frontend/src/entrypoints/create-version.js +++ b/src/main/frontend/src/entrypoints/create-version.js @@ -2,10 +2,8 @@ import { createApp } from 'vue'; import CreateVersion from '@/CreateVersion'; createApp(CreateVersion, { - defaultColor: window.DEFAULT_COLOR, pendingVersion: window.PENDING_VERSION, ownerName: window.OWNER_NAME, projectSlug: window.PROJECT_SLUG, - channels: window.CHANNELS, forumSync: window.FORUM_SYNC, }).mount('#create-version'); diff --git a/src/main/frontend/src/entrypoints/font-awesome.js b/src/main/frontend/src/entrypoints/font-awesome.js index d06a414d1..ea578b343 100644 --- a/src/main/frontend/src/entrypoints/font-awesome.js +++ b/src/main/frontend/src/entrypoints/font-awesome.js @@ -39,6 +39,7 @@ import { faKey, faLink, faList, + faListOl, faLock, faMagic, faMoneyBillAlt, @@ -48,6 +49,7 @@ import { faPlayCircle, faPlus, faPuzzlePiece, + faQuestion, faQuestionCircle, faReply, faSave, @@ -57,6 +59,7 @@ import { faSpinner, faStar as fasStar, faStopCircle, + faTag, faTags, faTerminal, faThumbsUp as fasThumbsUp, @@ -120,6 +123,7 @@ library.add( faChartArea, faHeartbeat, faList, + faListOl, faSignOutAlt, farThumbsUp, faTrash, @@ -168,7 +172,9 @@ library.add( faUserTag, faTags, faExclamationTriangle, - faCheckSquare + faCheckSquare, + faQuestion, + faTag ); dom.watch(); diff --git a/src/main/frontend/src/entrypoints/platform-choice.js b/src/main/frontend/src/entrypoints/platform-choice.js deleted file mode 100644 index cc7321aa4..000000000 --- a/src/main/frontend/src/entrypoints/platform-choice.js +++ /dev/null @@ -1,4 +0,0 @@ -import { createApp } from 'vue'; -import PlatformChoice from '@/PlatformChoice'; - -createApp(PlatformChoice).mount('#platform-choice'); diff --git a/src/main/frontend/src/entrypoints/release-channels.js b/src/main/frontend/src/entrypoints/release-channels.js new file mode 100644 index 000000000..02e7ebde8 --- /dev/null +++ b/src/main/frontend/src/entrypoints/release-channels.js @@ -0,0 +1,4 @@ +import { createApp } from 'vue'; +import ReleaseChannels from '@/ReleaseChannels'; + +createApp(ReleaseChannels).mount('#release-channels'); diff --git a/src/main/frontend/src/js/actionLog.js b/src/main/frontend/src/js/actionLog.js index b0c176a62..64ba69a86 100644 --- a/src/main/frontend/src/js/actionLog.js +++ b/src/main/frontend/src/js/actionLog.js @@ -9,10 +9,7 @@ $('body') var idToDiff = $(this).attr('data-diff'); var diff = new diff_match_patch(); - var textDiff = diff.diff_main( - $('textarea[data-oldstate="' + idToDiff + '"]').val(), - $('textarea[data-newstate="' + idToDiff + '"]').val() - ); + var textDiff = diff.diff_main($('textarea[data-oldstate="' + idToDiff + '"]').val(), $('textarea[data-newstate="' + idToDiff + '"]').val()); diff.diff_cleanupSemantic(textDiff); $('#modal-view-body').html(diff.diff_prettyHtml(textDiff).replace(/¶/g, '')); @@ -22,9 +19,7 @@ $('body') var idToShow = $(this).attr('data-view'); $('#modal-view-body').html( - '' + '' ); $('#modal-view').modal('show'); }) @@ -32,9 +27,7 @@ $('body') var idToShow = $(this).attr('data-view'); $('#modal-view-body').html( - '' + '' ); $('#modal-view').modal('show'); }); diff --git a/src/main/frontend/src/js/apiKeysManagement.js b/src/main/frontend/src/js/apiKeysManagement.js index d4a6997cf..37a9960b6 100644 --- a/src/main/frontend/src/js/apiKeysManagement.js +++ b/src/main/frontend/src/js/apiKeysManagement.js @@ -86,14 +86,7 @@ $(function () { row.append($('').text(token)); row.append($('')); row.append($('').text(namedPerms)); - row.append( - $('').append( - $(' -
+ <@csrf.formField />
diff --git a/src/main/resources/templates/projects/versions/create.ftlh b/src/main/resources/templates/projects/versions/create.ftlh index a34ee00b8..aab6b7d09 100644 --- a/src/main/resources/templates/projects/versions/create.ftlh +++ b/src/main/resources/templates/projects/versions/create.ftlh @@ -11,21 +11,15 @@ <#assign mainWidth = "col-md-10"> <#assign scriptsVar> - -<#-- --> -<#-- --> - <#if pending?? && !pending.dependencies??> - - - <#assign styleVar> @@ -63,6 +57,6 @@
- <@modalManage.modalManage /> +<#-- <@modalManage.modalManage />-->