From d1e052c3793be538d32294d47e54df04af849790 Mon Sep 17 00:00:00 2001 From: Katerina Koukiou Date: Fri, 2 Aug 2019 16:53:51 +0200 Subject: [PATCH] Change the URL when changing the Tabs in the Blueprint page Fixes #741 Closes #752 --- pages/blueprint/index.js | 8 +++++++- routes.json | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pages/blueprint/index.js b/pages/blueprint/index.js index abf7c8e82..270d844ea 100644 --- a/pages/blueprint/index.js +++ b/pages/blueprint/index.js @@ -310,6 +310,8 @@ class BlueprintPage extends React.Component { if (blueprint.customizations !== undefined && blueprint.customizations.user !== undefined) { users = blueprint.customizations.user; } + const pathSuffix = cockpit.location.path[cockpit.location.path.length - 1]; + const activeKey = ["customizations", "packages", "images"].includes(pathSuffix) ? pathSuffix : undefined; return ( (this.layout = c)}> @@ -374,7 +376,11 @@ class BlueprintPage extends React.Component {

- + cockpit.location.go(["blueprint", blueprint.name, eventId])} + id="blueprint-tabs" + >
diff --git a/routes.json b/routes.json index 45c2150c9..cb33033d7 100644 --- a/routes.json +++ b/routes.json @@ -17,6 +17,10 @@ "path": "/blueprint/:blueprint", "page": "./pages/blueprint" }, + { + "path": "/blueprint/:blueprint/:subtab", + "page": "./pages/blueprint" + }, { "path": "/edit/:blueprint", "page": "./pages/blueprintEdit"