From 106797a70afe3136bcec0021782d7f2d908db7cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Thu, 14 Sep 2023 03:59:33 +0000 Subject: [PATCH] BulmaDrawer: enum DrawerState --- ui/src/components/admin/CalendarAssistant.vue | 16 ++++----- ui/src/components/admin/ConfigView.vue | 15 ++++---- ui/src/components/admin/DoorMapEditor.vue | 15 ++++---- ui/src/components/bulma/Drawer.vue | 36 ++++++++++++------- 4 files changed, 43 insertions(+), 39 deletions(-) diff --git a/ui/src/components/admin/CalendarAssistant.vue b/ui/src/components/admin/CalendarAssistant.vue index a3944f2..2a210e1 100644 --- a/ui/src/components/admin/CalendarAssistant.vue +++ b/ui/src/components/admin/CalendarAssistant.vue @@ -3,8 +3,7 @@ @@ -54,7 +53,7 @@ import { Options, Vue } from "vue-class-component"; import MultiModal from "../MultiModal.vue"; import BulmaButton from "../bulma/Button.vue"; -import BulmaDrawer from "../bulma/Drawer.vue"; +import BulmaDrawer, { DrawerState } from "../bulma/Drawer.vue"; @Options({ components: { @@ -64,8 +63,7 @@ import BulmaDrawer from "../bulma/Drawer.vue"; }, }) export default class extends Vue { - public is_loaded = false; - public is_failed = false; + public drawer_state = DrawerState.Loading; public day_parts: DayStrModel[] = []; public day_image_names: DayStrModel[] = []; @@ -75,8 +73,7 @@ export default class extends Vue { }; public on_open(): void { - this.is_loaded = false; - this.is_failed = false; + this.drawer_state = DrawerState.Loading; Promise.all([ this.$advent22.api_get("admin/day_parts"), @@ -85,9 +82,10 @@ export default class extends Vue { .then(([day_parts, day_image_names]) => { this.day_parts = day_parts; this.day_image_names = day_image_names; - this.is_loaded = true; + + this.drawer_state = DrawerState.Ready; }) - .catch(() => (this.is_failed = true)); + .catch(() => (this.drawer_state = DrawerState.Failed)); } public door_click(day: number) { diff --git a/ui/src/components/admin/ConfigView.vue b/ui/src/components/admin/ConfigView.vue index bcd618b..2beb907 100644 --- a/ui/src/components/admin/ConfigView.vue +++ b/ui/src/components/admin/ConfigView.vue @@ -1,8 +1,7 @@