talawa-api icon indicating copy to clipboard operation
talawa-api copied to clipboard

Add more options to UserOrderByInput

Open pranshugupta54 opened this issue 11 months ago • 14 comments

Is your feature request related to a problem? Please describe. Implement more options to filter for users

Describe the solution you'd like Add options like created_ASC and created_DESC to UserOrderByInput

Currently: image

Additional context Users are fetched on frontend in different sets, example $first:10 but API has no option to fetch Newest first or Oldest first, whereas Admin panel has the filtering on frontend which messes up the order. Reference: PalisadoesFoundation/talawa-admin#1706

Potential internship candidates Please read this if you are planning to apply for a Palisadoes Foundation internship https://github.com/PalisadoesFoundation/talawa/issues/359

pranshugupta54 avatar Mar 10 '24 19:03 pranshugupta54

I would like to work on this

rahulch07 avatar Mar 10 '24 19:03 rahulch07

@pranshugupta54 @Huy1996 @palisadoes There is no need of adding more filtering options.

https://github.com/PalisadoesFoundation/talawa-api/assets/87270395/14add95e-1436-4ebf-8367-fa951cbfc0da

Out of all the fetched users the sortUsers function in User.tsx sorts all the user on basis of time at which they were created. image

So, I think there is no need to add an option to fetch Newest first or Oldest first users.

Please provide your thoughts on this.

rahulch07 avatar Mar 14 '24 19:03 rahulch07

@rahulch07, check this - https://www.loom.com/share/5c39a600c172446fbb3c8fb6d2a7c30c?sid=47b71f0e-3566-4512-9dbe-31b7538aac37

So basically at first, backend sends us 12 users then frontend sorts it. Then on scrolling, backend sends us new 12 users so total 24 users and now frontend sorts them.

But backend doesn't send them in sorted order, so if we want NewestFirst then backend should send sorted 12 itself.

pranshugupta54 avatar Mar 14 '24 19:03 pranshugupta54

But is this the intended design goal? @Huy1996 @palisadoes Please clarify.

rahulch07 avatar Mar 15 '24 12:03 rahulch07

The infinite scroll design is intended but the data is incorrect. If user selects Newest then we should get newest sequence from all existing users and not only those 12 users

pranshugupta54 avatar Mar 15 '24 13:03 pranshugupta54

@pranshugupta54 @Huy1996

Is this the expected result?

https://github.com/PalisadoesFoundation/talawa-api/assets/87270395/d2c2a643-bb28-4186-9cd8-1a30bc6195d8

Scrolling is smooth and do not jump to last user

rahulch07 avatar Mar 20 '24 13:03 rahulch07

Yes looks good now, the data doesn't change on scrolling

pranshugupta54 avatar Mar 20 '24 13:03 pranshugupta54

UserThirtySix is the latest added user then UserThirtyFive and so on, therefore UserThirtySix appears first on newest. Similarly for oldest it goes last

rahulch07 avatar Mar 20 '24 13:03 rahulch07

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

github-actions[bot] avatar Mar 31 '24 00:03 github-actions[bot]

Making PR soon.

rahulch07 avatar Mar 31 '24 12:03 rahulch07

Working on test cases

rahulch07 avatar Apr 10 '24 18:04 rahulch07

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

github-actions[bot] avatar Apr 21 '24 00:04 github-actions[bot]

Unassigning due no activity or open PR

Cioppolo14 avatar Apr 21 '24 14:04 Cioppolo14

@Cioppolo14 I was not able to make a PR as I was working on another issue. Please reassign me I will open a PR this week. Thanks

rahulch07 avatar Apr 23 '24 07:04 rahulch07

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

github-actions[bot] avatar May 04 '24 00:05 github-actions[bot]

working on it

rahulch07 avatar May 04 '24 04:05 rahulch07

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

github-actions[bot] avatar May 16 '24 00:05 github-actions[bot]