]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
fix(ui): enable authorize for all OCPP versions in StartTransaction
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 3 Apr 2026 21:43:43 +0000 (23:43 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 3 Apr 2026 21:43:43 +0000 (23:43 +0200)
The OCPP 2.0.x authorize restriction was a UI-only limitation — the
simulator stack already handles Authorize for both 1.6 and 2.0.x.
Remove the isOCPP20x guard so the checkbox is available for all versions.

ui/web/src/components/actions/StartTransaction.vue
ui/web/tests/unit/StartTransaction.test.ts

index 896641ffbc0b564570616f671e88ba74fac3e1db..62a7d8f7109edfafea919f807d193dbe010b42d5 100644 (file)
@@ -20,7 +20,7 @@
       type="text"
     >
   </p>
-  <p v-if="!isOCPP20x">
+  <p>
     Authorize RFID tag:
     <input
       v-model="state.authorizeIdTag"
@@ -42,13 +42,7 @@ import { useRoute, useRouter } from 'vue-router'
 import { useToast } from 'vue-toast-notification'
 
 import Button from '@/components/buttons/Button.vue'
-import {
-  convertToInt,
-  resetToggleButtonState,
-  ROUTE_NAMES,
-  UIClient,
-  useUIClient,
-} from '@/composables'
+import { convertToInt, resetToggleButtonState, ROUTE_NAMES, useUIClient } from '@/composables'
 import { type OCPPVersion } from '@/types'
 
 const props = defineProps<{
@@ -65,7 +59,6 @@ const evseId = computed(() =>
   $route.query.evseId != null ? Number($route.query.evseId) : undefined
 )
 const ocppVersion = computed(() => $route.query.ocppVersion as OCPPVersion | undefined)
-const isOCPP20x = computed(() => UIClient.isOCPP20x(ocppVersion.value))
 
 const state = ref<{ authorizeIdTag: boolean; idTag: string }>({
   authorizeIdTag: false,
@@ -81,7 +74,7 @@ const toggleButtonId = computed(
 const handleStartTransaction = async (): Promise<void> => {
   const idTag = state.value.idTag.length > 0 ? state.value.idTag : undefined
 
-  if (!isOCPP20x.value && state.value.authorizeIdTag) {
+  if (state.value.authorizeIdTag) {
     if (idTag == null) {
       $toast.error('Please provide an RFID tag to authorize')
       return
index 4f00c97b220ecdecdeb649b615f74883e14227d5..750f24c7f1fcbba350aba8edf3779b95c687fd0e 100644 (file)
@@ -93,9 +93,9 @@ describe('StartTransaction', () => {
       expect(wrapper.find('[type="checkbox"]').exists()).toBe(true)
     })
 
-    it('should hide authorize checkbox for OCPP 2.0.x', () => {
+    it('should show authorize checkbox for OCPP 2.0.x', () => {
       const wrapper = mountComponent({ ocppVersion: OCPPVersion.VERSION_20 })
-      expect(wrapper.find('[type="checkbox"]').exists()).toBe(false)
+      expect(wrapper.find('[type="checkbox"]').exists()).toBe(true)
     })
   })