Skip to content
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

chore: remove check for 10<groups on add #305

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 2 additions & 7 deletions src/components/Organizations/Groups/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const DELETE_GROUP = gql`
/**
* The primary list of groups.
*/
const Groups = ({ groups = [], organizationId, organizationName, ableToAddGroup, refetch, orgFriendlyName }) => {
const Groups = ({ groups = [], organizationId, organizationName, refetch, orgFriendlyName }) => {
const [modalStates, setModalStates] = useState({
addUser: {
open: false,
Expand Down Expand Up @@ -209,12 +209,7 @@ const Groups = ({ groups = [], organizationId, organizationName, ableToAddGroup,
emptyText="No groups found"
labelText="Groups"
/>
<NewGroup
disabled={!ableToAddGroup}
organizationId={organizationId}
onGroupAdded={refetch}
existingGroupNames={groups.map(g => g.name)}
/>
<NewGroup organizationId={organizationId} onGroupAdded={refetch} existingGroupNames={groups.map(g => g.name)} />
</StyledGroups>
</GroupsWrapper>
);
Expand Down
4 changes: 0 additions & 4 deletions src/pages/organizations/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ export const PageGroups = ({ router }) => {
return <OrganizationNotFound variables={{ name: router.query.organizationSlug }} />;
}

// disable adding new groups if non-default groups count is 10
const ableToAddGroup = organization.groups.filter(group => group.type !== 'project-default-group').length < 10;

return (
<>
<Head>
Expand All @@ -89,7 +86,6 @@ export const PageGroups = ({ router }) => {
organizationId={organization.id}
organizationName={organization.name}
orgFriendlyName={organization.friendlyName}
ableToAddGroup={ableToAddGroup}
refetch={handleRefetch}
/>
</OrganizationsWrapper>
Expand Down