mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 02:36:37 +00:00
Only show url path field in advanced mode (#5233)
This commit is contained in:
parent
4e19232960
commit
a88321d243
@ -99,7 +99,9 @@ export class DialogLovelaceDashboardDetail extends LitElement {
|
|||||||
.label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
"ui.panel.config.lovelace.dashboards.detail.title"
|
"ui.panel.config.lovelace.dashboards.detail.title"
|
||||||
)}
|
)}
|
||||||
@blur=${this._fillUrlPath}
|
@blur=${this.hass.userData?.showAdvanced
|
||||||
|
? this._fillUrlPath
|
||||||
|
: undefined}
|
||||||
.invalid=${titleInvalid}
|
.invalid=${titleInvalid}
|
||||||
.errorMessage=${this.hass.localize(
|
.errorMessage=${this.hass.localize(
|
||||||
"ui.panel.config.lovelace.dashboards.detail.title_required"
|
"ui.panel.config.lovelace.dashboards.detail.title_required"
|
||||||
@ -113,7 +115,7 @@ export class DialogLovelaceDashboardDetail extends LitElement {
|
|||||||
"ui.panel.config.lovelace.dashboards.detail.icon"
|
"ui.panel.config.lovelace.dashboards.detail.icon"
|
||||||
)}
|
)}
|
||||||
></ha-icon-input>
|
></ha-icon-input>
|
||||||
${!this._params.dashboard
|
${!this._params.dashboard && this.hass.userData?.showAdvanced
|
||||||
? html`
|
? html`
|
||||||
<paper-input
|
<paper-input
|
||||||
.value=${this._urlPath}
|
.value=${this._urlPath}
|
||||||
@ -212,10 +214,13 @@ export class DialogLovelaceDashboardDetail extends LitElement {
|
|||||||
private _titleChanged(ev: PolymerChangedEvent<string>) {
|
private _titleChanged(ev: PolymerChangedEvent<string>) {
|
||||||
this._error = undefined;
|
this._error = undefined;
|
||||||
this._title = ev.detail.value;
|
this._title = ev.detail.value;
|
||||||
|
if (!this.hass.userData?.showAdvanced) {
|
||||||
|
this._fillUrlPath();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _fillUrlPath() {
|
private _fillUrlPath() {
|
||||||
if (this._urlPath || !this._title) {
|
if ((this.hass.userData?.showAdvanced && this._urlPath) || !this._title) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const parts = this._title.toLowerCase().split(" ");
|
const parts = this._title.toLowerCase().split(" ");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user