CRUD icon indicating copy to clipboard operation
CRUD copied to clipboard

[v6][Bug] Columns created from field definition arrays still have their classes

Open tabacitu opened this issue 2 years ago • 1 comments

Bug report

What I did

In the DEMO, we create the columns in ColumnMonsterCrudController out of fields that have wrapperAttributes:

            [   // Month
                'name'              => 'week',
                'label'             => 'Week'.backpack_free_badge(),
                'type'              => 'week',
                'wrapperAttributes' => ['class' => 'form-group col-md-4'],
                'tab'               => 'Time and space',
            ],

What I expected to happen

Show a clean column.

What happened

Some columns do NOT show a clean output, because they keep those classes on the wrapper attributes.

What I've already tried to fix it

Nothing. Right now in the DEMO we manually remove those classes. I'm not sure we should do something about it... I kind of EXPECT that, to be honest. But it's worth talking about this in a team setting. What do you guys think we should do @pxpm & @jorgetwgroup ?

tabacitu avatar Feb 27 '23 09:02 tabacitu

We talked about the possibility to create: addColumnsFromFields($fields) method that would strip the required stuff to make the fields work as columns. In the mentioned example, the bootstrap sizing classes.

pxpm avatar Jun 01 '23 11:06 pxpm