mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-31 13:07:49 +00:00
Only use toggle mode in card editor
This commit is contained in:
parent
4f2652abd2
commit
c8b7f373c3
@ -49,6 +49,7 @@ class HuiCardEditor extends LitElement {
|
|||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.lovelace=${this.lovelace}
|
.lovelace=${this.lovelace}
|
||||||
.value=${this.config}
|
.value=${this.config}
|
||||||
|
show-toggle-mode-button
|
||||||
></hui-card-element-editor>
|
></hui-card-element-editor>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -74,6 +74,9 @@ export abstract class HuiElementEditor<T, C = any> extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public context?: C;
|
@property({ attribute: false }) public context?: C;
|
||||||
|
|
||||||
|
@property({ type: Boolean, attribute: "show-toggle-mode-button" })
|
||||||
|
public showToggleModeButton = false;
|
||||||
|
|
||||||
@state() private _yaml?: string;
|
@state() private _yaml?: string;
|
||||||
|
|
||||||
@state() private _config?: T;
|
@state() private _config?: T;
|
||||||
@ -217,9 +220,16 @@ export abstract class HuiElementEditor<T, C = any> extends LitElement {
|
|||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<ha-button @click=${this.toggleMode} .disabled=${!guiModeAvailable}>
|
${this.showToggleModeButton
|
||||||
${guiModeAvailable && this._guiMode ? "Show yaml" : "Show UI"}
|
? html`
|
||||||
</ha-button>
|
<ha-button
|
||||||
|
@click=${this.toggleMode}
|
||||||
|
.disabled=${!guiModeAvailable}
|
||||||
|
>
|
||||||
|
${guiModeAvailable && this._guiMode ? "Show yaml" : "Show UI"}
|
||||||
|
</ha-button>
|
||||||
|
`
|
||||||
|
: nothing}
|
||||||
${this.GUImode
|
${this.GUImode
|
||||||
? html`
|
? html`
|
||||||
<div class="gui-editor">
|
<div class="gui-editor">
|
||||||
|
@ -1803,7 +1803,7 @@
|
|||||||
"editor_not_supported": "Visual editor not supported",
|
"editor_not_supported": "Visual editor not supported",
|
||||||
"editor_not_supported_details": "The visual editor is not supported for type ''{type}''.",
|
"editor_not_supported_details": "The visual editor is not supported for type ''{type}''.",
|
||||||
"warning_details": "The configuration contains the following warnings:",
|
"warning_details": "The configuration contains the following warnings:",
|
||||||
"edit_in_yaml_supported": "You can still edit your config in YAML.",
|
"edit_in_yaml_supported": "You can still edit the configuration in YAML.",
|
||||||
"key_missing": "Required key ''{key}'' is missing.",
|
"key_missing": "Required key ''{key}'' is missing.",
|
||||||
"key_not_expected": "Key ''{key}'' is not expected or not supported by the visual editor.",
|
"key_not_expected": "Key ''{key}'' is not expected or not supported by the visual editor.",
|
||||||
"key_wrong_type": "The provided value for ''{key}'' is not supported by the visual editor. We support ({type_correct}) but received ({type_wrong}).",
|
"key_wrong_type": "The provided value for ''{key}'' is not supported by the visual editor. We support ({type_correct}) but received ({type_wrong}).",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user