Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 33 additions & 18 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,24 +305,39 @@ module.exports = function (eleventyConfig) {
})

// Copies the 11ty base layout and partials to the contributions app layouts directory
eleventyConfig.on("eleventy.before", async ({ directories, runMode, outputMode }) => {
fs.copyFile(`${directories.includes}layouts/base.njk`, './views/common/base.njk', (err) => {
if (err) {
console.log("Error Found:", err);
}
})

fs.copyFile(`${directories.includes}layouts/partials/header.njk`, './views/common/partials/header.njk', (err) => {
if (err) {
console.log("Error Found:", err);
}
})
fs.copyFile(`${directories.includes}layouts/partials/footer.njk`, './views/common/partials/footer.njk', (err) => {
if (err) {
console.log("Error Found:", err);
}
})
});
eleventyConfig.on(
'eleventy.before',
async ({ directories, runMode, outputMode }) => {
fs.copyFile(
`${directories.includes}layouts/base.njk`,
'./views/common/base.njk',
(err) => {
if (err) {
console.log('Error Found:', err)
}
}
)

fs.copyFile(
`${directories.includes}layouts/partials/header.njk`,
'./views/common/partials/header.njk',
(err) => {
if (err) {
console.log('Error Found:', err)
}
}
)
fs.copyFile(
`${directories.includes}layouts/partials/footer.njk`,
'./views/common/partials/footer.njk',
(err) => {
if (err) {
console.log('Error Found:', err)
}
}
)
}
)

// Rebuild when a change is made to a component template file
eleventyConfig.addWatchTarget('src/moj/components/**/*.njk')
Expand Down
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ app.set('view engine', 'njk')
const njk = expressNunjucks(app, {
watch: isDev,
noCache: false,
loader: nunjucks.FileSystemLoader,
loader: nunjucks.FileSystemLoader
})

njk.env.addFilter('rev', rev)
Expand Down
147 changes: 41 additions & 106 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ const config = {
howIsTheComponentUsed: {
label: 'How is the component being used?'
}
}
},
showOnCya: true,
removable: false
},
'component-image': {
title: 'Component image',
Expand All @@ -39,7 +41,9 @@ const config = {
label: 'Upload a file',
hint: 'The file must be a JPG, BMP, PNG, TIF or PDF, and smaller than 10MB.'
}
}
},
showOnCya: true,
removable: false
},
'accessibility-findings': {
title: 'Accessibility findings',
Expand All @@ -57,7 +61,9 @@ const config = {
label: 'Has the component been tested with assistive technology?',
hint: 'This could be with screen reader software or an adaptive keyboard.'
}
}
},
showOnCya: false,
removable: false
},
'add-external-audit': {
title: 'External accessibility audit',
Expand All @@ -77,7 +83,9 @@ const config = {
'/accessibility-findings': {
hasComponentBeenTestedExternalAccessibility: 'yes'
}
}
},
showOnCya: true,
removable: true
},
'add-internal-audit': {
title: 'Internal accessibility review',
Expand All @@ -97,7 +105,9 @@ const config = {
'/accessibility-findings': {
hasComponentBeenTestedInternalAudit: 'yes'
}
}
},
showOnCya: true,
removable: true
},
'add-assistive-tech': {
title: 'Testing with assistive technology',
Expand All @@ -115,40 +125,19 @@ const config = {
'/accessibility-findings': {
hasComponentBeenTestedUsingAssistiveTechnology: 'yes'
}
}
},
prototype: {
title: 'Prototype',
fields: {
componentPrototypeUrl: {
label: 'Do you have a prototype link?',
hint: 'For example to the GOV.UK Prototype Kit, Figma, Sketch, Mural or Miro.'
}
}
},
'prototype-url': {
title: 'Prototype details',
fields: {
prototypeUrl: {
label: 'Add the prototype link',
hint: 'For example, to the GOV.UK Prototype Kit, Figma, Sketch, Mural or Miro. '
},
prototypeUrlAdditionalInformation: {
label: 'Add more information about the prototype (optional)',
hint: 'Enter any relevant information, for example a username, password or link expiry date.'
}
},
conditions: {
'/prototype': { componentPrototypeUrl: 'yes' }
}
showOnCya: true,
removable: true
},
'component-code': {
title: 'Component code',
fields: {
componentCodeAvailable: {
label: 'Do you have code for the component?'
}
}
},
showOnCya: false,
removable: false
},
'component-code-details': {
title: 'Component code details',
Expand All @@ -171,15 +160,19 @@ const config = {
},
conditions: {
'/component-code': { componentCodeAvailable: 'yes' }
}
},
showOnCya: true,
removable: true
},
figma: {
title: 'Figma design',
fields: {
figmaUrl: {
label: 'Do you have a Figma link for the component?'
}
}
},
showOnCya: false,
removable: false
},
'figma-link': {
title: 'Figma design details',
Expand All @@ -195,7 +188,9 @@ const config = {
},
conditions: {
'/figma': { figmaUrl: 'yes' }
}
},
showOnCya: true,
removable: true
},
'your-details': {
title: 'Your details',
Expand All @@ -213,90 +208,30 @@ const config = {
label: 'Sharing your contact details on the component page',
hint: 'Adding your details to the component enables other users to contact you (or your team) to collaborate on the component.\r\nSelect all that apply'
}
}
},
showOnCya: true,
removable: false
},
'check-your-answers': {}
},
ADD_NEW_COMPONENT_ROUTE: '/contribute/add-new-component',
MAX_ADD_ANOTHER: 10,
ACRONYMS_TO_UPPERCASE: ['url'],
CHECK_YOUR_ANSWERS_LABEL_OVERRIDES: {
// componentOverview: 'Component description',
// howIsTheComponentUsed: 'How the component is being used in your service',
// accessibilityReport: 'Audit report',
// externalOrganisation: 'External accessibility audit supplier',
// internalOrganisation: 'Internal accessibility audit supplier',
// issuesDiscovered: 'Issues discovered during the audit',
// prototypeUrl: 'Prototype link',
// prototypeUrlAdditionalInformation: 'Additional information',
// componentCode: 'Code',
// componentCodeUsage: 'Code usage',
// componentCodeLanguage: 'Code language',
// componentCodeLanguageOther: 'Other code language',
// figmaLink: 'Prototype link',
// figmaLinkAdditionalInformation: 'Additional information',
// shareYourDetails: 'Share your details on the component page',
// componentImage: 'Supporting file'
},
CHECK_YOUR_ANSWERS: {
sections: [
{
title: 'Component details',
data: ['component-details', 'component-image']
},
{
title: 'External accessibility audit',
data: [
{
'accessibility-findings': {
includeFields: ['hasComponentBeenTestedExternalAccessibility']
}
},
'add-external-audit'
]
},
{
title: 'Internal accessibility review',
data: [
{
'accessibility-findings': {
includeFields: ['hasComponentBeenTestedInternalAudit']
}
},
'add-internal-audit'
]
},
{
title: 'Assistive technology testing',
data: [
{
'accessibility-findings': {
includeFields: ['hasComponentBeenTestedUsingAssistiveTechnology']
}
},
'add-assistive-tech'
]
},
{ title: 'Prototype', data: ['prototype', 'prototype-url'] },
{ title: 'Figma', data: ['figma', 'figma-link'] },
{ title: 'Code', data: ['component-code', 'component-code-details'] },
{ title: 'Your details', data: ['your-details'] }
],
canRemoveStatic: [

],
canRemoveMultiples: [
'/prototype-url',
'/figma-link',
'/component-code-details'
],
ignoreFields: []
'component-code-details': {
title: 'Code sample',
fields: {
componentCodeUsage: 'Usage',
componentCodeLanguage: 'Language',
componentCodeLanguageOther: 'Language',
componentCode: 'Code'
}
}
},
SHARE_YOUR_DETAILS: {
addNameToComponentPage: 'add my name to the component page',
addTeamNameToComponentPage: 'add my team name to the component page'
}
}


