From cd1d79bbf7274737bb99ee0c9a7f57c6258e7f64 Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Tue, 28 May 2024 17:49:41 +0100 Subject: [PATCH] feat: Update Portlet instance enablement message - MEED-6916 - Meeds-io/MIPs#139 (#83) --- .../main/resources/locale/portlet/LayoutEditor_en.properties | 3 ++- layout-webapp/src/main/webapp/vue-app/layout-editor/main.js | 2 +- .../main/webapp/vue-app/portlets/components/instances/Item.vue | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/layout-webapp/src/main/resources/locale/portlet/LayoutEditor_en.properties b/layout-webapp/src/main/resources/locale/portlet/LayoutEditor_en.properties index a90d2696a..2f2ae1158 100644 --- a/layout-webapp/src/main/resources/locale/portlet/LayoutEditor_en.properties +++ b/layout-webapp/src/main/resources/locale/portlet/LayoutEditor_en.properties @@ -152,7 +152,8 @@ portlets.instances=instances portlets.filter.placeholder=Filter by name, description portlets.label.disableInstance=Disable instance portlets.label.enableInstance=Enable instance -portlets.status.update.success=Portlet instance status successfully updated +portlets.status.enabled.success=Instance successfully activated +portlets.status.disabled.success=Instance successfully deactivated portlets.status.update.error=An unknown error occurred while updating instance. Please contact the administrator or try agan later. portlets.layout.update.success=Portlet instance successfully updated portlets.layout.update.error=An unknown error occurred while updating instance. Please contact the administrator or try agan later. diff --git a/layout-webapp/src/main/webapp/vue-app/layout-editor/main.js b/layout-webapp/src/main/webapp/vue-app/layout-editor/main.js index 76d244629..738235fc4 100644 --- a/layout-webapp/src/main/webapp/vue-app/layout-editor/main.js +++ b/layout-webapp/src/main/webapp/vue-app/layout-editor/main.js @@ -148,7 +148,7 @@ export function init() { this.$portletInstanceCategoryService.getPortletInstanceCategories() .then(categories => this.applicationCategories = categories); this.$portletInstanceService.getPortletInstances() - .then(applications => this.allApplications = applications); + .then(applications => this.allApplications = applications.filter(a => !a.disabled)); this.$brandingService.getBrandingInformation() .then(data => this.branding = data); }, diff --git a/layout-webapp/src/main/webapp/vue-app/portlets/components/instances/Item.vue b/layout-webapp/src/main/webapp/vue-app/portlets/components/instances/Item.vue index 5b378d8e5..24fbe401c 100644 --- a/layout-webapp/src/main/webapp/vue-app/portlets/components/instances/Item.vue +++ b/layout-webapp/src/main/webapp/vue-app/portlets/components/instances/Item.vue @@ -123,7 +123,7 @@ export default { }); }) .then(() => { - this.$root.$emit('alert-message', this.$t('portlets.status.update.success'), 'success'); + this.$root.$emit('alert-message', this.enabled && this.$t('portlets.status.disabled.success') || this.$t('portlets.status.enabled.success'), 'success'); }) .catch(() => this.$root.$emit('alert-message', this.$t('portlets.status.update.error'), 'error')) .finally(() => this.loading = false);