diff --git a/pages/projects/digital-standards-playbook/index.js b/pages/projects/digital-standards-playbook/index.js index 9a6ec42208..cc54abf06e 100644 --- a/pages/projects/digital-standards-playbook/index.js +++ b/pages/projects/digital-standards-playbook/index.js @@ -35,7 +35,6 @@ export default function DigitalStandardsPlaybookPage(props) { window.adobeDataLayer = window.adobeDataLayer || []; window.adobeDataLayer.push({ event: "pageLoad" }); } - console.log(props.dictionary); }, []); return ( diff --git a/pages/projects/oas-benefits-estimator/index.js b/pages/projects/oas-benefits-estimator/index.js index 16805d3c56..0bab6a1b74 100644 --- a/pages/projects/oas-benefits-estimator/index.js +++ b/pages/projects/oas-benefits-estimator/index.js @@ -5,7 +5,6 @@ import { ActionButton } from "../../../components//atoms/ActionButton"; import { useEffect, useState } from "react"; import aemServiceInstance from "../../../services/aemServiceInstance"; import { ProjectInfo } from "../../../components/atoms/ProjectInfo"; -import Card from "../../../components/molecules/Card"; import { createBreadcrumbs } from "../../../lib/utils/createBreadcrumbs"; import { Heading } from "../../../components/molecules/Heading"; import Image from "next/image"; diff --git a/pages/projects/transforming-ei-indigenous-peoples/index.js b/pages/projects/transforming-ei-indigenous-peoples/index.js index b8893720f4..d57fa986f0 100644 --- a/pages/projects/transforming-ei-indigenous-peoples/index.js +++ b/pages/projects/transforming-ei-indigenous-peoples/index.js @@ -4,19 +4,23 @@ import { Layout } from "../../../components/organisms/Layout"; import { useEffect, useState } from "react"; import aemServiceInstance from "../../../services/aemServiceInstance"; import { ProjectInfo } from "../../../components/atoms/ProjectInfo"; -import Card from "../../../components/molecules/Card"; import { createBreadcrumbs } from "../../../lib/utils/createBreadcrumbs"; import { Heading } from "../../../components/molecules/Heading"; import Image from "next/image"; import stageDictionary from "../../../lib/utils/stageDictionary"; import { sortUpdatesByDate } from "../../../lib/utils/sortUpdatesByDate"; -import FragmentRender from "../../../components/fragment_renderer/FragmentRender"; import TextRender from "../../../components/text_node_renderer/TextRender"; import { getDictionaryTerm } from "../../../lib/utils/getDictionaryTerm"; +import { shuffle } from "../../../lib/utils/shuffle"; +import { ExploreUpdates } from "../../../components/organisms/ExploreUpdates"; +import { filterItems } from "../../../lib/utils/filterItems"; +import { ExploreProjects } from "../../../components/organisms/ExploreProjects"; export default function EiIndigenousOverview(props) { const [pageData] = useState(props.pageData.item); const updatesData = sortUpdatesByDate(props.updatesData); + const [allProjects] = useState(props.allProjects); + const [filteredDictionary] = useState( props.dictionary.items.filter( (item) => @@ -27,33 +31,6 @@ export default function EiIndigenousOverview(props) { ) ); - const displayProjectUpdates = updatesData.map((update) => ( -
  • - -
  • - )); - useEffect(() => { if (props.adobeAnalyticsUrl) { window.adobeDataLayer = window.adobeDataLayer || []; @@ -337,7 +314,7 @@ export default function EiIndigenousOverview(props) { -
    +
    -
    - {updatesData.length === 0 ? null : ( -
    -

    - {props.locale === "en" - ? "Project updates" - : "Mises à jour du projet"} -

    -
      - {displayProjectUpdates} -
    -
    + {props.updatesData.length !== 0 ? ( + + ) : null} + + locale={props.locale} + projects={filterItems(allProjects, pageData.scId).slice(0, 3)} + /> ); @@ -376,6 +378,10 @@ export const getStaticProps = async ({ locale }) => { const { data: dictionary } = await aemServiceInstance.getFragment( "dictionaryQuery" ); + // get all projects data + const { data: allProjects } = await aemServiceInstance.getFragment( + "projectQuery" + ); return { props: { @@ -384,6 +390,7 @@ export const getStaticProps = async ({ locale }) => { pageData: pageData.sclabsPageV1ByPath, updatesData: pageData.sclabsPageV1ByPath.item.scLabProjectUpdates, dictionary: dictionary.dictionaryV1List, + allProjects: shuffle(allProjects.sclabsPageV1List.items), ...(await serverSideTranslations(locale, ["common"])), }, revalidate: process.env.ISR_ENABLED === "true" ? 10 : false,