module.exports = config
1 change: 1 addition & 0 deletions docs/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
@forward "components/app-buildingblock-card";
@forward "components/status";
@forward "components/documentation-tabs";
@forward "components/summary-card";

@view-transition {
navigation: auto;
Expand Down
12 changes: 3 additions & 9 deletions docs/stylesheets/components/_prose.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
@include govuk-typography-weight-bold;
}

ul,
ol {
ul:not([class]),
ol:not([class]) {
@extend %govuk-list;
}

Expand All @@ -65,14 +65,8 @@
@extend %govuk-link;
}

a {
a:not(.govuk-button) {
@extend %govuk-link;

/* stylelint-disable selector-no-qualifying-type */
&.govuk-link--no-visited-state,
&.govuk-button {
color: govuk-colour("white");
}
}

.govuk-link--inverse {
Expand Down
9 changes: 9 additions & 0 deletions docs/stylesheets/components/_summary-card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@use "../moj-frontend" as *;

.govuk-summary-card__title-wrapper {
background-color: #e5e6e7;
}

.govuk-summary-card__content {
background-color: govuk-colour("white");
}
16 changes: 8 additions & 8 deletions filters/rev.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const fs = require('fs')

const rev = (filepath) => {
if (process.env.ENV === 'production' || process.env.ENV === 'staging') {
const manifest = JSON.parse(
fs.readFileSync('public/rev-manifest.json', 'utf8')
)
const revision = manifest[filepath]
return `/${revision || filepath}`
}
return `/${filepath}`
if (process.env.ENV === 'production' || process.env.ENV === 'staging') {
const manifest = JSON.parse(
fs.readFileSync('public/rev-manifest.json', 'utf8')
)
const revision = manifest[filepath]
return `/${revision || filepath}`
}
return `/${filepath}`
}

module.exports = rev
Loading
Loading