Skip to content

Conversation

@rhamilto
Copy link
Member

@rhamilto rhamilto commented Jan 22, 2026

Summary

Creates a shared global error modal launcher utility in the console-shared package to eliminate code duplication and ensure error modals work correctly across all contexts (topology, standalone pages, import flows).

Note: This PR builds on:

Changes

New Shared Utility

  • packages/console-shared/src/utils/error-modal-handler.ts
    • launchGlobalErrorModal() - Launch error modals from non-React contexts
    • useSetupGlobalErrorModalLauncher() - Hook to initialize the launcher
    • setGlobalErrorModalLauncher() - Manage global state

Migrated Packages

  • topology: Updated Topology.tsx, componentUtils.ts, edgeActions.ts
  • knative-plugin: Updated knativeComponentUtils.ts, create-connector-utils.ts
  • shipwright-plugin: Updated logs-utils.ts, BuildRunDetailsPage.tsx
  • dev-console: Updated pipeline-template-utils.ts, ImportPage.tsx, DeployImagePage.tsx

Launcher Initialization

Added useSetupGlobalErrorModalLauncher() in root components:

  • packages/topology/src/components/graph-view/Topology.tsx - For topology drag/drop contexts
  • packages/shipwright-plugin/src/components/buildrun-details/BuildRunDetailsPage.tsx - For standalone log viewing
  • packages/dev-console/src/components/import/ImportPage.tsx - For Git import flow
  • packages/dev-console/src/components/import/DeployImagePage.tsx - For deploy image flow

Cleanup

  • Removed topology-specific errorModalHandler implementation
  • Removed deprecated errorModal function from public/components/modals

Benefits

  • ✅ Eliminates code duplication across packages
  • ✅ Ensures error modals work in all contexts (topology, standalone pages, import flows)
  • ✅ Single source of truth for error modal launching
  • ✅ Proper initialization and cleanup via React hooks

Test plan

  • Test topology drag/drop operations that trigger errors
  • Test BuildRun log viewing with error conditions
  • Test Git import flow with route exposure errors
  • Test deploy image flow with pipeline trigger errors
  • Verify no console errors when error modals are triggered

Related

Jira: CONSOLE-5012

🤖 Generated with Claude Code

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 22, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 22, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 22, 2026

@rhamilto: This pull request references CONSOLE-5012 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

Creates a shared global error modal launcher utility in the console-shared package to eliminate code duplication and ensure error modals work correctly across all contexts (topology, standalone pages, import flows).

Changes

New Shared Utility

  • packages/console-shared/src/utils/error-modal-handler.ts
  • launchGlobalErrorModal() - Launch error modals from non-React contexts
  • useSetupGlobalErrorModalLauncher() - Hook to initialize the launcher
  • setGlobalErrorModalLauncher() - Manage global state

Migrated Packages

  • topology: Updated Topology.tsx, componentUtils.ts, edgeActions.ts
  • knative-plugin: Updated knativeComponentUtils.ts, create-connector-utils.ts
  • shipwright-plugin: Updated logs-utils.ts, BuildRunDetailsPage.tsx
  • dev-console: Updated pipeline-template-utils.ts, ImportPage.tsx, DeployImagePage.tsx

Launcher Initialization

Added useSetupGlobalErrorModalLauncher() in root components:

  • packages/topology/src/components/graph-view/Topology.tsx - For topology drag/drop contexts
  • packages/shipwright-plugin/src/components/buildrun-details/BuildRunDetailsPage.tsx - For standalone log viewing
  • packages/dev-console/src/components/import/ImportPage.tsx - For Git import flow
  • packages/dev-console/src/components/import/DeployImagePage.tsx - For deploy image flow

Cleanup

  • Removed topology-specific errorModalHandler implementation
  • Removed deprecated errorModal function from public/components/modals

Benefits

  • ✅ Eliminates code duplication across packages
  • ✅ Ensures error modals work in all contexts (topology, standalone pages, import flows)
  • ✅ Single source of truth for error modal launching
  • ✅ Proper initialization and cleanup via React hooks

