diff --git a/frontend/package.json b/frontend/package.json index af54d4be1..49a4c7a43 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -34,6 +34,7 @@ "vuetify": "^3.6.12" }, "devDependencies": { + "@module-federation/vite": "^1.1.3", "@vitejs/plugin-basic-ssl": "^1.1.0", "@vitejs/plugin-vue": "^5.0.5", "eslint": "^9.6.0", diff --git a/frontend/src/components/shared/UserMenu.vue b/frontend/src/components/shared/UserMenu.vue new file mode 100644 index 000000000..c44db702b --- /dev/null +++ b/frontend/src/components/shared/UserMenu.vue @@ -0,0 +1,58 @@ + + + {{ userInitials }} + + + + + + {{ userInitials }} + + + + + + + + + + Account + + + + + + Logout + + + + + + + + + diff --git a/frontend/src/layouts/dashboard/NavBar.vue b/frontend/src/layouts/dashboard/NavBar.vue index 77706a082..ee78dd28b 100644 --- a/frontend/src/layouts/dashboard/NavBar.vue +++ b/frontend/src/layouts/dashboard/NavBar.vue @@ -62,50 +62,50 @@ - - - - - - {{ userInitials }} - - - {{ displayName }} - mdi-chevron-up - - - - - - - - - - {{ item.text }} - - - + @@ -118,6 +118,14 @@ import { getActivePinia } from 'pinia' import { useGlobalStore, useAuthStore, useParametersStore } from '@/stores' import parametersApi from '@/api/parameters' +const props = defineProps({ + menuItems: { + type: Array, + required: false, + default: null, + }, +}) + const globalStore = useGlobalStore() const authStore = useAuthStore() const parametersStore = useParametersStore() @@ -155,6 +163,9 @@ const displayName = computed(() => { }) const menuItems = computed(() => { + if (props.menuItems) { + return props.menuItems + } if (route.meta.layout === 'account') { return getUserSettingsMenuItems() } diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index 580a49303..0fdfa2e90 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -26,7 +26,7 @@ const routes = [ { path: '', name: 'Dashboard', - component: () => import('@/views/Dashboard.vue'), + component: () => import('@/views/DashboardView.vue'), meta: { requiresAuth: true, }, diff --git a/frontend/src/stores/auth.store.js b/frontend/src/stores/auth.store.js index 760c90574..02fc2b05e 100644 --- a/frontend/src/stores/auth.store.js +++ b/frontend/src/stores/auth.store.js @@ -1,7 +1,7 @@ import Cookies from 'js-cookie' import { defineStore } from 'pinia' -import { computed, ref } from 'vue' +import { computed, inject, ref } from 'vue' import gettext from '@/plugins/gettext' import router from '@/router/index.js' import { UserManager } from 'oidc-client-ts' diff --git a/frontend/src/views/Dashboard.vue b/frontend/src/views/DashboardView.vue similarity index 100% rename from frontend/src/views/Dashboard.vue rename to frontend/src/views/DashboardView.vue diff --git a/frontend/src/views/login/LoginCallbackView.vue b/frontend/src/views/login/LoginCallbackView.vue index 15610962c..f4af780ac 100644 --- a/frontend/src/views/login/LoginCallbackView.vue +++ b/frontend/src/views/login/LoginCallbackView.vue @@ -1,6 +1,7 @@ -