Bugfixes, reset exercise progress from frontend
This commit is contained in:
@@ -9,4 +9,8 @@ export function getServerState() {
|
|||||||
|
|
||||||
export function resetDatabase() {
|
export function resetDatabase() {
|
||||||
return axios.get(BASE_URL + "/resetdatabase")
|
return axios.get(BASE_URL + "/resetdatabase")
|
||||||
|
}
|
||||||
|
|
||||||
|
export function resetExerciseProgress() {
|
||||||
|
return axios.get(BASE_URL + "/resetExerciseProgress")
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,9 @@ export enum BannerStateEnum {
|
|||||||
// Status: 200 OK
|
// Status: 200 OK
|
||||||
DATABASERESETSUCCESSFUL,
|
DATABASERESETSUCCESSFUL,
|
||||||
|
|
||||||
|
// Status: 200 OK
|
||||||
|
EXERCISEPROGRESSRESETSUCCESSFUL,
|
||||||
|
|
||||||
|
|
||||||
////////// API Endpoint /accounts //////////
|
////////// API Endpoint /accounts //////////
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"concert": "Konzert | Konzerte",
|
"concert": "Konzert | Konzerte",
|
||||||
"resetPreferences": "Einstellungen zurücksetzen",
|
"resetPreferences": "Einstellungen zurücksetzen",
|
||||||
"resetDatabase": "Datenbank zurücksetzen",
|
"resetDatabase": "Datenbank zurücksetzen",
|
||||||
"resetConfirm": {
|
"resetDatabaseConfirm": {
|
||||||
"title": "Datenbank zurücksetzen?",
|
"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."
|
"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",
|
"exercise": "Aufgabe",
|
||||||
"resetProgress": "Aufgabenfortschritt zurücksetzen",
|
"resetProgress": "Aufgabenfortschritt zurücksetzen",
|
||||||
"youAreHere": "Du bist hier:",
|
"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!"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,5 +164,9 @@
|
|||||||
"exercise": "Exercise",
|
"exercise": "Exercise",
|
||||||
"resetProgress": "Reset Exercise Progress",
|
"resetProgress": "Reset Exercise Progress",
|
||||||
"youAreHere": "You are here:",
|
"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!"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ defineProps({
|
|||||||
<v-col>
|
<v-col>
|
||||||
<concert-list-item
|
<concert-list-item
|
||||||
:title="dateStringToHumanReadableString(concert.date)"
|
:title="dateStringToHumanReadableString(concert.date)"
|
||||||
:image="concert.location.image"
|
:image="concert.location.imageOutdoor"
|
||||||
@click="(concert.inStock > 0) && router.push('/concert/' + concert.id)"
|
@click="(concert.inStock > 0) && router.push('/concert/' + concert.id)"
|
||||||
:link="concert.inStock > 0"
|
:link="concert.inStock > 0"
|
||||||
:append-icon="concert.inStock == 0 ? 'mdi-minus-circle' : 'mdi-ticket'"
|
:append-icon="concert.inStock == 0 ? 'mdi-minus-circle' : 'mdi-ticket'"
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ getConcert(Number(router.currentRoute.value.params.id))
|
|||||||
:loading="feedbackStore.fetchDataFromServerInProgress"
|
:loading="feedbackStore.fetchDataFromServerInProgress"
|
||||||
:link="false"
|
:link="false"
|
||||||
:title="concertModel.event.band.name + ' - ' + concertModel.event.name"
|
:title="concertModel.event.band.name + ' - ' + concertModel.event.name"
|
||||||
:image="concertModel.location.image"
|
:image="concertModel.location.imageOutdoor"
|
||||||
>
|
>
|
||||||
<template #description>
|
<template #description>
|
||||||
<p>{{ dateStringToHumanReadableString(concertModel.date) }}</p>
|
<p>{{ dateStringToHumanReadableString(concertModel.date) }}</p>
|
||||||
@@ -71,7 +71,8 @@ getConcert(Number(router.currentRoute.value.params.id))
|
|||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col v-else>
|
<v-col v-else>
|
||||||
<seat-plan-map :concert="concertModel" :seat-groups="seatGroups" />
|
<seat-plan-map
|
||||||
|
:concert="concertModel" :seat-groups="seatGroups" :location="concertModel.location" />
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
|
|||||||
@@ -5,12 +5,13 @@ import cardView from '@/components/basics/cardView.vue';
|
|||||||
import outlinedButton from '@/components/basics/outlinedButton.vue';
|
import outlinedButton from '@/components/basics/outlinedButton.vue';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import confirmDialog from '@/components/basics/confirmDialog.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 { ServerStateEnum } from '@/data/enums/serverStateEnum';
|
||||||
import packageJson from './../../../../package.json'
|
import packageJson from './../../../../package.json'
|
||||||
|
|
||||||
const feedbackStore = useFeedbackStore()
|
const feedbackStore = useFeedbackStore()
|
||||||
const showConfirmDialog = ref(false)
|
const showConfirmDeleteDbDialog = ref(false)
|
||||||
|
const showConfirmDeleteExerciseProgressDialog = ref(false)
|
||||||
const serverOnline = ref(ServerStateEnum.PENDING)
|
const serverOnline = ref(ServerStateEnum.PENDING)
|
||||||
|
|
||||||
getServerState()
|
getServerState()
|
||||||
@@ -34,11 +35,25 @@ async function resetDb() {
|
|||||||
feedbackStore.changeBanner(BannerStateEnum.DATABASERESETSUCCESSFUL)
|
feedbackStore.changeBanner(BannerStateEnum.DATABASERESETSUCCESSFUL)
|
||||||
serverOnline.value = ServerStateEnum.ONLINE
|
serverOnline.value = ServerStateEnum.ONLINE
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
showConfirmDialog.value = false
|
showConfirmDeleteDbDialog.value = false
|
||||||
// todo: Request all data
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -75,7 +90,7 @@ async function resetDb() {
|
|||||||
<v-row>
|
<v-row>
|
||||||
<v-col class="d-flex justify-center align-center">
|
<v-col class="d-flex justify-center align-center">
|
||||||
<outlined-button
|
<outlined-button
|
||||||
@click="showConfirmDialog = true"
|
@click="showConfirmDeleteDbDialog = true"
|
||||||
prepend-icon="mdi-database-refresh"
|
prepend-icon="mdi-database-refresh"
|
||||||
color="red"
|
color="red"
|
||||||
:disabled="serverOnline != ServerStateEnum.ONLINE"
|
:disabled="serverOnline != ServerStateEnum.ONLINE"
|
||||||
@@ -88,8 +103,10 @@ async function resetDb() {
|
|||||||
<v-row>
|
<v-row>
|
||||||
<v-col class="d-flex justify-center align-center">
|
<v-col class="d-flex justify-center align-center">
|
||||||
<outlined-button
|
<outlined-button
|
||||||
|
@click="showConfirmDeleteExerciseProgressDialog = true"
|
||||||
prepend-icon="mdi-progress-close"
|
prepend-icon="mdi-progress-close"
|
||||||
color="red"
|
color="red"
|
||||||
|
:disabled="serverOnline != ServerStateEnum.ONLINE"
|
||||||
>
|
>
|
||||||
{{ $t('resetProgress') }}
|
{{ $t('resetProgress') }}
|
||||||
</outlined-button>
|
</outlined-button>
|
||||||
@@ -97,11 +114,19 @@ async function resetDb() {
|
|||||||
</v-row>
|
</v-row>
|
||||||
</card-view>
|
</card-view>
|
||||||
|
|
||||||
|
<!-- Confirm delete database -->
|
||||||
<confirm-dialog
|
<confirm-dialog
|
||||||
:title="$t('resetDatabaseConfirm.title')"
|
:title="$t('resetDatabaseConfirm.title')"
|
||||||
:description="$t('resetDatabaseConfirm.description')"
|
:description="$t('resetDatabaseConfirm.description')"
|
||||||
v-model="showConfirmDialog"
|
v-model="showConfirmDeleteDbDialog"
|
||||||
:onConfirm="resetDb"
|
:onConfirm="resetDb"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- Confirm delete exercise progress -->
|
||||||
|
<confirm-dialog
|
||||||
|
:title="$t('resetExerciseProgressConfirm.title')"
|
||||||
|
:description="$t('resetExerciseProgressConfirm.description')"
|
||||||
|
v-model="showConfirmDeleteExerciseProgressDialog"
|
||||||
|
:onConfirm="resetExerciseProg"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
Reference in New Issue
Block a user