X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Fui-server%2Fui-services%2FAbstractUIService.ts;h=71b057abe4a2f7369c1376d97ffcc55046eb0e89;hb=7671fa0be211e944f027ebd83f3a0ad64c2ef2d6;hp=d3d1231d49c578d5b7a32626202fe50208a547c3;hpb=2896e06dc8d72adf7150b23c941079f622f6f37c;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ui-server/ui-services/AbstractUIService.ts b/src/charging-station/ui-server/ui-services/AbstractUIService.ts index d3d1231d..71b057ab 100644 --- a/src/charging-station/ui-server/ui-services/AbstractUIService.ts +++ b/src/charging-station/ui-server/ui-services/AbstractUIService.ts @@ -10,9 +10,10 @@ import { type ResponsePayload, ResponseStatus, } from '../../../types'; -import { logger } from '../../../utils/Logger'; -import { Utils } from '../../../utils/Utils'; -import { type AbstractUIServer, Bootstrap, UIServiceWorkerBroadcastChannel } from '../../internal'; +import { Utils, logger } from '../../../utils'; +import { Bootstrap } from '../../Bootstrap'; +import { UIServiceWorkerBroadcastChannel } from '../../broadcast-channel/UIServiceWorkerBroadcastChannel'; +import type { AbstractUIServer } from '../AbstractUIServer'; const moduleName = 'AbstractUIService'; @@ -31,6 +32,7 @@ export abstract class AbstractUIService { BroadcastChannelProcedureName.START_AUTOMATIC_TRANSACTION_GENERATOR, [ProcedureName.STOP_AUTOMATIC_TRANSACTION_GENERATOR]: BroadcastChannelProcedureName.STOP_AUTOMATIC_TRANSACTION_GENERATOR, + [ProcedureName.SET_SUPERVISION_URL]: BroadcastChannelProcedureName.SET_SUPERVISION_URL, [ProcedureName.START_TRANSACTION]: BroadcastChannelProcedureName.START_TRANSACTION, [ProcedureName.STOP_TRANSACTION]: BroadcastChannelProcedureName.STOP_TRANSACTION, [ProcedureName.AUTHORIZE]: BroadcastChannelProcedureName.AUTHORIZE, @@ -98,7 +100,7 @@ export abstract class AbstractUIService { }; } finally { // Send response for payload not forwarded to broadcast channel - if (responsePayload !== undefined) { + if (!Utils.isNullOrUndefined(responsePayload)) { this.sendResponse(messageId, responsePayload); } } @@ -151,7 +153,7 @@ export abstract class AbstractUIService { ): void { if (Utils.isNotEmptyArray(payload.hashIds)) { payload.hashIds = payload.hashIds - .filter((hashId) => hashId !== undefined) + .filter((hashId) => !Utils.isNullOrUndefined(hashId)) .map((hashId) => { if (this.uiServer.chargingStations.has(hashId) === true) { return hashId;