-
Notifications
You must be signed in to change notification settings - Fork 77
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
OCLOMRS-1047:List of concepts - Text search and filters don't work anymore #743
Conversation
includeAdded: generalFilters.includes("Include Added Concepts") | ||
}); | ||
} | ||
retrieveConcepts({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @suruchee have you also tested on a working instance of ocl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix @suruchee , it is working well but I tried to keep most of what we had and only add the necessary dependencies to the useEffect
and it still works, let's do that so that we don't break some other parts.
useEffect(() => { | ||
setContainerUrl(url.replace("/concepts", "")); | ||
}, [url]); | ||
const containerUrl = url.replace("/concepts", ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might not need to remove this useEffect, it might cause some bugs
containerType === SOURCE_VERSION_CONTAINER | ||
? retrieveSource(containerUrl) | ||
: retrieveDictionary(containerUrl); | ||
// we don't make this reactive(only depend on the initial values), because the requirement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also let's keep this if
condition so that it only runs when there is a url
}, [retrieveConcepts, retrieveDictionary, retrieveSource, containerUrl]); | ||
|
||
}, [ | ||
retrieveConcepts, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove the retrieveDictionary, retrieveSource and containerUrl
, let's keep them there, the only problem was that we were not including the initialQ
, url
, page
, limit
and there other params in the dependecies, with that only change it works as expected, so let's keep what was there and add url, page, limit, initialQ and others
that way we won't affect some other work or have bugs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @hadijahkyampeire, I have updated with your suggestions.
Also, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the fix.
@suruchee this same work has been covered in @jwnasambu PR, you should rebase and maybe make this PR fix the clear filters bug. |
Hi @ibacher and @hadijahkyampeire, the clear all button works with the code changes but only works in double click, I also tried changing dependency in viewConceptsPage but did not work. Can you guys have a look? |
|
||
const clearAllFilters = () => { | ||
setCheckedClasses([]); | ||
setCheckedDataTypes([]); | ||
setCheckedGeneral([]); | ||
setCheckedSources([]); | ||
goTo(url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually wonder about this... Right now the behaviour is that I click each filter and then click the "APPLY FILTERS" link to actually update the view. The logic behind the way the "CLEAR ALL" button currently work is that it's just clearing the filters as if you had cleared them manually. You still need to click "APPLY FILTERS" for the changes to make.
I think the question is: is the user experience expectation that clicking on the "CLEAR ALL" button removes all the filters and updates the table, or do we want to just clear all the filters and let the updating of the table take place after the user has reset their filters.
There are two reasons I might click on the "CLEAR ALL" button:
- I really want to go back to the view of all concepts.
- I just want to clear out the filters I previously had so I can create a new set of filters.
This new behaviour obviously makes the flow easy for 1, but is it the right flow for 2?
And in either case, I would update this PR to reflect what this change actually does (i.e. reloads the table when clicking "CLEAR ALL") rather than the now disconnected ticket it was first attached to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the "CLEAR Filter" button should remove all the filters, update the url and make a request since the URL has changed so that the user goes back to the view without filters but we should remember to keep page and q
since they are not attached to the other filters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
q
makes sense to keep, but not page
if we're making a new query (why would I want to be on page 5 of all the concepts after having been on page 5 of all the question concepts?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be great @ibacher if you can update this PR with that fix, I will update the ticket description to capture the clear filter changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right @ibacher , now I see it for the page
setting to 1
, though given where the clear filters button is placed it looks like it's only for clearing the filters in the sideBar and not anything else. But I think that's a minor UX thing, now that I think of it, it's probably what the user expects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @hadijahkyampeire, and @ibacher I think we should leave it as it is for now. So, just closing the PR.
JIRA TICKET NAME:
Clear Filters button does not work well
Summary: