diff --git a/client/gatsby-node.js b/client/gatsby-node.js index a897756686be72..a484bfdc84bd5f 100644 --- a/client/gatsby-node.js +++ b/client/gatsby-node.js @@ -143,11 +143,12 @@ exports.createPages = async function createPages({ ({ node }) => node ); - const inNextCurriculum = superBlock => - superBlockStages[SuperBlockStage.Next].includes(superBlock); + const inCurrentCurriculum = superBlock => + !superBlockStages[SuperBlockStage.Next].includes(superBlock) && + !superBlockStages[SuperBlockStage.NextEnglish].includes(superBlock); - const currentChallengeNodes = allChallengeNodes.filter( - node => !inNextCurriculum(node.challenge.superBlock) + const currentChallengeNodes = allChallengeNodes.filter(node => + inCurrentCurriculum(node.challenge.superBlock) ); const createIdToNextPathMap = nodes => diff --git a/client/i18n/locales/english/translations.json b/client/i18n/locales/english/translations.json index fa5ac4cd17a1b6..c9b4b0db1783a2 100644 --- a/client/i18n/locales/english/translations.json +++ b/client/i18n/locales/english/translations.json @@ -167,6 +167,7 @@ "interview-prep-heading": "Prepare for the developer interview job search:", "legacy-curriculum-heading": "Explore our Legacy Curriculum:", "next-heading": "Try our beta curriculum:", + "next-english-heading": "Try our latest English curriculum:", "upcoming-heading": "Upcoming curriculum:", "faq": "Frequently asked questions:", "faqs": [ diff --git a/client/src/components/Map/index.tsx b/client/src/components/Map/index.tsx index a975165d093bf2..8a0571068580e6 100644 --- a/client/src/components/Map/index.tsx +++ b/client/src/components/Map/index.tsx @@ -63,6 +63,7 @@ const superBlockHeadings: { [key in SuperBlockStage]: string } = { [SuperBlockStage.Legacy]: 'landing.legacy-curriculum-heading', [SuperBlockStage.New]: '', // TODO: add translation [SuperBlockStage.Next]: 'landing.next-heading', + [SuperBlockStage.NextEnglish]: 'landing.next-english-heading', [SuperBlockStage.Upcoming]: 'landing.upcoming-heading' }; diff --git a/e2e/landing.spec.ts b/e2e/landing.spec.ts index 36c0348ae300e3..51ac80d2e3b5ed 100644 --- a/e2e/landing.spec.ts +++ b/e2e/landing.spec.ts @@ -30,6 +30,7 @@ const superBlocks = [ intro[SuperBlocks.CollegeAlgebraPy].title, intro[SuperBlocks.FullStackDeveloper].title, intro[SuperBlocks.A2English].title, + intro[SuperBlocks.B1English].title, intro[SuperBlocks.FoundationalCSharp].title, intro[SuperBlocks.TheOdinProject].title, intro[SuperBlocks.CodingInterviewPrep].title, diff --git a/e2e/map.spec.ts b/e2e/map.spec.ts index d5907f9dd98dae..e9be991626143b 100644 --- a/e2e/map.spec.ts +++ b/e2e/map.spec.ts @@ -12,6 +12,7 @@ const superBlocksWithLinks = [ ...superBlockStages[SuperBlockStage.Core], ...superBlockStages[SuperBlockStage.Next], ...superBlockStages[SuperBlockStage.English], + ...superBlockStages[SuperBlockStage.NextEnglish], ...superBlockStages[SuperBlockStage.Professional], ...superBlockStages[SuperBlockStage.Extra], ...superBlockStages[SuperBlockStage.Legacy] diff --git a/shared/config/curriculum.test.ts b/shared/config/curriculum.test.ts index eb3cab9efd131b..e3bef69c190faf 100644 --- a/shared/config/curriculum.test.ts +++ b/shared/config/curriculum.test.ts @@ -51,6 +51,7 @@ describe('generateSuperBlockList', () => { tempSuperBlockMap[SuperBlockStage.New] = []; tempSuperBlockMap[SuperBlockStage.Upcoming] = []; tempSuperBlockMap[SuperBlockStage.Next] = []; + tempSuperBlockMap[SuperBlockStage.NextEnglish] = []; expect(result).toHaveLength(Object.values(tempSuperBlockMap).flat().length); }); }); @@ -59,19 +60,19 @@ describe('Immutability of superBlockOrder, notAuditedSuperBlocks, and flatSuperB it('should not allow modification of superBlockOrder', () => { expect(() => { superBlockStages[SuperBlockStage.Core] = []; - }).toThrowError(TypeError); + }).toThrow(TypeError); }); it('should not allow modification of notAuditedSuperBlocks', () => { expect(() => { notAuditedSuperBlocks[Languages.English] = []; - }).toThrowError(TypeError); + }).toThrow(TypeError); }); it('should not allow modification of flatSuperBlockMap', () => { expect(() => { notAuditedSuperBlocks[Languages.English] = []; - }).toThrowError(TypeError); + }).toThrow(TypeError); }); }); diff --git a/shared/config/curriculum.ts b/shared/config/curriculum.ts index 48d21adabf5166..4d91fe1cc974af 100644 --- a/shared/config/curriculum.ts +++ b/shared/config/curriculum.ts @@ -48,13 +48,15 @@ export enum SuperBlockStage { Legacy, New, Upcoming, - Next + Next, + NextEnglish } const defaultStageOrder = [ SuperBlockStage.Core, SuperBlockStage.Next, SuperBlockStage.English, + SuperBlockStage.NextEnglish, SuperBlockStage.Professional, SuperBlockStage.Extra, SuperBlockStage.Legacy @@ -65,9 +67,12 @@ export function getStageOrder({ showUpcomingChanges, showNextCurriculum }: Config): SuperBlockStage[] { + const isCurrentStage = (stage: SuperBlockStage) => + !(stage === SuperBlockStage.Next) && + !(stage === SuperBlockStage.NextEnglish); const stageOrder = showNextCurriculum ? [...defaultStageOrder] - : [...defaultStageOrder.filter(stage => stage !== SuperBlockStage.Next)]; + : [...defaultStageOrder.filter(isCurrentStage)]; if (showNewCurriculum) stageOrder.push(SuperBlockStage.New); if (showUpcomingChanges) stageOrder.push(SuperBlockStage.Upcoming); @@ -96,6 +101,7 @@ export const superBlockStages: StageMap = { ], [SuperBlockStage.Next]: [SuperBlocks.FullStackDeveloper], [SuperBlockStage.English]: [SuperBlocks.A2English], + [SuperBlockStage.NextEnglish]: [SuperBlocks.B1English], [SuperBlockStage.Professional]: [SuperBlocks.FoundationalCSharp], [SuperBlockStage.Extra]: [ SuperBlocks.TheOdinProject, @@ -109,7 +115,7 @@ export const superBlockStages: StageMap = { SuperBlocks.PythonForEverybody ], [SuperBlockStage.New]: [], - [SuperBlockStage.Upcoming]: [SuperBlocks.B1English] + [SuperBlockStage.Upcoming]: [] }; Object.freeze(superBlockStages);