Comments (50)
Still coming. Became a part of a bigger effort (π€¦ββ) but will be out soon.
from decap-cms.
Requesting some more flexibility here. What do you all think about accepting some optional yaml in the config that would result in both additional fields being displayed in the entry list, as well as making them sortable?
Something like:
collections:
- name: posts
label: Posts
folder: src/posts
create: true
fields:
- { name: title, label: Title, widget: string }
- { name: publishedDate, label: Published Date, widget: datetime }
- { name: editedDate, label: Edited Date, widget: datetime }
- { name: body, label: Body, widget: markdown }
sortableFields: ["title", "publishedDate", "editedDate"]
from decap-cms.
Any updates on this??
from decap-cms.
from decap-cms.
Waiting on this too - just been asked whether or not this is possible to do rather than the current alphabetical.
config only is fine - specifically wanting reverse date order (newest entries at top of list)
from decap-cms.
Latest decisions:
- Implement for all backends
- Control sorting via UI!
- This does not mean drag and drop, that's a whole other thing: #475
- Defaults:
- "Updated" - uses Git to sort files by most recently changed
- Inferred fields - title and date
- Configuration can be used to sort by any field
from decap-cms.
@mittalyashu Taking more space is preferable to having a confusing UI component. "Ascending" and "Descending" are sort directions and should be separate from the list of fields to sort by. Not to mention that the way they're displayed there implies you can somehow select both at once.
from decap-cms.
I spoke w/ @Benaiah recently about using sha's to pseudo cache. The big 3 Git hosts all provide some kind of commit diffing via API:
With the ability to see files that changed between two commits, we can create a sort of index in a data file in your repo, updating changed bits on load, and never needing to download all entries (except to create the original cache, or if the cache is somehow lost).
Still some work to do on the concept, but it does feel feasible.
from decap-cms.
Wow! Enfin! Congratulations on closing this one. It's been more than 3 years waiting for this! Good Job team!
from decap-cms.
@barbalex question: we're about to implement this, but initially it will be config driven, so you can set the sort in config but won't be able to change it in the UI. Regardless of whether it's too late to actually use it for your client, I'm curious whether what I'm describing would satisfy your requirements?
Sent with GitHawk
from decap-cms.
This is next on our list. We needed to pay off some tech debt to make this happen (#3316)
from decap-cms.
I agree with @Herohtar. Also: it does not have to take up extra space. If you move the asc/desc icon out of the select box and use it as a button you'd have the outcome I mean.
from decap-cms.
It seems to me that currently we have paginated entries, but at the expense of:
- ability to order entries
- ability to filter entries
- ability to search entries
For me this is a poor tradeoff. Implementation of the above three items is a pretty critical feature for any CMS if it is to scale at all. Given that it seems that it is unlikely that the above three features are going to be implemented across all backends due to differences in how they handle pagination, how about making the pagination of results optional? This would allow the above features to be implemented for collections that are not set to paginate. I know the feedback from the people using my build is that it is virtually unusable without a means of searching or ordering entries, whereas pagination is just a nice-to-have feature that has very little or no effect for relatively small collections.
In short, I feel like the tradeoff between pagination and the above features is not a good one.
from decap-cms.
@erquhart Yes, config would suffice as entries would be sorted by a date field, descending. Plus: I can wait a few weeks. Looking forward to this feature!
from decap-cms.
Very impressed with many aspects of this project, but from the perspective of someone evaluating different static CMS tools, having content show up in hard-coded reverse-alphabetical order is a fairly glaring deficiency, and makes it unsuitable for production use. Not being a React expert, I can't even find where in the source to change this.
I'd be happy just to have a simple config option control this, and that might be simpler to implement.
sort: [fieldname] [asc|desc]
In the meantime, is someone able to point me to the source where this is hard-coded?
from decap-cms.
That's a part of the plan, I expect repo indexes to play a big role in many features and improvements in the future. Initially this will likely all be in memory. Perf won't be great for large collections, but it will initially be configuration driven (no UI sort selection), so the impact will be limited.
Sent with GitHawk
from decap-cms.
Bump, my file names are numeric based, and it's annoying that right now it sorts by, without any option to sort by date
1.md
10.md
11.md
2.md
3.md
from decap-cms.
In v3-ui-redesign
we are working on exactly this. Weβve created this list view where you can click on the table headings and also drag items in a custom order.
Check it out here...
https://storybook.netlifycms.org/?path=/story/components-table--table
from decap-cms.
I have created this. It is similar to what @phae said.
Check the source file.
from decap-cms.
Looks good! I would split the ascending / descending functionality from the select box though. So a select box to select the sort modifier and one button to switch between ascending and descending.
from decap-cms.
Is this request really 2 years old? This is so important!
from decap-cms.
Some repos using Netlify CMS have thousands of entries in a single collection, so requiring that they all be loaded up front is a non-starter.
I agree, and I appreciate that most apis will paginate results, that's why I'm suggesting making pagination something that can be opted out of. For many, probably the majority of cases, there is little or no need for pagination, and it would be fine to load everything up front. Just suggesting that by allowing a collection to opt out of pagination, it could at the same time opt-in to ordering entries, filtering entries and searching entries. At the moment, these crucial features are not available due to the difficulty of their implementation alongside enforced pagination.
from decap-cms.
Opting out of pagination by loading all posts up-front is possible - thereβs existing code to do so for search in the GitLab and BitBucket backends. It could be an option for small sites, though the latency upfront can become large very quickly. The CMS would also have to load them every time it detects a change in the repo, meaning this cost would be incurred multiple times in a single CMS session.
from decap-cms.
Best thing you can do is up vote the issue as we use it for prioritization. This is currently number 4: https://github.com/netlify/netlify-cms/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc
from decap-cms.
That's where commit diffing comes in.
from decap-cms.
I'd be happy just to have a simple config option control this, and that might be simpler to implement.
sort: [fieldname] [asc|desc]
@chocobuckle I think he means that you can control sorting from the UI as opposed to the comment I quoted. Drag and drop is more related to #475
from decap-cms.
@wing5wong I plan to virtualize these rows with react-window
. So it should handle 200+ items easily.
from decap-cms.
That will take too much of space from design prospective. Why not just keep inside a single component.
I know the title of the button is wrong, but the image is just to show the design.
from decap-cms.
Okay, I will try and do some brainstorming π.
from decap-cms.
@JasonHanley That is an interesting thought. I never considered hacking it myself :D
I have not really taken time to analize it well, but my bet would be in this file:
Either line: #50 or #55. Not sure which one of those 2 methods is used, but I would bet that one of those 2 arrays (or maybe boths) need a sort
function.
from decap-cms.
Note that this is more complex than it seems - in many cases you're dealing with a paginated list, in which case more entries load as you scroll. Sorting would therefore have to be supported by the backend in use, or else we need to load all pages up front before sorting.
Sent with GitHawk
from decap-cms.
Ugh, I do see the trickiness, assuming you're using something like https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/src/%7Bnode%7D/%7Bpath%7D to list the files in a folder.
The best you could do is sort by file name or file size. In that case, I don't see any way to avoid loading, parsing, and caching all entries upfront. It's a bit of a shame you have to load the entire file just to get the front matter.
from decap-cms.
We didn't choose pagination - the Bitbucket and GitLab API's (and pretty much every normal API out there) returns paginated results. Some repos using Netlify CMS have thousands of entries in a single collection, so requiring that they all be loaded up front is a non-starter. As GitLab and Bitbucket support were the most requested features by a wide margin, we had to take the good with the bad.
Again, we can start this off with a backend agnostic solution in core and an implementation in the GitHub backend. I don't love having features supported in only one backend, but it's better than nothing.
from decap-cms.
I see that this issue is included in the dev cycle ending on 29th of March. Will this mean that we can soon see some sorting within the netlify cms?
from decap-cms.
I had almost decided on using netlify-cms for two projects. Then I realized that not being able to sort was a no-go for my client :-(
I understand the problems and realize it is hard to solve. Aside from this: great project!
from decap-cms.
@erquhart is this still on the roadmap?
from decap-cms.
Absolutely, just didn't get it out as soon as I had hoped.
Sent with GitHawk
from decap-cms.
Great that this is being developed now. Sorting is the last major hurdle for our clients too.
How is this going to work with sorting by custom fields? Is this now part of the acceptance criteria as per @loremipson's suggestion?
With hundreds of pages, I'd imagine this could get quite slow as we'd be bombarding {your git host} with requests on every single client-side sort. So, will the CMS maintain in-repo index files? eg.
`/.netlify-cms/indexes/${collection}/${field}.json`
from decap-cms.
Any updates on this? Config only is fine for our case as well.
from decap-cms.
I would like you may add this feature to the CMS, it would be great to be a able to decide how to sort the items of different collections in the CMS.
from decap-cms.
Would love an update on this.
Currently no way to sort in a decent way? Best workaround I've found is using "{{year}}-{{month}}-{{day}}" or similar as slug. However, when updating an item NetlifyCMS is not updating filenames.
Am I doing something wrong or are we missing this very basic and crucial feature?
from decap-cms.
definitely an up vote for this feature.
from decap-cms.
Any update on this?
from decap-cms.
I would hope we could filter by draft/published status as well.
from decap-cms.
@erquhart By "sort in ui", do you mean we'll be able to click and drag items to new positions?
from decap-cms.
Just in case you have note considered it yet: A couple of days ago I found a wonderful "a table enhancing plug-in for the jQuery Javascript library" on Github, which might add wonderful sorting, filtering and grouping features to the great NetlifyCMS solution. See https://github.com/DataTables/DataTables for more information.
from decap-cms.
Will this implementation deal with a large list as well - say 200 + items
from decap-cms.
Glad to be able to unsubscribe from this, thank you team
from decap-cms.
Congrats on this implementation @erezrokah @erquhart it works really well π :)
My team have a long lists of post and want to have the latest post first, because it's not always easy to remember the name of a post you're looking for to find it and edit it. Latest-post-first is how we present posts on the frontend, and it's not obvious to them why it would be different on the back-end.
Is it possible to set a date
field to be the default from sortableFields
and control the direction? or would that be a new feature?
from decap-cms.
@equivalentideas Thanks π
The reason for not to have a default sort was that sorting requires reading all entries (since it's done client side) which can take some time with large collections, and once a user sorts a collection, that preference is persisted so it's a one time thing.
With that said, since this is not the first time I've heard of that request it's looks like it would make sense to be able to opt in to a default sort method with the cost of a slow first load.
Does that makes sense? Do you mind opening a feature request with your suggestion?
from decap-cms.
Related Issues (20)
- Specifying a default publish_mode value
- NotFoundError: Node.removeChild: The node to be removed is not a child of this node HOT 1
- NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child o... HOT 2
- Integrating Compressor.js for image uploading optimization HOT 2
- Use GitHub Apps instead of OAuth for the GitHub Backend
- Unable to create custom formatter: TypeError: r.getIn is not a function
- Integrate netlify-identity-widget capabilities into Decap CMS. HOT 1
- Implement editorial workflow for Gitea / Forgejo backend HOT 2
- IndexSizeError: Failed to execute 'setStart' on 'Range': There is no child at offset 4. HOT 1
- NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child o... HOT 1
- Delete the value of an optional text/image widget results in an empty string value
- Multiple blank lines support in Rich text Editor HOT 1
- TypeError: t.get is not a function HOT 1
- Deleting a bullet point in rich text editor crashes CMS HOT 1
- windows dev-test environment markdown issue - process.cwd, vfile
- Error: Cannot find a descendant at path [3,5] in node: {"children":[{"type":"paragraph","children... HOT 1
- Error: Cannot find a descendant at path [3,5] in node: {"children":[{"type":"paragraph","children... HOT 1
- Sort features on blog page HOT 1
- Error when trying to change image in gallery HOT 1
- `picker_utc` of datetime widget is broken in #6980, resulting in a timezone mismatch HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from decap-cms.