Skip to content

Commit ebcb320

Browse files
feat(CS): new X-Road 8 theme
Elevated View for certificates/wizards Improved logic for breadcrumb tracking Refs: XRDDEV-2917
1 parent 3bb6dff commit ebcb320

37 files changed

+943
-321
lines changed

src/central-server/admin-service/ui/src/App.vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@
2626
-->
2727
<template>
2828
<XrdApp :login-view="loginView">
29-
<router-view v-slot="{ Component }">
30-
<transition name="fade" mode="out-in">
31-
<component :is="Component" />
32-
</transition>
33-
</router-view>
29+
<router-view />
3430
</XrdApp>
3531
</template>
3632

src/central-server/admin-service/ui/src/components/certificate/CertificateDetails.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import { useRouter } from 'vue-router';
5050
import CertificateHash from '@/components/certificate/CertificateHash.vue';
5151
import CertificateInfo from '@/components/certificate/CertificateInfo.vue';
5252
import { CertificateDetails } from '@/openapi-types';
53+
import { XrdCertificate } from '@niis/shared-ui';
5354
5455
defineProps({
5556
certificateDetails: {

src/central-server/admin-service/ui/src/layouts/AppBase.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@
3030
<AppToolbar />
3131
<router-view name="navigation" />
3232

33-
<v-main class="bg-surface pr-10">
34-
<router-view />
35-
<XrdAppFooter :app-version="appVersion" class="mt-6 mb-6 pa-0" />
33+
<v-main class="bg-surface pr-10 pb-8">
34+
<div class="mb-6">
35+
<router-view />
36+
</div>
37+
<router-view name="footer" />
3638
</v-main>
3739
</v-layout>
3840
</template>
@@ -43,15 +45,11 @@ import { useUser } from '@/store/modules/user';
4345
import { useSystem } from '@/store/modules/system';
4446
import { useAlerts } from '@/store/modules/alerts';
4547
import AppToolbar from '@/layouts/AppToolbar.vue';
46-
import { XrdAppFooter } from '@niis/shared-ui';
47-
import { computed } from 'vue';
4848
4949
const userStore = useUser();
5050
const { checkAlerts } = useAlerts();
5151
const systemStore = useSystem();
5252
53-
const appVersion = computed(() => systemStore.serverVersion?.info || '');
54-
5553
const sessionPollInterval = setInterval(
5654
() => pollSessionStatus(),
5755
Timeouts.POLL_SESSION_TIMEOUT,
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!--
2+
The MIT License
3+
4+
Copyright (c) 2019- Nordic Institute for Interoperability Solutions (NIIS)
5+
Copyright (c) 2018 Estonian Information System Authority (RIA),
6+
Nordic Institute for Interoperability Solutions (NIIS), Population Register Centre (VRK)
7+
Copyright (c) 2015-2017 Estonian Information System Authority (RIA), Population Register Centre (VRK)
8+
9+
Permission is hereby granted, free of charge, to any person obtaining a copy
10+
of this software and associated documentation files (the "Software"), to deal
11+
in the Software without restriction, including without limitation the rights
12+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
copies of the Software, and to permit persons to whom the Software is
14+
furnished to do so, subject to the following conditions:
15+
16+
The above copyright notice and this permission notice shall be included in
17+
all copies or substantial portions of the Software.
18+
19+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
THE SOFTWARE.
26+
-->
27+
28+
<template>
29+
<XrdAppFooter :app-version="appVersion" class="mb-6 pa-0" />
30+
</template>
31+
32+
<script lang="ts" setup>
33+
import { useSystem } from '@/store/modules/system';
34+
import { XrdAppFooter } from '@niis/shared-ui';
35+
import { computed } from 'vue';
36+
37+
const systemStore = useSystem();
38+
39+
const appVersion = computed(() => systemStore.serverVersion?.info || '');
40+
</script>

src/central-server/admin-service/ui/src/layouts/TabsBase.vue renamed to src/central-server/admin-service/ui/src/layouts/AppMainNavigation.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
THE SOFTWARE.
2626
-->
2727
<template>
28-
<XrdTabsBase :tabs="allowedTabs" :user-name="username" />
28+
<XrdMainNavigation :tabs="allowedTabs" :user-name="username" />
2929
</template>
3030

3131
<script lang="ts" setup>
3232
import { computed } from 'vue';
3333
import { mainTabs } from '@/global';
3434
import { useUser } from '@/store/modules/user';
35-
import { XrdTabsBase } from '@niis/shared-ui';
35+
import { XrdMainNavigation } from '@niis/shared-ui';
3636
3737
const { getAllowedTabs, username } = useUser();
3838
const allowedTabs = computed(() => getAllowedTabs(mainTabs));

src/central-server/admin-service/ui/src/layouts/PageNavigation.vue renamed to src/central-server/admin-service/ui/src/layouts/ViewNavigation.vue

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,16 @@
2525
THE SOFTWARE.
2626
-->
2727
<template>
28-
<v-tabs grow class="bg-tab rounded-xl">
28+
<v-tabs bg-color="surface-container-low" grow class="rounded-xl">
2929
<v-tab
3030
v-for="tab in allowedTabs"
3131
:key="tab.key"
32-
class="body-regular font-weight-medium"
33-
variant="flat"
32+
class="xrd-tab body-regular font-weight-medium"
33+
selected-class="xrd-tab--active"
34+
variant="text"
3435
rounded="xl"
35-
base-color="tab"
36-
color="active-tab"
36+
base-color="primary"
37+
color="tertiary"
3738
hide-slider
3839
:to="tab.to"
3940
:data-test="tab.key"
@@ -70,7 +71,11 @@ export default defineComponent({
7071
});
7172
</script>
7273
<style lang="scss" scoped>
73-
.v-tab-item--selected {
74-
background-color: red;
74+
.xrd-tab {
75+
background-color: rgb(var(--v-theme-surface-container-low));
76+
77+
&.xrd-tab--active {
78+
background-color: rgb(var(--v-theme-on-accent));
79+
}
7580
}
7681
</style>

src/central-server/admin-service/ui/src/router/router.ts

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,27 @@ import {
2929
createWebHashHistory,
3030
NavigationGuardNext,
3131
RouteLocationNormalized,
32+
RouteLocationNormalizedLoaded,
3233
} from 'vue-router';
3334
import routes from './routes';
3435
import { RouteName } from '@/global';
3536
import { useUser } from '@/store/modules/user';
3637
import { useSystem } from '@/store/modules/system';
37-
import { useNotifications, XrdLocation } from '@niis/shared-ui';
38+
import { useNotifications, XrdLocation, useHistory } from '@niis/shared-ui';
3839

3940
// Create the router
4041
const router = createRouter({
4142
history: createWebHashHistory(),
4243
routes: routes,
4344
});
4445

45-
function backOnEscape(event: KeyboardEvent) {
46-
if (event.key === 'Escape') {
47-
router.go(-1);
48-
}
49-
}
46+
router.afterEach(
47+
(to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded) => {
48+
const { push } = useHistory();
49+
50+
push(to);
51+
},
52+
);
5053

5154
router.beforeEach(
5255
async (
@@ -65,12 +68,6 @@ router.beforeEach(
6568
const notifications = useNotifications();
6669
const system = useSystem();
6770

68-
if (to.meta.backOnEscape) {
69-
window.addEventListener('keyup', backOnEscape);
70-
} else {
71-
window.removeEventListener('keyup', backOnEscape);
72-
}
73-
7471
// User is allowed to access any other view than login only after authenticated information has been fetched
7572
// Session alive information is fetched before any view is accessed. This prevents UI flickering by not allowing
7673
// user to be redirected to a view that contains api calls (s)he is not allowed.
@@ -92,17 +89,6 @@ router.beforeEach(
9289
/*
9390
Check permissions here
9491
*/
95-
const fromName = from.meta.from?.name || from.name;
96-
97-
if (to.meta.allowBackTo) {
98-
for (const routeName of to.meta.allowBackTo) {
99-
if (routeName == from.name) {
100-
to.meta.from = from;
101-
} else if (routeName == from.meta.from?.name) {
102-
to.meta.from = from.meta.from;
103-
}
104-
}
105-
}
10692

10793
if (!to?.meta?.permissions) {
10894
next();

0 commit comments

Comments
 (0)