mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +00:00
Conditionally display new copy under subscriptions table [AC-1657] (#6332)
* Add copy to translations * Add copy to premium user subscription page * Add copy to organization user subscription page * Conditionally display copy on premium user subscription page * Conditionally display copy on organization user subscription page * Update translations to approved copy
This commit is contained in:
@@ -81,6 +81,17 @@
|
|||||||
{{ i.quantity * i.amount | currency : "$" }} /{{ i.interval | i18n }}
|
{{ i.quantity * i.amount | currency : "$" }} /{{ i.interval | i18n }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr bitRow *ngIf="discount && discount.active">
|
||||||
|
<td bitCell colspan="2">
|
||||||
|
<small>
|
||||||
|
{{ "customBillingStart" | i18n }}
|
||||||
|
<a routerLink="/settings/subscription/billing-history">
|
||||||
|
{{ "billingHistory" | i18n }}
|
||||||
|
</a>
|
||||||
|
{{ "customBillingEnd" | i18n }}
|
||||||
|
</small>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="userOrg.isFreeOrg">
|
<ng-container *ngIf="userOrg.isFreeOrg">
|
||||||
<tr bitRow *ngIf="userOrg.usePasswordManager">
|
<tr bitRow *ngIf="userOrg.usePasswordManager">
|
||||||
|
|||||||
@@ -140,6 +140,10 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
|
|||||||
return this.sub != null ? this.sub.upcomingInvoice : null;
|
return this.sub != null ? this.sub.upcomingInvoice : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get discount() {
|
||||||
|
return this.sub != null ? this.sub.discount : null;
|
||||||
|
}
|
||||||
|
|
||||||
get isExpired() {
|
get isExpired() {
|
||||||
const nextInvoice = this.nextInvoice;
|
const nextInvoice = this.nextInvoice;
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,17 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>{{ i.quantity * i.amount | currency : "$" }} /{{ i.interval | i18n }}</td>
|
<td>{{ i.quantity * i.amount | currency : "$" }} /{{ i.interval | i18n }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr *ngIf="discount != null && discount.active">
|
||||||
|
<td colspan="2">
|
||||||
|
<small>
|
||||||
|
{{ "customBillingStart" | i18n }}
|
||||||
|
<a routerLink="/settings/subscription/billing-history">
|
||||||
|
{{ "billingHistory" | i18n }}
|
||||||
|
</a>
|
||||||
|
{{ "customBillingEnd" | i18n }}
|
||||||
|
</small>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -206,6 +206,10 @@ export class UserSubscriptionComponent implements OnInit {
|
|||||||
return this.sub != null ? this.sub.upcomingInvoice : null;
|
return this.sub != null ? this.sub.upcomingInvoice : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get discount() {
|
||||||
|
return this.sub != null ? this.sub.discount : null;
|
||||||
|
}
|
||||||
|
|
||||||
get storagePercentage() {
|
get storagePercentage() {
|
||||||
return this.sub != null && this.sub.maxStorageGb
|
return this.sub != null && this.sub.maxStorageGb
|
||||||
? +(100 * (this.sub.storageGb / this.sub.maxStorageGb)).toFixed(2)
|
? +(100 * (this.sub.storageGb / this.sub.maxStorageGb)).toFixed(2)
|
||||||
|
|||||||
@@ -7177,5 +7177,11 @@
|
|||||||
},
|
},
|
||||||
"alreadyHaveAccount": {
|
"alreadyHaveAccount": {
|
||||||
"message": "Already have an account?"
|
"message": "Already have an account?"
|
||||||
|
},
|
||||||
|
"customBillingStart": {
|
||||||
|
"message": "Custom billing is not reflected. Visit the "
|
||||||
|
},
|
||||||
|
"customBillingEnd": {
|
||||||
|
"message": " page for latest invoicing."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { OrganizationResponse } from "../../../admin-console/models/response/org
|
|||||||
import {
|
import {
|
||||||
BillingSubscriptionResponse,
|
BillingSubscriptionResponse,
|
||||||
BillingSubscriptionUpcomingInvoiceResponse,
|
BillingSubscriptionUpcomingInvoiceResponse,
|
||||||
|
BillingCustomerDiscount,
|
||||||
} from "./subscription.response";
|
} from "./subscription.response";
|
||||||
|
|
||||||
export class OrganizationSubscriptionResponse extends OrganizationResponse {
|
export class OrganizationSubscriptionResponse extends OrganizationResponse {
|
||||||
@@ -10,6 +11,7 @@ export class OrganizationSubscriptionResponse extends OrganizationResponse {
|
|||||||
storageGb: number;
|
storageGb: number;
|
||||||
subscription: BillingSubscriptionResponse;
|
subscription: BillingSubscriptionResponse;
|
||||||
upcomingInvoice: BillingSubscriptionUpcomingInvoiceResponse;
|
upcomingInvoice: BillingSubscriptionUpcomingInvoiceResponse;
|
||||||
|
discount: BillingCustomerDiscount;
|
||||||
expiration: string;
|
expiration: string;
|
||||||
expirationWithoutGracePeriod: string;
|
expirationWithoutGracePeriod: string;
|
||||||
secretsManagerBeta: boolean;
|
secretsManagerBeta: boolean;
|
||||||
@@ -25,6 +27,8 @@ export class OrganizationSubscriptionResponse extends OrganizationResponse {
|
|||||||
upcomingInvoice == null
|
upcomingInvoice == null
|
||||||
? null
|
? null
|
||||||
: new BillingSubscriptionUpcomingInvoiceResponse(upcomingInvoice);
|
: new BillingSubscriptionUpcomingInvoiceResponse(upcomingInvoice);
|
||||||
|
const discount = this.getResponseProperty("Discount");
|
||||||
|
this.discount = discount == null ? null : new BillingCustomerDiscount(discount);
|
||||||
this.expiration = this.getResponseProperty("Expiration");
|
this.expiration = this.getResponseProperty("Expiration");
|
||||||
this.expirationWithoutGracePeriod = this.getResponseProperty("ExpirationWithoutGracePeriod");
|
this.expirationWithoutGracePeriod = this.getResponseProperty("ExpirationWithoutGracePeriod");
|
||||||
this.secretsManagerBeta = this.getResponseProperty("SecretsManagerBeta");
|
this.secretsManagerBeta = this.getResponseProperty("SecretsManagerBeta");
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export class SubscriptionResponse extends BaseResponse {
|
|||||||
maxStorageGb: number;
|
maxStorageGb: number;
|
||||||
subscription: BillingSubscriptionResponse;
|
subscription: BillingSubscriptionResponse;
|
||||||
upcomingInvoice: BillingSubscriptionUpcomingInvoiceResponse;
|
upcomingInvoice: BillingSubscriptionUpcomingInvoiceResponse;
|
||||||
|
discount: BillingCustomerDiscount;
|
||||||
license: any;
|
license: any;
|
||||||
expiration: string;
|
expiration: string;
|
||||||
usingInAppPurchase: boolean;
|
usingInAppPurchase: boolean;
|
||||||
@@ -21,11 +22,13 @@ export class SubscriptionResponse extends BaseResponse {
|
|||||||
this.usingInAppPurchase = this.getResponseProperty("UsingInAppPurchase");
|
this.usingInAppPurchase = this.getResponseProperty("UsingInAppPurchase");
|
||||||
const subscription = this.getResponseProperty("Subscription");
|
const subscription = this.getResponseProperty("Subscription");
|
||||||
const upcomingInvoice = this.getResponseProperty("UpcomingInvoice");
|
const upcomingInvoice = this.getResponseProperty("UpcomingInvoice");
|
||||||
|
const discount = this.getResponseProperty("Discount");
|
||||||
this.subscription = subscription == null ? null : new BillingSubscriptionResponse(subscription);
|
this.subscription = subscription == null ? null : new BillingSubscriptionResponse(subscription);
|
||||||
this.upcomingInvoice =
|
this.upcomingInvoice =
|
||||||
upcomingInvoice == null
|
upcomingInvoice == null
|
||||||
? null
|
? null
|
||||||
: new BillingSubscriptionUpcomingInvoiceResponse(upcomingInvoice);
|
: new BillingSubscriptionUpcomingInvoiceResponse(upcomingInvoice);
|
||||||
|
this.discount = discount == null ? null : new BillingCustomerDiscount(discount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,3 +91,14 @@ export class BillingSubscriptionUpcomingInvoiceResponse extends BaseResponse {
|
|||||||
this.amount = this.getResponseProperty("Amount");
|
this.amount = this.getResponseProperty("Amount");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class BillingCustomerDiscount extends BaseResponse {
|
||||||
|
id: string;
|
||||||
|
active: boolean;
|
||||||
|
|
||||||
|
constructor(response: any) {
|
||||||
|
super(response);
|
||||||
|
this.id = this.getResponseProperty("Id");
|
||||||
|
this.active = this.getResponseProperty("Active");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user