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

Handle errors in multi select #20494

Merged
merged 2 commits into from Apr 12, 2024
Merged

Handle errors in multi select #20494

merged 2 commits into from Apr 12, 2024

Conversation

bramkragten
Copy link
Member

@bramkragten bramkragten commented Apr 11, 2024

Proposed change

Prevent entities without a entity registry entry from being multi selectable, add error handling.

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

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:

@bramkragten bramkragten added this to the 2024.4 milestone Apr 11, 2024
src/translations/en.json Outdated Show resolved Hide resolved
Co-authored-by: Simon Lamon <32477463+silamon@users.noreply.github.com>
Comment on lines +1159 to +1169
showAlertDialog(this, {
title: this.hass.localize("ui.panel.config.common.multiselect.failed", {
number: rejected.length,
}),
text: html`<pre>
${rejected
.map((r) => r.reason.message || r.reason.code || r.reason)
.join("\r\n")}</pre
>`,
});
}
Copy link
Member

Choose a reason for hiding this comment

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

It can be nice to create an helper function for that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will do in follow up

@bramkragten bramkragten merged commit be2f2c6 into dev Apr 12, 2024
13 checks passed
@bramkragten bramkragten deleted the error-handling-multi-select branch April 12, 2024 09:15
bramkragten added a commit that referenced this pull request Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error handling when adding automations to category or label fails
3 participants