Address minor comments about config menu (#12492)

This commit is contained in:
Bram Kragten 2022-04-28 15:44:01 +02:00 committed by GitHub
parent 2c9411c6c3
commit 1617a9dfed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 9 deletions

View File

@ -110,7 +110,9 @@ class ConfigAnalytics extends LitElement {
ha-settings-row { ha-settings-row {
padding: 0; padding: 0;
} }
p {
margin-top: 0;
}
.card-actions { .card-actions {
display: flex; display: flex;
flex-direction: row-reverse; flex-direction: row-reverse;

View File

@ -187,6 +187,7 @@ class HaConfigSectionGeneral extends LitElement {
href="https://en.wikipedia.org/wiki/ISO_4217#Active_codes" href="https://en.wikipedia.org/wiki/ISO_4217#Active_codes"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
class="find-value"
>${this.hass.localize( >${this.hass.localize(
"ui.panel.config.core.section.core.core_config.find_currency_value" "ui.panel.config.core.section.core.core_config.find_currency_value"
)}</a )}</a
@ -345,6 +346,10 @@ class HaConfigSectionGeneral extends LitElement {
ha-select { ha-select {
display: block; display: block;
} }
a.find-value {
margin-top: 8px;
display: inline-block;
}
ha-locations-editor { ha-locations-editor {
display: block; display: block;
height: 400px; height: 400px;

View File

@ -39,9 +39,9 @@ import { configSections } from "../ha-panel-config";
import "./ha-config-navigation"; import "./ha-config-navigation";
import "./ha-config-updates"; import "./ha-config-updates";
const randomTip = (hass: HomeAssistant) => { const randomTip = (hass: HomeAssistant, narrow: boolean) => {
const weighted: string[] = []; const weighted: string[] = [];
const tips = [ let tips = [
{ {
content: hass.localize( content: hass.localize(
"ui.panel.config.tips.join", "ui.panel.config.tips.join",
@ -84,11 +84,16 @@ const randomTip = (hass: HomeAssistant) => {
</span>` </span>`
), ),
weight: 2, weight: 2,
narrow: true,
}, },
{ content: hass.localize("ui.tips.key_c_hint"), weight: 1 }, { content: hass.localize("ui.tips.key_c_hint"), weight: 1, narrow: false },
{ content: hass.localize("ui.tips.key_m_hint"), weight: 1 }, { content: hass.localize("ui.tips.key_m_hint"), weight: 1, narrow: false },
]; ];
if (narrow) {
tips = tips.filter((tip) => tip.narrow);
}
tips.forEach((tip) => { tips.forEach((tip) => {
for (let i = 0; i < tip.weight; i++) { for (let i = 0; i < tip.weight; i++) {
weighted.push(tip.content); weighted.push(tip.content);
@ -215,7 +220,7 @@ class HaConfigDashboard extends LitElement {
super.updated(changedProps); super.updated(changedProps);
if (!this._tip && changedProps.has("hass")) { if (!this._tip && changedProps.has("hass")) {
this._tip = randomTip(this.hass); this._tip = randomTip(this.hass, this.narrow);
} }
} }

View File

@ -224,14 +224,14 @@ export const configSections: { [name: string]: PageNavigation[] } = {
path: "/config/person", path: "/config/person",
translationKey: "ui.panel.config.person.caption", translationKey: "ui.panel.config.person.caption",
iconPath: mdiAccount, iconPath: mdiAccount,
iconColor: "#E48629", iconColor: "#5A87FA",
}, },
{ {
component: "users", component: "users",
path: "/config/users", path: "/config/users",
translationKey: "ui.panel.config.users.caption", translationKey: "ui.panel.config.users.caption",
iconPath: mdiBadgeAccountHorizontal, iconPath: mdiBadgeAccountHorizontal,
iconColor: "#E48629", iconColor: "#5A87FA",
core: true, core: true,
advancedOnly: true, advancedOnly: true,
}, },

View File

@ -111,6 +111,9 @@ export class HassioHostname extends LitElement {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
ha-settings-row {
border-top: none;
}
`; `;
} }

View File

@ -1493,7 +1493,7 @@
"unit_system_metric": "Metric", "unit_system_metric": "Metric",
"imperial_example": "Fahrenheit, pounds", "imperial_example": "Fahrenheit, pounds",
"metric_example": "Celsius, kilograms", "metric_example": "Celsius, kilograms",
"find_currency_value": "Find your value", "find_currency_value": "Find my value",
"save_button": "Save", "save_button": "Save",
"currency": "Currency", "currency": "Currency",
"edit_location": "Edit location", "edit_location": "Edit location",