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

Plugging into open scd #1448

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e236204
Feat: Added Waiter addon
pascalwilbrink Feb 12, 2024
26a362f
Fix: removed console.log
pascalwilbrink Feb 12, 2024
2a284a2
Fix: Removed .workdone
pascalwilbrink Feb 12, 2024
5541386
Fix: Removed waiting from OpenSCD
pascalwilbrink Feb 13, 2024
137612e
Fix: Added deferred promise to open-scd.test
pascalwilbrink Feb 13, 2024
5f11fd8
Fix: Added deferred promise to open-scd.test
pascalwilbrink Feb 13, 2024
12fc4d7
Fix: fixed E2E test
pascalwilbrink Feb 13, 2024
563d4c8
Removed waiting mixin
pascalwilbrink Feb 13, 2024
1a1c195
Feat: Settings addon
pascalwilbrink Feb 13, 2024
b833f9f
Fix: fixed test
pascalwilbrink Feb 13, 2024
e3d1515
Fix: updated import in themes.ts
pascalwilbrink Feb 13, 2024
4960d04
Fix: updated import in themes.ts
pascalwilbrink Feb 13, 2024
d051c91
Feat: Moved hosting into OpenSCD class
pascalwilbrink Feb 14, 2024
7a84fa2
Removed Hosting Mixin
pascalwilbrink Feb 15, 2024
e997916
Removed console.log
pascalwilbrink Feb 15, 2024
2a5bc49
Feat: Removed custom webcomponent definition in tests
pascalwilbrink Feb 15, 2024
7d4a6be
Fixed some tests
pascalwilbrink Feb 15, 2024
1d81b5a
Fixed more tests
pascalwilbrink Feb 15, 2024
9e92087
Fixed tests
pascalwilbrink Feb 15, 2024
a3470b7
Updated timeout
pascalwilbrink Feb 15, 2024
4742434
Removed dist folders
pascalwilbrink Feb 15, 2024
7cf43b8
Removed dist folder
pascalwilbrink Feb 15, 2024
ebf3714
Fixed tests
pascalwilbrink Feb 15, 2024
17d0605
Renamed wizarding.test.ts
pascalwilbrink Feb 16, 2024
328d490
Fix: Fixed some other tests
pascalwilbrink Feb 16, 2024
bd46e84
Removed dist folders
pascalwilbrink Feb 16, 2024
514b04d
Removed dist folder
pascalwilbrink Feb 16, 2024
e51a3f9
Removed console.logs
pascalwilbrink Feb 16, 2024
ff2274b
Moved pluggin Mixin into OpenSCD class
pascalwilbrink Feb 19, 2024
279cec5
Removed dist folders
pascalwilbrink Feb 19, 2024
deabb43
Updated import on historing
pascalwilbrink Feb 19, 2024
032172e
fixed tests
pascalwilbrink Feb 21, 2024
37a47ee
Added timeout to tet
pascalwilbrink Feb 21, 2024
9bbfc82
Added updateComplete to beforeEach
pascalwilbrink Feb 21, 2024
58ffd23
fixed merge conflicts
pascalwilbrink Mar 7, 2024
2d8730e
Updated snapshot
pascalwilbrink Mar 7, 2024
28653ce
Fixed merge conflicts
pascalwilbrink Mar 8, 2024
664522e
Delete packages/open-scd/test/dist/mock-open-scd.js
pascalwilbrink Mar 8, 2024
f77eedf
Delete packages/open-scd/test/unit/dist/Plugging.test.js
pascalwilbrink Mar 8, 2024
5aa658a
Update connectedap-c.test.ts
pascalwilbrink Mar 8, 2024
88a8626
Update Plugging.test.ts
pascalwilbrink Mar 8, 2024
18d80aa
Update open-scd.ts
pascalwilbrink Mar 8, 2024
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
9 changes: 6 additions & 3 deletions packages/open-scd/src/addons/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ export function newLoadNsdocEvent(

@customElement('oscd-settings')
export class OscdSettings extends LitElement {
/** Object containing all *.nsdoc files and a function extracting element's label form them*/
@property({
type: Object,
})
nsdoc!: Nsdoc;

/** Current [[`Settings`]] in `localStorage`, default to [[`defaults`]]. */
@property()
get settings(): Settings {
Expand All @@ -103,9 +109,6 @@ export class OscdSettings extends LitElement {
'IEC 61850-8-1': this.getSetting('IEC 61850-8-1'),
};
}
/** Object containing all *.nsdoc files and a function extracting element's label form them*/
@property({ attribute: false })
nsdoc: Nsdoc = initializeNsdoc();

@property({
type: Object,
Expand Down
8 changes: 4 additions & 4 deletions packages/open-scd/test/mock-open-scd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { WizardDialog } from '../src/wizard-dialog.js';
@customElement('mock-open-scd')
export class MockOpenSCD extends OpenSCD {
@queryAssignedNodes()
_plugins!: Array<HTMLElement>;
_slots!: Array<HTMLElement>;

@query('oscd-wizards')
wizards!: Wizards;
Expand All @@ -23,13 +23,13 @@ export class MockOpenSCD extends OpenSCD {
}

getPlugin<T extends HTMLElement>(name: string): T | undefined {
return this._plugins.find(
p => p.tagName.toLowerCase() === name.toLowerCase()
return this._slots.find(
s => s.tagName.toLowerCase() === name.toLowerCase()
) as T | undefined;
}

getActivePlugin<T extends HTMLElement>(): T {
return this._plugins[0]! as T;
return this._slots[0]! as T;
}

get wizardUI(): WizardDialog {
Expand Down
6 changes: 6 additions & 0 deletions packages/open-scd/test/unit/Plugging.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ describe('OpenSCD-Plugin', () => {
primaryAction = <HTMLElement>(
element.pluginUI.querySelector('mwc-button[slot="primaryAction"]')
);
await element.updateComplete;
});

it('disables deselected plugins', async () => {
Expand Down Expand Up @@ -152,9 +153,14 @@ describe('OpenSCD-Plugin', () => {
await src.updateComplete;
await name.updateComplete;
primaryAction.click();
await new Promise(resolve => setTimeout(resolve, 50)); // await animation

await element.requestUpdate();
await element.updateComplete;

expect(element.editors).to.have.lengthOf(7);
});

it('adds a new menu kind plugin on add button click', async () => {
const lengthMenuKindPlugins = element.menuEntries.length;
src.value = 'http://example.com/plugin.js';
Expand Down
Loading