Skip to content

Commit 2501fb7

Browse files
authored
refactor(wizards/ConductingEquipment): Correct earth switch symbol application to ConductingEquipment
1 parent 0a2d5a4 commit 2501fb7

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/wizards/conductingequipment.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,8 @@ function containsEarthSwitchDefinition(condEq: Element): boolean {
168168
*/
169169
export function typeStr(condEq: Element): string {
170170
if (
171-
containsGroundedTerminal(condEq) ||
172-
(condEq.getAttribute('type') === 'DIS' &&
173-
containsEarthSwitchDefinition(condEq))
171+
condEq.getAttribute('type') === 'DIS' &&
172+
(containsGroundedTerminal(condEq) || containsEarthSwitchDefinition(condEq))
174173
) {
175174
// these checks only carried out for a three phase system
176175
return 'ERS';
@@ -268,7 +267,10 @@ export function createAction(parent: Element): WizardActor {
268267
};
269268
}
270269

271-
export function reservedNamesConductingEquipment(parent: Element, currentName?: string | null): string[] {
270+
export function reservedNamesConductingEquipment(
271+
parent: Element,
272+
currentName?: string | null
273+
): string[] {
272274
return Array.from(parent.querySelectorAll('ConductingEquipment'))
273275
.filter(isPublic)
274276
.map(condEq => condEq.getAttribute('name') ?? '')
@@ -287,15 +289,22 @@ export function createConductingEquipmentWizard(parent: Element): Wizard {
287289
label: get('add'),
288290
action: createAction(parent),
289291
},
290-
content: renderConductingEquipmentWizard('', '', 'create', '', reservedNames),
292+
content: renderConductingEquipmentWizard(
293+
'',
294+
'',
295+
'create',
296+
'',
297+
reservedNames
298+
),
291299
},
292300
];
293301
}
294302

295303
export function editConductingEquipmentWizard(element: Element): Wizard {
296304
const reservedNames = reservedNamesConductingEquipment(
297305
<Element>element.parentNode!,
298-
element.getAttribute('name'));
306+
element.getAttribute('name')
307+
);
299308

300309
return [
301310
{

0 commit comments

Comments
 (0)