From e620998cd6624568a7821d5437a5096f47555791 Mon Sep 17 00:00:00 2001 From: Stef3st Date: Mon, 8 May 2023 14:27:17 +0200 Subject: [PATCH 1/2] chore: disabled OCL validator --- public/js/plugins.js | 2 +- src/Hosting.ts | 3 ++- test/integration/__snapshots__/open-scd.test.snap.js | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/public/js/plugins.js b/public/js/plugins.js index 3ca8099520..6f9be8ffcb 100644 --- a/public/js/plugins.js +++ b/public/js/plugins.js @@ -168,7 +168,7 @@ export const officialPlugins = [ position: 'top', }, { - name: 'Validate using OCL', + name: '[WIP] Validate OCL', src: '/src/validators/CompasValidateSchema.js', icon: 'rule_folder', default: true, diff --git a/src/Hosting.ts b/src/Hosting.ts index eae7a91e9b..1b8869ba1c 100644 --- a/src/Hosting.ts +++ b/src/Hosting.ts @@ -148,7 +148,8 @@ export function Hosting< ) ); }, - disabled: (): boolean => this.doc === null, + disabled: (): boolean => + this.doc === null || plugin.name.includes('[WIP]'), content: plugin.content, kind: 'validator', }) diff --git a/test/integration/__snapshots__/open-scd.test.snap.js b/test/integration/__snapshots__/open-scd.test.snap.js index 027d32a5c6..9bd2c7bbb9 100644 --- a/test/integration/__snapshots__/open-scd.test.snap.js +++ b/test/integration/__snapshots__/open-scd.test.snap.js @@ -178,7 +178,7 @@ snapshots["open-scd looks like its snapshot"] = rule_folder - Validate using OCL + [WIP] Validate OCL @@ -1135,7 +1135,7 @@ snapshots["open-scd looks like its snapshot"] = rule_folder - Validate using OCL + [WIP] Validate OCL Date: Mon, 8 May 2023 17:27:33 +0200 Subject: [PATCH 2/2] fix: disabled ocl validator --- public/js/plugins.js | 4 +-- src/Hosting.ts | 3 +-- src/Plugging.ts | 5 +++- .../__snapshots__/open-scd.test.snap.js | 27 +++++-------------- test/unit/Plugging.test.ts | 4 +-- 5 files changed, 15 insertions(+), 28 deletions(-) diff --git a/public/js/plugins.js b/public/js/plugins.js index 6f9be8ffcb..a26a255f43 100644 --- a/public/js/plugins.js +++ b/public/js/plugins.js @@ -168,10 +168,10 @@ export const officialPlugins = [ position: 'top', }, { - name: '[WIP] Validate OCL', + name: '[WIP] Validate using OCL', src: '/src/validators/CompasValidateSchema.js', icon: 'rule_folder', - default: true, + default: false, kind: 'validator', }, { diff --git a/src/Hosting.ts b/src/Hosting.ts index 1b8869ba1c..eae7a91e9b 100644 --- a/src/Hosting.ts +++ b/src/Hosting.ts @@ -148,8 +148,7 @@ export function Hosting< ) ); }, - disabled: (): boolean => - this.doc === null || plugin.name.includes('[WIP]'), + disabled: (): boolean => this.doc === null, content: plugin.content, kind: 'validator', }) diff --git a/src/Plugging.ts b/src/Plugging.ts index 897d0a5a5a..8ef0461b43 100644 --- a/src/Plugging.ts +++ b/src/Plugging.ts @@ -458,12 +458,15 @@ export function Plugging EditingElement>( value="${plugin.src}" ?selected=${plugin.installed} hasMeta + ?disabled=${plugin.name.startsWith('[WIP]')} left > ${plugin.icon || pluginIcons[plugin.kind]} - ${plugin.name} + ${plugin.name.startsWith('[WIP]') + ? html`[WIP] ${plugin.name.substring(6)}` + : plugin.name} ` )} `; diff --git a/test/integration/__snapshots__/open-scd.test.snap.js b/test/integration/__snapshots__/open-scd.test.snap.js index 9bd2c7bbb9..8903ae1758 100644 --- a/test/integration/__snapshots__/open-scd.test.snap.js +++ b/test/integration/__snapshots__/open-scd.test.snap.js @@ -165,24 +165,6 @@ snapshots["open-scd looks like its snapshot"] = Redo - - - rule_folder - - - [WIP] Validate OCL - - - - rule_folder - [WIP] Validate OCL + [WIP] + + Validate using OCL + { ).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(); @@ -177,7 +177,7 @@ describe('PluggingElement', () => { await name.updateComplete; primaryAction.click(); await element.updateComplete; - expect(element.validators).to.have.lengthOf(4); + expect(element.validators).to.have.lengthOf(3); }); }); });