mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 23:33:31 +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;
|
usesKeyConnector: boolean;
|
||||||
isOnSecretsManagerStandalone: boolean;
|
isOnSecretsManagerStandalone: boolean;
|
||||||
initialTab?: MemberDialogTab;
|
initialTab?: MemberDialogTab;
|
||||||
numConfirmedMembers: number;
|
numSeatsUsed: number;
|
||||||
managedByOrganization?: boolean;
|
managedByOrganization?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,7 +263,7 @@ export class MemberDialogComponent implements OnDestroy {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.remainingSeats$ = this.organization$.pipe(
|
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 (
|
if (
|
||||||
organization.hasReseller &&
|
organization.hasReseller &&
|
||||||
this.params.numConfirmedMembers + emails.length > organization.seats
|
this.params.numSeatsUsed + emails.length > organization.seats
|
||||||
) {
|
) {
|
||||||
this.formGroup.controls.emails.setErrors({
|
this.formGroup.controls.emails.setErrors({
|
||||||
tooManyEmails: { message: this.i18nService.t("seatLimitReachedContactYourProvider") },
|
tooManyEmails: { message: this.i18nService.t("seatLimitReachedContactYourProvider") },
|
||||||
|
|||||||
@@ -510,6 +510,11 @@ export class MembersComponent extends BaseMembersComponent<OrganizationUserView>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const numSeatsUsed =
|
||||||
|
this.dataSource.confirmedUserCount +
|
||||||
|
this.dataSource.invitedUserCount +
|
||||||
|
this.dataSource.acceptedUserCount;
|
||||||
|
|
||||||
const dialog = openUserAddEditDialog(this.dialogService, {
|
const dialog = openUserAddEditDialog(this.dialogService, {
|
||||||
data: {
|
data: {
|
||||||
name: this.userNamePipe.transform(user),
|
name: this.userNamePipe.transform(user),
|
||||||
@@ -519,7 +524,7 @@ export class MembersComponent extends BaseMembersComponent<OrganizationUserView>
|
|||||||
usesKeyConnector: user?.usesKeyConnector,
|
usesKeyConnector: user?.usesKeyConnector,
|
||||||
isOnSecretsManagerStandalone: this.orgIsOnSecretsManagerStandalone,
|
isOnSecretsManagerStandalone: this.orgIsOnSecretsManagerStandalone,
|
||||||
initialTab: initialTab,
|
initialTab: initialTab,
|
||||||
numConfirmedMembers: this.dataSource.confirmedUserCount,
|
numSeatsUsed,
|
||||||
managedByOrganization: user?.managedByOrganization,
|
managedByOrganization: user?.managedByOrganization,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ export class MemberAccessReportComponent implements OnInit {
|
|||||||
usesKeyConnector: user?.usesKeyConnector,
|
usesKeyConnector: user?.usesKeyConnector,
|
||||||
isOnSecretsManagerStandalone: this.orgIsOnSecretsManagerStandalone,
|
isOnSecretsManagerStandalone: this.orgIsOnSecretsManagerStandalone,
|
||||||
initialTab: MemberDialogTab.Role,
|
initialTab: MemberDialogTab.Role,
|
||||||
numConfirmedMembers: this.dataSource.data.length,
|
numSeatsUsed: this.dataSource.data.length,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user