diff --git a/.github/ISSUE_TEMPLATE/malfunction.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml similarity index 57% rename from .github/ISSUE_TEMPLATE/malfunction.yaml rename to .github/ISSUE_TEMPLATE/bug_report.yaml index bbd2024..8943f4c 100644 --- a/.github/ISSUE_TEMPLATE/malfunction.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -1,15 +1,15 @@ name: Napaka v delovanju description: Napišite poročilo o napaki v delovanju. +labels: ["bug"] body: - type: markdown attributes: - value: | - Hvala, ker ste si vzeli čas za izpolnitev tega poročila! + value: Hvala, ker ste si vzeli čas za izpolnjevanje tega poročila! - type: textarea id: description attributes: label: Opis napake - description: Kolikor vam je mogoče podrobno opisati napako. + description: Čim bolj podrobno opišite napako, ki ste jo opazili. validations: required: true - type: input @@ -17,22 +17,22 @@ body: attributes: label: Operacijski sistem description: V katerem operacijskem sistemu se pojavlja ta napaka (po možnosti z verzijo)? - placeholder: Android 13, iOS 16, Windows 11 itd. + placeholder: npr. Android 14, iOS 17.6, Windows 11, itd. validations: required: true - type: input id: browser attributes: label: Brskalnik - description: V katerem brskalniku se pojavlja ta napaka? - placeholder: Chrome, Safari, Firefox itd. + description: V katerem brskalniku se pojavlja ta napaka (po možnosti z verzijo)? + placeholder: npr. Chrome 128, Firefox 130, Safari 17.6, itd. validations: required: true - type: textarea id: screenshot attributes: - label: Posnetek zaslona telefona/računalnika - description: V primeru, če imate vizualne napake, lahko tu prilepite svoj posnetek zaslona. + label: Posnetek zaslona + description: V primeru, da imate vizualne napake, lahko tu prilepite svoj posnetek zaslona. placeholder: Kliknite v to besedilno polje in prilepite svoj posnetek zaslona. validations: - required: false \ No newline at end of file + required: false diff --git a/.github/ISSUE_TEMPLATE/data_error.yaml b/.github/ISSUE_TEMPLATE/data_error.yaml index d10960f..3f77b5f 100644 --- a/.github/ISSUE_TEMPLATE/data_error.yaml +++ b/.github/ISSUE_TEMPLATE/data_error.yaml @@ -1,20 +1,20 @@ name: Napaka v podatkih description: Napišite poročilo o napaki v podatkih. +labels: ["bug"] body: - type: markdown attributes: - value: | - Hvala, ker ste si vzeli čas za izpolnitev tega poročila! + value: Hvala, ker ste si vzeli čas za izpolnjevanje tega poročila! - type: dropdown id: datatype attributes: label: Vrsta podatka - description: Pri katerem podatku, se je pojavila napaka? + description: Pri katerem podatku se je pojavila napaka? options: - Urnik - - Jedilniki - - Okrožnice - Nadomeščanja + - Okrožnice + - Jedilniki - Razporedi kosil validations: required: true @@ -22,26 +22,34 @@ body: id: viewtype attributes: label: Vrsta pogleda - description: Pri katerem pogledu, se je pojavila napaka? + description: Pri katerem pogledu se je pojavila napaka? options: - Razred - Profesor - Učilnica validations: - required: true + required: false + - type: input + id: viewlist + attributes: + label: Ime pogleda + description: Pri katerem pogledu se je pojavila napaka? + placeholder: npr. 4A, MINF, MZGO + validations: + required: false - type: textarea - id: error + id: description attributes: label: Opis napake - description: Kolikor vam je mogoče podrobno opisati napako. - placeholder: npr. Namesto geografije 3. uro je bila napisana 4. uro + description: Čim bolj podrobno opišite napako, ki ste jo opazili. + placeholder: npr. Namesto geografije 3. uro je bila napisana kemija. validations: required: true - type: input id: date attributes: label: Datum - description: Vpišite datum, ko se je zgodila napaka (dd. mm. yyyy) - placeholder: npr. 29. 12. 2023 + description: Vnesite datum, ko se je zgodila napaka (dd. mm. yyyy). + placeholder: npr. 27. 5. 2024 validations: - required: false \ No newline at end of file + required: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index 25755b1..1c6b879 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -1,28 +1,28 @@ name: Prošnja za funkcijo -description: Napišite izboljšavo obstoječih funkcij ali novo funkcijo +description: Napišite predlog za izboljšavo obstoječih funkcij ali dodajanja novih. +labels: ["enhancement"] body: - type: markdown attributes: - value: | - Hvala, ker ste si vzeli čas za izpolnitev tega poročila! + value: Hvala, ker ste si vzeli čas za izpolnjevanje tega poročila! - type: textarea - id: idea + id: description attributes: label: Vaša zamisel description: V nekaj stavkih opišite svojo zamisel. validations: required: true - type: textarea - id: whatfor + id: problem attributes: - label: Problem, ki ga reši + label: Rešen problem description: Kakšen problem bi rešila vaša zamisel? validations: required: true - type: textarea - id: other + id: context attributes: - label: Slike vaše zamisli - description: Kako bi izgledala vaša zamisel? Kako rešijo to druge aplikacije? + label: Več informacij + description: Kako bi izgledala vaša zamisel? Kako to rešujejo druge aplikacije? validations: - required: false \ No newline at end of file + required: false diff --git a/website/src/App.vue b/website/src/App.vue index 921bf97..caeef9a 100644 --- a/website/src/App.vue +++ b/website/src/App.vue @@ -18,6 +18,7 @@ import AppSnackbar from '@/components/AppSnackbar.vue' import NavigationDay from '@/components/NavigationDay.vue' import NavigationDesktop from '@/components/NavigationDesktop.vue' import NavigationMobile from '@/components/NavigationMobile.vue' +import { useSnackbarStore } from '@/composables/snackbar' import { useSessionStore } from '@/stores/session' import { ThemeType, useSettingsStore } from '@/stores/settings' import { updateAllData } from '@/utils/update' @@ -50,6 +51,11 @@ onMounted(() => { updateAllData() }, }) + + if (!navigator.onLine) { + const { displaySnackbar } = useSnackbarStore() + displaySnackbar('Internetna povezava ni na voljo') + } }) onUnmounted(() => { diff --git a/website/src/components/SettingsSelectEntity.vue b/website/src/components/SettingsSelectEntity.vue index 9e48545..70e4d38 100644 --- a/website/src/components/SettingsSelectEntity.vue +++ b/website/src/components/SettingsSelectEntity.vue @@ -72,7 +72,7 @@ const availableList = computed(() => { // Display the correct dialogs based on state useEventListener(window, 'popstate', event => { - if (event.state?.entityTypeDialog && event.state?.entityListDialog) { + if (event.state?.entityTypeDialog || event.state?.entityListDialog) { entityTypeDialog.value = event.state.entityTypeDialog entityListDialog.value = event.state.entityListDialog } diff --git a/website/src/registerServiceWorker.ts b/website/src/registerServiceWorker.ts index 0d1cd55..7dc1018 100644 --- a/website/src/registerServiceWorker.ts +++ b/website/src/registerServiceWorker.ts @@ -11,6 +11,8 @@ export default function registerServiceWorker(router: Router) { // Display a message while updating the service worker const { displaySnackbar } = useSnackbarStore() displaySnackbar('Posodabljanje ...') + + // Mark that we need to update the service worker immediatelyUpdate = true } @@ -18,6 +20,8 @@ export default function registerServiceWorker(router: Router) { // Display a success message if the app was updated const { displaySnackbar } = useSnackbarStore() displaySnackbar('Aplikacija posodobljena') + + // Hide the parameter after the app was updated router.replace(location.pathname) } @@ -40,12 +44,14 @@ export default function registerServiceWorker(router: Router) { onNeedRefresh() { if (immediatelyUpdate) { - // Update the service worker immediately if requested console.log('Update parameter detected, updating the service worker...') + + // Update the service worker immediately if requested performUpdate() } else { - // Prompt the user to update the service worker console.log('New content is available, prompting the user to refresh...') + + // Prompt the user to update the service worker const { displaySnackbar } = useSnackbarStore() displaySnackbar('Na voljo je posodobitev', 'Posodobi', performUpdate, -1) } @@ -53,7 +59,14 @@ export default function registerServiceWorker(router: Router) { }) const performUpdate = async () => { - await router.replace({ path: location.pathname, query: { updating: 1 } }) + // Display a message while updating the service worker + const { displaySnackbar } = useSnackbarStore() + displaySnackbar('Posodabljanje ...') + + // Add query parameter so we know the app was updated + history.replaceState(history.state, '', location.pathname + '?updating=1') + + // Update the service worker await updateSW() } } diff --git a/website/src/utils/update.ts b/website/src/utils/update.ts index 9a3cdcf..8a42e86 100644 --- a/website/src/utils/update.ts +++ b/website/src/utils/update.ts @@ -41,17 +41,18 @@ export async function updateAllData(showSuccess: boolean = true): Promise } export async function updateWrapper(updateFunction: () => Promise) { - const { displaySnackbar } = useSnackbarStore() - if (!navigator.onLine) { - displaySnackbar('Internetna povezava ni na voljo') return } try { await updateFunction() } catch (error) { + // Inform the user about the error + const { displaySnackbar } = useSnackbarStore() displaySnackbar('Napaka pri pridobivanju podatkov') + + // Log the error to the console console.error(error) // Submit the error to Sentry if enabled