fix(client): only show live certifications (#57602)

This commit is contained in:
Oliver Eyton-Williams
2024-12-18 18:44:45 +01:00
committed by GitHub
parent 91c9b10e58
commit 174eec287a
2 changed files with 34 additions and 11 deletions

View File

@@ -25,7 +25,8 @@ import {
signInLoadingSelector
} from '../../redux/selectors';
import type { ChallengeNode, User } from '../../redux/prop-types';
import { CertTitle } from '../../../config/cert-and-project-map';
import { CertTitle, liveCerts } from '../../../config/cert-and-project-map';
import { superBlockToCertMap } from '../../../../shared/config/certification-settings';
import Block from './components/block';
import CertChallenge from './components/cert-challenge';
import LegacyLinks from './components/legacy-links';
@@ -187,15 +188,9 @@ const SuperBlockIntroductionPage = (props: SuperBlockProp) => {
const i18nTitle = getSuperBlockTitleForMap(superBlock);
const superblockWithoutCert = [
SuperBlocks.RespWebDesign,
SuperBlocks.CodingInterviewPrep,
SuperBlocks.TheOdinProject,
SuperBlocks.ProjectEuler,
SuperBlocks.A2English,
SuperBlocks.RosettaCode,
SuperBlocks.PythonForEverybody
];
const showCertification = liveCerts.some(
cert => superBlockToCertMap[superBlock] === cert.certSlug
);
const superBlockWithAccordionView = [SuperBlocks.FullStackDeveloper];
const chosenBlock = getChosenBlock();
@@ -255,7 +250,7 @@ const SuperBlockIntroductionPage = (props: SuperBlockProp) => {
/>
);
})}
{!superblockWithoutCert.includes(superBlock) && (
{showCertification && (
<CertChallenge
certification={certification}
superBlock={superBlock}

View File

@@ -250,6 +250,34 @@ export const certTypeTitleMap = {
'JavaScript Algorithms and Data Structures (Beta)'
};
export const superBlockToCertMap: {
[key in SuperBlocks]: Certification | null;
} = {
[SuperBlocks.RespWebDesign]: Certification.RespWebDesign,
[SuperBlocks.JsAlgoDataStructNew]: Certification.JsAlgoDataStructNew,
[SuperBlocks.FrontEndDevLibs]: Certification.FrontEndDevLibs,
[SuperBlocks.DataVis]: Certification.DataVis,
[SuperBlocks.RelationalDb]: Certification.RelationalDb,
[SuperBlocks.BackEndDevApis]: Certification.BackEndDevApis,
[SuperBlocks.QualityAssurance]: Certification.QualityAssurance,
[SuperBlocks.SciCompPy]: Certification.SciCompPy,
[SuperBlocks.DataAnalysisPy]: Certification.DataAnalysisPy,
[SuperBlocks.InfoSec]: Certification.InfoSec,
[SuperBlocks.MachineLearningPy]: Certification.MachineLearningPy,
[SuperBlocks.CollegeAlgebraPy]: Certification.CollegeAlgebraPy,
[SuperBlocks.FoundationalCSharp]: Certification.FoundationalCSharp,
[SuperBlocks.RespWebDesignNew]: Certification.RespWebDesign,
[SuperBlocks.JsAlgoDataStruct]: Certification.JsAlgoDataStruct,
[SuperBlocks.FullStackDeveloper]: Certification.FullStackDeveloper,
[SuperBlocks.A2English]: Certification.A2English,
[SuperBlocks.B1English]: Certification.B1English,
[SuperBlocks.PythonForEverybody]: null,
[SuperBlocks.CodingInterviewPrep]: null,
[SuperBlocks.ProjectEuler]: null,
[SuperBlocks.TheOdinProject]: null,
[SuperBlocks.RosettaCode]: null
};
export type CertSlug = (typeof Certification)[keyof typeof Certification];
export const linkedInCredentialIds = {