From d06e7eb8a05918e13746151772ca43552d27e285 Mon Sep 17 00:00:00 2001 From: Zack Date: Tue, 22 Feb 2022 12:11:22 -0600 Subject: [PATCH 1/6] Add Tip to config page --- .../config/dashboard/ha-config-dashboard.ts | 64 ++++++++++++++++++- src/translations/en.json | 4 ++ 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/src/panels/config/dashboard/ha-config-dashboard.ts b/src/panels/config/dashboard/ha-config-dashboard.ts index 552692e1e3d3..b76083cfd4df 100644 --- a/src/panels/config/dashboard/ha-config-dashboard.ts +++ b/src/panels/config/dashboard/ha-config-dashboard.ts @@ -1,4 +1,9 @@ -import { mdiCloudLock, mdiDotsVertical, mdiMagnify } from "@mdi/js"; +import { + mdiCloudLock, + mdiDotsVertical, + mdiLightbulbOutline, + mdiMagnify, +} from "@mdi/js"; import "@material/mwc-list/mwc-list-item"; import type { ActionDetail } from "@material/mwc-list"; import "@polymer/app-layout/app-header/app-header"; @@ -18,6 +23,7 @@ import "../../../components/ha-icon-next"; import "../../../components/ha-icon-button"; import "../../../components/ha-menu-button"; import "../../../components/ha-button-menu"; +import "../../../components/ha-svg-icon"; import { CloudStatus } from "../../../data/cloud"; import { refreshSupervisorAvailableUpdates, @@ -134,6 +140,50 @@ class HaConfigDashboard extends LitElement { .pages=${configSections.dashboard} > `} +
+ + Tip! + ${this.hass.localize( + "ui.panel.config.tips.join", + "forums", + html`Forums`, + "twitter", + html`Twitter`, + "discord", + html`Discord`, + "blog", + html`Blog`, + "newsletter", + html`NEW Newsletter` + )} +
`; @@ -223,6 +273,18 @@ class HaConfigDashboard extends LitElement { :host([narrow]) ha-config-section { margin-top: -42px; } + + .tips { + text-align: center; + } + + .tips .text { + color: var(--secondary-text-color); + } + + .tip-word { + font-weight: 500; + } `, ]; } diff --git a/src/translations/en.json b/src/translations/en.json index 7e214663dd3d..98de3e06cc7f 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -3146,6 +3146,10 @@ "log_level_changed": "Log Level changed to: {level}", "download_logs": "Download logs" } + }, + "tips": { + "tip": "Tip!", + "join": "Join the community on our {forums}, {twitter}, {discord}, {blog} or {newsletter}" } }, "lovelace": { From fe87d9189444f53c6d2ae60188c110905b7373bd Mon Sep 17 00:00:00 2001 From: Zack Date: Tue, 22 Feb 2022 12:18:07 -0600 Subject: [PATCH 2/6] new --- src/panels/config/dashboard/ha-config-dashboard.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/panels/config/dashboard/ha-config-dashboard.ts b/src/panels/config/dashboard/ha-config-dashboard.ts index b76083cfd4df..227751ae8b26 100644 --- a/src/panels/config/dashboard/ha-config-dashboard.ts +++ b/src/panels/config/dashboard/ha-config-dashboard.ts @@ -175,12 +175,13 @@ class HaConfigDashboard extends LitElement { >Blog`, "newsletter", - html`NEW Newsletter` + html`NEW + Newsletter` )} From 69417783280ed76c20a7d743332b7e3e984b7e4b Mon Sep 17 00:00:00 2001 From: Zack Date: Tue, 22 Feb 2022 16:25:37 -0600 Subject: [PATCH 3/6] review --- .../config/dashboard/ha-config-dashboard.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/panels/config/dashboard/ha-config-dashboard.ts b/src/panels/config/dashboard/ha-config-dashboard.ts index 227751ae8b26..0e27093947cc 100644 --- a/src/panels/config/dashboard/ha-config-dashboard.ts +++ b/src/panels/config/dashboard/ha-config-dashboard.ts @@ -3,6 +3,7 @@ import { mdiDotsVertical, mdiLightbulbOutline, mdiMagnify, + mdiNewBox, } from "@mdi/js"; import "@material/mwc-list/mwc-list-item"; import type { ActionDetail } from "@material/mwc-list"; @@ -155,7 +156,7 @@ class HaConfigDashboard extends LitElement { >`, "twitter", html`TwitterDiscordChat`, "blog", html`Blog`, "newsletter", - html`NEW + html` Newsletter` + > + ` )} @@ -286,6 +289,10 @@ class HaConfigDashboard extends LitElement { .tip-word { font-weight: 500; } + + .new { + color: var(--primary-color); + } `, ]; } From 7485675c427e142ae4b836ef188b0926e4f6e758 Mon Sep 17 00:00:00 2001 From: Zack Date: Tue, 22 Feb 2022 16:43:12 -0600 Subject: [PATCH 4/6] Fix orphan span --- src/panels/config/dashboard/ha-config-dashboard.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/panels/config/dashboard/ha-config-dashboard.ts b/src/panels/config/dashboard/ha-config-dashboard.ts index 0e27093947cc..d3192ef2259d 100644 --- a/src/panels/config/dashboard/ha-config-dashboard.ts +++ b/src/panels/config/dashboard/ha-config-dashboard.ts @@ -144,8 +144,8 @@ class HaConfigDashboard extends LitElement {
Tip! - ${this.hass.localize( + + ${this.hass.localize( "ui.panel.config.tips.join", "forums", html`Blog`, "newsletter", - html` - Newsletter + > ` - )} + )} +
From 9140b2781695d7f331d2bf2daac30ab4cc66f9c1 Mon Sep 17 00:00:00 2001 From: Zack Date: Tue, 22 Feb 2022 16:47:52 -0600 Subject: [PATCH 5/6] use doc url helper --- src/panels/config/dashboard/ha-config-dashboard.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/panels/config/dashboard/ha-config-dashboard.ts b/src/panels/config/dashboard/ha-config-dashboard.ts index d3192ef2259d..94bdeb96da58 100644 --- a/src/panels/config/dashboard/ha-config-dashboard.ts +++ b/src/panels/config/dashboard/ha-config-dashboard.ts @@ -41,6 +41,7 @@ import "./ha-config-updates"; import { fireEvent } from "../../../common/dom/fire_event"; import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; import { showToast } from "../../../util/toast"; +import { documentationUrl } from "../../../util/documentation-url"; @customElement("ha-config-dashboard") class HaConfigDashboard extends LitElement { @@ -149,35 +150,35 @@ class HaConfigDashboard extends LitElement { "ui.panel.config.tips.join", "forums", html`Forums`, "twitter", html`Twitter`, "discord", html`Chat`, "blog", html`Blog`, "newsletter", html`Newsletter Date: Tue, 22 Feb 2022 16:51:39 -0600 Subject: [PATCH 6/6] community to not doc helper --- src/panels/config/dashboard/ha-config-dashboard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panels/config/dashboard/ha-config-dashboard.ts b/src/panels/config/dashboard/ha-config-dashboard.ts index 94bdeb96da58..9d1d77cfd79b 100644 --- a/src/panels/config/dashboard/ha-config-dashboard.ts +++ b/src/panels/config/dashboard/ha-config-dashboard.ts @@ -150,7 +150,7 @@ class HaConfigDashboard extends LitElement { "ui.panel.config.tips.join", "forums", html`Forums