mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-22 13:00:56 -04:00
refactor: remove release code (#57957)
This commit is contained in:
committed by
GitHub
parent
be6736f5df
commit
d68cbdb2c4
@@ -3,7 +3,6 @@ import { useTranslation } from 'react-i18next';
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { Spacer } from '@freecodecamp/ui';
|
||||
import { useFeature } from '@growthbook/growthbook-react';
|
||||
|
||||
import {
|
||||
type SuperBlocks,
|
||||
@@ -139,7 +138,6 @@ function Map({
|
||||
allChallenges
|
||||
}: MapProps): React.ReactElement {
|
||||
const { t } = useTranslation();
|
||||
const showNextCurriculum = useFeature('fcc-10').on;
|
||||
|
||||
const allSuperblockChallengesCompleted = (superblock: SuperBlocks) => {
|
||||
// array of all challenge ID's in the superblock
|
||||
@@ -168,8 +166,7 @@ function Map({
|
||||
<div className='map-ui' data-test-label='curriculum-map'>
|
||||
{getStageOrder({
|
||||
showNewCurriculum,
|
||||
showUpcomingChanges,
|
||||
showNextCurriculum
|
||||
showUpcomingChanges
|
||||
}).map(stage => (
|
||||
<Fragment key={stage}>
|
||||
<h2 className={forLanding ? 'big-heading' : ''}>
|
||||
|
||||
@@ -21,7 +21,6 @@ import {
|
||||
ChallengeMeta,
|
||||
ChallengeNode,
|
||||
CompletedChallenge,
|
||||
NavigationPaths,
|
||||
ResizeProps,
|
||||
SavedChallengeFiles,
|
||||
Test
|
||||
@@ -113,7 +112,6 @@ interface ShowClassicProps extends Pick<PreviewProps, 'previewMounted'> {
|
||||
output: string[];
|
||||
pageContext: {
|
||||
challengeMeta: ChallengeMeta;
|
||||
nextCurriculumPaths: NavigationPaths;
|
||||
projectPreview: {
|
||||
challengeData: CompletedChallenge;
|
||||
};
|
||||
@@ -208,7 +206,6 @@ function ShowClassic({
|
||||
pageContext: {
|
||||
challengeMeta,
|
||||
challengeMeta: { isFirstStep, nextChallengePath },
|
||||
nextCurriculumPaths,
|
||||
projectPreview: { challengeData }
|
||||
},
|
||||
createFiles,
|
||||
@@ -236,7 +233,6 @@ function ShowClassic({
|
||||
const isMobile = useMediaQuery({
|
||||
query: `(max-width: ${MAX_MOBILE_WIDTH}px)`
|
||||
});
|
||||
const showNextCurriculum = useFeature('fcc-10').on;
|
||||
|
||||
const guideUrl = getGuideUrl({ forumTopicId, title });
|
||||
|
||||
@@ -378,9 +374,7 @@ function ShowClassic({
|
||||
// freeform, so the preview is shown on demand.
|
||||
if (demoType === 'onLoad') openModal('projectPreview');
|
||||
const challengePaths = getChallengePaths({
|
||||
showNextCurriculum,
|
||||
currentCurriculumPaths: challengeMeta,
|
||||
nextCurriculumPaths
|
||||
currentCurriculumPaths: challengeMeta
|
||||
});
|
||||
|
||||
updateChallengeMeta({
|
||||
|
||||
@@ -9,7 +9,6 @@ import { bindActionCreators } from 'redux';
|
||||
import type { Dispatch } from 'redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { Container, Col, Row, Alert, Spacer } from '@freecodecamp/ui';
|
||||
import { useFeature } from '@growthbook/growthbook-react';
|
||||
|
||||
// Local Utilities
|
||||
import LearnLayout from '../../../components/layouts/learn';
|
||||
@@ -40,7 +39,6 @@ import {
|
||||
ChallengeNode,
|
||||
ChallengeMeta,
|
||||
CompletedChallenge,
|
||||
NavigationPaths,
|
||||
Test
|
||||
} from '../../../redux/prop-types';
|
||||
import ProjectToolPanel from '../projects/tool-panel';
|
||||
@@ -102,7 +100,6 @@ interface ShowCodeAllyProps {
|
||||
openCompletionModal: () => void;
|
||||
pageContext: {
|
||||
challengeMeta: ChallengeMeta;
|
||||
nextCurriculumPaths: NavigationPaths;
|
||||
};
|
||||
partiallyCompletedChallenges: CompletedChallenge[];
|
||||
t: TFunction;
|
||||
@@ -115,8 +112,6 @@ interface ShowCodeAllyProps {
|
||||
function ShowCodeAlly(props: ShowCodeAllyProps) {
|
||||
const container = useRef<HTMLElement>(null);
|
||||
|
||||
const showNextCurriculum = useFeature('fcc-10').on;
|
||||
|
||||
const {
|
||||
completedChallenges,
|
||||
data: {
|
||||
@@ -136,7 +131,6 @@ function ShowCodeAlly(props: ShowCodeAllyProps) {
|
||||
},
|
||||
isChallengeCompleted,
|
||||
isSignedIn,
|
||||
pageContext: { nextCurriculumPaths },
|
||||
partiallyCompletedChallenges,
|
||||
t,
|
||||
updateSolutionFormValues
|
||||
@@ -174,9 +168,7 @@ function ShowCodeAlly(props: ShowCodeAllyProps) {
|
||||
} = props;
|
||||
initTests(tests);
|
||||
const challengePaths = getChallengePaths({
|
||||
showNextCurriculum,
|
||||
currentCurriculumPaths: challengeMeta,
|
||||
nextCurriculumPaths
|
||||
currentCurriculumPaths: challengeMeta
|
||||
});
|
||||
updateChallengeMeta({
|
||||
...challengeMeta,
|
||||
|
||||
@@ -11,7 +11,6 @@ import type { Dispatch } from 'redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { Container, Col, Alert, Row, Button, Spacer } from '@freecodecamp/ui';
|
||||
import { micromark } from 'micromark';
|
||||
import { useFeature } from '@growthbook/growthbook-react';
|
||||
|
||||
// Local Utilities
|
||||
import LearnLayout from '../../../components/layouts/learn';
|
||||
@@ -47,7 +46,6 @@ import {
|
||||
CompletedChallenge,
|
||||
UserExamQuestion,
|
||||
UserExam,
|
||||
NavigationPaths,
|
||||
GeneratedExamResults,
|
||||
GeneratedExamQuestion,
|
||||
PrerequisiteChallenge,
|
||||
@@ -130,7 +128,6 @@ interface ShowExamProps {
|
||||
closeFinishExamModal: () => void;
|
||||
pageContext: {
|
||||
challengeMeta: ChallengeMeta;
|
||||
nextCurriculumPaths: NavigationPaths;
|
||||
};
|
||||
t: TFunction;
|
||||
startExam: () => void;
|
||||
@@ -168,13 +165,11 @@ function ShowExam(props: ShowExamProps) {
|
||||
isChallengeCompleted,
|
||||
openExitExamModal,
|
||||
openFinishExamModal,
|
||||
pageContext: { nextCurriculumPaths },
|
||||
t
|
||||
} = props;
|
||||
|
||||
let timerInterval: NodeJS.Timeout;
|
||||
|
||||
const showNextCurriculum = useFeature('fcc-10').on;
|
||||
const container = useRef<HTMLElement>(null);
|
||||
|
||||
const [examTimeInSeconds, setExamTimeInSeconds] = useState(0);
|
||||
@@ -205,9 +200,7 @@ function ShowExam(props: ShowExamProps) {
|
||||
} = props;
|
||||
initTests(tests);
|
||||
const challengePaths = getChallengePaths({
|
||||
showNextCurriculum,
|
||||
currentCurriculumPaths: challengeMeta,
|
||||
nextCurriculumPaths
|
||||
currentCurriculumPaths: challengeMeta
|
||||
});
|
||||
updateChallengeMeta({
|
||||
...challengeMeta,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Package Utilities
|
||||
import { graphql } from 'gatsby';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { useFeature } from '@growthbook/growthbook-react';
|
||||
import Helmet from 'react-helmet';
|
||||
import { ObserveKeys } from 'react-hotkeys';
|
||||
import type { TFunction } from 'i18next';
|
||||
@@ -15,12 +14,7 @@ import ShortcutsModal from '../components/shortcuts-modal';
|
||||
|
||||
// Local Utilities
|
||||
import LearnLayout from '../../../components/layouts/learn';
|
||||
import {
|
||||
ChallengeNode,
|
||||
ChallengeMeta,
|
||||
NavigationPaths,
|
||||
Test
|
||||
} from '../../../redux/prop-types';
|
||||
import { ChallengeNode, ChallengeMeta, Test } from '../../../redux/prop-types';
|
||||
import Hotkeys from '../components/hotkeys';
|
||||
import ChallengeTitle from '../components/challenge-title';
|
||||
import ChallegeExplanation from '../components/challenge-explanation';
|
||||
@@ -72,7 +66,6 @@ interface ShowFillInTheBlankProps {
|
||||
openHelpModal: () => void;
|
||||
pageContext: {
|
||||
challengeMeta: ChallengeMeta;
|
||||
nextCurriculumPaths: NavigationPaths;
|
||||
};
|
||||
t: TFunction;
|
||||
updateChallengeMeta: (arg0: ChallengeMeta) => void;
|
||||
@@ -102,7 +95,7 @@ const ShowFillInTheBlank = ({
|
||||
openHelpModal,
|
||||
updateChallengeMeta,
|
||||
openCompletionModal,
|
||||
pageContext: { challengeMeta, nextCurriculumPaths },
|
||||
pageContext: { challengeMeta },
|
||||
isChallengeCompleted
|
||||
}: ShowFillInTheBlankProps) => {
|
||||
const { t } = useTranslation();
|
||||
@@ -117,14 +110,11 @@ const ShowFillInTheBlank = ({
|
||||
const [showFeedback, setShowFeedback] = useState(false);
|
||||
|
||||
const container = useRef<HTMLElement | null>(null);
|
||||
const showNextCurriculum = useFeature('fcc-10').on;
|
||||
|
||||
useEffect(() => {
|
||||
initTests(tests);
|
||||
const challengePaths = getChallengePaths({
|
||||
showNextCurriculum,
|
||||
currentCurriculumPaths: challengeMeta,
|
||||
nextCurriculumPaths
|
||||
currentCurriculumPaths: challengeMeta
|
||||
});
|
||||
updateChallengeMeta({
|
||||
...challengeMeta,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { graphql } from 'gatsby';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { useFeature } from '@growthbook/growthbook-react';
|
||||
import Helmet from 'react-helmet';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { connect } from 'react-redux';
|
||||
@@ -9,12 +8,7 @@ import { isEqual } from 'lodash';
|
||||
|
||||
// Local Utilities
|
||||
import LearnLayout from '../../../components/layouts/learn';
|
||||
import {
|
||||
ChallengeNode,
|
||||
ChallengeMeta,
|
||||
NavigationPaths,
|
||||
Test
|
||||
} from '../../../redux/prop-types';
|
||||
import { ChallengeNode, ChallengeMeta, Test } from '../../../redux/prop-types';
|
||||
import ChallengeDescription from '../components/challenge-description';
|
||||
import Hotkeys from '../components/hotkeys';
|
||||
import ChallengeTitle from '../components/challenge-title';
|
||||
@@ -66,7 +60,6 @@ interface ShowQuizProps {
|
||||
openHelpModal: () => void;
|
||||
pageContext: {
|
||||
challengeMeta: ChallengeMeta;
|
||||
nextCurriculumPaths: NavigationPaths;
|
||||
};
|
||||
updateChallengeMeta: (arg0: ChallengeMeta) => void;
|
||||
updateSolutionFormValues: () => void;
|
||||
@@ -97,7 +90,7 @@ const ShowGeneric = ({
|
||||
}
|
||||
}
|
||||
},
|
||||
pageContext: { challengeMeta, nextCurriculumPaths },
|
||||
pageContext: { challengeMeta },
|
||||
initTests,
|
||||
updateChallengeMeta,
|
||||
openCompletionModal,
|
||||
@@ -114,9 +107,7 @@ const ShowGeneric = ({
|
||||
useEffect(() => {
|
||||
initTests(tests);
|
||||
const challengePaths = getChallengePaths({
|
||||
showNextCurriculum,
|
||||
currentCurriculumPaths: challengeMeta,
|
||||
nextCurriculumPaths
|
||||
currentCurriculumPaths: challengeMeta
|
||||
});
|
||||
updateChallengeMeta({
|
||||
...challengeMeta,
|
||||
@@ -161,8 +152,6 @@ const ShowGeneric = ({
|
||||
|
||||
const [showFeedback, setShowFeedback] = useState(false);
|
||||
|
||||
const showNextCurriculum = useFeature('fcc-10').on;
|
||||
|
||||
const handleMcqOptionChange = (
|
||||
questionIndex: number,
|
||||
answerIndex: number
|
||||
|
||||
@@ -7,16 +7,10 @@ import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import type { Dispatch } from 'redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { useFeature } from '@growthbook/growthbook-react';
|
||||
|
||||
import { Container, Col, Row, Button, Spacer } from '@freecodecamp/ui';
|
||||
import LearnLayout from '../../../components/layouts/learn';
|
||||
import {
|
||||
ChallengeNode,
|
||||
ChallengeMeta,
|
||||
NavigationPaths,
|
||||
Test
|
||||
} from '../../../redux/prop-types';
|
||||
import { ChallengeNode, ChallengeMeta, Test } from '../../../redux/prop-types';
|
||||
import ChallengeDescription from '../components/challenge-description';
|
||||
import Hotkeys from '../components/hotkeys';
|
||||
import ChallengeTitle from '../components/challenge-title';
|
||||
@@ -83,7 +77,6 @@ interface MsTrophyProps {
|
||||
openHelpModal: () => void;
|
||||
pageContext: {
|
||||
challengeMeta: ChallengeMeta;
|
||||
nextCurriculumPaths: NavigationPaths;
|
||||
};
|
||||
submitChallenge: () => void;
|
||||
t: TFunction;
|
||||
@@ -91,7 +84,6 @@ interface MsTrophyProps {
|
||||
}
|
||||
|
||||
function MsTrophy(props: MsTrophyProps) {
|
||||
const showNextCurriculum = useFeature('fcc-10').on;
|
||||
const container = useRef<HTMLElement>(null);
|
||||
const {
|
||||
data: {
|
||||
@@ -113,15 +105,13 @@ function MsTrophy(props: MsTrophyProps) {
|
||||
}
|
||||
}
|
||||
},
|
||||
pageContext: { challengeMeta, nextCurriculumPaths },
|
||||
pageContext: { challengeMeta },
|
||||
initTests,
|
||||
updateChallengeMeta
|
||||
} = props;
|
||||
initTests(tests);
|
||||
const challengePaths = getChallengePaths({
|
||||
showNextCurriculum,
|
||||
currentCurriculumPaths: challengeMeta,
|
||||
nextCurriculumPaths
|
||||
currentCurriculumPaths: challengeMeta
|
||||
});
|
||||
updateChallengeMeta({
|
||||
...challengeMeta,
|
||||
|
||||
@@ -6,14 +6,12 @@ import type { TFunction } from 'i18next';
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { Container, Col, Row, Spacer } from '@freecodecamp/ui';
|
||||
import { useFeature } from '@growthbook/growthbook-react';
|
||||
|
||||
import LearnLayout from '../../../../components/layouts/learn';
|
||||
import { isSignedInSelector } from '../../../../redux/selectors';
|
||||
import {
|
||||
ChallengeMeta,
|
||||
ChallengeNode,
|
||||
NavigationPaths,
|
||||
Test
|
||||
} from '../../../../redux/prop-types';
|
||||
import ChallengeDescription from '../../components/challenge-description';
|
||||
@@ -87,7 +85,6 @@ interface BackEndProps {
|
||||
output: string[];
|
||||
pageContext: {
|
||||
challengeMeta: ChallengeMeta;
|
||||
nextCurriculumPaths: NavigationPaths;
|
||||
};
|
||||
t: TFunction;
|
||||
tests: Test[];
|
||||
@@ -97,7 +94,6 @@ interface BackEndProps {
|
||||
}
|
||||
|
||||
const ShowBackEnd = (props: BackEndProps) => {
|
||||
const showNextCurriculum = useFeature('fcc-10').on;
|
||||
const container = useRef<HTMLElement>(null);
|
||||
|
||||
const handleSubmit = ({
|
||||
@@ -124,14 +120,12 @@ const ShowBackEnd = (props: BackEndProps) => {
|
||||
}
|
||||
}
|
||||
},
|
||||
pageContext: { challengeMeta, nextCurriculumPaths }
|
||||
pageContext: { challengeMeta }
|
||||
} = props;
|
||||
initConsole();
|
||||
initTests(tests);
|
||||
const challengePaths = getChallengePaths({
|
||||
showNextCurriculum,
|
||||
currentCurriculumPaths: challengeMeta,
|
||||
nextCurriculumPaths
|
||||
currentCurriculumPaths: challengeMeta
|
||||
});
|
||||
updateChallengeMeta({
|
||||
...challengeMeta,
|
||||
|
||||
@@ -8,13 +8,11 @@ import { bindActionCreators } from 'redux';
|
||||
import type { Dispatch } from 'redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { Container, Col, Row, Spacer } from '@freecodecamp/ui';
|
||||
import { useFeature } from '@growthbook/growthbook-react';
|
||||
|
||||
import LearnLayout from '../../../../components/layouts/learn';
|
||||
import {
|
||||
ChallengeNode,
|
||||
ChallengeMeta,
|
||||
NavigationPaths,
|
||||
Test
|
||||
} from '../../../../redux/prop-types';
|
||||
import ChallengeDescription from '../../components/challenge-description';
|
||||
@@ -64,7 +62,6 @@ interface ProjectProps {
|
||||
openCompletionModal: () => void;
|
||||
pageContext: {
|
||||
challengeMeta: ChallengeMeta;
|
||||
nextCurriculumPaths: NavigationPaths;
|
||||
};
|
||||
t: TFunction;
|
||||
updateChallengeMeta: (arg0: ChallengeMeta) => void;
|
||||
@@ -82,7 +79,6 @@ const ShowFrontEndProject = (props: ProjectProps) => {
|
||||
}
|
||||
};
|
||||
|
||||
const showNextCurriculum = useFeature('fcc-10').on;
|
||||
const container = useRef<HTMLElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -93,15 +89,13 @@ const ShowFrontEndProject = (props: ProjectProps) => {
|
||||
challenge: { fields, title, challengeType, helpCategory }
|
||||
}
|
||||
},
|
||||
pageContext: { challengeMeta, nextCurriculumPaths },
|
||||
pageContext: { challengeMeta },
|
||||
initTests,
|
||||
updateChallengeMeta
|
||||
} = props;
|
||||
initTests(fields.tests);
|
||||
const challengePaths = getChallengePaths({
|
||||
showNextCurriculum,
|
||||
currentCurriculumPaths: challengeMeta,
|
||||
nextCurriculumPaths
|
||||
currentCurriculumPaths: challengeMeta
|
||||
});
|
||||
updateChallengeMeta({
|
||||
...challengeMeta,
|
||||
|
||||
@@ -17,17 +17,11 @@ import {
|
||||
useQuiz,
|
||||
Spacer
|
||||
} from '@freecodecamp/ui';
|
||||
import { useFeature } from '@growthbook/growthbook-react';
|
||||
|
||||
// Local Utilities
|
||||
import { shuffleArray } from '../../../../../shared/utils/shuffle-array';
|
||||
import LearnLayout from '../../../components/layouts/learn';
|
||||
import {
|
||||
ChallengeNode,
|
||||
ChallengeMeta,
|
||||
NavigationPaths,
|
||||
Test
|
||||
} from '../../../redux/prop-types';
|
||||
import { ChallengeNode, ChallengeMeta, Test } from '../../../redux/prop-types';
|
||||
import ChallengeDescription from '../components/challenge-description';
|
||||
import Hotkeys from '../components/hotkeys';
|
||||
import ChallengeTitle from '../components/challenge-title';
|
||||
@@ -81,7 +75,6 @@ interface ShowQuizProps {
|
||||
isChallengeCompleted: boolean;
|
||||
pageContext: {
|
||||
challengeMeta: ChallengeMeta;
|
||||
nextCurriculumPaths: NavigationPaths;
|
||||
};
|
||||
updateChallengeMeta: (arg0: ChallengeMeta) => void;
|
||||
updateSolutionFormValues: () => void;
|
||||
@@ -109,7 +102,7 @@ const ShowQuiz = ({
|
||||
}
|
||||
}
|
||||
},
|
||||
pageContext: { challengeMeta, nextCurriculumPaths },
|
||||
pageContext: { challengeMeta },
|
||||
initTests,
|
||||
updateChallengeMeta,
|
||||
isChallengeCompleted,
|
||||
@@ -134,7 +127,6 @@ const ShowQuiz = ({
|
||||
const [showUnanswered, setShowUnanswered] = useState(false);
|
||||
|
||||
const [exitConfirmed, setExitConfirmed] = useState(false);
|
||||
const showNextCurriculum = useFeature('fcc-10').on;
|
||||
|
||||
const blockNameTitle = `${t(
|
||||
`intro:${superBlock}.blocks.${block}.title`
|
||||
@@ -199,9 +191,7 @@ const ShowQuiz = ({
|
||||
useEffect(() => {
|
||||
initTests(tests);
|
||||
const challengePaths = getChallengePaths({
|
||||
showNextCurriculum,
|
||||
currentCurriculumPaths: challengeMeta,
|
||||
nextCurriculumPaths
|
||||
currentCurriculumPaths: challengeMeta
|
||||
});
|
||||
updateChallengeMeta({
|
||||
...challengeMeta,
|
||||
|
||||
@@ -1,23 +1,12 @@
|
||||
import { NavigationPaths } from '../../../redux/prop-types';
|
||||
|
||||
export const getChallengePaths = ({
|
||||
showNextCurriculum,
|
||||
currentCurriculumPaths,
|
||||
nextCurriculumPaths
|
||||
currentCurriculumPaths
|
||||
}: {
|
||||
showNextCurriculum: boolean;
|
||||
currentCurriculumPaths: NavigationPaths;
|
||||
nextCurriculumPaths: NavigationPaths;
|
||||
}): NavigationPaths => {
|
||||
const nextChallengePath = showNextCurriculum
|
||||
? nextCurriculumPaths.nextChallengePath
|
||||
: currentCurriculumPaths.nextChallengePath;
|
||||
|
||||
const prevChallengePath = showNextCurriculum
|
||||
? nextCurriculumPaths.prevChallengePath
|
||||
: currentCurriculumPaths.prevChallengePath;
|
||||
return {
|
||||
nextChallengePath,
|
||||
prevChallengePath
|
||||
nextChallengePath: currentCurriculumPaths.nextChallengePath,
|
||||
prevChallengePath: currentCurriculumPaths.prevChallengePath
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user