-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Confirmation Dialog #4053
Confirmation Dialog #4053
Conversation
🎉 Nice! |
OK I think I've covered the most of the app. I'd like to do another for |
} | ||
|
||
private async _dismiss(): Promise<void> { | ||
this._params = undefined; |
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.
Should probably add a dismiss callback for the future.
deleteConfigEntry(this.hass, this.configEntryId).then((result) => { | ||
fireEvent(this, "hass-reload-entries"); | ||
if (result.require_restart) { | ||
alert( | ||
this.hass.localize( | ||
"ui.panel.config.integrations.config_entry.restart_confirm" | ||
) | ||
); | ||
} | ||
navigate(this, "/config/integrations/dashboard", true); | ||
}), |
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.
Move this to a separate function like you did for the rest:
confirm: () => this._deleteConfigEntry()
export interface ConfirmationDialogParams { | ||
title?: string; | ||
text: string; | ||
confirm: () => void; |
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.
For the future, we should add a dismiss callback, and the ability to overwrite the OK
and 'Cancel' buttons text.
@bramkragten are you implementing these changes? I was about to carry them out but can let you finish off this PR if you like 😃 |
Yeah wanted to get this in before I make a release 😄 sorry |
Go ahead. Cheers! 🍻 |
Description
Adds a confirmation dialog which can replace all the browser-based
window.confirm
which helps the ui stays the same throughout.Added to
More to add to, but this is a good start