Skip to content

Commit fbea545

Browse files
committed
feat: - hide custom roles tab if experiment is not enabled
1 parent 68eae17 commit fbea545

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

site/src/pages/ManagementSettingsPage/CustomRolesPage/CustomRolesPage.tsx

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,21 @@ import Button from "@mui/material/Button";
33
import { type FC, useEffect } from "react";
44
import { Helmet } from "react-helmet-async";
55
import { useQuery } from "react-query";
6-
import { Link as RouterLink, useLocation, useParams } from "react-router-dom";
6+
import { Link as RouterLink, useParams } from "react-router-dom";
77
import { getErrorMessage } from "api/errors";
88
import { organizationRoles } from "api/queries/roles";
99
import { displayError } from "components/GlobalSnackbar/utils";
1010
import { PageHeader, PageHeaderTitle } from "components/PageHeader/PageHeader";
1111
import { useAuthenticated } from "contexts/auth/RequireAuth";
12-
import { useDashboard } from "modules/dashboard/useDashboard";
1312
import { useFeatureVisibility } from "modules/dashboard/useFeatureVisibility";
1413
import { pageTitle } from "utils/page";
1514
import CustomRolesPageView from "./CustomRolesPageView";
1615

1716
export const CustomRolesPage: FC = () => {
1817
const { permissions } = useAuthenticated();
1918
const { assignOrgRole: canAssignOrgRole } = permissions;
20-
const {
21-
multiple_organizations: organizationsEnabled,
22-
custom_roles: isCustomRolesEnabled,
23-
} = useFeatureVisibility();
24-
const { experiments } = useDashboard();
25-
const location = useLocation();
19+
const { custom_roles: isCustomRolesEnabled } = useFeatureVisibility();
20+
2621
const { organization = "default" } = useParams() as { organization: string };
2722
const organizationRolesQuery = useQuery(organizationRoles(organization));
2823
const filteredRoleData = organizationRolesQuery.data?.filter(
@@ -40,16 +35,6 @@ export const CustomRolesPage: FC = () => {
4035
}
4136
}, [organizationRolesQuery.error]);
4237

43-
// if (
44-
// organizationsEnabled &&
45-
// experiments.includes("multi-organization") &&
46-
// location.pathname === "/deployment/groups"
47-
// ) {
48-
// const defaultName =
49-
// getOrganizationNameByDefault(organizations) ?? "default";
50-
// return <Navigate to={`/organizations/${defaultName}/groups`} replace />;
51-
// }
52-
5338
return (
5439
<>
5540
<Helmet>

0 commit comments

Comments
 (0)