Skip to content

Commit

Permalink
Merge branch 'dev' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
krischarbonneau committed Jul 26, 2024
2 parents 21d9c05 + ff3ecb3 commit c9228af
Show file tree
Hide file tree
Showing 7 changed files with 270 additions and 51 deletions.
22 changes: 20 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ FROM base AS build
# Build envs
ARG HOSTALIAS_CERT
ENV HOSTALIAS_CERT=$HOSTALIAS_CERT
ARG HOSTALIAS_ROOT_CERT
ENV HOSTALIAS_ROOT_CERT=$HOSTALIAS_ROOT_CERT
ARG LOGGING_LEVEL=info
ENV LOGGING_LEVEL=$LOGGING_LEVEL
ARG AEM_GRAPHQL_ENDPOINT=https://www.canada.ca/graphql/execute.json/decd-endc/
Expand All @@ -26,7 +28,19 @@ ENV NODE_ENV=production
WORKDIR /build
COPY --from=base /base ./

RUN mkdir -p /usr/local/share/ca-certificates/ && echo ${HOSTALIAS_CERT} | sed 's/\\n/\n/g' | xargs > /usr/local/share/ca-certificates/env.crt && chmod 644 /usr/local/share/ca-certificates/env.crt && npm run build
RUN mkdir -p /usr/local/share/ca-certificates/ && \
echo ${HOSTALIAS_CERT} | \
sed 's/\\n/\n/g' | \
xargs > \
/usr/local/share/ca-certificates/env.crt && \
chmod 644 /usr/local/share/ca-certificates/env.crt && \
mkdir -p /etc/ssl/certs/ && \
echo ${HOSTALIAS_ROOT_CERT} | \
sed 's/\\n/\n/g' | \
xargs > \
/etc/ssl/certs/root.crt && \
chmod 644 /etc/ssl/certs/root.crt && \
npm run build

FROM node:20-alpine3.20 AS production
ENV NODE_ENV=production
Expand All @@ -51,9 +65,13 @@ RUN addgroup \

WORKDIR ${home}

COPY --from=build /etc/ssl/certs/root.crt /etc/ssl/certs/root.crt
COPY --from=build --chown=${user}:${group} /usr/local/share/ca-certificates/env.crt ${MSCA_NG_CERT_LOCATION}

RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/* && update-ca-certificates
RUN apk update && \
apk add ca-certificates && \
rm -rf /var/cache/apk/* && \
update-ca-certificates

USER ${user}

Expand Down
66 changes: 25 additions & 41 deletions components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useRouter } from 'next/router'
import throttle from 'lodash.throttle'
import IdleTimeout from './IdleTimeout'
import { signOut } from 'next-auth/react'
import getConfig from 'next/config'

export default function Layout(props) {
const t = props.locale === 'en' ? en : fr
Expand Down Expand Up @@ -144,48 +145,31 @@ export default function Layout(props) {
<main id="mainContent" className="sch-container grid gap-[30px]">
{props.children}
</main>

<IdleTimeout locale={props.locale} refPageAA={props.refPageAA} />

{process.env.ENVIRONMENT === 'production' ? (
<Footer
lang={!props.locale ? 'en' : props.locale}
brandLinks={[
{
href: t.footerTermsAndConditionURL,
id: 'linkTC',
text: t.footerTermsAndCondition,
},
{
href: t.footerPrivacyURL,
id: 'linkPR',
text: t.footerPrivacy,
},
]}
contactLink={contactLink}
btnLink="#top"
id="page-footer"
/>
) : (
<Footer
lang={!props.locale ? 'en' : props.locale}
brandLinks={[
{
href: t.footerTermsAndConditionDevURL,
id: 'linkTC',
text: t.footerTermsAndCondition,
},
{
href: t.footerPrivacyDevURL,
id: 'linkPR',
text: t.footerPrivacy,
},
]}
contactLink={contactLink}
btnLink="#top"
id="page-footer"
/>
)}
<Footer
lang={!props.locale ? 'en' : props.locale}
brandLinks={[
{
href:
getConfig()?.publicRuntimeConfig.ENVIRONMENT === 'production'
? t.footerTermsAndConditionURL
: t.footerTermsAndConditionDevURL,
id: 'linkTC',
text: t.footerTermsAndCondition,
},
{
href:
getConfig()?.publicRuntimeConfig.ENVIRONMENT === 'production'
? t.footerPrivacyURL
: t.footerPrivacyDevURL,
id: 'linkPR',
text: t.footerPrivacy,
},
]}
contactLink={contactLink}
btnLink="#top"
id="page-footer"
/>
</>
)
}
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/ContactUs.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Validate Contact Us Landing page', () => {
cy.get('[data-cy = "contact-task-list"]')
.find('a')
.should('be.visible')
.and('have.length', '3')
.and('have.length', '4')
.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 @@ -98,6 +98,7 @@ export async function getContactUsContent() {
const eiContactFragment = findFragmentByScId(response, 'ei-contact-us')
const oasContactFragment = findFragmentByScId(response, 'oas-contact-us')
const cppContactFragment = findFragmentByScId(response, 'cpp-contact-us')
const sinContactFragment = findFragmentByScId(response, 'sin-contact-us')

const mappedSecurity = {
en: {
Expand Down Expand Up @@ -144,6 +145,16 @@ export async function getContactUsContent() {
: '',
schBetaPopup: oasContactFragment?.schBetaPopUp,
},
{
linkId: sinContactFragment?.scId,
linkTitle: sinContactFragment?.scLinkTextEn,
linkAssistiveTitle: sinContactFragment?.scLinkTextAssistiveEn,
linkDestination: sinContactFragment?.scDestinationURLEn,
linkDescription: sinContactFragment?.scDescriptionEn?.json
? sinContactFragment.scDescriptionEn.json[0].content[0].value
: '',
schBetaPopup: sinContactFragment?.schBetaPopUp,
},
],
},
fr: {
Expand Down Expand Up @@ -190,6 +201,16 @@ export async function getContactUsContent() {
: '',
schBetaPopup: oasContactFragment?.schBetaPopUp,
},
{
linkId: sinContactFragment?.scId,
linkTitle: sinContactFragment?.scLinkTextFr,
linkAssistiveTitle: sinContactFragment?.scLinkTextAssistiveFr,
linkDestination: sinContactFragment?.scDestinationURLFr,
linkDescription: sinContactFragment?.scDescriptionFr?.json
? sinContactFragment.scDescriptionFr.json[0].content[0].value
: '',
schBetaPopup: sinContactFragment?.schBetaPopUp,
},
],
},
}
Expand Down
Loading

0 comments on commit c9228af

Please sign in to comment.