Skip to content

Commit

Permalink
Merge pull request #243 from com-pas/242-disable-ocl-rules
Browse files Browse the repository at this point in the history
fix: 242 disable ocl rules
  • Loading branch information
Stef3st authored May 10, 2023
2 parents 11df56e + 8635731 commit 2d4ca1c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 26 deletions.
4 changes: 2 additions & 2 deletions public/js/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ export const officialPlugins = [
position: 'top',
},
{
name: 'Validate using OCL',
name: '[WIP] Validate using OCL',
src: '/src/validators/CompasValidateSchema.js',
icon: 'rule_folder',
default: true,
default: false,
kind: 'validator',
},
{
Expand Down
5 changes: 4 additions & 1 deletion src/Plugging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,12 +458,15 @@ export function Plugging<TBase extends new (...args: any[]) => EditingElement>(
value="${plugin.src}"
?selected=${plugin.installed}
hasMeta
?disabled=${plugin.name.startsWith('[WIP]')}
left
>
<mwc-icon slot="meta"
>${plugin.icon || pluginIcons[plugin.kind]}</mwc-icon
>
${plugin.name}
${plugin.name.startsWith('[WIP]')
? html`[WIP] <strike>${plugin.name.substring(6)}</strike>`
: plugin.name}
</mwc-check-list-item>`
)}
`;
Expand Down
27 changes: 6 additions & 21 deletions test/integration/__snapshots__/open-scd.test.snap.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,24 +165,6 @@ snapshots["open-scd looks like its snapshot"] =
Redo
</span>
</mwc-list-item>
<mwc-list-item
aria-disabled="true"
class="validator"
disabled=""
graphic="icon"
iconid="rule_folder"
mwc-list-item=""
tabindex="-1"
>
<mwc-icon slot="graphic">
rule_folder
</mwc-icon>
<span>
Validate using OCL
</span>
</mwc-list-item>
<oscd-plugine36e411de62aaf96 class="plugin validator">
</oscd-plugine36e411de62aaf96>
<mwc-list-item
aria-disabled="true"
class="validator"
Expand Down Expand Up @@ -1122,20 +1104,23 @@ snapshots["open-scd looks like its snapshot"] =
>
</li>
<mwc-check-list-item
aria-disabled="false"
aria-disabled="true"
class="official"
disabled=""
graphic="control"
hasmeta=""
left=""
mwc-list-item=""
selected=""
tabindex="-1"
value="/src/validators/CompasValidateSchema.js"
>
<mwc-icon slot="meta">
rule_folder
</mwc-icon>
Validate using OCL
[WIP]
<strike>
Validate using OCL
</strike>
</mwc-check-list-item>
<mwc-check-list-item
aria-disabled="false"
Expand Down
4 changes: 2 additions & 2 deletions test/unit/Plugging.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ describe('PluggingElement', () => {
).to.have.property('position');
});
it('adds a new validator kind plugin on add button click', async () => {
expect(element.validators).to.have.lengthOf(3);
expect(element.validators).to.have.lengthOf(2);
src.value = 'http://example.com/plugin.js';
name.value = 'testName';
validatorKindOption.click();
await src.updateComplete;
await name.updateComplete;
primaryAction.click();
await element.updateComplete;
expect(element.validators).to.have.lengthOf(4);
expect(element.validators).to.have.lengthOf(3);
});
});
});

0 comments on commit 2d4ca1c

Please sign in to comment.