Skip to content

Commit 9d56926

Browse files
authored
Merge pull request #60 from com-pas/fix/schema-validation-warning
fix: set scl schema version back to minimum of 2007B4
2 parents b86fbe6 + 2832053 commit 9d56926

10 files changed

Lines changed: 15 additions & 15 deletions

File tree

packages/openscd/public/md/Validate-template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The templates validator can find issues that the schema validator cannot, because the issues are not connected to the schema defined in IEC 61850-6 but with other parts of the standard: IEC 61850-7-3/IEC 61850-7-4/IEC 61850-8-1.
22

3-
> NOTE: OpenSCD is using name space description (NSD) files as a reference (how it should be). These files are provided by the standard but not for all Editions. That is why we only validate the `DataTypeTemplate` section for projects 2007B5 and higher (Edition 2.1).
3+
> NOTE: OpenSCD is using name space description (NSD) files as a reference (how it should be). These files are provided by the standard but not for all Editions. That is why we only validate the `DataTypeTemplate` section for projects 2007B4 and higher (Edition 2.1).
44
55
The validator is triggered on every change in the project basis and the results are displayed in the **diagnostics** pane like so:
66

packages/openscd/src/translations/de.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export const de: Translations = {
180180
zeroissues: 'Es konnten keine Fehler in dem Projekt gefunden werden.',
181181
placeholder: 'Hier werden Validierungsfehler angezeigt.',
182182
missingnsd:
183-
'DataTypeTemplates können nicht validiert werden. Das Projekt muss die Version 2007B5 oder höher haben.',
183+
'DataTypeTemplates können nicht validiert werden. Das Projekt muss die Version 2007B4 oder höher haben.',
184184
},
185185
plugins: {
186186
heading: 'Plug-ins',

packages/openscd/src/translations/en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export const en = {
157157
zeroissues: 'No errors found in the project',
158158
placeholder: 'Issues found during validation will show up here',
159159
missingnsd:
160-
'Cannot validate DataTypeTemplates. The version of the project must be higher than or equal to 2007B5',
160+
'Cannot validate DataTypeTemplates. The version of the project must be higher than or equal to 2007B4',
161161
},
162162
plugins: {
163163
heading: 'Plug-ins',

packages/plugins/src/validators/ValidateTemplates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class ValidateTemplates extends LitElement {
4242
this.doc.documentElement.getAttribute('release') ?? '',
4343
];
4444

45-
if (!(version === '2007' && revision === 'B' && Number(release) >= 5)) {
45+
if (!(version === '2007' && revision === 'B' && Number(release) > 3)) {
4646
this.dispatchEvent(
4747
newIssueEvent({
4848
validatorId: this.pluginId,

packages/plugins/test/integration/validators/ValidateTemplates.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('ValidateTemplates OpenSCD integration test ', () => {
7070
await expect(parent.historyAddon.diagnosticUI).to.equalSnapshot();
7171
});
7272
});
73-
describe('with schema version smaller "2007B5"', () => {
73+
describe('with schema version smaller "2007B4"', () => {
7474
beforeEach(async () => {
7575
doc = await fetch('/test/testfiles/valid2007B.scd')
7676
.then(response => response.text())

packages/plugins/test/integration/validators/__snapshots__/ValidateTemplates.test.snap.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ snapshots["ValidateTemplates OpenSCD integration test with issues in the DataTy
529529
`;
530530
/* end snapshot ValidateTemplates OpenSCD integration test with issues in the DataTypeTemplates section pushes issues to the diagnostics pane that look like the latest snapshot */
531531

532-
snapshots["ValidateTemplates OpenSCD integration test with schema version smaller \"2007B5\" looks like the latest snapshot"] =
532+
snapshots["ValidateTemplates OpenSCD integration test with schema version smaller \"2007B4\" looks like the latest snapshot"] =
533533
`<mwc-dialog
534534
heading="Diagnostics"
535535
id="diagnostic"
@@ -551,15 +551,15 @@ snapshots["ValidateTemplates OpenSCD integration test with schema version small
551551
role="separator"
552552
>
553553
</li>
554-
<abbr title="Cannot validate DataTypeTemplates. The version of the project must be higher than or equal to 2007B5
554+
<abbr title="Cannot validate DataTypeTemplates. The version of the project must be higher than or equal to 2007B4
555555
">
556556
<mwc-list-item
557557
aria-disabled="false"
558558
mwc-list-item=""
559559
tabindex="-1"
560560
>
561561
<span>
562-
Cannot validate DataTypeTemplates. The version of the project must be higher than or equal to 2007B5
562+
Cannot validate DataTypeTemplates. The version of the project must be higher than or equal to 2007B4
563563
</span>
564564
<span slot="secondary">
565565
</span>
@@ -574,5 +574,5 @@ snapshots["ValidateTemplates OpenSCD integration test with schema version small
574574
</mwc-button>
575575
</mwc-dialog>
576576
`;
577-
/* end snapshot ValidateTemplates OpenSCD integration test with schema version smaller "2007B5" looks like the latest snapshot */
577+
/* end snapshot ValidateTemplates OpenSCD integration test with schema version smaller "2007B4" looks like the latest snapshot */
578578

packages/plugins/test/testfiles/templates/dotypes.scd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<SCL version="2007" revision="B" release="5" xmlns:sxy="http://www.iec.ch/61850/2003/SCLcoordinates" xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:txy="http://www.iec.ch/61850/2003/Terminal" xmlns:scl="http://www.iec.ch/61850/2003/SCL" xsi:schemaLocation="http://www.iec.ch/61850/2003/SCL SCL.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:IEC_60870_5_104="http://www.iec.ch/61850-80-1/2007/SCL">
2+
<SCL version="2007" revision="B" release="4" xmlns:sxy="http://www.iec.ch/61850/2003/SCLcoordinates" xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:txy="http://www.iec.ch/61850/2003/Terminal" xmlns:scl="http://www.iec.ch/61850/2003/SCL" xsi:schemaLocation="http://www.iec.ch/61850/2003/SCL SCL.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:IEC_60870_5_104="http://www.iec.ch/61850-80-1/2007/SCL">
33
<Header id="TrainingIEC61850" version="1" revision="143" toolID="IEC 61850 System Configurator, Version: V5.90 " nameStructure="IEDName">
44
<Text>TrainingIEC61850</Text>
55
<History>

packages/plugins/test/testfiles/validators/datatypetemplateerrors.scd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<SCL xmlns:sxy="http://www.iec.ch/61850/2003/SCLcoordinates" xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:txy="http://www.iec.ch/61850/2003/Terminal" xmlns:scl="http://www.iec.ch/61850/2003/SCL" xsi:schemaLocation="http://www.iec.ch/61850/2003/SCL SCL.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:IEC_60870_5_104="http://www.iec.ch/61850-80-1/2007/SCL" version="2007" revision="B" release="5">
2+
<SCL xmlns:sxy="http://www.iec.ch/61850/2003/SCLcoordinates" xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:txy="http://www.iec.ch/61850/2003/Terminal" xmlns:scl="http://www.iec.ch/61850/2003/SCL" xsi:schemaLocation="http://www.iec.ch/61850/2003/SCL SCL.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:IEC_60870_5_104="http://www.iec.ch/61850-80-1/2007/SCL" version="2007" revision="B" release="4">
33
<Header id="TrainingIEC61850" version="1" revision="143" toolID="IEC 61850 System Configurator, Version: V5.90 " nameStructure="IEDName">
44
<Text>TrainingIEC61850</Text>
55
<History>

packages/plugins/test/testfiles/validators/zeroissues.scd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<SCL xmlns="http://www.iec.ch/61850/2003/SCL" version="2007" revision="B" release="5">
2+
<SCL xmlns="http://www.iec.ch/61850/2003/SCL" version="2007" revision="B" release="4">
33
<Header id="TrainingIEC61850" version="1" revision="143" />
44
<DataTypeTemplates>
55
</DataTypeTemplates>

packages/plugins/test/unit/validators/ValidateTemplates.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ describe('ValidateTemplates', () => {
127127
);
128128
});
129129

130-
it('pushes only diag.missingnsd issue to diagnostics pane for SCL version < 2007B5', async () => {
130+
it('pushes only diag.missingnsd issue to diagnostics pane for SCL version < 2007B4', async () => {
131131
element.doc.querySelector('SCL')?.setAttribute('version', '2003');
132132
await element.validate();
133133
expect(issueEvent).to.have.been.calledOnce;
134134
expect(issueEvent.args[0][0].detail.title).to.contain(
135-
'Cannot validate DataTypeTemplates. The version of the project must be higher than or equal to 2007B5'
135+
'Cannot validate DataTypeTemplates. The version of the project must be higher than or equal to 2007B4'
136136
);
137137
});
138138

@@ -142,7 +142,7 @@ describe('ValidateTemplates', () => {
142142
await element.validate();
143143
expect(issueEvent).to.have.been.calledOnce;
144144
expect(issueEvent.args[0][0].detail.title).to.contain(
145-
'Cannot validate DataTypeTemplates. The version of the project must be higher than or equal to 2007B5'
145+
'Cannot validate DataTypeTemplates. The version of the project must be higher than or equal to 2007B4'
146146
);
147147
});
148148

0 commit comments

Comments
 (0)