1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-03-02 03:41:09 +01:00

fix seat count to include invited and accepted members (#12848)

This commit is contained in:
Brandon Treston 2025-01-14 12:15:23 -05:00 committed by GitHub
parent 62e879940c
commit 63a9c69f5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 5 deletions

View File

@ -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") },

View File

@ -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,
},
});

View File

@ -103,7 +103,7 @@ export class MemberAccessReportComponent implements OnInit {
usesKeyConnector: user?.usesKeyConnector,
isOnSecretsManagerStandalone: this.orgIsOnSecretsManagerStandalone,
initialTab: MemberDialogTab.Role,
numConfirmedMembers: this.dataSource.data.length,
numSeatsUsed: this.dataSource.data.length,
},
});