From 38c14c10335b9cc1b14fee8ffd351e47b89c1335 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 645826c8a..62a739314 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 @@ -85,6 +85,7 @@ export function init() { diffScrollX: 0, diffScrollY: 0, gap: 20, + nodeUri: null, }), computed: { parentAppX() { @@ -126,6 +127,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);