diff --git a/__mocks__/utils.mock.ts b/__mocks__/utils.mock.ts
index db3cb4975..31161b76a 100644
--- a/__mocks__/utils.mock.ts
+++ b/__mocks__/utils.mock.ts
@@ -1,3 +1,6 @@
import { TextEncoder, TextDecoder } from 'util'
Object.assign(global, { TextDecoder, TextEncoder })
+
+// for testing locally comment.
+// process.env.AUTH_DISABLED= "true"
diff --git a/__tests__/pages/privacy-notice-terms-conditions.test.js b/__tests__/pages/privacy-notice-terms-conditions.test.js
deleted file mode 100644
index 701dcd63f..000000000
--- a/__tests__/pages/privacy-notice-terms-conditions.test.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * @jest-environment jsdom
- */
-import { render, screen } from '@testing-library/react'
-import '@testing-library/jest-dom'
-import PrivacyCondition from '../../pages/privacy-notice-terms-conditions'
-
-import { useRouter } from 'next/router'
-
-// mocks useRouter to be able to use component' router.asPath
-jest.mock('next/router', () => ({
- useRouter: jest.fn(),
-}))
-
-// mocks useRouter to be able to use component' router.asPath
-jest.mock('../../lib/auth', () => ({
- AuthIsDisabled: () => {
- return true
- },
- AuthIsValid: () => {
- return true
- },
- Redirect: jest.fn(),
-}))
-
-describe('Privacy Notice Terms Conditions page', () => {
- const content = {
- id: 'privacy-notice-terms-conditions',
- breadcrumb: [
- { link: 'my-dashboard', text: 'My dashboard', id: 'my-dashboard' },
- ],
- pageName: 'privacy-notice-terms-conditions',
- heading: 'Privacy notice and terms and conditions',
- alert: {
- type: 'info',
- text: 'You may wish to print this page for future reference since it contains important information.\n',
- },
- content:
- 'testing ## Terms and conditions of use testing 1. **Your credentials** testing',
- }
- const contentFr = {
- id: 'privacy-notice-terms-conditions',
- breadcrumb: [
- {
- link: 'mon-tableau-de-bord',
- text: 'Mon tableau de bord',
- id: 'my-dashboard',
- },
- ],
- pageName: 'avis-confidentialite-modalites',
- heading: 'Avis de confidentialité et modalités',
- alert: {
- type: 'info',
- text:
- 'Vous pouvez imprimer cette page pour vous y référer ultérieurement car elle contient des informations importantes.\n' +
- '\n' +
- ' ',
- },
- content:
- 'testing ## Conditions d’utilisation testing 1. **Vos identifiants** testing',
- }
- const popupContent = {}
-
- beforeEach(() => {
- useRouter.mockImplementation(() => ({
- pathname: '/',
- asPath: '/',
- }))
- })
-
- it('should render the page in English', () => {
- render(
-
- )
- const PrivacyConditionDiv = screen.getByTestId(
- 'terms-conditionsContent-test'
- )
- expect(PrivacyConditionDiv).toBeInTheDocument()
- })
-
- it('should render the page in French', () => {
- render(
-
- )
- const PrivacyConditionDiv = screen.getByTestId(
- 'terms-conditionsContent-test'
- )
- expect(PrivacyConditionDiv).toBeInTheDocument()
- })
-})
diff --git a/components/Layout.js b/components/Layout.js
index b1ca62d9e..c31dbef64 100644
--- a/components/Layout.js
+++ b/components/Layout.js
@@ -147,24 +147,45 @@ export default function Layout(props) {
-
+ {process.env.ENVIRONMENT === 'production' ? (
+
+ ) : (
+
+ )}
>
)
}
diff --git a/cypress/e2e/termsConditions.cy.js b/cypress/e2e/termsConditions.cy.js
deleted file mode 100644
index 6a800ad15..000000000
--- a/cypress/e2e/termsConditions.cy.js
+++ /dev/null
@@ -1,80 +0,0 @@
-///
-
-describe('Validate Terms and Conditions Page', () => {
- beforeEach(() => {
- cy.visit('/privacy-notice-terms-conditions')
- })
-
- it('Terms and conditions and Privacy has no detectable a11y violations on load', () => {
- cy.injectAxe()
- cy.checkA11y()
- })
-
- it('validate the "Privacy" click on dashboard page goes to T&C page EN', () => {
- cy.visit('/my-dashboard')
- cy.get('#footerLink1').click()
- cy.location('pathname', { timeout: 10000 })
- .should('equal', '/en/privacy-notice-terms-conditions')
- cy.get('#PrivacyCondition-heading')
- .should('be.visible')
- .and('have.text', 'Privacy notice and terms and conditions')
- cy.get('#privacy-notice').should('be.visible')
- cy.get('#digital-identity-verification--consent').should('be.visible')
- cy.get('#system-requirements').should('be.visible')
- cy.get('[data-cy="breadcrumb-My dashboard"]')
- .should('be.visible')
- .and('have.text', 'My dashboard')
- .and('have.attr', 'href', '/en/my-dashboard')
- })
-
- it('validate the "Privacy" click on dashboard page goes to T&C page FR', () => {
- cy.visit('/my-dashboard')
- cy.changeLang().should('have.text', 'English')
- cy.url().should('contains', '/fr/mon-tableau-de-bord')
- cy.get('#footerLink1').click()
- cy.location('pathname', { timeout: 10000 }).should(
- 'equal',
- '/fr/avis-confidentialite-modalites'
- )
- cy.get('#PrivacyCondition-heading')
- .should('be.visible')
- .and('have.text', 'Avis de confidentialité et modalités')
- cy.get('#avis-de-confidentialite').should('be.visible')
- cy.get('#verification-de-lidentite-numerique---consentement').should(
- 'be.visible'
- )
- cy.get('#exigences-du-systeme').should('be.visible')
- cy.get('[data-cy="breadcrumb-Mon tableau de bord"]')
- .should('be.visible')
- .and('have.text', 'Mon tableau de bord')
- .and('have.attr', 'href', '/fr/mon-tableau-de-bord')
- })
-
- it('validate the "terms and conditions" click on dashboard page goes to T&C page EN', () => {
- cy.visit('/my-dashboard')
- cy.get('#footerLink0').click()
- cy.location('pathname', { timeout: 10000 }).should(
- 'equal',
- '/en/privacy-notice-terms-conditions'
- )
- cy.get('#termsAndConditions').should('be.visible')
- cy.get('#terms-and-conditions-of-use').should('be.visible')
- })
-
- it('validate the "terms and conditions" click on dashboard page goes to T&C page FR', () => {
- cy.visit('/my-dashboard')
- cy.changeLang().should('have.text', 'English')
- cy.url().should('contains', '/fr/mon-tableau-de-bord')
- cy.get('#footerLink0').click()
- cy.location('pathname', { timeout: 10000 }).should(
- 'equal',
- '/fr/avis-confidentialite-modalites'
- )
- cy.get('#conditions-dutilisation').should('be.visible')
- cy.get('#termesEtConditions').should('be.visible')
- })
-
- it('Validate the "Back to Dashboard" click navigates to dashboard page', () => {
- cy.get('#back-to-dashboard-button').should('be.visible')
- })
-})
diff --git a/graphql/mappers/privacy-notice-terms-conditions.ts b/graphql/mappers/privacy-notice-terms-conditions.ts
deleted file mode 100644
index 61b9696c3..000000000
--- a/graphql/mappers/privacy-notice-terms-conditions.ts
+++ /dev/null
@@ -1,123 +0,0 @@
-import { cachified } from 'cachified'
-import { lruCache as cache, defaultTtl as ttl } from '../../lib/cache-utils'
-
-interface GetSchPrivacyNoticeTermsConditionsV1 {
- data: {
- schPageV1ByPath: {
- item: {
- scId: string
- scPageNameEn: string
- scPageNameFr: string
- scTitleEn: string
- scTitleFr: string
- scDateModifiedOverwrite: string
- scBreadcrumbParentPages: Array<{
- scId: string
- scTitleEn: string
- scTitleFr: string
- scPageNameEn: string
- scPageNameFr: string
- }>
- scFragments: Array<{
- scId: string
- scContentEn?: {
- markdown: string
- }
- scContentFr?: {
- markdown: string
- }
- scTitleEn?: string
- scTitleFr?: string
- scDestinationURLEn?: string
- scDestinationURLFr?: string
- }>
- }
- }
- }
-}
-
-const getCachedContent = () => {
- return cachified({
- key: `content-privacy-and-toc`,
- cache,
- getFreshValue: async () => {
- const response = await fetch(
- `${process.env.AEM_GRAPHQL_ENDPOINT}getSchPrivacyNoticeTermsConditionsV1`,
- )
- if (!response.ok) return null
- return (await response.json()) as GetSchPrivacyNoticeTermsConditionsV1
- },
- ttl,
- })
-}
-
-export async function getPrivacyConditionContent() {
- const response = await getCachedContent()
-
- const alertFragment = findFragmentByScId(
- response,
- 'privacy-terms-conditions-alert',
- )
-
- const privacyTermsConditionsFragment = findFragmentByScId(
- response,
- 'privacy-terms-conditions-content',
- )
-
- const mappedPrivacyConditions = {
- en: {
- id: response?.data.schPageV1ByPath.item.scId,
- dateModified: response?.data.schPageV1ByPath.item.scDateModifiedOverwrite,
- breadcrumb:
- response?.data.schPageV1ByPath.item.scBreadcrumbParentPages.map(
- (level) => {
- return {
- link: level.scPageNameEn,
- text: level.scTitleEn,
- id: level.scId,
- }
- },
- ),
- pageName: response?.data.schPageV1ByPath.item.scPageNameEn,
- heading: response?.data.schPageV1ByPath.item.scTitleEn,
- alert: {
- type: 'information',
- text: alertFragment?.scContentEn?.markdown,
- },
- content: privacyTermsConditionsFragment?.scContentEn?.markdown,
- },
- fr: {
- id: response?.data.schPageV1ByPath.item.scId,
- dateModified: response?.data.schPageV1ByPath.item.scDateModifiedOverwrite,
- breadcrumb:
- response?.data.schPageV1ByPath.item.scBreadcrumbParentPages.map(
- (level) => {
- return {
- link: level.scPageNameFr,
- text: level.scTitleFr,
- id: level.scId,
- }
- },
- ),
- pageName: response?.data.schPageV1ByPath.item.scPageNameFr,
- heading: response?.data.schPageV1ByPath.item.scTitleFr,
- alert: {
- type: 'information',
- text: alertFragment?.scContentFr?.markdown,
- },
- content: privacyTermsConditionsFragment?.scContentFr?.markdown,
- },
- }
- return mappedPrivacyConditions
-}
-
-const findFragmentByScId = (
- res: GetSchPrivacyNoticeTermsConditionsV1 | null,
- id: string,
-) => {
- return (
- res?.data.schPageV1ByPath.item.scFragments.find(
- (element) => element.scId === id,
- ) ?? null
- )
-}
diff --git a/locales/en.js b/locales/en.js
index d063a8b16..d70d08fdf 100644
--- a/locales/en.js
+++ b/locales/en.js
@@ -125,12 +125,18 @@ export default {
footerAboutURL: 'https://www.canada.ca/en/government/about.html',
footerAbout: 'About Canada.ca',
+ footerTermsAndConditionDevURL:
+ 'https://srv241-s2.sade.hrdc-drhc.gc.ca/ecas-seca/rascl_ii/SCL/TC.aspx?mode=ReadOnly&lang=eng',
footerTermsAndConditionURL:
- '/privacy-notice-terms-conditions#termsAndConditions',
+ 'https://srv136.services.gc.ca/ecas-seca/rascl/SCL/TC.aspx?mode=ReadOnly&lang=eng',
+
footerTermsAndCondition: 'Terms and conditions',
footerTermsAndConditionAnchor: 'termsAndConditions',
- footerPrivacyURL: '/privacy-notice-terms-conditions',
+ footerPrivacyDevURL:
+ 'https://srv241-s2.sade.hrdc-drhc.gc.ca/ecas-seca/rascl_ii/SCL/TC.aspx?mode=ReadOnly&lang=eng',
+ footerPrivacyURL:
+ 'https://srv136.services.gc.ca/ecas-seca/rascl/SCL/TC.aspx?mode=ReadOnly&lang=eng',
footerPrivacy: 'Privacy',
footerPrivacyAnchor: 'privacy',
diff --git a/locales/fr.js b/locales/fr.js
index 80908d98e..f16c8d5b5 100644
--- a/locales/fr.js
+++ b/locales/fr.js
@@ -120,12 +120,17 @@ export default {
footerAboutURL: 'https://www.canada.ca/en/government/about.html',
footerAbout: 'À propos de Canada.ca',
+ footerTermsAndConditionDevURL:
+ 'https://srv241-s2.sade.hrdc-drhc.gc.ca/ecas-seca/rascl_ii/SCL/TC.aspx?mode=ReadOnly&lang=fra',
footerTermsAndConditionURL:
- '/fr/avis-confidentialite-modalites#termesEtConditions',
+ 'https://srv136.services.gc.ca/ecas-seca/rascl/SCL/TC.aspx?mode=ReadOnly&lang=fra',
footerTermsAndCondition: 'Avis',
footerTermsAndConditionAnchor: 'termesEtConditions',
- footerPrivacyURL: '/fr/avis-confidentialite-modalites/',
+ footerPrivacyDevURL:
+ 'https://srv241-s2.sade.hrdc-drhc.gc.ca/ecas-seca/rascl_ii/SCL/TC.aspx?mode=ReadOnly&lang=fra',
+ footerPrivacyURL:
+ 'https://srv136.services.gc.ca/ecas-seca/rascl/SCL/TC.aspx?mode=ReadOnly&lang=fra',
footerPrivacy: 'Confidentialité',
footerPrivacyAnchor: 'confidentialité',
diff --git a/next.config.js b/next.config.js
index 78792b9cb..7f27caf4e 100644
--- a/next.config.js
+++ b/next.config.js
@@ -29,10 +29,6 @@ const REWRITES = [
source: '/contactez-nous/communiquer-regime-pensions-canada',
destination: '/contact-us/contact-canada-pension-plan',
},
- {
- source: '/avis-confidentialite-modalites',
- destination: '/privacy-notice-terms-conditions',
- },
{
source: '/demande-revision',
destination: '/decision-reviews',
diff --git a/pages/privacy-notice-terms-conditions.js b/pages/privacy-notice-terms-conditions.js
deleted file mode 100644
index 01381683b..000000000
--- a/pages/privacy-notice-terms-conditions.js
+++ /dev/null
@@ -1,333 +0,0 @@
-import { useEffect, useCallback, useMemo, useState } from 'react'
-import PropTypes from 'prop-types'
-import Date from '../components/Date'
-import Heading from '../components/Heading'
-import ContextualAlert from '../components/ContextualAlert'
-import en from '../locales/en'
-import fr from '../locales/fr'
-import { getPrivacyConditionContent } from '../graphql/mappers/privacy-notice-terms-conditions'
-import { getLogger } from '../logging/log-util'
-import {
- AuthIsDisabled,
- AuthIsValid,
- ValidateSession,
- Redirect,
- getIdToken,
-} from '../lib/auth'
-import { authOptions } from '../pages/api/auth/[...nextauth]'
-import { getServerSession } from 'next-auth/next'
-import BackToButton from '../components/BackToButton'
-import Markdown from 'markdown-to-jsx'
-import { getAuthModalsContent } from '../graphql/mappers/auth-modals'
-import React from 'react'
-import ErrorPage from '../components/ErrorPage'
-
-export default function PrivacyCondition(props) {
- const t = props.locale === 'en' ? en : fr
-
- const errorCode =
- props.content?.err ||
- props.bannerContent?.err ||
- props.popupContent?.err ||
- props.popupContentNA?.err ||
- props.authModals?.err
- if (errorCode !== undefined) {
- return (
-
- )
- }
-
- const pageContent = props.content.content
-
- const [privacy, ...termsAndConditions] = pageContent.split(
- props.locale === 'en'
- ? /(?=## Terms and conditions of use|1\. \*\*Your credentials\*\*)/
- : /(?=## Conditions d’utilisation|1\. \*\*Vos identifiants\*\*)/,
- )
-
- return (
-
- )
-}
-
-export async function getServerSideProps({ req, res, locale }) {
- const session = await getServerSession(req, res, authOptions)
-
- if (!AuthIsDisabled() && !(await AuthIsValid(req, session)))
- return Redirect(locale)
-
- const token = await getIdToken(req)
-
- //If Next-Auth session is valid, check to see if ECAS session is. If not, clear session cookies and redirect to login
- if (!AuthIsDisabled() && (await AuthIsValid(req, session))) {
- const sessionValid = await ValidateSession(
- process.env.CLIENT_ID,
- token?.sid,
- )
- if (!sessionValid) {
- // Clear all session cookies
- const isSecure = req.headers['x-forwarded-proto'] === 'https'
- const cookiePrefix = `${isSecure ? '__Secure-' : ''}next-auth.session-token`
- const cookies = []
- for (const cookie of Object.keys(req.cookies)) {
- if (cookie.startsWith(cookiePrefix)) {
- cookies.push(
- `${cookie}=deleted; Max-Age=0; path=/ ${isSecure ? '; Secure ' : ''}`,
- )
- }
- }
- res.setHeader('Set-Cookie', cookies)
- return {
- redirect: {
- destination: `/${locale}/auth/login`,
- permanent: false,
- },
- }
- }
- }
-
- //The below sets the minimum logging level to error and surpresses everything below that
- const logger = getLogger('privacy-notice-terms-and-conditions')
- logger.level = 'error'
-
- const content = await getPrivacyConditionContent().catch((error) => {
- logger.error(error)
- return { err: '500' }
- })
-
- const authModals = await getAuthModalsContent().catch((error) => {
- logger.error(error)
- return { err: '500' }
- })
-
- /* istanbul ignore next */
- const langToggleLink =
- locale === 'en'
- ? '/fr/avis-confidentialite-modalites'
- : '/en/privacy-notice-terms-conditions'
-
- const breadCrumbItems =
- locale === 'en'
- ? content.en.breadcrumb?.map(({ link, text }) => {
- return { text, link: '/' + locale + '/' + link }
- })
- : content.fr.breadcrumb?.map(({ link, text }) => {
- return { text, link: '/' + locale + '/' + link }
- })
- /* Place-holder Meta Data Props */
- const meta = {
- data_en: {
- title:
- 'Privacy notice and terms and conditions - My Service Canada Account',
- desc: 'English',
- author: 'Service Canada',
- keywords: '',
- service: 'ESDC-EDSC_MSCA-MSDC-SCH',
- creator: 'Employment and Social Development Canada',
- accessRights: '1',
- },
- data_fr: {
- title:
- 'Avis de confidentialité et modalités - Mon dossier Service Canada',
- desc: 'Français',
- author: 'Service Canada',
- keywords: '',
- service: 'ESDC-EDSC_MSCA-MSDC-SCH',
- creator: 'Emploi et Développement social Canada',
- accessRights: '1',
- },
- }
-
- return {
- props: {
- locale,
- langToggleLink,
- content:
- content?.err !== undefined
- ? content
- : locale === 'en'
- ? content.en
- : content.fr,
- meta,
- breadCrumbItems,
- aaPrefix:
- content?.err !== undefined
- ? ''
- : `ESDC-EDSC_MSCA-MSDC-SCH:${content.en?.heading || content.en?.title}`,
- aaMenuPrefix:
- content?.err !== undefined ? '' : `ESDC-EDSC_MSCA-MSDC-SCH:Nav Menu`,
- popupStaySignedIn:
- authModals?.err !== undefined
- ? authModals
- : locale === 'en'
- ? authModals.mappedPopupStaySignedIn.en
- : authModals.mappedPopupStaySignedIn.fr,
- popupYouHaveBeenSignedout:
- authModals?.err !== undefined
- ? authModals
- : locale === 'en'
- ? authModals.mappedPopupSignedOut.en
- : authModals.mappedPopupSignedOut.fr,
- },
- }
-}
-
-PrivacyCondition.propTypes = {
- /**
- * current locale in the address
- */
- locale: PropTypes.string,
-
- /*
- * Language link toggle text
- */
- langToggleLink: PropTypes.string,
-
- /*
- * Content Tags
- */
-
- content: PropTypes.object,
-
- /*
- * Meta Tags
- */
-
- meta: PropTypes.object,
-}
diff --git a/pages/profile.js b/pages/profile.js
index d96e215ac..711df7af2 100644
--- a/pages/profile.js
+++ b/pages/profile.js
@@ -37,9 +37,7 @@ export default function Profile(props) {
errType={errorCode}
isAuth={false}
homePageLink={
- props.locale === 'en'
- ? 'en/privacy-notice-terms-conditions'
- : 'fr/avis-confidentialite-modalites'
+ props.locale === 'en' ? 'en/my-dashboard' : 'fr/mon-tableau-de-bord'
}
accountPageLink={
props?.locale === 'en'
diff --git a/pages/security-settings.js b/pages/security-settings.js
index 9523da2af..526b9f9c7 100644
--- a/pages/security-settings.js
+++ b/pages/security-settings.js
@@ -34,9 +34,7 @@ export default function SecuritySettings(props) {
errType={errorCode}
isAuth={false}
homePageLink={
- props.locale === 'en'
- ? 'en/privacy-notice-terms-conditions'
- : 'fr/avis-confidentialite-modalites'
+ props.locale === 'en' ? 'en/my-dashboard' : 'fr/mon-tableau-de-bord'
}
accountPageLink={
props?.locale === 'en'