diff --git a/locales/en/out/constants.i18n.json b/locales/en/out/constants.i18n.json index d116e5ae9..88b62c10b 100644 --- a/locales/en/out/constants.i18n.json +++ b/locales/en/out/constants.i18n.json @@ -26,7 +26,7 @@ "info.redirect": "You are being redirected.", "info.runningCode": "Running user code", "info.privacyStatement": "Privacy Statement", - "info.thirdPartyWebsite": "You will be redirect to adafruit.com, a website outside Microsoft. Read the privacy statement on Adafruit:", + "info.thirdPartyWebsite": "By clicking \"Agree and Proceed\" you will be redirected to adafruit.com, a third party website not managed by Microsoft. Please note that your activity on adafruit.com is subject to Adafruit's privacy policy", "info.welcomeOutputTab": "Welcome to the Adafruit Simulator output tab !\n\n", "label.webviewPanel": "Adafruit CPX", "name": "Pacifica Simulator", diff --git a/src/constants.ts b/src/constants.ts index 7fd869014..0813e8983 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -94,7 +94,7 @@ export const CONSTANTS = { RUNNING_CODE: localize("info.runningCode", "Running user code"), THIRD_PARTY_WEBSITE: localize( "info.thirdPartyWebsite", - "You will be redirect to adafruit.com, a website outside Microsoft. Read the privacy statement on Adafruit:" + "By clicking \"Agree and Proceed\" you will be redirected to adafruit.com, a third party website not managed by Microsoft. Please note that your activity on adafruit.com is subject to Adafruit's privacy policy", ), WELCOME_OUTPUT_TAB: localize( "info.welcomeOutputTab", @@ -167,6 +167,9 @@ export namespace DialogResponses { export const ACCEPT_AND_RUN: MessageItem = { title: localize("dialogResponses.agreeAndRun", "Agree and Run") }; + export const AGREE_AND_PROCEED: MessageItem = { + title: localize("dialogResponses.agreeAndProceed", "Agree and Proceed") + }; export const CANCEL: MessageItem = { title: localize("dialogResponses.cancel", "Cancel") } diff --git a/src/extension_utils/utils.ts b/src/extension_utils/utils.ts index dd22c3245..5cecd57d5 100644 --- a/src/extension_utils/utils.ts +++ b/src/extension_utils/utils.ts @@ -28,14 +28,17 @@ export const validCodeFileName = (filePath: string) => { export const showPrivacyModal = (okAction: () => void) => { window.showInformationMessage( - `${CONSTANTS.INFO.THIRD_PARTY_WEBSITE} ${CONSTANTS.LINKS.PRIVACY}`, - DialogResponses.MESSAGE_UNDERSTOOD + `${CONSTANTS.INFO.THIRD_PARTY_WEBSITE}: ${CONSTANTS.LINKS.PRIVACY}`, + DialogResponses.AGREE_AND_PROCEED, + DialogResponses.CANCEL, ) .then((privacySelection: MessageItem | undefined) => { - if (privacySelection === DialogResponses.MESSAGE_UNDERSTOOD) { + if (privacySelection === DialogResponses.AGREE_AND_PROCEED) { okAction(); + } else if (privacySelection === DialogResponses.CANCEL) { + // do nothing } - }) + }); } export const checkPythonDependency = async () => { diff --git a/src/view/components/toolbar/ToolBar.tsx b/src/view/components/toolbar/ToolBar.tsx index 0d7f7fc50..49b603574 100644 --- a/src/view/components/toolbar/ToolBar.tsx +++ b/src/view/components/toolbar/ToolBar.tsx @@ -255,14 +255,14 @@ class ToolBar extends React.Component {
{`${ - CONSTANTS.REDIRECT.description - } : \n ${CONSTANTS.REDIRECT.privacy}`}
+ CONSTANTS.REDIRECT.DESCRIPTION + } : \n ${CONSTANTS.REDIRECT.PRIVACY}`}
{`Got it`} @@ -285,7 +285,7 @@ class ToolBar extends React.Component { ); const linkAnchor = ( - Learn More + Learn More ); return this.state.doNotShowAgain ? linkAnchor : linkString; @@ -300,7 +300,7 @@ class ToolBar extends React.Component { if (this.state.doNotShowAgain) { const ref = window.document.getElementById("redirect"); if (ref) { - window.location.assign(CONSTANTS.REDIRECT.link); + window.location.assign(CONSTANTS.REDIRECT.LINK); } } }; diff --git a/src/view/constants.ts b/src/view/constants.ts index 5aef66d9d..9d353f688 100644 --- a/src/view/constants.ts +++ b/src/view/constants.ts @@ -35,11 +35,11 @@ export const CONSTANTS = { NUMERIC_SEVEN: "7" }, REDIRECT: { - link: + DESCRIPTION: + "By clicking \"Agree and Proceed\" you will be redirected to adafruit.com, a third party website not managed by Microsoft. Please note that your activity on adafruit.com is subject to Adafruit's privacy policy", + LINK: "https://learn.adafruit.com/adafruit-circuit-playground-express/circuitpython-quickstart", - privacy: "https://www.adafruit.com/privacy", - description: - "You will be redirect to adafruit.com, a website outside Microsoft. Read the privacy statement on Adafruit:" + PRIVACY: "https://www.adafruit.com/privacy" }, TOOLBAR_INFO: `Explore what's on the board:` };