From: Jérôme Benoit Date: Sat, 2 Mar 2024 10:46:54 +0000 (+0100) Subject: refactor(ui): strong type pages ref X-Git-Tag: v1.2.38~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=cf959670a5fe40c5279d6e08989f5b31ee06a64d;p=e-mobility-charging-stations-simulator.git refactor(ui): strong type pages ref Signed-off-by: Jérôme Benoit --- 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) })