Skip to content

Commit

Permalink
refactor: add breadcrumbs to all remaining pages (#1026)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn authored Nov 11, 2024
1 parent cfab09c commit 831db75
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 53 deletions.
20 changes: 10 additions & 10 deletions src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ import localeManager from './i18n/localeManager.js'
/** @type {import('vue-router').RouterOptions['routes']} */
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: '/sign-in', name: 'sign-in', component: () => import('./views/SignIn.vue'), meta: { title: 'SignIn', icon: 'mdi-login', drawerMenu: true, requiresAuth: false, breadcrumbs: [{title: 'SignIn', disabled: true }] } },
{ path: '/dashboard', name: 'dashboard', component: () => import('./views/UserDashboard.vue'), meta: { title: 'Dashboard', icon: 'mdi-account-circle', 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: '/dashboard/settings', name: 'dashboard-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', requiresAuth: true }},
{ path: '/dashboard/settings', name: 'dashboard-settings', component: () => import('./views/UserSettings.vue'), meta: { title: 'Settings', requiresAuth: true, breadcrumbs: [{title: 'Settings', disabled: true }] } }, // not used anymore
{ path: '/prices/add', name: 'add-price', component: () => import('./views/AddPriceHome.vue'), meta: { title: 'AddPrice', requiresAuth: true, breadcrumbs: [{title: 'AddPrice', disabled: true }] }}, // not used anymore
{ path: '/prices/add/single', name: 'add-price-single', component: () => import('./views/AddPriceSingle.vue'), meta: { title: 'Add a single price (price tag)', requiresAuth: true, breadcrumbs: [{title: 'Experiments', disabled: false, to: '/experiments' }, {title: 'AddPriceSingle', disabled: true }] }},
{ path: '/prices/add/multiple', name: 'add-price-multiple', component: () => import('./views/AddPriceMultiple.vue'), meta: { title: 'AddPrice', icon: 'mdi-tag-plus-outline', drawerMenu: true, color: 'primary', requiresAuth: true, breadcrumbs: [{title: 'AddPriceMultiple', disabled: true }] }},
{ path: '/prices/add/multiple/price-tag', name: 'add-price-multiple-price-tag', redirect: () => { return { path: '/prices/add/multiple' }}},
{ path: '/prices/add/multiple/receipt', name: 'add-price-multiple-receipt', redirect: () => { return { path: '/prices/add/multiple' }}},
{ path: '/prices/:id', name: 'prices-detail', component: () => import('./views/PriceDetail.vue'), meta: { title: 'Price detail' }},
{ path: '/search', name: 'search', component: () => import('./views/Search.vue'), meta: { title: 'Search', icon: 'mdi-magnify', drawerMenu: true }},
{ path: '/prices', name: 'prices', component: () => import('./views/PriceList.vue'), meta: { title: 'LatestPrices', icon: 'mdi-tag-multiple-outline', drawerMenu: true }},
{ path: '/products', name: 'products', component: () => import('./views/ProductList.vue'), meta: { title: 'TopProducts', icon: 'mdi-database-outline', drawerMenu: true }},
{ path: '/search', name: 'search', component: () => import('./views/Search.vue'), meta: { title: 'Search', icon: 'mdi-magnify', drawerMenu: true, breadcrumbs: [{title: 'Search', disabled: true }] }},
{ path: '/prices', name: 'prices', component: () => import('./views/PriceList.vue'), meta: { title: 'LatestPrices', icon: 'mdi-tag-multiple-outline', drawerMenu: true, breadcrumbs: [{title: 'LatestPrices', disabled: true }] }},
{ path: '/products', name: 'products', component: () => import('./views/ProductList.vue'), meta: { title: 'TopProducts', icon: 'mdi-database-outline', drawerMenu: true, breadcrumbs: [{title: 'TopProducts', disabled: true }] }},
{ path: '/products/:id', name: 'product-detail', component: () => import('./views/ProductDetail.vue'), meta: { title: 'Product detail' }},
{ path: '/locations', name: 'locations', component: () => import('./views/LocationList.vue'), meta: { title: 'TopLocations', icon: 'mdi-map-marker-star-outline', drawerMenu: true }},
{ path: '/locations', name: 'locations', component: () => import('./views/LocationList.vue'), meta: { title: 'TopLocations', icon: 'mdi-map-marker-star-outline', drawerMenu: true, breadcrumbs: [{title: 'TopLocations', disabled: true }] }},
{ path: '/locations/:id', name: 'location-detail', component: () => import('./views/LocationDetail.vue'), meta: { title: 'Location detail' }},
{ path: '/countries/:country', name: 'country-detail', component: () => import('./views/CountryDetail.vue'), meta: { title: 'Country detail' }},
{ path: '/countries/:country/cities/:city', name: 'country-city-detail', component: () => import('./views/CountryCityDetail.vue'), meta: { title: 'City detail' }},
Expand All @@ -30,12 +30,12 @@ const routes = [
{ path: '/labels/:id', name: 'label-detail', component: () => import('./views/LabelDetail.vue'), meta: { title: 'Label detail' }},
{ path: '/proofs/add/single', name: 'proof-add', component: () => import('./views/ProofAddSingle.vue'), meta: { title: 'AddProofSingle', icon: 'mdi-image-plus', requiresAuth: true, breadcrumbs: [{title: 'Experiments', disabled: false, to: '/experiments' }, {title: 'AddProofSingle', disabled: true }] }},
{ path: '/proofs/:id', name: 'proof-detail', component: () => import('./views/ProofDetail.vue'), meta: { title: 'Proof detail', requiresAuth: true }},
{ path: '/users', name: 'users', component: () => import('./views/UserList.vue'), meta: { title: 'TopContributors', icon: 'mdi-account-star-outline', drawerMenu: true }},
{ path: '/users', name: 'users', component: () => import('./views/UserList.vue'), meta: { title: 'TopContributors', icon: 'mdi-account-star-outline', drawerMenu: true, breadcrumbs: [{title: 'TopContributors', disabled: true }] }},
{ path: '/users/:username', name: 'user-detail', component: () => import('./views/UserDetail.vue'), meta: { title: 'User detail' }},
{ path: '/experiments', name: 'experiments', component: () => import('./views/Experiments.vue'), meta: { title: 'Experiments', icon: 'mdi-test-tube', breadcrumbs: [{title: 'Experiments', disabled: true }] }},
{ path: '/stats', name: 'stats', component: () => import('./views/Stats.vue'), meta: { title: 'Stats', icon: 'mdi-chart-box-outline', drawerMenu: true }},
{ path: '/stats', name: 'stats', component: () => import('./views/Stats.vue'), meta: { title: 'Stats', icon: 'mdi-chart-box-outline', drawerMenu: true, breadcrumbs: [{title: 'Stats', disabled: true }] }},
{ path: '/settings', name: 'settings', component: () => import('./views/Settings.vue'), meta: { title: 'Settings', icon: 'mdi-cog-outline', drawerMenu: true, breadcrumbs: [{title: 'Settings', disabled: true }] }},
{ path: '/about', name: 'about', component: () => import('./views/About.vue'), meta: { title: 'About', icon: 'mdi-information-outline', drawerMenu: true }},
{ path: '/about', name: 'about', component: () => import('./views/About.vue'), meta: { title: 'About', icon: 'mdi-information-outline', drawerMenu: true, breadcrumbs: [{title: 'About', disabled: true }] }},
// Why this redirect?
// The app used to be available at https://prices.openfoodfacts.org/app
// It is now available at https://prices.openfoodfacts.org
Expand Down
6 changes: 0 additions & 6 deletions src/views/About.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<template>
<h2 class="text-h6">
{{ $t('Common.About') }}
</h2>

<br>

<v-sheet v-for="fieldset in fieldsetsGeneral" :id="fieldset.id" :key="fieldset.title" tag="section" class="mb-4 bg-background">
<i18n-t :keypath="fieldset.title" tag="h2" class="mb-1">
<template #op_name>
Expand Down
4 changes: 0 additions & 4 deletions src/views/AddPriceHome.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<template>
<h1 class="text-h5 mb-1">
{{ $t('AddPriceHome.Title') }}
</h1>

<v-row>
<v-col cols="12" sm="6" lg="4">
<v-card
Expand Down
4 changes: 0 additions & 4 deletions src/views/LocationList.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<template>
<h1 class="text-h5 mb-1">
{{ $t('LocationList.Title') }}
</h1>

<v-row v-if="!loading">
<v-col>
<v-chip label variant="text" prepend-icon="mdi-map-marker-outline">
Expand Down
4 changes: 0 additions & 4 deletions src/views/PriceList.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<template>
<h1 class="text-h5 mb-1">
{{ $t('PriceList.Title') }}
</h1>

<v-row>
<v-col v-for="price in priceList" :key="price" cols="12" sm="6" md="4" xl="3">
<PriceCard :price="price" :product="price.product" elevation="1" height="100%" />
Expand Down
4 changes: 0 additions & 4 deletions src/views/ProductList.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<template>
<h1 class="text-h5 mb-1">
{{ $t('ProductList.Title') }}
</h1>

<v-row v-if="!loading">
<v-col>
<v-chip label variant="text" prepend-icon="mdi-database-outline">
Expand Down
5 changes: 0 additions & 5 deletions src/views/Search.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<template>
<h1 class="text-h5 mb-1">
{{ $t('Search.Title') }}
<v-progress-circular v-if="loading" indeterminate :size="30" />
</h1>

<v-row>
<v-col>
<v-form @submit.prevent="search">
Expand Down
4 changes: 0 additions & 4 deletions src/views/SignIn.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<template>
<h1 class="text-h5 mb-1">
{{ $t('SignIn.Title') }}
</h1>

<v-row>
<v-col cols="12" md="6">
<v-alert
Expand Down
4 changes: 0 additions & 4 deletions src/views/Stats.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<template>
<h1 class="text-h5 mb-1">
{{ $t('Common.Stats') }}
</h1>

<h2 class="text-h6 mb-1">
<v-icon size="x-small" icon="mdi-tag-outline" />
{{ $t('Common.Prices') }}
Expand Down
4 changes: 0 additions & 4 deletions src/views/UserList.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<template>
<h1 class="text-h5 mb-1">
{{ $t('UserList.Title') }}
</h1>

<v-row v-if="!loading">
<v-col>
<v-chip label variant="text" prepend-icon="mdi-account-badge-outline">
Expand Down
4 changes: 0 additions & 4 deletions src/views/UserSettings.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<template>
<h1 class="text-h5 mb-1">
{{ $t('UserSettings.Title') }}
</h1>

<v-form @submit.prevent="updateSettings">
<v-row>
<!-- Display -->
Expand Down

0 comments on commit 831db75

Please sign in to comment.