mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +00:00
Use startsWith for m shortcut for partial match (#12464)
This commit is contained in:
parent
ebc807a6a4
commit
307cd5ad8c
@ -41,15 +41,15 @@ export const getMyRedirects = (hasSupervisor: boolean): Redirects => ({
|
|||||||
component: "cloud",
|
component: "cloud",
|
||||||
redirect: "/config/cloud",
|
redirect: "/config/cloud",
|
||||||
},
|
},
|
||||||
integrations: {
|
|
||||||
redirect: "/config/integrations",
|
|
||||||
},
|
|
||||||
config_flow_start: {
|
config_flow_start: {
|
||||||
redirect: "/config/integrations/add",
|
redirect: "/config/integrations/add",
|
||||||
params: {
|
params: {
|
||||||
domain: "string",
|
domain: "string",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
integrations: {
|
||||||
|
redirect: "/config/integrations",
|
||||||
|
},
|
||||||
config_mqtt: {
|
config_mqtt: {
|
||||||
component: "mqtt",
|
component: "mqtt",
|
||||||
redirect: "/config/mqtt",
|
redirect: "/config/mqtt",
|
||||||
@ -79,10 +79,6 @@ export const getMyRedirects = (hasSupervisor: boolean): Redirects => ({
|
|||||||
areas: {
|
areas: {
|
||||||
redirect: "/config/areas/dashboard",
|
redirect: "/config/areas/dashboard",
|
||||||
},
|
},
|
||||||
blueprints: {
|
|
||||||
component: "blueprint",
|
|
||||||
redirect: "/config/blueprint/dashboard",
|
|
||||||
},
|
|
||||||
blueprint_import: {
|
blueprint_import: {
|
||||||
component: "blueprint",
|
component: "blueprint",
|
||||||
redirect: "/config/blueprint/dashboard/import",
|
redirect: "/config/blueprint/dashboard/import",
|
||||||
@ -90,6 +86,10 @@ export const getMyRedirects = (hasSupervisor: boolean): Redirects => ({
|
|||||||
blueprint_url: "url",
|
blueprint_url: "url",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
blueprints: {
|
||||||
|
component: "blueprint",
|
||||||
|
redirect: "/config/blueprint/dashboard",
|
||||||
|
},
|
||||||
automations: {
|
automations: {
|
||||||
component: "automation",
|
component: "automation",
|
||||||
redirect: "/config/automation/dashboard",
|
redirect: "/config/automation/dashboard",
|
||||||
|
@ -73,7 +73,7 @@ export default <T extends Constructor<HassElement>>(superClass: T) =>
|
|||||||
for (const [slug, redirect] of Object.entries(
|
for (const [slug, redirect] of Object.entries(
|
||||||
myPanel.getMyRedirects(isComponentLoaded(this.hass, "hassio"))
|
myPanel.getMyRedirects(isComponentLoaded(this.hass, "hassio"))
|
||||||
)) {
|
)) {
|
||||||
if (redirect.redirect === targetPath) {
|
if (targetPath.startsWith(redirect.redirect)) {
|
||||||
window.open(
|
window.open(
|
||||||
`https://my.home-assistant.io/create-link/?redirect=${slug}`,
|
`https://my.home-assistant.io/create-link/?redirect=${slug}`,
|
||||||
"_blank"
|
"_blank"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user