Streamlined stores
This commit is contained in:
@@ -26,7 +26,6 @@ async function doOrder() {
|
||||
}
|
||||
|
||||
if (basketStore.usedAddress != null && basketStore.usedPayment != null) {
|
||||
|
||||
await basketStore.takeOrder()
|
||||
showDialog.value = false
|
||||
}
|
||||
|
||||
@@ -2,24 +2,21 @@
|
||||
import { getAllExerciseGroups } from '@/data/api/exerciseApi';
|
||||
import scoreCard from './scoreCard.vue';
|
||||
import { ref } from 'vue';
|
||||
import { useFeedbackStore } from '@/stores/feedbackStore';
|
||||
import { ExerciseGroupApiModel } from '@/data/models/exercises/exerciseGroupApiModel';
|
||||
import { usePreferencesStore } from '@/stores/preferences.store';
|
||||
|
||||
const exerciseGroups = ref<Array<ExerciseGroupApiModel>>([])
|
||||
const feedbackStore = useFeedbackStore()
|
||||
|
||||
feedbackStore.fetchDataFromServerInProgress = true
|
||||
const preferencesStore = usePreferencesStore()
|
||||
|
||||
getAllExerciseGroups()
|
||||
.then(result => {
|
||||
exerciseGroups.value = result.data
|
||||
feedbackStore.fetchDataFromServerInProgress = false
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<v-container max-width="1000">
|
||||
<v-row v-if="feedbackStore.fetchDataFromServerInProgress" v-for="i in 3">
|
||||
<v-row v-if="preferencesStore.fetchInProgress" v-for="i in 3">
|
||||
<v-col>
|
||||
<score-card :loading="true"
|
||||
/>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ThemeEnum } from '@/data/enums/themeEnums';
|
||||
import { useTheme } from 'vuetify/lib/framework.mjs';
|
||||
import { i18n } from '@/plugins/i18n';
|
||||
import cardView from '@/components/basics/cardView.vue';
|
||||
import { usePreferencesStore } from '@/stores/preferencesStore';
|
||||
import { usePreferencesStore } from '@/stores/preferences.store';
|
||||
|
||||
const preferencesStore = usePreferencesStore()
|
||||
const theme = useTheme()
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { BannerStateEnum } from '@/data/enums/bannerStateEnum';
|
||||
import { useFeedbackStore } from '@/stores/feedbackStore';
|
||||
import { useFeedbackStore } from '@/stores/feedback.store';
|
||||
import cardView from '@/components/basics/cardView.vue';
|
||||
import outlinedButton from '@/components/basics/outlinedButton.vue';
|
||||
import { ref } from 'vue';
|
||||
import confirmDialog from '@/components/basics/confirmDialog.vue';
|
||||
import { getServerState, resetDatabase, resetExerciseProgress } from '@/data/api/mainApi';
|
||||
import { fetchServerState, resetDatabase, resetExerciseProgress } from '@/data/api/mainApi';
|
||||
import { ServerStateEnum } from '@/data/enums/serverStateEnum';
|
||||
import packageJson from './../../../../package.json'
|
||||
|
||||
@@ -14,7 +14,7 @@ const showConfirmDeleteDbDialog = ref(false)
|
||||
const showConfirmDeleteExerciseProgressDialog = ref(false)
|
||||
const serverOnline = ref(ServerStateEnum.PENDING)
|
||||
|
||||
getServerState()
|
||||
fetchServerState()
|
||||
.then(result => {
|
||||
if (result.status == 200) {
|
||||
serverOnline.value = ServerStateEnum.ONLINE
|
||||
|
||||
@@ -5,7 +5,8 @@ import cardViewHorizontal from '@/components/basics/cardViewHorizontal.vue';
|
||||
import locationListItem from '@/components/pageParts/locationListItem.vue';
|
||||
import cardViewTopImage from '@/components/basics/cardViewTopImage.vue';
|
||||
import bandListItem from '@/components/pageParts/bandListItem.vue';
|
||||
import { useSearchStore } from '@/stores/searchStore';
|
||||
import { useSearchStore } from '@/stores/search.store';
|
||||
import ConcertListItem from '@/components/pageParts/concertListItem.vue';
|
||||
|
||||
const searchStore = useSearchStore()
|
||||
</script>
|
||||
@@ -30,7 +31,7 @@ const searchStore = useSearchStore()
|
||||
</v-row>
|
||||
|
||||
<v-row
|
||||
v-if="searchStore.searchInProgress"
|
||||
v-if="searchStore.fetchInProgress"
|
||||
v-for="i in 2"
|
||||
>
|
||||
<v-col>
|
||||
@@ -46,7 +47,7 @@ const searchStore = useSearchStore()
|
||||
:band="band"
|
||||
:concerts="band.concerts"
|
||||
:genres="band.genres"
|
||||
:loading="searchStore.searchInProgress"
|
||||
:loading="searchStore.fetchInProgress"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -62,6 +63,46 @@ const searchStore = useSearchStore()
|
||||
|
||||
|
||||
|
||||
<!-- Section Concert results -->
|
||||
<v-row>
|
||||
<v-col>
|
||||
<section-divider :title="$t('event', 2)" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row
|
||||
v-if="searchStore.fetchInProgress"
|
||||
v-for="i in 2"
|
||||
>
|
||||
<v-col>
|
||||
<card-view-horizontal :loading="true" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row
|
||||
v-else-if="searchStore.concerts.length > 0"
|
||||
v-for="concert in searchStore.concerts"
|
||||
>
|
||||
<v-col>
|
||||
<concert-list-item
|
||||
:concert="concert"
|
||||
:band="concert.band"
|
||||
:location="concert.location"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row v-else >
|
||||
<v-col>
|
||||
<v-empty-state
|
||||
:title="$t('noEventsFound')"
|
||||
icon="mdi-party-popper"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
|
||||
|
||||
<!-- Section Location results -->
|
||||
<v-row>
|
||||
<v-col>
|
||||
@@ -70,7 +111,7 @@ const searchStore = useSearchStore()
|
||||
</v-row>
|
||||
|
||||
<v-row
|
||||
v-if="searchStore.searchInProgress"
|
||||
v-if="searchStore.fetchInProgress"
|
||||
>
|
||||
<v-col v-for="i in 4">
|
||||
<card-view-top-image :loading="true" />
|
||||
@@ -82,11 +123,11 @@ const searchStore = useSearchStore()
|
||||
>
|
||||
<v-col
|
||||
cols="3"
|
||||
v-for="locaiton in searchStore.locations"
|
||||
v-for="location in searchStore.locations"
|
||||
>
|
||||
<location-list-item
|
||||
:location="locaiton"
|
||||
:concerts="locaiton.concerts"
|
||||
:location="location"
|
||||
:nr-of-concerts="location.concerts.length"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -99,49 +140,7 @@ const searchStore = useSearchStore()
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
|
||||
|
||||
<!-- Section Event results -->
|
||||
<v-row>
|
||||
<v-col>
|
||||
<section-divider :title="$t('event', 2)" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row
|
||||
v-if="searchStore.searchInProgress"
|
||||
v-for="i in 2"
|
||||
>
|
||||
<v-col>
|
||||
<card-view-horizontal :loading="true" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!-- <v-row
|
||||
v-else-if="searchStore.events.length > 0"
|
||||
v-for="event in searchStore.events"
|
||||
>
|
||||
<v-col>
|
||||
<event-list-item
|
||||
:event="event"
|
||||
:band="event.band"
|
||||
:concerts="event.concerts"
|
||||
:loading="searchStore.searchInProgress"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row> -->
|
||||
|
||||
<v-row v-else >
|
||||
<v-col>
|
||||
<v-empty-state
|
||||
:title="$t('noEventsFound')"
|
||||
icon="mdi-party-popper"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
|
||||
</v-col>
|
||||
|
||||
<v-spacer />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import cardView from '@/components/basics/cardView.vue';
|
||||
import { useSearchStore } from '@/stores/searchStore';
|
||||
import { useSearchStore } from '@/stores/search.store';
|
||||
|
||||
const searchStore = useSearchStore()
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user