1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-11 10:10:25 +01:00

[AC-3029][Defect] Organization storage count is not carried over to the Upgrade dialog Total section (#10965)

* Resolve the ui changes issues

* Resolve the storage ui issue
This commit is contained in:
cyprain-okeke 2024-09-10 12:57:47 +01:00 committed by GitHub
parent 71e5bcb947
commit c1b1db071d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 35 additions and 10 deletions

View File

@ -389,17 +389,21 @@
bitTypography="body2"
*ngIf="
selectedPlan.PasswordManager.hasAdditionalStorageOption &&
!organization.useSecretsManager
!organization.useSecretsManager &&
organization.maxStorageGb > 0
"
>
<span>
{{ 0 }}
{{ organization.maxStorageGb }}
{{ "additionalStorageGbMessage" | i18n }}
&times;
{{ selectedPlan.PasswordManager.additionalStoragePricePerGb | currency: "$" }}
{{ additionalStoragePriceMonthly(selectedPlan) | currency: "$" }}
/{{ "year" | i18n }}
</span>
<span>{{ 0 | currency: "$" }}</span>
<span>{{
organization.maxStorageGb * selectedPlan.PasswordManager.additionalStoragePricePerGb
| currency: "$"
}}</span>
</p>
<!-- secrets manager summary for annual -->
<p class="tw-font-semibold tw-mt-3 tw-mb-1" *ngIf="organization.useSecretsManager">
@ -505,17 +509,21 @@
bitTypography="body2"
*ngIf="
selectedPlan.PasswordManager.hasAdditionalStorageOption &&
!organization.useSecretsManager
!organization.useSecretsManager &&
organization.maxStorageGb > 0
"
>
<span>
{{ 0 }}
{{ organization.maxStorageGb }}
{{ "additionalStorageGbMessage" | i18n }}
&times;
{{ selectedPlan.PasswordManager.additionalStoragePricePerGb | currency: "$" }}
{{ additionalStoragePriceMonthly(selectedPlan) | currency: "$" }}
/{{ "month" | i18n }}
</span>
<span>{{ 0 | currency: "$" }}</span>
<span>{{
organization.maxStorageGb * selectedPlan.PasswordManager.additionalStoragePricePerGb
| currency: "$"
}}</span>
</p>
<!-- secrets manager summary for monthly -->
<p class="tw-font-semibold tw-mt-3 tw-mb-1" *ngIf="organization.useSecretsManager">

View File

@ -477,6 +477,13 @@ export class ChangePlanDialogComponent implements OnInit, OnDestroy {
);
}
additionalStoragePriceMonthly(selectedPlan: PlanResponse) {
if (!selectedPlan.isAnnual) {
return selectedPlan.PasswordManager.additionalStoragePricePerGb;
}
return selectedPlan.PasswordManager.additionalStoragePricePerGb / 12;
}
additionalServiceAccountTotal(plan: PlanResponse): number {
if (!plan.SecretsManager.hasAdditionalServiceAccountOption || this.additionalServiceAccount) {
return 0;
@ -525,9 +532,18 @@ export class ChangePlanDialogComponent implements OnInit, OnDestroy {
get total() {
if (this.organization.useSecretsManager) {
return this.passwordManagerSubtotal + this.secretsManagerSubtotal + this.taxCharges || 0;
return (
this.passwordManagerSubtotal +
this.additionalStorageTotal(this.selectedPlan) +
this.secretsManagerSubtotal +
this.taxCharges || 0
);
}
return this.passwordManagerSubtotal + this.taxCharges || 0;
return (
this.passwordManagerSubtotal +
this.additionalStorageTotal(this.selectedPlan) +
this.taxCharges || 0
);
}
get teamsStarterPlanIsAvailable() {
@ -639,6 +655,7 @@ export class ChangePlanDialogComponent implements OnInit, OnDestroy {
if (this.selectedPlan.productTier !== ProductTierType.Families) {
request.additionalSeats = this.organization.seats;
}
request.additionalStorageGb = this.organization.maxStorageGb;
request.premiumAccessAddon =
this.selectedPlan.PasswordManager.hasPremiumAccessOption &&
this.formGroup.controls.premiumAccessAddon.value;