From c37f316e22f65587e3c6ac6b95c102c1a09362b5 Mon Sep 17 00:00:00 2001 From: "monika.maksymiuk" Date: Wed, 16 Oct 2024 21:00:41 +0200 Subject: [PATCH] Navigation side bar (#1904) --- hermes-console/src/App.vue | 3 +- .../navigation-drawer/NavigationDrawer.vue | 130 ++++++++++++++++++ .../navigation-drawer/NavigationItem.vue | 42 ++++++ hermes-console/src/i18n/en-US/index.ts | 6 + hermes-console/src/store/auth/useAuthStore.ts | 10 +- 5 files changed, 188 insertions(+), 3 deletions(-) create mode 100644 hermes-console/src/components/navigation-drawer/NavigationDrawer.vue create mode 100644 hermes-console/src/components/navigation-drawer/NavigationItem.vue diff --git a/hermes-console/src/App.vue b/hermes-console/src/App.vue index cc14e88436..cd37d7f65d 100644 --- a/hermes-console/src/App.vue +++ b/hermes-console/src/App.vue @@ -4,6 +4,7 @@ import AppNotificationProvider from '@/components/app-notification/AppNotificationProvider.vue'; import ConsoleFooter from '@/components/console-footer/ConsoleFooter.vue'; import ConsoleHeader from '@/components/console-header/ConsoleHeader.vue'; + import NavigationDrawer from '@/components/navigation-drawer/NavigationDrawer.vue'; const configStore = useAppConfigStore(); configStore.loadConfig(); @@ -13,7 +14,7 @@
- + diff --git a/hermes-console/src/components/navigation-drawer/NavigationDrawer.vue b/hermes-console/src/components/navigation-drawer/NavigationDrawer.vue new file mode 100644 index 0000000000..c87fa48474 --- /dev/null +++ b/hermes-console/src/components/navigation-drawer/NavigationDrawer.vue @@ -0,0 +1,130 @@ + + + diff --git a/hermes-console/src/components/navigation-drawer/NavigationItem.vue b/hermes-console/src/components/navigation-drawer/NavigationItem.vue new file mode 100644 index 0000000000..3cdcdf4b0d --- /dev/null +++ b/hermes-console/src/components/navigation-drawer/NavigationItem.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/hermes-console/src/i18n/en-US/index.ts b/hermes-console/src/i18n/en-US/index.ts index 01ec3f08b8..c236741ee4 100644 --- a/hermes-console/src/i18n/en-US/index.ts +++ b/hermes-console/src/i18n/en-US/index.ts @@ -7,12 +7,18 @@ const en_US = { console: 'Console', favoriteTopics: 'Favorite topics', favoriteSubscriptions: 'Favorite subs', + topics: 'Topics', + subscriptions: 'Subscriptions', runtime: 'Runtime', statistics: 'Stats', search: 'Search', documentation: 'Docs', costs: 'Costs', adminTools: 'Admin tools', + favorites: 'Favorites', + readiness: 'Readiness', + constraints: 'Constraints', + consistency: 'Consistency', }, }, header: { diff --git a/hermes-console/src/store/auth/useAuthStore.ts b/hermes-console/src/store/auth/useAuthStore.ts index c49f2f1cec..4d62082972 100644 --- a/hermes-console/src/store/auth/useAuthStore.ts +++ b/hermes-console/src/store/auth/useAuthStore.ts @@ -78,8 +78,14 @@ export const useAuthStore = defineStore('auth', { }, }, getters: { - userData(state: AuthStoreState): { exp: number } { - return state.accessToken ? jwtDecode(state.accessToken) : { exp: 0 }; + userData(state: AuthStoreState): { + exp: number; + full_name: string; + user_name: string; + } { + return state.accessToken + ? jwtDecode(state.accessToken) + : { exp: 0, full_name: '', user_name: '' }; }, isUserAuthorized(state: AuthStoreState): boolean { const expiresAt = this.userData.exp * 1000;