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

220 - Fix: Filters disappear when the filters results is 1 file #226

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'develop' of https://github.com/IQSS/dataverse-frontend
…into fix/220-filtering-on-files-tab-and-there-is-only-one-file
MellyGray committed Dec 11, 2023
commit 240a4fcf041ff0eff3a93780f22449b8bc497f83
Original file line number Diff line number Diff line change
@@ -18,12 +18,9 @@ export function FileCriteriaForm({
onCriteriaChange,
filesCountInfo
}: FileCriteriaInputsProps) {
if (
!filesCountInfo ||
(filesCountInfo.total < MINIMUM_FILES_TO_SHOW_CRITERIA_INPUTS && !criteria.someFilterApplied)
) {
return <></>
}
const showFileCriteriaInputs =
filesCountInfo &&
(filesCountInfo.total >= MINIMUM_FILES_TO_SHOW_CRITERIA_INPUTS || criteria.someFilterApplied)
return (
<div className={styles['criteria-section']}>
<Form>
Original file line number Diff line number Diff line change
@@ -294,7 +294,7 @@ describe('FileCriteriaForm', () => {
const criteria = new FileCriteria()
.withFilterByTag('document')
.withFilterByAccess(FileAccessOption.PUBLIC)
.withFilterByType('image')
.withFilterByType('image/png')

cy.customMount(
<FileCriteriaForm
@@ -304,7 +304,7 @@ describe('FileCriteriaForm', () => {
/>
)

cy.findByRole('button', { name: 'File Type: Image' }).should('exist')
cy.findByRole('button', { name: 'File Type: PNG Image' }).should('exist')
cy.findByRole('button', { name: 'Access: Public' }).should('exist')
cy.findByRole('button', { name: 'File Tags: Document' }).should('exist')
})
You are viewing a condensed version of this merge commit. You can view the full changes here.