1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-12 06:23:38 +00:00

Remove unreachable toast logic.

This commit is contained in:
Jimmy Vo
2024-12-05 12:23:04 -05:00
parent f980b2b57e
commit 933fb36a93
3 changed files with 20 additions and 12 deletions

View File

@@ -284,16 +284,27 @@ export class MemberDialogComponent implements OnDestroy {
orgSeatLimitReachedValidator(
organization,
this.params.allOrganizationUserEmails,
this.i18nService.t("subscriptionUpgrade", organization.seats),
this.getSeatLimitErrorMessageForPlan(organization),
this.params.occupiedSeatCount,
),
];
const emailsControl = this.formGroup.get("emails");
emailsControl.setValidators(emailsControlValidators);
emailsControl.updateValueAndValidity();
}
}
private getSeatLimitErrorMessageForPlan(organization: Organization): string {
const { seats, hasReseller } = organization;
if (hasReseller) {
return this.i18nService.t("seatLimitReachedContactYourProvider", seats);
}
return this.i18nService.t("subscriptionUpgrade", seats);
}
private loadOrganizationUser(
userDetails: OrganizationUserAdminView,
groups: GroupDetailsView[],
@@ -467,15 +478,6 @@ export class MemberDialogComponent implements OnDestroy {
});
return;
}
if (
organization.hasReseller &&
this.params.numConfirmedMembers + emails.length > organization.seats
) {
this.formGroup.controls.emails.setErrors({
tooManyEmails: { message: this.i18nService.t("seatLimitReachedContactYourProvider") },
});
return;
}
await this.userService.invite(emails, userView);
}

View File

@@ -467,7 +467,7 @@ export class MembersComponent extends BaseMembersComponent<OrganizationUserView>
if (
!user &&
this.organization.hasReseller &&
this.organization.seats === this.dataSource.confirmedUserCount
this.organization.seats === this.dataSource.occupiedSeatCount
) {
this.toastService.showToast({
variant: "error",

View File

@@ -8519,7 +8519,13 @@
"message": "Contact your provider to purchase additional seats."
},
"seatLimitReachedContactYourProvider": {
"message": "Seat limit has been reached. Contact your provider to purchase additional seats."
"message": "Seat limit of $COUNT$ has been reached. Contact your provider to purchase additional seats.",
"placeholders": {
"count": {
"content": "$1",
"example": "2"
}
}
},
"collectionAccessRestricted": {
"message": "Collection access is restricted"