@@ -3,26 +3,21 @@ import Button from "@mui/material/Button";
3
3
import { type FC , useEffect } from "react" ;
4
4
import { Helmet } from "react-helmet-async" ;
5
5
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" ;
7
7
import { getErrorMessage } from "api/errors" ;
8
8
import { organizationRoles } from "api/queries/roles" ;
9
9
import { displayError } from "components/GlobalSnackbar/utils" ;
10
10
import { PageHeader , PageHeaderTitle } from "components/PageHeader/PageHeader" ;
11
11
import { useAuthenticated } from "contexts/auth/RequireAuth" ;
12
- import { useDashboard } from "modules/dashboard/useDashboard" ;
13
12
import { useFeatureVisibility } from "modules/dashboard/useFeatureVisibility" ;
14
13
import { pageTitle } from "utils/page" ;
15
14
import CustomRolesPageView from "./CustomRolesPageView" ;
16
15
17
16
export const CustomRolesPage : FC = ( ) => {
18
17
const { permissions } = useAuthenticated ( ) ;
19
18
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
+
26
21
const { organization = "default" } = useParams ( ) as { organization : string } ;
27
22
const organizationRolesQuery = useQuery ( organizationRoles ( organization ) ) ;
28
23
const filteredRoleData = organizationRolesQuery . data ?. filter (
@@ -40,16 +35,6 @@ export const CustomRolesPage: FC = () => {
40
35
}
41
36
} , [ organizationRolesQuery . error ] ) ;
42
37
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
-
53
38
return (
54
39
< >
55
40
< Helmet >
0 commit comments