From e75f40f351b0e3b92a5e8e9a8062974d03321444 Mon Sep 17 00:00:00 2001 From: Charles-Pham Date: Tue, 19 Nov 2024 11:42:31 -0700 Subject: [PATCH] Add cdcp to contact us (#752) * Add cdcp to contact us * Make CDCP first and open in a new tab --- cypress/e2e/ContactUs.cy.js | 2 +- graphql/mappers/contact-us.ts | 21 +++++++++++++++++++++ pages/contact-us/index.tsx | 2 ++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/ContactUs.cy.js b/cypress/e2e/ContactUs.cy.js index 99a24f627..53099e4a7 100644 --- a/cypress/e2e/ContactUs.cy.js +++ b/cypress/e2e/ContactUs.cy.js @@ -27,7 +27,7 @@ describe('Validate Contact Us Landing page', () => { cy.get('[data-cy = "contact-task-list"]') .find('a') .should('be.visible') - .and('have.length', '4') + .and('have.length', '5') .and('not.have.length', 0) .and('not.have.attr', 'href', '#undefined') }) diff --git a/graphql/mappers/contact-us.ts b/graphql/mappers/contact-us.ts index ea85c51a4..e1aa068a2 100644 --- a/graphql/mappers/contact-us.ts +++ b/graphql/mappers/contact-us.ts @@ -99,6 +99,7 @@ export async function getContactUsContent() { const oasContactFragment = findFragmentByScId(response, 'oas-contact-us') const cppContactFragment = findFragmentByScId(response, 'cpp-contact-us') const sinContactFragment = findFragmentByScId(response, 'sin-contact-us') + const cdcpContactFragment = findFragmentByScId(response, 'cdcp-contact-us') const mappedSecurity = { en: { @@ -115,6 +116,16 @@ export async function getContactUsContent() { heading: response?.data.schPageV1ByPath.item.scTitleEn, subHeading: introFragment?.scContentEn?.json[0].content[0].value, links: [ + { + linkId: cdcpContactFragment?.scId, + linkTitle: cdcpContactFragment?.scLinkTextEn, + linkAssistiveTitle: cdcpContactFragment?.scLinkTextAssistiveEn, + linkDestination: cdcpContactFragment?.scDestinationURLEn, + linkDescription: cdcpContactFragment?.scDescriptionEn?.json + ? cdcpContactFragment.scDescriptionEn.json[0].content[0].value + : '', + schBetaPopup: cdcpContactFragment?.schBetaPopUp, + }, { linkId: eiContactFragment?.scId, linkTitle: eiContactFragment?.scLinkTextEn, @@ -171,6 +182,16 @@ export async function getContactUsContent() { heading: response?.data.schPageV1ByPath.item.scTitleFr, subHeading: introFragment?.scContentFr?.json[0].content[0].value, links: [ + { + linkId: cdcpContactFragment?.scId, + linkTitle: cdcpContactFragment?.scLinkTextFr, + linkAssistiveTitle: cdcpContactFragment?.scLinkTextAssistiveFr, + linkDestination: cdcpContactFragment?.scDestinationURLFr, + linkDescription: cdcpContactFragment?.scDescriptionFr?.json + ? cdcpContactFragment.scDescriptionFr.json[0].content[0].value + : '', + schBetaPopup: cdcpContactFragment?.schBetaPopUp, + }, { linkId: eiContactFragment?.scId, linkTitle: eiContactFragment?.scLinkTextFr, diff --git a/pages/contact-us/index.tsx b/pages/contact-us/index.tsx index 1851ee39b..44810efed 100644 --- a/pages/contact-us/index.tsx +++ b/pages/contact-us/index.tsx @@ -47,6 +47,8 @@ const ContactLanding = (props: ContactLandingProps) => { const newTabExceptions: string[] = [ 'https://www.canada.ca/en/employment-social-development/corporate/contact/sin.html', 'https://www.canada.ca/fr/emploi-developpement-social/ministere/coordonnees/nas.html', + 'https://www.canada.ca/en/services/benefits/dental/dental-care-plan/contact.html', + 'https://www.canada.ca/fr/services/prestations/dentaire/regime-soins-dentaires/contactez.html', ] return (