Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/openscd/src/translations/loader.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { de } from './de.js';
import { en } from './en.js';
import { Language } from '@openscd/core/dist/foundation/deprecated/settings';
import { Language } from '@openscd/core/foundation/deprecated/settings';
export const languages = { en, de };

/**
Expand Down
58 changes: 0 additions & 58 deletions packages/plugins/src/directDialogMixin.ts

This file was deleted.

19 changes: 14 additions & 5 deletions packages/plugins/src/editors/Cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import { css, html, LitElement, property, TemplateResult } from 'lit-element';

import { styles } from './templates/foundation.js';
import { DirectDialogMixin } from '../directDialogMixin.js';
import { WizardMixin } from '../wizard-mixin.js';

import './cleanup/datasets-container.js';
import './cleanup/control-blocks-container.js';
import './cleanup/datatypes-container.js';

/** An editor [[`plugin`]] for cleaning SCL references and definitions. */
export default class Cleanup extends DirectDialogMixin {
export default class Cleanup extends WizardMixin {
/** The document being edited as provided to plugins by [[`OpenSCD`]]. */
@property()
doc!: XMLDocument;
Expand All @@ -20,9 +20,18 @@ export default class Cleanup extends DirectDialogMixin {
render(): TemplateResult {
return html`
<div class="cleanup">
<cleanup-datasets .editCount=${this.editCount} .doc=${this.doc}></cleanup-datasets>
<cleanup-control-blocks .editCount=${this.editCount} .doc=${this.doc}></cleanup-control-blocks>
<cleanup-data-types .editCount=${this.editCount} .doc=${this.doc}></cleanup-data-types>
<cleanup-datasets
.editCount=${this.editCount}
.doc=${this.doc}
></cleanup-datasets>
<cleanup-control-blocks
.editCount=${this.editCount}
.doc=${this.doc}
></cleanup-control-blocks>
<cleanup-data-types
.editCount=${this.editCount}
.doc=${this.doc}
></cleanup-data-types>
</div>
${this.renderWizardDialog()}
`;
Expand Down
25 changes: 13 additions & 12 deletions packages/plugins/src/editors/Communication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import './ied/access-point-container.js';
import {
newWizardEvent,
WizardEvent,
isPublic
isPublic,
} from '@openscd/open-scd/src/foundation.js';
import { createElement } from '@openscd/xml';
import { newActionEvent } from '@openscd/core/foundation/deprecated/editor.js';
import { wizards } from '../wizards/wizard-library.js';
import { createSubNetworkWizard } from '../wizards/subnetwork.js';
import { DirectDialogMixin } from '../directDialogMixin.js';
import { WizardMixin } from '../wizard-mixin.js';

/** An editor [[`plugin`]] for editing the `Communication` section. */
export default class CommunicationPlugin extends DirectDialogMixin {
export default class CommunicationPlugin extends WizardMixin {
/** The document being edited as provided to plugins by [[`OpenSCD`]]. */
@property()
doc!: XMLDocument;
Expand Down Expand Up @@ -55,15 +55,16 @@ export default class CommunicationPlugin extends DirectDialogMixin {
render(): TemplateResult {
if (!this.doc?.querySelector(':root > Communication >SubNetwork'))
return html`<h1>
<span style="color: var(--base1)">${get('communication.missing')}</span
><mwc-fab
extended
icon="add"
label="${get('subnetwork.wizard.title.add')}"
@click=${() => this.openCreateSubNetworkWizard()}
></mwc-fab>
</h1>
${this.renderWizardDialog()}`;
<span style="color: var(--base1)"
>${get('communication.missing')}</span
><mwc-fab
extended
icon="add"
label="${get('subnetwork.wizard.title.add')}"
@click=${() => this.openCreateSubNetworkWizard()}
></mwc-fab>
</h1>
${this.renderWizardDialog()}`;

return html`<mwc-fab
extended
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/src/editors/GooseSubscriberDataBinding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { Nsdoc } from '@openscd/open-scd/src/foundation/nsdoc.js';

import './subscription/fcda-binding-list.js';
import './subscription/later-binding/ext-ref-ln-binding-list.js';
import { DirectDialogMixin } from '../directDialogMixin.js';
import { WizardMixin } from '../wizard-mixin.js';

/** An editor [[`plugin`]] for Subscribe Data Binding (GOOSE). */
export default class GooseSubscribeDataBindingPlugin extends DirectDialogMixin {
export default class GooseSubscribeDataBindingPlugin extends WizardMixin {
@property({ attribute: false })
doc!: XMLDocument;
@property({ type: Number })
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/src/editors/GooseSubscriberMessageBinding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import './subscription/goose/subscriber-list.js';
import './subscription/goose/goose-list.js';
import './subscription/ied-list.js';
import { newViewEvent, View, ViewEvent } from './subscription/foundation.js';
import { DirectDialogMixin } from '../directDialogMixin.js';
import { WizardMixin } from '../wizard-mixin.js';

/** Defining view outside the class, which makes it persistent. */
let view: View = View.PUBLISHER;

/** An editor [[`plugin`]] for subscribing IEDs to GOOSE messages. */
export default class GooseSubscriberMessageBindingPlugin extends DirectDialogMixin {
export default class GooseSubscriberMessageBindingPlugin extends WizardMixin {
/** The document being edited as provided to plugins by [[`OpenSCD`]]. */
@property()
doc!: XMLDocument;
Expand Down
10 changes: 5 additions & 5 deletions packages/plugins/src/editors/IED.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import {
} from '@openscd/open-scd/src/foundation.js';
import { Nsdoc } from '@openscd/open-scd/src/foundation/nsdoc.js';
import { getIcon } from '@openscd/open-scd/src/icons/icons.js';
import { DirectDialogMixin } from '../directDialogMixin.js';
import { WizardMixin } from '../wizard-mixin.js';

/** An editor [[`plugin`]] for editing the `IED` section. */
export default class IedPlugin extends DirectDialogMixin {
export default class IedPlugin extends WizardMixin {
/** The document being edited as provided to plugins by [[`OpenSCD`]]. */
@property()
doc!: XMLDocument;
Expand Down Expand Up @@ -237,9 +237,9 @@ export default class IedPlugin extends DirectDialogMixin {
</section>`;
}
return html`<h1>
<span style="color: var(--base1)">${get('iededitor.missing')}</span>
</h1>
${this.renderWizardDialog()}`;
<span style="color: var(--base1)">${get('iededitor.missing')}</span>
</h1>
${this.renderWizardDialog()}`;
}

static styles = css`
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/src/editors/Protocol104.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ import {

import { newWizardEvent } from '@openscd/open-scd/src/foundation.js';
import { wizards } from '../wizards/wizard-library.js';
import { DirectDialogMixin } from '../directDialogMixin.js';
import { WizardMixin } from '../wizard-mixin.js';

/** Defining view outside the class, which makes it persistent. */
let selectedViewProtocol104Plugin: View = View.VALUES;

export default class Communication104Plugin extends DirectDialogMixin {
export default class Communication104Plugin extends WizardMixin {
@property()
doc!: XMLDocument;
@property({ type: Number })
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/src/editors/SMVSubscriberDataBinding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { Nsdoc } from '@openscd/open-scd/src/foundation/nsdoc.js';

import './subscription/fcda-binding-list.js';
import './subscription/later-binding/ext-ref-ln-binding-list.js';
import { DirectDialogMixin } from '../directDialogMixin.js';
import { WizardMixin } from '../wizard-mixin.js';

/** An editor [[`plugin`]] for Subscribe Data Binding (SMV). */
export default class SMVSubscribeDataBindingPlugin extends DirectDialogMixin {
export default class SMVSubscribeDataBindingPlugin extends WizardMixin {
@property({ attribute: false })
doc!: XMLDocument;
@property({ type: Number })
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/src/editors/SMVSubscriberMessageBinding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import './subscription/sampledvalues/subscriber-list.js';
import './subscription/sampledvalues/smv-list.js';
import './subscription/ied-list.js';
import { newViewEvent, View, ViewEvent } from './subscription/foundation.js';
import { DirectDialogMixin } from '../directDialogMixin.js';
import { WizardMixin } from '../wizard-mixin.js';

/** Defining view outside the class, which makes it persistent. */
let view: View = View.PUBLISHER;

/** An editor [[`plugin`]] for subscribing IEDs to Sampled Values. */
export default class SMVSubscriberMessageBindingPlugin extends DirectDialogMixin {
export default class SMVSubscriberMessageBindingPlugin extends WizardMixin {
/** The document being edited as provided to plugins by [[`OpenSCD`]]. */
@property()
doc!: XMLDocument;
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/src/editors/SingleLineDiagram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import { isSCLNamespace } from '@openscd/open-scd/src/schemas.js';
import { wizards } from './singlelinediagram/wizards/wizard-library.js';
import { SingleSelectedEvent } from '@material/mwc-list/mwc-list-foundation';
import { get } from '../translation.js';
import { DirectDialogMixin } from '../directDialogMixin.js';
import { WizardMixin } from '../wizard-mixin.js';

import '@material/mwc-list/mwc-list-item';
import '@material/mwc-select';
Expand All @@ -71,7 +71,7 @@ addEventListener('open-doc', onOpenDocResetSelectedSubstation);
/**
* Main class plugin for Single Line Diagram editor.
*/
export default class SingleLineDiagramPlugin extends DirectDialogMixin {
export default class SingleLineDiagramPlugin extends WizardMixin {
// The full given XML document.
@property({ attribute: false })
doc!: XMLDocument;
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/src/editors/Substation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import '@material/mwc-fab';
import './substation/zeroline-pane.js';
import { newWizardEvent } from '@openscd/open-scd/src/foundation.js';
import { wizards } from '../wizards/wizard-library.js';
import { DirectDialogMixin } from '../directDialogMixin.js';
import { WizardMixin } from '../wizard-mixin.js';

/** An editor [[`plugin`]] for editing the `Substation` section. */
export default class SubstationPlugin extends DirectDialogMixin {
export default class SubstationPlugin extends WizardMixin {
/** The document being edited as provided to plugins by [[`OpenSCD`]]. */
@property()
doc!: XMLDocument;
Expand Down
33 changes: 14 additions & 19 deletions packages/plugins/src/editors/Templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@ import '@material/mwc-list';
import '@material/mwc-list/mwc-list-item';

import '@openscd/open-scd/src/filtered-list.js';
import {
identity,
newWizardEvent,
} from '@openscd/open-scd/src/foundation.js';
import { identity, newWizardEvent } from '@openscd/open-scd/src/foundation.js';

import {
createElement,
} from '@openscd/xml';
import { createElement } from '@openscd/xml';

import { newActionEvent } from '@openscd/core/foundation/deprecated/editor.js';
import { styles } from './templates/foundation.js';
Expand All @@ -40,7 +35,7 @@ import { List } from '@material/mwc-list';
import { ListItem } from '@material/mwc-list/mwc-list-item';
import { SingleSelectedEvent } from '@material/mwc-list/mwc-list-foundation';

import { DirectDialogMixin } from '../directDialogMixin.js';
import { WizardMixin } from '../wizard-mixin.js';

const templates = fetch('public/xml/templates.scd')
.then(response => response.text())
Expand All @@ -55,14 +50,14 @@ const nsd7420 = fetch('public/xml/IEC_61850-7-420_2019A4.nsd')
.then(str => new DOMParser().parseFromString(str, 'application/xml'));

/** An editor [[`plugin`]] for editing the `DataTypeTemplates` section. */
export default class TemplatesPlugin extends DirectDialogMixin {
export default class TemplatesPlugin extends WizardMixin {
/** The document being edited as provided to plugins by [[`OpenSCD`]]. */
@property({ attribute: false })
doc!: XMLDocument;
@property({ type: Number })
editCount = -1;

@property({attribute:false}) api: unknown
@property({ attribute: false }) api: unknown;

updated(changedProperties: Map<string, unknown>): void {
if (changedProperties.has('api')) {
Expand Down Expand Up @@ -171,15 +166,15 @@ export default class TemplatesPlugin extends DirectDialogMixin {
render(): TemplateResult {
if (!this.doc?.querySelector(':root > DataTypeTemplates'))
return html`<h1>
<span style="color: var(--base1)">${get('templates.missing')}</span>
<mwc-fab
extended
icon="add"
label="${get('templates.add')}"
@click=${() => this.createDataTypeTemplates()}
></mwc-fab>
</h1>
${this.renderWizardDialog()}`;
<span style="color: var(--base1)">${get('templates.missing')}</span>
<mwc-fab
extended
icon="add"
label="${get('templates.add')}"
@click=${() => this.createDataTypeTemplates()}
></mwc-fab>
</h1>
${this.renderWizardDialog()}`;
return html`
<div id="containerTemplates">
<section tabindex="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ export function getDaElementByDaiElement(
* @param daElement - The DA Element for which to check.
*/
function isEnumType(daElement: Element | undefined) {
return daElement?.getAttribute('bType') === 'Enum' ?? false;
return daElement?.getAttribute('bType') === 'Enum';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class FcdaBindingList extends LitElement {
`fcda-binding-list-${
this.includeLaterBinding ? 'later-binding' : 'data-binding'
}-${this.controlTag}$hideSubscribed`
) === 'true' ?? false
) === 'true'
);
}

Expand All @@ -109,7 +109,7 @@ export class FcdaBindingList extends LitElement {
`fcda-binding-list-${
this.includeLaterBinding ? 'later-binding' : 'data-binding'
}-${this.controlTag}$hideNotSubscribed`
) === 'true' ?? false
) === 'true'
);
}

Expand Down
6 changes: 2 additions & 4 deletions packages/plugins/src/editors/substation/l-node-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import {
newWizardEvent,
} from '@openscd/open-scd/src/foundation.js';

import {
cloneElement,
} from '@openscd/xml';
import { cloneElement } from '@openscd/xml';

import { newActionEvent } from '@openscd/core/foundation/deprecated/editor.js';
import {
Expand Down Expand Up @@ -86,7 +84,7 @@ export class LNodeEditor extends LitElement {
}
@state()
private get missingIedReference(): boolean {
return this.element.getAttribute('iedName') === 'None' ?? false;
return this.element.getAttribute('iedName') === 'None';
}
@state()
private get isIEDReference(): boolean {
Expand Down
Loading
Loading