Integrate Wizarding API V3 from OpenEnergyTools to OpenSCD#1630
Integrate Wizarding API V3 from OpenEnergyTools to OpenSCD#1630david-monichi wants to merge 22 commits intoopenscd:mainfrom
Conversation
f21f485 to
e2bb55b
Compare
c4d34cb to
47237da
Compare
|
@david-monichi is this one ready to review? |
| this.updateComplete | ||
| .then(() => this.wizardUI.updateComplete) | ||
| .then(() => this.wizardUI.dialog?.updateComplete) | ||
| .then(() => this.wizardUI.dialog?.focus()); |
There was a problem hiding this comment.
Thank you for the small cleanups too :)
| this.addEventListener('wizard', this.onWizard as EventListener); | ||
| this.addEventListener('oscd-edit-wizard-request', (e: Event) => | ||
| this.onWizardRequest(e as CustomEvent<EditWizardRequest>) | ||
| ); | ||
| this.addEventListener('oscd-create-wizard-request', (e: Event) => | ||
| this.onWizardRequest(e as CustomEvent<CreateWizardRequest>) | ||
| ); | ||
| this.addEventListener('oscd-close-wizard', () => this.onCloseWizard()); | ||
| this.addEventListener('editor-action', () => | ||
| this.wizardUI.requestUpdate() | ||
| this.wizardUI?.requestUpdate() |
There was a problem hiding this comment.
couldn't we put the event listener on the HTML elements?
something along these lines:
render(): TemplateResult {
return html`
${ifImplemented(super.render())}
<wizard-dialog
.wizard=${this.workflow[0]?.() ?? []}
@oscd-edit-wizard-request=${this.onWizardRequest}
@oscd-close-wizard=${this.onCloseWizard}
>
</wizard-dialog>
`;
}This way Litjs can handle their lifecycle.
There was a problem hiding this comment.
I think it's possible. I'll test it and make the change.
| } else if (wizard === null) { | ||
| this.workflow.shift(); | ||
| } else if (wizard) { | ||
| subwizard ? this.workflow.unshift(wizard) : this.workflow.push(wizard); |
There was a problem hiding this comment.
is there a reason why it is not just another 'if-else'?
There was a problem hiding this comment.
No special reason. I will change it.
| this.updateComplete | ||
| .then(() => this.wizardUI.updateComplete) | ||
| .then(() => this.wizardUI.dialog?.updateComplete) | ||
| .then(() => this.wizardUI.dialog?.focus()); |
There was a problem hiding this comment.
again, thank you for the clean up :)
|
I see the deployment has not been tested. I'll try it locally first |
|
Hello @trusz Working url: http://146.247.24.58/ Please take a look. Thank you |
|
Hello @trusz |
Integrate Wizarding API V3 from OpenEnergyTools to OpenSCD
As external project the PR can't be marked as draft.