From 5422fda99099be1fb66d5458292c7b6edd352fec Mon Sep 17 00:00:00 2001
From: Paul Bottein
Date: Thu, 22 Sep 2022 15:24:15 +0200
Subject: [PATCH] Update import blueprint dialog (#13840)
---
.../blueprint/dialog-import-blueprint.ts | 95 ++++++++++++-------
src/translations/en.json | 10 +-
2 files changed, 64 insertions(+), 41 deletions(-)
diff --git a/src/panels/config/blueprint/dialog-import-blueprint.ts b/src/panels/config/blueprint/dialog-import-blueprint.ts
index ef43378c16..1b97d52e8d 100644
--- a/src/panels/config/blueprint/dialog-import-blueprint.ts
+++ b/src/panels/config/blueprint/dialog-import-blueprint.ts
@@ -1,4 +1,5 @@
import "@material/mwc-button";
+import { mdiOpenInNew } from "@mdi/js";
import { css, html, LitElement, TemplateResult } from "lit";
import { customElement, property, query, state } from "lit/decorators";
import { fireEvent } from "../../../common/dom/fire_event";
@@ -105,50 +106,61 @@ class DialogImportBlueprint extends LitElement {
>
${this._result.raw_data}
`
- : html`${this.hass.localize(
- "ui.panel.config.blueprint.add.import_introduction_link",
- "community_link",
- html`${this.hass.localize(
- "ui.panel.config.blueprint.add.community_forums"
- )}`
- )}
+ ${this.hass.localize(
+ "ui.panel.config.blueprint.add.import_introduction"
+ )}
+
+
+ ${this.hass.localize(
+ "ui.panel.config.blueprint.add.community_forums"
+ )}
+
+
+ `}
+ >
+ `}
+
+ ${this.hass.localize("ui.common.cancel")}
+
${!this._result
- ? html`
- ${this._importing
- ? html``
- : ""}
- ${this.hass.localize("ui.panel.config.blueprint.add.import_btn")}
- `
- : html`
- ${this.hass.localize("ui.common.cancel")}
+ ${this._importing
+ ? html``
+ : ""}
+ ${this.hass.localize(
+ "ui.panel.config.blueprint.add.import_btn"
+ )}
+ `
+ : html`
`
: ""}
${this.hass.localize("ui.panel.config.blueprint.add.save_btn")}
- `}
+
+ `}
`;
}
@@ -215,9 +228,19 @@ class DialogImportBlueprint extends LitElement {
static styles = [
haStyleDialog,
css`
+ p {
+ margin-top: 0;
+ margin-bottom: 8px;
+ }
ha-textfield {
display: block;
- margin-top: 8px;
+ margin-top: 24px;
+ }
+ a {
+ text-decoration: none;
+ }
+ a ha-svg-icon {
+ --mdc-icon-size: 16px;
}
`,
];
diff --git a/src/translations/en.json b/src/translations/en.json
index 2629fdf097..2200bf2228 100755
--- a/src/translations/en.json
+++ b/src/translations/en.json
@@ -2258,15 +2258,15 @@
"add": {
"header": "Import a blueprint",
"import_header": "Blueprint ''{name}''",
- "import_introduction_link": "You can import blueprints of other users from Github and the {community_link}. Enter the URL of the blueprint below.",
- "community_forums": "community forums",
- "url": "URL of the blueprint",
+ "import_introduction": "Import blueprints of other users from GitHub and the community forums by pasting the address below.",
+ "community_forums": "View blueprints on the community forums",
+ "url": "Blueprint address",
"raw_blueprint": "Blueprint content",
"importing": "Loading blueprint…",
- "import_btn": "Preview blueprint",
+ "import_btn": "Preview",
"saving": "Importing blueprint…",
"save_btn": "Import blueprint",
- "error_no_url": "Please enter the URL of the blueprint.",
+ "error_no_url": "Please enter the blueprint address.",
"unsupported_blueprint": "This blueprint is not supported",
"file_name": "Blueprint Path"
}