Update Repairs to new design (#13276)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
Zack Barett 2022-07-27 04:06:38 -05:00 committed by GitHub
parent 68517018cc
commit f7090583ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 74 additions and 53 deletions

View File

@ -188,54 +188,59 @@ class HaConfigDashboard extends LitElement {
.isWide=${this.isWide}
full-width
>
${repairsIssues.length
? html`
<ha-card outlined>
<ha-config-repairs
.hass=${this.hass}
.narrow=${this.narrow}
.total=${totalRepairIssues}
.repairsIssues=${repairsIssues}
@update-issues=${this._fetchIssues}
></ha-config-repairs>
${totalRepairIssues > repairsIssues.length
? html`
<a class="button" href="/config/repairs">
${this.hass.localize(
"ui.panel.config.repairs.more_repairs",
{
count: totalRepairIssues - repairsIssues.length,
}
)}
</a>
`
: ""}
</ha-card>
`
: ""}
${canInstallUpdates.length
? html`
<ha-card outlined>
<ha-config-updates
.hass=${this.hass}
.narrow=${this.narrow}
.total=${totalUpdates}
.updateEntities=${canInstallUpdates}
></ha-config-updates>
${totalUpdates > canInstallUpdates.length
? html`
<a class="button" href="/config/updates">
${this.hass.localize(
"ui.panel.config.updates.more_updates",
{
count: totalUpdates - canInstallUpdates.length,
}
)}
</a>
`
: ""}
</ha-card>
`
${repairsIssues.length || canInstallUpdates.length
? html`<ha-card outlined>
${repairsIssues.length
? html`
<ha-config-repairs
.hass=${this.hass}
.narrow=${this.narrow}
.total=${totalRepairIssues}
.repairsIssues=${repairsIssues}
@update-issues=${this._fetchIssues}
></ha-config-repairs>
${totalRepairIssues > repairsIssues.length
? html`
<a class="button" href="/config/repairs">
${this.hass.localize(
"ui.panel.config.repairs.more_repairs",
{
count:
totalRepairIssues - repairsIssues.length,
}
)}
</a>
`
: ""}
`
: ""}
${repairsIssues.length && canInstallUpdates.length
? html`<hr />`
: ""}
${canInstallUpdates.length
? html`
<ha-config-updates
.hass=${this.hass}
.narrow=${this.narrow}
.total=${totalUpdates}
.updateEntities=${canInstallUpdates}
></ha-config-updates>
${totalUpdates > canInstallUpdates.length
? html`
<a class="button" href="/config/updates">
${this.hass.localize(
"ui.panel.config.updates.more_updates",
{
count:
totalUpdates - canInstallUpdates.length,
}
)}
</a>
`
: ""}
`
: ""}
</ha-card>`
: ""}
<ha-card outlined>
@ -336,9 +341,12 @@ class HaConfigDashboard extends LitElement {
color: var(--primary-text-color);
}
a.button {
display: block;
color: var(--primary-color);
padding: 16px;
display: inline-block;
color: var(--primary-text-color);
padding: 6px 16px;
margin: 8px 16px 16px 16px;
border-radius: 32px;
border: 1px solid var(--divider-color);
}
.title {
font-size: 16px;
@ -368,6 +376,16 @@ class HaConfigDashboard extends LitElement {
.keep-together {
display: inline-block;
}
hr {
height: 1px;
background-color: var(
--ha-card-border-color,
var(--divider-color, #e0e0e0)
);
border: none;
margin-top: 0;
}
`,
];
}

View File

@ -81,6 +81,9 @@ class HaConfigRepairs extends LitElement {
)}`
: ""}
</span>
${!this.narrow
? html`<ha-icon-next slot="meta"></ha-icon-next>`
: ""}
</ha-list-item>
`
)}

View File

@ -1218,7 +1218,7 @@
"title": "{count} {count, plural,\n one {update}\n other {updates}\n}",
"unable_to_fetch": "Unable to load updates",
"version_available": "Version {version_available} is available",
"more_updates": "+{count} updates",
"more_updates": "Show all updates",
"show": "show",
"show_skipped": "Show skipped",
"hide_skipped": "Hide skipped",
@ -1231,7 +1231,7 @@
"description": "Find and fix issues with your Home Assistant instance",
"title": "{count} {count, plural,\n one {repair}\n other {repairs}\n}",
"no_repairs": "There are currently no repairs available",
"more_repairs": "+{count} repairs",
"more_repairs": "Show all repairs",
"show_ignored": "Show ignored",
"hide_ignored": "Hide ignored",
"critical": "Critical",