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

[7961] Fix dead link from CSV docs to empty template #4928

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stevehook
Copy link
Contributor

Context

The link from the CSV reference docs to the empty CSV template for bulk add trainee is broken (was never implemented).

Also addresses issues with content-disposition to ensure that the empty CSV is always served as a download.

Changes proposed in this pull request

  • Add a missing route to the BulkUpdate::AddTrainees::EmptyTemplatesController#show action.
  • Use the above route for the links on the new upload page as well as the CSV reference docs.
  • Extend the feature spec that covers this area to assert that the link of the CSV reference docs works.

Guidance to review

Anything missing?

Important business

  • Does this PR introduce any PII fields that need to be overwritten or deleted in db/scripts/sanitise.sql?
  • Does this PR change the database schema? If so, have you updated the config/analytics.yml file and considered whether you need to send 'import_entity' events?
  • Do we need to send any updates to DQT as part of the work in this PR?
  • Does this PR need an ADR?

NB: Please notify the #twd_data_insights team and ask for a review if new fields are being added to analytics.yml

Also addresses issues with `content-disposition` to ensure that the
empty CSV is always served as a download.
<%= govuk_link_to(
"Download empty CSV file to add new trainees",
bulk_update_add_trainees_empty_template_path(format: :csv),
) %>
Copy link
Contributor Author

@stevehook stevehook Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going through the new route/controller rather than serving the file directly allows us to include a content-disposition header that will direct the browser to treat the file correctly (as a download).

Copy link

sonarqubecloud bot commented Jan 9, 2025

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.19%. Comparing base (07229a8) to head (945cf77).
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4928      +/-   ##
==========================================
+ Coverage   96.11%   96.19%   +0.08%     
==========================================
  Files         745      751       +6     
  Lines       16069    16172     +103     
==========================================
+ Hits        15444    15557     +113     
+ Misses        625      615      -10     
Flag Coverage Δ
unittests 96.19% <ø> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@tomtrentham tomtrentham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants