Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@HenriRabalais
Copy link
Collaborator

@HenriRabalais HenriRabalais commented Oct 10, 2024

Brief summary of changes

This PR reduces the strictness of the filter logic in the Filter.js component by adjusting the conditions for the exactMatch variable, functionally changing the multiselect filter from an AND to an OR boolean operators.

If this change is contentious, I can work on a way of have this be decided either by individual modules via a prop, or by use input by incorporating some sort of toggle button.

@HenriRabalais HenriRabalais added Beginner Friendly PR or Issue appears to be easy for someone to use to familiarize themselves with LORIS State: Discussion required PR or issue that requires the resolution of a discussion with the relevant parties to proceed labels Oct 10, 2024
@maximemulder
Copy link
Contributor

Hum, do you have a use case for this change ? I am not sure we want it if it is not used somewhere.

@HenriRabalais
Copy link
Collaborator Author

HenriRabalais commented Oct 25, 2024

The use-case is all uses of FilterableDatatable because this would influence the behaviour of multi-select filters across the board. The idea is that multi-select filters should function with OR behaviour rather than AND behaviour.

For example, if you want to filter based on projects and you want to select rows that include a given set of projects, currently that's not possible because it will make sure the row exactly matches the selected projects.

Let me know if that clears things up @maximemulder — if not i can try and provide a better example.

But in general I think this needs discussion, since it's a pretty large change and it might merit having some sort of optional toggle or module-specific configuration because users might be thrown off by the behaviour change. @ridz1208 and @driusan do you have any thoughts based on the PR description?

@maximemulder
Copy link
Contributor

Oh, hum okay, I do see a utility in your projects example. But I am not the best person to answer whether or not this is a desirable feature, so I guess we should either get a reply from the devs you pinged or talk about it at a LORIS meeting (every Tuesday at 11AM).

@skarya22
Copy link
Contributor

skarya22 commented Oct 29, 2024

Is it possible to have a parameter in addMultiselect that let's you choose if it is an OR or AND (default to OR)? I can see the possibility of a project wanting to allow users to be able to see when a participant as two visits such as both Baseline_V2a and Baseline_V2b in CCNA.
image
I think that it would make it less restrictive and prevent a future override from needing to be made.

So I feel like the I can work on a way of have this be decided either by individual modules via a prop would be beneficial

@maximemulder
Copy link
Contributor

We discussed this PR at the LORIS meeting and concluded that an OR is likely the most intuitive behavior. So this change is approved. @skarya22 makes a good point about the AND behavior also being desirable in some cases.

IMO we accept the OR as a default behavior (that is, this PR, I'll test it right away), and in the future we might want to add a switch to change the behavior depending on the user's needs.

Copy link
Contributor

@maximemulder maximemulder left a comment

Choose a reason for hiding this comment

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

Works on my machine !

@driusan driusan merged commit 1ea7737 into aces:main Oct 29, 2024
@maximemulder maximemulder added the Passed manual tests PR has been successfully tested by at least one peer label Oct 29, 2024
ZhichGaming pushed a commit to ZhichGaming/Loris that referenced this pull request Nov 25, 2024
…ces#9402)

This reduces the strictness of the filter logic in the Filter.js
component by adjusting the conditions for the exactMatch variable,
thereby functionally changing the multiselect filter from an AND to an OR
boolean operators.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Beginner Friendly PR or Issue appears to be easy for someone to use to familiarize themselves with LORIS Passed manual tests PR has been successfully tested by at least one peer State: Discussion required PR or issue that requires the resolution of a discussion with the relevant parties to proceed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants