mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 04:06:35 +00:00
Fix hass.io icon order (#3462)
This commit is contained in:
parent
e2dfac48d0
commit
f10fab7e22
@ -36,21 +36,21 @@ const SHOW_AFTER_SPACER = ["config", "developer-tools", "hassio"];
|
|||||||
|
|
||||||
const SUPPORT_SCROLL_IF_NEEDED = "scrollIntoViewIfNeeded" in document.body;
|
const SUPPORT_SCROLL_IF_NEEDED = "scrollIntoViewIfNeeded" in document.body;
|
||||||
|
|
||||||
const SORT_VALUE = {
|
const SORT_VALUE_URL_PATHS = {
|
||||||
map: 1,
|
map: 1,
|
||||||
logbook: 2,
|
logbook: 2,
|
||||||
history: 3,
|
history: 3,
|
||||||
"developer-tools": 9,
|
"developer-tools": 9,
|
||||||
hassio: 10,
|
hassio: 10,
|
||||||
configuration: 11,
|
config: 11,
|
||||||
};
|
};
|
||||||
|
|
||||||
const panelSorter = (a, b) => {
|
const panelSorter = (a, b) => {
|
||||||
const aBuiltIn = a.component_name in SORT_VALUE;
|
const aBuiltIn = a.url_path in SORT_VALUE_URL_PATHS;
|
||||||
const bBuiltIn = b.component_name in SORT_VALUE;
|
const bBuiltIn = b.url_path in SORT_VALUE_URL_PATHS;
|
||||||
|
|
||||||
if (aBuiltIn && bBuiltIn) {
|
if (aBuiltIn && bBuiltIn) {
|
||||||
return SORT_VALUE[a.component_name] - SORT_VALUE[b.component_name];
|
return SORT_VALUE_URL_PATHS[a.url_path] - SORT_VALUE_URL_PATHS[b.url_path];
|
||||||
}
|
}
|
||||||
if (aBuiltIn) {
|
if (aBuiltIn) {
|
||||||
return -1;
|
return -1;
|
||||||
@ -81,7 +81,7 @@ const computePanels = (hass: HomeAssistant): [PanelInfo[], PanelInfo[]] => {
|
|||||||
if (!panel.title) {
|
if (!panel.title) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
(SHOW_AFTER_SPACER.includes(panel.component_name)
|
(SHOW_AFTER_SPACER.includes(panel.url_path)
|
||||||
? afterSpacer
|
? afterSpacer
|
||||||
: beforeSpacer
|
: beforeSpacer
|
||||||
).push(panel);
|
).push(panel);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user