-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing view licence returns status tags (#1110)
https://eaflood.atlassian.net/browse/WATER-4444 We are replacing the legacy view licence page with a new one. That means we needed to recreate the returns tab, though with some improvements to the display. However, further testing has shown we've missed some of the possible statuses, specifically `void` and `received`. Plus, we were automatically converting `due` to `overdue` when this should only be if the due date has passed. This change fixes the logic for the return statuses. While we are at it, we added a new macro for handling the display of the tag to keep things consistent with how we show tags in other areas of the app.
- Loading branch information
1 parent
12af920
commit c6ee83f
Showing
5 changed files
with
63 additions
and
39 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,30 @@ | ||
{% from "govuk/components/tag/macro.njk" import govukTag %} | ||
|
||
{% macro statusTag(status, inline=false) %} | ||
{% if status === 'overdue' %} | ||
{% set color = 'govuk-tag--orange' %} | ||
{% elif status === 'void' %} | ||
{% set color = 'govuk-tag--grey' %} | ||
{% elif status === 'due' %} | ||
{% set color = 'govuk-tag--blue' %} | ||
{% elif status === 'received' %} | ||
{% set color = 'govuk-tag--green' %} | ||
{% elif status === 'complete' %} | ||
{% set color = 'govuk-tag--green' %} | ||
{% else %} | ||
{% set color = 'govuk-tag--blue' %} | ||
{% endif %} | ||
|
||
{% if inline %} | ||
{% set fontSize = "" %} | ||
{% else %} | ||
{% set fontSize = "govuk-!-font-size-27" %} | ||
{% endif %} | ||
|
||
{{ | ||
govukTag({ | ||
text: status, | ||
classes: color + ' ' + fontSize | ||
}) | ||
}} | ||
{% endmacro %} |
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