From f9c6535d6ec79ca360894be4edee33d8741161f0 Mon Sep 17 00:00:00 2001 From: lumi-tip Date: Thu, 26 Dec 2024 16:02:37 -0400 Subject: [PATCH 01/10] refactor to include extra-small --- .../syllabus/ProjectBoardGuidedExperience.jsx | 10 +++--- .../syllabus/ProjectInstructions.jsx | 34 ++++++++++++++++++- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/js_modules/syllabus/ProjectBoardGuidedExperience.jsx b/src/js_modules/syllabus/ProjectBoardGuidedExperience.jsx index 7640f42e6..dec5b4e23 100644 --- a/src/js_modules/syllabus/ProjectBoardGuidedExperience.jsx +++ b/src/js_modules/syllabus/ProjectBoardGuidedExperience.jsx @@ -20,6 +20,7 @@ function ProjectHeading({ currentAsset, isDelivered, handleStartLearnpack }) { const title = currentAsset?.title; const assetType = currentAsset?.asset_type; + const includesVideo = currentAsset?.intro_video_url; const assetTypeIcons = { LESSON: 'book', EXERCISE: 'strength', @@ -44,22 +45,22 @@ function ProjectHeading({ currentAsset, isDelivered, handleStartLearnpack }) { flexDirection={{ base: 'column', sm: isDelivered ? 'column' : 'row' }} > - + - + {title} - {currentAsset?.description && ( + {currentAsset?.description && includesVideo && ( {currentAsset.description} )} - + @@ -124,7 +125,6 @@ function ProjectBoardGuidedExperience({ currentAsset, handleStartLearnpack }) { gap="20px" mb={isDelivered && '1.5rem'} flexDirection={{ base: 'column', md: 'row' }} - // margin={{ base: '0px -10px', md: '0px -2rem' }} > diff --git a/src/js_modules/syllabus/ProjectInstructions.jsx b/src/js_modules/syllabus/ProjectInstructions.jsx index 146d86554..7be8edf2c 100644 --- a/src/js_modules/syllabus/ProjectInstructions.jsx +++ b/src/js_modules/syllabus/ProjectInstructions.jsx @@ -91,6 +91,7 @@ function ButtonsHandler({ currentAsset, setShowCloneModal, vendors, handleStartL const showProvisioningLinks = vendors.length > 0 && currentAsset?.gitpod && !cohortSession.available_as_saas; const isExternalExercise = currentAsset.external && currentAsset.asset_type === 'EXERCISE'; + const canSeeInstructions = variant !== 'small' || variant !== 'extra-small'; if (isExternalExercise) { return ( @@ -125,7 +126,7 @@ function ButtonsHandler({ currentAsset, setShowCloneModal, vendors, handleStartL fontWeight="500" background="gray.200" color="blue.default" - display={!isForOpenLocaly && variant !== 'small' && 'none'} + display={!isForOpenLocaly && !canSeeInstructions && 'none'} onClick={() => { if (isForOpenLocaly) setShowCloneModal(true); else scrollToMarkdown(); @@ -169,6 +170,37 @@ function ProjectInstructions({ currentAsset, variant, handleStartLearnpack }) { const startWithLearnpack = learnpackDeployUrl && cohortSession.available_as_saas && !noLearnpackIncluded.includes(currentAsset.slug); + if (variant === 'extra-small') { + return ( + + {(!isForOpenLocaly || startWithLearnpack) && ( + + )} + + + + + + + + ); + } + if (variant === 'small') { return ( <> From b4bd78f37623fb428869332a95f754453a4ccf2b Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:56:06 -0400 Subject: [PATCH 02/10] Update dashboard.json --- public/locales/en/dashboard.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/locales/en/dashboard.json b/public/locales/en/dashboard.json index b27b8bb98..1e8b3096f 100644 --- a/public/locales/en/dashboard.json +++ b/public/locales/en/dashboard.json @@ -44,7 +44,7 @@ }, "saasCohortcallToAction": { "title": "Last worked module", - "buttonText": "Retake where you left" + "buttonText": "Continue where you left" }, "cohortSideBar": { "title": "About your cohort", @@ -205,4 +205,4 @@ "title": "Welcome to 4Geeks!", "description": "Watch this short video that explains how to get the most out of 4Geeks and enhance your learning experience" } -} \ No newline at end of file +} From d0cd099ae50e3646a2fdcaa44be316b5d5333b31 Mon Sep 17 00:00:00 2001 From: lumi-tip Date: Tue, 7 Jan 2025 14:50:49 -0400 Subject: [PATCH 03/10] small changes in the button --- src/js_modules/syllabus/ProjectInstructions.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js_modules/syllabus/ProjectInstructions.jsx b/src/js_modules/syllabus/ProjectInstructions.jsx index 7be8edf2c..39eb21fdc 100644 --- a/src/js_modules/syllabus/ProjectInstructions.jsx +++ b/src/js_modules/syllabus/ProjectInstructions.jsx @@ -124,8 +124,10 @@ function ButtonsHandler({ currentAsset, setShowCloneModal, vendors, handleStartL padding="4px 8px" fontSize="14px" fontWeight="500" - background="gray.200" - color="blue.default" + background={variant === 'extra-small' ? 'none' : 'gray.200'} + color={variant === 'extra-small' ? 'white' : 'blue.default'} + _hover={variant === 'extra-small' && 'none'} + _active={variant === 'extra-small' && 'none'} display={!isForOpenLocaly && !canSeeInstructions && 'none'} onClick={() => { if (isForOpenLocaly) setShowCloneModal(true); From 7c51a960a44c51c5d7992477cb9807ea72c4d403 Mon Sep 17 00:00:00 2001 From: lumi-tip Date: Tue, 7 Jan 2025 16:37:12 -0400 Subject: [PATCH 04/10] small changes --- src/js_modules/syllabus/ProjectInstructions.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js_modules/syllabus/ProjectInstructions.jsx b/src/js_modules/syllabus/ProjectInstructions.jsx index 39eb21fdc..039b5a61c 100644 --- a/src/js_modules/syllabus/ProjectInstructions.jsx +++ b/src/js_modules/syllabus/ProjectInstructions.jsx @@ -174,7 +174,7 @@ function ProjectInstructions({ currentAsset, variant, handleStartLearnpack }) { if (variant === 'extra-small') { return ( - + {(!isForOpenLocaly || startWithLearnpack) && ( )} From adb945d2690992aacf51fe98cbacec6a16291a9f Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Wed, 8 Jan 2025 12:15:34 -0400 Subject: [PATCH 05/10] Update exercises.json --- public/locales/en/exercises.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/locales/en/exercises.json b/public/locales/en/exercises.json index 7441e20f9..0463189eb 100644 --- a/public/locales/en/exercises.json +++ b/public/locales/en/exercises.json @@ -12,9 +12,9 @@ "created": "Created by:", "description": "Choose one of the following tutorials and learn with step-by-step interactive tutorials, instant grading, and get help from Rigobot; Our internally developed AI for learning technical skills", "backToExercises": "Back to Exercises", - "direct-access-interactive": "Sign up and get access to interactive tutorial", - "direct-access-solution": "Sign up and get access to solution files and videos", - "direct-access-similar": "Signup and get access to similar projects", + "direct-access-interactive": "Sign up and get access to this free interactive tutorial", + "direct-access-solution": "Sign up and get access to solution files and videos for free", + "direct-access-similar": "Signup and get access to this project for free", "thanks": "Thanks!", "register": "Register to 4Geeks", "create-account": "Create account", From e2cf300a8545e3c8d7c07fb8a1df657364a38652 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Wed, 8 Jan 2025 12:16:42 -0400 Subject: [PATCH 06/10] Update exercises.json --- public/locales/es/exercises.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/locales/es/exercises.json b/public/locales/es/exercises.json index e85d2c5e4..abcf99388 100644 --- a/public/locales/es/exercises.json +++ b/public/locales/es/exercises.json @@ -12,9 +12,9 @@ "created": "Creado por:", "description": "Los siguientes ejercicios explican conceptos diferentes de programación y han sido publicados por miembros de BreatheCode, ahora 4Geeks, busca un ejercicio usando los filtros", "backToExercises": "Volver a ejercicios", - "direct-access-interactive": "Regístrate para obtener acceso al tutorial interactivo", - "direct-access-solution": "Regístrate para obtener acceso a archivos y video de la solución", - "direct-access-similar": "Regístrate para obtener acceso a proyectos similares", + "direct-access-interactive": "Regístrate para obtener acceso gratis al tutorial interactivo", + "direct-access-solution": "Regístrate para obtener acceso gratis a archivos y video de la solución", + "direct-access-similar": "Regístrate para obtener acceso gratis a este proyecto", "thanks": "¡Gracias!", "register": "Regístrate en 4Geeks", "create-account": "Crear cuenta", From 56e9ca8684529f8ee2e6921ae837074867104b6c Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Wed, 8 Jan 2025 14:18:59 -0500 Subject: [PATCH 07/10] Update dashboard.json --- public/locales/en/dashboard.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locales/en/dashboard.json b/public/locales/en/dashboard.json index 1e8b3096f..5facea789 100644 --- a/public/locales/en/dashboard.json +++ b/public/locales/en/dashboard.json @@ -122,7 +122,7 @@ "how-to-deliver-text": "Please submit a Github URL that points to your project as a Github repository. How to deliver projects", "handler-text": "Deliver assignment", "mandatory-message": "It looks like you need to complete at least {{count}} open projects before you can earn you certificate", - "deliver-confirm": "I confirm that this submission is entirely my own work, and I understand the consequences of violating the academy terms and conditions.", + "deliver-confirm": "I confirm that this submission is entirely my own work, and I understand the consequences of violating the terms and conditions.", "see-mandatory-projects": " See mandatory projects", "file-upload": "Upload one or more files with no more than 10MB in the following formats: ", "error-file-format": "File format is not correct.", From bfb6c130ec648042fcfe6c3bc5a47ba1fcdd4aef Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Wed, 8 Jan 2025 14:19:41 -0500 Subject: [PATCH 08/10] Update dashboard.json --- public/locales/es/dashboard.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locales/es/dashboard.json b/public/locales/es/dashboard.json index 33ef3e7f8..5bc3bea0f 100644 --- a/public/locales/es/dashboard.json +++ b/public/locales/es/dashboard.json @@ -123,7 +123,7 @@ "how-to-deliver-text": "Envíe una URL de Github que apunte a su proyecto como un repositorio de Github. Cómo entregar proyectos", "handler-text": "Entregar proyecto", "mandatory-message": "Parece que necesitas completar al menos {{count}} proyectos abiertos antes de poder obtener tu certificado.", - "deliver-confirm": "Confirmo que esta entrega es completamente mi propio trabajo y entiendo las consecuencias de violar los términos y condiciones de la academia.", + "deliver-confirm": "Confirmo que esta entrega es completamente mi propio trabajo y entiendo las consecuencias de violar los términos y condiciones.", "see-mandatory-projects": " Ver proyectos obligatorios", "file-upload": "Sube uno o más archivos con un máximo de 10 MB en los siguientes formatos: ", "error-file-format": "El formato de archivo es incorrecto.", From b5866802e866f3fa2803478872c160a0292c6cb5 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Thu, 9 Jan 2025 13:07:34 +0100 Subject: [PATCH 09/10] allow to edit on github on public assets views --- package-lock.json | 120 ++++++++++++++++++ src/pages/how-to/[slug]/index.jsx | 17 ++- .../interactive-coding-tutorial/[slug].jsx | 37 ++++-- .../interactive-exercise/[slug]/index.jsx | 60 +++++---- src/pages/lesson/[slug].jsx | 8 +- 5 files changed, 196 insertions(+), 46 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3a335a312..fee068f51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33578,6 +33578,126 @@ "type": "github", "url": "https://github.com/sponsors/wooorm" } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "13.5.3", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.5.3.tgz", + "integrity": "sha512-UpBKxu2ob9scbpJyEq/xPgpdrgBgN3aLYlxyGqlYX5/KnwpJpFuIHU2lx8upQQ7L+MEmz+fA1XSgesoK92ppwQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "13.5.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.5.3.tgz", + "integrity": "sha512-5AzM7Yx1Ky+oLY6pHs7tjONTF22JirDPd5Jw/3/NazJ73uGB05NqhGhB4SbeCchg7SlVYVBeRMrMSZwJwq/xoA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "13.5.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.5.3.tgz", + "integrity": "sha512-A/C1shbyUhj7wRtokmn73eBksjTM7fFQoY2v/0rTM5wehpkjQRLOXI8WJsag2uLhnZ4ii5OzR1rFPwoD9cvOgA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "13.5.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.5.3.tgz", + "integrity": "sha512-FubPuw/Boz8tKkk+5eOuDHOpk36F80rbgxlx4+xty/U71e3wZZxVYHfZXmf0IRToBn1Crb8WvLM9OYj/Ur815g==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "13.5.3", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.5.3.tgz", + "integrity": "sha512-DPw8nFuM1uEpbX47tM3wiXIR0Qa+atSzs9Q3peY1urkhofx44o7E1svnq+a5Q0r8lAcssLrwiM+OyJJgV/oj7g==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "13.5.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.5.3.tgz", + "integrity": "sha512-zBPSP8cHL51Gub/YV8UUePW7AVGukp2D8JU93IHbVDu2qmhFAn9LWXiOOLKplZQKxnIPUkJTQAJDCWBWU4UWUA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-ia32-msvc": { + "version": "13.5.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.5.3.tgz", + "integrity": "sha512-ONcL/lYyGUj4W37D4I2I450SZtSenmFAvapkJQNIJhrPMhzDU/AdfLkW98NvH1D2+7FXwe7yclf3+B7v28uzBQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "13.5.3", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.5.3.tgz", + "integrity": "sha512-2Vz2tYWaLqJvLcWbbTlJ5k9AN6JD7a5CN2pAeIzpbecK8ZF/yobA39cXtv6e+Z8c5UJuVOmaTldEAIxvsIux/Q==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } } } } diff --git a/src/pages/how-to/[slug]/index.jsx b/src/pages/how-to/[slug]/index.jsx index d326d0449..c5e211947 100644 --- a/src/pages/how-to/[slug]/index.jsx +++ b/src/pages/how-to/[slug]/index.jsx @@ -20,6 +20,7 @@ import GridContainer from '../../../common/components/GridContainer'; import MktSideRecommendations from '../../../common/components/MktSideRecommendations'; import { cleanObject } from '../../../utils/index'; import { ORIGIN_HOST, categoriesFor } from '../../../utils/variables'; +import useAuth from '../../../common/hooks/useAuth'; import useStyle from '../../../common/hooks/useStyle'; import RelatedContent from '../../../common/components/RelatedContent'; import MktEventCards from '../../../common/components/MktEventCards'; @@ -151,6 +152,7 @@ export const getStaticProps = async ({ params, locale, locales }) => { export default function HowToSlug({ data, markdown }) { const { t, lang } = useTranslation('how-to'); + const { isAuthenticated } = useAuth(); const [neverLoaded, setNeverLoaded] = useState(false); const title = data?.title || ''; const author = data?.author || ''; @@ -222,13 +224,14 @@ export default function HowToSlug({ data, markdown }) { gap="10px" paddingX="0" /> - - - - {t('common:edit-on-github')} - - - + {isAuthenticated && ( + + + + {t('common:edit-on-github')} + + + )} {title ? ( diff --git a/src/pages/interactive-coding-tutorial/[slug].jsx b/src/pages/interactive-coding-tutorial/[slug].jsx index ad9cd7c75..966b63929 100644 --- a/src/pages/interactive-coding-tutorial/[slug].jsx +++ b/src/pages/interactive-coding-tutorial/[slug].jsx @@ -9,7 +9,9 @@ import Head from 'next/head'; import Heading from '../../common/components/Heading'; import Link from '../../common/components/NextChakraLink'; import Text from '../../common/components/Text'; +import Icon from '../../common/components/Icon'; import useAuth from '../../common/hooks/useAuth'; +import useStyle from '../../common/hooks/useStyle'; import FixedBottomCta from '../../js_modules/projects/FixedBottomCta'; import SimpleTable from '../../js_modules/projects/SimpleTable'; import TabletWithForm from '../../js_modules/projects/TabletWithForm'; @@ -195,6 +197,7 @@ function TableInfo({ t, project, commonTextColor }) { function ProjectSlug({ project, markdown }) { const { t } = useTranslation('projects'); const { isAuthenticated } = useAuth(); + const { fontColor, featuredLight } = useStyle(); const [isCtaVisible, setIsCtaVisible] = useState(true); const markdownData = markdown ? getMarkDownContent(markdown) : ''; const { colorMode } = useColorMode(); @@ -257,18 +260,28 @@ function ProjectSlug({ project, markdown }) { // display={{ base: 'block', sm: 'grid' }} > - - - {`← ${t('projects:backToProjects')}`} - + + + + {`← ${t('projects:backToProjects')}`} + + {isAuthenticated && project?.readme_url && ( + + + + {t('common:edit-on-github')} + + + )} + {project?.title ? ( { if (elem && isWindow) { @@ -232,29 +232,41 @@ function Exercise({ exercise, markdown }) { position="relative" > - - {`← ${t('exercises:backToExercises')}`} - - + + + + {`← ${t('exercises:backToExercises')}`} + + + + {isAuthenticated && exercise?.readme_url && ( + + + + {t('common:edit-on-github')} + + + )} + {exercise?.title ? ( - - {lesson?.readme_url && ( + + {isAuthenticated && lesson?.readme_url && ( {t('common:edit-on-github')} )} - {isIpynb && lesson?.collab_url && lesson?.readme_url && ( + {isAuthenticated && isIpynb && lesson?.collab_url && lesson?.readme_url && ( )} From 71f8d0ed15a5cf2b20dee6d8fff2b7b1bf38e91b Mon Sep 17 00:00:00 2001 From: Gustavo Date: Thu, 9 Jan 2025 16:03:12 +0100 Subject: [PATCH 10/10] fix naming convention --- src/pages/workshops/[event_slug].jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/workshops/[event_slug].jsx b/src/pages/workshops/[event_slug].jsx index 4dbf1c08d..bd0901a1f 100644 --- a/src/pages/workshops/[event_slug].jsx +++ b/src/pages/workshops/[event_slug].jsx @@ -139,7 +139,7 @@ export const getStaticProps = async ({ params, locale }) => { }); }; -function Page({ eventData, asset }) { +function Workshop({ eventData, asset }) { const { t } = useTranslation('workshops'); const { userSession } = useContext(SessionContext); const [users, setUsers] = useState([]); @@ -1129,13 +1129,13 @@ function Page({ eventData, asset }) { ); } -Page.propTypes = { +Workshop.propTypes = { eventData: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.any])), asset: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.any])), }; -Page.defaultProps = { +Workshop.defaultProps = { eventData: {}, asset: null, }; -export default Page; +export default Workshop;