From 19094d47aacad61a6fe5982147508bf74b2e17ea Mon Sep 17 00:00:00 2001 From: Proddy Date: Fri, 24 Nov 2023 07:41:23 +0100 Subject: [PATCH 1/6] 3.6.5-dev.0 --- CHANGELOG.md | 3 ++- CHANGELOG_LATEST.md | 4 +--- Makefile | 2 +- interface/package.json | 2 +- mock-api/server.js | 4 ++-- platformio.ini | 2 +- sonar-project.properties | 2 +- src/system.cpp | 2 +- src/version.h | 2 +- 9 files changed, 11 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fe60ca33..7e1da56db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [3.6.3] November 18 2023 +## [3.6.4] November 24 2023 ## **IMPORTANT! BREAKING CHANGES** @@ -34,6 +34,7 @@ Writeable Text entities have moved from type `sensor` to `text` in Home Assistan - fixed helper text in Web Device Entity dialog box for numerical ranges - MQTT base with paths not working in HA [#1393](https://github.com/emsesp/EMS-ESP32/issues/1393) - set/read thermostat mode for RC100-RC300, [#1440](https://github.com/emsesp/EMS-ESP32/issues/1440) [#1442](https://github.com/emsesp/EMS-ESP32/issues/1442) +- some setting commands for ems-boiler have used wrong ems+ telegram in 3.6.3 ## Changed diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index c325fe9d7..c48e0672e 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -1,6 +1,6 @@ # Changelog -## [3.6.4] +## [3.6.5] ## **IMPORTANT! BREAKING CHANGES** @@ -8,6 +8,4 @@ ## Fixed -- some setting commands for ems-boiler have used wrong ems+ telegram in 3.6.3 - ## Changed diff --git a/Makefile b/Makefile index 64e4b61b5..1beb818c8 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ DEFINES += -DARDUINOJSON_ENABLE_STD_STRING=1 -DARDUINOJSON_ENABLE_PROGMEM=1 -DAR DEFINES += -DEMSESP_DEBUG -DEMSESP_STANDALONE -DEMSESP_TEST -D__linux__ -DEMC_RX_BUFFER_SIZE=1500 DEFINES += $(ARGS) -DEFAULTS = -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.6.3-dev\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\" +DEFAULTS = -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.6.4-dev\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\" #---------------------------------------------------------------------- # Sources & Files diff --git a/interface/package.json b/interface/package.json index f8c6bd82a..5a8fd4fb1 100644 --- a/interface/package.json +++ b/interface/package.json @@ -1,6 +1,6 @@ { "name": "EMS-ESP", - "version": "3.6.3", + "version": "3.6.5", "description": "build EMS-ESP WebUI", "homepage": "https://emsesp.github.io/docs", "author": "proddy", diff --git a/mock-api/server.js b/mock-api/server.js index 2dc90b50d..88e478349 100644 --- a/mock-api/server.js +++ b/mock-api/server.js @@ -324,7 +324,7 @@ security_settings = { ] }; const features = { - version: 'v3.6.3-demo', + version: 'v3.6-demo', // platform: 'ESP32' platform: 'ESP32-S3' }; @@ -355,7 +355,7 @@ const EMSESP_WRITE_ENTITIES_ENDPOINT = REST_ENDPOINT_ROOT + 'entities'; const emsesp_info = { System: { - version: '3.6.3', + version: '3.6.5', uptime: '001+06:40:34.018', 'uptime (seconds)': 110434, freemem: 131, diff --git a/platformio.ini b/platformio.ini index 2fe2a578d..69521fe02 100644 --- a/platformio.ini +++ b/platformio.ini @@ -172,7 +172,7 @@ platform = native build_flags = -DARDUINOJSON_ENABLE_STD_STRING=1 -DARDUINOJSON_ENABLE_PROGMEM=1 -DARDUINOJSON_ENABLE_ARDUINO_STRING -DARDUINOJSON_USE_DOUBLE=0 -DEMSESP_DEBUG -DEMSESP_STANDALONE -DEMSESP_TEST -D__linux__ - -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.6.3-dev\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\" + -DEMSESP_DEFAULT_LOCALE=\"en\" -DEMSESP_DEFAULT_TX_MODE=8 -DEMSESP_DEFAULT_VERSION=\"3.6.4-dev\" -DEMSESP_DEFAULT_BOARD_PROFILE=\"S32\" -lpthread -std=gnu++11 -Og -ggdb build_src_flags = diff --git a/sonar-project.properties b/sonar-project.properties index 877b44ec4..fdd85ff20 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,7 +1,7 @@ sonar.organization=emsesp sonar.projectKey=emsesp_EMS-ESP32 sonar.projectName=EMS-ESP32 -sonar.projectVersion=3.6.3 +sonar.projectVersion=3.6.5 sonar.sources=./src sonar.cfamily.build-wrapper-output=bw-output sonar.sourceEncoding=UTF-8 diff --git a/src/system.cpp b/src/system.cpp index f1d5b013f..6677c5ff6 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -1096,7 +1096,7 @@ bool System::check_upgrade(bool factory_settings) { missing_version = (settingsVersion.empty() || (settingsVersion.length() < 5)); if (missing_version) { LOG_WARNING("No version information found (%s)", settingsVersion.c_str()); - settingsVersion = "3.6.3"; // this was the last stable version + settingsVersion = "3.6.4"; // this was the last stable version } } diff --git a/src/version.h b/src/version.h index d5365b3ed..fa47481b3 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.6.4-dev.2" +#define EMSESP_APP_VERSION "3.6.5-dev.0" From 095255b9b742e3f996c6da95dc1155efe8bef4a4 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Fri, 24 Nov 2023 10:15:34 +0100 Subject: [PATCH 2/6] revert to react-router-dom 6.19.0 to fix tab-routing-issue --- interface/package.json | 4 ++-- interface/yarn.lock | 42 +++++++++++++++++++++--------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/interface/package.json b/interface/package.json index 5a8fd4fb1..090becfe8 100644 --- a/interface/package.json +++ b/interface/package.json @@ -29,7 +29,7 @@ "@table-library/react-table-library": "4.1.7", "@types/imagemin": "^8.0.5", "@types/lodash-es": "^4.17.12", - "@types/node": "^20.9.5", + "@types/node": "^20.10.0", "@types/react": "^18.2.38", "@types/react-dom": "^18.2.17", "@types/react-router-dom": "^5.3.3", @@ -43,7 +43,7 @@ "react-dom": "latest", "react-dropzone": "^14.2.3", "react-icons": "^4.12.0", - "react-router-dom": "^6.20.0", + "react-router-dom": "^6.19.0", "react-toastify": "^9.1.3", "sockette": "^2.0.6", "typesafe-i18n": "^5.26.2", diff --git a/interface/yarn.lock b/interface/yarn.lock index 440fe5985..1a109c51b 100644 --- a/interface/yarn.lock +++ b/interface/yarn.lock @@ -1187,10 +1187,10 @@ __metadata: languageName: node linkType: hard -"@remix-run/router@npm:1.13.0": - version: 1.13.0 - resolution: "@remix-run/router@npm:1.13.0" - checksum: bb173a012d2036c5ee69babfe30c73975b970c2e5a0edaba138c302ae80d255e238e462e77365ab4efe819b6397e1a7f3a416d6200d17f9655f0ca1c51c4f45e +"@remix-run/router@npm:1.12.0": + version: 1.12.0 + resolution: "@remix-run/router@npm:1.12.0" + checksum: f984e42cfe855991e1d3067f686f857614f12e8c1c45168a2d98e3fc3a427e232fd0b6cf145173b7cd132faf070702b532c34230a825d933908c54c85077fc69 languageName: node linkType: hard @@ -1478,12 +1478,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^20.9.5": - version: 20.9.5 - resolution: "@types/node@npm:20.9.5" +"@types/node@npm:^20.10.0": + version: 20.10.0 + resolution: "@types/node@npm:20.10.0" dependencies: undici-types: "npm:~5.26.4" - checksum: f7d02ef84a449f079bc77d7494dc96a1d45006b3a7583a41430d8b62ad7dd914bcce8d1ed60584b8725289e609c20288c840aadb21cc52d5b656fa7731c1a528 + checksum: c7d5ddbdbf3491e2363135c9611eb6bfae90eda2957279237fa232bcb29cd0df1cc3ee149d6de9915b754262a531ee2d57d33c9ecd58d763e8ad4856113822f3 languageName: node linkType: hard @@ -1745,7 +1745,7 @@ __metadata: "@table-library/react-table-library": "npm:4.1.7" "@types/imagemin": "npm:^8.0.5" "@types/lodash-es": "npm:^4.17.12" - "@types/node": "npm:^20.9.5" + "@types/node": "npm:^20.10.0" "@types/react": "npm:^18.2.38" "@types/react-dom": "npm:^18.2.17" "@types/react-router-dom": "npm:^5.3.3" @@ -1775,7 +1775,7 @@ __metadata: react-dom: "npm:latest" react-dropzone: "npm:^14.2.3" react-icons: "npm:^4.12.0" - react-router-dom: "npm:^6.20.0" + react-router-dom: "npm:^6.19.0" react-toastify: "npm:^9.1.3" rollup-plugin-visualizer: "npm:^5.9.2" sockette: "npm:^2.0.6" @@ -7020,27 +7020,27 @@ __metadata: languageName: node linkType: hard -"react-router-dom@npm:^6.20.0": - version: 6.20.0 - resolution: "react-router-dom@npm:6.20.0" +"react-router-dom@npm:^6.19.0": + version: 6.19.0 + resolution: "react-router-dom@npm:6.19.0" dependencies: - "@remix-run/router": "npm:1.13.0" - react-router: "npm:6.20.0" + "@remix-run/router": "npm:1.12.0" + react-router: "npm:6.19.0" peerDependencies: react: ">=16.8" react-dom: ">=16.8" - checksum: 4b6741c545cedf5a5c4f996deb953679dcc985425e0664e27b97fdb9ab1387cbe1a6a12bfc7f7c38ec40b15759b4bf6396930ec26540a4a81ae16d154fd35049 + checksum: 38312efc11d3ef688062301479a8257a1495a81cd8dd7039c1f81aba6774963df7d21aaee2ba1a3c152857b70f4fb9966a3ccff47aca12212e854dcd6fc4deab languageName: node linkType: hard -"react-router@npm:6.20.0": - version: 6.20.0 - resolution: "react-router@npm:6.20.0" +"react-router@npm:6.19.0": + version: 6.19.0 + resolution: "react-router@npm:6.19.0" dependencies: - "@remix-run/router": "npm:1.13.0" + "@remix-run/router": "npm:1.12.0" peerDependencies: react: ">=16.8" - checksum: 2cdac5ad8b7a7bc230173b26768bcf3f6a9abc0a19983fa7b76b9ffdbeb44bfbd88fcc2033e9062defafef144db207859eb3162a9c9742d70cfce4e7166ff1e5 + checksum: 5454f4a4d65401430ded8f1033cebe4ccca771c3c827e8329c77dcfd73618ca9a32488fb58722bf6a07afef7d8e7ef22a710aae0f3337e5c20962bf6473d81a3 languageName: node linkType: hard From 8898ec94190e49a89c5b78c9ff001fbb150d7c54 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Sun, 26 Nov 2023 08:59:32 +0100 Subject: [PATCH 3/6] revert to react-router-dom 6.18.0 to bring blue tab line back --- interface/package.json | 2 +- .../framework/security/ManageUsersForm.tsx | 2 +- .../src/project/SettingsCustomization.tsx | 2 +- interface/src/project/SettingsEntities.tsx | 2 +- interface/src/project/SettingsScheduler.tsx | 2 +- interface/src/utils/useRest.ts | 2 +- interface/yarn.lock | 32 +++++++++---------- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/interface/package.json b/interface/package.json index 090becfe8..45a97dd8a 100644 --- a/interface/package.json +++ b/interface/package.json @@ -43,7 +43,7 @@ "react-dom": "latest", "react-dropzone": "^14.2.3", "react-icons": "^4.12.0", - "react-router-dom": "^6.19.0", + "react-router-dom": "6.18.0", "react-toastify": "^9.1.3", "sockette": "^2.0.6", "typesafe-i18n": "^5.26.2", diff --git a/interface/src/framework/security/ManageUsersForm.tsx b/interface/src/framework/security/ManageUsersForm.tsx index f60c8e0c0..a8d8c9afb 100644 --- a/interface/src/framework/security/ManageUsersForm.tsx +++ b/interface/src/framework/security/ManageUsersForm.tsx @@ -12,7 +12,7 @@ import { Table, Header, HeaderRow, HeaderCell, Body, Row, Cell } from '@table-li import { useTheme } from '@table-library/react-table-library/theme'; import { useContext, useState } from 'react'; -import { useBlocker } from 'react-router-dom'; +import { unstable_useBlocker as useBlocker } from 'react-router-dom'; import GenerateToken from './GenerateToken'; import UserForm from './UserForm'; import type { FC } from 'react'; diff --git a/interface/src/project/SettingsCustomization.tsx b/interface/src/project/SettingsCustomization.tsx index 463ec3518..183d32778 100644 --- a/interface/src/project/SettingsCustomization.tsx +++ b/interface/src/project/SettingsCustomization.tsx @@ -23,7 +23,7 @@ import { Table, Header, HeaderRow, HeaderCell, Body, Row, Cell } from '@table-li import { useTheme } from '@table-library/react-table-library/theme'; import { useRequest } from 'alova'; import { useState, useEffect, useCallback } from 'react'; -import { useBlocker, useLocation } from 'react-router-dom'; +import { unstable_useBlocker as useBlocker, useLocation } from 'react-router-dom'; import { toast } from 'react-toastify'; import EntityMaskToggle from './EntityMaskToggle'; diff --git a/interface/src/project/SettingsEntities.tsx b/interface/src/project/SettingsEntities.tsx index 708d86513..1128dd645 100644 --- a/interface/src/project/SettingsEntities.tsx +++ b/interface/src/project/SettingsEntities.tsx @@ -7,7 +7,7 @@ import { useTheme } from '@table-library/react-table-library/theme'; // eslint-disable-next-line import/named import { updateState, useRequest } from 'alova'; import { useState, useCallback } from 'react'; -import { useBlocker } from 'react-router-dom'; +import { unstable_useBlocker as useBlocker } from 'react-router-dom'; import { toast } from 'react-toastify'; diff --git a/interface/src/project/SettingsScheduler.tsx b/interface/src/project/SettingsScheduler.tsx index f8d2d8f72..7ba89969f 100644 --- a/interface/src/project/SettingsScheduler.tsx +++ b/interface/src/project/SettingsScheduler.tsx @@ -9,7 +9,7 @@ import { useTheme } from '@table-library/react-table-library/theme'; // eslint-disable-next-line import/named import { updateState, useRequest } from 'alova'; import { useState, useEffect, useCallback } from 'react'; -import { useBlocker } from 'react-router-dom'; +import { unstable_useBlocker as useBlocker } from 'react-router-dom'; import { toast } from 'react-toastify'; import SettingsSchedulerDialog from './SettingsSchedulerDialog'; import * as EMSESP from './api'; diff --git a/interface/src/utils/useRest.ts b/interface/src/utils/useRest.ts index bce61546e..921513bba 100644 --- a/interface/src/utils/useRest.ts +++ b/interface/src/utils/useRest.ts @@ -1,6 +1,6 @@ import { useRequest, type Method } from 'alova'; import { useState } from 'react'; -import { useBlocker } from 'react-router-dom'; +import { unstable_useBlocker as useBlocker } from 'react-router-dom'; import { toast } from 'react-toastify'; import { useI18nContext } from 'i18n/i18n-react'; diff --git a/interface/yarn.lock b/interface/yarn.lock index 1a109c51b..d273a7f3b 100644 --- a/interface/yarn.lock +++ b/interface/yarn.lock @@ -1187,10 +1187,10 @@ __metadata: languageName: node linkType: hard -"@remix-run/router@npm:1.12.0": - version: 1.12.0 - resolution: "@remix-run/router@npm:1.12.0" - checksum: f984e42cfe855991e1d3067f686f857614f12e8c1c45168a2d98e3fc3a427e232fd0b6cf145173b7cd132faf070702b532c34230a825d933908c54c85077fc69 +"@remix-run/router@npm:1.11.0": + version: 1.11.0 + resolution: "@remix-run/router@npm:1.11.0" + checksum: 629ec578b9dfd3c5cb5de64a0798dd7846ec5ba0351aa66f42b1c65efb43da8f30366be59b825303648965b0df55b638c110949b24ef94fd62e98117fdfb0c0f languageName: node linkType: hard @@ -1775,7 +1775,7 @@ __metadata: react-dom: "npm:latest" react-dropzone: "npm:^14.2.3" react-icons: "npm:^4.12.0" - react-router-dom: "npm:^6.19.0" + react-router-dom: "npm:6.18.0" react-toastify: "npm:^9.1.3" rollup-plugin-visualizer: "npm:^5.9.2" sockette: "npm:^2.0.6" @@ -7020,27 +7020,27 @@ __metadata: languageName: node linkType: hard -"react-router-dom@npm:^6.19.0": - version: 6.19.0 - resolution: "react-router-dom@npm:6.19.0" +"react-router-dom@npm:6.18.0": + version: 6.18.0 + resolution: "react-router-dom@npm:6.18.0" dependencies: - "@remix-run/router": "npm:1.12.0" - react-router: "npm:6.19.0" + "@remix-run/router": "npm:1.11.0" + react-router: "npm:6.18.0" peerDependencies: react: ">=16.8" react-dom: ">=16.8" - checksum: 38312efc11d3ef688062301479a8257a1495a81cd8dd7039c1f81aba6774963df7d21aaee2ba1a3c152857b70f4fb9966a3ccff47aca12212e854dcd6fc4deab + checksum: b0e72603d73172b6c6662afe2faed326753d5bbd9905aa560e3dade7996fc13d19e34e3ed668d2849efd685e2db2f711129c84b1439870e92c9cc91ddc343cf5 languageName: node linkType: hard -"react-router@npm:6.19.0": - version: 6.19.0 - resolution: "react-router@npm:6.19.0" +"react-router@npm:6.18.0": + version: 6.18.0 + resolution: "react-router@npm:6.18.0" dependencies: - "@remix-run/router": "npm:1.12.0" + "@remix-run/router": "npm:1.11.0" peerDependencies: react: ">=16.8" - checksum: 5454f4a4d65401430ded8f1033cebe4ccca771c3c827e8329c77dcfd73618ca9a32488fb58722bf6a07afef7d8e7ef22a710aae0f3337e5c20962bf6473d81a3 + checksum: a00c8f347b7ffee575f4a7731782e688e3fca458ca5bd970fb41cef66a6851853caa24464155ab438d5879f367b1223a539642a405a865913ffe7e63e53b1245 languageName: node linkType: hard From 1cbfc91912a760fa473b63ffb4069983df27b1d8 Mon Sep 17 00:00:00 2001 From: Proddy Date: Sun, 26 Nov 2023 15:56:30 +0100 Subject: [PATCH 4/6] remove tab from help page --- interface/src/project/Help.tsx | 89 ++++++++++++++++++----- interface/src/project/HelpInformation.tsx | 85 ---------------------- 2 files changed, 72 insertions(+), 102 deletions(-) delete mode 100644 interface/src/project/HelpInformation.tsx diff --git a/interface/src/project/Help.tsx b/interface/src/project/Help.tsx index d5b355823..49f6cc75a 100644 --- a/interface/src/project/Help.tsx +++ b/interface/src/project/Help.tsx @@ -1,28 +1,83 @@ -import { Tab } from '@mui/material'; -import { Navigate, Route, Routes } from 'react-router-dom'; -import HelpInformation from './HelpInformation'; +import CommentIcon from '@mui/icons-material/CommentTwoTone'; +import EastIcon from '@mui/icons-material/East'; +import GitHubIcon from '@mui/icons-material/GitHub'; +import MenuBookIcon from '@mui/icons-material/MenuBookTwoTone'; +import { Box, List, ListItem, ListItemAvatar, ListItemText, Link, Typography } from '@mui/material'; import type { FC } from 'react'; - -import { RouterTabs, useRouterTab, useLayoutTitle } from 'components'; - +import { SectionContent, useLayoutTitle } from 'components'; import { useI18nContext } from 'i18n/i18n-react'; const Help: FC = () => { const { LL } = useI18nContext(); - const { routerTab } = useRouterTab(); - useLayoutTitle(LL.HELP_OF('')); + const uploadURL = window.location.origin + '/system/upload'; + return ( - <> - - - - - } /> - } /> - - + + + + + + + + {LL.HELP_INFORMATION_1()}  + +   + + {LL.CLICK_HERE()} + + + + + + + + + + {LL.HELP_INFORMATION_2()}  + +   + + {LL.CLICK_HERE()} + + + + + + + + + + {LL.HELP_INFORMATION_3()}  + + + {LL.CLICK_HERE()} + +
+ ({LL.HELP_INFORMATION_4()}  + + {LL.UPLOAD()} + + ) +
+
+
+ + + + {LL.HELP_INFORMATION_5()} + + + + {'github.com/emsesp/EMS-ESP32'} + + + + @proddy @MichaelDvP + + +
); }; diff --git a/interface/src/project/HelpInformation.tsx b/interface/src/project/HelpInformation.tsx deleted file mode 100644 index 9aae937f9..000000000 --- a/interface/src/project/HelpInformation.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import CommentIcon from '@mui/icons-material/CommentTwoTone'; -import EastIcon from '@mui/icons-material/East'; -import GitHubIcon from '@mui/icons-material/GitHub'; -import MenuBookIcon from '@mui/icons-material/MenuBookTwoTone'; -import { Typography, Box, List, ListItem, ListItemText, Link, ListItemAvatar } from '@mui/material'; -import type { FC } from 'react'; - -import { SectionContent } from 'components'; - -import { useI18nContext } from 'i18n/i18n-react'; - -const HelpInformation: FC = () => { - const { LL } = useI18nContext(); - - const uploadURL = window.location.origin + '/system/upload'; - - return ( - - - - - - - - {LL.HELP_INFORMATION_1()}  - -   - - {LL.CLICK_HERE()} - - - - - - - - - - {LL.HELP_INFORMATION_2()}  - -   - - {LL.CLICK_HERE()} - - - - - - - - - - {LL.HELP_INFORMATION_3()}  - - - {LL.CLICK_HERE()} - -
- ({LL.HELP_INFORMATION_4()}  - - {LL.UPLOAD()} - - ) -
-
-
- - - - {LL.HELP_INFORMATION_5()} - - - - {'github.com/emsesp/EMS-ESP32'} - - - - @proddy @MichaelDvP - - -
- ); -}; - -export default HelpInformation; From 76901d97d2e92722c3b696e2961a7822cd2e370d Mon Sep 17 00:00:00 2001 From: Proddy Date: Sun, 26 Nov 2023 15:56:46 +0100 Subject: [PATCH 5/6] fix router --- interface/package.json | 4 +- .../src/components/routing/useRouterTab.ts | 7 ++- interface/src/framework/ap/AccessPoint.tsx | 10 +++-- interface/src/framework/mqtt/Mqtt.tsx | 6 +-- .../framework/network/NetworkConnection.tsx | 12 +++-- interface/src/framework/ntp/NetworkTime.tsx | 6 +-- .../framework/security/ManageUsersForm.tsx | 2 +- interface/src/framework/security/Security.tsx | 6 +-- interface/src/framework/system/System.tsx | 10 ++--- interface/src/project/Dashboard.tsx | 8 ++-- interface/src/project/Settings.tsx | 10 ++--- .../src/project/SettingsCustomization.tsx | 2 +- interface/src/project/SettingsEntities.tsx | 2 +- interface/src/project/SettingsScheduler.tsx | 2 +- interface/src/utils/useRest.ts | 2 +- interface/yarn.lock | 44 +++++++++---------- 16 files changed, 70 insertions(+), 63 deletions(-) diff --git a/interface/package.json b/interface/package.json index 45a97dd8a..4a2642391 100644 --- a/interface/package.json +++ b/interface/package.json @@ -43,7 +43,7 @@ "react-dom": "latest", "react-dropzone": "^14.2.3", "react-icons": "^4.12.0", - "react-router-dom": "6.18.0", + "react-router-dom": "6.20.0", "react-toastify": "^9.1.3", "sockette": "^2.0.6", "typesafe-i18n": "^5.26.2", @@ -68,7 +68,7 @@ "eslint-plugin-react-hooks": "^4.6.0", "preact": "^10.19.2", "prettier": "^3.1.0", - "rollup-plugin-visualizer": "^5.9.2", + "rollup-plugin-visualizer": "^5.9.3", "terser": "^5.24.0", "vite": "^5.0.2", "vite-plugin-imagemin": "^0.6.1", diff --git a/interface/src/components/routing/useRouterTab.ts b/interface/src/components/routing/useRouterTab.ts index 5dff86fd8..52cfe55cb 100644 --- a/interface/src/components/routing/useRouterTab.ts +++ b/interface/src/components/routing/useRouterTab.ts @@ -1,9 +1,8 @@ -import { useMatch, useResolvedPath } from 'react-router-dom'; +import { useLocation } from 'react-router-dom'; export const useRouterTab = () => { - const routerTabPath = useResolvedPath(':tab'); - const routerTabPathMatch = useMatch(routerTabPath.pathname); + const loc = useLocation().pathname; + const routerTab = loc.substring(0, loc.lastIndexOf('/')) ? loc : false; - const routerTab = routerTabPathMatch?.params?.tab || false; return { routerTab } as const; }; diff --git a/interface/src/framework/ap/AccessPoint.tsx b/interface/src/framework/ap/AccessPoint.tsx index 87fecefb3..5d74cd7f6 100644 --- a/interface/src/framework/ap/AccessPoint.tsx +++ b/interface/src/framework/ap/AccessPoint.tsx @@ -22,8 +22,12 @@ const AccessPoint: FC = () => { return ( <> - - + + } /> @@ -36,7 +40,7 @@ const AccessPoint: FC = () => { } /> - } /> + } /> ); diff --git a/interface/src/framework/mqtt/Mqtt.tsx b/interface/src/framework/mqtt/Mqtt.tsx index 7520b0eec..f65ea4181 100644 --- a/interface/src/framework/mqtt/Mqtt.tsx +++ b/interface/src/framework/mqtt/Mqtt.tsx @@ -21,8 +21,8 @@ const Mqtt: FC = () => { return ( <> - - + + } /> @@ -34,7 +34,7 @@ const Mqtt: FC = () => { } /> - } /> + } /> ); diff --git a/interface/src/framework/network/NetworkConnection.tsx b/interface/src/framework/network/NetworkConnection.tsx index 18d1842ef..cd9113398 100644 --- a/interface/src/framework/network/NetworkConnection.tsx +++ b/interface/src/framework/network/NetworkConnection.tsx @@ -44,9 +44,13 @@ const NetworkConnection: FC = () => { }} > - - - + + + } /> @@ -66,7 +70,7 @@ const NetworkConnection: FC = () => { } /> - } /> + } /> ); diff --git a/interface/src/framework/ntp/NetworkTime.tsx b/interface/src/framework/ntp/NetworkTime.tsx index d41d1fb8c..21a110001 100644 --- a/interface/src/framework/ntp/NetworkTime.tsx +++ b/interface/src/framework/ntp/NetworkTime.tsx @@ -20,8 +20,8 @@ const NetworkTime: FC = () => { return ( <> - - + + } /> @@ -33,7 +33,7 @@ const NetworkTime: FC = () => { } /> - } /> + } /> ); diff --git a/interface/src/framework/security/ManageUsersForm.tsx b/interface/src/framework/security/ManageUsersForm.tsx index a8d8c9afb..f60c8e0c0 100644 --- a/interface/src/framework/security/ManageUsersForm.tsx +++ b/interface/src/framework/security/ManageUsersForm.tsx @@ -12,7 +12,7 @@ import { Table, Header, HeaderRow, HeaderCell, Body, Row, Cell } from '@table-li import { useTheme } from '@table-library/react-table-library/theme'; import { useContext, useState } from 'react'; -import { unstable_useBlocker as useBlocker } from 'react-router-dom'; +import { useBlocker } from 'react-router-dom'; import GenerateToken from './GenerateToken'; import UserForm from './UserForm'; import type { FC } from 'react'; diff --git a/interface/src/framework/security/Security.tsx b/interface/src/framework/security/Security.tsx index d55a171e1..b6be5ddfd 100644 --- a/interface/src/framework/security/Security.tsx +++ b/interface/src/framework/security/Security.tsx @@ -17,13 +17,13 @@ const Security: FC = () => { return ( <> - - + + } /> } /> - } /> + } /> ); diff --git a/interface/src/framework/system/System.tsx b/interface/src/framework/system/System.tsx index 2caf4b7c6..8dc373cf2 100644 --- a/interface/src/framework/system/System.tsx +++ b/interface/src/framework/system/System.tsx @@ -23,10 +23,10 @@ const System: FC = () => { return ( <> - - - - + + + + } /> @@ -47,7 +47,7 @@ const System: FC = () => { } /> - } /> + } /> ); diff --git a/interface/src/project/Dashboard.tsx b/interface/src/project/Dashboard.tsx index bfbaa8923..ea1d441f8 100644 --- a/interface/src/project/Dashboard.tsx +++ b/interface/src/project/Dashboard.tsx @@ -20,15 +20,15 @@ const Dashboard: FC = () => { return ( <> - - - + + + } /> } /> } /> - } /> + } /> ); diff --git a/interface/src/project/Settings.tsx b/interface/src/project/Settings.tsx index 29edb1c13..5a0de5b82 100644 --- a/interface/src/project/Settings.tsx +++ b/interface/src/project/Settings.tsx @@ -18,17 +18,17 @@ const Settings: FC = () => { return ( <> - - - - + + + + } /> } /> } /> } /> - } /> + } /> ); diff --git a/interface/src/project/SettingsCustomization.tsx b/interface/src/project/SettingsCustomization.tsx index 183d32778..463ec3518 100644 --- a/interface/src/project/SettingsCustomization.tsx +++ b/interface/src/project/SettingsCustomization.tsx @@ -23,7 +23,7 @@ import { Table, Header, HeaderRow, HeaderCell, Body, Row, Cell } from '@table-li import { useTheme } from '@table-library/react-table-library/theme'; import { useRequest } from 'alova'; import { useState, useEffect, useCallback } from 'react'; -import { unstable_useBlocker as useBlocker, useLocation } from 'react-router-dom'; +import { useBlocker, useLocation } from 'react-router-dom'; import { toast } from 'react-toastify'; import EntityMaskToggle from './EntityMaskToggle'; diff --git a/interface/src/project/SettingsEntities.tsx b/interface/src/project/SettingsEntities.tsx index 1128dd645..708d86513 100644 --- a/interface/src/project/SettingsEntities.tsx +++ b/interface/src/project/SettingsEntities.tsx @@ -7,7 +7,7 @@ import { useTheme } from '@table-library/react-table-library/theme'; // eslint-disable-next-line import/named import { updateState, useRequest } from 'alova'; import { useState, useCallback } from 'react'; -import { unstable_useBlocker as useBlocker } from 'react-router-dom'; +import { useBlocker } from 'react-router-dom'; import { toast } from 'react-toastify'; diff --git a/interface/src/project/SettingsScheduler.tsx b/interface/src/project/SettingsScheduler.tsx index 7ba89969f..f8d2d8f72 100644 --- a/interface/src/project/SettingsScheduler.tsx +++ b/interface/src/project/SettingsScheduler.tsx @@ -9,7 +9,7 @@ import { useTheme } from '@table-library/react-table-library/theme'; // eslint-disable-next-line import/named import { updateState, useRequest } from 'alova'; import { useState, useEffect, useCallback } from 'react'; -import { unstable_useBlocker as useBlocker } from 'react-router-dom'; +import { useBlocker } from 'react-router-dom'; import { toast } from 'react-toastify'; import SettingsSchedulerDialog from './SettingsSchedulerDialog'; import * as EMSESP from './api'; diff --git a/interface/src/utils/useRest.ts b/interface/src/utils/useRest.ts index 921513bba..bce61546e 100644 --- a/interface/src/utils/useRest.ts +++ b/interface/src/utils/useRest.ts @@ -1,6 +1,6 @@ import { useRequest, type Method } from 'alova'; import { useState } from 'react'; -import { unstable_useBlocker as useBlocker } from 'react-router-dom'; +import { useBlocker } from 'react-router-dom'; import { toast } from 'react-toastify'; import { useI18nContext } from 'i18n/i18n-react'; diff --git a/interface/yarn.lock b/interface/yarn.lock index d273a7f3b..51e254188 100644 --- a/interface/yarn.lock +++ b/interface/yarn.lock @@ -1187,10 +1187,10 @@ __metadata: languageName: node linkType: hard -"@remix-run/router@npm:1.11.0": - version: 1.11.0 - resolution: "@remix-run/router@npm:1.11.0" - checksum: 629ec578b9dfd3c5cb5de64a0798dd7846ec5ba0351aa66f42b1c65efb43da8f30366be59b825303648965b0df55b638c110949b24ef94fd62e98117fdfb0c0f +"@remix-run/router@npm:1.13.0": + version: 1.13.0 + resolution: "@remix-run/router@npm:1.13.0" + checksum: bb173a012d2036c5ee69babfe30c73975b970c2e5a0edaba138c302ae80d255e238e462e77365ab4efe819b6397e1a7f3a416d6200d17f9655f0ca1c51c4f45e languageName: node linkType: hard @@ -1775,9 +1775,9 @@ __metadata: react-dom: "npm:latest" react-dropzone: "npm:^14.2.3" react-icons: "npm:^4.12.0" - react-router-dom: "npm:6.18.0" + react-router-dom: "npm:6.20.0" react-toastify: "npm:^9.1.3" - rollup-plugin-visualizer: "npm:^5.9.2" + rollup-plugin-visualizer: "npm:^5.9.3" sockette: "npm:^2.0.6" terser: "npm:^5.24.0" typesafe-i18n: "npm:^5.26.2" @@ -7020,27 +7020,27 @@ __metadata: languageName: node linkType: hard -"react-router-dom@npm:6.18.0": - version: 6.18.0 - resolution: "react-router-dom@npm:6.18.0" +"react-router-dom@npm:6.20.0": + version: 6.20.0 + resolution: "react-router-dom@npm:6.20.0" dependencies: - "@remix-run/router": "npm:1.11.0" - react-router: "npm:6.18.0" + "@remix-run/router": "npm:1.13.0" + react-router: "npm:6.20.0" peerDependencies: react: ">=16.8" react-dom: ">=16.8" - checksum: b0e72603d73172b6c6662afe2faed326753d5bbd9905aa560e3dade7996fc13d19e34e3ed668d2849efd685e2db2f711129c84b1439870e92c9cc91ddc343cf5 + checksum: 4b6741c545cedf5a5c4f996deb953679dcc985425e0664e27b97fdb9ab1387cbe1a6a12bfc7f7c38ec40b15759b4bf6396930ec26540a4a81ae16d154fd35049 languageName: node linkType: hard -"react-router@npm:6.18.0": - version: 6.18.0 - resolution: "react-router@npm:6.18.0" +"react-router@npm:6.20.0": + version: 6.20.0 + resolution: "react-router@npm:6.20.0" dependencies: - "@remix-run/router": "npm:1.11.0" + "@remix-run/router": "npm:1.13.0" peerDependencies: react: ">=16.8" - checksum: a00c8f347b7ffee575f4a7731782e688e3fca458ca5bd970fb41cef66a6851853caa24464155ab438d5879f367b1223a539642a405a865913ffe7e63e53b1245 + checksum: 2cdac5ad8b7a7bc230173b26768bcf3f6a9abc0a19983fa7b76b9ffdbeb44bfbd88fcc2033e9062defafef144db207859eb3162a9c9742d70cfce4e7166ff1e5 languageName: node linkType: hard @@ -7326,22 +7326,22 @@ __metadata: languageName: node linkType: hard -"rollup-plugin-visualizer@npm:^5.9.2": - version: 5.9.2 - resolution: "rollup-plugin-visualizer@npm:5.9.2" +"rollup-plugin-visualizer@npm:^5.9.3": + version: 5.9.3 + resolution: "rollup-plugin-visualizer@npm:5.9.3" dependencies: open: "npm:^8.4.0" picomatch: "npm:^2.3.1" source-map: "npm:^0.7.4" yargs: "npm:^17.5.1" peerDependencies: - rollup: 2.x || 3.x + rollup: 2.x || 3.x || 4.x peerDependenciesMeta: rollup: optional: true bin: rollup-plugin-visualizer: dist/bin/cli.js - checksum: 9cc5b140cdb384cd16538537ed41b8ecc97a21ee1fe7974775c6fbbb7522ed1733da7c47ab8b619c9b4f190de5de3b2ad34303afe94f943c41f2ce2ec621b6cb + checksum: 569acbdf9401fb5e23456d889b1094e95a003331c63428732f94418eda59850fd74994587353f58c833a535cc24cdef56c06872996f76f98802ff22939ebbf0d languageName: node linkType: hard From 8574b44d4ebc41419b7116a96631fe34bcee5f6c Mon Sep 17 00:00:00 2001 From: Proddy Date: Sun, 26 Nov 2023 18:44:15 +0100 Subject: [PATCH 6/6] react-router-dom 6.20.0 minimal --- interface/package.json | 2 +- interface/yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/package.json b/interface/package.json index 4a2642391..457488a7e 100644 --- a/interface/package.json +++ b/interface/package.json @@ -43,7 +43,7 @@ "react-dom": "latest", "react-dropzone": "^14.2.3", "react-icons": "^4.12.0", - "react-router-dom": "6.20.0", + "react-router-dom": "^6.20.0", "react-toastify": "^9.1.3", "sockette": "^2.0.6", "typesafe-i18n": "^5.26.2", diff --git a/interface/yarn.lock b/interface/yarn.lock index 51e254188..7d151a850 100644 --- a/interface/yarn.lock +++ b/interface/yarn.lock @@ -1775,7 +1775,7 @@ __metadata: react-dom: "npm:latest" react-dropzone: "npm:^14.2.3" react-icons: "npm:^4.12.0" - react-router-dom: "npm:6.20.0" + react-router-dom: "npm:^6.20.0" react-toastify: "npm:^9.1.3" rollup-plugin-visualizer: "npm:^5.9.3" sockette: "npm:^2.0.6" @@ -7020,7 +7020,7 @@ __metadata: languageName: node linkType: hard -"react-router-dom@npm:6.20.0": +"react-router-dom@npm:^6.20.0": version: 6.20.0 resolution: "react-router-dom@npm:6.20.0" dependencies: