Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin design - for prototyping, not for merging #2225

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions govuk-prototype-kit.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"assets": [
"/lib/assets/images",
"/lib/assets/css",
"/lib/assets/javascripts/optional",
"/lib/assets/javascripts/manage-prototype"
],
Expand Down
1 change: 1 addition & 0 deletions lib/assets/css/accessible-autocomplete.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/assets/images/plugins/admin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/assets/images/plugins/dwp-frontend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/assets/images/plugins/govuk-frontend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/assets/images/plugins/govuk-notify.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/assets/images/plugins/hmrc-frontend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/assets/images/plugins/jQuery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/assets/images/plugins/step-by-step.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/assets/images/plugins/task-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/assets/images/plugins/xgovuk-filters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions lib/assets/javascripts/manage-prototype/manage-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
const params = new URLSearchParams(window.location.search)
const packageName = params.get('package')
const version = params.get('version')
const mode = params.get('mode') || window.location.pathname.split('/').pop()
var mode
// const mode = params.get('mode') || window.location.pathname.split('/').pop()

const timeout = 30 * 1000

Expand Down Expand Up @@ -114,11 +115,11 @@
}, timeout)
}

if (event && event.preventDefault) {
event.preventDefault()
hide('plugin-action-confirmation')
}
mode = event.target.dataset.mode

console.log(mode)

hide('plugin-action-button')
show('panel-processing')

return getToken()
Expand All @@ -145,7 +146,6 @@
actionTimeoutId = null
requestTimeoutId = null

hide('panel-manual-instructions')
const actionButton = document.getElementById('plugin-action-button')

if (actionButton) {
Expand Down
64 changes: 34 additions & 30 deletions lib/assets/sass/manage-prototype.scss
Original file line number Diff line number Diff line change
Expand Up @@ -439,63 +439,67 @@ body .govuk-prototype-kit-manage-prototype-govuk-tag {
padding-left: 0 !important;
}


.govuk-prototype-kit-manage-prototype-plugin-list-plugin-list {
border-top: 1px solid #b1b4b6;
.govuk-prototype-kit-manage-prototype-plugin-list {
margin-bottom: 2em;
}

.govuk-prototype-kit-manage-prototype-plugin-list-plugin-list__item {
.govuk-prototype-kit-manage-prototype-plugin-list__item {
border-bottom: 1px solid #b1b4b6;
padding: .6em 0
}

.govuk-prototype-kit-manage-prototype-plugin-list-plugin-list__item-name {
display: inline-block;
width: 60%
}

.govuk-prototype-kit-manage-prototype-plugin-list-plugin-list__item-link {
margin-right: 1em;
}
.govuk-prototype-kit-manage-prototype-plugin-list-plugin-list {
border-top: 1px solid #b1b4b6;
margin-bottom: 2em;
}

.govuk-prototype-kit-manage-prototype-plugin-list-plugin-list__item {
border-bottom: 1px solid #b1b4b6;
padding: .6em 0
}

.govuk-prototype-kit-manage-prototype-plugin-list-plugin-list__item-name {
.govuk-prototype-kit-manage-prototype-plugin-list__item-name {
display: inline-block;
width: 35%;
vertical-align: middle;
}

.govuk-prototype-kit-manage-prototype-plugin-list-plugin-list__item-buttons,
.govuk-prototype-kit-manage-prototype-plugin-list-plugin-list__item-version{
.govuk-prototype-kit-manage-prototype-plugin-list__item-buttons,
.govuk-prototype-kit-manage-prototype-plugin-list__item-version{
display: inline-block;
vertical-align: middle;
}

.govuk-prototype-kit-manage-prototype-plugin-list-plugin-list__item-version {
.govuk-prototype-kit-manage-prototype-plugin-list__item-version {
width: 15%
}

.badge{
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background: #1d70b8;
border-radius: 10px;
color: #fff;
display: inline-block;
font-family: GDS Transport,arial,sans-serif;
font-size: 1.1rem;
font-weight: 600;
line-height: 1.25;
min-width: 10px;
padding: 2px 6px 0;
text-align: center;
white-space: nowrap;
margin-left: 10px;
}

.links-section{
border-top: black 1px solid;
padding-top: 30px;
margin-bottom: 30px;
}

@media(min-width: 40.0525em) {
.govuk-prototype-kit-manage-prototype-plugin-list-plugin-list__item-buttons {
.govuk-prototype-kit-manage-prototype-plugin-list__item-buttons {
.govuk-button {
margin: 0
}
}
}

@media(max-width: 40.0525em) {
.govuk-prototype-kit-manage-prototype-plugin-list-plugin-list__item-name,
.govuk-prototype-kit-manage-prototype-plugin-list-plugin-list__item-buttons,
.govuk-prototype-kit-manage-prototype-plugin-list-plugin-list__item-version {
.govuk-prototype-kit-manage-prototype-plugin-list__item-name,
.govuk-prototype-kit-manage-prototype-plugin-list__item-buttons,
.govuk-prototype-kit-manage-prototype-plugin-list__item-version {
display: block;
width: auto;
}
Expand Down
69 changes: 69 additions & 0 deletions lib/data/new-plugins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"plugins": [
{
"packageName": "accessible-autocomplete",
"name": "Accessible autocomplete",
"scope": "GDS",
"summary": "An accessible autocomplete component",
"image": "accessible-autocomplete.png",
"latestVersion": "1.2.3",
"tag": "Recommended"
},
{
"packageName": "xgovuk-filters",
"name": "X-GOVUK Prototype Filters",
"scope": "X-GOVUK",
"summary": "Use this GOV.UK Prototype Kit plugin to add helpful filters to Nunjucks templates. Rapidly modify and transform data while ensuring it follows the GOV.UK style guide.",
"image": "xgovuk-filters.png",
"latestVersion": "1.2.3",
"tag": "Awaiting review",
"filters": [
"formatList",
"isArray",
"rejectFromArray",
"selectFromArray",
"uniqueFromArray",
"duration",
"govukDate",
"govukTime",
"isoDateFromDateInput",
"monthName",
"currency",
"display",
"isNumber",
"ordinal",
"plural",
"showNumber",
"isObject",
"objectToArray",
"govukMarkdown",
"headingsStartWith",
"isString",
"noOrphans",
"slugify",
"startsWith"
]
},
{
"packageName": "admin",
"name": "Admin",
"scope": "Eleanor Stanton",
"summary": "",
"latestVersion": "1.2.3",
"tag": "Unknown"
},
{
"packageName": "dwp-frontend",
"name": "DWP Frontend",
"scope": "DWP",
"summary": "Components and styles for the DWP Design System",
"links": {
"documentation": "https://design-system.dwp.gov.uk",
"support": "https://design-system.dwp.gov.uk"
},
"image": "dwp-frontend.png",
"latestVersion": "1.2.3",
"tag": "Recommended"
}
]
}
80 changes: 80 additions & 0 deletions lib/data/plugins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"govuk-frontend": {
"summary": "Components and styles for the GOV.UK Design System",
"scope": "GDS",
"links": {
"documentation": "https://design-system.service.gov.uk/",
"support": "https://design-system.service.gov.uk/get-in-touch/"
},
"image": "govuk-frontend.png",
"tag": "Recommended"
},
"@govuk-prototype-kit/common-templates": {
"summary": "Templates for common GOV.UK service pages",
"scope": "GDS",
"tag": "Recommended"
},
"@govuk-prototype-kit/step-by-step": {
"summary": "Templates for the GOV.UK Step by step pattern",
"scope": "GDS",
"image": "step-by-step.png",
"tag": "Recommended"
},
"@govuk-prototype-kit/task-list": {
"summary": "Template for the GOV.UK Task list pattern",
"scope": "GDS",
"image": "task-list.png",
"tag": "Recommended"
},
"hmrc-frontend": {
"summary": "Patterns designed specifically for the needs of HMRC users and patterns that are not yet in the GOV.UK Design System.",
"scope": "HMRC",
"image": "hmrc-frontend.png",
"links": {
"documentation": "https://design.tax.service.gov.uk/hmrc-design-patterns/",
"support": "https://design.tax.service.gov.uk/hmrc-design-patterns/"
},
"tag": "Recommended",
"included": [
"Account header",
"Accounts office reference",
"Add to a list",
"Ask the user for their consent",
"Confirmed identity",
"Could not confirm identity",
"Currency input",
"Employer PAYE reference",
"EORI numbers",
"File upload",
"Hiding information",
"HMRC banner",
"Internal header",
"Match an organisation to HMRC records",
"Notification badge",
"Page heading",
"Page not found",
"Page title",
"Research banner",
"Service timeout",
"Service unavailable",
"Sign out",
"Status tags in Task list pages",
"There is a problem with the service",
"Timeline",
"Unique taxpayer reference",
"VAT registration number",
"Welsh language toggle"]
},
"jquery": {
"summary": "Makes the jQuery JavaScript library available on all pages.",
"scope": "GDS",
"image": "jQuery.png"
},
"notifications-node-client": {
"name": "GOV.UK Notify",
"summary": "Send emails and SMS from your prototype.",
"scope": "GDS",
"image": "govuk-notify.png",
"tag": "Recommended"
}
}
Loading