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

Sort shares by name in UI #973

Merged
merged 2 commits into from May 1, 2016

Conversation

Projects
None yet
2 participants
@maxhq
Contributor

maxhq commented Oct 21, 2015

The share list in Storage - Shares or in the dropdown on Storage - Samba is now sorted by name per default - IMHO this gives a nicer overview. This is done by making the API (class ShareListView) accept any object attribute in URL parameter sortby.

To discuss:
If sorting is not considered a relevant overhead even for a large number of shares, we could set a default server-side sorting by attribute name. Currently, if sortby URL parameter is NOT given, no sorting takes place.

maxhq added some commits Oct 21, 2015

ShareListView API now accepts any sort parameter
URL parameter "sortby" could only be set to "usage", now it can be set to any
attribute of the Share object. Also the "reverse" parameter is used.

To prevent unneccessary processing, no sorting is done if parameter is not set. 

The following query is now possible:
https://192.168.0.1/api/shares?page=1&format=json&page_size=15&sortby=name
ShareCollection requests sorted shares (by name)
The Javascript model makes use of the modified API and requests the share list
to be sorted by name.

This gives nicely sorted shares everywhere in the UI.
@maxhq

This comment has been minimized.

Show comment
Hide comment
@maxhq

maxhq Jan 22, 2016

Contributor

By the way, the idea of the sortby parameter was that it could be used later for other reporting, e.g. on a page that shows the biggest shares etc.

Contributor

maxhq commented Jan 22, 2016

By the way, the idea of the sortby parameter was that it could be used later for other reporting, e.g. on a page that shows the biggest shares etc.

@schakrava

This comment has been minimized.

Show comment
Hide comment
@schakrava

schakrava May 1, 2016

Member

@maxhq My apologies for taking a long time to merge this. For some reason, I mistakenly assumed you had closed this pr.

Thanks for your contribution!

Member

schakrava commented May 1, 2016

@maxhq My apologies for taking a long time to merge this. For some reason, I mistakenly assumed you had closed this pr.

Thanks for your contribution!

@schakrava schakrava merged commit 768f9f4 into rockstor:master May 1, 2016

@schakrava schakrava added this to the Kilauea Iki milestone Jun 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment