From 72a96eebcf97318e1bb5446d9839951a46a6de84 Mon Sep 17 00:00:00 2001 From: Tom <20648924+moT01@users.noreply.github.com> Date: Mon, 12 Feb 2024 10:26:33 -0600 Subject: [PATCH] feat(client): add gp instructions for rdb (#53612) Co-authored-by: Shaun Hamilton --- client/i18n/locales/english/intro.json | 2 +- client/i18n/locales/english/translations.json | 15 ++ .../growth-book/codeally-button.tsx | 18 +- .../components/growth-book/codeally-down.tsx | 26 --- .../growth-book/codeally-iframe.tsx | 21 --- client/src/components/layouts/default.tsx | 8 +- client/src/components/layouts/global.css | 7 - client/src/redux/action-types.js | 3 - client/src/redux/actions.js | 4 - client/src/redux/codeally-saga.js | 38 ---- client/src/redux/index.js | 15 -- client/src/redux/selectors.js | 4 - .../templates/Challenges/codeally/show.tsx | 173 ++++++++++++------ .../Introduction/components/legacy-links.tsx | 15 -- .../build-a-celestial-bodies-database.md | 2 +- .../build-a-number-guessing-game.md | 2 +- .../build-a-periodic-table-database.md | 2 +- .../build-a-salon-appointment-scheduler.md | 2 +- .../build-a-world-cup-database.md | 2 +- .../build-a-kitty-ipsum-translator.md | 2 +- .../build-a-bike-rental-shop.md | 2 +- .../build-a-boilerplate.md | 2 +- .../build-five-programs.md | 2 +- .../build-an-sql-reference-object.md | 2 +- .../build-a-castle.md | 2 +- .../build-a-mario-database.md | 2 +- .../build-a-student-database-part-1.md | 2 +- .../build-a-student-database-part-2.md | 2 +- cypress/e2e/default/settings/user-token.ts | 3 +- 29 files changed, 157 insertions(+), 223 deletions(-) delete mode 100644 client/src/components/growth-book/codeally-iframe.tsx delete mode 100644 client/src/redux/codeally-saga.js diff --git a/client/i18n/locales/english/intro.json b/client/i18n/locales/english/intro.json index 45d581bde43..f30305e243a 100644 --- a/client/i18n/locales/english/intro.json +++ b/client/i18n/locales/english/intro.json @@ -1449,7 +1449,7 @@ "legacy-go-back": "Go to the current version of the curriculum.", "course-maintenance": "These courses are undergoing maintenance. If they are not working, you can learn how to run them locally at <0>https://www.freecodecamp.org/news/how-to-run-freecodecamps-relational-databases-curriculum-using-docker-vscode-and-coderoad.", "course-disabling-soon": "The browser version of these courses will be temporarily disabled soon and your virtual machines will be deleted. Any progress in your virtual machines will be lost. If you have any files you want from them, you should save them to your computer. We apologize for any inconvenience. We hope to have an improved browser version of these courses available again in the next few weeks.", - "course-disabled": "These courses are temporarily unavailable to run in the browser. We apologize for any inconvenience. You can learn how to run them locally at <0>https://www.freecodecamp.org/news/how-to-run-freecodecamps-relational-databases-curriculum-using-docker-vscode-and-coderoad. We hope to have an improved browser version available again in the next few weeks.", + "course-disabled": "These courses are temporarily unavailable to run in the browser. We apologize for any inconvenience. You can learn how to run them locally at <0>https://www.freecodecamp.org/news/how-to-run-freecodecamps-relational-databases-curriculum-using-docker-vscode-and-coderoad. We hope to have an improved browser version available again soon.", "run-locally": "For now, we recommend running the courses locally on your computer. You can learn how at <0>https://www.freecodecamp.org/news/how-to-run-freecodecamps-relational-databases-curriculum-using-docker-vscode-and-coderoad.", "progress-wont-save": "Your progress will not be saved to your freeCodeCamp account when running them locally.", "go-back-to-learn": "Go back to the stable version of the curriculum.", diff --git a/client/i18n/locales/english/translations.json b/client/i18n/locales/english/translations.json index e419c72e16a..db35c513cb4 100644 --- a/client/i18n/locales/english/translations.json +++ b/client/i18n/locales/english/translations.json @@ -416,6 +416,21 @@ "help-translate-link": "Help us translate.", "project-preview-title": "Here's a preview of what you will build", "github-required": "<0>Create a GitHub account if you don't have one. You'll need it when you create the virtual Linux server machine. This process may take a few minutes.", + "gitpod": { + "intro": "This course runs in a virtual Linux machine using Gitpod. Follow these instructions to start the course:", + "step-1": "<0>Create a GitHub account if you don't have one", + "step-2": "Click the start button below", + "step-3": "Login to Gitpod with your GitHub account if you aren't already", + "step-4": "Once the virtual Linux machine is finished loading, start the CodeRoad extension by:", + "step-5": "Clicking the \"hamburger\" menu near the top left of the VSCode window,", + "step-6": "Going to the \"View\" menu,", + "step-7": "Clicking on the \"Command Palette\" option,", + "step-8": "and running the \"CodeRoad: Start\" command", + "step-9": "Follow the instructions in CodeRoad to complete the course", + "continue-project": "Clicking the button below will start a new project. If you have previously started the {{course}} course, go to <0>your Gitpod dashboard to continue.", + "learn-more": "Learn more about <0>Gitpod workspaces.", + "logout-warning": "If you log out of freeCodeCamp before you complete the entire {{course}} course, your progress will not be saved to your freeCodeCamp account." + }, "step-1": "Step 1: Complete the project", "step-2": "Step 2: Submit your code", "submit-public-url": "When you have completed the project, save all the required files into a public repository and submit the URL to it below.", diff --git a/client/src/components/growth-book/codeally-button.tsx b/client/src/components/growth-book/codeally-button.tsx index fa216d81f75..3f06bb94ff6 100644 --- a/client/src/components/growth-book/codeally-button.tsx +++ b/client/src/components/growth-book/codeally-button.tsx @@ -1,25 +1,29 @@ +import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import React from 'react'; import { useFeature } from '@growthbook/growthbook-react'; +import { useTranslation } from 'react-i18next'; import { Button } from '@freecodecamp/ui'; interface CodeAllyButtonProps { - onClick: () => void; text: string; + onClick: () => void; } export function CodeAllyButton(props: CodeAllyButtonProps): JSX.Element | null { const codeAllyDisabledFeature = useFeature('codeally_disabled'); + const { t } = useTranslation(); return ( ); } diff --git a/client/src/components/growth-book/codeally-down.tsx b/client/src/components/growth-book/codeally-down.tsx index 8a41fcad9e6..e27f9168f7f 100644 --- a/client/src/components/growth-book/codeally-down.tsx +++ b/client/src/components/growth-book/codeally-down.tsx @@ -25,29 +25,6 @@ const Down = () => { ); }; -const DisablingSoon = () => { - const { t } = useTranslation(); - return ( - -

{t('intro:misc-text.course-disabling-soon')}

- -

- - - placeholder - - -

- -

{t('intro:misc-text.progress-wont-save')}

-
- ); -}; - const Disabled = () => { const { t } = useTranslation(); return ( @@ -71,13 +48,10 @@ const Disabled = () => { export function CodeAllyDown(): JSX.Element | null { const codeAllyDownFeature = useFeature('codeally_down'); - const codeAllyDisablingSoonFeature = useFeature('codeally_disabling_soon'); const codeAllyDisabledFeature = useFeature('codeally_disabled'); return codeAllyDisabledFeature.on ? ( - ) : codeAllyDisablingSoonFeature.on ? ( - ) : codeAllyDownFeature.on ? ( ) : null; diff --git a/client/src/components/growth-book/codeally-iframe.tsx b/client/src/components/growth-book/codeally-iframe.tsx deleted file mode 100644 index 3972fa434ce..00000000000 --- a/client/src/components/growth-book/codeally-iframe.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react'; -import { useFeature } from '@growthbook/growthbook-react'; - -interface CodeAllyIframeProps { - src: string; -} - -export function CodeAllyIframe(props: CodeAllyIframeProps): JSX.Element | null { - const codeAllyDisabledFeature = useFeature('codeally_disabled'); - - return codeAllyDisabledFeature.on ? null : ( -