Skip to content

Commit 232f6d5

Browse files
refactor: remove SHOW_NEW_CURRICULUM (freeCodeCamp#57977)
1 parent 09a5415 commit 232f6d5

15 files changed

Lines changed: 10 additions & 66 deletions

File tree

.github/workflows/node.js-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ jobs:
194194
run: |
195195
cp sample.env .env
196196
echo 'SHOW_UPCOMING_CHANGES=true' >> .env
197-
echo 'SHOW_NEW_CURRICULUM=true' >> .env
198197
cat .env
199198
200199
- name: Start MongoDB

.github/workflows/temporary-container-checks.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ jobs:
5151
--build-arg PATREON_CLIENT_ID=id_from_patreon_dashboard \
5252
--build-arg DEPLOYMENT_ENV=staging \
5353
--build-arg SHOW_UPCOMING_CHANGES=false \
54-
--build-arg SHOW_NEW_CURRICULUM=false \
5554
--build-arg GROWTHBOOK_URI=api_URI_from_Growthbook_dashboard \
5655
--build-arg FREECODECAMP_NODE_ENV=development \
5756
-f docker/web/Dockerfile .

client/src/components/Map/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ import { SuperBlockIcon } from '../../assets/superblock-icon';
1414
import LinkButton from '../../assets/icons/link-button';
1515
import { ButtonLink } from '../helpers';
1616
import { getSuperBlockTitleForMap } from '../../utils/superblock-map-titles';
17-
import {
18-
showUpcomingChanges,
19-
showNewCurriculum
20-
} from '../../../config/env.json';
17+
import { showUpcomingChanges } from '../../../config/env.json';
2118

2219
import './map.css';
2320

@@ -165,7 +162,6 @@ function Map({
165162
return (
166163
<div className='map-ui' data-test-label='curriculum-map'>
167164
{getStageOrder({
168-
showNewCurriculum,
169165
showUpcomingChanges
170166
}).map(stage => (
171167
<Fragment key={stage}>

client/tools/create-env.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ if (FREECODECAMP_NODE_ENV !== 'development') {
4949
'curriculumLocale',
5050
'deploymentEnv',
5151
'environment',
52-
'showUpcomingChanges',
53-
'showNewCurriculum'
52+
'showUpcomingChanges'
5453
];
5554
const searchKeys = ['algoliaAppId', 'algoliaAPIKey'];
5655
const donationKeys = ['stripePublicKey', 'paypalClientId', 'patreonClientId'];
@@ -114,14 +113,9 @@ if (FREECODECAMP_NODE_ENV !== 'development') {
114113
checkCurriculumLocale();
115114
if (fs.existsSync(`${configPath}/env.json`)) {
116115
/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment */
117-
const { showNewCurriculum, showUpcomingChanges } = require(
118-
`${configPath}/env.json`
119-
);
116+
const { showUpcomingChanges } = require(`${configPath}/env.json`);
120117
/* eslint-enable @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment */
121-
if (
122-
env['showUpcomingChanges'] !== showUpcomingChanges ||
123-
env['showNewCurriculum'] !== showNewCurriculum
124-
) {
118+
if (env['showUpcomingChanges'] !== showUpcomingChanges) {
125119
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
126120
console.log('Feature flags have been changed, cleaning client cache.');
127121
const child = spawn('pnpm', ['run', '-w', 'clean:client']);

client/tools/read-env.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const {
3232
PATREON_CLIENT_ID: patreonClientId,
3333
DEPLOYMENT_ENV: deploymentEnv,
3434
SHOW_UPCOMING_CHANGES: showUpcomingChanges,
35-
SHOW_NEW_CURRICULUM: showNewCurriculum,
3635
GROWTHBOOK_URI: growthbookUri
3736
} = process.env;
3837

@@ -72,7 +71,6 @@ export default Object.assign(locations, {
7271
? null
7372
: patreonClientId,
7473
showUpcomingChanges: showUpcomingChanges === 'true',
75-
showNewCurriculum: showNewCurriculum === 'true',
7674
growthbookUri:
7775
!growthbookUri || growthbookUri === 'api_URI_from_Growthbook_dashboard'
7876
? null

curriculum/get-challenges.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,7 @@ function generateChallengeCreator(lang, englishPath, i18nPath) {
341341

342342
// const superOrder = getSuperOrder(meta.superBlock);
343343
// NOTE: Use this version when a super block is in beta.
344-
const superOrder = getSuperOrder(meta.superBlock, {
345-
// switch this back to SHOW_NEW_CURRICULUM when we're ready to beta the JS superblock
346-
showNewCurriculum: process.env.SHOW_UPCOMING_CHANGES === 'true'
347-
});
344+
const superOrder = getSuperOrder(meta.superBlock);
348345
if (superOrder !== null) challenge.superOrder = superOrder;
349346
/* Since there can be more than one way to complete a certification (using the
350347
legacy curriculum or the new one, for instance), we need a certification

curriculum/test/test-challenges.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,16 +300,11 @@ function populateTestsForLang({ lang, challenges, meta, superBlocks }) {
300300
return;
301301
}
302302
it(`${superBlock} should have the same order in every meta`, function () {
303-
const firstOrder = getSuperOrder(filteredMeta[0].superBlock, {
304-
showNewCurriculum: process.env.SHOW_NEW_CURRICULUM
305-
});
303+
const firstOrder = getSuperOrder(filteredMeta[0].superBlock);
306304
assert.isNumber(firstOrder);
307305
assert.isTrue(
308306
filteredMeta.every(
309-
el =>
310-
getSuperOrder(el.superBlock, {
311-
showNewCurriculum: process.env.SHOW_NEW_CURRICULUM
312-
}) === firstOrder
307+
el => getSuperOrder(el.superBlock) === firstOrder
313308
),
314309
'The superOrder properties are mismatched.'
315310
);

curriculum/utils.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ function createSuperOrder(superBlocks) {
4343
}
4444

4545
const flatSuperBlockMap = generateSuperBlockList({
46-
showNewCurriculum: process.env.SHOW_NEW_CURRICULUM === 'true',
4746
showUpcomingChanges: process.env.SHOW_UPCOMING_CHANGES === 'true'
4847
});
4948
const superOrder = createSuperOrder(flatSuperBlockMap);

curriculum/utils.test.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,7 @@ describe('getSuperOrder', () => {
141141
});
142142

143143
it.skip('returns unique numbers for all current curriculum', () => {
144-
if (
145-
process.env.SHOW_NEW_CURRICULUM !== 'true' &&
146-
process.env.SHOW_UPCOMING_CHANGES !== 'true'
147-
) {
148-
expect.assertions(17);
149-
} else if (process.env.SHOW_NEW_CURRICULUM !== 'true') {
150-
expect.assertions(17);
151-
} else if (process.env.SHOW_UPCOMING_CHANGES !== 'true') {
144+
if (process.env.SHOW_UPCOMING_CHANGES !== 'true') {
152145
expect.assertions(17);
153146
} else {
154147
expect.assertions(19);
@@ -172,15 +165,7 @@ describe('getSuperOrder', () => {
172165
expect(getSuperOrder(SuperBlocks.RespWebDesign)).toBe(15);
173166
expect(getSuperOrder(SuperBlocks.JsAlgoDataStruct)).toBe(16);
174167

175-
if (
176-
process.env.SHOW_NEW_CURRICULUM === 'true' &&
177-
process.env.SHOW_UPCOMING_CHANGES === 'true'
178-
) {
179-
expect(getSuperOrder(SuperBlocks.TheOdinProject)).toBe(17);
180-
expect(getSuperOrder(SuperBlocks.FullStackDeveloper)).toBe(18);
181-
} else if (process.env.SHOW_NEW_CURRICULUM === 'true') {
182-
return;
183-
} else if (process.env.SHOW_UPCOMING_CHANGES === 'true') {
168+
if (process.env.SHOW_UPCOMING_CHANGES === 'true') {
184169
expect(getSuperOrder(SuperBlocks.TheOdinProject)).toBe(17);
185170
expect(getSuperOrder(SuperBlocks.FullStackDeveloper)).toBe(18);
186171
}

docker/api-server/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ RUN pnpm -F=api-server -F=tools/scripts/build -F=challenge-parser -F=curriculum
2727
# following env vars.
2828
ARG SHOW_UPCOMING_CHANGES=false
2929
ENV SHOW_UPCOMING_CHANGES=$SHOW_UPCOMING_CHANGES
30-
ARG SHOW_NEW_CURRICULUM=false
31-
ENV SHOW_NEW_CURRICULUM=$SHOW_NEW_CURRICULUM
3230
RUN pnpm build:curriculum
3331

3432
RUN pnpm build:server

0 commit comments

Comments
 (0)