From 6ec22a9408acf188955c26ce6880600636e769cb Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Wed, 24 Nov 2021 14:31:16 -0600 Subject: [PATCH] Add sponsorship pre validate to families redeem page (#1315) * Add sponsorship pre validate to families redeem page * Update messaging * update jslib --- jslib | 2 +- .../families-for-enterprise-setup.component.html | 5 ++++- .../families-for-enterprise-setup.component.ts | 2 ++ src/locales/en/messages.json | 7 +++++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/jslib b/jslib index b4f475251a..d02fcd082e 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit b4f475251aa6817403117b71fb5a8836cdae9c75 +Subproject commit d02fcd082edd8f94cff30d057644540eb6ccde87 diff --git a/src/app/organizations/sponsorships/families-for-enterprise-setup.component.html b/src/app/organizations/sponsorships/families-for-enterprise-setup.component.html index 82f590da5b..f69197ca7c 100644 --- a/src/app/organizations/sponsorships/families-for-enterprise-setup.component.html +++ b/src/app/organizations/sponsorships/families-for-enterprise-setup.component.html @@ -6,7 +6,10 @@ {{'loading' | i18n}} -
+
+ {{'badToken' | i18n}} +
+

{{'acceptBitwardenFamiliesHelp' | i18n}}

diff --git a/src/app/organizations/sponsorships/families-for-enterprise-setup.component.ts b/src/app/organizations/sponsorships/families-for-enterprise-setup.component.ts index 0d38c2c818..d8923a15dc 100644 --- a/src/app/organizations/sponsorships/families-for-enterprise-setup.component.ts +++ b/src/app/organizations/sponsorships/families-for-enterprise-setup.component.ts @@ -55,6 +55,7 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit { @ViewChild('deleteOrganizationTemplate', { read: ViewContainerRef, static: true }) deleteModalRef: ViewContainerRef; loading = true; + badToken = false; formPromise: Promise; token: string; @@ -89,6 +90,7 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit { this.token = qParams.token; await this.syncService.fullSync(true); + this.badToken = !await this.apiService.postPreValidateSponsorshipToken(this.token); this.loading = false; this.existingFamilyOrganizations = (await this.userService.getAllOrganizations()) diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index c23605cba6..25022feb23 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -4506,6 +4506,9 @@ "sponsoredFamiliesSharedCollections": { "message": "Shared collections for Family secrets" }, + "badToken": { + "message": "The link is no longer valid. Please have the sponsor resend the offer." + }, "reclaimedFreePlan": { "message": "Reclaimed free plan" }, @@ -4540,7 +4543,7 @@ } }, "sponsoredFamiliesOffer": { - "message": "Redeem Free Bitwarden Families Organization Offer" + "message": "Accept Free Bitwarden Families" }, "sponsoredFamiliesOfferRedeemed": { "message": "Free Bitwarden Families offer successfully redeemed" @@ -4702,7 +4705,7 @@ "message": "Please provide a payment method to associate with the organization. Don't worry, we won't charge you anything unless you select additional features or your sponsorship expires. " }, "orgCreatedSponsorshipInvalid": { - "message": "The sponsorship offer has expired you may delete the organization you created to avoid a charge at the end of your 7 day trial. Otherwise you may close this prompt to keep the organization and assume billing responsibility." + "message": "The sponsorship offer has expired. You may delete the organization you created to avoid a charge at the end of your 7 day trial. Otherwise you may close this prompt to keep the organization and assume billing responsibility." }, "newFamiliesOrganization": { "message": "New Families Organization"