mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
fix hui-panel-view for a "warning_multiple_cards" (#25899)
This commit is contained in:
parent
93df473ad2
commit
6006e926a7
@ -10,8 +10,8 @@ import type { LovelaceViewConfig } from "../../../data/lovelace/config/view";
|
|||||||
import type { HomeAssistant } from "../../../types";
|
import type { HomeAssistant } from "../../../types";
|
||||||
import type { HuiCard } from "../cards/hui-card";
|
import type { HuiCard } from "../cards/hui-card";
|
||||||
import type { HuiCardOptions } from "../components/hui-card-options";
|
import type { HuiCardOptions } from "../components/hui-card-options";
|
||||||
import type { HuiWarning } from "../components/hui-warning";
|
|
||||||
import type { Lovelace } from "../types";
|
import type { Lovelace } from "../types";
|
||||||
|
import "../../../components/ha-alert";
|
||||||
|
|
||||||
let editCodeLoaded = false;
|
let editCodeLoaded = false;
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ export class PanelView extends LitElement implements LovelaceViewElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public cards: HuiCard[] = [];
|
@property({ attribute: false }) public cards: HuiCard[] = [];
|
||||||
|
|
||||||
@state() private _card?: HuiCard | HuiWarning | HuiCardOptions;
|
@state() private _card?: HuiCard | HuiCardOptions;
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
public setConfig(_config: LovelaceViewConfig): void {}
|
public setConfig(_config: LovelaceViewConfig): void {}
|
||||||
@ -63,11 +63,11 @@ export class PanelView extends LitElement implements LovelaceViewElement {
|
|||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
${this.cards!.length > 1
|
${this.cards!.length > 1
|
||||||
? html`<hui-warning .hass=${this.hass}>
|
? html`<ha-alert alert-type="warning"
|
||||||
${this.hass!.localize(
|
>${this.hass!.localize(
|
||||||
"ui.panel.lovelace.editor.view.panel_mode.warning_multiple_cards"
|
"ui.panel.lovelace.editor.view.panel_mode.warning_multiple_cards"
|
||||||
)}
|
)}</ha-alert
|
||||||
</hui-warning>`
|
>`
|
||||||
: ""}
|
: ""}
|
||||||
${this._card}
|
${this._card}
|
||||||
${this.lovelace?.editMode && this.cards.length === 0
|
${this.lovelace?.editMode && this.cards.length === 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user