Created attachment 1277408 [details] err Description of problem: Error message is shown when trying to create a new dialog with existing dialog's name Version-Release number of selected component (if applicable): 5.8.0.13-rc2.20170502165848_0f98658 How reproducible: Steps to Reproduce: 1. create a catalog item for ansible playbook. Create new dialog with some name say "xyz" 2. Create another catalog item for playbook and "create new dialog" with same name "xyz" 3. Error displayed : "Could not create Service Template - Validation failed: Label is not unique within region 0" Actual results: Expected results: Additional info:
Not able to create catalogitem after that even with correct new dialog or using existing dialog . Message shown : "Could not create Service Template - {"name":["Job template with this Name already exists."]}"
Correct, looks like we need to either do more validation up front or better error handling and cleanup if we hit an error so the job_template gets cleaned up.
https://github.com/ManageIQ/manageiq/pull/15092
PR: https://github.com/ManageIQ/manageiq/pull/15092 addresses the following backend scenario 1. create a catalog item for ansible playbook. Create new dialog with some name say "xyz" 2. Create another catalog item for playbook and "create new dialog" with same name "xyz" 3. Error displayed : "Could not create Service Template - Validation failed: Label is not unique within region 0" But only solves the error message below (https://bugzilla.redhat.com/show_bug.cgi?id=1449345#c2) as it now automatically will roll back the 'zombie' job_template created in step 2. Message shown : "Could not create Service Template - {"name":["Job template with this Name already exists."]}" The error shown in step 3 is still an issue due to the attempt at creating a dialog with the same name. We think a possible solution would be to add validation in the UI that wouldn't allow a new Dialog to be created when one in the 'Use Existing' dropdown has the same name.
UI changes suggested in https://bugzilla.redhat.com/show_bug.cgi?id=1449345#c6 - https://github.com/ManageIQ/manageiq-ui-classic/pull/1361
New commit detected on ManageIQ/manageiq-ui-classic/master: https://github.com/ManageIQ/manageiq-ui-classic/commit/6828c702c718a7b50063d2ecdbd4c9bd00e785ee commit 6828c702c718a7b50063d2ecdbd4c9bd00e785ee Author: Harpreet Kataria <hkataria> AuthorDate: Tue May 16 17:20:41 2017 -0400 Commit: Harpreet Kataria <hkataria> CommitDate: Tue May 16 17:20:41 2017 -0400 New dialog name validation added. Show flash message and disable Add/Save button when user enters a dialog name in 'Create New' field that already exists in the db https://bugzilla.redhat.com/show_bug.cgi?id=1449345 .../controllers/catalog/catalog_item_form_controller.js | 10 ++++++++++ .../layouts/angular/_ansible_form_options_angular.html.haml | 1 + 2 files changed, 11 insertions(+)
Fixed in 5.9.0.8.20171109215303_ed87902