CRUD icon indicating copy to clipboard operation
CRUD copied to clipboard

Columns prefix and suffix on wrapper

Open promatik opened this issue 4 years ago • 10 comments

Related with https://github.com/Laravel-Backpack/CRUD/pull/3435.

This adds ability to add prefix and suffix to each column wrapper.

promatik avatar Feb 01 '21 14:02 promatik

Note to self: we also talked about adding a wrapper[separator] attribute. Details in https://github.com/Laravel-Backpack/CRUD/pull/3435#issuecomment-769476582

tabacitu avatar Feb 01 '21 14:02 tabacitu

A new inspection was created.

scrutinizer-notifier avatar Sep 10 '21 07:09 scrutinizer-notifier

@promatik time to merge / close this. Still think it's a good idea & implementation? If so, please ask @pxpm to test & merge.

tabacitu avatar Oct 24 '22 16:10 tabacitu

Bump! @promatik do you still think this is worth doing?

tabacitu avatar Nov 07 '22 17:11 tabacitu

I think this is pretty cool 🤷‍♂️

image

And it can only be achieved with this feature, or, by hacking into the getFieldAttribute() { return "¿$this->field?";


Another example;

image
[
    ...
    'wrapper' => [
        ...
        'prefix' => '¿',
        'suffix' => '?',
    ],
    'prefix' => '—',
    'suffix' => '!',
],

promatik avatar Nov 21 '22 10:11 promatik

The inspection completed: No new issues

scrutinizer-notifier avatar Nov 21 '22 10:11 scrutinizer-notifier

Quick note, this highlights an inconsistency between the place of the column prefix and suffix, inside or outside the wrapper.

image

In some fields column prefix/suffix are inside, others are outside. In my opinion it should always be outside, and if the devs want the prefix/suffix inside, use the method introduced in this PR, inside wrapper 👌

But, that is a breaking change, so not for now 🤷‍♂️

promatik avatar Nov 21 '22 11:11 promatik

Awesome! Ok great, let's have this:

  • [x] @promatik please create a PR for the docs
  • [ ] @pxpm please review/test and merge if it has your green light too

tabacitu avatar Nov 21 '22 13:11 tabacitu

Docs here https://github.com/Laravel-Backpack/docs/pull/389 🙌

promatik avatar Dec 04 '22 23:12 promatik

@promatik if you think this is still worth doing, please add v6 docs for it (instead of v5) then ask Pedro to review and merge.

tabacitu avatar Oct 11 '23 11:10 tabacitu

@pxpm updated docs to v6 https://github.com/Laravel-Backpack/docs/pull/389 👌

promatik avatar Jan 07 '24 21:01 promatik