Bug 1975239

Summary: Adding an existing hook in the Add Hook window and then clicking "Cancel" disables the Add Hook fields when adding a new hook
Product: Migration Toolkit for Containers Reporter: Sergio <sregidor>
Component: UIAssignee: Ian <ibolton>
Status: CLOSED ERRATA QA Contact: Xin jiang <xjiang>
Severity: medium Docs Contact: Avital Pinnick <apinnick>
Priority: high    
Version: 1.5.0CC: ernelson, rjohnson
Target Milestone: ---   
Target Release: 1.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-28 04:08:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sergio 2021-06-23 10:20:16 UTC
Description of problem:
When we add an already existing hook to a migplan, and we click on "Cancel" button instead of "Add hook", the next time that we want to add a hook the UI will show a wrong screen.

Version-Release number of selected component (if applicable):
MTC 1.5.0

How reproducible:
Alwasy

Steps to Reproduce:
1. In MTC main screen, click on "Hooks" and create a hook
2. Create a migration plan and go to "Add hook" screen
3. Click on "Add hook" and select the hook created in step 1

"Hook name" and "hook definition" fields will be disabled.

4. Click on "Cancel"
5. Click again on "Add hook"


Actual results:
The hook created in step 1 is the default value now and the "hook name" and "hook definition" fields are disabled already but they are empty. If we try to create the hook with those values the form will complain about those fields being mandatory.

In case we want to use this default hook, we need to unselect it and select it again.

Expected results:
If we want to keep the last selected hook as the default value after a cancel operation, all fields need to be filled in taking this into account.

If we want to present all the fields in the form with an empty value after a cancel operation, then the default value for the "Add an existing hook or create a new one *" field should be  "Create a new hook" and do not disable any field.

Additional info:

Comment 5 Sergio 2021-06-29 09:08:40 UTC
Verified using MTC 1.5.0

   openshift-migration-rhel7-operator@sha256:00e77706ca22bcb557d13c16822180fc877e6ea1639a72fda8eb9f5488b039a2
    - name: MIG_CONTROLLER_REPO
      value: openshift-migration-controller-rhel8@sha256
    - name: MIG_CONTROLLER_TAG
      value: 7f657df15e9514df4ef42da3431f558a19b8d3233a2ef1222cd8e27793c93816
    - name: MIG_UI_REPO
      value: openshift-migration-ui-rhel8@sha256
    - name: MIG_UI_TAG
      value: bda1959e1f44170905499b304ce28f9f95ee1841b0dc29f9a9e2790d0dd0bd71


Now when we click on the "Cancel" button and we try to create a new hook all fields are empty and active.


Moved to VERIFIED status.

Comment 11 errata-xmlrpc 2021-07-28 04:08:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Migration Toolkit for Containers (MTC) image release advisory 1.5.0), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2021:2929