generated from DFE-Digital/govuk-dotnet-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: creation of Print this Page component
- Loading branch information
1 parent
e53c4e7
commit cfcdb87
Showing
12 changed files
with
96 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="govuk-grid-row"> | ||
<button class="govuk-link print-link-button" data-module="print-link" onclick="window.print()"> | ||
Print this page | ||
</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
Contentful-Schema/migrations/0013-print-page-component.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module.exports = async function (migration, { makeRequest }) { | ||
|
||
const contentTypeId = "content"; | ||
|
||
migration | ||
.editContentType(contentTypeId) | ||
.createField("printThisPageLocation") | ||
.name("Print this Page Location") | ||
.type("Symbol") | ||
.localized(false) | ||
.required(false) | ||
.validations([ | ||
{ | ||
in: [ | ||
"Before Feedback", | ||
"Before Credit Block", | ||
"Bottom of Page", | ||
"None", | ||
], | ||
}, | ||
]) | ||
.defaultValue({ | ||
"en-US": "None", | ||
}) | ||
.disabled(false) | ||
.omitted(false); | ||
|
||
migration | ||
.editContentType(contentTypeId) | ||
.changeFieldControl("printThisPageLocation", "builtin", "radio", { | ||
helpText: "Where should a Print this Page component be located?", | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.