1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-24 12:06:15 +01:00

[PM-13645] Fix invite counter to check remaining number of seats in plan (#11577)

* Fix invite counter to check remaining number of seats in plan

* Remove redundant async pipe subscriptions
This commit is contained in:
Brandon Treston 2024-10-28 11:24:14 -04:00 committed by GitHub
parent db6c6a84cc
commit 2a956744bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 5 deletions

View File

@ -23,14 +23,15 @@
<bit-tab [label]="'role' | i18n"> <bit-tab [label]="'role' | i18n">
<ng-container *ngIf="!editMode"> <ng-container *ngIf="!editMode">
<p bitTypography="body1">{{ "inviteUserDesc" | i18n }}</p> <p bitTypography="body1">{{ "inviteUserDesc" | i18n }}</p>
<bit-form-field> <bit-form-field *ngIf="remainingSeats$ | async as remainingSeats">
<bit-label>{{ "email" | i18n }}</bit-label> <bit-label>{{ "email" | i18n }}</bit-label>
<input id="emails" type="text" appAutoFocus bitInput formControlName="emails" /> <input id="emails" type="text" appAutoFocus bitInput formControlName="emails" />
<bit-hint>{{ <bit-hint *ngIf="remainingSeats > 1; else singleSeat">{{
"inviteMultipleEmailDesc" "inviteMultipleEmailDesc" | i18n: remainingSeats
| i18n
: (organization.productTierType === ProductTierType.TeamsStarter ? "10" : "20")
}}</bit-hint> }}</bit-hint>
<ng-template #singleSeat>
<bit-hint>{{ "inviteSingleEmailDesc" | i18n: remainingSeats }}</bit-hint>
</ng-template>
</bit-form-field> </bit-form-field>
</ng-container> </ng-container>
<bit-radio-group formControlName="type"> <bit-radio-group formControlName="type">

View File

@ -89,6 +89,7 @@ export class MemberDialogComponent implements OnDestroy {
PermissionMode = PermissionMode; PermissionMode = PermissionMode;
showNoMasterPasswordWarning = false; showNoMasterPasswordWarning = false;
isOnSecretsManagerStandalone: boolean; isOnSecretsManagerStandalone: boolean;
remainingSeats$: Observable<number>;
protected organization$: Observable<Organization>; protected organization$: Observable<Organization>;
protected collectionAccessItems: AccessItemView[] = []; protected collectionAccessItems: AccessItemView[] = [];
@ -250,6 +251,10 @@ export class MemberDialogComponent implements OnDestroy {
this.loading = false; this.loading = false;
}); });
this.remainingSeats$ = this.organization$.pipe(
map((organization) => organization.seats - this.params.numConfirmedMembers),
);
} }
private setFormValidators(organization: Organization) { private setFormValidators(organization: Organization) {

View File

@ -3214,6 +3214,9 @@
} }
} }
}, },
"inviteSingleEmailDesc": {
"message": "You have 1 invite remaining."
},
"userUsingTwoStep": { "userUsingTwoStep": {
"message": "This user is using two-step login to protect their account." "message": "This user is using two-step login to protect their account."
}, },