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

Add UI for restored entities #4414

Merged
merged 4 commits into from
Jan 3, 2020
Merged

Add UI for restored entities #4414

merged 4 commits into from
Jan 3, 2020

Conversation

bramkragten
Copy link
Member

@bramkragten bramkragten commented Jan 2, 2020

Closes #4401

image

@@ -172,6 +184,10 @@ class MoreInfoControls extends LocalizeMixin(EventsMixin(PolymerElement)) {
return !stateObj || !DOMAINS_NO_INFO.includes(computeStateDomain(stateObj));
}

_computeShowRestored(stateObj) {
return !stateObj || stateObj.attributes.restored;
Copy link
Member

Choose a reason for hiding this comment

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

This screen won't show without State obj

Copy link
Member Author

Choose a reason for hiding this comment

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

True, but it is undefined at first render...

Copy link
Member

Choose a reason for hiding this comment

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

Right, but then guard it, because now you're implying it's restored entity if state object is not available.

Suggested change
return !stateObj || stateObj.attributes.restored;
return stateObj && stateObj.attributes.restored;

@frenck
Copy link
Member

frenck commented Jan 3, 2020

This entity was previously made available via an integration. It is not currently being provided. If it is no longer used, you can remove it from the entity registry by clicking the button below.

"It is not currently being provided." Feels a bit disconnected from the rest.

Also, the "why this happened" is missing from the explanation, besides, it doesn't have to be the integration to blame (devices can change as well). Suggestion:

This entity is currently unavailable and is an orphan to a removed, changed or dysfunctional integration or device. If the entity is no longer in use, you can clean it up by removing it.

The above suggestion is also using an active voice.

@frenck
Copy link
Member

frenck commented Jan 3, 2020

Oh, can we make the "Remove entity" red? Since it is a "destructive" action.

@bramkragten bramkragten merged commit 18d09c6 into dev Jan 3, 2020
@delete-merged-branch delete-merged-branch bot deleted the restored branch January 3, 2020 11:44
@bramkragten bramkragten mentioned this pull request Jan 7, 2020
@lock lock bot locked and limited conversation to collaborators Jan 9, 2020
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.

Add notice about restored entity in more info dialog
5 participants