]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
refactor(ui-web): import randomUUID/validateUUID directly from ui-common
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 17 Apr 2026 00:47:04 +0000 (02:47 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 17 Apr 2026 00:47:04 +0000 (02:47 +0200)
Remove re-exports from composables/Utils.ts and composables/index.ts.
Consumers now import directly from ui-common.

ui/web/src/components/actions/AddChargingStations.vue
ui/web/src/composables/Utils.ts
ui/web/src/composables/index.ts
ui/web/src/views/ChargingStationsView.vue
ui/web/tests/unit/Utils.test.ts

index fe820e27830bded2a55bd3aacba6866cf4250887..159a4006ba4874854a91e9b0d140a9ff33324d4a 100644 (file)
 </template>
 
 <script setup lang="ts">
-import type { UUIDv4 } from 'ui-common'
-
+import { randomUUID, type UUIDv4 } from 'ui-common'
 import { ref, watch } from 'vue'
 import { useRouter } from 'vue-router'
 
 import Button from '@/components/buttons/Button.vue'
 import {
   convertToBoolean,
-  randomUUID,
   resetToggleButtonState,
   ROUTE_NAMES,
   useExecuteAction,
index 7afeee00086cbc5b84b72e29469ff735deb399b3..727a86738dc2310900261f84ae71c2c213c8bde8 100644 (file)
@@ -1,7 +1,6 @@
 import type { ChargingStationData, ConfigurationData } from 'ui-common'
 import type { InjectionKey, Ref } from 'vue'
 
-import { randomUUID, validateUUID } from 'ui-common'
 import { inject } from 'vue'
 import { useToast } from 'vue-toast-notification'
 
@@ -121,8 +120,6 @@ export const resetToggleButtonState = (id: string, shared = false): void => {
   deleteFromLocalStorage(key)
 }
 
-export { randomUUID, validateUUID }
-
 export const useUIClient = (): UIClient => {
   const injected = inject(uiClientKey, undefined)
   if (injected != null) return injected
index cfcc50e420ab1339fac7fff39a574563fed1d3ad..c63fc2df667115b1892a3884a94cf2fdc7835fb6 100644 (file)
@@ -16,7 +16,6 @@ export {
   getFromLocalStorage,
   getLocalStorage,
   getWebSocketStateName,
-  randomUUID,
   resetToggleButtonState,
   setToLocalStorage,
   templatesKey,
@@ -26,5 +25,4 @@ export {
   useExecuteAction,
   useTemplates,
   useUIClient,
-  validateUUID,
 } from './Utils'
index e3277e42a7ed9ce805a524d2e9cb4438d7d1646a..499abace879f60f9e17e567b506c9c2357e71560 100644 (file)
 </template>
 
 <script setup lang="ts">
-import type {
-  ChargingStationData,
-  ResponsePayload,
-  SimulatorState,
-  UIServerConfigurationSection,
-  UUIDv4,
+import {
+  type ChargingStationData,
+  randomUUID,
+  type ResponsePayload,
+  type SimulatorState,
+  type UIServerConfigurationSection,
+  type UUIDv4,
 } from 'ui-common'
-
 import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
 import { useToast } from 'vue-toast-notification'
 
@@ -122,7 +122,6 @@ import Container from '@/components/Container.vue'
 import {
   deleteLocalStorageByKeyPattern,
   getFromLocalStorage,
-  randomUUID,
   ROUTE_NAMES,
   setToLocalStorage,
   TOGGLE_BUTTON_KEY_PREFIX,
index 3637c5c3876a73529b787b7d6b3684b4edef7deb..ab8cd6886b798aa196b305b35d00ff7336fd0356 100644 (file)
@@ -3,6 +3,7 @@
  * @description Unit tests for type conversion, localStorage, UUID, and toggle state utilities.
  */
 import { flushPromises } from '@vue/test-utils'
+import { randomUUID, validateUUID } from 'ui-common'
 import { afterEach, describe, expect, it, vi } from 'vitest'
 
 import {
@@ -11,11 +12,9 @@ import {
   deleteFromLocalStorage,
   getFromLocalStorage,
   getLocalStorage,
-  randomUUID,
   resetToggleButtonState,
   setToLocalStorage,
   useExecuteAction,
-  validateUUID,
 } from '@/composables'
 
 import { toastMock } from '../setup'