Skip to content

Conversation

@TheRealJon
Copy link
Member

Summary

This PR introduces a new dynamic plugin extension point (console.catalog/toolbar-item) that allows plugins to contribute custom UI components to catalog toolbars. Plugins can target specific catalogs and catalog item types, or provide toolbar items that appear globally across all catalogs.

Key Changes

Extension Definition:

  • New console.catalog/toolbar-item extension type in the dynamic plugin SDK
  • Properties support optional catalogId and type filters for targeted placement
  • Components render as FlexItem elements in the catalog toolbar

Implementation:

  • Added extension type and type guard in catalog.ts
  • Updated useCatalogExtensions hook to resolve and filter toolbar extensions by catalogId and type
  • Modified CatalogToolbar component to render toolbar extension components
  • Updated CatalogServiceProvider to pass toolbar extensions through the catalog service
  • Added comprehensive test coverage for extension filtering logic

Use Case:
This enables plugins like operator-lifecycle-manager-v1 to add custom controls (toggles, filters, switches, etc.) directly into catalog interfaces without modifying core catalog code.

Documentation

SDK documentation has been updated in console-extensions.md with the new extension type definition and property descriptions.

Test Plan

  • Verify the extension type is properly exported and type guards work
  • Run unit tests for useCatalogExtensions hook: cd frontend && yarn test useCatalogExtensions.spec.ts
  • Verify CatalogController tests pass: cd frontend && yarn test CatalogController.spec.tsx
  • Build the frontend to ensure no TypeScript errors: cd frontend && yarn build:console
  • Manual testing with a plugin that uses this extension (will be done in follow-up OLMv1 PRs)

🤖 Generated with Claude Code

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 7, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Nov 7, 2025

@TheRealJon: This pull request references CONSOLE-4862 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.21.0" version, but no target version was set.

In response to this:

Summary

This PR introduces a new dynamic plugin extension point (console.catalog/toolbar-item) that allows plugins to contribute custom UI components to catalog toolbars. Plugins can target specific catalogs and catalog item types, or provide toolbar items that appear globally across all catalogs.

Key Changes

Extension Definition:

  • New console.catalog/toolbar-item extension type in the dynamic plugin SDK
  • Properties support optional catalogId and type filters for targeted placement
  • Components render as FlexItem elements in the catalog toolbar

Implementation:

  • Added extension type and type guard in catalog.ts
  • Updated useCatalogExtensions hook to resolve and filter toolbar extensions by catalogId and type
  • Modified CatalogToolbar component to render toolbar extension components
  • Updated CatalogServiceProvider to pass toolbar extensions through the catalog service
  • Added comprehensive test coverage for extension filtering logic

Use Case:
This enables plugins like operator-lifecycle-manager-v1 to add custom controls (toggles, filters, switches, etc.) directly into catalog interfaces without modifying core catalog code.

Documentation

SDK documentation has been updated in console-extensions.md with the new extension type definition and property descriptions.

Test Plan

  • Verify the extension type is properly exported and type guards work
  • Run unit tests for useCatalogExtensions hook: cd frontend && yarn test useCatalogExtensions.spec.ts
  • Verify CatalogController tests pass: cd frontend && yarn test CatalogController.spec.tsx
  • Build the frontend to ensure no TypeScript errors: cd frontend && yarn build:console
  • Manual testing with a plugin that uses this extension (will be done in follow-up OLMv1 PRs)

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from jhadvig and sg00dwin November 7, 2025 19:35
@openshift-ci openshift-ci bot added the component/sdk Related to console-plugin-sdk label Nov 7, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 7, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: TheRealJon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added component/shared Related to console-shared approved Indicates a PR has been approved by an approver from all required OWNERS files. plugin-api-changed Categorizes a PR as containing plugin API changes labels Nov 7, 2025
@TheRealJon
Copy link
Member Author

QE Approver
/assign @yapei

Docs Approver:
/assign @jseseCCS

