From 28f7417bdfea1012a6da8d4f0d01bf592d5da074 Mon Sep 17 00:00:00 2001 From: Nielda Karla <90112119+nieldakarla@users.noreply.github.com> Date: Thu, 11 Sep 2025 17:10:01 -0300 Subject: [PATCH] feat(Curriculum): Add new BlockType tags for the Language Curricula Chapter Based Certifications (#62156) Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com> --- client/i18n/locales/english/translations.json | 5 ++++- client/src/templates/Introduction/intro.css | 15 +++++++++++++++ curriculum/schema/challenge-schema.js | 5 ++++- curriculum/schema/meta-schema.js | 5 ++++- shared/config/blocks.ts | 6 +++++- tools/scripts/build/external-data-schema-v1.js | 10 ++++++++-- tools/scripts/build/external-data-schema-v2.js | 5 ++++- 7 files changed, 44 insertions(+), 7 deletions(-) diff --git a/client/i18n/locales/english/translations.json b/client/i18n/locales/english/translations.json index a77d1db7e9f..205fd0a574a 100644 --- a/client/i18n/locales/english/translations.json +++ b/client/i18n/locales/english/translations.json @@ -647,7 +647,10 @@ "lab": "Lab", "review": "Review", "quiz": "Quiz", - "exam": "Exam" + "exam": "Exam", + "warm-up": "Warm-up", + "learn": "Learn", + "practice": "Practice" } }, "donate": { diff --git a/client/src/templates/Introduction/intro.css b/client/src/templates/Introduction/intro.css index 8337f310de8..06df7472cae 100644 --- a/client/src/templates/Introduction/intro.css +++ b/client/src/templates/Introduction/intro.css @@ -61,6 +61,21 @@ color: var(--quaternary-color); } +.block-label-warm-up { + border-color: var(--yellow-color); + color: var(--yellow-color); +} + +.block-label-learn { + border-color: var(--highlight-color); + color: var(--highlight-color); +} + +.block-label-practice { + border-color: var(--success-color); + color: var(--success-color); +} + .block-header { display: flex; justify-content: space-between; diff --git a/curriculum/schema/challenge-schema.js b/curriculum/schema/challenge-schema.js index 754a8fea889..c46f53d3882 100644 --- a/curriculum/schema/challenge-schema.js +++ b/curriculum/schema/challenge-schema.js @@ -137,7 +137,10 @@ const schema = Joi.object().keys({ 'lecture', 'review', 'quiz', - 'exam' + 'exam', + 'warm-up', + 'learn', + 'practice' ).required(), otherwise: Joi.valid(null) }), diff --git a/curriculum/schema/meta-schema.js b/curriculum/schema/meta-schema.js index 65980b9a124..641945d790d 100644 --- a/curriculum/schema/meta-schema.js +++ b/curriculum/schema/meta-schema.js @@ -21,7 +21,10 @@ const schema = Joi.object() 'lecture', 'review', 'quiz', - 'exam' + 'exam', + 'warm-up', + 'learn', + 'practice' ), isUpcomingChange: Joi.boolean().required(), dashedName: Joi.string().regex(slugRE).required(), diff --git a/shared/config/blocks.ts b/shared/config/blocks.ts index 0cbfd31a9c7..70c3c568dc0 100644 --- a/shared/config/blocks.ts +++ b/shared/config/blocks.ts @@ -4,7 +4,11 @@ export enum BlockTypes { lab = 'lab', review = 'review', quiz = 'quiz', - exam = 'exam' + exam = 'exam', + /* The tags below refer to the Language Curricula chapter based certifications*/ + warmup = 'warm-up', + learn = 'learn', + practice = 'practice' } export enum BlockLayouts { diff --git a/tools/scripts/build/external-data-schema-v1.js b/tools/scripts/build/external-data-schema-v1.js index 3198a5915c0..58f6ae9cee6 100644 --- a/tools/scripts/build/external-data-schema-v1.js +++ b/tools/scripts/build/external-data-schema-v1.js @@ -1,4 +1,7 @@ const Joi = require('joi'); +const { + chapterBasedSuperBlocks +} = require('../../../shared/config/curriculum'); const blockSchema = Joi.object({}).keys({ desc: Joi.array().min(1), @@ -40,9 +43,12 @@ const blockSchema = Joi.object({}).keys({ 'lab', 'review', 'quiz', - 'exam' + 'exam', + 'warm-up', + 'learn', + 'practice' ).when('superBlock', { - is: 'full-stack-developer', + is: chapterBasedSuperBlocks, then: Joi.required(), otherwise: Joi.optional() }), diff --git a/tools/scripts/build/external-data-schema-v2.js b/tools/scripts/build/external-data-schema-v2.js index 4bd13a39f60..86df99d2398 100644 --- a/tools/scripts/build/external-data-schema-v2.js +++ b/tools/scripts/build/external-data-schema-v2.js @@ -45,7 +45,10 @@ const blockSchema = Joi.object().keys({ 'lab', 'review', 'quiz', - 'exam' + 'exam', + 'warm-up', + 'learn', + 'practice' ).when('superBlock', { is: chapterBasedSuperBlocks, then: Joi.required(),