Skip to content
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

Add sorting functionality to list requests #316

Closed
kschiffer opened this issue Mar 19, 2019 · 5 comments · Fixed by #1785
Closed

Add sorting functionality to list requests #316

kschiffer opened this issue Mar 19, 2019 · 5 comments · Fixed by #1785
Assignees
Labels
c/identity server This is related to the Identity Server compat/api This could affect API compatibility in progress We're working on it
Milestone

Comments

@kschiffer
Copy link
Contributor

Summary:
RPC call returning a list should support a sort option, to sort by a specific field either ascending or descending.

Why do we need this?
Sorting only by the id is not always desirable. Console users will likely also want to sort by creation date or something else.

What is already there? What do you see now?
The list protos already have an interface for this:

  // Order the results by this field path (must be present in the field mask).
  // Default ordering is by ID. Prepend with a minus (-) to reverse the order.
  string order = 3;
  // Limit the number of results per page.
  uint32 limit = 4;
  // Page number for pagination. 0 is interpreted as 1.
  uint32 page = 5;

What is missing? What do you want to see?
However, setting the sort value does not appear to have any effect yet. (While limit and page values work as expected)

How do you propose to implement this?
@htdvisser

Environment:
Making requests via the http bridge of gRPC.

What can you do yourself and what do you need help with?
Help.

@kschiffer kschiffer added the compat/api This could affect API compatibility label Mar 19, 2019
@kschiffer kschiffer added this to the Next Up milestone Mar 19, 2019
@htdvisser
Copy link
Contributor

Implementation wise this would involve translating the field mask path (which is the value of the order field) to the database column name and passing that to the SQL ORDER instead of ids.

@htdvisser htdvisser modified the milestones: Next Up, April 2019 Mar 26, 2019
@htdvisser htdvisser modified the milestones: April 2019, Next Up Apr 10, 2019
@johanstokking johanstokking modified the milestones: Next Up, Backlog Jun 20, 2019
@johanstokking
Copy link
Member

Pushing to Backlog. Let's consider this again based on user feedback

@rish-c
Copy link

rish-c commented Dec 11, 2019

Sorting gateways would be good to add in the console. Possible fields could be

  • Connected / Not connected
  • Data added
  • Owner
  • labels (location, site, indoor, outdoor etc.)

cc @kschiffer

@htdvisser
Copy link
Contributor

It's relatively easy to implement sorting on:

  • ID
  • EUIs (Gateways, End Devices)
  • Name
  • Created At

It's more work to implement sorting on:

  • Attributes

It's currently not possible to sort on:

  • Owner: we don't have the concept of owner in v3. We have (multiple) members with (different) rights and we can't sort on those.
  • Connected (Gateways): This is not known by the Entity Registry.
  • Last Seen (Gateways, End Devices): This is not known by the Entity Registry.

@htdvisser htdvisser added the c/identity server This is related to the Identity Server label Dec 12, 2019
@kschiffer
Copy link
Contributor Author

Frontend-wise it's more or less a matter of re-activating our logic for sorting in our list views, so this is mostly blocked on the backend side.

@htdvisser htdvisser modified the milestones: Backlog, January 2020, December 2019 Dec 23, 2019
@htdvisser htdvisser added the in progress We're working on it label Dec 24, 2019
@htdvisser htdvisser mentioned this issue Dec 24, 2019
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/identity server This is related to the Identity Server compat/api This could affect API compatibility in progress We're working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants