IBX-12039: Added table component extension api#29
Conversation
| */ | ||
| public function getFullData(): iterable | ||
| { | ||
| return $this->fullData ?? $this->data; |
There was a problem hiding this comment.
Is that a secure fallback? If we don't have fullData (as it's optional), it could be misleading for callers that they want fullData but are receiving data silently instead.
I'd recommend to just return $this->fullData as ?iterable type and and caller side it can decide if is fallbacking to $this->data or not (that would be its explicit decision).
81b2ae2 to
00af091
Compare
| * @phpstan-param callable(mixed, Column): string $renderer | ||
| * | ||
| * @param array<string, string> $options presentation hints, see {@see Column::__construct()} | ||
| * @phpstan-param array{header_class?: string, cell_class?: string} $options presentation |
There was a problem hiding this comment.
We can get that phpstan type from Column definition as single source of truth
There was a problem hiding this comment.
Fixed: 58ee183 — addColumn() now imports ColumnOptions from Column via @phpstan-import-type.
| <thead> | ||
| <tr class="ibexa-table__row ibexa-table__row--header"> | ||
| <th class="ibexa-table__header-cell "> | ||
| <th class="ibexa-table__header-cell "> |
There was a problem hiding this comment.
Should there be additional space at the end of class? The same in <td/> tag below.
There was a problem hiding this comment.
Fixed: 031ed76 — class lists are now built with filter|join, so separators only appear between present classes. Only table_column_priority snapshot changed; the other four already had no trailing spaces.
Related PRs:
Description:
Closes the gaps that blocked
ibexa.Tablefrom expressing the admin-ui Versions tab tables,so the component can become the single canonical table extension point (instead of the
column-provider mechanism proposed in admin-ui#1960):
type/variantprops — table identity for PostMount listeners. Guarding ongetDataType()alone fails when different tables share a row type (all four versionstables carry
VersionInfo) or when the dataset is empty (getDataType()returns null).headlineprop +header/header_actionstemplate blocks — the table headline isrendered by the component and can be overwritten by a listener (used by ibexa/workflow's
"Drafts to review"). Not rendered when null, so existing usages are untouched.
classprop (defaults toibexa-table--last-column-sticky) — replaces the hardcoded modifierwhen set (versions tables use
ibexa-table--draft-conflict),''clears it; default output isbyte-identical.
Column::$options(header_class/cell_class) viaaddColumn(..., options: [...])—per-column th/td modifier classes (checkbox, close-left cells).
fullDatamount prop +getFullData(): ?iterable— whole dataset next to the rendered page,so listeners can decide column applicability independently of pagination; null when the mount
site gave none — falling back to page data is the caller's explicit choice (
?? getData()).before_table/after_tableblocks — anchor points inside the scrollable wrapper(used to keep the
admin-ui-versions-table-beforecomponent-group anchor).All changes are additive with safe defaults — the existing render snapshots pass unchanged.
The integration test suite additionally proves the trickiest consumer pattern: a checkbox
column rendering
form_widget()viaTemplateWrapper::renderBlock()insideform_start()/form_end()without widget duplication.For QA:
Covered by admin-ui/workflow/TM PRs (this PR alone changes no rendered output).