refactor(ui): strong type pages ref
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 2 Mar 2024 10:46:54 +0000 (11:46 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 2 Mar 2024 10:46:54 +0000 (11:46 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
ui/web/src/components/actions/AddChargingStations.vue
ui/web/src/components/actions/SetSupervisionUrl.vue
ui/web/src/components/actions/StartTransaction.vue
ui/web/src/components/buttons/ToggleButton.vue

index 9c7224fb02f3ffac512c41490d1f96a22f8703fc..f3450e1b0d307cfe1f6ad7c0d82e91644e32bace 100644 (file)
@@ -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: '',
index 2b7ef4a251a5b6c846a696da34038362f7e95147..1406db53919cf4595e0dfcf9c0dacd3ccad9f748 100644 (file)
@@ -43,7 +43,7 @@ defineProps<{
   chargingStationId: string
 }>()
 
-const state = ref({
+const state = ref<{ supervisionUrl: string }>({
   supervisionUrl: ''
 })
 
index cdf85938155a2bc5f381a86785d963dcd9926a4c..99ef311809e59caa56f5153cb5616998664ba48a 100644 (file)
@@ -39,7 +39,7 @@ defineProps<{
   connectorId: string
 }>()
 
-const state = ref({
+const state = ref<{ idTag: string }>({
   idTag: ''
 })
 
index 8cdd1de7d4bd22e5d26968d0613288ffe8e29c99..5b4d5c007d468f5bf1aeca56a77a0f7db1c340cf 100644 (file)
@@ -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<boolean>(id, props.status ?? false)
 })