mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 10:16:46 +00:00
Fix card editor help links (#25408)
This commit is contained in:
parent
724df18175
commit
75a2c061c2
@ -110,11 +110,7 @@ export class HuiDialogEditCard
|
||||
}
|
||||
|
||||
protected updated(changedProps: PropertyValues): void {
|
||||
if (
|
||||
!this._cardConfig ||
|
||||
this._documentationURL !== undefined ||
|
||||
!changedProps.has("_cardConfig")
|
||||
) {
|
||||
if (!this._cardConfig || !changedProps.has("_cardConfig")) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,23 @@ import {
|
||||
import type { HomeAssistant } from "../../../types";
|
||||
import { documentationUrl } from "../../../util/documentation-url";
|
||||
|
||||
const NON_STANDARD_URLS = {
|
||||
"energy-date-selection": "energy/#energy-date-picker",
|
||||
"energy-usage-graph": "energy/#energy-usage-graph",
|
||||
"energy-solar-graph": "energy/#solar-production-graph",
|
||||
"energy-gas-graph": "energy/#gas-consumption-graph",
|
||||
"energy-water-graph": "energy/#water-consumption-graph",
|
||||
"energy-distribution": "energy/#energy-distribution",
|
||||
"energy-sources-table": "energy/#energy-sources-table",
|
||||
"energy-grid-neutrality-gauge": "energy/#grid-neutrality-gauge",
|
||||
"energy-solar-consumed-gauge": "energy/#solar-consumed-gauge",
|
||||
"energy-carbon-consumed-gauge": "energy/#carbon-consumed-gauge",
|
||||
"energy-self-sufficiency-gauge": "energy/#self-sufficiency-gauge",
|
||||
"energy-devices-graph": "energy/#devices-energy-graph",
|
||||
"energy-devices-detail-graph": "energy/#detail-devices-energy-graph",
|
||||
"energy-sankey": "energy/#sankey-energy-graph",
|
||||
};
|
||||
|
||||
export const getCardDocumentationURL = (
|
||||
hass: HomeAssistant,
|
||||
type: string
|
||||
@ -15,7 +32,7 @@ export const getCardDocumentationURL = (
|
||||
return getCustomCardEntry(stripCustomPrefix(type))?.documentationURL;
|
||||
}
|
||||
|
||||
return `${documentationUrl(hass, "/dashboards/")}${type}`;
|
||||
return `${documentationUrl(hass, "/dashboards/")}${NON_STANDARD_URLS[type] || type}`;
|
||||
};
|
||||
|
||||
export const getBadgeDocumentationURL = (
|
||||
|
Loading…
x
Reference in New Issue
Block a user