Skip to content

Commit

Permalink
Merge pull request #797 from DFE-Digital/use-govuk-task-list
Browse files Browse the repository at this point in the history
Replace appTaskList with govukTaskList
  • Loading branch information
simonwhatley authored Dec 13, 2024
2 parents 086a288 + 314ec6c commit e9d239f
Show file tree
Hide file tree
Showing 6 changed files with 210 additions and 265 deletions.
2 changes: 0 additions & 2 deletions app/assets/sass/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ $govuk-assets-path: "/dist/govuk/assets/";
// Patterns that aren't in Frontend
@import "patterns/related-items";
@import "patterns/start-page";
@import "patterns/task-list";

// Misc
@import "helpers";
Expand Down Expand Up @@ -46,7 +45,6 @@ $govuk-assets-path: "/dist/govuk/assets/";
@import "components/spreadsheet";
@import "components/status-card";
@import "components/sub-navigation";
@import "components/task-list";
@import "components/timeline";
@import "components/user-card";

Expand Down
55 changes: 0 additions & 55 deletions app/assets/sass/components/_task-list.scss

This file was deleted.

71 changes: 0 additions & 71 deletions app/assets/sass/patterns/_task-list.scss

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/layout.njk
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
{% from "govuk/components/table/macro.njk" import govukTable %}
{% from "govuk/components/tabs/macro.njk" import govukTabs %}
{% from "govuk/components/tag/macro.njk" import govukTag %}
{% from "govuk/components/task-list/macro.njk" import govukTaskList %}
{% from "govuk/components/textarea/macro.njk" import govukTextarea %}
{% from "govuk/components/warning-text/macro.njk" import govukWarningText %}

Expand All @@ -39,7 +40,6 @@
{% from "_components/autocomplete-new/macro.njk" import appAutocompleteFromSelect %}
{% from "_components/autocomplete-new/macro.njk" import appAutocompleteFromInput %}
{% from "_components/banner/macro.njk" import appBanner %}
{% from "_components/task-list/macro.njk" import appTaskList %}
{% from "_components/footer/macro.njk" import appFooter %}
{% from "_components/school-autocomplete/macro.njk" import appSchoolAutocomplete with context %}
{% from "_components/sub-navigation/macro.njk" import appSubNavigation %}
Expand Down
105 changes: 65 additions & 40 deletions app/views/new-record/overview-apply-grouped-sections.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
{% endif %}

{% set hideReturnLink = true %}
{% set backLink = '/drafts' %}
{% set backLink = "/drafts" %}
{% set backText = "All drafts" %}

{% set gridColumn = 'govuk-grid-column-full' %}

{% set gridColumn = "govuk-grid-column-full" %}

{% block formContent %}
{# Rendered from /new-record/overview #}
Expand Down Expand Up @@ -56,25 +55,33 @@
{% set courseDetailsHref = "course-details/confirm" %}
{% endif %}

{{ appTaskList({
{{ govukTaskList({
classes: "govuk-!-margin-bottom-8",
items: [
{
text: "Course details",
idPrefix: "course-details",
title: {
text: "Course details"
},
href: courseDetailsHref | addReferrer(referrer),
id: "course-details",
tag: {
classes: record.courseDetails | getStatusText('Review', 'Review') | getStatusClass,
text: record.courseDetails | getStatusText('Review', 'Review')
status: {
tag: {
classes: record.courseDetails | getStatusText('Review', 'Review') | getStatusClass,
text: record.courseDetails | getStatusText('Review', 'Review')
}
}
} if record | requiresSection("courseDetails"),
{
text: "Trainee data",
idPrefix: "application-overview",
title: {
text: "Trainee data"
},
href: "apply-trainee-application" | addReferrer(referrer),
id: "application-overview",
tag: {
classes: record.applyData | getStatusText('Review', 'Review') | getStatusClass,
text: record.applyData | getStatusText('Review', 'Review')
status: {
tag: {
classes: record.applyData | getStatusText('Review', 'Review') | getStatusClass,
text: record.applyData | getStatusText('Review', 'Review')
}
}
}
]
Expand All @@ -95,47 +102,64 @@ Lead partners and employing schools" %}
{% endif %}
{% endif %}

{{ appTaskList({
{{ govukTaskList({
classes: "govuk-!-margin-bottom-8",
items: [
{
text: "Trainee ID",
idPrefix: "training-details",
title: {
text: "Trainee ID"
},
href: "training-details" | reviewIfInProgress(record.trainingDetails) | addReferrer(referrer),
id: "training-details",
tag: {
classes: record.trainingDetails | getStatusText | getStatusClass,
text: record.trainingDetails | getStatusText
status: {
tag: {
classes: record.trainingDetails | getStatusText | getStatusClass,
text: record.trainingDetails | getStatusText
}
}
} if record | requiresSection("trainingDetails"),
{
text: schoolSectionLabel,
idPrefix: "schools-details",
title: {
text: schoolSectionLabel
},
href: "schools" | reviewIfInProgress(record.schools) | addReferrer(referrer),
id: "schools-details",
tag: {
classes: record.schools | getStatusText | getStatusClass,
text: record.schools | getStatusText
status: {
tag: {
classes: record.schools | getStatusText | getStatusClass,
text: record.schools | getStatusText
}
}
} if record | requiresSection("schools"),
{
text: "Placements",
_href: "placements/confirm" if (record.placement) else "placements/can-add-placement",
idPrefix: "placement-details",
title: {
text: "Placements"
},
href: "placements/can-add-placement" | reviewIfInProgress(record.placement, "placements") | addReferrer(referrer),
id: "placement-details",
tag: {
classes: record.placement | getStatusText | getStatusClass,
text: record.placement | getStatusText
status: {
tag: {
classes: record.placement | getStatusText | getStatusClass,
text: record.placement | getStatusText
}
}
} if record | requiresSection("placement"),
{
text: "Funding",
href: "funding" | reviewIfInProgress(record.funding) if record | canStartFundingSection,
hint: "Complete course details first" if not record | canStartFundingSection,
id: "funding",
tag: {
classes: record.funding | getStatusText | getStatusClass,
text: record.funding | getStatusText("Cannot start yet" if not record | canStartFundingSection)
}
} if record | requiresSection("funding")
idPrefix: "funding",
title: {
text: "Funding"
},
href: "funding" | reviewIfInProgress(record.funding) if record | canStartFundingSection,
hint: {
text: "Complete course details first" if not record | canStartFundingSection
},
status: {
tag: {
classes: record.funding | getStatusText | getStatusClass,
text: record.funding | getStatusText("Cannot start yet" if not record | canStartFundingSection)
}
}
} if record | requiresSection("funding")
]
}) if not closed }}

Expand All @@ -152,4 +176,5 @@ Lead partners and employing schools" %}

</div>
</div>

{% endblock %}
Loading

0 comments on commit e9d239f

Please sign in to comment.