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

feat: add in check tab data #53

Merged
merged 2 commits into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/routes/models/view-application.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ const getFarmerApplication = require('./farmer-application')
const getOrganisationRows = require('./application-organisation')
const getClaimData = require('./application-claim')

const claimDataStatus = ['IN CHECK', 'REJECTED', 'READY TO PAY']

function ViewModel (application) {
this.model = {
applicationData: getFarmerApplication(application),
listData: { rows: getOrganisationRows(application?.data?.organisation) },
claimData: application?.claimed ? getClaimData(application) : false
claimData: application?.claimed || claimDataStatus.includes(application?.status?.status) ? getClaimData(application) : false
}
}

Expand Down
6 changes: 6 additions & 0 deletions app/views/macros/view-application-tabs.njk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
{% if claimed %}
<h2 class="govuk-heading-l">Claimed</h2>
{{ govukTable(model.claimData) }}
{% elif (status == "In check") %}
<h2 class="govuk-heading-l">Not claimed yet</h2>
{{ govukTable(model.claimData) }}
{% elif (status == "Rejected") %}
<h2 class="govuk-heading-l">Not eligible to claim</h2>
{{ govukTable(model.claimData) }}
{% elif (status == "Agreed") %}
<h2 class="govuk-heading-l">Not claimed yet</h2>
{% else %}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffc-ahwr-backoffice",
"version": "1.14.5",
"version": "1.14.6",
"description": "Back office of the health and welfare of your livestock",
"homepage": "https://github.com/DEFRA/ffc-ahwr-backoffice",
"main": "app/index.js",
Expand Down