Skip to content

Commit

Permalink
Improve message for yaml core settings (#22936)
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten authored Nov 21, 2024
1 parent 881ff13 commit 4e63eac
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/panels/config/core/ha-config-section-general.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@material/mwc-list/mwc-list-item";
import type { TemplateResult } from "lit";
import { css, html, LitElement } from "lit";
import { css, html, LitElement, nothing } from "lit";
import { customElement, property, state } from "lit/decorators";
import { UNIT_C } from "../../../common/const";
import { stopPropagation } from "../../../common/dom/stop_propagation";
Expand Down Expand Up @@ -77,13 +77,13 @@ class HaConfigSectionGeneral extends LitElement {
<div class="card-content">
${!canEdit
? html`
<p>
<ha-alert>
${this.hass.localize(
"ui.panel.config.core.section.core.core_config.edit_requires_storage"
)}
</p>
</ha-alert>
`
: ""}
: nothing}
<ha-textfield
name="name"
.label=${this.hass.localize(
Expand Down
14 changes: 9 additions & 5 deletions src/panels/config/network/ha-config-url-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,16 @@ class ConfigUrlForm extends LitElement {
<div class="card-content">
${!canEdit
? html`
<p>
<ha-alert>
${this.hass.localize(
"ui.panel.config.core.section.core.core_config.edit_requires_storage"
)}
</p>
</ha-alert>
`
: ""}
${this._error ? html`<div class="error">${this._error}</div>` : ""}
${this._error
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
: ""}
<div class="description">
${this.hass.localize("ui.panel.config.url.description")}
Expand Down Expand Up @@ -406,8 +408,10 @@ class ConfigUrlForm extends LitElement {
.row > * {
margin: 0 8px;
}
.error {
color: var(--error-color);
ha-alert {
display: block;
margin: 16px 0;
}
.card-actions {
Expand Down
2 changes: 1 addition & 1 deletion src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2435,7 +2435,7 @@
"header": "General configuration",
"introduction": "Manage your location, network, and analytics.",
"core_config": {
"edit_requires_storage": "Editor disabled because config stored in configuration.yaml.",
"edit_requires_storage": "You can not change these settings in the UI, as you have config stored in 'configuration.yaml' under the 'homeassistant' key.",
"location_name": "Name",
"latitude": "Latitude",
"longitude": "Longitude",
Expand Down

0 comments on commit 4e63eac

Please sign in to comment.