diff --git a/src/panels/config/automation/ha-automation-picker.ts b/src/panels/config/automation/ha-automation-picker.ts index 1b72642178..e333c5c542 100644 --- a/src/panels/config/automation/ha-automation-picker.ts +++ b/src/panels/config/automation/ha-automation-picker.ts @@ -132,7 +132,7 @@ class HaAutomationPicker extends LitElement { : "hass:pencil-off"} .disabled=${!automation.attributes.id} title="${this.hass.localize( - "ui.panel.config.automation.picker.show_info_automation" + "ui.panel.config.automation.picker.edit_automation" )}" > diff --git a/src/panels/config/blueprint/dialog-import-blueprint.ts b/src/panels/config/blueprint/dialog-import-blueprint.ts index 7f328756c4..dc526f0d0d 100644 --- a/src/panels/config/blueprint/dialog-import-blueprint.ts +++ b/src/panels/config/blueprint/dialog-import-blueprint.ts @@ -71,7 +71,7 @@ class DialogImportBlueprint extends LitElement { html`${this._result.blueprint.metadata.name}`, "domain", this._result.blueprint.metadata.domain - )} + )}

${this._result.validation_errors ? html`

@@ -89,7 +89,9 @@ class DialogImportBlueprint extends LitElement { `}

${this._result.raw_data}
` diff --git a/src/panels/config/blueprint/ha-blueprint-overview.ts b/src/panels/config/blueprint/ha-blueprint-overview.ts index d3874bf8f3..731b01366e 100644 --- a/src/panels/config/blueprint/ha-blueprint-overview.ts +++ b/src/panels/config/blueprint/ha-blueprint-overview.ts @@ -1,6 +1,6 @@ import "@material/mwc-fab"; import "@material/mwc-icon-button"; -import { mdiPlus, mdiHelpCircle, mdiDelete } from "@mdi/js"; +import { mdiPlus, mdiHelpCircle, mdiDelete, mdiRobot } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; import { CSSResult, @@ -80,7 +80,7 @@ class HaBlueprintOverview extends LitElement { }); private _columns = memoizeOne( - (_language): DataTableColumnContainer => { + (narrow, _language): DataTableColumnContainer => { const columns: DataTableColumnContainer = { name: { title: this.hass.localize( @@ -92,44 +92,77 @@ class HaBlueprintOverview extends LitElement { grows: true, }, }; - columns.domain = { - title: "Domain", - sortable: true, - filterable: true, - direction: "asc", - width: "20%", - }; - columns.path = { - title: "Path", - sortable: true, - filterable: true, - direction: "asc", - width: "20%", - }; - columns.create = { - title: "", - type: "icon-button", - template: (_, blueprint: any) => - blueprint.error - ? "" - : html` this._createNew(ev)} - >`, - }; + + if (narrow) { + columns.name.template = (name, entity: any) => { + return html` + ${name}
+
+ ${entity.path} +
+ `; + }; + columns.create = { + title: "", + type: "icon-button", + template: (_, blueprint: any) => + blueprint.error + ? "" + : html` this._createNew(ev)} + >`, + }; + } else { + columns.path = { + title: this.hass.localize( + "ui.panel.config.blueprint.overview.headers.file_name" + ), + sortable: true, + filterable: true, + direction: "asc", + width: "25%", + }; + columns.create = { + title: "", + width: "180px", + template: (_, blueprint: any) => + blueprint.error + ? "" + : html` this._createNew(ev)} + > + ${this.hass.localize( + "ui.panel.config.blueprint.overview.use_blueprint" + )} + `, + }; + } + columns.delete = { title: "", type: "icon-button", template: (_, blueprint: any) => blueprint.error ? "" - : html` this._delete(ev)} >`, }; + return columns; } ); @@ -142,7 +175,7 @@ class HaBlueprintOverview extends LitElement { back-path="/config" .route=${this.route} .tabs=${configSections.automation} - .columns=${this._columns(this.hass.language)} + .columns=${this._columns(this.narrow, this.hass.language)} .data=${this._processedBlueprints(this.blueprints)} id="entity_id" .noDataText=${this.hass.localize( diff --git a/src/translations/en.json b/src/translations/en.json index bb956c60ce..86b06bb91b 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1129,7 +1129,7 @@ }, "editor": { "enable_disable": "Enable/Disable automation", - "introduction": "Use automations to bring your home alive.", + "introduction": "Use automations to bring your home to live.", "default_name": "New Automation", "load_error_not_editable": "Only automations in automations.yaml are editable.", "load_error_unknown": "Error loading automation ({err_no}).", @@ -1447,15 +1447,19 @@ "introduction": "The blueprint editor allows you to create and edit blueprints.", "learn_more": "Learn more about blueprints", "headers": { - "name": "Name" + "name": "Name", + "domain": "Domain", + "file_name": "File name" }, "confirm_delete_header": "Delete this blueprint?", - "confirm_delete_text": "Are you sure you want to delete this blueprint", - "add_blueprint": "Add blueprint" + "confirm_delete_text": "Are you sure you want to delete this blueprint?", + "add_blueprint": "Add blueprint", + "use_blueprint": "Create automation", + "delete_blueprint": "Delete blueprint" }, "add": { "header": "Add new blueprint", - "import_header": "Import {name} ({domain})", + "import_header": "Import \"{name}\" (type: {domain})", "import_introduction": "You can import blueprints of other users from Github and the community forums. Enter the URL of the blueprint below.", "url": "URL of the blueprint", "importing": "Importing blueprint...", @@ -1463,7 +1467,8 @@ "saving": "Saving blueprint...", "save_btn": "Save blueprint", "error_no_url": "Please enter the URL of the blueprint.", - "unsupported_blueprint": "This blueprint is not supported" + "unsupported_blueprint": "This blueprint is not supported", + "file_name": "Local blueprint file name" } }, "script": { @@ -1537,7 +1542,7 @@ } }, "editor": { - "introduction": "Use scenes to bring your home alive.", + "introduction": "Use scenes to bring your home to live.", "default_name": "New Scene", "load_error_not_editable": "Only scenes in scenes.yaml are editable.", "load_error_unknown": "Error loading scene ({err_no}).",