Skip to content

Commit

Permalink
fix(subscription) Coalesce lack of prefix to empty string, allow no p…
Browse files Browse the repository at this point in the history
…refix in FCDA description (openscd#1078)

Coalesce lack of prefix to empty string, allow no prefix in FCDA description, closes openscd#1076

Co-authored-by: Dennis Labordus <dennis.labordus@alliander.com>
  • Loading branch information
danyill and Dennis Labordus authored Nov 16, 2022
1 parent 3f6b659 commit 2963c27
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
16 changes: 10 additions & 6 deletions src/editors/subscription/foundation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { css, LitElement, query } from 'lit-element';
import { css, html, LitElement, query } from 'lit-element';
import { nothing } from 'lit-html';

import {
cloneElement,
compareNames,
Expand Down Expand Up @@ -109,12 +111,14 @@ export function getFcdaTitleValue(fcdaElement: Element): string {

export function getFcdaSubtitleValue(fcdaElement: Element): string {
return `${fcdaElement.getAttribute('ldInst')} ${
fcdaElement.hasAttribute('ldInst') && fcdaElement.hasAttribute('prefix')
? `/`
fcdaElement.hasAttribute('ldInst') ? `/` : ''
}${
fcdaElement.getAttribute('prefix')
? ` ${fcdaElement.getAttribute('prefix')}`
: ''
} ${fcdaElement.getAttribute('prefix')} ${fcdaElement.getAttribute(
'lnClass'
)} ${fcdaElement.getAttribute('lnInst')}`;
} ${fcdaElement.getAttribute('lnClass')} ${fcdaElement.getAttribute(
'lnInst'
)}`;
}

export function existExtRef(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -679,19 +679,19 @@ snapshots["fcda-binding-list with a GSEControl doc loaded looks like the latest
value="
GOOSE_Publisher>>QB2_Disconnector>GOOSE2
Pos.stVal
QB2_Disconnector / CSWI 1
QB2_Disconnector / CSWI 1
GOOSE_Publisher>>QB2_Disconnector>GOOSE2sDataSet>QB2_Disconnector/ CSWI 1.Pos stVal (ST)
Pos.q
QB2_Disconnector / CSWI 1
QB2_Disconnector / CSWI 1
GOOSE_Publisher>>QB2_Disconnector>GOOSE2sDataSet>QB2_Disconnector/ CSWI 1.Pos q (ST)
EnaOpn.stVal
QB1_Disconnector null CILO 1
QB1_Disconnector / CILO 1
GOOSE_Publisher>>QB2_Disconnector>GOOSE2sDataSet>QB1_Disconnector/ CILO 1.EnaOpn stVal (ST)
EnaCls.stVal
QB1_Disconnector / CILO 1
QB1_Disconnector / CILO 1
GOOSE_Publisher>>QB2_Disconnector>GOOSE2sDataSet>QB1_Disconnector/ CILO 1.EnaCls stVal (ST)
EnaOpn.stVal
QB2_Disconnector null CILO 1
QB2_Disconnector / CILO 1
GOOSE_Publisher>>QB2_Disconnector>GOOSE2sDataSet>QB2_Disconnector/ CILO 1.EnaOpn stVal (ST)"
>
<mwc-icon-button
Expand Down Expand Up @@ -729,7 +729,7 @@ snapshots["fcda-binding-list with a GSEControl doc loaded looks like the latest
Pos.stVal
</span>
<span slot="secondary">
QB2_Disconnector / CSWI 1
QB2_Disconnector / CSWI 1
</span>
<mwc-icon slot="graphic">
subdirectory_arrow_right
Expand All @@ -753,7 +753,7 @@ snapshots["fcda-binding-list with a GSEControl doc loaded looks like the latest
Pos.q
</span>
<span slot="secondary">
QB2_Disconnector / CSWI 1
QB2_Disconnector / CSWI 1
</span>
<mwc-icon slot="graphic">
subdirectory_arrow_right
Expand All @@ -776,7 +776,7 @@ snapshots["fcda-binding-list with a GSEControl doc loaded looks like the latest
EnaOpn.stVal
</span>
<span slot="secondary">
QB1_Disconnector null CILO 1
QB1_Disconnector / CILO 1
</span>
<mwc-icon slot="graphic">
subdirectory_arrow_right
Expand All @@ -796,7 +796,7 @@ snapshots["fcda-binding-list with a GSEControl doc loaded looks like the latest
EnaCls.stVal
</span>
<span slot="secondary">
QB1_Disconnector / CILO 1
QB1_Disconnector / CILO 1
</span>
<mwc-icon slot="graphic">
subdirectory_arrow_right
Expand All @@ -816,7 +816,7 @@ snapshots["fcda-binding-list with a GSEControl doc loaded looks like the latest
EnaOpn.stVal
</span>
<span slot="secondary">
QB2_Disconnector null CILO 1
QB2_Disconnector / CILO 1
</span>
<mwc-icon slot="graphic">
subdirectory_arrow_right
Expand All @@ -832,10 +832,10 @@ snapshots["fcda-binding-list with a GSEControl doc loaded looks like the latest
value="
GOOSE_Publisher>>QB2_Disconnector>GOOSE1
Pos.stVal
QB1_Disconnector / CSWI 1
QB1_Disconnector / CSWI 1
GOOSE_Publisher>>QB2_Disconnector>GOOSE1sDataSet>QB1_Disconnector/ CSWI 1.Pos stVal (ST)
Pos.q
QB1_Disconnector / CSWI 1
QB1_Disconnector / CSWI 1
GOOSE_Publisher>>QB2_Disconnector>GOOSE1sDataSet>QB1_Disconnector/ CSWI 1.Pos q (ST)"
>
<mwc-icon-button
Expand Down Expand Up @@ -872,7 +872,7 @@ snapshots["fcda-binding-list with a GSEControl doc loaded looks like the latest
Pos.stVal
</span>
<span slot="secondary">
QB1_Disconnector / CSWI 1
QB1_Disconnector / CSWI 1
</span>
<mwc-icon slot="graphic">
subdirectory_arrow_right
Expand All @@ -892,7 +892,7 @@ snapshots["fcda-binding-list with a GSEControl doc loaded looks like the latest
Pos.q
</span>
<span slot="secondary">
QB1_Disconnector / CSWI 1
QB1_Disconnector / CSWI 1
</span>
<mwc-icon slot="graphic">
subdirectory_arrow_right
Expand Down

0 comments on commit 2963c27

Please sign in to comment.