diff --git a/src/data/config_flow.ts b/src/data/config_flow.ts index a06f8f42ec..94cce83ba8 100644 --- a/src/data/config_flow.ts +++ b/src/data/config_flow.ts @@ -13,6 +13,8 @@ export const DISCOVERY_SOURCES = [ "discovery", ]; +export const ATTENTION_SOURCES = ["reauth"]; + export const createConfigFlow = (hass: HomeAssistant, handler: string) => hass.callApi("POST", "config/config_entries/flow", { handler, diff --git a/src/panels/config/integrations/ha-config-integrations.ts b/src/panels/config/integrations/ha-config-integrations.ts index dd738133f7..99d7f6b266 100644 --- a/src/panels/config/integrations/ha-config-integrations.ts +++ b/src/panels/config/integrations/ha-config-integrations.ts @@ -10,12 +10,13 @@ import { CSSResult, customElement, html, + internalProperty, LitElement, property, - internalProperty, PropertyValues, TemplateResult, } from "lit-element"; +import { classMap } from "lit-html/directives/class-map"; import memoizeOne from "memoize-one"; import { HASSDomEvent } from "../../../common/dom/fire_event"; import "../../../common/search/search-input"; @@ -32,6 +33,7 @@ import { getConfigEntries, } from "../../../data/config_entries"; import { + ATTENTION_SOURCES, DISCOVERY_SOURCES, getConfigFlowInProgressCollection, ignoreConfigFlow, @@ -355,52 +357,67 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) { : ""} ${configEntriesInProgress.length ? configEntriesInProgress.map( - (flow: DataEntryFlowProgressExtended) => html` - -
- ${this.hass.localize( - "ui.panel.config.integrations.discovered" - )} -
-
-
- + (flow: DataEntryFlowProgressExtended) => { + const attention = ATTENTION_SOURCES.includes( + flow.context.source + ); + return html` + +
+ ${this.hass.localize( + `ui.panel.config.integrations.${ + attention ? "attention" : "discovered" + }` + )}
-

- ${flow.localized_title} -

-
- - ${this.hass.localize( - "ui.panel.config.integrations.configure" - )} - - ${DISCOVERY_SOURCES.includes(flow.context.source) && - flow.context.unique_id - ? html` - - ${this.hass.localize( - "ui.panel.config.integrations.ignore.ignore" - )} - - ` - : ""} +
+
+ +
+

+ ${flow.localized_title} +

+
+ + ${this.hass.localize( + `ui.panel.config.integrations.${ + attention ? "reconfigure" : "configure" + }` + )} + + ${DISCOVERY_SOURCES.includes(flow.context.source) && + flow.context.unique_id + ? html` + + ${this.hass.localize( + "ui.panel.config.integrations.ignore.ignore" + )} + + ` + : ""} +
-
-
- ` + + `; + } ) : ""} ${groupedConfigEntries.size @@ -639,6 +656,18 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) { flex-direction: column; justify-content: space-between; } + .attention { + --ha-card-border-color: var(--error-color); + } + .attention .header { + background: var(--error-color); + color: var(--text-primary-color); + padding: 8px; + text-align: center; + } + .attention mwc-button { + --mdc-theme-primary: var(--error-color); + } .discovered { --ha-card-border-color: var(--primary-color); } diff --git a/src/translations/en.json b/src/translations/en.json index cd234428f5..434e67cb0c 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1610,6 +1610,7 @@ "description": "Manage integrations", "integration": "integration", "discovered": "Discovered", + "attention": "Attention required", "configured": "Configured", "new": "Set up a new integration", "add_integration": "Add integration", @@ -1618,6 +1619,7 @@ "note_about_website_reference": "More are available on the ", "home_assistant_website": "Home Assistant website", "configure": "Configure", + "reconfigure": "Reconfigure", "none": "Nothing configured yet", "none_found": "No integrations found", "none_found_detail": "Adjust your search criteria.",