From 6fcda290c7a468fe68bf61941bc8aa1099f42e9e Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 17 Jul 2018 11:04:40 -0400 Subject: [PATCH] org change plan, cancel, reinstate actions --- jslib | 2 +- .../settings/organization-billing.component.ts | 16 ++++++++++++---- src/locales/en/messages.json | 4 ++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/jslib b/jslib index 4be7c6aa4c..9c0b4b8973 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 4be7c6aa4cf08171fecec26476a3ea045ada1124 +Subproject commit 9c0b4b897387045d08c5e9651ba4c103379d3ac6 diff --git a/src/app/organizations/settings/organization-billing.component.ts b/src/app/organizations/settings/organization-billing.component.ts index cfcf200644..a85cec7409 100644 --- a/src/app/organizations/settings/organization-billing.component.ts +++ b/src/app/organizations/settings/organization-billing.component.ts @@ -77,9 +77,9 @@ export class OrganizationBillingComponent implements OnInit { } try { - this.reinstatePromise = this.apiService.postReinstatePremium(); + this.reinstatePromise = this.apiService.postOrganizationReinstate(this.organizationId); await this.reinstatePromise; - this.analytics.eventTrack.next({ action: 'Reinstated Premium' }); + this.analytics.eventTrack.next({ action: 'Reinstated Plan' }); this.toasterService.popAsync('success', null, this.i18nService.t('reinstated')); this.load(); } catch { } @@ -97,14 +97,22 @@ export class OrganizationBillingComponent implements OnInit { } try { - this.cancelPromise = this.apiService.postCancelPremium(); + this.cancelPromise = this.apiService.postOrganizationCancel(this.organizationId); await this.cancelPromise; - this.analytics.eventTrack.next({ action: 'Canceled Premium' }); + this.analytics.eventTrack.next({ action: 'Canceled Plan' }); this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription')); this.load(); } catch { } } + async changePlan() { + const contactSupport = await this.platformUtilsService.showDialog(this.i18nService.t('changeBillingPlanDesc'), + this.i18nService.t('changeBillingPlan'), this.i18nService.t('contactSupport'), this.i18nService.t('close')); + if (contactSupport) { + this.platformUtilsService.launchUri('https://bitwarden.com/contact'); + } + } + downloadLicense() { if (this.loading) { return; diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index 670add99c2..71e35d0fc2 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -2179,6 +2179,10 @@ "message": "Change Plan", "description": "A billing plan/package. For example: families, teams, enterprise, etc." }, + "changeBillingPlanDesc": { + "message": "Contact customer support if you would like to change your plan. Please ensure that you have an active payment method added to the account.", + "description": "A billing plan/package. For example: families, teams, enterprise, etc." + }, "invoice": { "message": "Invoice" },