Skip to content

Commit

Permalink
feat(website): filter by data use terms in download panel (#1218)
Browse files Browse the repository at this point in the history
* fix(website): don't show and apply hidden filters in Download Panel

* feat(website): filter by data use terms in download panel
  • Loading branch information
chaoran-chen authored Mar 3, 2024
1 parent c236a41 commit 7fbbc92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,16 @@ describe('DownloadDialog', () => {
await checkAgreement();

expect(getDownloadHref()).toBe(
`${defaultLapisUrl}/sample/details?downloadAsFile=true&versionStatus=LATEST_VERSION&isRevocation=false&dataFormat=tsv&field1=value1`,
`${defaultLapisUrl}/sample/details?downloadAsFile=true&versionStatus=LATEST_VERSION&isRevocation=false&dataUseTerms=OPEN&dataFormat=tsv&field1=value1`,
);

await userEvent.click(screen.getByLabelText(/Yes, include older versions/));
await userEvent.click(screen.getByLabelText(/Raw nucleotide sequences/));
expect(getDownloadHref()).toBe(
`${defaultLapisUrl}/sample/unalignedNucleotideSequences?downloadAsFile=true&dataUseTerms=OPEN&field1=value1`,
);

await userEvent.click(screen.getByLabelText(/include restricted data/));
expect(getDownloadHref()).toBe(
`${defaultLapisUrl}/sample/unalignedNucleotideSequences?downloadAsFile=true&field1=value1`,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const generateDownloadUrl = (
params.set(IS_REVOCATION_FIELD, 'false');
}
if (!option.includeRestricted) {
// TODO(#852) Filter for sequences with an open Data Use Term.
params.set('dataUseTerms', 'OPEN');
}
if (option.dataType.type === 'metadata') {
params.set('dataFormat', metadataDefaultDownloadDataFormat);
Expand Down

0 comments on commit 7fbbc92

Please sign in to comment.