From 601425c30cf9977b315a21aa2c627ddc9fb78d24 Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Tue, 28 May 2024 12:25:22 +0100 Subject: [PATCH] fix: Fix SNV Editor Back Url - MEED-6937 - Meeds-io/meeds#2060 (#80) Prior to this change, when editing SNV in full edit mode (with a new page opened in a new tab) and then the user publishes the SNV content, the SNV redirects to the previous page which is the Layout Editor. When the layout editor is opened again in a new Tab, a new draft page is opened and makes the first Tab with Layout editor in an invalid state. This change will avoid redirection to layout editor when publishing the SNV by introducing a global variable indicating the page being edited in editor and that should be used for redirection in SNV. --- layout-webapp/src/main/webapp/vue-app/layout-editor/main.js | 6 ++++++ 1 file changed, 6 insertions(+) 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 75bfd12cb..76d244629 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 @@ -88,6 +88,7 @@ export function init() { diffScrollX: 0, diffScrollY: 0, gap: 20, + nodeUri: null, }), computed: { parentAppX() { @@ -129,6 +130,11 @@ export function init() { this.$root.$emit('layout-editor-moving-end', this.movingParentId); } }, + nodeUri() { + if (this.nodeUri) { + eXo.env.portal.webPageUrl = `/portal${this.nodeUri}`; + } + }, layout(newVal, oldVal) { if (!oldVal) { window.setTimeout(() => document.dispatchEvent(new CustomEvent('hideTopBarLoading')), 200);