From 860bebfc082722123089ff49e049ed7b0e01e943 Mon Sep 17 00:00:00 2001 From: Wolkenfarmer Date: Wed, 4 Sep 2024 13:41:31 +0200 Subject: [PATCH] Revert "#330 frontend: use enum for the exercise status" This reverts commit 78e6c1e1c3add52a228beca1e5757985e61fe688. --- .../screensPatient/ScreenWaiting.vue | 20 ++++++++++------ .../widgets/ExerciseControlPanel.vue | 24 +++++++++---------- frontend/src/sockets/MessageData.ts | 10 +------- frontend/src/sockets/SocketPatient.ts | 8 +++---- frontend/src/sockets/SocketTrainer.ts | 12 +++++----- frontend/src/stores/Exercise.ts | 2 +- 6 files changed, 37 insertions(+), 39 deletions(-) diff --git a/frontend/src/components/screensPatient/ScreenWaiting.vue b/frontend/src/components/screensPatient/ScreenWaiting.vue index c42cfeeb..59cd5bf3 100644 --- a/frontend/src/components/screensPatient/ScreenWaiting.vue +++ b/frontend/src/components/screensPatient/ScreenWaiting.vue @@ -8,13 +8,13 @@ const title = computed(() => { switch (exerciseStore.status) { - case ExerciseStatus.RUNNING: + case 'running': return patientStore.relocatingInfo - case ExerciseStatus.NOT_STARTED: + case 'not-started': return 'Warte, bis die Übung beginnt' - case ExerciseStatus.PAUSED: + case 'paused': return 'Übung pausiert' - case ExerciseStatus.ENDED: + case 'ended': return 'Übung beendet' default: return 'Warte auf Übung' @@ -22,9 +22,15 @@ }) const info = computed(() => { - if (exerciseStore.status == ExerciseStatus.RUNNING) { - return new Date(new Date(0).setSeconds(patientStore.timeUntilBack)).toISOString().substring(12, 19) - } else return 'Bereich: '+ exerciseStore.getAreaName(patientStore.areaId) + switch (exerciseStore.status) { + case 'running': + return new Date(new Date(0).setSeconds(patientStore.timeUntilBack)).toISOString().substring(12, 19) + case 'not-started': + case 'paused': + case 'ended': + default: + return 'Bereich: '+ exerciseStore.getAreaName(patientStore.areaId) + } }) diff --git a/frontend/src/components/widgets/ExerciseControlPanel.vue b/frontend/src/components/widgets/ExerciseControlPanel.vue index 3a087693..d200226b 100644 --- a/frontend/src/components/widgets/ExerciseControlPanel.vue +++ b/frontend/src/components/widgets/ExerciseControlPanel.vue @@ -1,18 +1,18 @@