Test plan

  • Test topology drag/drop operations that trigger errors
  • Test BuildRun log viewing with error conditions
  • Test Git import flow with route exposure errors
  • Test deploy image flow with pipeline trigger errors
  • Verify no console errors when error modals are triggered

Related

Jira: CONSOLE-5012

🤖 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
Copy link
Contributor

openshift-ci bot commented Jan 22, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 22, 2026

@rhamilto: This pull request references CONSOLE-5012 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

Creates a shared global error modal launcher utility in the console-shared package to eliminate code duplication and ensure error modals work correctly across all contexts (topology, standalone pages, import flows).

Changes

New Shared Utility

  • packages/console-shared/src/utils/error-modal-handler.ts
  • launchGlobalErrorModal() - Launch error modals from non-React contexts
  • useSetupGlobalErrorModalLauncher() - Hook to initialize the launcher
  • setGlobalErrorModalLauncher() - Manage global state

Migrated Packages

  • topology: Updated Topology.tsx, componentUtils.ts, edgeActions.ts
  • knative-plugin: Updated knativeComponentUtils.ts, create-connector-utils.ts
  • shipwright-plugin: Updated logs-utils.ts, BuildRunDetailsPage.tsx
  • dev-console: Updated pipeline-template-utils.ts, ImportPage.tsx, DeployImagePage.tsx

Launcher Initialization

Added useSetupGlobalErrorModalLauncher() in root components:

  • packages/topology/src/components/graph-view/Topology.tsx - For topology drag/drop contexts
  • packages/shipwright-plugin/src/components/buildrun-details/BuildRunDetailsPage.tsx - For standalone log viewing
  • packages/dev-console/src/components/import/ImportPage.tsx - For Git import flow
  • packages/dev-console/src/components/import/DeployImagePage.tsx - For deploy image flow

Cleanup

  • Removed topology-specific errorModalHandler implementation
  • Removed deprecated errorModal function from public/components/modals

Benefits

  • ✅ Eliminates code duplication across packages
  • ✅ Ensures error modals work in all contexts (topology, standalone pages, import flows)
  • ✅ Single source of truth for error modal launching
  • ✅ Proper initialization and cleanup via React hooks

Test plan

  • Test topology drag/drop operations that trigger errors
  • Test BuildRun log viewing with error conditions
  • Test Git import flow with route exposure errors
  • Test deploy image flow with pipeline trigger errors
  • Verify no console errors when error modals are triggered

Related

Jira: CONSOLE-5012

🤖 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 added the component/core Related to console core functionality label Jan 22, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 22, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhamilto

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

The pull request process is described 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

@openshift-ci openshift-ci bot added component/dev-console Related to dev-console approved Indicates a PR has been approved by an approver from all required OWNERS files. component/knative Related to knative-plugin component/sdk Related to console-plugin-sdk component/shared Related to console-shared component/topology Related to topology labels Jan 22, 2026
@rhamilto rhamilto marked this pull request as ready for review January 23, 2026 15:17
@rhamilto rhamilto changed the title WIP: CONSOLE-5012: Create shared global error modal launcher utility [WIP] CONSOLE-5012: Create shared global error modal launcher utility Jan 23, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 23, 2026

@rhamilto: This pull request references CONSOLE-5012 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

Creates a shared global error modal launcher utility in the console-shared package to eliminate code duplication and ensure error modals work correctly across all contexts (topology, standalone pages, import flows).

Note: This PR is based on CONSOLE-5012 and includes changes from other PRs in that branch. The changes below are cumulative and may include work from multiple related PRs.

Changes

New Shared Utility

  • packages/console-shared/src/utils/error-modal-handler.ts
  • launchGlobalErrorModal() - Launch error modals from non-React contexts
  • useSetupGlobalErrorModalLauncher() - Hook to initialize the launcher
  • setGlobalErrorModalLauncher() - Manage global state

