-
-
Notifications
You must be signed in to change notification settings - Fork 24
Add DataField visibility setting #287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
'{label}' => $label, | ||
'{value}' => $value, | ||
]); | ||
if ($field['isVisible']) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd skip the iteration instead of wrapping code. Reads a bit better.
if ($field['isVisible']) { | |
if (!$field['isVisible']) { | |
continue; | |
} |
Overall, I like it. Tests seem to fail, though. |
@@ -58,6 +60,7 @@ public function __construct( | |||
public readonly string $valueTag = '', | |||
public readonly array|Closure $valueAttributes = [], | |||
public readonly bool $encodeValue = true, | |||
public readonly bool $isVisible = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public readonly bool $isVisible = true, | |
public readonly bool $visible = true, |
For consistency with parameter $visible
in DataColumn
constructor.
@@ -338,6 +338,7 @@ private function normalizeColumns(array $fields): array | |||
, | |||
'valueAttributes' => $this->renderAttributes($valueAttributes), | |||
'valueTag' => $valueTag, | |||
'isVisible' => $field->isVisible, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can skip field already here and don't add it to $normalized
.
Solution for Issue #286, including tests