From cf959670a5fe40c5279d6e08989f5b31ee06a64d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 2 Mar 2024 11:46:54 +0100 Subject: [PATCH] refactor(ui): strong type pages ref MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- ui/web/src/components/actions/AddChargingStations.vue | 10 +++++++++- ui/web/src/components/actions/SetSupervisionUrl.vue | 2 +- ui/web/src/components/actions/StartTransaction.vue | 2 +- ui/web/src/components/buttons/ToggleButton.vue | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ui/web/src/components/actions/AddChargingStations.vue b/ui/web/src/components/actions/AddChargingStations.vue index 9c7224fb..f3450e1b 100644 --- a/ui/web/src/components/actions/AddChargingStations.vue +++ b/ui/web/src/components/actions/AddChargingStations.vue @@ -103,7 +103,15 @@ import { useToast } from 'vue-toast-notification' import Button from '@/components/buttons/Button.vue' import { convertToBoolean } from '@/composables' -const state = ref({ +const state = ref<{ + template: string + numberOfStations: number + supervisionUrl: string + autoStart: boolean + persistentConfiguration: boolean + ocppStrictCompliance: boolean + enableStatistics: boolean +}>({ template: '', numberOfStations: 1, supervisionUrl: '', diff --git a/ui/web/src/components/actions/SetSupervisionUrl.vue b/ui/web/src/components/actions/SetSupervisionUrl.vue index 2b7ef4a2..1406db53 100644 --- a/ui/web/src/components/actions/SetSupervisionUrl.vue +++ b/ui/web/src/components/actions/SetSupervisionUrl.vue @@ -43,7 +43,7 @@ defineProps<{ chargingStationId: string }>() -const state = ref({ +const state = ref<{ supervisionUrl: string }>({ supervisionUrl: '' }) diff --git a/ui/web/src/components/actions/StartTransaction.vue b/ui/web/src/components/actions/StartTransaction.vue index cdf85938..99ef3118 100644 --- a/ui/web/src/components/actions/StartTransaction.vue +++ b/ui/web/src/components/actions/StartTransaction.vue @@ -39,7 +39,7 @@ defineProps<{ connectorId: string }>() -const state = ref({ +const state = ref<{ idTag: string }>({ idTag: '' }) diff --git a/ui/web/src/components/buttons/ToggleButton.vue b/ui/web/src/components/buttons/ToggleButton.vue index 8cdd1de7..5b4d5c00 100644 --- a/ui/web/src/components/buttons/ToggleButton.vue +++ b/ui/web/src/components/buttons/ToggleButton.vue @@ -21,7 +21,7 @@ const $emit = defineEmits(['clicked']) const id = props.shared === true ? `shared-toggle-button-${props.id}` : `toggle-button-${props.id}` -const state = ref({ +const state = ref<{ status: boolean }>({ status: getFromLocalStorage(id, props.status ?? false) }) -- 2.34.1