From b229a0abfb8afa4eade0cffd6ef8dc45d5354019 Mon Sep 17 00:00:00 2001 From: guerler Date: Sun, 25 Sep 2022 22:54:48 -0400 Subject: [PATCH] Reroute page display to client --- client/src/entry/analysis/router.js | 8 ++++++++ lib/galaxy/webapps/galaxy/buildapp.py | 1 + lib/galaxy/webapps/galaxy/controllers/page.py | 2 +- templates/webapps/galaxy/page/display.mako | 2 -- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/src/entry/analysis/router.js b/client/src/entry/analysis/router.js index 0a738df98fb..df2fb146b9e 100644 --- a/client/src/entry/analysis/router.js +++ b/client/src/entry/analysis/router.js @@ -37,6 +37,7 @@ import InvocationReport from "components/Workflow/InvocationReport"; import JobDetails from "components/JobInformation/JobDetails"; import NewUserConfirmation from "components/login/NewUserConfirmation"; import NewUserWelcome from "components/NewUserWelcome/NewUserWelcome"; +import PageDisplay from "components/PageDisplay/PageDisplay"; import PageEditor from "components/PageEditor/PageEditor"; import Sharing from "components/Sharing/Sharing"; import StoredWorkflowInvocations from "components/Workflow/StoredWorkflowInvocations"; @@ -81,6 +82,13 @@ export function getRouter(Galaxy) { ...AdminRoutes, ...LibraryRoutes, { path: "/login/start", component: Login }, + { + path: "/pages/display", + component: PageDisplay, + props: (route) => ({ + pageId: route.query.id, + }), + }, { path: "/pages/editor", component: PageEditor, diff --git a/lib/galaxy/webapps/galaxy/buildapp.py b/lib/galaxy/webapps/galaxy/buildapp.py index 422564a5e29..fc8bfd042b2 100644 --- a/lib/galaxy/webapps/galaxy/buildapp.py +++ b/lib/galaxy/webapps/galaxy/buildapp.py @@ -227,6 +227,7 @@ def app_pair(global_conf, load_app_kwds=None, wsgi_preflight=True, **kwargs): webapp.add_client_route("/pages/list") webapp.add_client_route("/pages/list_published") webapp.add_client_route("/pages/create") + webapp.add_client_route("/pages/display") webapp.add_client_route("/pages/edit") webapp.add_client_route("/pages/editor") webapp.add_client_route("/pages/sharing") diff --git a/lib/galaxy/webapps/galaxy/controllers/page.py b/lib/galaxy/webapps/galaxy/controllers/page.py index e49b924f0d5..4a4cc9fbba6 100644 --- a/lib/galaxy/webapps/galaxy/controllers/page.py +++ b/lib/galaxy/webapps/galaxy/controllers/page.py @@ -575,7 +575,7 @@ class PageController(BaseUIController, SharableMixin, UsesStoredWorkflowMixin, U else: user_item_rating = 0 ave_item_rating, num_ratings = self.get_ave_item_rating_data(trans.sa_session, page) - + return trans.response.send_redirect(web.url_for(controller="pages", action="display", id=page_content)) return trans.fill_template_mako( template, item=page, diff --git a/templates/webapps/galaxy/page/display.mako b/templates/webapps/galaxy/page/display.mako index 5d3d29f613c..4ebaca5f9a2 100644 --- a/templates/webapps/galaxy/page/display.mako +++ b/templates/webapps/galaxy/page/display.mako @@ -1,9 +1,7 @@ <%inherit file="/display_base.mako"/> <%def name="javascript_app()"> - ${parent.javascript_app()} -