Skip to content

Conversation

@john-huang-121
Copy link
Contributor

Resolves #5308

Description

This feature adds the 'Export Audit' button to the Audits page. Similar to the Storage Location page except includes the audit date and status in the report.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update
  • Documentation update

How Has This Been Tested?

I first had to create a new Audit before exporting the CSV file.
Once that's done, I clicked the button and was able to get the csv of the audit.

Screenshots

New Export Button
Screenshot 2025-08-22 at 12 02 54 AM

@john-huang-121 john-huang-121 marked this pull request as ready for review August 25, 2025 22:17
@awwaiid awwaiid self-requested a review August 31, 2025 15:27
Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

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

Thanks for the first draft!

@john-huang-121
Copy link
Contributor Author

Can we re-run that spec-system test? Seems flakey.

@john-huang-121
Copy link
Contributor Author

Screenshot 2025-09-26 at 4 26 28 PM Screenshot 2025-09-26 at 4 26 55 PM

expect(csv_data).to eq(
<<~CSV
Audit Date,Audit Status,Storage Location Name,#{audit.line_items.first.name},#{audit_2.line_items.first.name}
#{audit.updated_at.strftime("%B %d %Y")},#{audit.status},#{sl.name},#{audit.line_items.first.quantity},0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please replace these with actual names, quantities, status etc. You can use freeze_time to hardcode the times as well. This will make the test less flaky and ensure we are asserting what we think we're asserting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated to a more hardcoded spec.

@john-huang-121 john-huang-121 requested a review from dorner October 4, 2025 06:43
Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

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

Looks good - over to @awwaiid for functional test.

@john-huang-121
Copy link
Contributor Author

Hello @awwaiid, do you have time to review my PR?

@ruestitch
Copy link
Collaborator

Hey, @awwaiid, @janeewheatley and I completed functional testing and we're seeing that the export Audit button and the example export looks good (attached)

Audits-2025-10-28.csv

@ruestitch
Copy link
Collaborator

Pending ticket: "Please wait" must not persist on the export button label after the export is complete

@ruestitch ruestitch merged commit 328876e into rubyforgood:main Oct 28, 2025
12 checks passed
@john-huang-121
Copy link
Contributor Author

@ruestitch Thank you for testing!

@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2025

@john-huang-121: Your PR 5308 Audit CSV Export is part of today's Human Essentials production release: 2025.11.02.
Thank you very much for your contribution!

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.

Provide export of audit

3 participants