From d55bade07025869dfe787b9cc8a70736cbe6254b Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 7 Sep 2021 00:40:25 -0700 Subject: [PATCH] Small tweaks for the create automation from blueprint screen (#9980) --- .../automation/blueprint-automation-editor.ts | 156 +++++++++--------- 1 file changed, 80 insertions(+), 76 deletions(-) diff --git a/src/panels/config/automation/blueprint-automation-editor.ts b/src/panels/config/automation/blueprint-automation-editor.ts index a7ccc8c07c..f0179d2fbd 100644 --- a/src/panels/config/automation/blueprint-automation-editor.ts +++ b/src/panels/config/automation/blueprint-automation-editor.ts @@ -53,7 +53,8 @@ export class HaBlueprintAutomationEditor extends LitElement { protected render() { const blueprint = this._blueprint; - return html` + return html` + ${!this.narrow ? html` ${this.config.alias} ` : ""} @@ -118,81 +119,80 @@ export class HaBlueprintAutomationEditor extends LitElement { - - ${this.hass.localize( - "ui.panel.config.automation.editor.blueprint.header" - )} - -
- ${this._blueprints - ? Object.keys(this._blueprints).length - ? html` - - ` - : this.hass.localize( - "ui.panel.config.automation.editor.blueprint.no_blueprints" - ) - : html``} -
+ +
+ ${this._blueprints + ? Object.keys(this._blueprints).length + ? html` + + ` + : this.hass.localize( + "ui.panel.config.automation.editor.blueprint.no_blueprints" + ) + : html``} +
- ${this.config.use_blueprint.path - ? blueprint && "error" in blueprint - ? html`

- There is an error in this Blueprint: ${blueprint.error} -

` - : html`${blueprint?.metadata.description - ? html`` - : ""} - ${blueprint?.metadata?.input && - Object.keys(blueprint.metadata.input).length - ? Object.entries(blueprint.metadata.input).map( - ([key, value]) => - html` - ${value?.name || key} - ${value?.description} - ${value?.selector - ? html`` - : html``} - ` - ) - : html`

- ${this.hass.localize( - "ui.panel.config.automation.editor.blueprint.no_inputs" - )} -

`}` - : ""} -
-
`; + ${this.config.use_blueprint.path + ? blueprint && "error" in blueprint + ? html`

+ There is an error in this Blueprint: ${blueprint.error} +

` + : html`${blueprint?.metadata.description + ? html`` + : ""} + ${blueprint?.metadata?.input && + Object.keys(blueprint.metadata.input).length + ? Object.entries(blueprint.metadata.input).map( + ([key, value]) => + html` + ${value?.name || key} + ${value?.description} + ${value?.selector + ? html`` + : html``} + ` + ) + : html`

+ ${this.hass.localize( + "ui.panel.config.automation.editor.blueprint.no_inputs" + )} +

`}` + : ""} + + `; } private async _getBlueprints() { @@ -267,11 +267,15 @@ export class HaBlueprintAutomationEditor extends LitElement { return [ haStyle, css` + ha-card.blueprint { + max-width: 1040px; + margin: 24px auto; + } .padding { padding: 16px; } .blueprint-picker-container { - padding: 16px; + padding: 0 16px 16px; } h3 { margin: 16px;