Skip to content

Commit 8c64ed7

Browse files
authored
Merge pull request #104 from filips123/frontend-fixes
More fixes for the new frontend
2 parents 91f1ad2 + 568bcfd commit 8c64ed7

File tree

7 files changed

+67
-39
lines changed

7 files changed

+67
-39
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
name: Napaka v delovanju
22
description: Napišite poročilo o napaki v delovanju.
3+
labels: ["bug"]
34
body:
45
- type: markdown
56
attributes:
6-
value: |
7-
Hvala, ker ste si vzeli čas za izpolnitev tega poročila!
7+
value: Hvala, ker ste si vzeli čas za izpolnjevanje tega poročila!
88
- type: textarea
99
id: description
1010
attributes:
1111
label: Opis napake
12-
description: Kolikor vam je mogoče podrobno opisati napako.
12+
description: Čim bolj podrobno opišite napako, ki ste jo opazili.
1313
validations:
1414
required: true
1515
- type: input
1616
id: os
1717
attributes:
1818
label: Operacijski sistem
1919
description: V katerem operacijskem sistemu se pojavlja ta napaka (po možnosti z verzijo)?
20-
placeholder: Android 13, iOS 16, Windows 11 itd.
20+
placeholder: npr. Android 14, iOS 17.6, Windows 11, itd.
2121
validations:
2222
required: true
2323
- type: input
2424
id: browser
2525
attributes:
2626
label: Brskalnik
27-
description: V katerem brskalniku se pojavlja ta napaka?
28-
placeholder: Chrome, Safari, Firefox itd.
27+
description: V katerem brskalniku se pojavlja ta napaka (po možnosti z verzijo)?
28+
placeholder: npr. Chrome 128, Firefox 130, Safari 17.6, itd.
2929
validations:
3030
required: true
3131
- type: textarea
3232
id: screenshot
3333
attributes:
34-
label: Posnetek zaslona telefona/računalnika
35-
description: V primeru, če imate vizualne napake, lahko tu prilepite svoj posnetek zaslona.
34+
label: Posnetek zaslona
35+
description: V primeru, da imate vizualne napake, lahko tu prilepite svoj posnetek zaslona.
3636
placeholder: Kliknite v to besedilno polje in prilepite svoj posnetek zaslona.
3737
validations:
38-
required: false
38+
required: false
Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,55 @@
11
name: Napaka v podatkih
22
description: Napišite poročilo o napaki v podatkih.
3+
labels: ["bug"]
34
body:
45
- type: markdown
56
attributes:
6-
value: |
7-
Hvala, ker ste si vzeli čas za izpolnitev tega poročila!
7+
value: Hvala, ker ste si vzeli čas za izpolnjevanje tega poročila!
88
- type: dropdown
99
id: datatype
1010
attributes:
1111
label: Vrsta podatka
12-
description: Pri katerem podatku, se je pojavila napaka?
12+
description: Pri katerem podatku se je pojavila napaka?
1313
options:
1414
- Urnik
15-
- Jedilniki
16-
- Okrožnice
1715
- Nadomeščanja
16+
- Okrožnice
17+
- Jedilniki
1818
- Razporedi kosil
1919
validations:
2020
required: true
2121
- type: dropdown
2222
id: viewtype
2323
attributes:
2424
label: Vrsta pogleda
25-
description: Pri katerem pogledu, se je pojavila napaka?
25+
description: Pri katerem pogledu se je pojavila napaka?
2626
options:
2727
- Razred
2828
- Profesor
2929
- Učilnica
3030
validations:
31-
required: true
31+
required: false
32+
- type: input
33+
id: viewlist
34+
attributes:
35+
label: Ime pogleda
36+
description: Pri katerem pogledu se je pojavila napaka?
37+
placeholder: npr. 4A, MINF, MZGO
38+
validations:
39+
required: false
3240
- type: textarea
33-
id: error
41+
id: description
3442
attributes:
3543
label: Opis napake
36-
description: Kolikor vam je mogoče podrobno opisati napako.
37-
placeholder: npr. Namesto geografije 3. uro je bila napisana 4. uro
44+
description: Čim bolj podrobno opišite napako, ki ste jo opazili.
45+
placeholder: npr. Namesto geografije 3. uro je bila napisana kemija.
3846
validations:
3947
required: true
4048
- type: input
4149
id: date
4250
attributes:
4351
label: Datum
44-
description: Vpišite datum, ko se je zgodila napaka (dd. mm. yyyy)
45-
placeholder: npr. 29. 12. 2023
52+
description: Vnesite datum, ko se je zgodila napaka (dd. mm. yyyy).
53+
placeholder: npr. 27. 5. 2024
4654
validations:
47-
required: false
55+
required: false
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
name: Prošnja za funkcijo
2-
description: Napišite izboljšavo obstoječih funkcij ali novo funkcijo
2+
description: Napišite predlog za izboljšavo obstoječih funkcij ali dodajanja novih.
3+
labels: ["enhancement"]
34
body:
45
- type: markdown
56
attributes:
6-
value: |
7-
Hvala, ker ste si vzeli čas za izpolnitev tega poročila!
7+
value: Hvala, ker ste si vzeli čas za izpolnjevanje tega poročila!
88
- type: textarea
9-
id: idea
9+
id: description
1010
attributes:
1111
label: Vaša zamisel
1212
description: V nekaj stavkih opišite svojo zamisel.
1313
validations:
1414
required: true
1515
- type: textarea
16-
id: whatfor
16+
id: problem
1717
attributes:
18-
label: Problem, ki ga reši
18+
label: Rešen problem
1919
description: Kakšen problem bi rešila vaša zamisel?
2020
validations:
2121
required: true
2222
- type: textarea
23-
id: other
23+
id: context
2424
attributes:
25-
label: Slike vaše zamisli
26-
description: Kako bi izgledala vaša zamisel? Kako rešijo to druge aplikacije?
25+
label: Več informacij
26+
description: Kako bi izgledala vaša zamisel? Kako to rešujejo druge aplikacije?
2727
validations:
28-
required: false
28+
required: false

