mirror of
https://github.com/home-assistant/frontend.git
synced 2026-01-13 06:03:44 +00:00
Use action button text name for empty state card (#28948)
This commit is contained in:
@ -55,10 +55,10 @@ export class HuiEmptyStateCard extends LitElement implements LovelaceCard {
|
||||
${this._config.content
|
||||
? html`<p>${this._config.content}</p>`
|
||||
: nothing}
|
||||
${this._config.tap_action && this._config.action_label
|
||||
${this._config.tap_action && this._config.action_button_text
|
||||
? html`
|
||||
<ha-button @click=${this._handleAction}>
|
||||
${this._config.action_label}
|
||||
${this._config.action_button_text}
|
||||
</ha-button>
|
||||
`
|
||||
: nothing}
|
||||
|
||||
@ -62,7 +62,7 @@ export interface EmptyStateCardConfig extends LovelaceCardConfig {
|
||||
icon?: string;
|
||||
title?: string;
|
||||
content?: string;
|
||||
action_label?: string;
|
||||
action_button_text?: string;
|
||||
tap_action?: ActionConfig;
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ const cardConfigStruct = assign(
|
||||
icon: optional(string()),
|
||||
title: optional(string()),
|
||||
content: optional(string()),
|
||||
action_label: optional(string()),
|
||||
action_button_text: optional(string()),
|
||||
tap_action: optional(actionConfigStruct),
|
||||
})
|
||||
);
|
||||
@ -78,7 +78,7 @@ export class HuiEmptyStateCardEditor
|
||||
flatten: true,
|
||||
iconPath: mdiGestureTap,
|
||||
schema: [
|
||||
{ name: "action_label", selector: { text: {} } },
|
||||
{ name: "action_button_text", selector: { text: {} } },
|
||||
{
|
||||
name: "tap_action",
|
||||
selector: {
|
||||
@ -134,7 +134,7 @@ export class HuiEmptyStateCardEditor
|
||||
switch (schema.name) {
|
||||
case "style":
|
||||
case "content":
|
||||
case "action_label":
|
||||
case "action_button_text":
|
||||
return this.hass!.localize(
|
||||
`ui.panel.lovelace.editor.card.empty_state.${schema.name}`
|
||||
);
|
||||
|
||||
@ -80,7 +80,7 @@ export class OriginalStatesViewStrategy extends ReactiveElement {
|
||||
),
|
||||
...(hass.user?.is_admin
|
||||
? {
|
||||
action_label: hass.localize(
|
||||
action_button_text: hass.localize(
|
||||
"ui.panel.lovelace.strategy.original-states.empty_state_action"
|
||||
),
|
||||
tap_action: {
|
||||
|
||||
@ -7992,7 +7992,7 @@
|
||||
"content-only": "Content only"
|
||||
},
|
||||
"content": "Content",
|
||||
"action_label": "Action label"
|
||||
"action_text": "Action button text"
|
||||
},
|
||||
"button": {
|
||||
"name": "Button",
|
||||
|
||||
Reference in New Issue
Block a user