feat: render resource view registries in tables and panels - #186
Merged
Merged
Conversation
Layout components merge what extensions register into a view's slots when given @registry, a surface prefix such as `ledger:table:invoice`: - Tabular: columns, row actions, bulk actions and toolbar buttons - TabularActions: toolbar buttons and bulk actions - Panel (and resource-context-panel's `registry` option): header buttons, and menu items in the existing "…" dropdown or a new one Also: - extract the three copies of the header-button and bulk-action markup into Layout::Resource::ActionButtons and Layout::Resource::BulkActions; bulk actions honour `permission` everywhere, and dropdown items without a handler no longer throw - Tabular derives its columns instead of copying @columns once, so later changes (and late registrations) reach the table; the column picker's choices are kept by column key across recomputes - Tabular forwards @searchDisabled and takes a <:header> block - Table cells, filters and action-button components may be ExtensionComponent definitions, rendered from the extension's engine - utils/resource-view: an optional lookup of ember-core's service (older ember-core builds leave views unchanged) and mergeHeaderButtons
This was referenced Sep 30, 2026
CI's per-file gate flagged three branches in Tabular that no input can reach: the column picker always hands back an array of columns, a missing column can never match a visibility key, and ResourceViewService.mergeSlot already defaults a missing list. TabularActions loses the same `?? []`.
Open
Covers Tabular's bulkActions getter with the registry service present but no @registry, the last branch the coverage gate flagged.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/v0.4.5 #186 +/- ##
================================================
Coverage 100.00% 100.00%
================================================
Files 324 325 +1
Lines 9137 9189 +52
================================================
+ Hits 9137 9189 +52
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renders the resource view registries added in fleetbase/ember-core#95. Layout components merge what extensions register when given
@registry, a surface prefix:<Layout::Resource::Tabular @registry="ledger:table:invoice">: columns, row actions, bulk actions and toolbar buttons.<Layout::Resource::TabularActions @registry=…>: toolbar buttons and bulk actions.<Layout::Resource::Panel @registry="ledger:details:invoice">: header buttons, plus menu items added to the existing "…" dropdown (or a new one).resourceContextPanel.open({ registry: … }): the same, for side panels.The ember-core service is looked up, not injected. With an older ember-core, views render exactly as before.
Also in this PR
tabular,tabular-actionsandpanel/header-actions) are nowLayout::Resource::ActionButtonsandLayout::Resource::BulkActions.permissionin Tabular too.dropdown-fn.@columnsonce in the constructor, so later changes (and late registrations) reach the table.@searchDisabledand takes a<:header>named block for extra header controls.ExtensionComponentdefinitions, rendered from the extension's own engine vialazy-engine-component.utils/resource-view:lookupResourceView(owner)andmergeHeaderButtons(), for views that lay out their own headers.Release order
Release after ember-core 0.3.25 (fleetbase/ember-core#95), as 0.4.5.
Testing
tests/integration/components/layout/resource/registry-test.jsandtests/unit/utils/resource-view-test.js, 22 tests.layout/resource,table,filters-picker,resource-context-panel,lazy-engine-componentanddropdown-fn.