mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
parent
979085a9de
commit
3984702d3e
@ -8,6 +8,7 @@ import { stopPropagation } from "../../../../common/dom/stop_propagation";
|
|||||||
import { createCloseHeading } from "../../../../components/ha-dialog";
|
import { createCloseHeading } from "../../../../components/ha-dialog";
|
||||||
import "../../../../components/ha-icon";
|
import "../../../../components/ha-icon";
|
||||||
import "../../../../components/ha-select";
|
import "../../../../components/ha-select";
|
||||||
|
import "../../../../components/ha-alert";
|
||||||
import {
|
import {
|
||||||
fetchConfig,
|
fetchConfig,
|
||||||
LovelaceConfig,
|
LovelaceConfig,
|
||||||
@ -104,8 +105,15 @@ export class HuiDialogSelectView extends LitElement {
|
|||||||
})}
|
})}
|
||||||
</ha-select>`
|
</ha-select>`
|
||||||
: ""}
|
: ""}
|
||||||
${this._config
|
${!this._config || (this._config.views || []).length < 1
|
||||||
? this._config.views.length > 1
|
? html`<ha-alert alert-type="error"
|
||||||
|
>${this.hass.localize(
|
||||||
|
this._config
|
||||||
|
? "ui.panel.lovelace.editor.select_view.no_views"
|
||||||
|
: "ui.panel.lovelace.editor.select_view.no_config"
|
||||||
|
)}</ha-alert
|
||||||
|
>`
|
||||||
|
: this._config.views.length > 1
|
||||||
? html`
|
? html`
|
||||||
<mwc-list dialogInitialFocus>
|
<mwc-list dialogInitialFocus>
|
||||||
${this._config.views.map(
|
${this._config.views.map(
|
||||||
@ -125,8 +133,7 @@ export class HuiDialogSelectView extends LitElement {
|
|||||||
)}
|
)}
|
||||||
</mwc-list>
|
</mwc-list>
|
||||||
`
|
`
|
||||||
: ""
|
: ""}
|
||||||
: html`<div>No config found.</div>`}
|
|
||||||
<mwc-button
|
<mwc-button
|
||||||
slot="secondaryAction"
|
slot="secondaryAction"
|
||||||
@click=${this.closeDialog}
|
@click=${this.closeDialog}
|
||||||
@ -134,7 +141,11 @@ export class HuiDialogSelectView extends LitElement {
|
|||||||
>
|
>
|
||||||
${this.hass!.localize("ui.common.cancel")}
|
${this.hass!.localize("ui.common.cancel")}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
<mwc-button slot="primaryAction" @click=${this._selectView}>
|
<mwc-button
|
||||||
|
slot="primaryAction"
|
||||||
|
.disabled=${!this._config || (this._config.views || []).length < 1}
|
||||||
|
@click=${this._selectView}
|
||||||
|
>
|
||||||
${this._params.actionLabel || this.hass!.localize("ui.common.move")}
|
${this._params.actionLabel || this.hass!.localize("ui.common.move")}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
</ha-dialog>
|
</ha-dialog>
|
||||||
|
@ -5020,7 +5020,9 @@
|
|||||||
"select_view": {
|
"select_view": {
|
||||||
"header": "Choose a view",
|
"header": "Choose a view",
|
||||||
"dashboard_label": "Dashboard",
|
"dashboard_label": "Dashboard",
|
||||||
"views_label": "View"
|
"views_label": "View",
|
||||||
|
"no_config": "No config found.",
|
||||||
|
"no_views": "No views in this dashboard."
|
||||||
},
|
},
|
||||||
"suggest_card": {
|
"suggest_card": {
|
||||||
"header": "We created a suggestion for you",
|
"header": "We created a suggestion for you",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user