-
Notifications
You must be signed in to change notification settings - Fork 2
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
HWPV-195: View & Edit individual claim page #650
base: main
Are you sure you want to change the base?
Conversation
…rison-visits-internal into claim-editing-page
…rison-visits-internal into claim-editing-page
…after being unassigned
@@ -4,6 +4,7 @@ | |||
// $govuk-compatibility-govukfrontendtoolkit: true; | |||
|
|||
$govuk-global-styles: true; | |||
$moj-images-path: "../../../node_modules/@ministryofjustice/frontend/moj/assets/images/"; |
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.
All these hardwired references to node_modules
will want addressing at some point, it's not the usual way to reference this and should they change the names or folder structure, which they could do as they don't say this is the way to reference the files, then it could all break.
However, this is as it currently is so it's not going to stop me approving 🙂 Possibly one for @simonnebMOJ to add a ticket for separately?
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.
@psoleckimoj Ah yes, the app kept crashing when it wasn't referenced like this so yes def one to have a look at making a ticket for @simonnebMOJ
Same with all the moj component imports a few lines down in this file. For some reason I couldn't import them with just @import'../../../node_modules/@ministryofjustice/frontend/moj/components/all
app/assets/sass/application.scss
Outdated
} | ||
|
||
.justify-content-end { |
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.
So not keen on this. Rules should reflect the block and what it does, not just be named after a specific CSS statement, better to create or extend the existing rule that this is being applied to. Like view-claim-display-helper
is a good name.
app/assets/sass/application.scss
Outdated
background-color: #00823b; | ||
color:#00823b; | ||
background-color: $govuk-success-colour; | ||
color: $govuk-success-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.
Not a comment on your update, just realised this rule and the one below are exactly the same 😁
app/assets/sass/application.scss
Outdated
|
||
.claim-approve-different-input { | ||
margin: 0px; |
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.
No need for px
etc when the value is 0
app/assets/sass/application.scss
Outdated
|
||
.claim-table-decision-error-margin { | ||
margin-top: 30px!important; |
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.
Ideally want to try and get around this as !important
is not good practice.
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.
I tried a few alternative approaches but to no avail. Rule only gets set when a specific error pops up upon submitting a claim rejection - so hopefully okay as only a rare case?
app/routes/claim/view-claim.js
Outdated
@@ -452,19 +456,17 @@ function handleError (error, req, res, updateConflict, next) { | |||
} | |||
} | |||
|
|||
function populateNewData (data, req) { | |||
function populateNewData (data, req, keepUnassignedChanges) { |
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.
Maybe default to false
to make it clearer, i.e. keepUnassignedChanges = false
app/routes/claim/view-claim.js
Outdated
if (!data.claim.AssignedTo) { | ||
populateNewData(data, req) | ||
} else { | ||
populateNewData(data, req, true) |
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.
One for the original developers not requiring it, this ideally wants to be an object rather than separate args purely because we don't know what true
is doing here.
<div class="claim-table-deduction-section-container"> | ||
<div> | ||
<span class="govuk-!-margin-top-2 govuk-!-margin-right-4 govuk-!-font-weight-bold">Type</span> |
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.
Could just put the classes on the div
and remove the span
? Also if it's bold maybe it's a heading
?
<div class="claim-table-deduction-section-container"> | ||
<div> | ||
<span class="govuk-!-margin-top-2 govuk-!-margin-right-4 govuk-!-font-weight-bold">Amount</span> |
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 above
}, | ||
{ | ||
html: deductionAmount, |
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.
So, going back to the CSS naming, maybe this class should be deduction-amount
and just have the values you're setting here?
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.
..and the same for others.
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.
My thinking was - theres quite a few variants of classes i've set up in the claim table that use the GOV design classes, so set them individually in the html for clarity
{% if Claim['IsOverpaid'] != true %} | ||
{% set overPaymentTitleText = 'Amount' %} | ||
{% set overPaymentInput = 'overpayment-amount' %} | ||
{% elseif Claim['IsOverpaid'] == true %} |
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.
Things like this can probably just be an else
?
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.
Or flip so you do the true
check first, then everything else will set it otherwise.
<span class="text-warning">Payout barcode can not be expired on a rejected claim</span> | ||
{% else %} | ||
<span class="text-pending">This will cause the original payment to be resubmitted (excluding top ups)</span> | ||
<br><br> |
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.
Ideally want to use CSS for spacing and not <br>
|
||
{% set visitRules %} | ||
<span class="govuk-caption-xl">Visit rules</span> | ||
<h1 class="govuk-heading-xl govuk-!-margin-bottom-4">{{ displayHelper.getRegionRulesByValue(Claim['Country']) }}</h1> |
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.
Heading needs to be meaningful, so caption text would go inside the header tag and restyle there. Think about what a screenreader would say out loud 🙂
] | ||
}) }} | ||
</fieldset> | ||
{% else %} |
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.
Could do an elsif
then else
|
||
{% if TopUps.length > 0 %} | ||
|
||
{% set tableRows = [ |
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.
Need some indentation
@@ -1,67 +1,130 @@ | |||
{% from "govuk/components/warning-text/macro.njk" import govukWarningText %} | |||
|
|||
{# DUPLICATE #} | |||
{% if duplicates.length > 0 %} |
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.
I think you can just do if duplicates | length
🤔
</div> | ||
{% set disabledReason %} | ||
{% if Claim.DisabledReason %} | ||
This Reference has been disabled <br> |
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.
Could move this line of text before the if
as it is always required.
Main comments:
|
$(this).next('input').on('input').removeClass('approved-amount') | ||
} totalApproved() | ||
}) | ||
if ($('#unassign').length) { |
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.
Not sure how I missed this, the code inside the if
and the else
are identical so no need for the statement?
if (isValidValue(value)) { | ||
approvedCost += parseFloat(value) | ||
} | ||
approvedCost += +$(this).text().replace('£', '').trim() |
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.
Actually this doesn't make sense, you're using approvedCost
as both a running total but you're also appending string/text to it, then using it as a number on line 32?
document.getElementById('additional-info-reject-manual').style.display = 'block' | ||
document.getElementById('manual-label').style.display = 'block' | ||
} | ||
function isValidValue (value) { |
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.
Sorry I seem to spot things after re-reading. Is value
a string or Number? isNan
doesn't make sense if you're also using trim
on a string? isNaN
will be OK with 1e3
for example.
No description provided.