Skip to content

Commit

Permalink
Add cdcp to contact us (#752)
Browse files Browse the repository at this point in the history
* Add cdcp to contact us

* Make CDCP first and open in a new tab
  • Loading branch information
Charles-Pham authored Nov 19, 2024
1 parent 6a98cfe commit e75f40f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cypress/e2e/ContactUs.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
Expand Down
21 changes: 21 additions & 0 deletions graphql/mappers/contact-us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions pages/contact-us/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit e75f40f

Please sign in to comment.