From 19705ac3d394c1fc7cf783d66becbbf65323d1f6 Mon Sep 17 00:00:00 2001 From: Jordan Willis <31868510+will0684@users.noreply.github.com> Date: Wed, 13 Dec 2023 10:14:22 -0500 Subject: [PATCH] Modify dynamic OAS article page to use template (#945) * update OAS article queries to support new fragments * update OAS article page to use template --- .../oasBenefitsEstimatorArticlesQuery.graphql | 102 ++++++- pages/projects/oas-benefits-estimator/[id].js | 279 +++--------------- 2 files changed, 147 insertions(+), 234 deletions(-) diff --git a/graphql/queries/oasBenefitsEstimatorArticlesQuery.graphql b/graphql/queries/oasBenefitsEstimatorArticlesQuery.graphql index e76ee9aae9..28c710cc18 100644 --- a/graphql/queries/oasBenefitsEstimatorArticlesQuery.graphql +++ b/graphql/queries/oasBenefitsEstimatorArticlesQuery.graphql @@ -1,5 +1,5 @@ query getOASBenefitsEstimatorArticles { - sclabsPageV1List ( + sclabsPageV1List( filter: { scContentType: { _expressions: [ @@ -69,7 +69,83 @@ query getOASBenefitsEstimatorArticles { scNoIndex scNoFollow scFragments { + ... on SclabsCompContentImageV1Model { + _model { + ... on ModelInfo { + title + } + } + scId + scLabContent { + scId + scContentEn { + json + } + scContentFr { + json + } + } + scLabImage { + ... on SclabsImageV1Model { + scId + scImageEn { + ... on ImageRef { + _publishUrl + width + height + } + ... on DocumentRef { + _publishUrl + } + } + scImageFr { + ... on ImageRef { + _publishUrl + width + height + } + ... on DocumentRef { + _publishUrl + } + } + scImageMobileEn { + ... on ImageRef { + _publishUrl + width + height + } + ... on DocumentRef { + _publishUrl + } + } + scImageMobileFr { + ... on ImageRef { + _publishUrl + width + height + } + ... on DocumentRef { + _publishUrl + } + } + scImageAltTextEn + scImageAltTextFr + scImageCaptionEn { + json + } + scImageCaptionFr { + json + } + } + } + scLabLayout + } ... on SclabsContentV1Model { + _model { + ... on ModelInfo { + title + } + } _path scId scContentEn { @@ -80,6 +156,11 @@ query getOASBenefitsEstimatorArticles { } } ... on SclabsImageV1Model { + _model { + ... on ModelInfo { + title + } + } scId scImageEn { ... on ImageRef { @@ -131,6 +212,11 @@ query getOASBenefitsEstimatorArticles { } } ... on SclabsButtonV1Model { + _model { + ... on ModelInfo { + title + } + } scId scTitleEn scTitleFr @@ -139,6 +225,11 @@ query getOASBenefitsEstimatorArticles { scButtonType } ... on SclabsFeatureV1Model { + _model { + ... on ModelInfo { + title + } + } scId scTitleEn scTitleFr @@ -158,6 +249,7 @@ query getOASBenefitsEstimatorArticles { _publishUrl } } + scImageAltTextEn scImageFr { ... on ImageRef { _publishUrl @@ -168,6 +260,7 @@ query getOASBenefitsEstimatorArticles { _publishUrl } } + scImageAltTextFr scFragments { ... on SclabsAlertV1Model { _path @@ -195,6 +288,11 @@ query getOASBenefitsEstimatorArticles { } } ... on TooltipV1Model { + _model { + ... on ModelInfo { + title + } + } _path scId scTitleEn @@ -209,4 +307,4 @@ query getOASBenefitsEstimatorArticles { } } } -} \ No newline at end of file +} diff --git a/pages/projects/oas-benefits-estimator/[id].js b/pages/projects/oas-benefits-estimator/[id].js index 957ac279b2..114d679889 100644 --- a/pages/projects/oas-benefits-estimator/[id].js +++ b/pages/projects/oas-benefits-estimator/[id].js @@ -1,14 +1,12 @@ -import Head from "next/head"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; import { useTranslation } from "next-i18next"; +import PageHead from "../../../components/fragment_renderer/PageHead"; import { Layout } from "../../../components/organisms/Layout"; -import { ActionButton } from "../../../components/atoms/ActionButton"; import { useEffect, useState } from "react"; import aemServiceInstance from "../../../services/aemServiceInstance"; import { getAllUpdateIds } from "../../../lib/utils/getAllUpdateIds"; import { createBreadcrumbs } from "../../../lib/utils/createBreadcrumbs"; -import TextRender from "../../../components/text_node_renderer/TextRender"; -import { CTA } from "../../../components/design-system/CTA"; +import FragmentRender from "../../../components/fragment_renderer/FragmentRender"; import { Heading } from "../../../components/design-system/Heading"; export default function OASUpdatePage(props) { @@ -36,238 +34,55 @@ export default function OASUpdatePage(props) { props.locale )} > - - {props.adobeAnalyticsUrl ? ( -