From 465b8365cf409f4b7526fa5abf71a01f02e1ab2e Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Mon, 10 Sep 2018 13:38:05 +0300 Subject: [PATCH] fix: prompter for mail on postinstall is very obligatory On postinstall CLI checks if the user had subscribed for NativeScript newsletter if not, prompts for email. However, the messages seems obligatory, while it is not. Reformat it, so the users can easily skip it in case they do not want to subscribe for the newsletter. --- lib/constants.ts | 2 +- lib/services/subscription-service.ts | 2 +- test/services/subscription-service.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/constants.ts b/lib/constants.ts index d2a96c0d06..b1858470a0 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -182,7 +182,7 @@ export class MacOSVersions { export const MacOSDeprecationStringFormat = "Support for macOS %s is deprecated and will be removed in one of the next releases of NativeScript. Please, upgrade to the latest macOS version."; export const PROGRESS_PRIVACY_POLICY_URL = "https://www.progress.com/legal/privacy-policy"; export class SubscribeForNewsletterMessages { - public static AgreeToReceiveEmailMsg = "I agree to receive email communications from Progress Software or its Partners (`https://www.progress.com/partners/partner-directory`)," + + public static AgreeToReceiveEmailMsg = "I agree".green.bold + " to receive email communications from Progress Software or its Partners (`https://www.progress.com/partners/partner-directory`)," + "containing information about Progress Software's products. Consent may be withdrawn at any time."; public static ReviewPrivacyPolicyMsg = `You can review the Progress Software Privacy Policy at \`${PROGRESS_PRIVACY_POLICY_URL}\``; public static PromptMsg = "Input your e-mail address to agree".green + " or " + "leave empty to decline".red.bold + ":"; diff --git a/lib/services/subscription-service.ts b/lib/services/subscription-service.ts index 7c28a2aa56..04cebae430 100644 --- a/lib/services/subscription-service.ts +++ b/lib/services/subscription-service.ts @@ -12,8 +12,8 @@ export class SubscriptionService implements ISubscriptionService { public async subscribeForNewsletter(): Promise { if (await this.shouldAskForEmail()) { - this.$logger.printMarkdown(SubscribeForNewsletterMessages.AgreeToReceiveEmailMsg); this.$logger.printMarkdown(SubscribeForNewsletterMessages.ReviewPrivacyPolicyMsg); + this.$logger.printMarkdown(SubscribeForNewsletterMessages.AgreeToReceiveEmailMsg); const email = await this.getEmail(SubscribeForNewsletterMessages.PromptMsg); await this.$userSettingsService.saveSetting("EMAIL_REGISTERED", true); diff --git a/test/services/subscription-service.ts b/test/services/subscription-service.ts index 4e8774864b..97e91abb6c 100644 --- a/test/services/subscription-service.ts +++ b/test/services/subscription-service.ts @@ -160,7 +160,7 @@ describe("subscriptionService", () => { await subscriptionService.subscribeForNewsletter(); - assert.equal(loggerOutput, `${SubscribeForNewsletterMessages.AgreeToReceiveEmailMsg}${SubscribeForNewsletterMessages.ReviewPrivacyPolicyMsg}`); + assert.equal(loggerOutput, `${SubscribeForNewsletterMessages.ReviewPrivacyPolicyMsg}${SubscribeForNewsletterMessages.AgreeToReceiveEmailMsg}`); }); const expectedMessageInPrompter = SubscribeForNewsletterMessages.PromptMsg;