PX Approver:
/assign @sferich888

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 7, 2025

@TheRealJon: GitHub didn't allow me to assign the following users: jseseCCS.

Note that only openshift members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

QE Approver
/assign @yapei

Docs Approver:
/assign @jseseCCS

PX Approver:
/assign @sferich888

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci openshift-ci bot added component/olm Related to OLM kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated labels Nov 7, 2025
…log toolbars

This change introduces a new dynamic plugin extension point that allows plugins to contribute custom UI components to catalog toolbars. Plugins can target specific catalogs and catalog item types, or provide toolbar items that appear across all catalogs.

Extension definition:
- New console.catalog/toolbar-item extension type
- Properties support optional catalogId and type filters
- Components render as FlexItems in the catalog toolbar

Implementation:
- Extension type and type guard in catalog.ts
- Hook to resolve and filter toolbar extensions by catalogId and type
- CatalogToolbar component renders toolbar extension components
- Comprehensive test coverage for extension filtering logic

This enables plugins like operator-lifecycle-manager-v1 to add custom controls (toggles, filters, etc.) directly into catalog interfaces without modifying core catalog code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 7, 2025

@TheRealJon: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-console 8f1edea link true /test e2e-gcp-console
ci/prow/images 8f1edea link true /test images
ci/prow/okd-scos-e2e-aws-ovn 8f1edea link false /test okd-scos-e2e-aws-ovn
ci/prow/okd-scos-images 8f1edea link true /test okd-scos-images
ci/prow/analyze 8f1edea link true /test analyze
ci/prow/frontend 8f1edea link true /test frontend

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@yapei
Copy link
Contributor

yapei commented Nov 11, 2025

there are critical errors

 ERROR in ./public/components/dashboard/project-dashboard/getting-started/__tests__/SampleGettingStartedCard.data.ts:3:14
TS2741: Property 'toolbarExtensions' is missing in type '{ type: string; items: undefined[]; itemsMap: {}; loaded: false; loadError: null; searchCatalog: () => any[]; catalogExtensions: ({ type: "console.catalog/item-type"; properties: { type: string; title: string; catalogDescription: string; typeDescription: string; }; flags: { ...; }; pluginID: string; pluginName: stri...' but required in type 'CatalogService'.
    1 | import { CatalogService } from '@console/shared';
    2 |
  > 3 | export const loadingCatalogService: CatalogService = {
      |              ^^^^^^^^^^^^^^^^^^^^^
    4 |   type: '',
    5 |   items: [],
    6 |   itemsMap: {},
ERROR in ./public/components/dashboard/project-dashboard/getting-started/__tests__/SampleGettingStartedCard.data.ts:158:14
TS2741: Property 'toolbarExtensions' is missing in type '{ type: string; searchCatalog: () => any[]; categories: undefined[]; items: ({ uid: string; type: string; name: string; provider: string; description: string; creationTimestamp: string; icon: { url: string; class: null; }; cta: { ...; }; } | { ...; })[]; itemsMap: { ...; }; loaded: true; loadError: null; catalogExte...' but required in type 'CatalogService'.
    156 | };
    157 |
  > 158 | export const loadedCatalogService: CatalogService = {
        |              ^^^^^^^^^^^^^^^^^^^^
    159 |   type: '',
    160 |   searchCatalog: () => [],
    161 |   categories: [],
webpack 5.97.1 compiled with 2 errors in 92945 ms 

@yapei
Copy link
Contributor

yapei commented Nov 11, 2025

@TheRealJon Shall we update console-demo-plugin to include new extension point so that we can cover checkpoints in integration testing? Not sure what's the criteria to add new extension point in our demo plugin though.

@TheRealJon
Copy link
Member Author

Covered by #15715

@TheRealJon TheRealJon closed this Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/olm Related to OLM component/sdk Related to console-plugin-sdk component/shared Related to console-shared jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated plugin-api-changed Categorizes a PR as containing plugin API changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants