]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
refactor(webui): add StateButton, centralize active style, fix refresh lifecycle
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 25 Mar 2026 20:30:03 +0000 (21:30 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 25 Mar 2026 20:30:03 +0000 (21:30 +0100)
commit9eab3d0f3c77975e247925c8d822467570b4dc81
tree57a84159847fbfc7bc36d36c9aa9cdb1f661dc87
parented33bc6638a560d95cedfc606189a3f565bd3512
refactor(webui): add StateButton, centralize active style, fix refresh lifecycle

- StateButton: stateless toggle driven by server state (active prop)
- Button: owns .button--active CSS, ToggleButton/StateButton pass :active
- Conditional buttons: show Start/Stop, Open/Close, Lock/Unlock based on state
- refreshChargingStations(): shared composable eliminates 4x duplicated refresh
- executeAction() helper in CSData/CSConnector: DRY action/toast/refresh
- Fix: trigger getChargingStations() on need-refresh event
- Fix: refresh after AddChargingStations, StartTransaction, SetSupervisionUrl
- table-layout: fixed on connectors table to prevent overflow
16 files changed:
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/Button.vue
ui/web/src/components/buttons/StateButton.vue [new file with mode: 0644]
ui/web/src/components/buttons/ToggleButton.vue
ui/web/src/components/charging-stations/CSConnector.vue
ui/web/src/components/charging-stations/CSData.vue
ui/web/src/composables/Utils.ts
ui/web/src/composables/index.ts
ui/web/src/views/ChargingStationsView.vue
ui/web/tests/unit/CSConnector.test.ts
ui/web/tests/unit/CSData.test.ts
ui/web/tests/unit/ChargingStationsView.test.ts
ui/web/tests/unit/ToggleButton.test.ts
ui/web/tests/unit/helpers.ts