-
Notifications
You must be signed in to change notification settings - Fork 23
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
docs: 1126 build status design #1154
Changes from 36 commits
b65e7da
61170b7
a638e5b
2d8e8b3
d49a703
07cef73
a4cd461
36a2171
82f4ece
7fdb4de
48130db
a210ded
38aaae1
0bfcc2a
bf88890
8e00b56
4f84a7c
865b2b0
c51f5dc
8bde440
d964dc1
c3acb35
2bd009f
ad306ac
739e567
5238953
8708684
7a2f52e
2972bc4
3634215
474e6c9
6902399
1d1a05e
4a3bb28
52d3716
b039d4b
b7d95c0
32656b3
242f6cb
c6dea49
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"Official": { | ||
"link": "How ‘official’ components work", | ||
"linkContent": "Components with an ‘official’ status have had a full, multi-disciplinary team review.", | ||
"statusMessage": "Updated " | ||
}, | ||
"To be reviewed": { | ||
"link": "How ‘to be reviewed’ components work", | ||
"linkContent": "Components with a ‘to be reviewed’ status have been added for use by everyone, but have not been checked or improved recently.", | ||
"statusMessage": "Created " | ||
}, | ||
"Experimental": { | ||
"link": "How ‘experimental’ components work", | ||
"linkContent": "Anyone can add an ‘experimental’ status component to the MoJ Design System. They’re early in development and can be used as a starting point.", | ||
"statusMessage": "Created " | ||
}, | ||
"Archived": { | ||
"link": "How ‘archived’ components work", | ||
"linkContent": "This component is no longer being supported and should not be used.", | ||
"statusMessage": "Archived " | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
{% extends "./base.njk" %} | ||
|
||
{% block content %} | ||
{% import "./macros/status.njk" as macros %} | ||
|
||
{% block content %} | ||
<div class="app-layout__content"> | ||
<h1 class="govuk-heading-xl"> | ||
{% if not isIndex %}<span class="govuk-caption-xl">Components</span>{% endif %} | ||
{% if not isIndex %}<span class="govuk-caption-xl">Components</span>{% endif %} | ||
<h1 class="govuk-heading-xl{% if status %} govuk-!-display-inline-block govuk-!-margin-bottom-2{% endif %}"> | ||
{{ title }} | ||
</h1> | ||
|
||
{{ macros.statusLabel(type, status, statusMessage, statusInfo, creatorName, creatorTeam, statusDate) }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a blocker for release, but could this be a pageTitle partial/macro? As its repeated several times There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks Chris, noted for later iteration. |
||
{{ content | safe }} | ||
|
||
{% include "./partials/get-help-and-contribute.njk" %} | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,60 @@ | ||||||
{% from "govuk/components/details/macro.njk" import govukDetails %} | ||||||
|
||||||
|
||||||
{% macro statusLabel(type, status, statusMessage, statusInfo, creatorName, creatorTeam, statusDate) %} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worth a little bit of inline documentation of these args? |
||||||
{% if status %} | ||||||
|
||||||
|
||||||
|
||||||
ehtabrizi marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
{% set statusData = (statusInfo[status] if statusInfo and status in statusInfo else {}) %} | ||||||
|
||||||
{% set statusClass = { | ||||||
"Official": "govuk-tag--green", | ||||||
"To be reviewed": "govuk-tag--orange", | ||||||
"Experimental": "govuk-tag", | ||||||
"Archived": "govuk-tag--grey" | ||||||
}[status] or "" %} | ||||||
|
||||||
|
||||||
<span class="govuk-tag status-tag {{ statusClass }}"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to trim the empty spaces off when Or follow the coding standards and use
Suggested change
|
||||||
<span class="govuk-visually-hidden">Status:</span> {{ status }} | ||||||
</span> | ||||||
|
||||||
{% if status == 'Experimental' or statusDate %} | ||||||
<p class="status-message govuk-!-margin-bottom-2"> | ||||||
{{ statusData.statusMessage }}{% if status == 'Experimental' %} by{%- if creatorName and creatorTeam %} | ||||||
{{ creatorName }} in {{ creatorTeam }} | ||||||
{%- elif creatorName %} | ||||||
{{ creatorName }} | ||||||
{%- elif creatorTeam %} | ||||||
someone in {{ creatorTeam }} | ||||||
{%- else %} | ||||||
someone in the community | ||||||
{%- endif %}{% if statusDate %} in {{ statusDate }}{% endif %}.{% else %} in {{ statusDate }}.{% endif %} | ||||||
</p> | ||||||
{% endif %} | ||||||
|
||||||
<details class="govuk-details govuk-!-margin-bottom-8"> | ||||||
<summary class="govuk-details__summary"> | ||||||
<span class="govuk-details__summary-text"> | ||||||
{{ statusInfo[status].link | ||||||
| replace('Components', type | capitalize + 's') | ||||||
| replace('components', type | lower + 's') | ||||||
| replace('Component', type | capitalize) | ||||||
| replace('component', type | lower) | ||||||
}} | ||||||
</span> | ||||||
</summary> | ||||||
<div class="govuk-details__text"> | ||||||
{{ statusInfo[status].linkContent | ||||||
| replace('Components', type | capitalize + 's') | ||||||
| replace('components', type | lower + 's') | ||||||
| replace('Component', type | capitalize) | ||||||
| replace('component', type | lower) | ||||||
}} | ||||||
<a href="/design-system-statuses">Read about all the Design System statuses</a>. | ||||||
</div> | ||||||
</details> | ||||||
|
||||||
{% endif %} | ||||||
{% endmacro %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.status-tag { | ||
display: inline-block; | ||
vertical-align: super; | ||
margin-left: govuk-spacing(2); | ||
} | ||
|
||
p.status-message { | ||
color: $govuk-secondary-text-colour; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there's only one macro in the file, would this be better as: