Move Navigation from NavDrawer to AppBar, redesign page structure and routes

This commit is contained in:
2024-09-27 13:08:43 +02:00
parent 941fd711d5
commit e3863058a0
38 changed files with 184 additions and 92 deletions

View File

@@ -105,7 +105,7 @@ The application host it's data in a SQLite database. The access is managed by an
<details open> <details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/shows/:id</b></code> <code> (Get all information about one show)</code> <summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/shows/:id</b></code> <code> (Get all information about one show)</code>
</summary> </summary>
@@ -122,7 +122,7 @@ The application host it's data in a SQLite database. The access is managed by an
<details open> <details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/tours</b></code> <code> (Get all tours)</code> <summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/tours</b></code> <code> (Get all tours)</code>
</summary> </summary>
@@ -136,7 +136,7 @@ The application host it's data in a SQLite database. The access is managed by an
</details> </details>
<details open> <details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/genres</b></code> <code> (Get all genres)</code> <summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/genres</b></code> <code> (Get all genres)</code>
</summary> </summary>
@@ -151,7 +151,7 @@ The application host it's data in a SQLite database. The access is managed by an
<details open> <details>
<summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/locations</b></code> <code> (Get all locations)</code> <summary><code><span style="color:#70AFFD"><b>GET</b></span></code> <code><b>/locations</b></code> <code> (Get all locations)</code>
</summary> </summary>
@@ -236,23 +236,6 @@ The application host it's data in a SQLite database. The access is managed by an
</details> </details>
<details>
<summary><code><span style="color:#69CA92"><b>POST</b></span></code> <code><b>/products/</b></code> <code> (Create a new product)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | None | required | object (JSON) | Model of a Product |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `201` | `application/json` | `ProductModel` |
> | `400` | `application/json` | `{code: 400, message: "..."}` |
</details>
<details> <details>
<summary><code><span style="color:#69CA92"><b>POST</b></span></code> <code><b>/orders/</b></code> <code> (Create a new order)</code> <summary><code><span style="color:#69CA92"><b>POST</b></span></code> <code><b>/orders/</b></code> <code> (Create a new order)</code>
</summary> </summary>
@@ -268,23 +251,6 @@ The application host it's data in a SQLite database. The access is managed by an
> | `201` | `application/json` | `OrderModel` | > | `201` | `application/json` | `OrderModel` |
</details> </details>
<details>
<summary><code><span style="color:#69CA92"><b>POST</b></span></code> <code><b>/categories/</b></code> <code> (Create a new category)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | None | required | object (JSON) | Model of a Category |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `201` | `application/json` | `OrderModel` |
> | `400` | `application/json` | `{code: 400, message: "..."}` |
</details>
--- ---
#### Updating existing #### Updating existing
@@ -309,7 +275,7 @@ The application host it's data in a SQLite database. The access is managed by an
#### Delete existing #### Delete existing
<details> <!-- <details>
<summary><code><span style="color:#EB5246"><b>DELETE</b></span></code> <code><b>/product/:id</b></code> <code> (Delete a product)</code> <summary><code><span style="color:#EB5246"><b>DELETE</b></span></code> <code><b>/product/:id</b></code> <code> (Delete a product)</code>
</summary> </summary>
@@ -323,23 +289,7 @@ The application host it's data in a SQLite database. The access is managed by an
> | :---: | --- | --- | > | :---: | --- | --- |
> | `200` | `application/json` | `ProductModel` | > | `200` | `application/json` | `ProductModel` |
> | `400` | `application/json` | `{code: 400, message: "..."}` | > | `400` | `application/json` | `{code: 400, message: "..."}` |
</details> </details> -->
<details>
<summary><code><span style="color:#EB5246"><b>DELETE</b></span></code> <code><b>/categories/:id</b></code> <code> (Delete a category)</code>
</summary>
##### Parameters
> | name | type | data type | description |
> | :---: | --- | --- | --- |
> | `id` | required | string | ID of category in the database |
##### Responses
> | http code | content-type | response |
> | :---: | --- | --- |
> | `200` | `application/json` | `CategoryModel` |
> | `400` | `application/json` | `{code: 400, message: "..."}` |
</details>
--- ---

View File