Migrated Packages

  • topology: Updated Topology.tsx, componentUtils.ts, edgeActions.ts
  • knative-plugin: Updated knativeComponentUtils.ts, create-connector-utils.ts
  • shipwright-plugin: Updated logs-utils.ts, BuildRunDetailsPage.tsx
  • dev-console: Updated pipeline-template-utils.ts, ImportPage.tsx, DeployImagePage.tsx

Launcher Initialization

Added useSetupGlobalErrorModalLauncher() in root components:

  • packages/topology/src/components/graph-view/Topology.tsx - For topology drag/drop contexts
  • packages/shipwright-plugin/src/components/buildrun-details/BuildRunDetailsPage.tsx - For standalone log viewing
  • packages/dev-console/src/components/import/ImportPage.tsx - For Git import flow
  • packages/dev-console/src/components/import/DeployImagePage.tsx - For deploy image flow

Cleanup

  • Removed topology-specific errorModalHandler implementation
  • Removed deprecated errorModal function from public/components/modals

Benefits

  • ✅ Eliminates code duplication across packages
  • ✅ Ensures error modals work in all contexts (topology, standalone pages, import flows)
  • ✅ Single source of truth for error modal launching
  • ✅ Proper initialization and cleanup via React hooks

Test plan

  • Test topology drag/drop operations that trigger errors
  • Test BuildRun log viewing with error conditions
  • Test Git import flow with route exposure errors
  • Test deploy image flow with pipeline trigger errors
  • Verify no console errors when error modals are triggered

Related

Jira: CONSOLE-5012

🤖 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.

1 similar comment
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jan 23, 2026

@rhamilto: This pull request references CONSOLE-5012 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

Creates a shared global error modal launcher utility in the console-shared package to eliminate code duplication and ensure error modals work correctly across all contexts (topology, standalone pages, import flows).

Note: This PR is based on CONSOLE-5012 and includes changes from other PRs in that branch. The changes below are cumulative and may include work from multiple related PRs.

Changes

New Shared Utility

  • packages/console-shared/src/utils/error-modal-handler.ts
  • launchGlobalErrorModal() - Launch error modals from non-React contexts
  • useSetupGlobalErrorModalLauncher() - Hook to initialize the launcher
  • setGlobalErrorModalLauncher() - Manage global state

Migrated Packages

  • topology: Updated Topology.tsx, componentUtils.ts, edgeActions.ts
  • knative-plugin: Updated knativeComponentUtils.ts, create-connector-utils.ts
  • shipwright-plugin: Updated logs-utils.ts, BuildRunDetailsPage.tsx
  • dev-console: Updated pipeline-template-utils.ts, ImportPage.tsx, DeployImagePage.tsx

Launcher Initialization

Added useSetupGlobalErrorModalLauncher() in root components:

  • packages/topology/src/components/graph-view/Topology.tsx - For topology drag/drop contexts
  • packages/shipwright-plugin/src/components/buildrun-details/BuildRunDetailsPage.tsx - For standalone log viewing
  • packages/dev-console/src/components/import/ImportPage.tsx - For Git import flow
  • packages/dev-console/src/components/import/DeployImagePage.tsx - For deploy image flow

Cleanup

  • Removed topology-specific errorModalHandler implementation
  • Removed deprecated errorModal function from public/components/modals

Benefits

  • ✅ Eliminates code duplication across packages
  • ✅ Ensures error modals work in all contexts (topology, standalone pages, import flows)
  • ✅ Single source of truth for error modal launching
  • ✅ Proper initialization and cleanup via React hooks

Test plan

  • Test topology drag/drop operations that trigger errors
  • Test BuildRun log viewing with error conditions
  • Test Git import flow with route exposure errors
  • Test deploy image flow with pipeline trigger errors
  • Verify no console errors when error modals are triggered

Related

Jira: CONSOLE-5012

🤖 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-robot
Copy link
Contributor

openshift-ci-robot commented Jan 23, 2026

@rhamilto: This pull request references CONSOLE-5012 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

