From f4133ccf619c97c90c6ebd5eb648de8bb854f4e0 Mon Sep 17 00:00:00 2001 From: Manabu Matsumoto Date: Wed, 12 Jul 2023 01:33:46 +0900 Subject: [PATCH] fix(curriculum): make the title show with proper format (#50912) Co-authored-by: Oliver Eyton-Williams --- .../__snapshots__/timeline-buttons.test.js.snap | 2 +- .../src/components/profile/components/time-line.tsx | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/src/components/profile/components/__snapshots__/timeline-buttons.test.js.snap b/client/src/components/profile/components/__snapshots__/timeline-buttons.test.js.snap index 703945ba8ea..e0f44e5c27e 100644 --- a/client/src/components/profile/components/__snapshots__/timeline-buttons.test.js.snap +++ b/client/src/components/profile/components/__snapshots__/timeline-buttons.test.js.snap @@ -39,7 +39,7 @@ exports[`should check certification page consistency 1`] = ` gatsby="true" href="/learn/2022/responsive-web-design/learn-accessibility-by-building-a-quiz/step-41" > - Learn Accessibility by Building a Quiz - Step 41 + Step 41 diff --git a/client/src/components/profile/components/time-line.tsx b/client/src/components/profile/components/time-line.tsx index ab7fe1e39d7..9d5349031b4 100644 --- a/client/src/components/profile/components/time-line.tsx +++ b/client/src/components/profile/components/time-line.tsx @@ -242,6 +242,8 @@ function useIdToNameMap(t: TFunction): Map { blockName } id + superBlock + hasEditableBoundaries title } } @@ -265,15 +267,20 @@ function useIdToNameMap(t: TFunction): Map { // @ts-expect-error Graphql needs typing id, // @ts-expect-error Graphql needs typing + superBlock, + // @ts-expect-error Graphql needs typing title, // @ts-expect-error Graphql needs typing - fields: { slug, blockName } + fields: { slug, blockName }, + // @ts-expect-error Graphql needs typing + hasEditableBoundaries } } }) => { + const blockNameTitle = t(`intro:${superBlock}.blocks.${blockName}.title`); idToNameMap.set(id, { challengeTitle: `${ - title.includes('Step') ? `${blockName} - ` : '' + hasEditableBoundaries ? blockNameTitle + ' - ' : '' }${title}`, challengePath: slug });