@@ -1,9 +1,9 @@
<script setup lang="ts"> <script setup lang="ts">
import { useTheme } from 'vuetify/lib/framework.mjs'; import { useTheme } from 'vuetify/lib/framework.mjs';
import { i18n } from './plugins/i18n'; import { i18n } from './plugins/i18n';
import { ref, watch } from 'vue'; import { watch } from 'vue';
import vuetify from './plugins/vuetify'; import navigationAppendItems from './components/navigation/navigationAppendItems.vue';
import navigationItems from './components/navigationItems.vue'; import navigationPrependItems from './components/navigation/navigationPrependItems.vue';
import { usePreferencesStore } from './data/stores/preferencesStore'; import { usePreferencesStore } from './data/stores/preferencesStore';
import { useFeedbackStore } from './data/stores/feedbackStore'; import { useFeedbackStore } from './data/stores/feedbackStore';
import { useTourStore } from './data/stores/tourStore'; import { useTourStore } from './data/stores/tourStore';
@@ -11,8 +11,8 @@ import { useTourStore } from './data/stores/tourStore';
const preferencesStore = usePreferencesStore() const preferencesStore = usePreferencesStore()
const tourStore = useTourStore() const tourStore = useTourStore()
const feedbackStore = useFeedbackStore() const feedbackStore = useFeedbackStore()
const theme = useTheme() const theme = useTheme()
const navRail = ref(vuetify.display.mobile)
theme.global.name.value = preferencesStore.theme theme.global.name.value = preferencesStore.theme
@@ -26,15 +26,20 @@ watch(() => preferencesStore.language, () => {
<template> <template>
<v-app> <v-app>
<v-app-bar> <v-app-bar
<v-app-bar-nav-icon @click="navRail = !navRail" /> height="80"
color="primary"
class="px-5"
>
<template #prepend>
<navigation-prepend-items />
</template>
<v-app-bar-title>HackMyCart</v-app-bar-title> <template #append>
<navigation-append-items />
</template>
</v-app-bar> </v-app-bar>
<v-navigation-drawer :rail="navRail" permanent>
<navigation-items v-model:nav-rail="navRail" />
</v-navigation-drawer>
<v-main> <v-main>
<!-- Snackbar in the top right corner for user feedback --> <!-- Snackbar in the top right corner for user feedback -->
@@ -58,7 +63,9 @@ watch(() => preferencesStore.language, () => {
</v-snackbar> </v-snackbar>
<!-- Here changes the router the content --> <!-- Here changes the router the content -->
<v-container max-width="1200">
<router-view></router-view> <router-view></router-view>
</v-container>
</v-main> </v-main>
</v-app> </v-app>
</template> </template>

View File

@@ -0,0 +1,29 @@
<script setup lang="ts">
import { useAccountStore } from '@/data/stores/accountStore';
import router from '@/plugins/router';
const accountStore = useAccountStore()
function startSearch() {
// todo
router.push("/shows/search")
}
</script>
<template>
<v-text-field
variant="outlined"
append-inner-icon="mdi-magnify"
density="compact"
class="mt-5 mr-5"
@click:append-inner="startSearch"
width="400"
/>
<v-btn v-if="accountStore.userAccount.id == 0" variant="plain" icon="mdi-account" to="/account/login" />
<v-btn v-else variant="plain" icon="mdi-account" to="/account/home" />
<v-btn variant="plain" icon="mdi-cart" to="/basket" />
<v-btn variant="plain" icon="mdi-help" to="/system/help" />
<v-btn variant="plain" icon="mdi-cog" to="/system/preferences"/>
</template>

View File

@@ -0,0 +1,48 @@
<script setup lang="ts">
</script>
<template>
<v-app-bar-title class="pr-5">
<!-- todo: Brand logo -->
<v-btn variant="plain" to="/" flat>HackMyCart</v-btn>
</v-app-bar-title>
<v-divider vertical />
<v-btn
to="/shows/events"
prepend-icon="mdi-ticket"
height="100%"
:rounded="false"
>
{{ $t('menu.shopping.allEvents', 2) }}
</v-btn>
<v-divider vertical />
<v-btn
variant="text"
to="/shows/locations"
prepend-icon="mdi-city"
height="100%"
:rounded="false"
>
{{ $t('menu.shopping.allLocations', 2) }}
</v-btn>
<v-divider vertical />
<v-btn
variant="text"
to="/shows/genres"
prepend-icon="mdi-music-clef-treble"
height="100%"
:rounded="false"
>
{{ $t('menu.shopping.allGenres', 2) }}
</v-btn>
<v-divider vertical />
</template>

View File

@@ -1,8 +1,9 @@
{ {
"menu": { "menu": {
"shopping": { "shopping": {
"shopping": "Einkaufen", "allEvents": "Alle Events",
"ticket": "Ticket | Tickets", "allLocations": "Alle Orte",
"allGenres": "Alle Genres",
"basket": "Warenkorb" "basket": "Warenkorb"
}, },
"account": { "account": {

View File

@@ -1,8 +1,9 @@
{ {
"menu": { "menu": {
"shopping": { "shopping": {
"shopping": "Shopping", "allEvents": "All Events",
"ticket": "Ticket | Tickets", "allLocations": "All Locations",
"allGenres": "All Genres",
"basket": "Basket" "basket": "Basket"
}, },
"account": { "account": {

View File

@@ -1,5 +1,4 @@
<script setup lang="ts"> <script setup lang="ts">
import alertBanner from '@/components/alertBanner.vue';
import accountDataCard from './accountDataCard.vue'; import accountDataCard from './accountDataCard.vue';
import accountManagingCard from './accountManagingCard.vue'; import accountManagingCard from './accountManagingCard.vue';
import addressesCard from './addressesCard.vue'; import addressesCard from './addressesCard.vue';

View File

@@ -0,0 +1,10 @@
<script setup lang="ts">
</script>
<template>
Account Home
<v-btn to="/account/edit" >Account Data</v-btn>
<v-btn to="/account/orders" >Orders</v-btn>
</template>

View File

@@ -2,5 +2,5 @@
</script> </script>
<template> <template>
Help Home
</template> </template>

View File

@@ -0,0 +1,6 @@
<script setup lang="ts">
</script>
<template>
Events
</template>

View File

@@ -0,0 +1,6 @@
<script setup lang="ts">
</script>
<template>
Genres
</template>

View File

@@ -0,0 +1,6 @@
<script setup lang="ts">
</script>
<template>
Locations
</template>

View File

@@ -0,0 +1,6 @@
<script setup lang="ts">
</script>
<template>
Search
</template>

View File

@@ -30,7 +30,7 @@ const vuetify = createVuetify({
darkBlue: { darkBlue: {
dark: true, dark: true,
colors: { colors: {
primary: colors.blue.darken1, primary: colors.blue.darken4,
secondary: colors.blue.lighten2 secondary: colors.blue.lighten2
} }
}, },

View File

@@ -0,0 +1,11 @@
import AccountHomePage from "@/pages/account/accountHomePage/index.vue";
import AccountDataPage from "@/pages/account/accountDataPage/index.vue";
import OrdersPage from "@/pages/account/ordersPage/index.vue";
import LoginPage from "@/pages/account/loginPage/index.vue"
export const accountRoutes = [
{ path: '/account/home', component: AccountHomePage },
{ path: '/account/login', component: LoginPage },
{ path: '/account/edit', component: AccountDataPage },
{ path: '/account/orders', component: OrdersPage },
]

View File

@@ -4,7 +4,7 @@ import AccountsPage from "@/pages/admin/accountsPage/index.vue"
import ProductsPage from "@/pages/admin/productsPage/index.vue" import ProductsPage from "@/pages/admin/productsPage/index.vue"
import BrandsPage from "@/pages/admin/brandsPage/index.vue" import BrandsPage from "@/pages/admin/brandsPage/index.vue"
export default [ export const adminRoutes = [
{ {
path: '/admin/dashboard', path: '/admin/dashboard',
component: DashboardPage component: DashboardPage

View File

@@ -1,23 +1,17 @@
import AccountPage from "@/pages/accountPage/index.vue";
import OrdersPage from "@/pages/ordersPage/index.vue";
import PreferencesPage from "@/pages/preferencesPage/index.vue";
import TourPage from "@/pages/toursPage/index.vue";
import LoginPage from "@/pages/loginPage/index.vue"
import BasketPage from "@/pages/basketPage/index.vue" import BasketPage from "@/pages/basketPage/index.vue"
import HelpPage from "@/pages/helpPage/index.vue" import HomePage from "@/pages/homePage/index.vue"
import ScoreBoardPage from "@/pages/scoreBoardPage/index.vue" import { adminRoutes } from "./admin.routes";
import adminRoutes from "./admin.routes"; import { accountRoutes } from "./account.routes";
import { showRoutes } from "./show.routes";
import { systemRoutes } from "./system.routes";
const routes = [ const routes = [
{ path: '/', component: TourPage }, { path: "/", component: HomePage },
{ path: '/account', component: AccountPage },
{ path: '/orders', component: OrdersPage },
{ path: '/preferences', component: PreferencesPage },
{ path: '/login', component: LoginPage },
{ path: '/basket', component: BasketPage }, { path: '/basket', component: BasketPage },
{ path: '/scoreboard', component: ScoreBoardPage }, ...showRoutes,
{ path: '/help', component: HelpPage }, ...accountRoutes,
...adminRoutes ...adminRoutes,
...systemRoutes
] ]
export default routes export default routes

View File

@@ -0,0 +1,11 @@
import EventsPage from "@/pages/shows/eventsPage/index.vue";
import GenresPage from "@/pages/shows/genresPage/index.vue";
import LocationsPage from "@/pages/shows/locationsPage/index.vue"
import SearchPage from "@/pages/shows/searchPage/index.vue"
export const showRoutes = [
{ path: '/shows/events', component: EventsPage },
{ path: '/shows/genres', component: GenresPage },
{ path: '/shows/locations', component: LocationsPage },
{ path: '/shows/search', component: SearchPage },
]

View File

@@ -0,0 +1,7 @@
import PreferencesPage from "@/pages/system/preferencesPage/index.vue";
import HelpPage from "@/pages/system/helpPage/index.vue"
export const systemRoutes = [
{ path: '/system/preferences', component: PreferencesPage },
{ path: '/system/help', component: HelpPage }
]