Global color schema, remove name and register number access in preferences, add alert in first startup wizard

This commit is contained in:
2024-11-26 20:13:54 +01:00
parent 7c78226864
commit ac21e8d607
26 changed files with 68 additions and 85 deletions

View File

@@ -78,25 +78,25 @@
"location": "Swiss Life Hall" "location": "Swiss Life Hall"
}, },
{ {
"date": "4", "date": "8",
"price": 92, "price": 92,
"inStock": 170, "inStock": 170,
"location": "Swiss Life Hall" "location": "Swiss Life Hall"
}, },
{ {
"date": "8", "date": "12",
"price": 119.90, "price": 119.90,
"inStock": 8736, "inStock": 8736,
"location": "Olympiahalle München" "location": "Olympiahalle München"
}, },
{ {
"date": "12", "date": "19",
"price": 114.90, "price": 114.90,
"inStock": 2793, "inStock": 2793,
"location": "Barclays Arena" "location": "Barclays Arena"
}, },
{ {
"date": "13", "date": "31",
"price": 124.90, "price": 124.90,
"inStock": 3079, "inStock": 3079,
"location": "Uber Arena Berlin" "location": "Uber Arena Berlin"
@@ -468,7 +468,7 @@
"location": "ZAG Arena" "location": "ZAG Arena"
}, },
{ {
"date": "6", "date": "15",
"price": 84.90, "price": 84.90,
"inStock": 192, "inStock": 192,
"location": "Muffatwerk" "location": "Muffatwerk"

View File

@@ -18,7 +18,7 @@
"username": "duranduran", "username": "duranduran",
"tickets": [ "tickets": [
{ {
"date": "4", "date": "8",
"concertGroupName": "Unlimited Love", "concertGroupName": "Unlimited Love",
"orderPrice": 184, "orderPrice": 184,
"seatGroup": "A", "seatGroup": "A",
@@ -26,7 +26,7 @@
"seat": 2 "seat": 2
}, },
{ {
"date": "4", "date": "8",
"concertGroupName": "Unlimited Love", "concertGroupName": "Unlimited Love",
"orderPrice": 184, "orderPrice": 184,
"seatGroup": "A", "seatGroup": "A",

View File

@@ -26,7 +26,6 @@ watch(() => preferencesStore.language, () => {
// Watch for theme change // Watch for theme change
watch(() => preferencesStore.theme, () => { watch(() => preferencesStore.theme, () => {
theme.global.name.value = preferencesStore.theme theme.global.name.value = preferencesStore.theme
feedbackStore.addSnackbar(BannerStateEnum.ERROR)
}) })
// Watch for 404 page directions // Watch for 404 page directions
@@ -98,8 +97,9 @@ function calcMargin(i) {
</v-main> </v-main>
</v-app> </v-app>
<!-- Test Environment sticker in bottom right corner -->
<v-sheet <v-sheet
color="red-darken-4" color="error"
position="fixed" position="fixed"
location="bottom right" location="bottom right"
class="pa-3 mb-12 mr-n16 text-center text-h5" class="pa-3 mb-12 mr-n16 text-center text-h5"

View File

@@ -36,7 +36,7 @@ function confirmPressed() {
<outlined-button <outlined-button
@click="showDialog = false" @click="showDialog = false"
prepend-icon="mdi-close" prepend-icon="mdi-close"
color="orange" color="warning"
:loading="loading" :loading="loading"
> >
{{ $t("misc.actions.cancel") }} {{ $t("misc.actions.cancel") }}
@@ -45,7 +45,7 @@ function confirmPressed() {
<outlined-button <outlined-button
@click="confirmPressed" @click="confirmPressed"
prepend-icon="mdi-check" prepend-icon="mdi-check"
color="red" color="error"
:loading="loading" :loading="loading"
> >
{{ $t("misc.actions.confirm") }} {{ $t("misc.actions.confirm") }}

View File

@@ -27,7 +27,7 @@ exerciseStore.getAllExercises()
:content="basketStore.itemsInBasket.reduce((tot, item) => { :content="basketStore.itemsInBasket.reduce((tot, item) => {
return tot + item.seats.length return tot + item.seats.length
}, 0)" }, 0)"
color="red" offset-x="8" offset-y="8"> color="error" offset-x="8" offset-y="8">
<v-btn variant="plain" icon="mdi-cart" to="/basket" /> <v-btn variant="plain" icon="mdi-cart" to="/basket" />
</v-badge> </v-badge>
</div> </div>

View File

@@ -34,7 +34,7 @@ defineProps({
<outlined-button <outlined-button
v-if="!hideAddButton" v-if="!hideAddButton"
prepend-icon="mdi-plus" prepend-icon="mdi-plus"
color="green" color="success"
:disabled="fetchInProgress" :disabled="fetchInProgress"
@click="onAddClick()" @click="onAddClick()"
> >

View File

@@ -154,7 +154,7 @@
"factoryReset": { "factoryReset": {
"factoryReset": "Zurücksetzen auf Werkseinstellungen", "factoryReset": "Zurücksetzen auf Werkseinstellungen",
"dialog": { "dialog": {
"title": "Aus Werkseinstellungen zurücksetzen?", "title": "Auf Werkseinstellungen zurücksetzen?",
"description": "Sollen alle Einstellungen und Daten auf Werkseinstellungen zurückgesetzt werden? Alle Änderungen und Fortschritte gehen verloren!" "description": "Sollen alle Einstellungen und Daten auf Werkseinstellungen zurückgesetzt werden? Alle Änderungen und Fortschritte gehen verloren!"
} }
} }
@@ -239,7 +239,8 @@
"connectToServer": "Server", "connectToServer": "Server",
"database": "Datenbank", "database": "Datenbank",
"exercises": "Aufgaben", "exercises": "Aufgaben",
"userData": "Persönliche Daten" "userData": "Persönliche Daten",
"enterYourPersonalData": "Bitte gebe nun deinen Namen und deine Matrikelnummer von der Universität ein. Überprüfe die Angaben vor dem Absenden genau! Die Angaben können später nicht ohne Verlust des Bearbeitungsfortschrittes geändert werden!"
}, },
"user": "Angaben zur Person", "user": "Angaben zur Person",
"registrationNumber": "Matrikelnummer", "registrationNumber": "Matrikelnummer",

View File

@@ -239,7 +239,8 @@
"connectToServer": "Server", "connectToServer": "Server",
"database": "Database", "database": "Database",
"exercises": "Exercises", "exercises": "Exercises",
"userData": "User data" "userData": "User data",
"enterYourPersonalData": "Please enter your name and your Matrikel number from your university. Check it twice! You can't change it later without loosing your exercise progress!"
}, },
"user": "About person", "user": "About person",
"registrationNumber": "Matrikel number", "registrationNumber": "Matrikel number",

View File

@@ -18,7 +18,7 @@ const accountStore = useAccountStore()
<v-col class="d-flex justify-center align-center"> <v-col class="d-flex justify-center align-center">
<outlined-button <outlined-button
prepend-icon="mdi-delete" prepend-icon="mdi-delete"
color="red" color="error"
:loading="accountStore.fetchInProgress" :loading="accountStore.fetchInProgress"
@click="showConfirmDialog = true" @click="showConfirmDialog = true"
> >
@@ -29,7 +29,7 @@ const accountStore = useAccountStore()
<v-col class="d-flex justify-center align-center"> <v-col class="d-flex justify-center align-center">
<outlined-button <outlined-button
prepend-icon="mdi-content-save" prepend-icon="mdi-content-save"
color="green" color="success"
:loading="accountStore.fetchInProgress" :loading="accountStore.fetchInProgress"
@click="accountStore.updateAccount()" @click="accountStore.updateAccount()"
> >

View File

@@ -81,7 +81,7 @@ const accountStore = useAccountStore()
<v-col class="d-flex justify-center align-center"> <v-col class="d-flex justify-center align-center">
<outlined-button <outlined-button
@click="accountStore.removeAddress(address)" @click="accountStore.removeAddress(address)"
color="red" color="error"
prepend-icon="mdi-delete" prepend-icon="mdi-delete"
> >
{{ $t('misc.actions.remove') }} {{ $t('misc.actions.remove') }}
@@ -102,7 +102,7 @@ const accountStore = useAccountStore()
<outlined-button <outlined-button
@click="accountStore.userAccount.addresses.push(new AddressModel())" @click="accountStore.userAccount.addresses.push(new AddressModel())"
prepend-icon="mdi-plus" prepend-icon="mdi-plus"
color="green" color="success"
> >
{{ $t('misc.actions.add') }} {{ $t('misc.actions.add') }}
</outlined-button> </outlined-button>

View File

@@ -17,7 +17,7 @@ const accountStore = useAccountStore()
<v-row> <v-row>
<v-col> <v-col>
<card-view-one-line <card-view-one-line
color="amber" color="warning"
prepend-icon="mdi-alert" prepend-icon="mdi-alert"
:title="$t('account.noRealPaymentsNeeded')" :title="$t('account.noRealPaymentsNeeded')"
/> />
@@ -60,7 +60,7 @@ const accountStore = useAccountStore()
<v-col class="d-flex justify-center align-center"> <v-col class="d-flex justify-center align-center">
<outlined-button <outlined-button
@click="accountStore.removePayment(payment)" @click="accountStore.removePayment(payment)"
color="red" color="error"
prepend-icon="mdi-delete" prepend-icon="mdi-delete"
> >
{{ $t('misc.actions.remove') }} {{ $t('misc.actions.remove') }}
@@ -88,7 +88,7 @@ const accountStore = useAccountStore()
<outlined-button <outlined-button
@click="accountStore.userAccount.payments.push(new PaymentModel())" @click="accountStore.userAccount.payments.push(new PaymentModel())"
prepend-icon="mdi-plus" prepend-icon="mdi-plus"
color="green" color="success"
> >
{{ $t('misc.actions.add') }} {{ $t('misc.actions.add') }}
</outlined-button> </outlined-button>

View File

@@ -69,7 +69,7 @@ async function startLogin() {
append-icon="mdi-arrow-right" append-icon="mdi-arrow-right"
@click="startLogin" @click="startLogin"
:loading="accountStore.fetchInProgress" :loading="accountStore.fetchInProgress"
color="green" color="success"
id="btn-login" id="btn-login"
> >
{{ $t('account.login.login') }} {{ $t('account.login.login') }}

View File

@@ -75,6 +75,7 @@ async function registerAccount() {
prepend-icon="mdi-account-plus" prepend-icon="mdi-account-plus"
@click="registerAccount" @click="registerAccount"
:loading="accountStore.fetchInProgress" :loading="accountStore.fetchInProgress"
color="success"
> >
{{ $t('account.register') }} {{ $t('account.register') }}
</outlined-button> </outlined-button>

View File

@@ -93,7 +93,7 @@ function itemProps(item: GenreModel) {
<template #actions> <template #actions>
<outlined-button <outlined-button
color="green" color="success"
@click="bandStore.saveBand" @click="bandStore.saveBand"
:loading="bandStore.fetchInProgress" :loading="bandStore.fetchInProgress"
> >

View File

@@ -53,7 +53,7 @@ const test = ref()
<outlined-button <outlined-button
@click="filesStore.uploadFile" @click="filesStore.uploadFile"
prepend-icon="mdi-file-upload" prepend-icon="mdi-file-upload"
color="green" color="success"
:disabled="filesStore.fileUploadDir.length == 0 || filesStore.fileUpload == undefined" :disabled="filesStore.fileUploadDir.length == 0 || filesStore.fileUpload == undefined"
:loading="filesStore.fetchInProgress" :loading="filesStore.fetchInProgress"
> >

View File

@@ -35,7 +35,7 @@ const genreStore = useGenreStore()
<template #actions> <template #actions>
<outlined-button <outlined-button
color="green" color="success"
@click="genreStore.saveGenre" @click="genreStore.saveGenre"
:disabled="!valid" :disabled="!valid"
:loading="genreStore.fetchInProgress" :loading="genreStore.fetchInProgress"

View File

@@ -53,7 +53,7 @@ const showOrderingDialog = ref()
prepend-icon="mdi-basket-check" prepend-icon="mdi-basket-check"
:disabled="basketStore.itemsInBasket.length == 0 || accountStore.userAccount.id == null" :disabled="basketStore.itemsInBasket.length == 0 || accountStore.userAccount.id == null"
variant="outlined" variant="outlined"
color="green" color="success"
@click="showOrderingDialog = true" @click="showOrderingDialog = true"
> >
{{ $t('order.takeOrder') }} {{ $t('order.takeOrder') }}

View File

@@ -100,7 +100,7 @@ function paymentItemProps(item: PaymentModel) {
@click="doOrder" @click="doOrder"
:loading="orderingInProgress" :loading="orderingInProgress"
prepend-icon="mdi-send" prepend-icon="mdi-send"
color="green" color="success"
> >
{{ $t('order.takeOrder') }} {{ $t('order.takeOrder') }}
</outlined-button> </outlined-button>

View File

@@ -56,7 +56,7 @@ function removeFromBasket(basketItem: BasketItemModel) {
<v-btn <v-btn
icon="mdi-delete" icon="mdi-delete"
@click="removeFromBasket(basketItem)" @click="removeFromBasket(basketItem)"
color="red" color="error"
variant="text" variant="text"
flat flat
/> />

View File

@@ -63,7 +63,7 @@ watch(() => currentStep.value, () => {
:title="step" :title="step"
:value="n + 1" :value="n + 1"
complete-icon="mdi-check" complete-icon="mdi-check"
color="green" color="success"
/> />
<v-divider v-if="n < steps.length - 1" /> <v-divider v-if="n < steps.length - 1" />
@@ -73,6 +73,7 @@ watch(() => currentStep.value, () => {
<!-- Content --> <!-- Content -->
<v-stepper-window> <v-stepper-window>
<!-- Step 1: Check connection to backend server -->
<v-stepper-window-item <v-stepper-window-item
:value="1" :value="1"
class="text-h4 text-center" class="text-h4 text-center"
@@ -84,6 +85,7 @@ watch(() => currentStep.value, () => {
<server-state-text /> <server-state-text />
</v-stepper-window-item> </v-stepper-window-item>
<!-- Step 2: Reset the database -->
<v-stepper-window-item <v-stepper-window-item
:value="2" :value="2"
> >
@@ -100,7 +102,7 @@ watch(() => currentStep.value, () => {
</div> </div>
</v-stepper-window-item> </v-stepper-window-item>
<!-- Step 3: Create exercises -->
<v-stepper-window-item <v-stepper-window-item
:value="3" :value="3"
> >
@@ -117,11 +119,18 @@ watch(() => currentStep.value, () => {
</div> </div>
</v-stepper-window-item> </v-stepper-window-item>
<!-- Step 4: Personal data -->
<v-stepper-window-item <v-stepper-window-item
:value="4" :value="4"
> >
<v-container class="px-0 py-2"> <v-container class="px-0 py-2">
<v-row>
<v-col>
<v-alert color="warning" icon="mdi-alert">
{{ $t('misc.firstStartup.enterYourPersonalData') }}
</v-alert>
</v-col>
</v-row>
<v-row> <v-row>
<v-col> <v-col>
<v-text-field <v-text-field
@@ -171,7 +180,7 @@ watch(() => currentStep.value, () => {
:disabled="preferencesStore.studentName.length == 0 || :disabled="preferencesStore.studentName.length == 0 ||
preferencesStore.registrationNumber.length == 0" preferencesStore.registrationNumber.length == 0"
prepend-icon="mdi-check" prepend-icon="mdi-check"
color="green" color="success"
> >
{{ $t('misc.firstStartup.complete') }} {{ $t('misc.firstStartup.complete') }}
</outlined-button> </outlined-button>

View File

@@ -2,7 +2,6 @@
import pageSetup from './pageSetupSection.vue'; import pageSetup from './pageSetupSection.vue';
import systemSetup from './systemSetupSection.vue'; import systemSetup from './systemSetupSection.vue';
import aboutSection from './aboutSection.vue'; import aboutSection from './aboutSection.vue';
import userSection from './userSection.vue';
</script> </script>
<template> <template>
@@ -13,12 +12,6 @@ import userSection from './userSection.vue';
</v-col> </v-col>
</v-row> </v-row>
<v-row>
<v-col>
<user-section />
</v-col>
</v-row>
<v-row> <v-row>
<v-col> <v-col>
<system-setup /> <system-setup />

View File

@@ -28,7 +28,7 @@ preferenceStore.getServerState()
<outlined-button <outlined-button
@click="preferenceStore.showDeleteDbDialog = true" @click="preferenceStore.showDeleteDbDialog = true"
prepend-icon="mdi-database-refresh" prepend-icon="mdi-database-refresh"
color="red" color="warning"
:disabled="preferenceStore.serverState != ServerStateEnum.ONLINE || preferenceStore.fetchInProgress" :disabled="preferenceStore.serverState != ServerStateEnum.ONLINE || preferenceStore.fetchInProgress"
> >
{{ $t('preferences.resetDatabase.resetDatabase') }} {{ $t('preferences.resetDatabase.resetDatabase') }}
@@ -39,7 +39,7 @@ preferenceStore.getServerState()
<outlined-button <outlined-button
@click="preferenceStore.showDeleteExerciseDialog = true" @click="preferenceStore.showDeleteExerciseDialog = true"
prepend-icon="mdi-progress-close" prepend-icon="mdi-progress-close"
color="red" color="warning"
:disabled="preferenceStore.serverState != ServerStateEnum.ONLINE || preferenceStore.fetchInProgress" :disabled="preferenceStore.serverState != ServerStateEnum.ONLINE || preferenceStore.fetchInProgress"
> >
{{ $t('preferences.resetExerciseProgress.resetExerciseProgress') }} {{ $t('preferences.resetExerciseProgress.resetExerciseProgress') }}
@@ -50,7 +50,7 @@ preferenceStore.getServerState()
<outlined-button <outlined-button
@click="preferenceStore.showFactoryResetDialog = true" @click="preferenceStore.showFactoryResetDialog = true"
prepend-icon="mdi-factory" prepend-icon="mdi-factory"
color="red" color="warning"
:disabled="preferenceStore.serverState != ServerStateEnum.ONLINE || preferenceStore.fetchInProgress" :disabled="preferenceStore.serverState != ServerStateEnum.ONLINE || preferenceStore.fetchInProgress"
> >
{{ $t('preferences.factoryReset.factoryReset') }} {{ $t('preferences.factoryReset.factoryReset') }}

View File

@@ -1,32 +0,0 @@
<script setup lang="ts">
import cardView from '@/components/basics/cardView.vue';
import { usePreferencesStore } from '@/stores/preferences.store';
const preferencesStore = usePreferencesStore()
</script>
<template>
<card-view icon="mdi-account-school" :title="$t('misc.user')">
<v-row>
<v-col>
<v-text-field
variant="outlined"
hide-details
:label="$t('misc.yourFullName')"
v-model="preferencesStore.studentName"
/>
</v-col>
</v-row>
<v-row>
<v-col>
<v-text-field
variant="outlined"
hide-details
:label="$t('misc.registrationNumber')"
v-model="preferencesStore.registrationNumber"
/>
</v-col>
</v-row>
</card-view>
</template>

View File

@@ -18,7 +18,11 @@ const vuetify = createVuetify({
colors: { colors: {
primary: colors.blue.darken4, primary: colors.blue.darken4,
secondary: colors.yellow.darken3, secondary: colors.yellow.darken3,
sheet: colors.grey.darken4 sheet: colors.grey.darken4,
warning: colors.amber.darken3,
success: colors.green.darken2,
error: colors.red.darken2,
exerciseSolved: colors.purple.darken2
} }
}, },
light: { light: {
@@ -26,7 +30,11 @@ const vuetify = createVuetify({
colors: { colors: {
primary: colors.blue.darken4, primary: colors.blue.darken4,
secondary: colors.yellow.darken3, secondary: colors.yellow.darken3,
sheet: colors.grey.lighten3 sheet: colors.grey.lighten3,
warning: colors.amber.darken4,
success: colors.green.darken2,
error: colors.red.darken4,
exerciseSolved: colors.purple.darken2
} }
}, },
} }

View File

@@ -16,9 +16,10 @@ export const useAccountStore = defineStore("accountStore", {
/** All accounts */ /** All accounts */
accounts: ref<Array<AccountApiModel>>([]), accounts: ref<Array<AccountApiModel>>([]),
/** Useraccount which is currently logged in */ /** Server token of currently logged in account */
userAccountToken: useLocalStorage("hackmycart/accountStore/userAccountToken", ""), userAccountToken: useLocalStorage("hackmycart/accountStore/userAccountToken", ""),
/** Useraccount which is currently logged in */
userAccount: useLocalStorage("hackmycart/accountStore/userAccount", new AccountApiModel()), userAccount: useLocalStorage("hackmycart/accountStore/userAccount", new AccountApiModel()),
/** User input on login screen */ /** User input on login screen */
@@ -49,6 +50,9 @@ export const useAccountStore = defineStore("accountStore", {
this.accounts = response.data this.accounts = response.data
this.fetchInProgress = false this.fetchInProgress = false
}) })
.catch(onrejected => {
this.fetchInProgress = false
})
}, },
/** /**

View File

@@ -197,7 +197,7 @@ export const useFeedbackStore = defineStore("feedbackStore", {
case BannerStateEnum.BANDSAVEDERROR: case BannerStateEnum.BANDSAVEDERROR:
case BannerStateEnum.GENREDELETEERROR: case BannerStateEnum.GENREDELETEERROR:
case BannerStateEnum.GENRESAVEDERROR: case BannerStateEnum.GENRESAVEDERROR:
return "red" return "warning"
case BannerStateEnum.BASKETTICKETADDED: case BannerStateEnum.BASKETTICKETADDED:
case BannerStateEnum.DATABASERESETSUCCESSFUL: case BannerStateEnum.DATABASERESETSUCCESSFUL:
@@ -211,7 +211,8 @@ export const useFeedbackStore = defineStore("feedbackStore", {
case BannerStateEnum.EXERCISEPROGRESSRESETSUCCESSFUL: case BannerStateEnum.EXERCISEPROGRESSRESETSUCCESSFUL:
case BannerStateEnum.GENREDELETESUCCESSFUL: case BannerStateEnum.GENREDELETESUCCESSFUL:
case BannerStateEnum.GENRESAVEDSUCCESSFUL: case BannerStateEnum.GENRESAVEDSUCCESSFUL:
return "green" case BannerStateEnum.BASKETTICKETREMOVED:
return "success"
case BannerStateEnum.EXERCISESOLVED01: case BannerStateEnum.EXERCISESOLVED01:
case BannerStateEnum.EXERCISESOLVED02: case BannerStateEnum.EXERCISESOLVED02:
@@ -225,10 +226,7 @@ export const useFeedbackStore = defineStore("feedbackStore", {
case BannerStateEnum.EXERCISESOLVED25: case BannerStateEnum.EXERCISESOLVED25:
case BannerStateEnum.EXERCISESOLVED31: case BannerStateEnum.EXERCISESOLVED31:
case BannerStateEnum.EXERCISESOLVED32: case BannerStateEnum.EXERCISESOLVED32:
return "purple" return "exerciseSolved"
case BannerStateEnum.BASKETTICKETREMOVED:
return "blue"
} }
}, },