Repository navigation
feat: add feature-gated content plugin PoC - #459
oleksgonchar wants to merge 3 commits into
Conversation
Signed-off-by: Oleksandr Gonchar <ogon@equinor.com>
Signed-off-by: Oleksandr Gonchar <ogon@equinor.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
May you join the salck channel and biweekly meetings to discuss this ? |
There was a problem hiding this comment.
🟡 Changes recommended
Async mount races, destructive test cleanup, and the Node/esbuild version mismatch remain unresolved.
4 open findings
What changed in this PR
Adds a feature-gated Custom Element plugin system to the Angular Central Dashboard, including React and Lit examples.
Changes:
- Adds plugin registration, routing, validation, context passing, and event handling.
- Adds example plugins, build tooling, and tests.
- Enables plugins only in the development overlay.
| File | Description |
|---|---|
manifests/kustomize/overlays/dev/patches/configmap.yaml |
Enables plugins in development. |
manifests/kustomize/overlays/dev/kustomization.yaml |
Defines the development overlay. |
manifests/kustomize/base/configmap.yaml |
Adds the feature gate and registrations. |
frontend/src/app/types/dashboard-settings.ts |
Types dashboard settings. |
frontend/src/app/types/dashboard-links.ts |
Defines plugin registrations. |
frontend/src/app/services/environment.service.ts |
Publishes dashboard settings. |
frontend/src/app/services/backend.service.ts |
Fetches dashboard settings. |
frontend/src/app/pages/content-plugin-host/content-plugin-host.component.ts |
Implements plugin hosting. |
frontend/src/app/pages/content-plugin-host/content-plugin-host.component.spec.ts |
Tests host behavior. |
frontend/src/app/pages/content-plugin-host/content-plugin-host.component.scss |
Styles the host. |
frontend/src/app/pages/content-plugin-host/content-plugin-host.component.html |
Defines host status and outlet. |
frontend/src/app/content-plugins/hello-react.spec.ts |
Tests the React example. |
frontend/src/app/content-plugins/hello-lit.spec.ts |
Tests the Lit example. |
frontend/src/app/app.module.ts |
Registers the host component. |
frontend/src/app/app-routing.module.ts |
Adds the plugin route. |
frontend/plugins/README.md |
Documents plugin usage. |
frontend/plugins/hello-react/src/hello-react.ts |
Implements the React example. |
frontend/plugins/hello-lit/src/hello-lit.ts |
Implements the Lit example. |
frontend/plugins/build.mjs |
Bundles example plugins. |
frontend/package.json |
Adds build scripts and dependencies. |
frontend/package-lock.json |
Locks plugin dependencies. |
frontend/.gitignore |
Ignores generated plugin bundles. |
Files not reviewed (1)
- components/centraldashboard-angular/frontend/package-lock.json: Generated file
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "babel-loader": "^8.0.6", | ||
| "cross-env": "^5.2.1", | ||
| "cypress": "~13.13.1", | ||
| "esbuild": "0.24.2", |
| .then(elementWasDefined => { | ||
| if (this.pluginId !== plugin.id || !elementWasDefined) { | ||
| if (this.pluginId === plugin.id && !elementWasDefined) { | ||
| this.fail('This content plugin did not register its custom element in time.'); | ||
| } | ||
| return; | ||
| } |
| } | ||
|
|
||
| describe('dashboard-hello-lit', () => { | ||
| afterEach(() => document.body.replaceChildren()); |
| } | ||
|
|
||
| describe('dashboard-hello-react', () => { | ||
| afterEach(() => document.body.replaceChildren()); |


related: #41
Summary
Adds a directional, feature-gated PoC for framework-neutral in-page Dashboard content.
The Angular Dashboard can load a same-origin, self-contained Custom Element bundle
at
/plugins/:pluginIdand exchange a small property/event contract with it.What changes
ContentPluginHostComponentand the/plugins/:pluginIdroute.DASHBOARD_CONTENT_PLUGINS_ENABLEDfeature gate, disabled in the baseconfiguration and enabled only by the development overlay.
ready,navigate, anderrorCustomEvents from plugins.requests.
Scope and limitations
This is a directional PoC, not production enablement.
DOM are not security boundaries.
negotiation, and a shared design-token contract are intentionally out of scope.
Validation
git diff --check origin/main...HEADnpm run test:prodincomponents/centraldashboard-angular/frontendThe test run executed all 42 specs. The local Karma run then reported an
afterAllerror from
karma-jasmine-html-reporter; this appears after spec execution and iscalled out for CI confirmation.