chore(client): remove daily challenge env variables (#62105)

This commit is contained in:
Tom
2025-09-30 01:47:38 -05:00
committed by GitHub
parent 6e01904ce6
commit d7505e9833
7 changed files with 9 additions and 29 deletions
-1
View File
@@ -196,7 +196,6 @@ jobs:
PAYPAL_CLIENT_ID: ${{ secrets.PAYPAL_CLIENT_ID }}
STRIPE_PUBLIC_KEY: ${{ secrets.STRIPE_PUBLIC_KEY }}
SHOW_UPCOMING_CHANGES: ${{ vars.SHOW_UPCOMING_CHANGES || 'false' }}
SHOW_DAILY_CODING_CHALLENGES: ${{ vars.SHOW_DAILY_CODING_CHALLENGES || 'false' }}
FREECODECAMP_NODE_ENV: production
# The below is used in ecosystem.config.js file for the API -- to be removed later
DEPLOYMENT_ENV: ${{ needs.setup-jobs.outputs.tgt_env_long }}
@@ -9,8 +9,7 @@ import {
DailyCodingChallengePageContext
} from '../redux/prop-types';
import DailyCodingChallengeNotFound from '../components/daily-coding-challenge/not-found';
import FourOhFour from '../components/FourOhFour';
import { apiLocation, showDailyCodingChallenges } from '../../config/env.json';
import { apiLocation } from '../../config/env.json';
import { isValidDateString } from '../components/daily-coding-challenge/helpers';
import {
validateDailyCodingChallengeSchema,
@@ -208,10 +207,6 @@ function ShowDailyCodingChallenge(): JSX.Element {
void fetchChallenge(date);
}, [date]);
if (!showDailyCodingChallenges) {
return <FourOhFour />;
}
if (isLoading) return <Loader />;
if (!challengeFound || !challengeProps)
+7 -11
View File
@@ -12,10 +12,7 @@ import {
import { SuperBlockIcon } from '../../assets/superblock-icon';
import LinkButton from '../../assets/icons/link-button';
import { ButtonLink } from '../helpers';
import {
showUpcomingChanges,
showDailyCodingChallenges
} from '../../../config/env.json';
import { showUpcomingChanges } from '../../../config/env.json';
import DailyCodingChallengeWidget from '../daily-coding-challenge/widget';
import './map.css';
@@ -88,13 +85,12 @@ function Map({ forLanding = false }: MapProps) {
<Fragment key={stage}>
{
/* Show the daily coding challenge before the "English" curriculum */
showDailyCodingChallenges &&
stage === SuperBlockStage.English && (
<>
<DailyCodingChallengeWidget forLanding={forLanding} />
<Spacer size='m' />
</>
)
stage === SuperBlockStage.English && (
<>
<DailyCodingChallengeWidget forLanding={forLanding} />
<Spacer size='m' />
</>
)
}
<h2 className={forLanding ? 'big-heading' : ''}>
{t(superBlockHeadings[stage])}
@@ -4,16 +4,10 @@ import { Container, Col, Row, Spacer } from '@freecodecamp/ui';
import Map from '../../../components/Map';
import DailyCodingChallengeCalendar from '../../../components/daily-coding-challenge/calendar';
import DailyCodingChallengeIcon from '../../../assets/icons/daily-coding-challenge';
import FourOhFour from '../../../components/FourOhFour';
import { showDailyCodingChallenges } from '../../../../config/env.json';
function Archive(): JSX.Element {
const { t } = useTranslation();
if (!showDailyCodingChallenges) {
return <FourOhFour />;
}
return (
<Container>
<Row>
+1 -2
View File
@@ -64,8 +64,7 @@ if (FREECODECAMP_NODE_ENV !== 'development') {
'curriculumLocale',
'deploymentEnv',
'environment',
'showUpcomingChanges',
'showDailyCodingChallenges'
'showUpcomingChanges'
];
const searchKeys = ['algoliaAppId', 'algoliaAPIKey'];
const donationKeys = ['stripePublicKey', 'paypalClientId', 'patreonClientId'];
-2
View File
@@ -32,7 +32,6 @@ const {
PATREON_CLIENT_ID: patreonClientId,
DEPLOYMENT_ENV: deploymentEnv,
SHOW_UPCOMING_CHANGES: showUpcomingChanges,
SHOW_DAILY_CODING_CHALLENGES: showDailyCodingChallenges,
GROWTHBOOK_URI: growthbookUri
} = process.env;
@@ -72,7 +71,6 @@ export default Object.assign(locations, {
? null
: patreonClientId,
showUpcomingChanges: showUpcomingChanges === 'true',
showDailyCodingChallenges: showDailyCodingChallenges === 'true',
growthbookUri:
!growthbookUri || growthbookUri === 'api_URI_from_Growthbook_dashboard'
? null
-1
View File
@@ -54,7 +54,6 @@ CURRICULUM_LOCALE=english
# Show or hide WIP in progress challenges
SHOW_UPCOMING_CHANGES=false
SHOW_DAILY_CODING_CHALLENGES=true
# ---------------------
# New API