Skip to content

Commit 8fbbc74

Browse files
committed
Included v1/v2 switcher in admin-area sub-pages
1 parent cfb021f commit 8fbbc74

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Unreleased
44

5+
* Included v1/v2 switcher in admin-area sub-pages (\#485).
56
* Setup tests to use PostgreSQL instead of SQlite (\#484).
67
* Implemented tasks admin page (\#484).
78
* Improved form builder used in workflow tasks without JSON Schema and in Meta properties tab (\#481).

src/routes/+layout.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@
99
$: isAdmin = userLoggedIn && $page.data.userInfo.is_superuser;
1010
$: server = $page.data.serverInfo || {};
1111
/** @type {'v1'|'v2'} */
12-
$: apiVersion = $page.url.pathname.startsWith('/v1') ? 'v1': 'v2';
12+
$: apiVersion = $page.url.pathname.startsWith('/v1') ? 'v1' : 'v2';
1313
// @ts-ignore
1414
// eslint-disable-next-line no-undef
1515
let clientVersion = __APP_VERSION__;
1616
1717
$: displayVersionSelector =
18-
!isSubPage($page.url.pathname, apiVersion) && selectedSection !== 'home';
18+
((selectedSection === 'admin' &&
19+
$page.url.pathname !== '/v2/admin/tasks' &&
20+
$page.url.pathname !== '/v2/admin/tasks-compatibility') ||
21+
!isSubPage($page.url.pathname, apiVersion)) &&
22+
selectedSection !== 'home';
1923
2024
/**
2125
* Returns true if the URL indicates a subpage.

0 commit comments

Comments
 (0)