From d0905b6224bc78ebae67cea8d3b0b115baf0d040 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 7 Jul 2021 15:14:31 -0400 Subject: [PATCH] (core) correct capitalization of AppSumo; add account management link Summary: Branding feedback from AppSumo found a capitalization problem. They also nudged us again to include a link back for the user to manage their AppSumo account. Test Plan: manual Reviewers: dsagal, anaisconce Reviewed By: dsagal Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D2901 --- app/client/ui/BillingPage.ts | 17 +++++++++++++++++ app/common/UserAPI.ts | 3 +++ 2 files changed, 20 insertions(+) diff --git a/app/client/ui/BillingPage.ts b/app/client/ui/BillingPage.ts index 4c1b2072..e45ddeab 100644 --- a/app/client/ui/BillingPage.ts +++ b/app/client/ui/BillingPage.ts @@ -182,6 +182,7 @@ export class BillingPage extends Disposable { makeSummaryFeature([`Your next invoice is `, getPriceString(sub.nextTotal), ' on ', dateFmt(sub.periodEnd)]), ] : null, + tier ? this.buildAppSumoLink(this._appModel.currentOrg?.billingAccount?.externalOptions?.invoiceId) : null, getSubscriptionProblem(sub), testId('summary') ), @@ -250,6 +251,22 @@ export class BillingPage extends Disposable { return null; } + // Include a precise link back to AppSumo for changing plans. + public buildAppSumoLink(invoiceId: string | undefined) { + if (!invoiceId) { return null; } + return dom('div', + css.billingTextBtn({ style: 'margin: 10px 0;' }, + cssBreadcrumbsLink( + css.billingIcon('Plus'), 'Change your AppSumo plan', + { + href: `https://appsumo.com/account/redemption/${invoiceId}/#change-plan`, + target: '_blank' + }, + testId('appsumo-link') + ) + )); + } + public buildPlansPage() { // Fetch plan and card data if not already present. this._model.fetchData().catch(reportError); diff --git a/app/common/UserAPI.ts b/app/common/UserAPI.ts index f229a80d..4e1398d0 100644 --- a/app/common/UserAPI.ts +++ b/app/common/UserAPI.ts @@ -65,6 +65,9 @@ export interface BillingAccount { individual: boolean; product: Product; isManager: boolean; + externalOptions?: { + invoiceId?: string; + }; } // Information about the product associated with an org or orgs.