From bfe50a0be4bad4a8a735273d0bb4092b649894f6 Mon Sep 17 00:00:00 2001 From: Steffen van den Driest Date: Thu, 4 Apr 2024 13:51:44 +0200 Subject: [PATCH 1/2] feat: add missing editor icons Signed-off-by: Steffen van den Driest --- packages/open-scd/src/icons/icons.ts | 195 ++++++++++++------ .../src/editors/substation/bay-editor.ts | 7 + .../src/editors/substation/line-editor.ts | 4 + .../src/editors/substation/process-editor.ts | 4 + .../editors/substation/substation-editor.ts | 5 + .../substation/transformer-winding-editor.ts | 4 + .../substation/voltage-level-editor.ts | 4 + .../__snapshots__/bay-editor.test.snap.js | 30 +++ .../__snapshots__/line-editor.test.snap.js | 15 ++ .../__snapshots__/process-editor.test.snap.js | 20 ++ .../substation-editor.test.snap.js | 25 +++ .../transformer-winding-editor.test.snap.js | 15 ++ .../voltage-level-editor.test.snap.js | 30 +++ 13 files changed, 294 insertions(+), 64 deletions(-) diff --git a/packages/open-scd/src/icons/icons.ts b/packages/open-scd/src/icons/icons.ts index f89b562263..90f9a49515 100644 --- a/packages/open-scd/src/icons/icons.ts +++ b/packages/open-scd/src/icons/icons.ts @@ -236,86 +236,64 @@ export const zeroLineIcon = html``; export const voltageLevelIcon = html` + + + + `; export const bayIcon = html` + + + - - - - `; @@ -684,3 +662,92 @@ export const sizableSmvIcon = svg` export const sizableGooseIcon = svg` `; + +export const substationIcon = svg` + + + + + + + + +`; +export const lineIcon = svg` + + + + + +`; +export const processIcon = svg` + + + + + +`; + +export const transformerWindingIcon = svg` + + + + + + + + + +`; diff --git a/packages/plugins/src/editors/substation/bay-editor.ts b/packages/plugins/src/editors/substation/bay-editor.ts index ed96c9c9bf..a455060c88 100644 --- a/packages/plugins/src/editors/substation/bay-editor.ts +++ b/packages/plugins/src/editors/substation/bay-editor.ts @@ -31,6 +31,10 @@ import { SCLTag, tags, } from '@openscd/open-scd/src/foundation.js'; +import { + bayIcon, + voltageLevelIcon, +} from '@openscd/open-scd/src/icons/icons.js'; import { emptyWizard, wizards } from '../../wizards/wizard-library.js'; import { cloneSubstationElement, @@ -185,6 +189,9 @@ export class BayEditor extends LitElement { render(): TemplateResult { return html`${this.renderRedirectUI()} + ${bayIcon} + ${lineIcon} + ${processIcon} + ${substationIcon} + ${transformerWindingIcon} + ${voltageLevelIcon} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Date: Thu, 4 Apr 2024 16:46:15 +0200 Subject: [PATCH 2/2] chore: removed inline styles Signed-off-by: Steffen van den Driest --- .../plugins/src/editors/substation/bay-editor.ts | 2 +- .../substation/conducting-equipment-editor.ts | 2 +- .../plugins/src/editors/substation/foundation.ts | 5 +++++ .../plugins/src/editors/substation/line-editor.ts | 2 +- .../editors/substation/powertransformer-editor.ts | 2 +- .../plugins/src/editors/substation/process-editor.ts | 2 +- .../src/editors/substation/substation-editor.ts | 2 +- .../editors/substation/transformer-winding-editor.ts | 2 +- .../src/editors/substation/voltage-level-editor.ts | 2 +- .../substation/__snapshots__/bay-editor.test.snap.js | 12 ++++++------ .../conducting-equipment-editor.test.snap.js | 8 ++++---- .../__snapshots__/line-editor.test.snap.js | 6 +++--- .../powertransformer-editor.test.snap.js | 8 ++++---- .../__snapshots__/process-editor.test.snap.js | 8 ++++---- .../__snapshots__/substation-editor.test.snap.js | 10 +++++----- .../transformer-winding-editor.test.snap.js | 6 +++--- .../__snapshots__/voltage-level-editor.test.snap.js | 12 ++++++------ 17 files changed, 48 insertions(+), 43 deletions(-) diff --git a/packages/plugins/src/editors/substation/bay-editor.ts b/packages/plugins/src/editors/substation/bay-editor.ts index a455060c88..cd00e79a35 100644 --- a/packages/plugins/src/editors/substation/bay-editor.ts +++ b/packages/plugins/src/editors/substation/bay-editor.ts @@ -189,7 +189,7 @@ export class BayEditor extends LitElement { render(): TemplateResult { return html`${this.renderRedirectUI()} - ${bayIcon} diff --git a/packages/plugins/src/editors/substation/conducting-equipment-editor.ts b/packages/plugins/src/editors/substation/conducting-equipment-editor.ts index 09b2c97024..7ddc082ccd 100644 --- a/packages/plugins/src/editors/substation/conducting-equipment-editor.ts +++ b/packages/plugins/src/editors/substation/conducting-equipment-editor.ts @@ -158,7 +158,7 @@ export class ConductingEquipmentEditor extends LitElement { } renderContentPane(): TemplateResult { - return html`${getIcon(this.element)} diff --git a/packages/plugins/src/editors/substation/foundation.ts b/packages/plugins/src/editors/substation/foundation.ts index 243646d716..11ff46ab61 100644 --- a/packages/plugins/src/editors/substation/foundation.ts +++ b/packages/plugins/src/editors/substation/foundation.ts @@ -679,4 +679,9 @@ export const styles = css` general-equipment-editor[showfunctions] { margin: 4px 8px 16px; } + + .substation-editor-icon { + width: 24px; + height: 24px; + } `; diff --git a/packages/plugins/src/editors/substation/line-editor.ts b/packages/plugins/src/editors/substation/line-editor.ts index 191283161e..b5c899fda9 100644 --- a/packages/plugins/src/editors/substation/line-editor.ts +++ b/packages/plugins/src/editors/substation/line-editor.ts @@ -171,7 +171,7 @@ export class LineEditor extends LitElement { } render(): TemplateResult { return html` - ${lineIcon} diff --git a/packages/plugins/src/editors/substation/powertransformer-editor.ts b/packages/plugins/src/editors/substation/powertransformer-editor.ts index d8c81c1780..5ba5288890 100644 --- a/packages/plugins/src/editors/substation/powertransformer-editor.ts +++ b/packages/plugins/src/editors/substation/powertransformer-editor.ts @@ -161,7 +161,7 @@ export class PowerTransformerEditor extends LitElement { } renderContentPane(): TemplateResult { - return html`${powerTransformerTwoWindingIcon} diff --git a/packages/plugins/src/editors/substation/process-editor.ts b/packages/plugins/src/editors/substation/process-editor.ts index 4f27aa4083..13cf43bc05 100644 --- a/packages/plugins/src/editors/substation/process-editor.ts +++ b/packages/plugins/src/editors/substation/process-editor.ts @@ -215,7 +215,7 @@ export class ProcessEditor extends LitElement { render(): TemplateResult { return html` - ${processIcon} diff --git a/packages/plugins/src/editors/substation/substation-editor.ts b/packages/plugins/src/editors/substation/substation-editor.ts index e5e60c8864..fde82503f4 100644 --- a/packages/plugins/src/editors/substation/substation-editor.ts +++ b/packages/plugins/src/editors/substation/substation-editor.ts @@ -214,7 +214,7 @@ export class SubstationEditor extends LitElement { render(): TemplateResult { return html`${this.renderRedirectUI()} - ${substationIcon} diff --git a/packages/plugins/src/editors/substation/transformer-winding-editor.ts b/packages/plugins/src/editors/substation/transformer-winding-editor.ts index f20f670c30..8c6b1709e0 100644 --- a/packages/plugins/src/editors/substation/transformer-winding-editor.ts +++ b/packages/plugins/src/editors/substation/transformer-winding-editor.ts @@ -166,7 +166,7 @@ export class TransformerWindingEditor extends LitElement { render(): TemplateResult { return html` - ${transformerWindingIcon} diff --git a/packages/plugins/src/editors/substation/voltage-level-editor.ts b/packages/plugins/src/editors/substation/voltage-level-editor.ts index 24a3af5d76..37938b11ae 100644 --- a/packages/plugins/src/editors/substation/voltage-level-editor.ts +++ b/packages/plugins/src/editors/substation/voltage-level-editor.ts @@ -223,7 +223,7 @@ export class VoltageLevelEditor extends LitElement { render(): TemplateResult { return html`${this.renderRedirectUI()} - ${voltageLevelIcon} diff --git a/packages/plugins/test/unit/editors/substation/__snapshots__/bay-editor.test.snap.js b/packages/plugins/test/unit/editors/substation/__snapshots__/bay-editor.test.snap.js index 63a7e0cc74..ab04c80e2a 100644 --- a/packages/plugins/test/unit/editors/substation/__snapshots__/bay-editor.test.snap.js +++ b/packages/plugins/test/unit/editors/substation/__snapshots__/bay-editor.test.snap.js @@ -7,8 +7,8 @@ snapshots["bay-editor looks like the latest snapshot"] = tabindex="0" >