-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
need to handle pages of messages in admin panel #503
Comments
The current API simply returns all the messages for a handle, which are then sorted and grouped into threads/conversations. These threads (stored in the context) are displayed in the messaging inbox. |
Just testing a bit, I noticed you can limit the messages with calls to the api using the limit and offset query parameters. Here is an example: '/messaging/message?handle=admin&limit=10&offset=10'. This gives you 10 messages from the 10th message. @nmcharlton I am happy to work on this! I will try to get this done later today or by Thursday of next week. |
@pranavkparti and @ZavenArra - @pranavkparti You were right, you do need to sort those on the backend first. You have to return the messages grouped by the "to" and "from" handle and not just the user handle like it is now. The API should probably have an endpoint that will let you pull messages for a single conversation ( i.e. from 'admin' and to 'handle@test' instead of from 'admin' OR to 'admin' ) or maybe use the parent_id field? Otherwise, the best you can do is infinite load from the array of messages. I did do this. That way, if you fix the API, it will be easy to add the additional fetch. In the meantime, it will infinite load/render which means it will render faster at only 10 initial items per conversation. One big problem - the scrollToBottom keeps interfering with the first initial scrollUp.@pranavkparti Would you be able to look into it and maybe see if it is obvious to you where the issue is? I have my code at https://github.com/sleddd/treetracker-admin-client/tree/messaging-infinite-scroll - I did not want to officially pull request until it was ready. The commit to look at is: sleddd@c76f638 |
Hy can you please assig this to me |
base query should load 10-20 most recent messages for each handle - new logic in API
subsequent scroll upward should load messages in pages
account and handle?
conversation/thread/something
with?
additional question about paging for survey responses..
The text was updated successfully, but these errors were encountered: