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.
Merge pull request #558 from DFE-Digital/SFSW-2024-Create-component-t…
…o-print-this-page Print this page component
- Loading branch information
Showing
13 changed files
with
79 additions
and
6 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
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.
27 changes: 27 additions & 0 deletions
27
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,27 @@ | ||
module.exports = async function (migration, { makeRequest }) { | ||
|
||
const contentTypeId = "content"; | ||
|
||
migration | ||
.editContentType(contentTypeId) | ||
.createField("showPrintThisPage") | ||
.name("Show Print this Page") | ||
.type("Boolean") | ||
.localized(false) | ||
.required(false) | ||
.validations([]) | ||
.defaultValue({ | ||
"en-US": true, | ||
}) | ||
.disabled(false) | ||
.omitted(false); | ||
|
||
migration | ||
.editContentType(contentTypeId) | ||
.changeFieldControl("showPrintThisPage", "builtin", "boolean", { | ||
helpText: | ||
"Should this page include a Print this Page component? It requires that a Feedback component is included in the page's items.", | ||
trueLabel: "Yes", | ||
falseLabel: "No", | ||
}); | ||
}; |
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.