mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 20:29:04 +08:00
fix: add support route to the base route for private routes (#6688)
* fix: add support route to the base route for private routes * fix: early return from useEffect if it's an old route * fix: same old explorer routes in old mapping
This commit is contained in:
parent
2f62a9d36d
commit
2c2e248c95
@ -18,6 +18,7 @@ import routes, {
|
|||||||
LIST_LICENSES,
|
LIST_LICENSES,
|
||||||
oldNewRoutesMapping,
|
oldNewRoutesMapping,
|
||||||
oldRoutes,
|
oldRoutes,
|
||||||
|
SUPPORT_ROUTE,
|
||||||
} from './routes';
|
} from './routes';
|
||||||
|
|
||||||
function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
|
function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
|
||||||
@ -37,7 +38,7 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
|
|||||||
const mapRoutes = useMemo(
|
const mapRoutes = useMemo(
|
||||||
() =>
|
() =>
|
||||||
new Map(
|
new Map(
|
||||||
[...routes, LIST_LICENSES].map((e) => {
|
[...routes, LIST_LICENSES, SUPPORT_ROUTE].map((e) => {
|
||||||
const currentPath = matchPath(pathname, {
|
const currentPath = matchPath(pathname, {
|
||||||
path: e.path,
|
path: e.path,
|
||||||
});
|
});
|
||||||
@ -160,6 +161,7 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
|
|||||||
pathname: redirectUrl,
|
pathname: redirectUrl,
|
||||||
};
|
};
|
||||||
history.replace(newLocation);
|
history.replace(newLocation);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
// if the current route
|
// if the current route
|
||||||
if (currentRoute) {
|
if (currentRoute) {
|
||||||
|
@ -427,7 +427,6 @@ export const LIST_LICENSES: AppRoutes = {
|
|||||||
|
|
||||||
export const oldRoutes = [
|
export const oldRoutes = [
|
||||||
'/pipelines',
|
'/pipelines',
|
||||||
'/logs/old-logs-explorer',
|
|
||||||
'/logs-explorer',
|
'/logs-explorer',
|
||||||
'/logs-explorer/live',
|
'/logs-explorer/live',
|
||||||
'/logs-save-views',
|
'/logs-save-views',
|
||||||
@ -437,7 +436,6 @@ export const oldRoutes = [
|
|||||||
|
|
||||||
export const oldNewRoutesMapping: Record<string, string> = {
|
export const oldNewRoutesMapping: Record<string, string> = {
|
||||||
'/pipelines': '/logs/pipelines',
|
'/pipelines': '/logs/pipelines',
|
||||||
'/logs/old-logs-explorer': '/logs/old-logs-explorer',
|
|
||||||
'/logs-explorer': '/logs/logs-explorer',
|
'/logs-explorer': '/logs/logs-explorer',
|
||||||
'/logs-explorer/live': '/logs/logs-explorer/live',
|
'/logs-explorer/live': '/logs/logs-explorer/live',
|
||||||
'/logs-save-views': '/logs/saved-views',
|
'/logs-save-views': '/logs/saved-views',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user