Skip to content

Add generic operator prompt and shared ResourceTable, ResourceInspect components#97

Open
anandkuma77 wants to merge 3 commits intoopenshift:mainfrom
sarthakpurohit:add-generic-prompt-and-supporting-files
Open

Add generic operator prompt and shared ResourceTable, ResourceInspect components#97
anandkuma77 wants to merge 3 commits intoopenshift:mainfrom
sarthakpurohit:add-generic-prompt-and-supporting-files

Conversation

@anandkuma77
Copy link

@anandkuma77 anandkuma77 commented Mar 4, 2026

What

  • docs/promts.md — Spec and prompt for adding a new operator to the plugin: end goal (operator dashboard, inspect page, sidebar link), shared components to use, a copy-paste prompt template (operator name, detection model, resource kinds, optional namespace/columns), and explicit “What NOT to do” and critical rules (e.g. useK8sModel only, #ALL_NS#, single inspect route, PatternFly 6 EmptyState, CSS/i18n constraints).
  • src/components/ResourceTable.tsx — Shared table component used for all operator resource lists: configurable columns and rows, loading/error/empty states, optional selectedProject for empty-state copy, and ResourceTableRowActions for per-row Inspect + Delete buttons (so useDeleteModal is used per row, not inside .map()).
  • src/ResourceInspect.tsx — Shared resource detail page: Card + Grid layout with Metadata, Labels, Annotations, Spec, Status, and Events, back button, and optional “Show/Hide sensitive data” for spec/status. Designed to be extended per operator via DISPLAY_NAMES, getResourceModel, and getPagePath instead of rewriting the component.

Why

  • Consistency and speed: A single, documented prompt and shared components let anyone (or an AI) add a new operator in a repeatable way: same dashboard layout, same table and inspect UX, same patterns (no VirtualizedTable, no useDeleteModal in .map(), correct EmptyState/namespace/route usage).
  • Fewer mistakes: The doc encodes lessons learned (RBAC/consoleFetchJSON, #ALL_NS#, PatternFly 6 APIs, reserved CSS classes, one inspect route, Plugins section) so new operators avoid known pitfalls.
  • Template reuse: ResourceTable and ResourceInspect become the standard building blocks for all operator UIs in this plugin, so the template stays maintainable as more operators are added.

How to run, locally:

  1. Do the oc login to the cluster
  2. Run the promt ( docs/promt.md) in cursor with the Operator Name ( Wait for cursor to finish writing the code before going to the next step), accept the changes made by cursor.
  3. in one console run 'yarn start'
  4. in another console run 'yarn start-console'
  5. Now you can see the result in on 'localhost:9000/'

@openshift-ci openshift-ci bot requested review from florkbr and rhamilto March 4, 2026 06:32
@openshift-ci
Copy link

openshift-ci bot commented Mar 4, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: anandkuma77
Once this PR has been reviewed and has the lgtm label, please assign therealjon for approval. For more information see the Code Review Process.

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

Details 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

Anand Kumar added 2 commits March 6, 2026 14:16
Create src/components/crds/ modules (Certificate, Issuer, ExternalSecret,
SecretStore, PushSecret, SecretProviderClass, Events) that ResourceInspect.tsx
imports. Each module exports K8sGroupVersionKind models for use with
useK8sWatchResource.

Made-with: Cursor
@openshift-ci
Copy link

openshift-ci bot commented Mar 6, 2026

@anandkuma77: The following test 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-aws-plugin-template ad95869 link true /test e2e-aws-plugin-template

Full PR test history. Your PR dashboard.

Details

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.

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