-
Notifications
You must be signed in to change notification settings - Fork 43
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
Integrate Wizarding API V3 from OpenEnergyTools to OpenSCD #1630
base: main
Are you sure you want to change the base?
Conversation
f21f485
to
e2bb55b
Compare
c4d34cb
to
47237da
Compare
@david-monichi is this one ready to review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few nitpickings
this.updateComplete | ||
.then(() => this.wizardUI.updateComplete) | ||
.then(() => this.wizardUI.dialog?.updateComplete) | ||
.then(() => this.wizardUI.dialog?.focus()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason why it is not just another 'if-else'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, thank you for the clean up :)
I see the deployment has not been tested. I'll try it locally first |
Integrate Wizarding API V3 from OpenEnergyTools to OpenSCD
As external project the PR can't be marked as draft.