Skip to content

Conversation

@SanjeevLakhwani
Copy link
Contributor

@SanjeevLakhwani SanjeevLakhwani commented Nov 20, 2025

Summary

  • Changed CSV export to download ALL matches from the current search using the discovery_matches endpoint with _format=csv parameter
  • CSV filenames now use i18n translations (e.g., Phenopackets.csv or Phénopackets.csv)
  • Removed old batch download functions that only exported selected items

Changes

  • New: downloadAllMatchesCSV() function that calls discovery_matches with _format=csv
  • Updated: Search results table export to download all matches instead of current page
  • Removed: Old batch endpoint functions (downloadIndividualCSV, downloadBiosampleCSV, downloadExperimentCSV)

Test plan

  • Search for data and click CSV export button
  • Verify CSV downloads with all matching results (not just current page)
  • Verify filename uses translated entity name
  • Test in both English and French

…ilenames

Changed CSV export to download all matches using the discovery_matches
endpoint with _format=csv parameter instead of the batch endpoints.
Filenames now use i18n translations for entity names.
Removed old batch download functions (downloadIndividualCSV,
downloadBiosampleCSV, downloadExperimentCSV) that are no longer used
after switching to discovery_matches endpoint.
…xport

- Use existing scopedAuthorizedRequestConfig utility instead of manually building params
- Switch from fetch to axios for consistency with rest of codebase
- Create useDownloadAllMatchesCSV hook to avoid passing state as parameter
- Remove unused useAuthorizationHeader import
…quests

- Create scopedAuthorizedRequestConfigFromParts to build config from auth + scope instead of full state
- Update useDownloadAllMatchesCSV to only depend on auth and selectedScope (not entire state)
- This prevents unnecessary callback recreation on unrelated Redux state changes
- Improves performance by reducing re-renders
Without _page_size=0, the endpoint would only return the default page size
instead of all matching results.
… types

Since we're using the discovery_matches endpoint with _format=csv,
export is automatically supported for all entity types (phenopackets,
biosamples, experiments, experiment_results). No need for per-entity
export configuration.
Copy link
Member

@gsfk gsfk left a comment

Choose a reason for hiding this comment

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

Working as expected.

The French filenames with English-only content are a little weird, but actual content of the csv is arguably out of scope here.

Copy link
Member

@davidlougheed davidlougheed left a comment

Choose a reason for hiding this comment

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

lgtm

@SanjeevLakhwani SanjeevLakhwani merged commit 00c29fa into main Nov 21, 2025
2 checks passed
@SanjeevLakhwani SanjeevLakhwani deleted the feat/csv-export-all-matches branch November 21, 2025 20:28
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.

4 participants