1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +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:
Alex Morask
2023-09-29 12:58:19 -04:00
committed by GitHub
parent c7afbab217
commit 1233a081e4
7 changed files with 54 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ import { OrganizationResponse } from "../../../admin-console/models/response/org
import {
BillingSubscriptionResponse,
BillingSubscriptionUpcomingInvoiceResponse,
BillingCustomerDiscount,
} from "./subscription.response";
export class OrganizationSubscriptionResponse extends OrganizationResponse {
@@ -10,6 +11,7 @@ export class OrganizationSubscriptionResponse extends OrganizationResponse {
storageGb: number;
subscription: BillingSubscriptionResponse;
upcomingInvoice: BillingSubscriptionUpcomingInvoiceResponse;
discount: BillingCustomerDiscount;
expiration: string;
expirationWithoutGracePeriod: string;
secretsManagerBeta: boolean;
@@ -25,6 +27,8 @@ export class OrganizationSubscriptionResponse extends OrganizationResponse {
upcomingInvoice == null
? null
: new BillingSubscriptionUpcomingInvoiceResponse(upcomingInvoice);
const discount = this.getResponseProperty("Discount");
this.discount = discount == null ? null : new BillingCustomerDiscount(discount);
this.expiration = this.getResponseProperty("Expiration");
this.expirationWithoutGracePeriod = this.getResponseProperty("ExpirationWithoutGracePeriod");
this.secretsManagerBeta = this.getResponseProperty("SecretsManagerBeta");

View File

@@ -7,6 +7,7 @@ export class SubscriptionResponse extends BaseResponse {
maxStorageGb: number;
subscription: BillingSubscriptionResponse;
upcomingInvoice: BillingSubscriptionUpcomingInvoiceResponse;
discount: BillingCustomerDiscount;
license: any;
expiration: string;
usingInAppPurchase: boolean;
@@ -21,11 +22,13 @@ export class SubscriptionResponse extends BaseResponse {
this.usingInAppPurchase = this.getResponseProperty("UsingInAppPurchase");
const subscription = this.getResponseProperty("Subscription");
const upcomingInvoice = this.getResponseProperty("UpcomingInvoice");
const discount = this.getResponseProperty("Discount");
this.subscription = subscription == null ? null : new BillingSubscriptionResponse(subscription);
this.upcomingInvoice =
upcomingInvoice == null
? null
: 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");
}
}
export class BillingCustomerDiscount extends BaseResponse {
id: string;
active: boolean;
constructor(response: any) {
super(response);
this.id = this.getResponseProperty("Id");
this.active = this.getResponseProperty("Active");
}
}