Skip to content

Commit d68cbdb

Browse files
refactor: remove release code (freeCodeCamp#57957)
1 parent be6736f commit d68cbdb

File tree

16 files changed

+35
-177
lines changed

16 files changed

+35
-177
lines changed

client/gatsby-node.js

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ const uniq = require('lodash/uniq');
55
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
66
const webpack = require('webpack');
77

8-
const {
9-
superBlockStages,
10-
SuperBlockStage
11-
} = require('../shared/config/curriculum');
128
const env = require('./config/env.json');
139
const {
1410
createChallengePages,
@@ -143,14 +139,6 @@ exports.createPages = async function createPages({
143139
({ node }) => node
144140
);
145141

146-
const inCurrentCurriculum = superBlock =>
147-
!superBlockStages[SuperBlockStage.Next].includes(superBlock) &&
148-
!superBlockStages[SuperBlockStage.NextEnglish].includes(superBlock);
149-
150-
const currentChallengeNodes = allChallengeNodes.filter(node =>
151-
inCurrentCurriculum(node.challenge.superBlock)
152-
);
153-
154142
const createIdToNextPathMap = nodes =>
155143
nodes.reduce((map, node, index) => {
156144
const nextNode = nodes[index + 1];
@@ -167,25 +155,17 @@ exports.createPages = async function createPages({
167155
return map;
168156
}, {});
169157

170-
const idToNextPathCurrentCurriculum = createIdToNextPathMap(
171-
currentChallengeNodes
172-
);
173-
174-
const idToPrevPathCurrentCurriculum = createIdToPrevPathMap(
175-
currentChallengeNodes
176-
);
177-
178-
const idToNextPathNextCurriculum = createIdToNextPathMap(allChallengeNodes);
158+
const idToNextPathCurrentCurriculum =
159+
createIdToNextPathMap(allChallengeNodes);
179160

180-
const idToPrevPathNextCurriculum = createIdToPrevPathMap(allChallengeNodes);
161+
const idToPrevPathCurrentCurriculum =
162+
createIdToPrevPathMap(allChallengeNodes);
181163

182164
// Create challenge pages.
183165
result.data.allChallengeNode.edges.forEach(
184166
createChallengePages(createPage, {
185167
idToNextPathCurrentCurriculum,
186-
idToPrevPathCurrentCurriculum,
187-
idToNextPathNextCurriculum,
188-
idToPrevPathNextCurriculum
168+
idToPrevPathCurrentCurriculum
189169
})
190170
);
191171

client/src/components/Map/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { useTranslation } from 'react-i18next';
33
import { connect } from 'react-redux';
44
import { createSelector } from 'reselect';
55
import { Spacer } from '@freecodecamp/ui';
6-
import { useFeature } from '@growthbook/growthbook-react';
76

87
import {
98
type SuperBlocks,
@@ -139,7 +138,6 @@ function Map({
139138
allChallenges
140139
}: MapProps): React.ReactElement {
141140
const { t } = useTranslation();
142-
const showNextCurriculum = useFeature('fcc-10').on;
143141

144142
const allSuperblockChallengesCompleted = (superblock: SuperBlocks) => {
145143
// array of all challenge ID's in the superblock
@@ -168,8 +166,7 @@ function Map({
168166
<div className='map-ui' data-test-label='curriculum-map'>
169167
{getStageOrder({
170168
showNewCurriculum,
171-
showUpcomingChanges,
172-
showNextCurriculum
169+
showUpcomingChanges
173170
}).map(stage => (
174171
<Fragment key={stage}>
175172
<h2 className={forLanding ? 'big-heading' : ''}>

client/src/templates/Challenges/classic/show.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
ChallengeMeta,
2222
ChallengeNode,
2323
CompletedChallenge,
24-
NavigationPaths,
2524
ResizeProps,
2625
SavedChallengeFiles,
2726
Test
@@ -113,7 +112,6 @@ interface ShowClassicProps extends Pick<PreviewProps, 'previewMounted'> {
113112
output: string[];
114113
pageContext: {
115114
challengeMeta: ChallengeMeta;
116-
nextCurriculumPaths: NavigationPaths;
117115
projectPreview: {
118116
challengeData: CompletedChallenge;
119117
};
@@ -208,7 +206,6 @@ function ShowClassic({
208206
pageContext: {
209207
challengeMeta,
210208
challengeMeta: { isFirstStep, nextChallengePath },
211-
nextCurriculumPaths,
212209
projectPreview: { challengeData }
213210
},
214211
createFiles,
@@ -236,7 +233,6 @@ function ShowClassic({
236233
const isMobile = useMediaQuery({
237234
query: `(max-width: ${MAX_MOBILE_WIDTH}px)`
238235
});
239-
const showNextCurriculum = useFeature('fcc-10').on;
240236

241237
const guideUrl = getGuideUrl({ forumTopicId, title });
242238

@@ -378,9 +374,7 @@ function ShowClassic({
378374
// freeform, so the preview is shown on demand.
379375
if (demoType === 'onLoad') openModal('projectPreview');
380376
const challengePaths = getChallengePaths({
381-
showNextCurriculum,
382-
currentCurriculumPaths: challengeMeta,
383-
nextCurriculumPaths
377+
currentCurriculumPaths: challengeMeta
384378
});
385379

386380
updateChallengeMeta({

client/src/templates/Challenges/codeally/show.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { bindActionCreators } from 'redux';
99
import type { Dispatch } from 'redux';
1010
import { createSelector } from 'reselect';
1111
import { Container, Col, Row, Alert, Spacer } from '@freecodecamp/ui';
12-
import { useFeature } from '@growthbook/growthbook-react';
1312

1413
// Local Utilities
1514
import LearnLayout from '../../../components/layouts/learn';
@@ -40,7 +39,6 @@ import {
4039
ChallengeNode,
4140
ChallengeMeta,
4241
CompletedChallenge,
43-
NavigationPaths,
4442
Test
4543
} from '../../../redux/prop-types';
4644
import ProjectToolPanel from '../projects/tool-panel';
@@ -102,7 +100,6 @@ interface ShowCodeAllyProps {
102100
openCompletionModal: () => void;
103101
pageContext: {
104102
challengeMeta: ChallengeMeta;
105-
nextCurriculumPaths: NavigationPaths;
106103
};
107104
partiallyCompletedChallenges: CompletedChallenge[];
108105
t: TFunction;
@@ -115,8 +112,6 @@ interface ShowCodeAllyProps {
115112
function ShowCodeAlly(props: ShowCodeAllyProps) {
116113
const container = useRef<HTMLElement>(null);
117114

118-
const showNextCurriculum = useFeature('fcc-10').on;
119-
120115
const {
121116
completedChallenges,
122117
data: {
@@ -136,7 +131,6 @@ function ShowCodeAlly(props: ShowCodeAllyProps) {
136131
},
137132
isChallengeCompleted,
138133
isSignedIn,
139-
pageContext: { nextCurriculumPaths },
140134
partiallyCompletedChallenges,
141135
t,
142136
updateSolutionFormValues
@@ -174,9 +168,7 @@ function ShowCodeAlly(props: ShowCodeAllyProps) {
174168
} = props;
175169
initTests(tests);
176170
const challengePaths = getChallengePaths({
177-
showNextCurriculum,
178-
currentCurriculumPaths: challengeMeta,
179-
nextCurriculumPaths
171+
currentCurriculumPaths: challengeMeta
180172
});
181173
updateChallengeMeta({
182174
...challengeMeta,

client/src/templates/Challenges/exam/show.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import type { Dispatch } from 'redux';
1111
import { createSelector } from 'reselect';
1212
import { Container, Col, Alert, Row, Button, Spacer } from '@freecodecamp/ui';
1313
import { micromark } from 'micromark';
14-
import { useFeature } from '@growthbook/growthbook-react';
1514

1615
// Local Utilities
1716
import LearnLayout from '../../../components/layouts/learn';
@@ -47,7 +46,6 @@ import {
4746
CompletedChallenge,
4847
UserExamQuestion,
4948
UserExam,
50-
NavigationPaths,
5149
GeneratedExamResults,
5250
GeneratedExamQuestion,
5351
PrerequisiteChallenge,
@@ -130,7 +128,6 @@ interface ShowExamProps {
130128
closeFinishExamModal: () => void;
131129
pageContext: {
132130
challengeMeta: ChallengeMeta;
133-
nextCurriculumPaths: NavigationPaths;
134131
};
135132
t: TFunction;
136133
startExam: () => void;
@@ -168,13 +165,11 @@ function ShowExam(props: ShowExamProps) {
168165
isChallengeCompleted,
169166
openExitExamModal,
170167
openFinishExamModal,
171-
pageContext: { nextCurriculumPaths },
172168
t
173169
} = props;
174170

175171
let timerInterval: NodeJS.Timeout;
176172

177-
const showNextCurriculum = useFeature('fcc-10').on;
178173
const container = useRef<HTMLElement>(null);
179174

180175
const [examTimeInSeconds, setExamTimeInSeconds] = useState(0);
@@ -205,9 +200,7 @@ function ShowExam(props: ShowExamProps) {
205200
} = props;
206201
initTests(tests);
207202
const challengePaths = getChallengePaths({
208-
showNextCurriculum,
209-
currentCurriculumPaths: challengeMeta,
210-
nextCurriculumPaths
203+
currentCurriculumPaths: challengeMeta
211204
});
212205
updateChallengeMeta({
213206
...challengeMeta,

client/src/templates/Challenges/fill-in-the-blank/show.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Package Utilities
22
import { graphql } from 'gatsby';
33
import React, { useEffect, useRef, useState } from 'react';
4-
import { useFeature } from '@growthbook/growthbook-react';
54
import Helmet from 'react-helmet';
65
import { ObserveKeys } from 'react-hotkeys';
76
import type { TFunction } from 'i18next';
@@ -15,12 +14,7 @@ import ShortcutsModal from '../components/shortcuts-modal';
1514

1615
// Local Utilities
1716
import LearnLayout from '../../../components/layouts/learn';
18-
import {
19-
ChallengeNode,
20-
ChallengeMeta,
21-
NavigationPaths,
22-
Test
23-
} from '../../../redux/prop-types';
17+
import { ChallengeNode, ChallengeMeta, Test } from '../../../redux/prop-types';
2418
import Hotkeys from '../components/hotkeys';
2519
import ChallengeTitle from '../components/challenge-title';
2620
import ChallegeExplanation from '../components/challenge-explanation';
@@ -72,7 +66,6 @@ interface ShowFillInTheBlankProps {
7266
openHelpModal: () => void;
7367
pageContext: {
7468
challengeMeta: ChallengeMeta;
75-
nextCurriculumPaths: NavigationPaths;
7669
};
7770
t: TFunction;
7871
updateChallengeMeta: (arg0: ChallengeMeta) => void;
@@ -102,7 +95,7 @@ const ShowFillInTheBlank = ({
10295
openHelpModal,
10396
updateChallengeMeta,
10497
openCompletionModal,
105-
pageContext: { challengeMeta, nextCurriculumPaths },
98+
pageContext: { challengeMeta },
10699
isChallengeCompleted
107100
}: ShowFillInTheBlankProps) => {
108101
const { t } = useTranslation();
@@ -117,14 +110,11 @@ const ShowFillInTheBlank = ({
117110
const [showFeedback, setShowFeedback] = useState(false);
118111

119112
const container = useRef<HTMLElement | null>(null);
120-
const showNextCurriculum = useFeature('fcc-10').on;
121113

122114
useEffect(() => {
123115
initTests(tests);
124116
const challengePaths = getChallengePaths({
125-
showNextCurriculum,
126-
currentCurriculumPaths: challengeMeta,
127-
nextCurriculumPaths
117+
currentCurriculumPaths: challengeMeta
128118
});
129119
updateChallengeMeta({
130120
...challengeMeta,

client/src/templates/Challenges/generic/show.tsx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { graphql } from 'gatsby';
22
import React, { useEffect, useRef, useState } from 'react';
3-
import { useFeature } from '@growthbook/growthbook-react';
43
import Helmet from 'react-helmet';
54
import { useTranslation } from 'react-i18next';
65
import { connect } from 'react-redux';
@@ -9,12 +8,7 @@ import { isEqual } from 'lodash';
98

109
// Local Utilities
1110
import LearnLayout from '../../../components/layouts/learn';
12-
import {
13-
ChallengeNode,
14-
ChallengeMeta,
15-
NavigationPaths,
16-
Test
17-
} from '../../../redux/prop-types';
11+
import { ChallengeNode, ChallengeMeta, Test } from '../../../redux/prop-types';
1812
import ChallengeDescription from '../components/challenge-description';
1913
import Hotkeys from '../components/hotkeys';
2014
import ChallengeTitle from '../components/challenge-title';
@@ -66,7 +60,6 @@ interface ShowQuizProps {
6660
openHelpModal: () => void;
6761
pageContext: {
6862
challengeMeta: ChallengeMeta;
69-
nextCurriculumPaths: NavigationPaths;
7063
};
7164
updateChallengeMeta: (arg0: ChallengeMeta) => void;
7265
updateSolutionFormValues: () => void;
@@ -97,7 +90,7 @@ const ShowGeneric = ({
9790
}
9891
}
9992
},
100-
pageContext: { challengeMeta, nextCurriculumPaths },
93+
pageContext: { challengeMeta },
10194
initTests,
10295
updateChallengeMeta,
10396
openCompletionModal,
@@ -114,9 +107,7 @@ const ShowGeneric = ({
114107
useEffect(() => {
115108
initTests(tests);
116109
const challengePaths = getChallengePaths({
117-
showNextCurriculum,
118-
currentCurriculumPaths: challengeMeta,
119-
nextCurriculumPaths
110+
currentCurriculumPaths: challengeMeta
120111
});
121112
updateChallengeMeta({
122113
...challengeMeta,
@@ -161,8 +152,6 @@ const ShowGeneric = ({
161152

162153
const [showFeedback, setShowFeedback] = useState(false);
163154

164-
const showNextCurriculum = useFeature('fcc-10').on;
165-
166155
const handleMcqOptionChange = (
167156
questionIndex: number,
168157
answerIndex: number

client/src/templates/Challenges/ms-trophy/show.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,10 @@ import { connect } from 'react-redux';
77
import { bindActionCreators } from 'redux';
88
import type { Dispatch } from 'redux';
99
import { createSelector } from 'reselect';
10-
import { useFeature } from '@growthbook/growthbook-react';
1110

1211
import { Container, Col, Row, Button, Spacer } from '@freecodecamp/ui';
1312
import LearnLayout from '../../../components/layouts/learn';
14-
import {
15-
ChallengeNode,
16-
ChallengeMeta,
17-
NavigationPaths,
18-
Test
19-
} from '../../../redux/prop-types';
13+
import { ChallengeNode, ChallengeMeta, Test } from '../../../redux/prop-types';
2014
import ChallengeDescription from '../components/challenge-description';
2115
import Hotkeys from '../components/hotkeys';
2216
import ChallengeTitle from '../components/challenge-title';
@@ -83,15 +77,13 @@ interface MsTrophyProps {
8377
openHelpModal: () => void;
8478
pageContext: {
8579
challengeMeta: ChallengeMeta;
86-
nextCurriculumPaths: NavigationPaths;
8780
};
8881
submitChallenge: () => void;
8982
t: TFunction;
9083
updateChallengeMeta: (arg0: ChallengeMeta) => void;
9184
}
9285

9386
function MsTrophy(props: MsTrophyProps) {
94-
const showNextCurriculum = useFeature('fcc-10').on;
9587
const container = useRef<HTMLElement>(null);
9688
const {
9789
data: {
@@ -113,15 +105,13 @@ function MsTrophy(props: MsTrophyProps) {
113105
}
114106
}
115107
},
116-
pageContext: { challengeMeta, nextCurriculumPaths },
108+
pageContext: { challengeMeta },
117109
initTests,
118110
updateChallengeMeta
119111
} = props;
120112
initTests(tests);
121113
const challengePaths = getChallengePaths({
122-
showNextCurriculum,
123-
currentCurriculumPaths: challengeMeta,
124-
nextCurriculumPaths
114+
currentCurriculumPaths: challengeMeta
125115
});
126116
updateChallengeMeta({
127117
...challengeMeta,

0 commit comments

Comments
 (0)