From 58065a8ff55df76a8dd27e04623c5b7b43348412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Odini?= Date: Fri, 4 Oct 2024 11:27:38 +0200 Subject: [PATCH] feat(Dashboard): first basic breadcrumb for user dashboard pages (#927) --- src/App.vue | 3 +++ src/components/Breadcrumbs.vue | 17 +++++++++++++++++ src/i18n/locales/en.json | 6 ++++++ src/router.js | 7 +++---- src/views/UserDashboard.vue | 4 ---- src/views/UserDashboardPriceList.vue | 7 ------- src/views/UserDashboardProofList.vue | 7 ------- 7 files changed, 29 insertions(+), 22 deletions(-) create mode 100644 src/components/Breadcrumbs.vue diff --git a/src/App.vue b/src/App.vue index 75882202936..f958cd28d50 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,6 +4,7 @@ + @@ -16,11 +17,13 @@ import { defineComponent } from 'vue' import Header from './components/Header.vue' import Footer from './components/Footer.vue' +import Breadcrumbs from './components/Breadcrumbs.vue'; export default defineComponent({ components: { Header, Footer, + Breadcrumbs, }, }) diff --git a/src/components/Breadcrumbs.vue b/src/components/Breadcrumbs.vue new file mode 100644 index 00000000000..a438b6ac9a6 --- /dev/null +++ b/src/components/Breadcrumbs.vue @@ -0,0 +1,17 @@ + + + diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index fa503af707a..91fa1217d4e 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -438,6 +438,12 @@ "LatestPrices": { "Title": "Latest prices" }, + "MyPrices": { + "Title": "My prices" + }, + "MyProofs": { + "Title": "My proofs" + }, "ProofAddSingle": { "Title": "Add a proof" }, diff --git a/src/router.js b/src/router.js index f316caec2b1..de1dc52c15c 100644 --- a/src/router.js +++ b/src/router.js @@ -6,9 +6,9 @@ import localeManager from './i18n/localeManager.js' const routes = [ { path: '/', name: 'home', component: () => import('./views/Home.vue'), meta: { title: 'Home', icon: 'mdi-home', drawerMenu: true } }, { path: '/sign-in', name: 'sign-in', component: () => import('./views/SignIn.vue'), meta: { title: 'SignIn', icon: 'mdi-login', drawerMenu: true, requiresAuth: false } }, - { path: '/dashboard', name: 'dashboard', component: () => import('./views/UserDashboard.vue'), meta: { title: 'Dashboard', icon: 'mdi-view-dashboard-outline', drawerMenu: true, requiresAuth: true } }, - { path: '/dashboard/prices', name: 'dashboard-prices', component: () => import('./views/UserDashboardPriceList.vue'), meta: { title: 'MyPrices', requiresAuth: true } }, - { path: '/dashboard/proofs', name: 'dashboard-proofs', component: () => import('./views/UserDashboardProofList.vue'), meta: { title: 'MyProofs', requiresAuth: true } }, + { path: '/dashboard', name: 'dashboard', component: () => import('./views/UserDashboard.vue'), meta: { title: 'Dashboard', icon: 'mdi-view-dashboard-outline', drawerMenu: true, requiresAuth: true, breadcrumbs: [{title: 'Dashboard', disabled: true }] } }, + { path: '/dashboard/prices', name: 'dashboard-prices', component: () => import('./views/UserDashboardPriceList.vue'), meta: { title: 'MyPrices', requiresAuth: true, breadcrumbs: [{title: 'Dashboard', disabled: false, to: '/dashboard' }, {title: 'MyPrices', disabled: true}] } }, + { path: '/dashboard/proofs', name: 'dashboard-proofs', component: () => import('./views/UserDashboardProofList.vue'), meta: { title: 'MyProofs', requiresAuth: true, breadcrumbs: [{title: 'Dashboard', disabled: false, to: '/dashboard' }, {title: 'MyProofs', disabled: true}] } }, { path: '/settings', name: 'settings', component: () => import('./views/UserSettings.vue'), meta: { title: 'Settings', requiresAuth: true } }, { path: '/prices/add', name: 'add-price', component: () => import('./views/AddPriceHome.vue'), meta: { title: 'AddPrice', icon: 'mdi-tag-plus-outline', drawerMenu: true, color: 'primary', requiresAuth: true }}, { path: '/prices/add/single', name: 'add-price-single', component: () => import('./views/AddPriceSingle.vue'), meta: { title: 'Add a single price (price tag)', requiresAuth: true }}, @@ -58,7 +58,6 @@ const router = createRouter({ await localeManager.changeLanguage(locale) } if (to.meta.requiresAuth && !store.user.token) { - console.log('checkAuth') return next({ name: 'sign-in' }) } diff --git a/src/views/UserDashboard.vue b/src/views/UserDashboard.vue index ab3346ea15c..a525c586b57 100644 --- a/src/views/UserDashboard.vue +++ b/src/views/UserDashboard.vue @@ -1,8 +1,4 @@