CRUD icon indicating copy to clipboard operation
CRUD copied to clipboard

Add List order support for translatable models

Open pxpm opened this issue 3 years ago • 2 comments

WHY

BEFORE - What was wrong? What was happening before this PR?

This is a redo of #4176 . Thanks @guleswine for the contribution, I merged your PR here but needed to re-factor it cause the structure of ListOperation changed.

TLDR: Translatable fields are not orderable in ListOperation.

AFTER - What is happening after this PR?

Checking if column is JSON, if it is, we can safelly apply the JSON->order synthax.

Is it a breaking change?

I don't think so, no.

How can we test the before & after?

Try to order the name column in the Products controller.

pxpm avatar Sep 03 '22 10:09 pxpm

Hi @pxpm i try to reproduce this error but i cant.

Product table on demo have name, description and others as json field type on database (mysql) Screen Shot 2022-09-12 at 19 16 09

I go to list view and try to reorder, everything works i try in "main" branch Screen Shot 2022-09-12 at 19 16 21

Do i miss something?

Cheers.

jcastroa87 avatar Sep 12 '22 22:09 jcastroa87

Hey @jorgetwgroup I don't think A->M->T->A (the initials on the name column) are ordered ... 🙃

Cheers

pxpm avatar Sep 16 '22 11:09 pxpm

Hi @pxpm

OMG, in my defense, im very good with numbers, but now i discovery my weakness (letters) 😢

I check this with main branch

screenshot-backpack test-2022 09 22-16_46_20

Then with pr/4176 branch

screenshot-backpack test-2022 09 22-16_46_38

Everything work great!

For me look ready, but i understand is needed to sync with https://github.com/Laravel-Backpack/CRUD/pull/4649

@tabacitu is in your hands now

Cheers.

jcastroa87 avatar Sep 22 '22 19:09 jcastroa87