From 51b39e4120789cf046810c6ee945a085f1dd62a9 Mon Sep 17 00:00:00 2001 From: juanf <juanf@ethz.ch> Date: Fri, 14 Jul 2023 15:25:19 +0200 Subject: [PATCH] SSDM-13811: back button and experiment link fixes --- .../html/js/controllers/MainController.js | 79 +++++++++---------- .../views/DataGrid/ExperimentDataGridUtil.js | 2 +- 2 files changed, 40 insertions(+), 41 deletions(-) diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js index cafdc77be44..dca72c8a18c 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/MainController.js @@ -404,7 +404,45 @@ function MainController(profile) { CKEditorManager.destroy(); this.sideMenu.removeSubSideMenu(); - + + // + // Permanent URLs + // + if (shouldURLBePushToHistory) { + var menuUniqueId = this.sideMenu.getCurrentNodeId(); + var url = Util.getURLFor(menuUniqueId, newViewChange, arg); + history.pushState(null, "", url); //History Push State + + var toPush = null; + if(shouldStateBePushToHistory) { + toPush = { + header : null, + content : null, + auxContent : null + } + + if(this.views.header) { + toPush.header = this.views.header; + toPush.header.detach(); + } + + if(this.views.content) { + toPush.content = this.views.content; + toPush.content.detach(); + } + + if(this.views.auxContent) { + toPush.auxContent = this.views.auxContent; + toPush.auxContent.detach(); + } + } + + this.backStack.push({ + view : toPush, + url : url + }); + } + // // // @@ -894,47 +932,8 @@ function MainController(profile) { } catch(err) { Util.manageError(err); } - - // - // Permanent URLs - // - if (shouldURLBePushToHistory) { - var menuUniqueId = this.sideMenu.getCurrentNodeId(); - var url = Util.getURLFor(menuUniqueId, newViewChange, arg); - history.pushState(null, "", url); //History Push State - - var toPush = null; - if(shouldStateBePushToHistory) { - toPush = { - header : null, - content : null, - auxContent : null - } - - if(this.views.header) { - toPush.header = this.views.header; - toPush.header.detach(); - } - - if(this.views.content) { - toPush.content = this.views.content; - toPush.content.detach(); - } - - if(this.views.auxContent) { - toPush.auxContent = this.views.auxContent; - toPush.auxContent.detach(); - } - } - - this.backStack.push({ - view : toPush, - url : url - }); - } - // // Refresh Functionality // diff --git a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/ExperimentDataGridUtil.js b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/ExperimentDataGridUtil.js index 4fdf4c34570..384cc39d60b 100644 --- a/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/ExperimentDataGridUtil.js +++ b/ui-eln-lims/src/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataGrid/ExperimentDataGridUtil.js @@ -59,7 +59,7 @@ var ExperimentDataGridUtil = new function() { exportableProperty: DataGridExportOptions.EXPORTABLE_FIELD.PERM_ID, sortable : true, render : function(data) { - return FormUtil.getFormLink(data.permId, "Experiment", data.permId); + return FormUtil.getFormLink(data.permId, "Experiment", data.identifier); }, filter : function(data, filter) { return data.identifier.toLowerCase().indexOf(filter) !== -1; -- GitLab