Skip to content

Commit f253b9d

Browse files
author
Rob Tjalma
authored
Merge pull request #129 from com-pas/upstream-v0.12
Merge Upstream v0.12.0 into CoMPAS
2 parents 5a4de8b + 45874d4 commit f253b9d

File tree

119 files changed

+14313
-593
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+14313
-593
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [0.12.0](https://github.com/openscd/open-scd/compare/v0.11.0...v0.12.0) (2022-03-21)
6+
7+
8+
### Features
9+
10+
* **Editing:** check globally for ID uniqueness ([c2b14fb](https://github.com/openscd/open-scd/commits/c2b14fb337adb9f55874dbb3add0aefda8622946))
11+
* **editors/cleanup:** unreferenced DataSet ([#568](https://github.com/openscd/open-scd/issues/568)) ([edc133c](https://github.com/openscd/open-scd/commits/edc133cdecce61abf53d043bc45292d1a1a36c7c))
12+
* **editors/Substation:** Add PowerTransformer Components to Substation Editor ([22555b6](https://github.com/openscd/open-scd/commits/22555b6713c9f2c8e882269ffce9a826d016e87b))
13+
* **editors/template/lnodetype-wizards:** make use of -7-420 NSD ([0a2d5a4](https://github.com/openscd/open-scd/commits/0a2d5a40c50d5a0cc66fd7c5b31f6493aa7c4600))
14+
* **plugins/IED:** Add icon set to IED editor containers ([9878259](https://github.com/openscd/open-scd/commits/9878259665be2e34bd99dd1d5f72c1944b3dca1f))
15+
* **plugins/SampledValues:** Create Sampled Values tab in Subscription plugin ([f94b042](https://github.com/openscd/open-scd/commits/f94b0422253940785a0982ae72910f1bbbc2ac62))
16+
* **plugins/SampledValues:** Small bug fix + Added Integration tests ([a58f305](https://github.com/openscd/open-scd/commits/a58f305c78a65c056c617e9f09e8d648f4aaf610))
17+
* **plugins/Subscription:** Create 'Subscription' plugin for GOOSE subscriptions ([25fae6f](https://github.com/openscd/open-scd/commits/25fae6fc42ad76f269ef029848d5cae6329eee33))
18+
* **wizard-dialog:** allow used-defined actions in menu ([f8c5a93](https://github.com/openscd/open-scd/commits/f8c5a93100e4c7e922627337ffee32f6169b12cf))
19+
20+
21+
### Bug Fixes
22+
23+
* **action-pane:** adjust css rules for icon slot ([#594](https://github.com/openscd/open-scd/issues/594)) ([8bc0549](https://github.com/openscd/open-scd/commits/8bc0549bc791ef6b7fe0b1dfd4d5a6f1dfccde2d))
24+
* **editors/template:** on id attribute update adopt references as well ([#590](https://github.com/openscd/open-scd/issues/590)) ([af246dd](https://github.com/openscd/open-scd/commits/af246ddcde907688081aaa20d295faeb978b0a6f))
25+
* **editors/template:** properly update xxxType list after add/editing ([#582](https://github.com/openscd/open-scd/issues/582)) ([2e11cc8](https://github.com/openscd/open-scd/commits/2e11cc8c277d31dd693ae54656e1c3b4cd23f8f3))
26+
* **wizard-dialog:** make sure to close on non empty editor action ([8fb125c](https://github.com/openscd/open-scd/commits/8fb125c1c353feb37a4c988d59a608090fb0425b))
27+
528
## [0.11.0](https://github.com/openscd/open-scd/compare/v0.10.0...v0.11.0) (2022-03-08)
629

730

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@
4040
"purpose": "maskable"
4141
}
4242
],
43-
"version": "0.11.0"
43+
"version": "0.12.0"
4444
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "open-scd",
3-
"version": "0.11.0",
3+
"version": "0.12.0",
44
"repository": "https://github.com/openscd/open-scd.git",
55
"description": "A bottom-up substation configuration designer for projects described using SCL `IEC 61850-6` Edition 2 or greater.",
66
"keywords": [

public/js/plugins.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ export const officialPlugins = [
2020
default: true,
2121
kind: 'editor',
2222
},
23+
{
24+
name: 'Subscription',
25+
src: '/src/editors/Subscription.js',
26+
icon: 'link',
27+
default: true,
28+
kind: 'editor',
29+
},
30+
{
31+
name: 'Sampled Values Subscriber',
32+
src: '/src/editors/SampledValues.js',
33+
icon: 'link',
34+
default: true,
35+
kind: 'editor',
36+
},
2337
{
2438
name: 'Communication',
2539
src: '/src/editors/Communication.js',
@@ -142,6 +156,13 @@ export const officialPlugins = [
142156
requireDoc: true,
143157
position: 'middle'
144158
},
159+
{
160+
name: 'Cleanup',
161+
src: '/src/editors/Cleanup.js',
162+
icon: 'cleaning_services',
163+
default: false,
164+
kind: 'editor',
165+
},
145166
{
146167
name: 'Auto Align SLD',
147168
src: '/src/menu/CompasAutoAlignment.js',

public/xml/IEC_61850-7-420_2019A4.nsd

Lines changed: 5520 additions & 0 deletions
Large diffs are not rendered by default.

src/Editing.ts

Lines changed: 100 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function Editing<TBase extends LitElementConstructor>(Base: TBase) {
5050
)
5151
return true;
5252

53-
const invalid =
53+
const invalidNaming =
5454
create.new.element.hasAttribute('name') &&
5555
Array.from(create.new.parent.children).some(
5656
elm =>
@@ -59,7 +59,7 @@ export function Editing<TBase extends LitElementConstructor>(Base: TBase) {
5959
(<Element>create.new.element).getAttribute('name')
6060
);
6161

62-
if (invalid)
62+
if (invalidNaming) {
6363
this.dispatchEvent(
6464
newLogEvent({
6565
kind: 'error',
@@ -77,7 +77,38 @@ export function Editing<TBase extends LitElementConstructor>(Base: TBase) {
7777
})
7878
);
7979

80-
return !invalid;
80+
return false;
81+
}
82+
83+
const invalidId =
84+
create.new.element.hasAttribute('id') &&
85+
Array.from(
86+
create.new.parent.ownerDocument.querySelectorAll(
87+
'LNodeType, DOType, DAType, EnumType'
88+
)
89+
).some(
90+
elm =>
91+
elm.getAttribute('id') ===
92+
(<Element>create.new.element).getAttribute('id')
93+
);
94+
95+
if (invalidId) {
96+
this.dispatchEvent(
97+
newLogEvent({
98+
kind: 'error',
99+
title: get('editing.error.create', {
100+
name: create.new.element.tagName,
101+
}),
102+
message: get('editing.error.idClash', {
103+
id: create.new.element.getAttribute('id')!,
104+
}),
105+
})
106+
);
107+
108+
return false;
109+
}
110+
111+
return true;
81112
}
82113

83114
private onCreate(action: Create) {
@@ -199,7 +230,7 @@ export function Editing<TBase extends LitElementConstructor>(Base: TBase) {
199230
private checkReplaceValidity(replace: Replace): boolean {
200231
if (replace.checkValidity !== undefined) return replace.checkValidity();
201232

202-
const invalid =
233+
const invalidNaming =
203234
replace.new.element.hasAttribute('name') &&
204235
replace.new.element.getAttribute('name') !==
205236
replace.old.element.getAttribute('name') &&
@@ -210,7 +241,7 @@ export function Editing<TBase extends LitElementConstructor>(Base: TBase) {
210241
replace.new.element.getAttribute('name')
211242
);
212243

213-
if (invalid)
244+
if (invalidNaming) {
214245
this.dispatchEvent(
215246
newLogEvent({
216247
kind: 'error',
@@ -225,7 +256,40 @@ export function Editing<TBase extends LitElementConstructor>(Base: TBase) {
225256
})
226257
);
227258

228-
return !invalid;
259+
return false;
260+
}
261+
262+
const invalidId =
263+
replace.new.element.hasAttribute('id') &&
264+
replace.new.element.getAttribute('id') !==
265+
replace.old.element.getAttribute('id') &&
266+
Array.from(
267+
replace.new.element.ownerDocument.querySelectorAll(
268+
'LNodeType, DOType, DAType, EnumType'
269+
)
270+
).some(
271+
elm =>
272+
elm.getAttribute('id') ===
273+
(<Element>replace.new.element).getAttribute('id')
274+
);
275+
276+
if (invalidId) {
277+
this.dispatchEvent(
278+
newLogEvent({
279+
kind: 'error',
280+
title: get('editing.error.update', {
281+
name: replace.new.element.tagName,
282+
}),
283+
message: get('editing.error.idClash', {
284+
id: replace.new.element.getAttribute('id')!,
285+
}),
286+
})
287+
);
288+
289+
return false;
290+
}
291+
292+
return true;
229293
}
230294

231295
private onReplace(action: Replace) {
@@ -255,15 +319,15 @@ export function Editing<TBase extends LitElementConstructor>(Base: TBase) {
255319
private checkUpdateValidity(update: Update): boolean {
256320
if (update.checkValidity !== undefined) return update.checkValidity();
257321

258-
const invalid = Array.from(
322+
const invalidNaming = Array.from(
259323
update.element.parentElement?.children ?? []
260324
).some(
261325
elm =>
262326
elm.tagName === update.element.tagName &&
263327
elm.getAttribute('name') === update.newAttributes['name']
264328
);
265329

266-
if (invalid)
330+
if (invalidNaming) {
267331
this.dispatchEvent(
268332
newLogEvent({
269333
kind: 'error',
@@ -278,7 +342,34 @@ export function Editing<TBase extends LitElementConstructor>(Base: TBase) {
278342
})
279343
);
280344

281-
return !invalid;
345+
return false;
346+
}
347+
348+
const invalidId =
349+
update.newAttributes['id'] &&
350+
Array.from(
351+
update.element.ownerDocument.querySelectorAll(
352+
'LNodeType, DOType, DAType, EnumType'
353+
)
354+
).some(elm => elm.getAttribute('id') === update.newAttributes['id']);
355+
356+
if (invalidId) {
357+
this.dispatchEvent(
358+
newLogEvent({
359+
kind: 'error',
360+
title: get('editing.error.update', {
361+
name: update.element.tagName,
362+
}),
363+
message: get('editing.error.idClash', {
364+
id: update.newAttributes['id']!,
365+
}),
366+
})
367+
);
368+
369+
return false;
370+
}
371+
372+
return true;
282373
}
283374

284375
private onUpdate(action: Update) {

src/Logging.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import {
3535
OpenDocEvent,
3636
SclhistoryEntry,
3737
} from './foundation.js';
38-
import { getFilterIcon, iconColors } from './icons.js';
38+
import { getFilterIcon, iconColors } from './icons/icons.js';
3939
import { Plugin } from './Plugging.js';
4040

4141
const icons = {

src/action-pane.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,12 @@ export class ActionPane extends LitElement {
170170
top: -0.1em;
171171
--mdc-icon-size: 1em;
172172
}
173+
174+
::slotted([slot='icon']) {
175+
vertical-align: middle;
176+
position: relative;
177+
top: -0.1em;
178+
--mdc-icon-size: 1em;
179+
}
173180
`;
174181
}

0 commit comments

Comments
 (0)