agentejo / cockpit

Add content management functionality to any site - plug & play / headless / api-first CMS
http://getcockpit.com
MIT License
5.4k stars 523 forks source link

Since update, collection view is broken for sortable entries #836

Closed PaulBouisset closed 5 years ago

PaulBouisset commented 6 years ago

Since I update cockpit to "0.6.13" the view to see the entries in collection is completely broken. After the update everything is fine, data is still here, but the collection that have the option "Custom sortable entries" enable are not displayed correctly (see screenshot). I can't change the project list from row to cards and only two fields are display. It make the re-ordering impossible because I can't see any information about the entries. If I disable the "Custom sortable entries" the view is back to normal but of course I can't re-order entries anymore.

Do you know where this bug could come from ?

capture d ecran 2018-08-11 a 07 56 23

Thank you for your help, Cockpit is a great tool

raffaelj commented 6 years ago

I don't know the history, but I have this behavior, too. The mechanism comes from https://github.com/agentejo/cockpit/blob/next/modules/Collections/assets/entries-tree.tag#L207-L208

It displays only the first and second entries and in the tree view there are list-items instead of a table. I would say, it's work in progress...

workaround 1:

Reorder your fields to display the relevant parts (title, name, whatever).

workaround 2:

Change the values in the linked lines above from "2" to "4" and adjust some classes for a better visual experience here: https://github.com/agentejo/cockpit/blob/next/modules/Collections/assets/entries-tree.tag#L156-L177 But this would be overwritten with the next update.

workaround 3:

Do the stuff from workaround 2, add a way to configure the number of displayed items or the priority of displayed items in sortable view and open a pull request :-)

PaulBouisset commented 6 years ago

Thanks, but what I am not sure to understand is where the behavior comes from. Before the update you could easily re-order items in list or table view. Something in the last update might have broke it and it's not possible anymore to change the view of "custom sortable entries".

I don't want to downgrade my cockpit version just for this feature but it was a essential one.

raffaelj commented 6 years ago

Now I see your problem.

Which version and which branch did you use before? Was it before entries were nestable? If so, this might be the start of the behavior: start to rework custom sortable collections to allow nestable entries… from 18 Apr.

I didn't use cockpit before May 2018, so I never noticed the old layout. I also use the next branch to have all the cool new features (and to see and sometimes solve interesting problems).

It seems, some features got lost during the rewrite from sortable to nestable... but it's too much code to understand it on the fly. I think, I can't help you with this for now.

PaulBouisset commented 6 years ago

When I start using cockpit it was on the "next" branch and it was beginning of February 2018. Sorry I don't remember the exact version.

Thanks anyway for your help, I will try to trace back what caused the problem and post it there in case I find a solution. The behavior you pointed seems to be a good start to investigate.

aheinze commented 6 years ago

This is not a bug but an evolution of the sortable setting to allow item nesting. I would also recommend to put the fields in the right order so you can identify your items more easily.

I'm sorry to say but a table layout for custom sorting won't come back.