Skip to content

Commit feafbe3

Browse files
committed
Remove multi-org check from management settings layout
We only use this layout when multi-org is enabled, so no need to run the check a second time.
1 parent 890c761 commit feafbe3

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

site/src/pages/ManagementSettingsPage/ManagementSettingsLayout.tsx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ import { Margins } from "components/Margins/Margins";
99
import { Stack } from "components/Stack/Stack";
1010
import { useAuthenticated } from "contexts/auth/RequireAuth";
1111
import { RequirePermission } from "contexts/auth/RequirePermission";
12-
import { useDashboard } from "modules/dashboard/useDashboard";
13-
import { useFeatureVisibility } from "modules/dashboard/useFeatureVisibility";
14-
import NotFoundPage from "pages/404Page/404Page";
1512
import { DeploySettingsContext } from "../DeploySettingsPage/DeploySettingsLayout";
1613
import { Sidebar } from "./Sidebar";
1714

@@ -33,10 +30,14 @@ export const useOrganizationSettings = (): OrganizationSettingsContextValue => {
3330
return context;
3431
};
3532

33+
/**
34+
* A multi-org capable settings page layout.
35+
*
36+
* If multi-org is not enabled or licensed, this is the wrong layout to use.
37+
* See DeploySettingsLayoutInner instead.
38+
*/
3639
export const ManagementSettingsLayout: FC = () => {
3740
const { permissions } = useAuthenticated();
38-
const { experiments } = useDashboard();
39-
const feats = useFeatureVisibility();
4041
const deploymentConfigQuery = useQuery(
4142
// TODO: This is probably normally fine because we will not show links to
4243
// pages that need this data, but if you manually visit the page you
@@ -46,13 +47,6 @@ export const ManagementSettingsLayout: FC = () => {
4647
);
4748
const organizationsQuery = useQuery(organizations());
4849

49-
const canViewOrganizations =
50-
feats.multiple_organizations && experiments.includes("multi-organization");
51-
52-
if (!canViewOrganizations) {
53-
return <NotFoundPage />;
54-
}
55-
5650
// The deployment settings page also contains users, audit logs, groups and
5751
// organizations, so this page must be visible if you can see any of these.
5852
const canViewDeploymentSettingsPage =

0 commit comments

Comments
 (0)