mirror of
https://github.com/home-assistant/frontend.git
synced 2026-02-04 01:10:33 -06:00
Hide edit and delete actions for YAML dashboards in config (#29368)
YAML dashboards are defined in configuration files and cannot be modified or deleted through the UI. This change ensures the edit and delete actions are only shown for storage-mode dashboards. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
fcc6f1b5e9
commit
0eb7229819
@ -80,7 +80,7 @@ export class DialogLovelaceDashboardDetail extends LitElement {
|
||||
)}
|
||||
>
|
||||
<div>
|
||||
${this._params.dashboard && !this._params.dashboard.id
|
||||
${this._params.dashboard?.mode === "yaml"
|
||||
? this.hass.localize(
|
||||
"ui.panel.config.lovelace.dashboards.cant_edit_yaml"
|
||||
)
|
||||
@ -97,7 +97,7 @@ export class DialogLovelaceDashboardDetail extends LitElement {
|
||||
</div>
|
||||
${this._params.urlPath
|
||||
? html`
|
||||
${this._params.dashboard?.id
|
||||
${this._params.dashboard?.mode === "storage"
|
||||
? html`
|
||||
<ha-button
|
||||
slot="secondaryAction"
|
||||
@ -123,7 +123,7 @@ export class DialogLovelaceDashboardDetail extends LitElement {
|
||||
dialogInitialFocus
|
||||
>
|
||||
${this._params.urlPath
|
||||
? this._params.dashboard?.id
|
||||
? this._params.dashboard?.mode === "storage"
|
||||
? this.hass.localize(
|
||||
"ui.panel.config.lovelace.dashboards.detail.update"
|
||||
)
|
||||
@ -232,8 +232,9 @@ export class DialogLovelaceDashboardDetail extends LitElement {
|
||||
}
|
||||
|
||||
private async _updateDashboard() {
|
||||
if (this._params?.urlPath && !this._params.dashboard?.id) {
|
||||
if (this._params?.urlPath && this._params.dashboard?.mode === "yaml") {
|
||||
this.closeDialog();
|
||||
return;
|
||||
}
|
||||
this._submitting = true;
|
||||
try {
|
||||
|
||||
@ -281,7 +281,8 @@ export class HaConfigLovelaceDashboards extends LitElement {
|
||||
action: () => this._handleSetAsDefault(dashboard),
|
||||
disabled: dashboard.default,
|
||||
},
|
||||
...(dashboard.type === "user_created"
|
||||
...(dashboard.type === "user_created" &&
|
||||
dashboard.mode === "storage"
|
||||
? [
|
||||
{
|
||||
path: mdiPencil,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user