From 3aad0808edc8e93617a549b14898dac7c9faf10d Mon Sep 17 00:00:00 2001 From: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com> Date: Wed, 24 Mar 2021 14:58:13 +0000 Subject: [PATCH] fix(client): fix v7 certlocation (#41565) --- client/src/templates/Introduction/SuperBlockIntro.js | 5 +++-- .../src/templates/Introduction/components/CertChallenge.js | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client/src/templates/Introduction/SuperBlockIntro.js b/client/src/templates/Introduction/SuperBlockIntro.js index 715f22c53a..ded90364d8 100644 --- a/client/src/templates/Introduction/SuperBlockIntro.js +++ b/client/src/templates/Introduction/SuperBlockIntro.js @@ -132,7 +132,7 @@ export class SuperBlockIntroductionPage extends Component { const { data: { markdownRemark: { - frontmatter: { superBlock } + frontmatter: { superBlock, title } }, allChallengeNode: { edges } }, @@ -175,7 +175,7 @@ export class SuperBlockIntroductionPage extends Component { ))} {superBlock !== 'coding-interview-prep' && (
- +
)} @@ -216,6 +216,7 @@ export const query = graphql` markdownRemark(fields: { slug: { eq: $slug } }) { frontmatter { superBlock + title } } allChallengeNode( diff --git a/client/src/templates/Introduction/components/CertChallenge.js b/client/src/templates/Introduction/components/CertChallenge.js index 180c79d5e8..6e67a25bb6 100644 --- a/client/src/templates/Introduction/components/CertChallenge.js +++ b/client/src/templates/Introduction/components/CertChallenge.js @@ -10,10 +10,12 @@ import GreenPass from '../../../assets/icons/GreenPass'; import GreenNotCompleted from '../../../assets/icons/GreenNotCompleted'; import { userSelector } from '../../../redux'; import { User } from '../../../redux/propTypes'; +import { certMap } from '../../../resources/certAndProjectMap'; const propTypes = { superBlock: PropTypes.string, t: PropTypes.func, + title: PropTypes.string, user: User }; @@ -28,6 +30,7 @@ export class CertChallenge extends Component { const { superBlock, t, + title, user: { is2018DataVisCert, isApisMicroservicesCert, @@ -56,8 +59,9 @@ export class CertChallenge extends Component { 'machine-learning-with-python': isMachineLearningPyCertV7 }; + const cert = certMap.find(x => x.title === title); const isCertified = userCertificates[superBlock]; - const certLocation = `/certification/${username}/${superBlock}`; + const certLocation = `/certification/${username}/${cert.slug}`; const certCheckmarkStyle = { height: '40px', width: '40px' }; const i18nSuperBlock = t(`intro:${superBlock}.title`); const i18nCertText = t(`intro:misc-text.certification`, {