feat(manifest): icons for stats-block widget + page-header custom actions (closes #324, #325)#329
Merged
Conversation
…ions (closes #324, #325) Closes #324: CnStatsBlockWidget now accepts an `iconClass: String` prop (default `''`) forwarded from `widgetDef.props.iconClass` through the CnDashboardPage `getStatsBlockProps` allowlist. The widget renders a wrapping `<div :class="['cn-stats-block-widget', iconClass]">` so consumers can use NC core icon classes (`icon-link`, `icon-mail`, ...). No MDI dynamic-import path (deferred per issue option 1). Closes #325: CnIndexPage now accepts `config.headerActions[]` — a page-level analogue of the existing row-level `actions[]`, same shape (`{ id, label, icon, handler, route, ... }`), rendered inside the CnActionsBar overflow dropdown between built-in Refresh and the `#action-items` slot. Handler dispatch reuses the row-level registry pattern (`navigate` / `emit` / `none` / custom registry); built-in ids (`refresh`, `import`, `export`, `copy`, `delete`) are dropped with a console.warn to prevent masquerade. CnActionsBar emits `@header-action({ action, id })` (payload aliases the id under both keys, matching the row-level `@action` convention); CnIndexPage re-emits after handler dispatch. Schema: `headerActions` key added on `pages[].config` in both `app-manifest.schema.json` (v1) and `app-manifest-v2.schema.json` referencing the same `action` $def. Tests: 21 new tests across 4 spec files covering iconClass prop forwarding, dashboard dispatcher allowlist, header-action rendering / emit semantics, built-in-id collision warning, and handler dispatch. Backwards-compatible: new props default to safe values, schema keys are additive, DOM diff for stats-block is a single empty wrapper div.
Contributor
|
🎉 This PR is included in version 1.0.0-beta.69 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
4 tasks
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.
Summary
Two manifest-renderer plumbing gaps surfaced together during the openconnector v2-manifest migration. Both unblock declarative JSON manifests that already work in JSX/code, and both ship in this single PR because they share commit-history context (manifest schema diff, CnActionsBar / CnIndexPage / CnDashboardPage edits).
#324 —
CnStatsBlockWidgetacceptsiconClassiconClass: Stringprop (default'') onCnStatsBlockWidget.CnDashboardPage.getStatsBlockPropsallowlist so manifestwidgetDef.props.iconClassreaches the widget.<div :class="['cn-stats-block-widget', iconClass]">so consumers can use NC core icon classes (icon-link,icon-mail, …). No MDI dynamic-import — pure CSS-class path.#325 —
CnIndexPageacceptsconfig.headerActions[]headerActions: Arrayprop (default[]) onCnIndexPage, mirrored by aheaderActions[]config key onpages[].config(v1 + v2 schemas).actions[]({ id, label, icon, handler, route, ... }).headerActions: Arrayprop onCnActionsBar, rendered inside the existingNcActionsoverflow dropdown after built-in Refresh and before the#action-itemsslot.navigate/emit/none/ custom) as row-level actions; payload is{}-only (no row context, since these are page-level).refresh,import,export,copy,delete) are silently dropped with aconsole.warn.@header-action({ action, id })on bothCnActionsBarandCnIndexPage(payload aliases the id under both keys to match the row-level@actionconvention).Backwards compatibility
''/[]).<div>wheniconClassis unset.OpenSpec change
openspec/changes/manifest-icons-and-page-actions/— proposal + design + tasks + two spec deltas (dashboard-page,index-page). Validates strict-clean.Consumers unblocked
Test plan
npm run lint— 0 errors, 454 pre-existing warnings (all in unrelated files)npm run check:docs— 190/190 documented, 114/114 components prop+slot coverednpm test— 21 new tests passing across 4 new spec files; 4 pre-existing test failures onbetaare unchanged by this PR (CnDataMatrix,CnSearchPage,validateManifest.detailSidebarTabs,validateManifest.wikiStabilise)npm run check:jsdoc— pre-existing red onbeta(PR feat(dashboard): date-range header + chart time-bucket data source #326 introduced new events onCnDashboardPagewithout bumping baselines, so 16 components currently below baseline). This PR adds 0 new drops; the new events onCnActionsBar/CnIndexPagecarry JSDoc. Deferred follow-up: a baseline-refresh PR can reset the post-feat(dashboard): date-range header + chart time-bucket data source #326 drops, but it's pre-existing drift unrelated to this work.stats-blockwidget carryingprops.iconClass: "icon-link"— wrapper div picks up the class.pages[].config.headerActions[]entry on an openconnector index page (handler: "navigate"with aroute) — entry appears in the overflow dropdown after Refresh, click navigates.