mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Remove back path from UI (#13936)
Remove back path from UI as it can be edited with yaml editor
This commit is contained in:
parent
650d579d05
commit
f768c5ef7f
@ -33,7 +33,7 @@ export class HuiViewEditor extends LitElement {
|
|||||||
private _suggestedPath = false;
|
private _suggestedPath = false;
|
||||||
|
|
||||||
private _schema = memoizeOne(
|
private _schema = memoizeOne(
|
||||||
(localize: LocalizeFunc, subview: boolean, showAdvanced: boolean) =>
|
(localize: LocalizeFunc) =>
|
||||||
[
|
[
|
||||||
{ name: "title", selector: { text: {} } },
|
{ name: "title", selector: { text: {} } },
|
||||||
{
|
{
|
||||||
@ -69,14 +69,6 @@ export class HuiViewEditor extends LitElement {
|
|||||||
boolean: {},
|
boolean: {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
...(subview && showAdvanced
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
name: "back_path",
|
|
||||||
selector: { navigation: {} },
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
] as const
|
] as const
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -98,11 +90,7 @@ export class HuiViewEditor extends LitElement {
|
|||||||
return html``;
|
return html``;
|
||||||
}
|
}
|
||||||
|
|
||||||
const schema = this._schema(
|
const schema = this._schema(this.hass.localize);
|
||||||
this.hass.localize,
|
|
||||||
this._config.subview ?? false,
|
|
||||||
this.hass.userData?.showAdvanced ?? false
|
|
||||||
);
|
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
theme: "Backend-selected",
|
theme: "Backend-selected",
|
||||||
@ -128,9 +116,6 @@ export class HuiViewEditor extends LitElement {
|
|||||||
if (config.type === "masonry") {
|
if (config.type === "masonry") {
|
||||||
delete config.type;
|
delete config.type;
|
||||||
}
|
}
|
||||||
if (!config.subview) {
|
|
||||||
delete config.back_path;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.isNew &&
|
this.isNew &&
|
||||||
@ -155,10 +140,6 @@ export class HuiViewEditor extends LitElement {
|
|||||||
return this.hass.localize("ui.panel.lovelace.editor.edit_view.type");
|
return this.hass.localize("ui.panel.lovelace.editor.edit_view.type");
|
||||||
case "subview":
|
case "subview":
|
||||||
return this.hass.localize("ui.panel.lovelace.editor.edit_view.subview");
|
return this.hass.localize("ui.panel.lovelace.editor.edit_view.subview");
|
||||||
case "back_path":
|
|
||||||
return this.hass.localize(
|
|
||||||
"ui.panel.lovelace.editor.edit_view.back_path"
|
|
||||||
);
|
|
||||||
default:
|
default:
|
||||||
return this.hass!.localize(
|
return this.hass!.localize(
|
||||||
`ui.panel.lovelace.editor.card.generic.${schema.name}`
|
`ui.panel.lovelace.editor.card.generic.${schema.name}`
|
||||||
@ -174,10 +155,6 @@ export class HuiViewEditor extends LitElement {
|
|||||||
return this.hass.localize(
|
return this.hass.localize(
|
||||||
"ui.panel.lovelace.editor.edit_view.subview_helper"
|
"ui.panel.lovelace.editor.edit_view.subview_helper"
|
||||||
);
|
);
|
||||||
case "back_path":
|
|
||||||
return this.hass.localize(
|
|
||||||
"ui.panel.lovelace.editor.edit_view.back_path_helper"
|
|
||||||
);
|
|
||||||
default:
|
default:
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
@ -3805,8 +3805,6 @@
|
|||||||
},
|
},
|
||||||
"subview": "Subview",
|
"subview": "Subview",
|
||||||
"subview_helper": "Subviews don't appear in tabs and have a back button.",
|
"subview_helper": "Subviews don't appear in tabs and have a back button.",
|
||||||
"back_path": "Back path (optional)",
|
|
||||||
"back_path_helper": "Only for subviews. If empty, clicking on back button will go to the previous page.",
|
|
||||||
"edit_ui": "Edit in visual editor",
|
"edit_ui": "Edit in visual editor",
|
||||||
"edit_yaml": "Edit in YAML"
|
"edit_yaml": "Edit in YAML"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user