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

Add review badge, rename existing and call it tag! #885

Merged
merged 11 commits into from
Apr 4, 2024
6 changes: 3 additions & 3 deletions app/views/bill-licences/remove.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% from "govuk/components/inset-text/macro.njk" import govukInsetText %}
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}

{% from "macros/badge.njk" import statusBadge %}
{% from "macros/bill-run-status-tag.njk" import statusTag %}

{% block breadcrumbs %}
{# Back link #}
Expand All @@ -32,9 +32,9 @@
<div class="govuk-grid-row govuk-!-margin-bottom-0">
<div class="govuk-grid-column-full">

{# Status badge #}
{# Status tag #}
<p class="govuk-body">
{{ statusBadge(billRunStatus) }}
{{ statusTag(billRunStatus) }}
</p>

{# Bill run meta-data #}
Expand Down
6 changes: 3 additions & 3 deletions app/views/bill-runs/cancel.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% from "govuk/components/button/macro.njk" import govukButton %}
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}

{% from "macros/badge.njk" import statusBadge %}
{% from "macros/bill-run-status-tag.njk" import statusTag %}

{% block breadcrumbs %}
{# Back link #}
Expand All @@ -26,9 +26,9 @@
<div class="govuk-grid-row govuk-!-margin-bottom-0">
<div class="govuk-grid-column-full">

{# Status badge #}
{# Status tag #}
<p class="govuk-body">
{{ statusBadge(billRunStatus) }}
{{ statusTag(billRunStatus) }}
</p>

{# Bill run meta-data #}
Expand Down
6 changes: 3 additions & 3 deletions app/views/bill-runs/empty.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %}
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}

{% from "macros/badge.njk" import statusBadge %}
{% from "macros/bill-run-status-tag.njk" import statusTag %}

{% block breadcrumbs %}
{# Back link #}
Expand Down Expand Up @@ -38,9 +38,9 @@
<div class="govuk-grid-row govuk-!-margin-bottom-0">
<div class="govuk-grid-column-full">

{# Status badge #}
{# Status tag #}
<p class="govuk-body">
{{ statusBadge(billRunStatus) }}
{{ statusTag(billRunStatus) }}
</p>

{# Bill run meta-data #}
Expand Down
6 changes: 3 additions & 3 deletions app/views/bill-runs/errored.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %}
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}

{% from "macros/badge.njk" import statusBadge %}
{% from "macros/bill-run-status-tag.njk" import statusTag %}

{% block breadcrumbs %}
{# Back link #}
Expand Down Expand Up @@ -38,9 +38,9 @@
<div class="govuk-grid-row govuk-!-margin-bottom-0">
<div class="govuk-grid-column-full">

{# Status badge #}
{# Status tag #}
<p class="govuk-body">
{{ statusBadge(billRunStatus) }}
{{ statusTag(billRunStatus) }}
</p>

{# Bill run meta-data #}
Expand Down
57 changes: 9 additions & 48 deletions app/views/bill-runs/review-licence.njk
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{% extends 'layout.njk' %}
{% from "govuk/components/back-link/macro.njk" import govukBackLink %}
{% from "govuk/components/tag/macro.njk" import govukTag %}
{% from "govuk/components/table/macro.njk" import govukTable %}
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}
{% from "govuk/components/details/macro.njk" import govukDetails %}
{% from "macros/badge.njk" import badge %}

{% from "macros/review-status-tag.njk" import statusTag %}

{% block breadcrumbs %}
{# Back link #}
Expand All @@ -24,18 +22,8 @@
<span class="govuk-caption-l">{{region}} two-part tariff bill run</span>
<h1 class="govuk-heading-xl govuk-!-margin-bottom-3">{{pageTitle}}</h1>

{# Status badge #}
{% if licence.status == 'review' %}
{% set colour = "govuk-tag--blue govuk-!-font-size-16" %}
{% else %}
{% set colour = "govuk-tag--green govuk-!-font-size-16" %}
{% endif %}

<p class="govuk-body">
{{govukTag({
text: licence.status,
classes: colour
})}}
{{ statusTag(licence.status) }}
</p>
</div>
</div>
Expand Down Expand Up @@ -84,13 +72,10 @@
{% set matchedReturnIndex = loop.index0 %}

{% if return.returnStatus == 'overdue' or return.returnStatus == 'query' %}
{% set colour = "govuk-tag--red"%}
{% set returnLink = "/return/internal?returnId=" + return.returnId %}
{% elif return.status == 'void' %}
{% set colour = "govuk-tag--grey" %}
{% set returnLink = "/return/internal?returnId=" + return.returnId %}
{% else %}
{% set colour = "govuk-tag--green" %}
{% set returnLink = "/returns/return?id=" + return.returnId%}
{% endif %}

Expand All @@ -106,11 +91,8 @@
{{ return.description }}
{% endset %}

{% set statusTag %}
{{govukTag({
text: return.returnStatus,
classes: colour + ' govuk-!-font-size-14'
})}}
{% set tag %}
{{ statusTag(return.returnStatus) }}
{% endset %}

{% set issues = '' %}
Expand All @@ -130,7 +112,7 @@
attributes: { 'data-test': 'matched-return-summary' + matchedReturnIndex }
},
{
html: statusTag,
html: tag,
classes: 'govuk-body-s',
attributes: { 'data-test': 'matched-return-status' + matchedReturnIndex }
},
Expand Down Expand Up @@ -176,14 +158,6 @@
{% for return in unmatchedReturns %}
{% set unmatchedReturnIndex = loop.index0 %}

{% if return.returnStatus == 'overdue' or return.returnStatus == 'query' %}
{% set colour = "govuk-tag--red"%}
{% elif return.status == 'void' %}
{% set colour = "govuk-tag--grey" %}
{% else %}
{% set colour = "govuk-tag--green" %}
{% endif %}

{% set action %}
<a class="govuk-link" href="/licences/{{ licence.licenceId }}#returns">{{ return.reference }}<span class="govuk-visually-hidden"></a>
<div>{{return.dates}}</div>
Expand All @@ -196,11 +170,8 @@
{{ return.description }}
{% endset %}

{% set statusTag %}
{{govukTag({
text: return.returnStatus,
classes: colour + ' govuk-!-font-size-14'
})}}
{% set tag %}
{{ statusTag(return.returnStatus) }}
{% endset %}

{% set issues = '' %}
Expand All @@ -220,7 +191,7 @@
attributes: { 'data-test': 'unmatched-return-summary' + unmatchedReturnIndex }
},
{
html: statusTag,
html: tag,
classes: 'govuk-body-s',
attributes: { 'data-test': 'unmatched-return-status' + unmatchedReturnIndex }
},
Expand Down Expand Up @@ -349,21 +320,11 @@
{% set chargeElementIndex = loop.index0 %}
{% set elementRows = [] %}

{# Status badge #}
{% if chargeElement.elementStatus == 'review' %}
{% set elementColour = "govuk-tag--blue govuk-!-font-size-16" %}
{% else %}
{% set elementColour = "govuk-tag--green govuk-!-font-size-16" %}
{% endif %}

<div class="govuk-!-margin-top-6">
<div class="tag-wrapper">
<span class="govuk-body govuk-!-font-weight-regular">{{chargeElement.elementNumber}}</span>
<span class="tag-element">
{{govukTag({
text: chargeElement.elementStatus,
classes: elementColour
})}}
{{ statusTag(chargeElement.elementStatus) }}
</span>
<h3 class="govuk-heading-s govuk-!-margin-bottom-1">{{chargeElement.elementDescription}}
<div>
Expand Down
27 changes: 5 additions & 22 deletions app/views/bill-runs/review.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
{% from "govuk/components/radios/macro.njk" import govukRadios %}
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}
{% from "govuk/components/table/macro.njk" import govukTable %}
{% from "govuk/components/tag/macro.njk" import govukTag %}

{% from "macros/bill-run-status-tag.njk" import statusTag as billRunStatusTag %}
{% from "macros/review-status-tag.njk" import statusTag as reviewStatusTag %}

{% block breadcrumbs %}
{# Back link #}
Expand All @@ -25,18 +27,8 @@
<span class="govuk-caption-l">{{ region }} {{ billRunType }} bill run</span>
<h1 class="govuk-heading-xl govuk-!-margin-bottom-3">{{ pageTitle }}</h1>

{# Status badge #}
{% if status == 'review' %}
{% set colour = "govuk-tag--blue govuk-!-font-size-27" %}
{% else %}
{% set colour = "govuk-tag--green govuk-!-font-size-27" %}
{% endif %}

<p class="govuk-body">
{{ govukTag({
text: status,
classes: colour
}) }}
{{ billRunStatusTag(status) }}
</p>

{# Bill run meta-data #}
Expand Down Expand Up @@ -263,17 +255,8 @@
{% set tableRows = [] %}
{% if preparedLicences.length > 0 %}
{% for licence in preparedLicences %}
{% if licence.status == 'review' %}
{% set colour = "govuk-tag--blue" %}
{% else %}
{% set colour = "govuk-tag--green" %}
{% endif %}

{% set statusTag %}
{{govukTag({
text: licence.status,
classes: colour
})}}
{{ reviewStatusTag(licence.status) }}
{% endset %}

{% set action %}
Expand Down
6 changes: 3 additions & 3 deletions app/views/bill-runs/send.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% from "govuk/components/button/macro.njk" import govukButton %}
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}

{% from "macros/badge.njk" import statusBadge %}
{% from "macros/bill-run-status-tag.njk" import statusTag %}

{% block breadcrumbs %}
{# Back link #}
Expand All @@ -26,9 +26,9 @@
<div class="govuk-grid-row govuk-!-margin-bottom-0">
<div class="govuk-grid-column-full">

{# Status badge #}
{# Status tag #}
<p class="govuk-body">
{{ statusBadge(billRunStatus) }}
{{ statusTag(billRunStatus) }}
</p>

{# Bill run meta-data #}
Expand Down
6 changes: 3 additions & 3 deletions app/views/bill-runs/setup/create.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}
{% from "govuk/components/warning-text/macro.njk" import govukWarningText %}

{% from "macros/badge.njk" import statusBadge %}
{% from "macros/bill-run-status-tag.njk" import statusTag %}

{% block breadcrumbs %}
{# Back link #}
Expand Down Expand Up @@ -32,9 +32,9 @@
iconFallbackText: 'Warning'
}) }}

{# Status badge #}
{# Status tag #}
<p class="govuk-body">
{{ statusBadge(billRunStatus) }}
{{ statusTag(billRunStatus) }}
</p>

{# Bill run meta-data #}
Expand Down
6 changes: 3 additions & 3 deletions app/views/bill-runs/view.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}
{% from "govuk/components/table/macro.njk" import govukTable %}

{% from "macros/badge.njk" import statusBadge %}
{% from "macros/bill-run-status-tag.njk" import statusTag %}

{% block breadcrumbs %}
{# Back link #}
Expand All @@ -28,9 +28,9 @@
<div class="govuk-grid-row govuk-!-margin-bottom-0">
<div class="govuk-grid-column-full">

{# Status badge #}
{# Status tag #}
<p class="govuk-body">
{{ statusBadge(billRunStatus) }}
{{ statusTag(billRunStatus) }}
</p>

{# Bill run meta-data #}
Expand Down
6 changes: 3 additions & 3 deletions app/views/bills/remove.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% from "govuk/components/inset-text/macro.njk" import govukInsetText %}
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}

{% from "macros/badge.njk" import statusBadge %}
{% from "macros/bill-run-status-tag.njk" import statusTag %}

{% block breadcrumbs %}
{# Back link #}
Expand All @@ -32,9 +32,9 @@
<div class="govuk-grid-row govuk-!-margin-bottom-0">
<div class="govuk-grid-column-full">

{# Status badge #}
{# Status tag #}
<p class="govuk-body">
{{ statusBadge(billRunStatus) }}
{{ statusTag(billRunStatus) }}
</p>

{# Bill run meta-data #}
Expand Down
6 changes: 3 additions & 3 deletions app/views/bills/view-multi-licence.njk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% from "govuk/components/table/macro.njk" import govukTable %}
{% from "govuk/components/warning-text/macro.njk" import govukWarningText %}

{% from "macros/badge.njk" import statusBadge %}
{% from "macros/bill-run-status-tag.njk" import statusTag %}

{% block breadcrumbs %}
{# Back link #}
Expand All @@ -29,9 +29,9 @@
<div class="govuk-grid-row govuk-!-margin-bottom-0">
<div class="govuk-grid-column-full">

{# Status badge #}
{# Status tag #}
<p class="govuk-body">
{{ statusBadge(billRunStatus) }}
{{ statusTag(billRunStatus) }}
</p>

{# Bill meta-data #}
Expand Down
6 changes: 3 additions & 3 deletions app/views/bills/view-single-licence-presroc.njk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% from "govuk/components/table/macro.njk" import govukTable %}
{% from "govuk/components/warning-text/macro.njk" import govukWarningText %}

{% from "macros/badge.njk" import statusBadge %}
{% from "macros/bill-run-status-tag.njk" import statusTag %}

{% block breadcrumbs %}
{# Back link #}
Expand All @@ -29,9 +29,9 @@
<div class="govuk-grid-row govuk-!-margin-bottom-0">
<div class="govuk-grid-column-full">

{# Status badge #}
{# Status tag #}
<p class="govuk-body">
{{ statusBadge(billRunStatus) }}
{{ statusTag(billRunStatus) }}
</p>

{# Bill meta-data #}
Expand Down
Loading
Loading