website/src/App.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import AppSnackbar from '@/components/AppSnackbar.vue'
1818
import NavigationDay from '@/components/NavigationDay.vue'
1919
import NavigationDesktop from '@/components/NavigationDesktop.vue'
2020
import NavigationMobile from '@/components/NavigationMobile.vue'
21+
import { useSnackbarStore } from '@/composables/snackbar'
2122
import { useSessionStore } from '@/stores/session'
2223
import { ThemeType, useSettingsStore } from '@/stores/settings'
2324
import { updateAllData } from '@/utils/update'
@@ -50,6 +51,11 @@ onMounted(() => {
5051
updateAllData()
5152
},
5253
})
54+
55+
if (!navigator.onLine) {
56+
const { displaySnackbar } = useSnackbarStore()
57+
displaySnackbar('Internetna povezava ni na voljo')
58+
}
5359
})
5460
5561
onUnmounted(() => {

website/src/components/SettingsSelectEntity.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const availableList = computed(() => {
7272
7373
// Display the correct dialogs based on state
7474
useEventListener(window, 'popstate', event => {
75-
if (event.state?.entityTypeDialog && event.state?.entityListDialog) {
75+
if (event.state?.entityTypeDialog || event.state?.entityListDialog) {
7676
entityTypeDialog.value = event.state.entityTypeDialog
7777
entityListDialog.value = event.state.entityListDialog
7878
}

website/src/registerServiceWorker.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ export default function registerServiceWorker(router: Router) {
1111
// Display a message while updating the service worker
1212
const { displaySnackbar } = useSnackbarStore()
1313
displaySnackbar('Posodabljanje ...')
14+
15+
// Mark that we need to update the service worker
1416
immediatelyUpdate = true
1517
}
1618

1719
if (searchParams.has('updating')) {
1820
// Display a success message if the app was updated
1921
const { displaySnackbar } = useSnackbarStore()
2022
displaySnackbar('Aplikacija posodobljena')
23+
24+
// Hide the parameter after the app was updated
2125
router.replace(location.pathname)
2226
}
2327

@@ -40,20 +44,29 @@ export default function registerServiceWorker(router: Router) {
4044

4145
onNeedRefresh() {
4246
if (immediatelyUpdate) {
43-
// Update the service worker immediately if requested
4447
console.log('Update parameter detected, updating the service worker...')
48+
49+
// Update the service worker immediately if requested
4550
performUpdate()
4651
} else {
47-
// Prompt the user to update the service worker
4852
console.log('New content is available, prompting the user to refresh...')
53+
54+
// Prompt the user to update the service worker
4955
const { displaySnackbar } = useSnackbarStore()
5056
displaySnackbar('Na voljo je posodobitev', 'Posodobi', performUpdate, -1)
5157
}
5258
},
5359
})
5460

5561
const performUpdate = async () => {
56-
await router.replace({ path: location.pathname, query: { updating: 1 } })
62+
// Display a message while updating the service worker
63+
const { displaySnackbar } = useSnackbarStore()
64+
displaySnackbar('Posodabljanje ...')
65+
66+
// Add query parameter so we know the app was updated
67+
history.replaceState(history.state, '', location.pathname + '?updating=1')
68+
69+
// Update the service worker
5770
await updateSW()
5871
}
5972
}

website/src/utils/update.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,18 @@ export async function updateAllData(showSuccess: boolean = true): Promise<void>
4141
}
4242

4343
export async function updateWrapper(updateFunction: () => Promise<void>) {
44-
const { displaySnackbar } = useSnackbarStore()
45-
4644
if (!navigator.onLine) {
47-
displaySnackbar('Internetna povezava ni na voljo')
4845
return
4946
}
5047

5148
try {
5249
await updateFunction()
5350
} catch (error) {
51+
// Inform the user about the error
52+
const { displaySnackbar } = useSnackbarStore()
5453
displaySnackbar('Napaka pri pridobivanju podatkov')
54+
55+
// Log the error to the console
5556
console.error(error)
5657

5758
// Submit the error to Sentry if enabled

0 commit comments

Comments
 (0)