Bug 1713100

Summary: attempting to copy and save a service dialog with the same name results in dialog fields being duplicated
Product: Red Hat CloudForms Management Engine Reporter: Tuan <tuado>
Component: UI - OPSAssignee: Martin Hradil <mhradil>
Status: CLOSED CURRENTRELEASE QA Contact: Niyaz Akhtar Ansari <nansari>
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.10.3CC: bmidwood, dmetzger, hkataria, jocarter, lavenel, mfeifer, mpovolny, mshriver, obarenbo, rblanco, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.11.0.17 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1733375 (view as bug list) Environment:
Last Closed: 2019-12-13 15:01:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1733375    
Attachments:
Description Flags
Duplicate tabs none

Description Tuan 2019-05-22 21:12:33 UTC
Description of problem:
attempting to copy and save a service dialog with the same name results in dialog fields tabs being duplicated

Screen shot attached. Tabs are duplicated showing multiple tabs of VM DETAILS, and Additional disks. 

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

How reproducible:
Every time

Steps to Reproduce:
1. Copy service dialog "Test DIalog" save as "Copy of Test Dialog"
2. Copy service dialog "Test DIalog" attempt to save as "Copy of Test Dialog" 
You will receive an error stating dialog name already exists. The original "Test Dialog" will have all of its tabs duplicated.

Actual results:
Tabs are copied and showing multiple times.

Expected results:


Additional info:

Comment 2 Tuan 2019-05-22 21:13:47 UTC
Created attachment 1572161 [details]
Duplicate tabs

Comment 3 Harpreet Kataria 2019-05-22 21:34:49 UTC
*** Bug 1713101 has been marked as a duplicate of this bug. ***

Comment 10 CFME Bot 2019-07-25 10:06:22 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:

https://github.com/ManageIQ/manageiq-ui-classic/commit/4962568f5586895f95fc7d0b7093737e4d3de041
commit 4962568f5586895f95fc7d0b7093737e4d3de041
Author:     Martin Hradil <mhradil>
AuthorDate: Tue Jul 23 10:26:57 2019 -0400
Commit:     Martin Hradil <mhradil>
CommitDate: Tue Jul 23 10:26:57 2019 -0400

    Dialog copy - remove ids pointing to the original dialog

    When copying a dialog, we load the original, allow the user to change it, and save that data as a new dialog.

    But, the API just saves the fields, groups and tabs, then saves the dialog, and only after that updates those tabs to point to the new dialog. No transactions.
    Which means that when dialog validation fails, all the copied tabs still point to the original dialog, leading to duplicate tabs appearing in the original.

    This does not fix the API bug or attempt to wrap it in a transaction,
    this just makes sure the UI won't send any obsolete ids when copying,
    thus limiting the impact of the API bug to extra unused tabs remaining in the db.

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1713100

 app/assets/javascripts/controllers/dialog_editor/dialog_editor_controller.js | 16 +
 1 file changed, 16 insertions(+)

Comment 12 CFME Bot 2019-07-25 20:56:45 UTC
New commit detected on ManageIQ/manageiq-ui-classic/ivanchuk:

https://github.com/ManageIQ/manageiq-ui-classic/commit/9e9d63e2ec014989eca31bfaa57f61623c6c790a
commit 9e9d63e2ec014989eca31bfaa57f61623c6c790a
Author:     Milan Zázrivec <mzazrivec>
AuthorDate: Thu Jul 25 06:04:05 2019 -0400
Commit:     Milan Zázrivec <mzazrivec>
CommitDate: Thu Jul 25 06:04:05 2019 -0400

    Merge pull request #5856 from himdel/dialog-copy

    Dialog copy - remove ids pointing to the original dialog

    (cherry picked from commit 9c807596ac916a4356662aef891c57589791780e)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1713100

 app/assets/javascripts/controllers/dialog_editor/dialog_editor_controller.js | 16 +
 1 file changed, 16 insertions(+)

Comment 13 Niyaz Akhtar Ansari 2019-07-31 07:29:39 UTC
Verified in Version 5.11.0.17.20190730152352_93b1c30