Skip to content

fix: prompter for mail on postinstall is very obligatory #3878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 + ":";
Expand Down
2 changes: 1 addition & 1 deletion lib/services/subscription-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export class SubscriptionService implements ISubscriptionService {

public async subscribeForNewsletter(): Promise<void> {
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);
Expand Down
2 changes: 1 addition & 1 deletion test/services/subscription-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down