Skip to content

fix: use multi-org settings layout even if not licensed #14215

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

Merged
merged 7 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
fix: only check flag for organization settings
I added checks against the license but actually what we want is for
these views to become the default even when not licensed (once the
experimental flag is removed).
  • Loading branch information
code-asher committed Aug 9, 2024
commit 6f70bb1f67e4bf5637da03bb71ec69366c47aa4b
1 change: 0 additions & 1 deletion site/src/modules/dashboard/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const Navbar: FC = () => {
const canViewDeployment = Boolean(permissions.viewDeploymentValues);
const canViewOrganizations =
Boolean(permissions.editAnyOrganization) &&
featureVisibility.multiple_organizations &&
experiments.includes("multi-organization");
const canViewAllUsers = Boolean(permissions.viewAllUsers);
const proxyContextValue = useProxy();
Expand Down
5 changes: 1 addition & 4 deletions site/src/pages/DeploySettingsPage/DeploySettingsLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { Stack } from "components/Stack/Stack";
import { useAuthenticated } from "contexts/auth/RequireAuth";
import { RequirePermission } from "contexts/auth/RequirePermission";
import { useDashboard } from "modules/dashboard/useDashboard";
import { useFeatureVisibility } from "modules/dashboard/useFeatureVisibility";
import { ManagementSettingsLayout } from "pages/ManagementSettingsPage/ManagementSettingsLayout";
import { Sidebar } from "./Sidebar";

Expand All @@ -34,9 +33,7 @@ export const useDeploySettings = (): DeploySettingsContextValue => {
export const DeploySettingsLayout: FC = () => {
const { experiments } = useDashboard();

const feats = useFeatureVisibility();
const canViewOrganizations =
feats.multiple_organizations && experiments.includes("multi-organization");
const canViewOrganizations = experiments.includes("multi-organization");

return canViewOrganizations ? (
<ManagementSettingsLayout />
Expand Down
3 changes: 1 addition & 2 deletions site/src/pages/UsersPage/UsersLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export const UsersLayout: FC = () => {
const location = useLocation();
const activeTab = location.pathname.endsWith("groups") ? "groups" : "users";

const canViewOrganizations =
feats.multiple_organizations && experiments.includes("multi-organization");
const canViewOrganizations = experiments.includes("multi-organization");

return (
<>
Expand Down
5 changes: 1 addition & 4 deletions site/src/pages/UsersPage/UsersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import { isNonInitialPage } from "components/PaginationWidget/utils";
import { useAuthenticated } from "contexts/auth/RequireAuth";
import { usePaginatedQuery } from "hooks/usePaginatedQuery";
import { useDashboard } from "modules/dashboard/useDashboard";
import { useFeatureVisibility } from "modules/dashboard/useFeatureVisibility";
import { pageTitle } from "utils/page";
import { generateRandomString } from "utils/random";
import { ResetPasswordDialog } from "./ResetPasswordDialog";
Expand All @@ -43,7 +42,6 @@ const UsersPage: FC = () => {
const searchParamsResult = useSearchParams();
const { entitlements, experiments } = useDashboard();
const [searchParams] = searchParamsResult;
const feats = useFeatureVisibility();

const groupsByUserIdQuery = useQuery(groupsByUserId("default"));
const authMethodsQuery = useQuery(authMethods());
Expand Down Expand Up @@ -104,8 +102,7 @@ const UsersPage: FC = () => {
authMethodsQuery.isLoading ||
groupsByUserIdQuery.isLoading;

const canViewOrganizations =
feats.multiple_organizations && experiments.includes("multi-organization");
const canViewOrganizations = experiments.includes("multi-organization");
if (canViewOrganizations && location.pathname !== "/deployment/users") {
return <Navigate to={`/deployment/users${location.search}`} replace />;
}
Expand Down