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

Added remove resources option in the form on Retirement tab #629

Merged
merged 1 commit into from
Mar 11, 2017

Conversation

h-kataria
Copy link
Contributor

@h-kataria h-kataria commented Mar 8, 2017

#Added an option to ask user if they want to remove associated resources as part of service retirement, default is set to "none" with options none/pre/post.

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

@tinaafitz @bzwei @gmcculloug please review/test.

screenshots:
Remove resources upon service retirement options are Yes/No when user has no playbook selected.
catalog_item_remove_resources1

Remove resources upon service retirement options are No/Pre/Post when user has playbook selected.
catalog_item_remove_resoures2

@@ -59,6 +59,17 @@
%option{"value" => ""}
= "<#{_('Unassigned')}>"

.form-group
%label.col-md-2.control-label{"for" => "catalog_id"}
= _('Would you like to remove associated resources as part of service retirement?')
Copy link
Member

Choose a reason for hiding this comment

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

This seems odd as the only field text in the form of a question. Maybe this should be: "Retirement: Remove associated resources" with options "Never, Pre-Playbook, Post-Playbook"

@tinaafitz @mkanoor @bzwei Thoughts?

@h-kataria
Copy link
Contributor Author

@tinaafitz @bzwei @gmcculloug please review/test

@h-kataria h-kataria changed the title Added remove resources option in the form Added remove resources option in the form on Retirement tab Mar 10, 2017
@@ -69,6 +71,13 @@ ManageIQ.angular.app.controller('catalogItemFormController', ['$scope', 'catalog
}
};

var getRemoveResourcesTypes = function() {
if (angular.isUndefined(vm.catalogItemModel.retirement_playbook_id) || vm.catalogItemModel.retirement_playbook_id === '')
vm.catalogItemModel['remove_resources_types'] = {"No": "no", "Yes": "yes"};
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this defines the value passed to the API call? I think we agreed on the values, here will be "no_without_playbook" and "yes_without_playbook"

if (angular.isUndefined(vm.catalogItemModel.retirement_playbook_id) || vm.catalogItemModel.retirement_playbook_id === '')
vm.catalogItemModel['remove_resources_types'] = {"No": "no", "Yes": "yes"};
else
vm.catalogItemModel['remove_resources_types'] = {"No": "no", "Pre": "pre", "Post": "post"};
Copy link
Contributor

Choose a reason for hiding this comment

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

with this group the value will be "no_with_playbook", "pre_with_playbook" and "post_with_playbook"

@h-kataria
Copy link
Contributor Author

@bzwei drop down values updated, please re-test.

@tinaafitz
Copy link
Member

@h-kataria The UI changes look good. I'll test again with the new drop down values. I noticed that the save button is disabled unless you select to create a new dialog.

Added an option to ask user if they want to remove resources as part of service retirement, If playbook is not selected options are "Yes/No", when playbook is selected options are "No/Pre/Post", default is set to "No".
Fixed existing JS spec test.

https://www.pivotaltracker.com/story/show/141238703
@miq-bot
Copy link
Member

miq-bot commented Mar 10, 2017

Checked commit h-kataria@ab24a33 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks good. 🍪

@tinaafitz
Copy link
Member

@h-kataria Retested with the latest changes and it looks great!
Please disregard my last comment about the buttons. It was user error. :-)

@dclarizio dclarizio merged commit 7fb4088 into ManageIQ:master Mar 11, 2017
@dclarizio dclarizio added this to the Sprint 56 Ending Mar 13, 2017 milestone Mar 11, 2017
@h-kataria h-kataria deleted the remove_resources_option branch March 15, 2017 20:59
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.

6 participants