8000 chore: clean up groups page by aslilac · Pull Request #16259 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

chore: clean up groups page #16259

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 13 commits into from
Jan 29, 2025
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
Prev Previous commit
Next Next commit
🧹
  • Loading branch information
aslilac committed Jan 28, 2025
commit 6679635281a21d4a0bac8040b62be9c3be17c3a7
6 changes: 3 additions & 3 deletions site/src/pages/GroupsPage/GroupsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { useGroupsSettings } from "./GroupsPageProvider";
import GroupsPageView from "./GroupsPageView";

export const GroupsPage: FC = () => {
const feats = useFeatureVisibility();
const { template_rbac: groupsEnabled } = useFeatureVisibility();
const { organization, showOrganizations } = useGroupsSettings();
8000 const groupsQuery = useQuery(
organization ? groupsByOrganization(organization.name) : { enabled: false },
Expand Down Expand Up @@ -65,7 +65,7 @@ export const GroupsPage: FC = () => {
title="Groups"
description={`Manage groups for this ${showOrganizations ? "organization" : "deployment"}.`}
/>
{permissions.createGroup && feats.template_rbac && (
{groupsEnabled && permissions.createGroup && (
<Button asChild>
<RouterLink to="create">
<GroupAdd />
Expand All @@ -78,7 +78,7 @@ export const GroupsPage: FC = () => {
<GroupsPageView
groups={groupsQuery.data}
canCreateGroup={permissions.createGroup}
isTemplateRBACEnabled={feats.template_rbac}
isTemplateRBACEnabled={groupsEnabled}
/>
</>
);
Expand Down
6 changes: 3 additions & 3 deletions site/src/pages/GroupsPage/GroupsPageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ import { docs } from "utils/docs";
export type GroupsPageViewProps = {
groups: Group[] | undefined;
canCreateGroup: boolean;
isTemplateRBACEnabled: boolean;
groupsEnabled: boolean;
};

export const GroupsPageView: FC<GroupsPageViewProps> = ({
groups,
canCreateGroup,
isTemplateRBACEnabled,
groupsEnabled,
}) => {
const isLoading = Boolean(groups === undefined);
const isEmpty = Boolean(groups && groups.length === 0);

return (
<>
<ChooseOne>
<Cond condition={!isTemplateRBACEnabled}>
<Cond condition={!groupsEnabled}>
<Paywall
message="Groups"
description="Organize users into groups with restricted access to templates. You need a Premium license to use this feature."
Expand Down
0