From 5392718414080e6ba47fc357cdef2fca99bbe897 Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Fri, 29 Nov 2024 12:03:33 +0100 Subject: [PATCH] feat: Add Shortcut to create Space from sidebar - MEED-7805 - Meeds-io/MIPs#159 (#4210) Add button from Spaces List drawer to access Space Form Drawer. --- .../locale/portal/HamburgerMenu_en.properties | 2 + .../main/webapp/WEB-INF/gatein-resources.xml | 35 ++++++++++ .../space/SpacesHamburgerNavigation.vue | 14 +++- .../space-form/components/SpaceFormDrawer.vue | 15 ++++- .../components/SpaceFormInviteUsersDrawer.vue | 1 + .../components/SpaceFormInviteUsersInput.vue | 2 +- .../main/webapp/vue-apps/space-form/main.js | 67 +++++++++++++++++++ .../webapp/vue-apps/space-form/services.js | 26 +++++++ .../space-templates-management/main.js | 1 - .../vue-apps/spaces-administration/main.js | 1 - .../vue-apps/spaces-list/initComponents.js | 2 - webapp/webpack.common.js | 1 + 12 files changed, 159 insertions(+), 8 deletions(-) create mode 100644 webapp/src/main/webapp/vue-apps/space-form/main.js create mode 100644 webapp/src/main/webapp/vue-apps/space-form/services.js diff --git a/webapp/src/main/resources/locale/portal/HamburgerMenu_en.properties b/webapp/src/main/resources/locale/portal/HamburgerMenu_en.properties index 2c5566c9d58..90429b983e1 100644 --- a/webapp/src/main/resources/locale/portal/HamburgerMenu_en.properties +++ b/webapp/src/main/resources/locale/portal/HamburgerMenu_en.properties @@ -39,3 +39,5 @@ menu.spaces.noUnreadSpaces=No unread activities here menu.spaces.noFavoriteSpaces1=You haven't marked any space as a favorite menu.spaces.noFavoriteSpaces2=Go to the {0}Spaces{1} page to do so menu.spaces.openSidebarTooltip=Open Sites page links +menu.spaces.addNewSpaceTooltip=Filter by space +menu.spaces.filterBySpaceTooltip=Filter by space diff --git a/webapp/src/main/webapp/WEB-INF/gatein-resources.xml b/webapp/src/main/webapp/WEB-INF/gatein-resources.xml index fa42926a1d5..f796bf31706 100644 --- a/webapp/src/main/webapp/WEB-INF/gatein-resources.xml +++ b/webapp/src/main/webapp/WEB-INF/gatein-resources.xml @@ -1119,6 +1119,9 @@ extensionRegistry + + spaceForm + @@ -1589,6 +1592,9 @@ extensionRegistry + + spaceForm + @@ -2009,6 +2015,9 @@ extensionRegistry + + spaceForm + @@ -2192,6 +2201,32 @@ + + spaceForm + + + commonVueComponents + + + vue + + + vuetify + + + eXoVueI18n + + + extensionRegistry + + + imageCropper + + + peopleListComponents diff --git a/webapp/src/main/webapp/vue-apps/space-form/components/SpaceFormDrawer.vue b/webapp/src/main/webapp/vue-apps/space-form/components/SpaceFormDrawer.vue index f85e5234b9a..4ee8392da18 100644 --- a/webapp/src/main/webapp/vue-apps/space-form/components/SpaceFormDrawer.vue +++ b/webapp/src/main/webapp/vue-apps/space-form/components/SpaceFormDrawer.vue @@ -146,6 +146,9 @@ @@ -349,6 +352,7 @@ export default { } }, created() { + window.spaceFormAdded = true; const search = window.location.search && window.location.search.substring(1); if (search) { const parameters = JSON.parse( @@ -364,11 +368,18 @@ export default { }); } } - }, - mounted() { + this.$root.$on('addNewSpace', this.open); + document.addEventListener('addNewSpace', this.openByEvent); + }, + beforeDestroy() { + this.$root.$off('addNewSpace', this.open); + document.removeEventListener('addNewSpace', this.openByEvent); }, methods: { + openByEvent(e) { + this.open(e?.detail); + }, async open(templateId) { this.templateId = templateId && Number(templateId); this.noGoBack = !!templateId; diff --git a/webapp/src/main/webapp/vue-apps/space-form/components/SpaceFormInviteUsersDrawer.vue b/webapp/src/main/webapp/vue-apps/space-form/components/SpaceFormInviteUsersDrawer.vue index c1bad8ace1b..7528446c71c 100644 --- a/webapp/src/main/webapp/vue-apps/space-form/components/SpaceFormInviteUsersDrawer.vue +++ b/webapp/src/main/webapp/vue-apps/space-form/components/SpaceFormInviteUsersDrawer.vue @@ -32,6 +32,7 @@