Skip to content

Commit

Permalink
Typescript migration menu network report (#620)
Browse files Browse the repository at this point in the history
* Migration TS component/menu and component/network

* add DISCONNECTOR and BREAKER types

* change voltageLevelId type

---------

Signed-off-by: TOURI ANIS <anis-1.touri@rte-france.com>
  • Loading branch information
anistouri authored Nov 5, 2024
1 parent a5da923 commit 1b70223
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/utils/types/equipmentType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ export enum EquipmentType {
VSC_CONVERTER_STATION = 'VSC_CONVERTER_STATION',
LCC_CONVERTER_STATION = 'LCC_CONVERTER_STATION',
DANGLING_LINE = 'DANGLING_LINE',
TIE_LINE = 'TIE_LINE',
DISCONNECTOR = 'DISCONNECTOR',
BREAKER = 'BREAKER',
}

// Must be equivalent as the back enum
Expand Down Expand Up @@ -149,6 +152,9 @@ export const EQUIPMENT_TYPE: Record<EquipmentType, { name: EquipmentType; tagLab
name: EquipmentType.LCC_CONVERTER_STATION,
tagLabel: 'equipment_search/lccConverterStationTag',
},
[EquipmentType.TIE_LINE]: undefined, // Not used in the UI
[EquipmentType.DISCONNECTOR]: undefined, // Not used in the UI
[EquipmentType.BREAKER]: undefined, // Not used in the UI
};

export interface Identifiable {
Expand All @@ -167,8 +173,21 @@ export interface EquipmentInfos extends Identifiable {
type: EquipmentType;
voltageLevelLabel?: string;
voltageLevelId?: string;
operatingStatus?: string;
terminal1Connected?: boolean;
terminal2Connected?: boolean;
voltageLevelId1?: string;
voltageLevelName1?: string;
voltageLevelId2?: string;
voltageLevelName2?: string;
}

export const OperatingStatus = {
IN_OPERATION: 'IN_OPERATION',
PLANNED_OUTAGE: 'PLANNED_OUTAGE',
FORCED_OUTAGE: 'FORCED_OUTAGE',
};

export const getEquipmentsInfosForSearchBar = (
equipmentsInfos: Equipment[],
getNameOrId: (e: Identifiable) => string
Expand Down

0 comments on commit 1b70223

Please sign in to comment.