Content-Length: 310325 | pFad | https://github.com/decaporg/decap-cms/issues/3715

07 sortableFields should have default sorting options · Issue #3715 · decaporg/decap-cms · GitHub
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

sortableFields should have default sorting options #3715

Open
fbnlsr opened this issue May 7, 2020 · 9 comments
Open

sortableFields should have default sorting options #3715

fbnlsr opened this issue May 7, 2020 · 9 comments
Labels
area: ui/collection good first issue type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@fbnlsr
Copy link

fbnlsr commented May 7, 2020

Is your feature request related to a problem? Please describe.

Whenever I log into Netlify CMS, I have to always do the same operation so that the entries of a folder collection is displayed the way I'd like.

Describe the solution you'd like

I'd like if we could have an option in the sortableFields config so that we could specify a default order and display type. So for instance we could specify something like:

sortableFields:
  display: "grid"
  key: "commit_date"
  type: "desc"
  fields:
    - "commit_date"
    - "author"
    - "title"
@erezrokah erezrokah added the type: feature code contributing to the implementation of a feature and/or user facing functionality label May 7, 2020
@erezrokah
Copy link
Contributor

Thanks @fbnlsr, the sorting order and key should be persisted per collection, so you should only need to do it once (if that is not the case, can you please update to latest version and test again?).

The reason we didn't enabled a default sort is that it would require fetching all entries on initial load which can take some time (in large collections one might even reach the APIs limits).

Allowing to opt-in to it makes sense though.

The grid view not persisting is another issue unrelated to sorting.

@fbnlsr
Copy link
Author

fbnlsr commented May 7, 2020

You're right, order and key are persisted. Grid view is not.

If we could still be able to enforce it via config.yml that'd be great still. 🙂

@erezrokah
Copy link
Contributor

Just to make it clear - if a user manually sorts, that would override the config sort right?

@fbnlsr
Copy link
Author

fbnlsr commented May 7, 2020

I feel it makes sense yes. The config could be used as a starting point or as an order suggestion, but it shouldn't come at the experience of the user's experience.

That is unless we could "freeze" it and make it impossible for the user to sort it again once it's been set in the config. We could imagine another optional key in the config that would make it so the sorting would be impossible. In that case, the fields parameter would be ignored. So for instance in the following example, since allow_sorting is present and set to false, fields are not shown:

sortableFields:
  display: "grid"
  key: "commit_date"
  type: "desc"
  allow_sorting: false
  fields:
    - "commit_date"
    - "author"
    - "title"

@KancerEzeroglu
Copy link
Contributor

I would like to work on this issue 😄

@emre-eskimez
Copy link

For those who are wondering without official thing. You can find a localstorage entry called netlify-cms.entries.sort you can create this entry on local storage if there is none. With desired sorting. So when user logs in if there is none it will default to yours.

@tremby
Copy link

tremby commented Nov 7, 2024

Was this implemented, or why the closure?

@martinjagodic
Copy link
Member

This was not implemented, @fbnlsr is there a reason why you closed the issue?

@fbnlsr
Copy link
Author

fbnlsr commented Nov 7, 2024

Sorry I was doing some housekeeping on my GitHub and thought it was resolved. I'm reopening the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ui/collection good first issue type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/decaporg/decap-cms/issues/3715

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy