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.
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.
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.
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.confirmwhich helps the ui stays the same throughout.Added to
More to add to, but this is a good start