-
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
Improve validation for claims to be audited upload #1354
base: main
Are you sure you want to change the base?
Conversation
11f8dc5
to
7eca88e
Compare
app/views/wizards/claims/upload_sampling_data_wizard/_upload_errors_step.html.erb
Outdated
Show resolved
Hide resolved
app/wizards/claims/upload_sampling_data_wizard/confirmation_step.rb
Outdated
Show resolved
Hide resolved
@@ -1,13 +1,18 @@ | |||
class Claims::UploadSamplingDataWizard::UploadStep < BaseStep | |||
attribute :csv_upload | |||
attribute :csv_content | |||
attribute :file_name | |||
attribute :claim_ids, default: [] |
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 this attribute can be removed.
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.
This relates to a question I've posed above: #1354 (comment)
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.
This is related to attribute :claim_ids, default: []
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.
Ah okay, claim_ids
is currently used in process_csv
but let me know if that should be different. This also highlighted to me that reset_claim_ids
should be replaced by reset_input_attributes
, so have updated that.
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 we no longer need to store the claim_ids
, it can all be handled in the wizard itself. See the other wizards for how to do this.
config/locales/en/wizards/claims/upload_sampling_data_wizard.yml
Outdated
Show resolved
Hide resolved
7eca88e
to
56e41be
Compare
There appear to be some missing text changes. The dropdown should need to go and add the inset text and header related guidance. |
56e41be
to
12a6fba
Compare
12a6fba
to
458a00d
Compare
Deployments
|
458a00d
to
17e39ee
Compare
</div> | ||
</div> | ||
|
||
<h2 class="govuk-heading-m">preview of <%= current_step.file_name %></h2> |
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.
preview of
should be in a locale.
<% end %> | ||
|
||
<% table.with_body do |body| %> | ||
<% current_step.csv.each_with_index do |csv_row, index| %> |
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.
<% current_step.csv.each_with_index do |csv_row, index| %> | |
<% current_step.csv.first(5).each_with_index do |csv_row, index| %> |
This is something I missed. We only need to show the first 5.
<%= f.govuk_file_field :csv_upload, label: nil %> | ||
|
||
<%= f.govuk_submit(t(".upload_csv_file")) %> |
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.
<%= f.govuk_file_field :csv_upload, label: nil %> | |
<%= f.govuk_submit(t(".upload_csv_file")) %> | |
<%= f.govuk_file_field :csv_upload, label: t(".upload_csv_file") %> | |
<%= f.govuk_submit(t(".upload")) %> |
This input still needs the upload_csv_file
label. It's the submit button which needs to change to just "Upload"
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 make the label hidden.
But, I see what you mean about the changes in design. The text approach is fine.
@@ -69,20 +58,24 @@ def when_i_click_on_upload_claims_to_be_sampled | |||
end | |||
|
|||
def when_i_upload_a_csv_containing_invalid_sampling_data | |||
attach_file "Upload CSV file", "spec/fixtures/claims/sampling/example_sampling_upload.csv" | |||
attach_file nil, |
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.
This is why you still need the upload_csv_file
label on the file_input. You shouldn't be adding a file to nil
Context
Improve validation for "claims to be audited" upload
Changes proposed in this pull request
Guidance to review
paid
status)Link to Trello card
https://trello.com/c/QTrfQQDW/377-csv-uploads-upload-claims-to-be-sampled
Screenshots