Skip to content

Commit

Permalink
chore: fixing type errors
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Munoz <juancho0202@gmail.com>
  • Loading branch information
juancho0202 committed Apr 17, 2024
1 parent fd7dc55 commit bba3937
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ import { createActions, createCheckActions } from '../foundation/actions.js';
import { getSignalName } from '../foundation/signalNames.js';

function getSwitchValue(wizard: Element, name: string): boolean {
const switchElement = wizard.shadowRoot?.querySelector<Switch>(
const switchElement = wizard.shadowRoot?.querySelector(
`mwc-switch[id="${name}"`
);
) as Switch;
return switchElement?.checked ?? false;
}

Expand Down
28 changes: 14 additions & 14 deletions packages/plugins/src/menu/SubscriberInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,47 +29,47 @@ function addIEDName(extRef: Element, gseControl: Element): Element | null {
.filter(item => !item.closest('Private'))
.filter(
iedName =>
iedName.innerHTML === ied.getAttribute('name') &&
iedName.innerHTML === ied?.getAttribute('name') &&
(iedName.getAttribute('apRef') ?? '') ===
(accPoint.getAttribute('name') ?? '') &&
(accPoint?.getAttribute('name') ?? '') &&
(iedName.getAttribute('ldInst') ?? '') ===
(lDevice.getAttribute('inst') ?? '') &&
(lDevice?.getAttribute('inst') ?? '') &&
(iedName.getAttribute('prefix') ?? '') ===
(anyln.getAttribute('prefix') ?? '') &&
(anyln?.getAttribute('prefix') ?? '') &&
(iedName.getAttribute('lnClass') ?? '') ===
(anyln.getAttribute('lnClass') ?? '') &&
(anyln?.getAttribute('lnClass') ?? '') &&
(iedName.getAttribute('lnInst') ?? '') ===
(anyln.getAttribute('inst') ?? '')
(anyln?.getAttribute('inst') ?? '')
).length === 0
) {
const iedName: Element = createElement(
gseControl.ownerDocument,
'IEDName',
{
apRef: accPoint.getAttribute('name') ?? '',
ldInst: lDevice.getAttribute('inst') ?? '',
prefix: anyln.getAttribute('prefix') ?? '',
lnClass: anyln.getAttribute('lnClass') ?? '',
lnInst: anyln.getAttribute('inst') || null,
apRef: accPoint?.getAttribute('name') ?? '',
ldInst: lDevice?.getAttribute('inst') ?? '',
prefix: anyln?.getAttribute('prefix') ?? '',
lnClass: anyln?.getAttribute('lnClass') ?? '',
lnInst: anyln?.getAttribute('inst') || null,
}
);
iedName.innerHTML = ied.getAttribute('name')!;
iedName.innerHTML = ied?.getAttribute('name')!;

return iedName;
}

if (
Array.from(gseControl.getElementsByTagName('IEDName'))
.filter(item => !item.closest('Private'))
.filter(iedName => iedName.innerHTML === ied.getAttribute('name'))
.filter(iedName => iedName.innerHTML === ied?.getAttribute('name'))
.length === 0
) {
const iedName: Element = createElement(
gseControl.ownerDocument,
'IEDName',
{}
);
iedName.innerHTML = ied.getAttribute('name')!;
iedName.innerHTML = ied?.getAttribute('name')!;

return iedName;
}
Expand Down

0 comments on commit bba3937

Please sign in to comment.