Skip to content

Commit

Permalink
Digital Standards Playbook Project Page Updates (#1105)
Browse files Browse the repository at this point in the history
* add tertiary style to ActionButton proptypes

* allow ActionButton in SurveyCTA to be passed an ID

* add new "Live" stage to stageDictionary.json

* pass in id to button in SurveyCTA on homepage

* update digital standards playbook page template

* update cypress tests
  • Loading branch information
will0684 authored Oct 18, 2024
1 parent 3548098 commit cc9c318
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 33 deletions.
1 change: 1 addition & 0 deletions components/atoms/ActionButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ ActionButton.propTypes = {
"secondary",
"danger",
"link",
"tertiary",
]),

/**
Expand Down
8 changes: 7 additions & 1 deletion components/molecules/SurveyCTA.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ActionButton } from "../atoms/ActionButton";
export const SurveyCTA = ({
heading,
description,
buttonId,
buttonLabel,
buttonLink,
buttonType,
Expand All @@ -14,7 +15,12 @@ export const SurveyCTA = ({
<p className="font-body">{description}</p>
</div>
<div className="flex flex-col px-10 pt-5 md:pt-0 md:justify-center md:items-center whitespace-nowrap">
<ActionButton href={buttonLink} text={buttonLabel} style="tertiary" />
<ActionButton
id={buttonId}
href={buttonLink}
text={buttonLabel}
style="tertiary"
/>
</div>
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/digital-standards-playbook.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ describe("Digital Standards Playbook Page", () => {
it("loads page",()=>{
cy.url().should('equal',Cypress.config().baseUrl+'/en/projects/digital-standards-playbook')
cy.get('button.info').click()
cy.get('h2.modal-title').should('have.text','Discovery')
cy.get('h2.modal-title').should('have.text','Live')
})

it("finds survey page", () => {
cy.get("a:contains('Take survey')").should('be.visible');
it("finds 'Read and comment on guidance' button", () => {
cy.get("a:contains('Read and comment on the new guidance')").should('be.visible');
});
});

6 changes: 4 additions & 2 deletions lib/utils/stageDictionary.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"en": {
"gc:custom/decd-endc/project-stage/alpha": "Alpha",
"gc:custom/decd-endc/project-stage/beta": "Beta",
"gc:custom/decd-endc/project-stage/discovery": "Discovery"
"gc:custom/decd-endc/project-stage/discovery": "Discovery",
"gc:custom/decd-endc/project-stage/live": "Live"
},
"fr": {
"gc:custom/decd-endc/project-stage/alpha": "Alpha",
"gc:custom/decd-endc/project-stage/beta": "Bêta",
"gc:custom/decd-endc/project-stage/discovery": "Découverte"
"gc:custom/decd-endc/project-stage/discovery": "Découverte",
"gc:custom/decd-endc/project-stage/live": "Mise en ligne"
}
}
5 changes: 5 additions & 0 deletions pages/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,11 @@ export default function Home(props) {
? pageData.scFragments[2].scContentEn.json[0].content[0].value
: pageData.scFragments[2].scContentFr.json[0].content[0].value
}
buttonId={
props.locale === "en"
? pageData.scFragments[2].scLabsButton[0].scId
: pageData.scFragments[2].scLabsButton[0].scIdFr
}
buttonLabel={
props.locale === "en"
? pageData.scFragments[2].scLabsButton[0].scTitleEn
Expand Down
27 changes: 0 additions & 27 deletions pages/projects/digital-standards-playbook/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,33 +364,6 @@ export default function DigitalStandardsPlaybookPage(props) {
? pageData.scFragments[0].scContentEn.json[9].content[0].value
: pageData.scFragments[0].scContentFr.json[9].content[0]
.value}
<a
className="underline underline-offset-[6px]"
href={
props.locale === "en"
? pageData.scFragments[0].scContentEn.json[9].content[1]
.data.href
: pageData.scFragments[0].scContentFr.json[9].content[1]
.data.href
}
>
{props.locale === "en"
? pageData.scFragments[0].scContentEn.json[9].content[1]
.value
: pageData.scFragments[0].scContentFr.json[9].content[1]
.value}
</a>
{props.locale === "en"
? pageData.scFragments[0].scContentEn.json[9].content[2].value
: pageData.scFragments[0].scContentFr.json[9].content[2]
.value}
</p>
<p className="col-span-12 xl:col-span-8">
{props.locale === "en"
? pageData.scFragments[0].scContentEn.json[10].content[0]
.value
: pageData.scFragments[0].scContentFr.json[10].content[0]
.value}
</p>

<ActionButton
Expand Down

0 comments on commit cc9c318

Please sign in to comment.