mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 07:13:32 +00:00
fix seat count to include invited and accepted members (#12848)
This commit is contained in:
@@ -68,7 +68,7 @@ export interface MemberDialogParams {
|
||||
usesKeyConnector: boolean;
|
||||
isOnSecretsManagerStandalone: boolean;
|
||||
initialTab?: MemberDialogTab;
|
||||
numConfirmedMembers: number;
|
||||
numSeatsUsed: number;
|
||||
managedByOrganization?: boolean;
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ export class MemberDialogComponent implements OnDestroy {
|
||||
});
|
||||
|
||||
this.remainingSeats$ = this.organization$.pipe(
|
||||
map((organization) => organization.seats - this.params.numConfirmedMembers),
|
||||
map((organization) => organization.seats - this.params.numSeatsUsed),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ export class MemberDialogComponent implements OnDestroy {
|
||||
}
|
||||
if (
|
||||
organization.hasReseller &&
|
||||
this.params.numConfirmedMembers + emails.length > organization.seats
|
||||
this.params.numSeatsUsed + emails.length > organization.seats
|
||||
) {
|
||||
this.formGroup.controls.emails.setErrors({
|
||||
tooManyEmails: { message: this.i18nService.t("seatLimitReachedContactYourProvider") },
|
||||
|
||||
@@ -510,6 +510,11 @@ export class MembersComponent extends BaseMembersComponent<OrganizationUserView>
|
||||
return;
|
||||
}
|
||||
|
||||
const numSeatsUsed =
|
||||
this.dataSource.confirmedUserCount +
|
||||
this.dataSource.invitedUserCount +
|
||||
this.dataSource.acceptedUserCount;
|
||||
|
||||
const dialog = openUserAddEditDialog(this.dialogService, {
|
||||
data: {
|
||||
name: this.userNamePipe.transform(user),
|
||||
@@ -519,7 +524,7 @@ export class MembersComponent extends BaseMembersComponent<OrganizationUserView>
|
||||
usesKeyConnector: user?.usesKeyConnector,
|
||||
isOnSecretsManagerStandalone: this.orgIsOnSecretsManagerStandalone,
|
||||
initialTab: initialTab,
|
||||
numConfirmedMembers: this.dataSource.confirmedUserCount,
|
||||
numSeatsUsed,
|
||||
managedByOrganization: user?.managedByOrganization,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user