Skip to content

Commit 21e2954

Browse files
authored
refactor(editors/subscriber...): Naming in GOOSE/SMV Subscriber plugins (openscd#991)
* Improve terminology and headings for GOOSE and SMV subscribing plugins, closes openscd#729 and related to openscd#958 * Update snapshots * Tidy up rebase * Revert snapshots incorrectly added * Update following review comments * Update snapshots * Make lists activatable, partly resolves openscd#958 * Update translations for later binding description * Update snapshots * Reset selection on first entry * Remove unnecessary styling * Tidying title generation logic and unnecessary imports * Update German translation
1 parent 4f1a937 commit 21e2954

21 files changed

+233
-127
lines changed

src/editors/GooseControlSubscription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default class GooseControlSubscriptionPlugin extends LitElement {
7676
<div class="container">
7777
${view == View.PUBLISHER
7878
? html`<goose-list class="row" .doc=${this.doc}></goose-list>`
79-
: html`<ied-list class="row" .doc=${this.doc}></ied-list>`}
79+
: html`<ied-list class="row" .doc=${this.doc} serviceType="goose"></ied-list>`}
8080
<subscriber-list-goose
8181
class="row"
8282
.doc=${this.doc}

src/editors/SampledValuesSubscription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default class SampledValuesSubscriberPlugin extends LitElement {
7474
<div class="container">
7575
${view == View.PUBLISHER
7676
? html`<smv-list class="row" .doc=${this.doc}></smv-list>`
77-
: html`<ied-list class="row" .doc=${this.doc}></ied-list>`}
77+
: html`<ied-list class="row" .doc=${this.doc} serviceType="smv"></ied-list>`}
7878
<subscriber-list-smv class="row" .doc=${this.doc}></subscriber-list-smv>
7979
</div>
8080
</div>`;

src/editors/subscription/foundation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export class SubscriberListContainer extends LitElement {
286286
/** List holding all current subscribed Elements. */
287287
subscribedElements: ListElement[] = [];
288288

289-
/** List holding all current avaialble Elements which are not subscribed. */
289+
/** List holding all current available Elements which are not subscribed. */
290290
availableElements: ListElement[] = [];
291291

292292
/** Current selected IED (when in Subscriber view) */

src/editors/subscription/goose/goose-list.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,15 @@ export class GooseList extends LitElement {
8787
);
8888
}
8989

90+
protected firstUpdated(): void {
91+
selectedGseControl = undefined;
92+
selectedDataSet = undefined;
93+
}
94+
9095
render(): TemplateResult {
9196
return html` <section tabindex="0">
92-
<h1>${translate('subscription.goose.publisherGoose.title')}</h1>
93-
<filtered-list>
97+
<h1>${translate('subscription.goose.publisher.title')}</h1>
98+
<filtered-list activatable>
9499
${getOrderedIeds(this.doc).map(
95100
ied =>
96101
html`

src/editors/subscription/goose/subscriber-list.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,21 +397,25 @@ export class SubscriberList extends SubscriberListContainer {
397397

398398
return view == View.PUBLISHER
399399
? html`<h1>
400-
${translate('subscription.goose.publisherGoose.subscriberTitle', {
400+
${translate('subscription.goose.publisher.subscriberTitle', {
401401
selected: gseControlName
402402
? this.currentGooseIedName + ' > ' + gseControlName
403403
: 'GOOSE',
404404
})}
405405
</h1>`
406406
: html`<h1>
407-
${translate('subscription.goose.subscriberGoose.publisherTitle', {
407+
${translate('subscription.goose.subscriber.publisherTitle', {
408408
selected: this.currentSelectedIed
409409
? this.currentSelectedIed.getAttribute('name')!
410410
: 'IED',
411411
})}
412412
</h1>`;
413413
}
414414

415+
protected firstUpdated(): void {
416+
this.currentSelectedIed = undefined
417+
}
418+
415419
render(): TemplateResult {
416420
return html`
417421
<section tabindex="0">

src/editors/subscription/ied-list.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ export class IedList extends LitElement {
2727
@property()
2828
doc!: XMLDocument;
2929

30+
@property({ type: String })
31+
serviceType?: 'goose' | 'smv';
32+
3033
private onIedSelect(element: Element): void {
3134
selectedIed = element;
3235

@@ -37,10 +40,14 @@ export class IedList extends LitElement {
3740
this.dispatchEvent(newIEDSelectEvent(selectedIed));
3841
}
3942

43+
protected firstUpdated(): void {
44+
selectedIed = undefined;
45+
}
46+
4047
render(): TemplateResult {
4148
return html` <section tabindex="0">
42-
<h1>${translate('subscription.iedList.title')}</h1>
43-
<filtered-list>
49+
<h1>${translate(`subscription.${this.serviceType}.subscriber.iedListTitle`)}</h1>
50+
<filtered-list activatable>
4451
${getOrderedIeds(this.doc).map(
4552
ied =>
4653
html`

src/editors/subscription/later-binding/ext-ref-later-binding-list.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ import {
1414
cloneElement,
1515
compareNames,
1616
getDescriptionAttribute,
17-
getNameAttribute,
1817
identity,
1918
newActionEvent,
2019
Replace,
2120
getSclSchemaVersion,
2221
} from '../../../foundation.js';
2322

2423
import { styles, updateExtRefElement, serviceTypes } from '../foundation.js';
25-
import { FcdaSelectEvent, getFcdaTitleValue } from './foundation.js';
24+
import { FcdaSelectEvent } from './foundation.js';
2625

2726
/**
2827
* A sub element for showing all Ext Refs from a FCDA Element.
@@ -236,19 +235,8 @@ export class ExtRefLaterBindingList extends LitElement {
236235
}
237236

238237
private renderTitle(): TemplateResult {
239-
const controlElementName = this.currentSelectedControlElement
240-
? getNameAttribute(this.currentSelectedControlElement)
241-
: undefined;
242-
const fcdaName = this.currentSelectedFcdaElement
243-
? getFcdaTitleValue(this.currentSelectedFcdaElement)
244-
: undefined;
245-
246238
return html`<h1>
247-
${translate('subscription.laterBinding.extRefList.title', {
248-
controlTag: this.controlTag,
249-
controlElementName: controlElementName ?? '-',
250-
fcdaName: fcdaName ?? '-',
251-
})}
239+
${translate(`subscription.laterBinding.extRefList.title`)}
252240
</h1>`;
253241
}
254242

src/editors/subscription/later-binding/fcda-later-binding-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export class FCDALaterBindingList extends LitElement {
143143
`subscription.laterBinding.${this.controlTag}.controlBlockList.title`
144144
)}
145145
</h1>
146-
<filtered-list>
146+
<filtered-list activatable>
147147
${controlElements.map(controlElement => {
148148
const fcdaElements = this.getFcdaElements(controlElement);
149149
return html`

src/editors/subscription/sampledvalues/smv-list.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ export class SmvPublisherList extends LitElement {
6363
);
6464
}
6565

66+
protected firstUpdated(): void {
67+
selectedSmvMsg = undefined;
68+
selectedDataSet = undefined;
69+
}
70+
6671
renderSmv(smvControl: Element): TemplateResult {
6772
return html`<mwc-list-item
6873
@click=${() => this.onSelect(smvControl)}
@@ -85,8 +90,8 @@ export class SmvPublisherList extends LitElement {
8590

8691
render(): TemplateResult {
8792
return html` <section tabindex="0">
88-
<h1>${translate('subscription.smv.publisherSmv.title')}</h1>
89-
<filtered-list>
93+
<h1>${translate('subscription.smv.publisher.title')}</h1>
94+
<filtered-list activatable>
9095
${getOrderedIeds(this.doc).map(
9196
ied =>
9297
html`

src/editors/subscription/sampledvalues/subscriber-list.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,21 +399,25 @@ export class SubscriberList extends SubscriberListContainer {
399399

400400
return view == View.PUBLISHER
401401
? html`<h1>
402-
${translate('subscription.smv.publisherSmv.subscriberTitle', {
402+
${translate('subscription.smv.publisher.subscriberTitle', {
403403
selected: gseControlName
404404
? this.currentSmvIedName + ' > ' + gseControlName
405405
: 'Sampled Value',
406406
})}
407407
</h1>`
408408
: html`<h1>
409-
${translate('subscription.smv.subscriberSmv.publisherTitle', {
409+
${translate('subscription.smv.subscriber.publisherTitle', {
410410
selected: this.currentSelectedIed
411411
? this.currentSelectedIed.getAttribute('name')!
412412
: 'IED',
413413
})}
414414
</h1>`;
415415
}
416416

417+
protected firstUpdated(): void {
418+
this.currentSelectedIed = undefined
419+
}
420+
417421
render(): TemplateResult {
418422
return html`
419423
<section tabindex="0">

0 commit comments

Comments
 (0)