Creates a shared global error modal launcher utility in the console-shared package to eliminate code duplication and ensure error modals work correctly across all contexts (topology, standalone pages, import flows).

Note: This PR builds on:

Changes

New Shared Utility

  • packages/console-shared/src/utils/error-modal-handler.ts
  • launchGlobalErrorModal() - Launch error modals from non-React contexts
  • useSetupGlobalErrorModalLauncher() - Hook to initialize the launcher
  • setGlobalErrorModalLauncher() - Manage global state

Migrated Packages

  • topology: Updated Topology.tsx, componentUtils.ts, edgeActions.ts
  • knative-plugin: Updated knativeComponentUtils.ts, create-connector-utils.ts
  • shipwright-plugin: Updated logs-utils.ts, BuildRunDetailsPage.tsx
  • dev-console: Updated pipeline-template-utils.ts, ImportPage.tsx, DeployImagePage.tsx

Launcher Initialization

Added useSetupGlobalErrorModalLauncher() in root components:

  • packages/topology/src/components/graph-view/Topology.tsx - For topology drag/drop contexts
  • packages/shipwright-plugin/src/components/buildrun-details/BuildRunDetailsPage.tsx - For standalone log viewing
  • packages/dev-console/src/components/import/ImportPage.tsx - For Git import flow
  • packages/dev-console/src/components/import/DeployImagePage.tsx - For deploy image flow

Cleanup

  • Removed topology-specific errorModalHandler implementation
  • Removed deprecated errorModal function from public/components/modals

Benefits

  • ✅ Eliminates code duplication across packages
  • ✅ Ensures error modals work in all contexts (topology, standalone pages, import flows)
  • ✅ Single source of truth for error modal launching
  • ✅ Proper initialization and cleanup via React hooks

Test plan

  • Test topology drag/drop operations that trigger errors
  • Test BuildRun log viewing with error conditions
  • Test Git import flow with route exposure errors
  • Test deploy image flow with pipeline trigger errors
  • Verify no console errors when error modals are triggered

Related

Jira: CONSOLE-5012

🤖 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 added the kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated label Jan 23, 2026
rhamilto added a commit to rhamilto/console that referenced this pull request Jan 23, 2026
This commit migrates all instances of confirmModal to use the modern
overlay pattern with useWarningModal, completing the modal migration
effort started in previous PRs.

Changes:
- Removed deprecated confirmModal launcher and confirm-modal.tsx file
- Migrated topology moveNodeToGroup to use useWarningModal with proper
  cancel handling via global handler pattern
- Updated StopNodeMaintenanceModal to remove deprecated imperative API
  and keep only the useStopNodeMaintenanceModal hook
- Fixed useWarningModal to properly call closeOverlay() and filter it
  from props spread to prevent React DOM warnings
- Added try-catch in topology drag-drop to prevent optimistic update
  when user cancels the move operation
- Updated all metal3-plugin maintenance components to use the hook-based
  approach

This PR builds upon and depends on:
- openshift#15932 (ResourceLimitsModal migration)
- openshift#15939 (DeletePDBModal migration)
- openshift#15940 (ConfigureUnschedulableModal migration)
- openshift#15946 (Global error modal utility)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@rhamilto
Copy link
Member Author

/retest

2 similar comments
@rhamilto
Copy link
Member Author

/retest

@rhamilto
Copy link
Member Author

/retest

rhamilto added a commit to rhamilto/console that referenced this pull request Jan 26, 2026
This commit migrates all instances of confirmModal to use the modern
overlay pattern with useWarningModal, completing the modal migration
effort started in previous PRs.

Changes:
- Removed deprecated confirmModal launcher and confirm-modal.tsx file
- Migrated topology moveNodeToGroup to use useWarningModal with proper
  cancel handling via global handler pattern
- Updated StopNodeMaintenanceModal to remove deprecated imperative API
  and keep only the useStopNodeMaintenanceModal hook
