From 5026d0a896d46f14e937f614e00e6c862cd4ff79 Mon Sep 17 00:00:00 2001 From: Charles-Pham Date: Thu, 14 Nov 2024 19:51:02 -0700 Subject: [PATCH 1/2] Add cdcp to contact us --- cypress/e2e/ContactUs.cy.js | 2 +- graphql/mappers/contact-us.ts | 21 +++++++++++++++++++++ 2 files changed, 22 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..dced161aa 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: { @@ -155,6 +156,16 @@ export async function getContactUsContent() { : '', schBetaPopup: sinContactFragment?.schBetaPopUp, }, + { + 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, + }, ], }, fr: { @@ -211,6 +222,16 @@ export async function getContactUsContent() { : '', schBetaPopup: sinContactFragment?.schBetaPopUp, }, + { + 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, + }, ], }, } From b03642dd48b5169bce23a2015295816c0fafb93d Mon Sep 17 00:00:00 2001 From: Charles-Pham Date: Thu, 14 Nov 2024 20:46:32 -0700 Subject: [PATCH 2/2] Make CDCP first and open in a new tab --- graphql/mappers/contact-us.ts | 40 +++++++++++++++++------------------ pages/contact-us/index.tsx | 2 ++ 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/graphql/mappers/contact-us.ts b/graphql/mappers/contact-us.ts index dced161aa..e1aa068a2 100644 --- a/graphql/mappers/contact-us.ts +++ b/graphql/mappers/contact-us.ts @@ -116,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, @@ -156,16 +166,6 @@ export async function getContactUsContent() { : '', schBetaPopup: sinContactFragment?.schBetaPopUp, }, - { - 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, - }, ], }, fr: { @@ -182,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, @@ -222,16 +232,6 @@ export async function getContactUsContent() { : '', schBetaPopup: sinContactFragment?.schBetaPopUp, }, - { - 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, - }, ], }, } 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 (