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

[DT-777] Filter by participant count #2733

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

rjohanek
Copy link
Contributor

@rjohanek rjohanek commented Nov 21, 2024

Addresses

Jira Ticket: https://broadworkbench.atlassian.net/browse/DT-777

Summary

Adds a filter for participant size

DatasetSearchTable:

  • generalize the filter handler to work for non-Array filters
  • generalize the numFiltersSelected method to work for non-Array filters
  • update assembleFullQuery to include range chunk
  • rename isFiltered to isFilteredArray because it is only used for array filters
  • remove unused arguments to filterHandler and unused prop to DatasetFilterList

DatasetFilterList

  • add new filter range constant
  • add new filter to the filter list

Visual

Screen.Recording.2024-11-21.at.9.59.40.AM.mov

To Do

Unit tests


Have you read Terra's Contributing Guide lately? If not, do that first.

  • Label PR with a Jira ticket number and include a link to the ticket
  • Label PR with a security risk modifier [no, low, medium, high]
  • PR describes scope of changes
  • Get a minimum of one thumbs worth of review, preferably two if enough team members are available
  • Get PO sign-off for all non-trivial UI or workflow changes
  • Verify all tests go green
  • Test this change deployed correctly and works on dev environment after deployment

@rjohanek rjohanek requested a review from a team as a code owner November 21, 2024 14:57
@rjohanek rjohanek requested review from pshapiro4broad and snf2ye and removed request for a team November 21, 2024 14:57
Copy link
Member

@pshapiro4broad pshapiro4broad left a comment

Choose a reason for hiding this comment

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

Looks OK, just a few misc comments.

src/components/data_search/DatasetSearchTable.jsx Outdated Show resolved Hide resolved
Comment on lines 61 to 62
} else {
if (filters[category]) {
Copy link
Member

Choose a reason for hiding this comment

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

I would combine an if after an else here

Suggested change
} else {
if (filters[category]) {
} else if (filters[category]) {

src/components/data_search/DatasetFilterList.jsx Outdated Show resolved Hide resolved
src/components/data_search/DatasetSearchTable.jsx Outdated Show resolved Hide resolved
Copy link
Contributor

@fboulnois fboulnois left a comment

Choose a reason for hiding this comment

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

I like most of @pshapiro4broad 's suggestions! The only one I'm not sure about is the filterHandler refactor.

import DatasetFilterList from '../../../src/components/data_search/DatasetFilterList';

const duosUser = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unused

{method: 'POST', url: '**/api/dataset/search/index'}, handler).as('searchIndex');
mount(<DatasetSearchTable {...props} />);
cy.get('#participantCountMax-range-input').clear().type('50');
cy.wait(1000).then(() => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

when I wait on 'searchIndex' it doesn't work I think because there is another call to this api without the filters applied first

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.

5 participants