From 7b5201599d191be593ef64044b1d7e8fa66b9a75 Mon Sep 17 00:00:00 2001 From: Drake Loud Date: Tue, 22 Oct 2019 01:27:36 -0700 Subject: [PATCH] added title to view configuation (#4037) * added title to view configuation * replacing let with const * added localization change * updated view config title * linter updates * Prettier updates --- .../lovelace/editor/view-editor/hui-edit-view.ts | 14 +++++++++++++- src/translations/en.json | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/panels/lovelace/editor/view-editor/hui-edit-view.ts b/src/panels/lovelace/editor/view-editor/hui-edit-view.ts index 9524f1e398..2ebc70dc70 100644 --- a/src/panels/lovelace/editor/view-editor/hui-edit-view.ts +++ b/src/panels/lovelace/editor/view-editor/hui-edit-view.ts @@ -87,6 +87,18 @@ export class HuiEditView extends LitElement { return this.shadowRoot!.querySelector("ha-paper-dialog")!; } + private get _viewConfigTitle(): string { + if (!this._config || !this._config.title) { + return this.hass!.localize("ui.panel.lovelace.editor.edit_view.header"); + } + + return this.hass!.localize( + "ui.panel.lovelace.editor.edit_view.header_name", + "name", + this._config.title + ); + } + protected render(): TemplateResult | void { let content; switch (this._curTab) { @@ -118,7 +130,7 @@ export class HuiEditView extends LitElement { return html`

- ${this.hass!.localize("ui.panel.lovelace.editor.edit_view.header")} + ${this._viewConfigTitle}