-
Story
-
Resolution: Done
-
Undefined
-
None
-
None
-
None
-
None
-
None
-
False
-
-
False
-
1
-
None
-
None
-
OCP Console - Sprint 274
As part of the work on react-router v5 drop, we need to migrate from the createModalLauncher instances in our codebase and we need to use the useOverlay hook instead. Before we are able to migrate to useOverlay we have to either refactor or move the consumers of createModalLauncher instances to a hook or FC.
Two such instances within HELM plugin are the getHelmDeleteAction function within creators.ts and confirmModalRollbackHelmRelease within HelmReleaseHistoryRow.tsx. We should refactor this code so that we will be able to launch deleteResourceModal via a hook instead. We should keep the existing actions as is and only accept a new argument with a callback to the modalLauncher retrieved from the newly introduced hook. Some prior refactors that have been done are a good reference point - https://github.com/openshift/console/pull/13506, https://github.com/openshift/console/pull/15078 or https://github.com/openshift/console/pull/15063 .
AC:
- Drop createModalLauncher use, refactor the Modals to have a hook that provides a callback to launch the modal via useOverlay.
- Refactor getHelmDeleteAction to accept a argument that is a callback to a modal launcher retrieved from the hook written above.
- Do the same for confirmModalRollbackHelmRelease.
- Consolidate with the consumers.