filament
filament copied to clipboard
feature: Add affixes to BooleanColumn and IconColumn
This PR adds the ability to add suffixes and prefixes to boolean columns. This is handy in situations where you want to add some more context to a boolean, but where you don't want to create a new text column (e.g. because there's too much whitespace).
![Schermafbeelding 2022-08-27 om 15 35 00](https://user-images.githubusercontent.com/59207045/187032557-5036f5eb-c58b-492c-ae07-95a4bc4bfff3.png)
It feels like for your use case you could use a badge column instead of boolean? I'm not sure if we should 'bloat' the boolean column with a prefix and suffix, feels wrong to me in a way.
I think it should be on both, also IconColumn? do we have that or am i making it up
It feels like for your use case you could use a badge column instead of boolean? I'm not sure if we should 'bloat' the boolean column with a prefix and suffix, feels wrong to me in a way.
No, because a badge column really displays a badge with a colored background, which looks much uglier.
I think it should be on both, also IconColumn? do we have that or am i making it up
I'm not sure either, but I'll check and update the PR!
Added IconColumn, so ready for review. @danharrin
I'm interested now... can we somehow refactor BooleanColumn
to extend IconColumn
?
I'm interested now... can we somehow refactor
BooleanColumn
to extendIconColumn
?
Exactly my thought!
I'm interested now... can we somehow refactor
BooleanColumn
to extendIconColumn
?
I think that it should be possible. I'll take a look later this week.
Maybe create a new component and call it IndicatorColumn?
Maybe create a new component and call it IndicatorColumn?
Personally I don't see the benefit of renaming IconColumn to IndicatorColumn. Or am I understanding you incorrectly?
Not sure what @danharrin thinks.
Agree. Let's just make BooleanColumn
extend IconColumn
and see how that works out first.
Maybe create a new component and call it IndicatorColumn?
Personally I don't see the benefit of renaming IconColumn to IndicatorColumn. Or am I understanding you incorrectly?
Not sure what @danharrin thinks.
For each component to be responsible for the actions assigned to it, BooleanColumn should be boolean, IconColumn should be an icon, and IndicatorColumn should be the indicator column. Also, in the case of further changes, problems should not arise due to connecting the BooleanColumn to the IconColumn. This is just an opinion, you know Filament better than me
What's the status of this PR, @ralphjsmit? 🙂
We've decided to deprecate BooleanColumn
in favor of IconColumn::make()->boolean()
: https://github.com/filamentphp/filament/issues/4273. So that will be handled separately from this PR.
https://github.com/filamentphp/filament/pull/4431 has been merged and deprecates the BooleanColumn
. Could you update this PR to add affix support to the IconColumn
?
Gonna close this, many merge conflicts so it would be easier to do the work on a new branch anyway