Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 242 disable ocl rules #243

Merged
merged 2 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
});
});
});