-
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-58: paginate concepts in a dictionary #70
Conversation
3b5fee3
to
e6f126e
Compare
Pull Request Test Coverage Report for Build 355
💛 - Coveralls |
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
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
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
} | ||
|
||
fetchConcepts(query = '', limit = 10, filterParams = null, filterName = null) { |
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.
Does the change from limit 10 to 0 mean you are paginating from client instead of server?
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.
yes, it's faster.
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 also needed to get the total number of concepts at every point in time whether I'm searching or filtering.
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.
What happens when a server has too many concepts? Do you still want to load all of them to the client?
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.
yeah, for now, that's the only way to get the total number of concepts while filtering by sources or class.
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 understand what you are saying, my point is I need to get the total number of concepts each time I fetch the concepts from the server, right now it will not be possible if I use the limit parameter.
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.
So with your change, are you simply getting the total number of concepts? Or are you actually getting the 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.
I'm getting the concepts. There's currently no way to get only the total number of concepts when filtering or searching.
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.
So my point is, the original code was safer because it does not load all the concepts. And this was achieved by the use of the limit parameter. Getting rid of this parameter looks like a design mistake unless you can convince me otherwise.
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.
The initial code was a quick hack, I only got the total number of concepts in a dictionary because I saved it in the localStorage. The issues with the initial code are as follows:
- when a filter returns eleven concepts, the user will only see ten with no idea there could be more because there's no way to know if there's actually more.
- The filter sidebar cannot be populated with items that are not available. i.e - if the first ten concepts are from the same source or class, the sidebar will be populated by only that type of source. This will clearly defeat the aim of having the sidebar.
- There are other reasons why I have to fetch everything first, but I will stop here. Refer to the images below for more clarity about my second point.
JIRA TICKET NAME:
As a user, I should be able to see all the concepts in my dictionary with proper pagination
Summary:
Return all concepts in a particular dictionary with proper paginations.
each page should not have more than 10 results
each page should have a previous and next button
infinite scroll could be used but not necessarily