Skip to content

Update dependencies and enhance CSV export functionality - #218

Merged
rsmoke merged 14 commits into
mainfrom
staging
Mar 3, 2026
Merged

Update dependencies and enhance CSV export functionality#218
rsmoke merged 14 commits into
mainfrom
staging

Conversation

@rsmoke

@rsmoke rsmoke commented Mar 3, 2026

Copy link
Copy Markdown
Member

This pull request adds a new feature to export program appointments as a CSV file, with options for exporting all appointments or only scheduled (booked) ones. It includes the controller action, service logic, UI dropdown for download, routing, and comprehensive test coverage.

CSV Export Feature for Appointments:

Controller and Service Implementation

  • Added an export action to AppointmentsController that authorizes the user and serves a CSV file of appointments for a program, with support for filtering by all or only scheduled appointments (scope).
  • Implemented CsvExportService.export_program_appointments, generating a CSV of appointments sorted by VIP last name and appointment date, with headers and appropriate filtering based on the scope.

User Interface and Routing

  • Updated appointments/index.html.erb to show a dropdown button for authorized users, allowing download of "All appointments" or "Scheduled only" as CSV.
  • Added a new route for the export action with CSV format to config/routes.rb.

Testing

  • Added request specs to verify CSV export works correctly for different user roles and scopes, including header-only output for empty data.
  • Added service specs to ensure correct CSV output, sorting, filtering, and edge case handling in CsvExportService.

Other Minor Improvements:

Questionnaire Chart Initialization

  • Improved chart initialization in questionnaires/responses.html.erb to ensure charts render reliably on first page load and after Turbo navigation, even if Chart.js loads slowly.

dependabot Bot and others added 14 commits February 27, 2026 02:54
Bumps [brakeman](https://github.com/presidentbeef/brakeman) from 8.0.2 to 8.0.4.
- [Release notes](https://github.com/presidentbeef/brakeman/releases)
- [Changelog](https://github.com/presidentbeef/brakeman/blob/main/CHANGES.md)
- [Commits](presidentbeef/brakeman@v8.0.2...v8.0.4)

---
updated-dependencies:
- dependency-name: brakeman
  dependency-version: 8.0.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [sqlite3](https://github.com/sparklemotion/sqlite3-ruby) from 2.9.0 to 2.9.1.
- [Release notes](https://github.com/sparklemotion/sqlite3-ruby/releases)
- [Changelog](https://github.com/sparklemotion/sqlite3-ruby/blob/main/CHANGELOG.md)
- [Commits](sparklemotion/sqlite3-ruby@v2.9.0...v2.9.1)

---
updated-dependencies:
- dependency-name: sqlite3
  dependency-version: 2.9.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [sentry-rails](https://github.com/getsentry/sentry-ruby) from 6.3.1 to 6.4.1.
- [Release notes](https://github.com/getsentry/sentry-ruby/releases)
- [Changelog](https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md)
- [Commits](getsentry/sentry-ruby@6.3.1...6.4.1)

---
updated-dependencies:
- dependency-name: sentry-rails
  dependency-version: 6.4.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [sentry-ruby](https://github.com/getsentry/sentry-ruby) from 6.3.1 to 6.4.1.
- [Release notes](https://github.com/getsentry/sentry-ruby/releases)
- [Changelog](https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md)
- [Commits](getsentry/sentry-ruby@6.3.1...6.4.1)

---
updated-dependencies:
- dependency-name: sentry-ruby
  dependency-version: 6.4.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
- Implemented a new export action in the AppointmentsController to allow downloading of program appointments in CSV format.
- Enhanced the appointments index view with a dropdown for selecting export options (all or scheduled appointments).
- Created a CsvExportService method to generate CSV data based on the selected scope, improving data accessibility for users.
- Updated routes to include the new export action, ensuring proper routing for CSV downloads.
- Introduced new tests for the CsvExportService to validate CSV generation for program appointments, covering various scenarios including all appointments, scheduled appointments, and handling of empty states.
- Updated the CsvExportService to sort appointments by VIP last name and appointment date, improving the organization of exported data.
- Enhanced the export functionality in the controller to ensure proper CSV responses for different user roles, including super admins and department admins.
- Ensured that the CSV export handles cases with no appointments gracefully, maintaining header integrity.
…6.4.1

Bump sentry-rails from 6.3.1 to 6.4.1
….4.1

Bump sentry-ruby from 6.3.1 to 6.4.1
- Added immediate initialization of questionnaire charts to ensure they display correctly on first visit, even during Turbo navigation.
- Implemented a fallback mechanism to wait for Chart.js to load if it hasn't been loaded yet, improving user experience on slower connections.
Enhance chart initialization in responses view
@rsmoke
rsmoke merged commit 392bef9 into main Mar 3, 2026
10 checks passed
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.

1 participant