mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Add heading card when creating a new view (#22123)
This commit is contained in:
parent
570ad38bac
commit
ac9654c1de
@ -379,7 +379,19 @@ export class HuiDialogEditView extends LitElement {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (viewConf.type === SECTION_VIEW_LAYOUT && !viewConf.sections?.length) {
|
if (viewConf.type === SECTION_VIEW_LAYOUT && !viewConf.sections?.length) {
|
||||||
viewConf.sections = [{ type: "grid", cards: [] }];
|
viewConf.sections = [
|
||||||
|
{
|
||||||
|
type: "grid",
|
||||||
|
cards: [
|
||||||
|
{
|
||||||
|
type: "heading",
|
||||||
|
heading: this.hass!.localize(
|
||||||
|
"ui.panel.lovelace.editor.section.default_section_title"
|
||||||
|
),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
} else if (!viewConf.cards?.length) {
|
} else if (!viewConf.cards?.length) {
|
||||||
viewConf.cards = [];
|
viewConf.cards = [];
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,9 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
|
|||||||
cards: [
|
cards: [
|
||||||
{
|
{
|
||||||
type: "heading",
|
type: "heading",
|
||||||
heading: "New Section",
|
heading: this.hass!.localize(
|
||||||
|
"ui.panel.lovelace.editor.section.default_section_title"
|
||||||
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
@ -5669,7 +5669,8 @@
|
|||||||
"section": {
|
"section": {
|
||||||
"add_badge": "Add badge",
|
"add_badge": "Add badge",
|
||||||
"add_card": "[%key:ui::panel::lovelace::editor::edit_card::add%]",
|
"add_card": "[%key:ui::panel::lovelace::editor::edit_card::add%]",
|
||||||
"create_section": "Create section"
|
"create_section": "Create section",
|
||||||
|
"default_section_title": "New section"
|
||||||
},
|
},
|
||||||
"delete_section": {
|
"delete_section": {
|
||||||
"title": "Delete section",
|
"title": "Delete section",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user