Skip to content

Commit

Permalink
Update dictionary terms selection + modify project page updates secti…
Browse files Browse the repository at this point in the history
…ons (#1056)

* fix dictionary term and make updates section consistent

* update dictionary mock
  • Loading branch information
will0684 authored Jun 25, 2024
1 parent 463951f commit ca6ed89
Show file tree
Hide file tree
Showing 11 changed files with 156 additions and 73 deletions.
67 changes: 65 additions & 2 deletions __mocks__/mockStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,13 @@ export const dictionaryData = {
data: {
dictionaryV1List: {
items: [
{
_path:
"/content/dam/decd-endc/content-fragments/sch/dictionary/opens-in-a-new-tab",
scId: "opens-in-a-new-tab",
scTermEn: "(Opens in a new tab)",
scTermFr: "(S'ouvre dans un nouvel onglet)",
},
{
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/all",
Expand All @@ -1028,13 +1035,48 @@ export const dictionaryData = {
scTermEn: "Ended",
scTermFr: "Fin",
},
{
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/explore-other-projects",
scId: "EXPLORE-OTHER-PROJECTS",
scTermEn: "Explore other projects",
scTermFr: "Explorez d'autres projets",
},
{
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/explore-the-project",
scId: "EXPLORE-THE-PROJECT",
scTermEn: "Explore the project",
scTermFr: "Explorez le projet",
},
{
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/filter-by",
scId: "FILTER-BY",
scTermEn: "Filter by:",
scTermFr: "Filtrer par :",
},
{
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/filter-by-project",
scId: "DICTIONARY-FILTER-BY-PROJECT",
scTermEn: "Filter by project",
scTermFr: "Filtrer par projet",
},
{
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/filter-by-project-status",
scId: "DICTIONARY-FILTER-BY-PROJECT-STATUS",
scTermEn: "Filter by project status",
scTermFr: "Filtrer par état du projet",
},
{
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/last-updated",
scId: "LAST-UPDATED",
scTermEn: "Last updated:",
scTermFr: "Dernière mise à jour :",
},
{
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/on-this-page",
Expand All @@ -1060,23 +1102,44 @@ export const dictionaryData = {
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/paused",
scId: "PAUSED",
scTermEn: "Paused",
scTermEn: "Paused:",
scTermFr: "Interrompu :",
},
{
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/posted-on",
scId: "POSTED-ON",
scTermEn: "Posted on:",
scTermFr: "Publié le :",
},
{
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/project-stage",
scId: "PROJECT-STAGE",
scTermEn: "Project stage:",
scTermFr: "Phase du projet :",
},
{
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/project-updates",
scId: "PROJECT-UPDATES",
scTermEn: "project updates",
scTermFr: "Mises à jour du projet",
},
{
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/required-information",
scId: "REQUIRED-INFORMATION",
scTermEn: "Required information",
scTermFr: "Renseignements obligatoires",
},
{
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/see-all-updates-project",
scId: "DICTIONARY-SEE-ALL-UPDATES-PROJECT",
scTermEn: "See all updates about this project",
scTermFr: "Consulter toutes les mises à jour de ce projet",
},
{
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/started",
Expand All @@ -1088,7 +1151,7 @@ export const dictionaryData = {
_path:
"/content/dam/decd-endc/content-fragments/sclabs/dictionary/summary",
scId: "SUMMARY",
scTermEn: "Summary",
scTermEn: "Summary:",
scTermFr: "Résumé :",
},
{
Expand Down
8 changes: 4 additions & 4 deletions pages/projects/benefits-navigator/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export default function BenefitNavigatorArticles(props) {
} font-bold`}
>
{props.locale === "en"
? dictionary[9].scTermEn
: dictionary[9].scTermFr}
? dictionary[13].scTermEn
: dictionary[13].scTermFr}
</p>
<p className="col-span-6 col-start-7 sm:col-start-5 lg:col-span-2 md:col-start-5 mt-0">
{pageData.scDateModifiedOverwrite}
Expand All @@ -61,8 +61,8 @@ export default function BenefitNavigatorArticles(props) {
} font-bold`}
>
{props.locale === "en"
? dictionary[4].scTermEn
: dictionary[4].scTermFr}
? dictionary[8].scTermEn
: dictionary[8].scTermFr}
</p>
<p className="row-start-2 col-span-6 col-start-7 sm:col-start-5 lg:col-span-2 md:col-start-5 mt-auto">
{pageData.scDateModifiedOverwrite}
Expand Down
25 changes: 14 additions & 11 deletions pages/projects/benefits-navigator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export default function BenefitsNavigatorOverview(props) {
href={props.locale === "en" ? update.scPageNameEn : update.scPageNameFr}
description={`${
props.locale === "en"
? props.dictionary.items[9].scTermEn
: props.dictionary.items[9].scTermFr
? props.dictionary.items[13].scTermEn
: props.dictionary.items[13].scTermFr
} ${update.scDateModifiedOverwrite}`}
/>
</li>
Expand Down Expand Up @@ -622,15 +622,18 @@ export default function BenefitsNavigatorOverview(props) {
</section>
</div>

{/* Todo: add locale files and use i18next for translations */}
<h2>
{props.locale === "en"
? "Project updates"
: "Mises à jour du projet"}
</h2>
<ul className="grid lg:grid-cols-12 gap-x-4 lg:gap-y-12 list-none ml-0">
{displayProjectUpdates}
</ul>
{updatesData.length === 0 ? null : (
<section id="projectUpdates">
<h2>
{props.locale === "en"
? "Project updates"
: "Mises à jour du projet"}
</h2>
<ul className="grid lg:grid-cols-12 gap-x-4 lg:gap-y-12 list-none ml-0 mb-12">
{displayProjectUpdates}
</ul>
</section>
)}
</div>
</Layout>
</>
Expand Down
8 changes: 4 additions & 4 deletions pages/projects/dashboard/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export default function MscaDashboardArticles(props) {
} font-bold`}
>
{props.locale === "en"
? dictionary[9].scTermEn
: dictionary[9].scTermFr}
? dictionary[13].scTermEn
: dictionary[13].scTermFr}
</p>
<p className="col-span-6 col-start-7 sm:col-start-5 lg:col-span-2 md:col-start-5 mt-0">
{pageData.scDateModifiedOverwrite}
Expand All @@ -61,8 +61,8 @@ export default function MscaDashboardArticles(props) {
} font-bold`}
>
{props.locale === "en"
? dictionary[4].scTermEn
: dictionary[4].scTermFr}
? dictionary[8].scTermEn
: dictionary[8].scTermFr}
</p>
<p className="row-start-2 col-span-6 col-start-7 sm:col-start-5 lg:col-span-2 md:col-start-5 mt-auto">
{pageData.scDateModifiedOverwrite}
Expand Down
26 changes: 14 additions & 12 deletions pages/projects/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export default function MscaDashboard(props) {
href={props.locale === "en" ? update.scPageNameEn : update.scPageNameFr}
description={`${
props.locale === "en"
? props.dictionary.items[9].scTermEn
: props.dictionary.items[9].scTermFr
? props.dictionary.items[13].scTermEn
: props.dictionary.items[13].scTermFr
} ${update.scDateModifiedOverwrite}`}
/>
</li>
Expand Down Expand Up @@ -340,16 +340,18 @@ export default function MscaDashboard(props) {
excludeH1={true}
/>
</section>
<section className="layout-container">
<h2>
{props.locale === "en"
? "Project updates"
: "Mises à jour du projet"}
</h2>
<ul className="grid lg:grid-cols-12 gap-x-4 lg:gap-y-12 list-none ml-0">
{displayProjectUpdates}
</ul>
</section>
{updatesData.length === 0 ? null : (
<section id="projectUpdates" className="layout-container">
<h2>
{props.locale === "en"
? "Project updates"
: "Mises à jour du projet"}
</h2>
<ul className="grid lg:grid-cols-12 gap-x-4 lg:gap-y-12 list-none ml-0 mb-12">
{displayProjectUpdates}
</ul>
</section>
)}
</Layout>
</>
);
Expand Down
8 changes: 4 additions & 4 deletions pages/projects/digital-standards-playbook/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export default function DigitalStandardsArticles(props) {
} font-bold`}
>
{props.locale === "en"
? dictionary[9].scTermEn
: dictionary[9].scTermFr}
? dictionary[13].scTermEn
: dictionary[13].scTermFr}
</p>
<p className="col-span-6 col-start-7 sm:col-start-5 lg:col-span-2 md:col-start-5 mt-0">
{pageData.scDateModifiedOverwrite}
Expand All @@ -63,8 +63,8 @@ export default function DigitalStandardsArticles(props) {
} font-bold`}
>
{props.locale === "en"
? dictionary[4].scTermEn
: dictionary[4].scTermFr}
? dictionary[8].scTermEn
: dictionary[8].scTermFr}
</p>
<p className="row-start-2 col-span-6 col-start-7 sm:col-start-5 lg:col-span-2 md:col-start-5 mt-auto">
{pageData.scDateModifiedOverwrite}
Expand Down
26 changes: 14 additions & 12 deletions pages/projects/digital-standards-playbook/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export default function DigitalStandardsPlaybookPage(props) {
href={props.locale === "en" ? update.scPageNameEn : update.scPageNameFr}
description={`${
props.locale === "en"
? props.dictionary.items[9].scTermEn
: props.dictionary.items[9].scTermFr
? props.dictionary.items[13].scTermEn
: props.dictionary.items[13].scTermFr
} ${update.scDateModifiedOverwrite}`}
/>
</li>
Expand Down Expand Up @@ -441,16 +441,18 @@ export default function DigitalStandardsPlaybookPage(props) {
</p>
</div>
</section>
<section id="project-updates">
<h2>
{props.locale === "en"
? props.dictionary.items[11].scTermEn
: props.dictionary.items[11].scTermFr}
</h2>
<ul className="grid lg:grid-cols-12 gap-x-4 lg:gap-y-12 list-none ml-0 mb-12">
{displayProjectUpdates}
</ul>
</section>
{updatesData.length === 0 ? null : (
<section id="projectUpdates">
<h2>
{props.locale === "en"
? "Project updates"
: "Mises à jour du projet"}
</h2>
<ul className="grid lg:grid-cols-12 gap-x-4 lg:gap-y-12 list-none ml-0 mb-12">
{displayProjectUpdates}
</ul>
</section>
)}
</div>
</Layout>
</>
Expand Down
8 changes: 4 additions & 4 deletions pages/projects/making-easier-get-benefits/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export default function IntegratedChannelStrategyArticles(props) {
} font-bold`}
>
{props.locale === "en"
? dictionary[9].scTermEn
: dictionary[9].scTermFr}
? dictionary[13].scTermEn
: dictionary[13].scTermFr}
</p>
<p className="col-span-6 col-start-7 sm:col-start-5 lg:col-span-2 md:col-start-5 mt-0">
{pageData.scDateModifiedOverwrite}
Expand All @@ -63,8 +63,8 @@ export default function IntegratedChannelStrategyArticles(props) {
} font-bold`}
>
{props.locale === "en"
? dictionary[4].scTermEn
: dictionary[4].scTermFr}
? dictionary[8].scTermEn
: dictionary[8].scTermFr}
</p>
<p className="row-start-2 col-span-6 col-start-7 sm:col-start-5 lg:col-span-2 md:col-start-5 mt-auto">
{pageData.scDateModifiedOverwrite}
Expand Down
21 changes: 15 additions & 6 deletions pages/projects/making-easier-get-benefits/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export default function IntegratedChannelStrategyPage(props) {
href={props.locale === "en" ? update.scPageNameEn : update.scPageNameFr}
description={`${
props.locale === "en"
? props.dictionary.items[9].scTermEn
: props.dictionary.items[9].scTermFr
? props.dictionary.items[13].scTermEn
: props.dictionary.items[13].scTermFr
} ${update.scDateModifiedOverwrite}`}
/>
</li>
Expand Down Expand Up @@ -331,7 +331,7 @@ export default function IntegratedChannelStrategyPage(props) {
</div>
</div>
</section>
<div className="grid grid-cols-12">
<div id="pageMainContent" className="grid grid-cols-12">
<div className="col-span-12 lg:col-span-7 mt-[48px]">
<TextRender
data={
Expand All @@ -343,9 +343,18 @@ export default function IntegratedChannelStrategyPage(props) {
/>
</div>
</div>
<ul className="grid lg:grid-cols-12 gap-x-4 lg:gap-y-12 list-none ml-0 mb-12">
{displayProjectUpdates}
</ul>
{updatesData.length === 0 ? null : (
<section id="projectUpdates">
<h2>
{props.locale === "en"
? "Project updates"
: "Mises à jour du projet"}
</h2>
<ul className="grid lg:grid-cols-12 gap-x-4 lg:gap-y-12 list-none ml-0 mb-12">
{displayProjectUpdates}
</ul>
</section>
)}
</div>
</Layout>
</>
Expand Down
8 changes: 4 additions & 4 deletions pages/projects/oas-benefits-estimator/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export default function OASBenefitsEstimatorArticles(props) {
} font-bold`}
>
{props.locale === "en"
? dictionary[9].scTermEn
: dictionary[9].scTermFr}
? dictionary[13].scTermEn
: dictionary[13].scTermFr}
</p>
<p className="col-span-6 col-start-7 sm:col-start-5 lg:col-span-2 md:col-start-5 mt-0">
{pageData.scDateModifiedOverwrite}
Expand All @@ -63,8 +63,8 @@ export default function OASBenefitsEstimatorArticles(props) {
} font-bold`}
>
{props.locale === "en"
? dictionary[4].scTermEn
: dictionary[4].scTermFr}
? dictionary[8].scTermEn
: dictionary[8].scTermFr}
</p>
<p className="row-start-2 col-span-6 col-start-7 sm:col-start-5 lg:col-span-2 md:col-start-5 mt-auto">
{pageData.scDateModifiedOverwrite}
Expand Down
Loading

0 comments on commit ca6ed89

Please sign in to comment.