Uploaded image for project: 'OpenShift Console'
  1. OpenShift Console
  2. CONSOLE-4607

[KNATIVE] Drop smaller createModalLauncher instances and use useOverlay instead.

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • None
    • None
    • None
    • OCP Console - Sprint 276

      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 useModal hook instead. Before we are able to migrate to useModal we have to refactor consumers of createModalLauncher to be a hook/FC form first. 

      For pipelines plugin there are several of such instances - useSinkPubSubActionProvider, useUriActionsProvider, useEventSourcesActionsProvider, useKnativeConnectorActionProvider, useTopologyActionsProvider, useBrokerActionProvider, useChannelActionProvider and useCommonActionsProvider. To see all the consumers in a list visit Inventory of createModalLauncher in Console(those marked with no big refactor needed).  We should refactor actions that store createModalLauncher callbacks within these providers ( identified in the inventory), so that the actions will store callbacks via useOverlay hook instead. Example for a refactor of single action that used a createModalLauncher can be seen here https://github.com/openshift/console/pull/15230

      AC:

      1.  Introduce new hooks for modals used within the actions of the above providers. This hook should use useOverlay hook to return a callback that would launch these modals.
      2. Consolidate above providers to use this new hook.
      3. Pass the modal launcher callback retrieved from the hook to the actions and use that callback instead of the createModalLauncher instance.

              viraj-1 Vikram Raj
              rh-ee-mziska Marek Ziska (Inactive)
              None
              None
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: