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
This commit is contained in:
Drake Loud 2019-10-22 01:27:36 -07:00 committed by Bram Kragten
parent 11c08e9a69
commit 7b5201599d
2 changed files with 14 additions and 1 deletions

View File

@ -87,6 +87,18 @@ export class HuiEditView extends LitElement {
return this.shadowRoot!.querySelector("ha-paper-dialog")!; 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 { protected render(): TemplateResult | void {
let content; let content;
switch (this._curTab) { switch (this._curTab) {
@ -118,7 +130,7 @@ export class HuiEditView extends LitElement {
return html` return html`
<ha-paper-dialog with-backdrop> <ha-paper-dialog with-backdrop>
<h2> <h2>
${this.hass!.localize("ui.panel.lovelace.editor.edit_view.header")} ${this._viewConfigTitle}
</h2> </h2>
<paper-tabs <paper-tabs
scrollable scrollable

View File

@ -1397,6 +1397,7 @@
}, },
"edit_view": { "edit_view": {
"header": "View Configuration", "header": "View Configuration",
"header_name": "{name} View Configuration",
"add": "Add view", "add": "Add view",
"edit": "Edit view", "edit": "Edit view",
"delete": "Delete view" "delete": "Delete view"