Reorder my links (#25319)

This commit is contained in:
Paulus Schoutsen 2025-05-05 12:54:33 -04:00 committed by GitHub
parent 9155c85509
commit fb3a59272d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,6 +16,11 @@ import "../../layouts/hass-error-screen";
import type { HomeAssistant, Route } from "../../types"; import type { HomeAssistant, Route } from "../../types";
import { documentationUrl } from "../../util/documentation-url"; import { documentationUrl } from "../../util/documentation-url";
// When a user presses "m", the user is redirected to the first redirect
// for which holds true currentPath.startsWith(redirect.redirect)
// That's why redirects should be sorted with more specific ones first
// Or else pressing "M" will link to the higher level page.
export const getMyRedirects = (): Redirects => ({ export const getMyRedirects = (): Redirects => ({
application_credentials: { application_credentials: {
redirect: "/config/application_credentials", redirect: "/config/application_credentials",
@ -73,15 +78,15 @@ export const getMyRedirects = (): Redirects => ({
brand: "string", brand: "string",
}, },
}, },
integrations: {
redirect: "/config/integrations",
},
integration: { integration: {
redirect: "/config/integrations/integration", redirect: "/config/integrations/integration",
params: { params: {
domain: "string", domain: "string",
}, },
}, },
integrations: {
redirect: "/config/integrations",
},
config_mqtt: { config_mqtt: {
component: "mqtt", component: "mqtt",
redirect: "/config/mqtt", redirect: "/config/mqtt",
@ -106,10 +111,6 @@ export const getMyRedirects = (): Redirects => ({
component: "matter", component: "matter",
redirect: "/config/matter/add", redirect: "/config/matter/add",
}, },
config_bluetooth: {
component: "bluetooth",
redirect: "/config/bluetooth",
},
bluetooth_advertisement_monitor: { bluetooth_advertisement_monitor: {
component: "bluetooth", component: "bluetooth",
redirect: "/config/bluetooth/advertisement-monitor", redirect: "/config/bluetooth/advertisement-monitor",
@ -118,6 +119,10 @@ export const getMyRedirects = (): Redirects => ({
component: "bluetooth", component: "bluetooth",
redirect: "/config/bluetooth/connection-monitor", redirect: "/config/bluetooth/connection-monitor",
}, },
config_bluetooth: {
component: "bluetooth",
redirect: "/config/bluetooth",
},
config_dhcp: { config_dhcp: {
component: "dhcp", component: "dhcp",
redirect: "/config/dhcp", redirect: "/config/dhcp",
@ -252,12 +257,12 @@ export const getMyRedirects = (): Redirects => ({
// customize was removed in 2021.12, fallback to dashboard // customize was removed in 2021.12, fallback to dashboard
redirect: "/config/dashboard", redirect: "/config/dashboard",
}, },
profile: {
redirect: "/profile",
},
profile_security: { profile_security: {
redirect: "/profile/security", redirect: "/profile/security",
}, },
profile: {
redirect: "/profile",
},
logbook: { logbook: {
component: "logbook", component: "logbook",
redirect: "/logbook", redirect: "/logbook",
@ -270,10 +275,6 @@ export const getMyRedirects = (): Redirects => ({
component: "media_source", component: "media_source",
redirect: "/media-browser", redirect: "/media-browser",
}, },
backup: {
component: "backup",
redirect: "/config/backup",
},
backup_list: { backup_list: {
component: "backup", component: "backup",
redirect: "/config/backup/backups", redirect: "/config/backup/backups",
@ -282,6 +283,10 @@ export const getMyRedirects = (): Redirects => ({
component: "backup", component: "backup",
redirect: "/config/backup/settings", redirect: "/config/backup/settings",
}, },
backup: {
component: "backup",
redirect: "/config/backup",
},
supervisor_snapshots: { supervisor_snapshots: {
component: "backup", component: "backup",
redirect: "/config/backup", redirect: "/config/backup",