OCPBUGS-66891: "Install" button on operator detail page should be disabled when the operator is in installing status
After
https://github.com/user-attachments/assets/5b2d996e-1fde-49cc-b848-81f2b9a371b8
@krishagarwal278: This pull request references Jira Issue OCPBUGS-66891, which is invalid:
- expected the bug to target the "4.21.0" version, but no target version was set
Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.
The bug has been updated to refer to the pull request using the external bug tracker.
In response to this:
Before
![]()
After
![]()
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.
Walkthrough
Replaces Link CTAs with Button CTAs supporting disabled/loading states, adds operator installation-state detection to drive CTA behavior, and propagates a new disabled flag through the catalog CTA type, useCtaLink hook, modal rendering, and operator catalog item generation.
Changes
| Cohort / File(s) | Summary |
|---|---|
Operator hub UI frontend/packages/operator-lifecycle-manager/src/components/operator-hub/operator-hub-items.tsx |
Replaced Link/CSS import with PatternFly Spinner; switched overlay install action from Link to Button (rendered as anchor via component+href). Added memoized isOperatorInstalling (based on detailsItem.subscription and CSV phase) to set isLoading/isDisabled, show spinner, and adjusted related logging and table string formatting. |
Catalog CTA type frontend/packages/console-dynamic-plugin-sdk/src/extensions/catalog.ts |
Added optional disabled?: boolean to cta in CatalogItem<T> to represent disabled CTA state in catalog extensions. |
Catalog details modal UI frontend/packages/console-shared/src/components/catalog/details/CatalogDetailsModal.tsx |
CTA rendering switched from plain Link to PatternFly Button that wraps a Link via component prop; consumes the new disabled return value from useCtaLink and applies isDisabled. Import set updated to include Button. |
Catalog CTA hook frontend/packages/console-shared/src/components/catalog/hooks/useCtaLink.ts |
Hook signature expanded to accept cta.disabled?: boolean and to return [to, label, disabled] (previously [to, label]). Propagates disabled through early returns, handles missing href, and preserves URL construction while stripping catalog-specific query params. |
Operator catalog items hook frontend/packages/operator-lifecycle-manager/src/hooks/useOperatorCatalogItems.tsx |
Primary CTA label and state reflect installation progress: label toggles to "Installing" and CTA becomes disabled when installing; uninstall CTA unchanged. No exported signature change. |
Estimated code review effort
๐ฏ 4 (Complex) | โฑ๏ธ ~40 minutes
โจ Finishing touches
- [ ] ๐ Generate docstrings
๐งช Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
๐ Recent review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
๐ฅ Commits
Reviewing files that changed from the base of the PR and between 5e51bfbb9e3a38998f1ef8812acb76ecf46a5730 and b0e593a74e6d61499a061c4c007e63bc3ee9a00c.
๐ Files selected for processing (4)
frontend/packages/console-dynamic-plugin-sdk/src/extensions/catalog.tsfrontend/packages/console-shared/src/components/catalog/details/CatalogDetailsModal.tsxfrontend/packages/console-shared/src/components/catalog/hooks/useCtaLink.tsfrontend/packages/operator-lifecycle-manager/src/hooks/useOperatorCatalogItems.tsx
๐ง Files skipped from review as they are similar to previous changes (2)
- frontend/packages/console-dynamic-plugin-sdk/src/extensions/catalog.ts
- frontend/packages/console-shared/src/components/catalog/details/CatalogDetailsModal.tsx
๐งฐ Additional context used
๐ Path-based instructions (1)
**
โ๏ธ CodeRabbit configuration file
-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.
Files:
frontend/packages/operator-lifecycle-manager/src/hooks/useOperatorCatalogItems.tsxfrontend/packages/console-shared/src/components/catalog/hooks/useCtaLink.ts
๐งฌ Code graph analysis (2)
frontend/packages/operator-lifecycle-manager/src/hooks/useOperatorCatalogItems.tsx (1)
frontend/__mocks__/i18next.ts (1)
t(8-14)
frontend/packages/console-shared/src/components/catalog/hooks/useCtaLink.ts (1)
frontend/packages/console-shared/src/components/catalog/hooks/index.ts (1)
useCtaLink(2-2)
๐ Additional comments (2)
frontend/packages/console-shared/src/components/catalog/hooks/useCtaLink.ts (1)
4-30: LGTM! Clean extension of the CTA API.The hook correctly extends the return type to include a
disabledflag with appropriate default handling. All return paths properly propagate the disabled state, and the URL construction logic remains intact.frontend/packages/operator-lifecycle-manager/src/hooks/useOperatorCatalogItems.tsx (1)
238-250: CTA configuration correctly reflects installation state.The logic properly toggles the label between "Install" and "Installing" and disables the CTA during installation. The implementation aligns with the PR objective to prevent multiple installation attempts.
Note: The correctness of this implementation depends on the
isInstallingflag accurately representing active installation (see previous comment on lines 198-202).
Comment @coderabbitai help to get the list of available commands and usage tips.
/jira refresh
@krishagarwal278: This pull request references Jira Issue OCPBUGS-66891, which is valid. The bug has been moved to the POST state.
3 validation(s) were run on this bug
- bug is open, matching expected state (open)
- bug target version (4.21.0) matches configured target version for branch (4.21.0)
- bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
Requesting review from QA contact: /cc @yapei
In response to this:
/jira refresh
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.
@krishagarwal278: This pull request references Jira Issue OCPBUGS-66891, which is invalid:
- expected the bug to target either version "4.22." or "openshift-4.22.", but it targets "4.21.0" instead
Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.
In response to this:
After
https://github.com/user-attachments/assets/5b2d996e-1fde-49cc-b848-81f2b9a371b8
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.
@krishagarwal278 Checked on cluster with the pr code, the 'Install' button is not disabled when operator is installing.
https://github.com/user-attachments/assets/56c6455e-714c-4e2e-b818-2eb7ae626281
There is a status notice 'Installing' on the right, I think we could disable the 'Install' button at the same time when this 'Installing' notice appears.
/retest
hi @yanpzhan if you click on that button, there's a installation page. The button is disabled there. But if you think it's better to disable on the modal itself, i can also do that ๐๐ป
hi @yanpzhan if you click on that button, there's a installation page. The button is disabled there. But if you think it's better to disable on the modal itself, i can also do that ๐๐ป
Yeah, it's better to disable on the modal itself.
Hi @yanpzhan, as you suggested, the install button is now disabled on the modal itself ๐๐ป
/retest
/retest
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: krishagarwal278 Once this PR has been reviewed and has the lgtm label, please ask for approval from jhadvig. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
@krishagarwal278: 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/images | b0e593a74e6d61499a061c4c007e63bc3ee9a00c | link | true | /test images |
| ci/prow/frontend | b0e593a74e6d61499a061c4c007e63bc3ee9a00c | link | true | /test frontend |
| ci/prow/analyze | b0e593a74e6d61499a061c4c007e63bc3ee9a00c | link | true | /test analyze |
| ci/prow/okd-scos-images | b0e593a74e6d61499a061c4c007e63bc3ee9a00c | link | true | /test okd-scos-images |
| ci/prow/e2e-gcp-console | b0e593a74e6d61499a061c4c007e63bc3ee9a00c | link | true | /test e2e-gcp-console |
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.