Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save newly created dialog_id in options #14254

Merged
merged 1 commit into from
Mar 10, 2017

Conversation

bzwei
Copy link
Contributor

@bzwei bzwei commented Mar 9, 2017

https://www.pivotaltracker.com/story/show/140972071

The dialog_id allows the UI to show the newly created dialog in the list of existing ones.

@bzwei
Copy link
Contributor Author

bzwei commented Mar 9, 2017

@miq-bot add_label providers/ansible_tower
@miq-bot add_label enhancement
@miq-bot add_label euwe/no
@miq-bot assign @gmcculloug

@bzwei
Copy link
Contributor Author

bzwei commented Mar 9, 2017

@syncrou please review

@miq-bot
Copy link
Member

miq-bot commented Mar 9, 2017

Checked commit bzwei@192045c with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks good. 👍

Dialog::AnsiblePlaybookServiceDialog.create_dialog(dialog_name, job_template)
new_dialog = Dialog::AnsiblePlaybookServiceDialog.create_dialog(dialog_name, job_template)
enhanced_config[action][:dialog] = new_dialog
service_template.options[:config_info][action][:dialog_id] = new_dialog.id
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to extract the logic from Line 47 - 49 into a separate method? I think it may make what is happening in the transaction easier to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@syncrou I have given it a lot of thoughts but still prefer the way as is. Line 48 and 49 use the result from Line 47. They are two very different hashes. If we pass them into a method as arguments and modify the hash content, it will be even harder to read or realize the hash content has been modified after the method call.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bzwei - Makes sense. I was picturing a single method name detailing actions required for creating the dialog - I can get behind the code where it is at after reading your response.

👍 Looks good to me.

@gmcculloug gmcculloug merged commit 1032e7b into ManageIQ:master Mar 10, 2017
@gmcculloug gmcculloug added this to the Sprint 56 Ending Mar 13, 2017 milestone Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants