diff --git a/software/src/data/api/mainApi.ts b/software/src/data/api/mainApi.ts index b4413a9..2371d89 100644 --- a/software/src/data/api/mainApi.ts +++ b/software/src/data/api/mainApi.ts @@ -9,4 +9,8 @@ export function getServerState() { export function resetDatabase() { return axios.get(BASE_URL + "/resetdatabase") +} + +export function resetExerciseProgress() { + return axios.get(BASE_URL + "/resetExerciseProgress") } \ No newline at end of file diff --git a/software/src/data/enums/bannerStateEnum.ts b/software/src/data/enums/bannerStateEnum.ts index 0c92816..1f26c8c 100644 --- a/software/src/data/enums/bannerStateEnum.ts +++ b/software/src/data/enums/bannerStateEnum.ts @@ -14,6 +14,9 @@ export enum BannerStateEnum { // Status: 200 OK DATABASERESETSUCCESSFUL, + // Status: 200 OK + EXERCISEPROGRESSRESETSUCCESSFUL, + ////////// API Endpoint /accounts ////////// diff --git a/software/src/locales/de.json b/software/src/locales/de.json index 254c3b7..a1cd2dd 100644 --- a/software/src/locales/de.json +++ b/software/src/locales/de.json @@ -7,7 +7,7 @@ "concert": "Konzert | Konzerte", "resetPreferences": "Einstellungen zurücksetzen", "resetDatabase": "Datenbank zurücksetzen", - "resetConfirm": { + "resetDatabaseConfirm": { "title": "Datenbank zurücksetzen?", "description": "Soll die Datenbank des Servers wirklich zurückgesetzt werden? Dies kann nicht rückgänig gemacht werden! Der Bearbeitungsfortschritt der Aufgaben wird nicht gelöscht." }, @@ -164,5 +164,9 @@ "exercise": "Aufgabe", "resetProgress": "Aufgabenfortschritt zurücksetzen", "youAreHere": "Du bist hier:", - "standingPlaces": "Stehplätze" + "standingPlaces": "Stehplätze", + "resetExerciseProgressConfirm": { + "title": "Übungsfortschritt zurücksetzen?", + "description": "Soll der Bearbeitungsfortschritt der Übungen wirklich zurückgesetzt werden? Dies kann nicht rückgänig gemacht werden!" + } } diff --git a/software/src/locales/en.json b/software/src/locales/en.json index 6e69b89..1459d37 100644 --- a/software/src/locales/en.json +++ b/software/src/locales/en.json @@ -164,5 +164,9 @@ "exercise": "Exercise", "resetProgress": "Reset Exercise Progress", "youAreHere": "You are here:", - "standingPlaces": "Standing capacity" + "standingPlaces": "Standing capacity", + "resetExerciseProgressConfirm": { + "title": "Reset Exercise progress?", + "description": "Do you really want to reset the exercise progress? This can't be undone!" + } } diff --git a/software/src/pages/events/bandDetailPage/concertSection.vue b/software/src/pages/events/bandDetailPage/concertSection.vue index 06ed563..f0b5c33 100644 --- a/software/src/pages/events/bandDetailPage/concertSection.vue +++ b/software/src/pages/events/bandDetailPage/concertSection.vue @@ -27,7 +27,7 @@ defineProps({ 0) && router.push('/concert/' + concert.id)" :link="concert.inStock > 0" :append-icon="concert.inStock == 0 ? 'mdi-minus-circle' : 'mdi-ticket'" diff --git a/software/src/pages/events/ticketOrderPage/index.vue b/software/src/pages/events/ticketOrderPage/index.vue index 9af8d9a..c52f5eb 100644 --- a/software/src/pages/events/ticketOrderPage/index.vue +++ b/software/src/pages/events/ticketOrderPage/index.vue @@ -40,7 +40,7 @@ getConcert(Number(router.currentRoute.value.params.id)) :loading="feedbackStore.fetchDataFromServerInProgress" :link="false" :title="concertModel.event.band.name + ' - ' + concertModel.event.name" - :image="concertModel.location.image" + :image="concertModel.location.imageOutdoor" > {{ dateStringToHumanReadableString(concertModel.date) }} @@ -71,7 +71,8 @@ getConcert(Number(router.currentRoute.value.params.id)) - + diff --git a/software/src/pages/system/preferencesPage/systemSetup.vue b/software/src/pages/system/preferencesPage/systemSetup.vue index 3d60e32..4485801 100644 --- a/software/src/pages/system/preferencesPage/systemSetup.vue +++ b/software/src/pages/system/preferencesPage/systemSetup.vue @@ -5,12 +5,13 @@ 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 } from '@/data/api/mainApi'; +import { getServerState, resetDatabase, resetExerciseProgress } from '@/data/api/mainApi'; import { ServerStateEnum } from '@/data/enums/serverStateEnum'; import packageJson from './../../../../package.json' const feedbackStore = useFeedbackStore() -const showConfirmDialog = ref(false) +const showConfirmDeleteDbDialog = ref(false) +const showConfirmDeleteExerciseProgressDialog = ref(false) const serverOnline = ref(ServerStateEnum.PENDING) getServerState() @@ -34,11 +35,25 @@ async function resetDb() { feedbackStore.changeBanner(BannerStateEnum.DATABASERESETSUCCESSFUL) serverOnline.value = ServerStateEnum.ONLINE } - }) - showConfirmDialog.value = false - // todo: Request all data + showConfirmDeleteDbDialog.value = false + }) } + +async function resetExerciseProg() { + serverOnline.value = ServerStateEnum.PENDING + + await resetExerciseProgress() + .then(result => { + if (result.status == 200) { + feedbackStore.changeBanner(BannerStateEnum.EXERCISEPROGRESSRESETSUCCESSFUL) + serverOnline.value = ServerStateEnum.ONLINE + } + + showConfirmDeleteExerciseProgressDialog.value = false + }) +} + @@ -75,7 +90,7 @@ async function resetDb() { {{ $t('resetProgress') }} @@ -97,11 +114,19 @@ async function resetDb() { - + + + + \ No newline at end of file
{{ dateStringToHumanReadableString(concertModel.date) }}