Skip to content

Add dialog-box warning support #7356

Merged
bramkragten merged 3 commits intohome-assistant:devfrom
spacegaier:dialog-question-warning
Oct 19, 2020
Merged

Add dialog-box warning support #7356
bramkragten merged 3 commits intohome-assistant:devfrom
spacegaier:dialog-question-warning

Conversation

@spacegaier
Copy link
Copy Markdown
Member

Breaking change

Proposed change

Helper function to create a question dialog with default Yes/No option (no button selection so user has to purposely select an option). The confirm and dismiss texts can still be override as before.
Also added the option to flag a dialog as containing a warning so that the matching CSS class gets applied.

The idea came to me when I changed the name of a device. The user then gets asked whether the entity IDs should also be changed. I saw two issues here:

  1. It was a Yes / Cancel dialog, but you cannot actually cancel anything here (the device renaming already happened, so Yes/No is correct IMHO).
  2. Clicking Yes here has a comparably big impact and to make sure a user is aware of the potential ramifications, this should be visually highlighted.

image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@spacegaier spacegaier force-pushed the dialog-question-warning branch from 0fb32f8 to bd765b7 Compare October 19, 2020 18:51
@spacegaier spacegaier changed the title Add dialog-box question and warning support Add dialog-box warning support Oct 19, 2020
@bramkragten bramkragten merged commit a7ef8ab into home-assistant:dev Oct 19, 2020
@spacegaier spacegaier deleted the dialog-question-warning branch October 19, 2020 20:23
@bramkragten bramkragten mentioned this pull request Oct 21, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants