Skip to content

feat: render resource view registries in tables and panels - #186

Merged
roncodes merged 3 commits into
release/v0.4.5from
feature/resource-view-registries
Oct 3, 2026
Merged

roncodes merged 3 commits into
release/v0.4.5from
feature/resource-view-registries

Conversation

@roncodes

Copy link
Copy Markdown
Member

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

  • Shared button markup: the three copies of the header-button and bulk-action markup (in tabular, tabular-actions and panel/header-actions) are now Layout::Resource::ActionButtons and Layout::Resource::BulkActions.
    • Bulk actions honour permission in Tabular too.
    • Dropdown items without a handler no longer throw from dropdown-fn.
  • Tabular columns:
    • Tabular derives its columns instead of copying @columns once in the constructor, so later changes (and late registrations) reach the table.
    • The column picker's choices are kept by column key across recomputes.
  • Tabular arguments: Tabular forwards @searchDisabled and takes a <:header> named block for extra header controls.
  • Extension components: table cells, filter components and action-button components can be ExtensionComponent definitions, rendered from the extension's own engine via lazy-engine-component.
  • utils/resource-view: lookupResourceView(owner) and mergeHeaderButtons(), 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

  • New: tests/integration/components/layout/resource/registry-test.js and tests/unit/utils/resource-view-test.js, 22 tests.
  • Run locally, the 788 tests in the touched modules all pass: layout/resource, table, filters-picker, resource-context-panel, lazy-engine-component and dropdown-fn.
  • The full suite and the coverage gate were not run locally; CI will cover them.

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
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 `?? []`.
@roncodes roncodes mentioned this pull request Oct 3, 2026
@roncodes
roncodes changed the base branch from main to release/v0.4.5 October 3, 2026 02:17
Covers Tabular's bulkActions getter with the registry service present but no
@registry, the last branch the coverage gate flagged.
@roncodes
roncodes merged commit 00df1f9 into release/v0.4.5 Oct 3, 2026
5 checks passed
@roncodes
roncodes deleted the feature/resource-view-registries branch October 3, 2026 03:15
@codecov

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f6923a5) to head (c62db6e).
⚠️ Report is 5 commits behind head on release/v0.4.5.

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     
Flag Coverage Δ
ember-ui 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
addon/components/layout/resource/panel.js 100.00% <100.00%> (ø)
...ddon/components/layout/resource/tabular-actions.js 100.00% <100.00%> (ø)
addon/components/layout/resource/tabular.js 100.00% <100.00%> (ø)
addon/utils/resource-view.js 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant