refactor(ui): move the charging stations data array to vue.js global
[e-mobility-charging-stations-simulator.git] / ui / web / src / components / charging-stations / CSConnector.vue
index f6cda45af6715868ebc8d0f312ccecd3646feec5..81d24face817efd795563e1e5127968091f1914f 100644 (file)
     </td>
     <td class="connectors-table__column">
       <Button @click="startTransaction()">Start Transaction</Button>
-      <!-- <IdTagInputModal
-        :visibility="state.isIdTagModalVisible"
-        :id-tag="state.idTag"
-        @close="hideIdTagModal()"
-        @done="compose(state.transaction, hideIdTagModal)()"
-      >
-        Start Transaction
-      </IdTagInputModal> -->
       <Button @click="stopTransaction()">Stop Transaction</Button>
       <Button @click="startAutomaticTransactionGenerator()">Start ATG</Button>
       <Button @click="stopAutomaticTransactionGenerator()">Stop ATG</Button>
 
 <script setup lang="ts">
 import { getCurrentInstance } from 'vue'
-// import { reactive } from 'vue'
-// import IdTagInputModal from '@/components/charging-stations/IdTagInputModal.vue'
 import Button from '@/components/buttons/Button.vue'
 import type { ConnectorStatus, Status } from '@/types'
-// import { compose } from '@/composables'
 
 const props = defineProps<{
   hashId: string
@@ -42,42 +31,18 @@ const props = defineProps<{
   idTag?: string
 }>()
 
-// type State = {
-//   isIdTagModalVisible: boolean
-//   idTag: string
-//   transaction: () => void
-// }
-
-// const state: State = reactive({
-//   isIdTagModalVisible: false,
-//   idTag: '',
-//   transaction: startTransaction
-// })
-
-// function getIdTag(transaction: () => void): void {
-//   state.transaction = transaction
-//   showTagModal()
-// }
-
-// function showTagModal(): void {
-//   state.isIdTagModalVisible = true
-// }
-// function hideIdTagModal(): void {
-//   state.isIdTagModalVisible = false
-// }
-
-const UIClient = getCurrentInstance()?.appContext.config.globalProperties.$UIClient
+const uiClient = getCurrentInstance()?.appContext.config.globalProperties.$uiClient
 
 function startTransaction(): void {
-  UIClient.startTransaction(props.hashId, props.connectorId, props.idTag)
+  uiClient.startTransaction(props.hashId, props.connectorId, props.idTag)
 }
 function stopTransaction(): void {
-  UIClient.stopTransaction(props.hashId, props.transactionId)
+  uiClient.stopTransaction(props.hashId, props.transactionId)
 }
 function startAutomaticTransactionGenerator(): void {
-  UIClient.startAutomaticTransactionGenerator(props.hashId, props.connectorId)
+  uiClient.startAutomaticTransactionGenerator(props.hashId, props.connectorId)
 }
 function stopAutomaticTransactionGenerator(): void {
-  UIClient.stopAutomaticTransactionGenerator(props.hashId, props.connectorId)
+  uiClient.stopAutomaticTransactionGenerator(props.hashId, props.connectorId)
 }
 </script>