- Fixed useWarningModal to properly call closeOverlay() and filter it
  from props spread to prevent React DOM warnings
- Added try-catch in topology drag-drop to prevent optimistic update
  when user cancels the move operation
- Updated all metal3-plugin maintenance components to use the hook-based
  approach

This PR builds upon and depends on:
- openshift#15932 (ResourceLimitsModal migration)
- openshift#15939 (DeletePDBModal migration)
- openshift#15940 (ConfigureUnschedulableModal migration)
- openshift#15946 (Global error modal utility)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@rhamilto
Copy link
Member Author

/retest

rhamilto added a commit to rhamilto/console that referenced this pull request Jan 26, 2026
This commit migrates all instances of confirmModal to use the modern
overlay pattern with useWarningModal, completing the modal migration
effort started in previous PRs.

Changes:
- Removed deprecated confirmModal launcher and confirm-modal.tsx file
- Migrated topology moveNodeToGroup to use useWarningModal with proper
  cancel handling via global handler pattern
- Updated StopNodeMaintenanceModal to remove deprecated imperative API
  and keep only the useStopNodeMaintenanceModal hook
- Fixed useWarningModal to properly call closeOverlay() and filter it
  from props spread to prevent React DOM warnings
- Added try-catch in topology drag-drop to prevent optimistic update
  when user cancels the move operation
- Updated all metal3-plugin maintenance components to use the hook-based
  approach

This PR builds upon and depends on:
- openshift#15932 (ResourceLimitsModal migration)
- openshift#15939 (DeletePDBModal migration)
- openshift#15940 (ConfigureUnschedulableModal migration)
- openshift#15946 (Global error modal utility)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@rhamilto
Copy link
Member Author

/retest

rhamilto added a commit to rhamilto/console that referenced this pull request Jan 27, 2026
This commit migrates all instances of confirmModal to use the modern
overlay pattern with useWarningModal, completing the modal migration
effort started in previous PRs.

Changes:
- Removed deprecated confirmModal launcher and confirm-modal.tsx file
- Migrated topology moveNodeToGroup to use useWarningModal with proper
  cancel handling via global handler pattern
- Updated StopNodeMaintenanceModal to remove deprecated imperative API
  and keep only the useStopNodeMaintenanceModal hook
- Fixed useWarningModal to properly call closeOverlay() and filter it
  from props spread to prevent React DOM warnings
- Added try-catch in topology drag-drop to prevent optimistic update
  when user cancels the move operation
- Updated all metal3-plugin maintenance components to use the hook-based
  approach

This PR builds upon and depends on:
- openshift#15932 (ResourceLimitsModal migration)
- openshift#15939 (DeletePDBModal migration)
- openshift#15940 (ConfigureUnschedulableModal migration)
- openshift#15946 (Global error modal utility)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
rhamilto and others added 11 commits January 28, 2026 10:37
This commit refactors configure-update-strategy-modal to use the
OverlayComponent pattern, eliminating createModalLauncher.

Changes:
- Refactored configure-update-strategy-modal.tsx to use OverlayComponent
- Added ConfigureUpdateStrategyModalProvider with ModalWrapper
- Added LazyConfigureUpdateStrategyModalProvider with React.lazy()
- Updated useDeploymentActions to use the new lazy provider
- Removed deprecated configureUpdateStrategyModal from index.ts

This change maintains backward compatibility through default exports
and preserves lazy loading functionality.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit migrates the configure namespace pull secret modal from the
legacy createModalLauncher pattern to the new OverlayComponent pattern.

Changes:
- Exported ConfigureNamespacePullSecretModalProvider as OverlayComponent
- Updated index.ts to lazy-load the modal provider
- Modified namespace.jsx to use useOverlay hook instead of direct modal call

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…tern

This commit migrates the configure cluster upstream modal from the legacy
createModalLauncher pattern to the new OverlayComponent pattern and fixes
react-modal accessibility warnings.

