Skip to content

Commit 8635731

Browse files
committed
fix: disabled ocl validator
1 parent e620998 commit 8635731

File tree

5 files changed

+15
-28
lines changed

5 files changed

+15
-28
lines changed

public/js/plugins.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ export const officialPlugins = [
168168
position: 'top',
169169
},
170170
{
171-
name: '[WIP] Validate OCL',
171+
name: '[WIP] Validate using OCL',
172172
src: '/src/validators/CompasValidateSchema.js',
173173
icon: 'rule_folder',
174-
default: true,
174+
default: false,
175175
kind: 'validator',
176176
},
177177
{

src/Hosting.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ export function Hosting<
148148
)
149149
);
150150
},
151-
disabled: (): boolean =>
152-
this.doc === null || plugin.name.includes('[WIP]'),
151+
disabled: (): boolean => this.doc === null,
153152
content: plugin.content,
154153
kind: 'validator',
155154
})

src/Plugging.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,15 @@ export function Plugging<TBase extends new (...args: any[]) => EditingElement>(
458458
value="${plugin.src}"
459459
?selected=${plugin.installed}
460460
hasMeta
461+
?disabled=${plugin.name.startsWith('[WIP]')}
461462
left
462463
>
463464
<mwc-icon slot="meta"
464465
>${plugin.icon || pluginIcons[plugin.kind]}</mwc-icon
465466
>
466-
${plugin.name}
467+
${plugin.name.startsWith('[WIP]')
468+
? html`[WIP] <strike>${plugin.name.substring(6)}</strike>`
469+
: plugin.name}
467470
</mwc-check-list-item>`
468471
)}
469472
`;

test/integration/__snapshots__/open-scd.test.snap.js

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -165,24 +165,6 @@ snapshots["open-scd looks like its snapshot"] =
165165
Redo
166166
</span>
167167
</mwc-list-item>
168-
<mwc-list-item
169-
aria-disabled="true"
170-
class="validator"
171-
disabled=""
172-
graphic="icon"
173-
iconid="rule_folder"
174-
mwc-list-item=""
175-
tabindex="-1"
176-
>
177-
<mwc-icon slot="graphic">
178-
rule_folder
179-
</mwc-icon>
180-
<span>
181-
[WIP] Validate OCL
182-
</span>
183-
</mwc-list-item>
184-
<oscd-plugine36e411de62aaf96 class="plugin validator">
185-
</oscd-plugine36e411de62aaf96>
186168
<mwc-list-item
187169
aria-disabled="true"
188170
class="validator"
@@ -1122,20 +1104,23 @@ snapshots["open-scd looks like its snapshot"] =
11221104
>
11231105
</li>
11241106
<mwc-check-list-item
1125-
aria-disabled="false"
1107+
aria-disabled="true"
11261108
class="official"
1109+
disabled=""
11271110
graphic="control"
11281111
hasmeta=""
11291112
left=""
11301113
mwc-list-item=""
1131-
selected=""
11321114
tabindex="-1"
11331115
value="/src/validators/CompasValidateSchema.js"
11341116
>
11351117
<mwc-icon slot="meta">
11361118
rule_folder
11371119
</mwc-icon>
1138-
[WIP] Validate OCL
1120+
[WIP]
1121+
<strike>
1122+
Validate using OCL
1123+
</strike>
11391124
</mwc-check-list-item>
11401125
<mwc-check-list-item
11411126
aria-disabled="false"

test/unit/Plugging.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,15 @@ describe('PluggingElement', () => {
169169
).to.have.property('position');
170170
});
171171
it('adds a new validator kind plugin on add button click', async () => {
172-
expect(element.validators).to.have.lengthOf(3);
172+
expect(element.validators).to.have.lengthOf(2);
173173
src.value = 'http://example.com/plugin.js';
174174
name.value = 'testName';
175175
validatorKindOption.click();
176176
await src.updateComplete;
177177
await name.updateComplete;
178178
primaryAction.click();
179179
await element.updateComplete;
180-
expect(element.validators).to.have.lengthOf(4);
180+
expect(element.validators).to.have.lengthOf(3);
181181
});
182182
});
183183
});

0 commit comments

Comments
 (0)