Skip to content

Commit

Permalink
Removed free seat assignment limitation
Browse files Browse the repository at this point in the history
  • Loading branch information
Cosmin-Parvulescu committed Sep 27, 2023
1 parent 4031aba commit b24d17a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions apps/console/app/routes/__layout/groups/$groupID/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,9 @@ export default () => {
title="Add Group Member"
subtitle="Invite Members to the Group"
onClick={
group.members.length + invitations.length <
IDENTITY_GROUP_OPTIONS.maxFreeMembers
group.members.length + invitations.length <=
IDENTITY_GROUP_OPTIONS.maxFreeMembers +
(groupSeats.total - groupSeats.used)
? () => setInviteModalOpen(true)
: undefined
}
Expand Down Expand Up @@ -780,7 +781,8 @@ export default () => {

<Pill className="bg-gray-200 rounded-lg !pr-2">
<Text size="xs" weight="medium" className="text-gray-800">
{group.members.length}/{IDENTITY_GROUP_OPTIONS.maxFreeMembers}
{group.members.length}/
{IDENTITY_GROUP_OPTIONS.maxFreeMembers + groupSeats.total}
</Text>
</Pill>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ export const inviteIdentityGroupMember = async ({
const invitations = await node.class.getInvitations()
const invitationCount = invitations.length

const seats = await node.class.getSeats()

const { edges: groupMembershipEdges } = await caller.edges.getEdges({
query: {
tag: EDGE_MEMBER_OF_IDENTITY_GROUP,
Expand All @@ -88,7 +90,7 @@ export const inviteIdentityGroupMember = async ({

if (
invitationCount + groupMembershipEdges.length >
IDENTITY_GROUP_OPTIONS.maxFreeMembers
IDENTITY_GROUP_OPTIONS.maxFreeMembers + (seats?.quantity ?? 0)
) {
throw new BadRequestError({
message: 'Max members reached',
Expand Down

0 comments on commit b24d17a

Please sign in to comment.