Changes:
- Exported ConfigureClusterUpstreamModalProvider as OverlayComponent
- Updated index.ts to lazy-load the modal provider
- Modified details-page.tsx to use useOverlay hook instead of direct modal call
- Removed unnecessary TFunction prop from modal type definition
- Fixed react-modal warnings by using useLayoutEffect for global app element setup
- Added explicit appElement prop to ModalWrapper for robust timing handling

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit migrates the managed resource save modal from the legacy
createModalLauncher pattern to the new OverlayComponent pattern.

Changes:
- Exported ManagedResourceSaveModalProvider as OverlayComponent
- Updated index.ts to lazy-load the modal provider
- Modified edit-yaml.tsx to use useOverlay hook instead of direct modal call
- Removed unnecessary 'kind' prop from modal invocation
- Updated type definition to extend ModalComponentProps

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The remove-user-modal was already replaced by useWarningModal in
group.tsx and is no longer used anywhere in the codebase.

Changes:
- Deleted remove-user-modal.tsx
- Removed LazyRemoveUserModalProvider export from index.ts

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit migrates the ConfigureUnschedulableModal from the legacy
createModalLauncher pattern to the new OverlayComponent pattern.

Changes:
- Exported ConfigureUnschedulableModalProvider as OverlayComponent
- Updated modals/index.ts to lazy-load the modal provider
- Modified useNodeActions hook to use useOverlay hook
- Removed createModalLauncher usage

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add error-modal-handler.ts to console-shared package with:
  - launchGlobalErrorModal() for launching modals from non-React contexts
  - useSetupGlobalErrorModalLauncher() hook for initialization
  - setGlobalErrorModalLauncher() for managing global state

- Migrate all packages to use shared launcher:
  - topology: Update Topology.tsx, componentUtils.ts, edgeActions.ts
  - knative-plugin: Update knativeComponentUtils.ts, create-connector-utils.ts
  - shipwright-plugin: Update logs-utils.ts, BuildRunDetailsPage.tsx
  - dev-console: Update pipeline-template-utils.ts, ImportPage.tsx, DeployImagePage.tsx

- Initialize launcher in root components:
  - topology: Topology.tsx (for topology drag/drop contexts)
  - shipwright-plugin: BuildRunDetailsPage.tsx (for standalone log viewing)
  - dev-console: ImportPage.tsx, DeployImagePage.tsx (for import flows)

- Remove topology-specific errorModalHandler implementation
- Remove deprecated errorModal function from public/components/modals

This consolidates error modal launching into a single reusable utility,
eliminating code duplication across packages and ensuring error modals
work correctly in all contexts (topology, standalone pages, import flows).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
rhamilto added a commit to rhamilto/console that referenced this pull request Jan 28, 2026
This commit migrates all instances of confirmModal to use the modern
overlay pattern with useWarningModal, completing the modal migration
effort started in previous PRs.

Changes:
- Removed deprecated confirmModal launcher and confirm-modal.tsx file
- Migrated topology moveNodeToGroup to use useWarningModal with proper
  cancel handling via global handler pattern
- Updated StopNodeMaintenanceModal to remove deprecated imperative API
  and keep only the useStopNodeMaintenanceModal hook
- Fixed useWarningModal to properly call closeOverlay() and filter it
  from props spread to prevent React DOM warnings
- Added try-catch in topology drag-drop to prevent optimistic update
  when user cancels the move operation
- Updated all metal3-plugin maintenance components to use the hook-based
  approach

This PR builds upon and depends on:
- openshift#15932 (ResourceLimitsModal migration)
- openshift#15939 (DeletePDBModal migration)
- openshift#15940 (ConfigureUnschedulableModal migration)
- openshift#15946 (Global error modal utility)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 28, 2026

@rhamilto: 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-gcp-console f071fd2 link true /test e2e-gcp-console

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.

@rhamilto
Copy link
Member Author

/retest

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/core Related to console core functionality component/dev-console Related to dev-console component/knative Related to knative-plugin component/sdk Related to console-plugin-sdk component/shared Related to console-shared component/topology Related to topology do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants