1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-20 02:38:53 +00:00

Make use of documentationUrl over hardcoded docs links (#28022)

Make use of documentationUrl over hardcoded docs link
This commit is contained in:
Aidan Timson
2025-11-21 11:43:46 +00:00
committed by GitHub
parent c679e312a0
commit 2955cb4956
9 changed files with 27 additions and 12 deletions

View File

@@ -10,6 +10,7 @@ import {
import { formatTime } from "../common/datetime/format_time"; import { formatTime } from "../common/datetime/format_time";
import type { LocalizeFunc } from "../common/translations/localize"; import type { LocalizeFunc } from "../common/translations/localize";
import type { HomeAssistant } from "../types"; import type { HomeAssistant } from "../types";
import { documentationUrl } from "../util/documentation-url";
import { fileDownload } from "../util/file_download"; import { fileDownload } from "../util/file_download";
import { handleFetchPromise } from "../util/hass-call-api"; import { handleFetchPromise } from "../util/hass-call-api";
import type { BackupManagerState, ManagerStateEvent } from "./backup_manager"; import type { BackupManagerState, ManagerStateEvent } from "./backup_manager";
@@ -414,7 +415,7 @@ ${hass.auth.data.hassUrl}
${hass.localize("ui.panel.config.backup.emergency_kit_file.encryption_key")} ${hass.localize("ui.panel.config.backup.emergency_kit_file.encryption_key")}
${encryptionKey} ${encryptionKey}
${hass.localize("ui.panel.config.backup.emergency_kit_file.more_info", { link: "https://www.home-assistant.io/more-info/backup-emergency-kit" })}`); ${hass.localize("ui.panel.config.backup.emergency_kit_file.more_info", { link: documentationUrl(hass, "/more-info/backup-emergency-kit") })}`);
export const geneateEmergencyKitFileName = ( export const geneateEmergencyKitFileName = (
hass: HomeAssistant, hass: HomeAssistant,

View File

@@ -5,6 +5,7 @@ import { atLeastVersion } from "../common/config/version";
import { applyThemesOnElement } from "../common/dom/apply_themes_on_element"; import { applyThemesOnElement } from "../common/dom/apply_themes_on_element";
import "../components/ha-card"; import "../components/ha-card";
import { haStyle } from "../resources/styles"; import { haStyle } from "../resources/styles";
import { documentationUrl } from "../util/documentation-url";
import type { HomeAssistant } from "../types"; import type { HomeAssistant } from "../types";
import "./hass-subpage"; import "./hass-subpage";
@@ -57,7 +58,7 @@ class SupervisorErrorScreen extends LitElement {
</li> </li>
<li> <li>
<a <a
href="https://www.home-assistant.io/help/" href=${documentationUrl(this.hass, "/help/")}
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
> >

View File

@@ -4,6 +4,7 @@ import { LitElement, css, html, nothing } from "lit";
import { customElement, property } from "lit/decorators"; import { customElement, property } from "lit/decorators";
import type { LocalizeFunc } from "../common/translations/localize"; import type { LocalizeFunc } from "../common/translations/localize";
import "../components/ha-card"; import "../components/ha-card";
import { documentationUrl } from "../util/documentation-url";
import type { HomeAssistant } from "../types"; import type { HomeAssistant } from "../types";
import { showAppDialog } from "./dialogs/show-app-dialog"; import { showAppDialog } from "./dialogs/show-app-dialog";
import { showCommunityDialog } from "./dialogs/show-community-dialog"; import { showCommunityDialog } from "./dialogs/show-community-dialog";
@@ -22,7 +23,10 @@ class OnboardingWelcomeLinks extends LitElement {
return html`<a return html`<a
target="_blank" target="_blank"
rel="noreferrer noopener" rel="noreferrer noopener"
href="https://www.home-assistant.io/blog/2016/01/19/perfect-home-automation/" href=${documentationUrl(
this.hass,
"/blog/2016/01/19/perfect-home-automation/"
)}
> >
<onboarding-welcome-link <onboarding-welcome-link
noninteractive noninteractive

View File

@@ -2,6 +2,7 @@ import { mdiClose, mdiOpenInNew } from "@mdi/js";
import { css, html, LitElement, nothing } from "lit"; import { css, html, LitElement, nothing } from "lit";
import { customElement, property, query, state } from "lit/decorators"; import { customElement, property, query, state } from "lit/decorators";
import { fireEvent } from "../../../common/dom/fire_event"; import { fireEvent } from "../../../common/dom/fire_event";
import { documentationUrl } from "../../../util/documentation-url";
import "../../../components/ha-alert"; import "../../../components/ha-alert";
import "../../../components/ha-button"; import "../../../components/ha-button";
import "../../../components/ha-code-editor"; import "../../../components/ha-code-editor";
@@ -140,7 +141,7 @@ class DialogImportBlueprint extends LitElement {
<ha-button <ha-button
size="small" size="small"
appearance="plain" appearance="plain"
href="https://www.home-assistant.io/get-blueprints" href=${documentationUrl(this.hass, "/get-blueprints")}
target="_blank" target="_blank"
rel="noreferrer noopener" rel="noreferrer noopener"
> >

View File

@@ -299,7 +299,7 @@ class HaBlueprintOverview extends LitElement {
> >
<ha-button <ha-button
appearance="plain" appearance="plain"
href="https://www.home-assistant.io/get-blueprints" href=${documentationUrl(this.hass, "/get-blueprints")}
target="_blank" target="_blank"
rel="noreferrer noopener" rel="noreferrer noopener"
size="small" size="small"

View File

@@ -2,6 +2,7 @@ import { css, html, LitElement, nothing } from "lit";
import { customElement, property } from "lit/decorators"; import { customElement, property } from "lit/decorators";
import "../../../../components/ha-alert"; import "../../../../components/ha-alert";
import type { EnergyValidationIssue } from "../../../../data/energy"; import type { EnergyValidationIssue } from "../../../../data/energy";
import { documentationUrl } from "../../../../util/documentation-url";
import type { HomeAssistant } from "../../../../types"; import type { HomeAssistant } from "../../../../types";
@customElement("ha-energy-validation-result") @customElement("ha-energy-validation-result")
@@ -29,7 +30,10 @@ class EnergyValidationMessage extends LitElement {
)} )}
${issue.type === "recorder_untracked" ${issue.type === "recorder_untracked"
? html`(<a ? html`(<a
href="https://www.home-assistant.io/integrations/recorder#configure-filter" href=${documentationUrl(
this.hass,
"/integrations/recorder#configure-filter"
)}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
>${this.hass.localize("ui.panel.config.common.learn_more")}</a >${this.hass.localize("ui.panel.config.common.learn_more")}</a

View File

@@ -16,6 +16,7 @@ import type { HomeAssistant } from "../../../types";
import { SubscribeMixin } from "../../../mixins/subscribe-mixin"; import { SubscribeMixin } from "../../../mixins/subscribe-mixin";
import { brandsUrl } from "../../../util/brands-url"; import { brandsUrl } from "../../../util/brands-url";
import { showToast } from "../../../util/toast"; import { showToast } from "../../../util/toast";
import { documentationUrl } from "../../../util/documentation-url";
import { haStyle } from "../../../resources/styles"; import { haStyle } from "../../../resources/styles";
import { showLabsPreviewFeatureEnableDialog } from "./show-dialog-labs-preview-feature-enable"; import { showLabsPreviewFeatureEnableDialog } from "./show-dialog-labs-preview-feature-enable";
import { import {
@@ -100,7 +101,7 @@ class HaConfigLabs extends SubscribeMixin(LitElement) {
? html` ? html`
<a <a
slot="toolbar-icon" slot="toolbar-icon"
href="https://www.home-assistant.io/integrations/labs/" href=${documentationUrl(this.hass, "/integrations/labs/")}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
.title=${this.hass.localize("ui.common.help")} .title=${this.hass.localize("ui.common.help")}
@@ -124,7 +125,7 @@ class HaConfigLabs extends SubscribeMixin(LitElement) {
"ui.panel.config.labs.empty.description" "ui.panel.config.labs.empty.description"
)} )}
<a <a
href="https://www.home-assistant.io/integrations/labs/" href=${documentationUrl(this.hass, "/integrations/labs/")}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
> >

View File

@@ -2,6 +2,7 @@ import type { CSSResultGroup } from "lit";
import { LitElement, css, html, nothing } from "lit"; import { LitElement, css, html, nothing } from "lit";
import { customElement, property, state } from "lit/decorators"; import { customElement, property, state } from "lit/decorators";
import { fireEvent } from "../../../common/dom/fire_event"; import { fireEvent } from "../../../common/dom/fire_event";
import { documentationUrl } from "../../../util/documentation-url";
import "../../../components/ha-alert"; import "../../../components/ha-alert";
import "../../../components/ha-button"; import "../../../components/ha-button";
import { createCloseHeading } from "../../../components/ha-dialog"; import { createCloseHeading } from "../../../components/ha-dialog";
@@ -14,8 +15,6 @@ import { haStyleDialog } from "../../../resources/styles";
import type { HomeAssistant } from "../../../types"; import type { HomeAssistant } from "../../../types";
import type { TagDetailDialogParams } from "./show-dialog-tag-detail"; import type { TagDetailDialogParams } from "./show-dialog-tag-detail";
const TAG_BASE = "https://www.home-assistant.io/tag/";
@customElement("dialog-tag-detail") @customElement("dialog-tag-detail")
class DialogTagDetail class DialogTagDetail
extends LitElement extends LitElement
@@ -122,7 +121,7 @@ class DialogTagDetail
</div> </div>
<div id="qr"> <div id="qr">
<ha-qr-code <ha-qr-code
.data=${`${TAG_BASE}${this._params!.entry!.id}`} .data=${`${documentationUrl(this.hass, "/tag/")}${this._params!.entry!.id}`}
center-image="/static/icons/favicon-192x192.png" center-image="/static/icons/favicon-192x192.png"
error-correction-level="quartile" error-correction-level="quartile"
scale="5" scale="5"

View File

@@ -7,6 +7,7 @@ import "../../components/ha-settings-row";
import "../../components/ha-switch"; import "../../components/ha-switch";
import type { CoreFrontendUserData } from "../../data/frontend"; import type { CoreFrontendUserData } from "../../data/frontend";
import { saveFrontendUserData } from "../../data/frontend"; import { saveFrontendUserData } from "../../data/frontend";
import { documentationUrl } from "../../util/documentation-url";
import type { HomeAssistant } from "../../types"; import type { HomeAssistant } from "../../types";
@customElement("ha-advanced-mode-row") @customElement("ha-advanced-mode-row")
@@ -31,7 +32,10 @@ class AdvancedModeRow extends LitElement {
<span slot="description"> <span slot="description">
${this.hass.localize("ui.panel.profile.advanced_mode.description")} ${this.hass.localize("ui.panel.profile.advanced_mode.description")}
<a <a
href="https://www.home-assistant.io/blog/2019/07/17/release-96/#advanced-mode" href=${documentationUrl(
this.hass,
"/blog/2019/07/17/release-96/#advanced-mode"
)}
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
>${this.hass.localize("ui.panel.profile.advanced_mode.link_promo")} >${this.hass.localize("ui.panel.profile.advanced_mode.link_promo")}