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

Migrate validate dialog to Lit #14

Merged
merged 4 commits into from
Jun 18, 2021
Merged

Migrate validate dialog to Lit #14

merged 4 commits into from
Jun 18, 2021

Conversation

balloob
Copy link
Member

@balloob balloob commented Jun 18, 2021

Migrate the validate dialog and the foundation (log modal) to Lit.

Unblocks other migrations mentioned in #4.


shadowRoot.innerHTML = `
<style>
.log {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is copied from esphome.css. Can be removed from there once all log-based dialogs are migrated.

private _setup = false;

public connectedCallback() {
if (this._setup) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we restart what we aborted if we connect again?

Copy link
Member Author

@balloob balloob Jun 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah we should create a new process dialog

@@ -2,10 +2,10 @@ import { uploadModal } from "../legacy";

const preload = () => import("./install-update-dialog");

const startInstallUpdate = async (ev: Event) => {
export const openInstallDialog = async (filename: string) => {
preload();
const dialog = document.createElement("esphome-install-dialog");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to create a new dialog element every time, or should we re-use it? Do we also remove the dialog when we close it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we do.

@balloob balloob merged commit 482e38e into main Jun 18, 2021
@balloob balloob deleted the add-validate-dialog branch June 18, 2021 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants