refactor(ui): remove dead code
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 17 Feb 2024 15:10:27 +0000 (16:10 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 17 Feb 2024 15:10:27 +0000 (16:10 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
ui/web/src/components/Modal.vue [deleted file]
ui/web/src/components/charging-stations/CSConnector.vue
ui/web/src/components/charging-stations/CSData.vue
ui/web/src/components/charging-stations/CSInfoModal.vue [deleted file]
ui/web/src/components/charging-stations/IdTagInputModal.vue [deleted file]
ui/web/src/composables/Utils.ts [deleted file]
ui/web/src/composables/index.ts
ui/web/src/views/ChargingStationsView.vue

diff --git a/ui/web/src/components/Modal.vue b/ui/web/src/components/Modal.vue
deleted file mode 100644 (file)
index 7463086..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<template>
-  <teleport to="body">
-    <div v-if="props.visibility" id="backdrop" @click.self="close()">
-      <slot></slot>
-    </div>
-  </teleport>
-</template>
-
-<script setup lang="ts">
-const props = defineProps<{
-  visibility: boolean
-}>()
-
-const emit = defineEmits(['close'])
-
-function close() {
-  emit('close')
-}
-</script>
-
-<style>
-#backdrop {
-  position: fixed;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  inset: 0;
-  background-color: black;
-}
-</style>
index f6cda45af6715868ebc8d0f312ccecd3646feec5..a2e94b9988a7fbf4f9aa659d70baa9c947b17893 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,30 +31,6 @@ 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
 
 function startTransaction(): void {
index 44aed70907e013bba5e0fc6369a9855aa4cc2904..c5eda783e79069d45c41beede939c2fdae16d3e4 100644 (file)
@@ -53,7 +53,6 @@
 </template>
 
 <script setup lang="ts">
-// import { reactive } from 'vue'
 import { getCurrentInstance } from 'vue'
 import CSConnector from '@/components/charging-stations/CSConnector.vue'
 import type { ChargingStationData, ChargingStationInfo, ConnectorStatus, Status } from '@/types'
@@ -63,16 +62,6 @@ const props = defineProps<{
   idTag: string
 }>()
 
-// type State = {
-//   isTagModalVisible: boolean
-//   idTag: string
-// }
-
-// const state: State = reactive({
-//   isTagModalVisible: false,
-//   idTag: ''
-// })
-
 function getStarted(): string {
   return props.chargingStation.started === true ? 'Yes' : 'No'
 }
@@ -151,12 +140,6 @@ function closeConnection(): void {
 function deleteChargingStation(): void {
   UIClient.deleteChargingStation(getHashId())
 }
-// function showTagModal(): void {
-//   state.isTagModalVisible = true
-// }
-// function hideTagModal(): void {
-//   state.isTagModalVisible = false
-// }
 </script>
 
 <style>
diff --git a/ui/web/src/components/charging-stations/CSInfoModal.vue b/ui/web/src/components/charging-stations/CSInfoModal.vue
deleted file mode 100644 (file)
index 9e0d1cd..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<template>
-  <Modal :visibility="props.isVisible">
-    <div>vendor: {{ props.stationInfo.chargePointVendor }}</div>
-  </Modal>
-</template>
-
-<script setup lang="ts">
-import type { ChargingStationInfo } from '@/types'
-import Modal from '@/components/Modal.vue'
-
-const props = defineProps<{
-  stationInfo: ChargingStationInfo
-  isVisible: boolean
-}>()
-</script>
diff --git a/ui/web/src/components/charging-stations/IdTagInputModal.vue b/ui/web/src/components/charging-stations/IdTagInputModal.vue
deleted file mode 100644 (file)
index ab965a7..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<template>
-  <Modal :visibility="props.visibility">
-    <label for="idTag">IdTag</label>
-    <!-- eslint-disable-next-line vue/no-mutating-props -->
-    <input v-model="props.idTag" type="text" name="idTag" @keypress.enter="done()" />
-    <Button @click="done()">
-      <slot></slot>
-    </Button>
-  </Modal>
-</template>
-
-<script setup lang="ts">
-import Button from '@/components/buttons/Button.vue'
-import Modal from '@/components/Modal.vue'
-
-const props = defineProps<{
-  visibility: boolean
-  idTag: string
-}>()
-
-const emit = defineEmits(['done'])
-
-function done() {
-  emit('done')
-}
-</script>
diff --git a/ui/web/src/composables/Utils.ts b/ui/web/src/composables/Utils.ts
deleted file mode 100644 (file)
index 54d926a..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-export const compose = <T>(...fns: ((arg: T) => T)[]): ((x: T) => T) => {
-  return (x: T) => fns.reduceRight((y, fn) => fn(y), x)
-}
index c5bd756f43839265680dae95491de1a7b30df11d..a4b40639498a77ddd2d207350bd4f069c849b24a 100644 (file)
@@ -1,2 +1 @@
 export { UIClient } from './UIClient'
-export { compose } from './Utils'
index 92ec0555bda39dc583a2555abdb72f4c9c5742b2..93fc88b25a38ae991911cde74ce594600dfae364 100644 (file)
@@ -68,7 +68,7 @@ function stopSimulator(): void {
 
 #inputs-container {
   display: flex;
-  justify-content: space-between;
+  flex-direction: row;
 }
 
 #reload-button {