Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor useRedirectWithSession hook and remove unused Server Admin menu item #326

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions web-server/src/constants/useRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const useRedirectWithSession = () => {
org?.integrations?.bitbucket;

useEffect(() => {
if (!orgId || !router.isReady) return;
if (!router.isReady) return;
if (!isOrgWelcomed) {
router.replace(ROUTES.WELCOME.PATH);
return;
Expand All @@ -43,7 +43,9 @@ export const useRedirectWithSession = () => {
router.replace(ROUTES.TEAMS.PATH);
return;
}
if (router.pathname === ROUTES.DORA_METRICS.PATH) return;
if (router.pathname !== ROUTES.DORA_METRICS.PATH){
router.replace(defaultRoute.PATH);
}
}, [
anyTeamEverExisted,
defaultRoute.PATH,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ const menuItems = (): MenuItems[] => [
icon: ExtensionTwoTone,
link: ROUTES.INTEGRATIONS.PATH
},
{
name: 'Server Admin',
icon: ExtensionTwoTone,
link: ROUTES.SERVER_ADMIN.PATH
}
]
}
];
Expand Down