-
Notifications
You must be signed in to change notification settings - Fork 365
Fixed the copy request dialog form #9482
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
base: master
Are you sure you want to change the base?
Fixed the copy request dialog form #9482
Conversation
Checked commit GilbertCherrie@0b70385 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.62.0, and yamllint app/controllers/miq_request_controller.rb
|
0b70385
to
55d6ffe
Compare
@elsamaryv please review |
55d6ffe
to
1716255
Compare
1716255
to
c82ee93
Compare
@@ -218,7 +218,8 @@ def prov_copy | |||
) | |||
|
|||
if req.kind_of?(ServiceTemplateProvisionRequest) | |||
@dialog_replace_data = req.options[:dialog].map { |key, val| {:name => key.split('dialog_').last, :value => val } }.to_json | |||
@dialog_replace_data = req.options[:dialog].map { |key, val| {:name => key.split('dialog_').last, :value => parse_val(key, val)} }.to_json | |||
# req.options[:dialog]["Array::dialog_param_test1"][1] =="\u001F" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to keep this comment?
val = val.split("\u001F") | ||
tags = [] | ||
val.each do |tag| | ||
tags.push(Classification.find_by(:id => tag.split('::').second).description) | ||
end | ||
val = tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simpler:
val = val.split("\u001F") | |
tags = [] | |
val.each do |tag| | |
tags.push(Classification.find_by(:id => tag.split('::').second).description) | |
end | |
val = tags | |
val = val.split("\u001F").map do |tag| | |
Classification.find_by(:id => tag.split('::').second).description | |
end |
@@ -21,7 +21,16 @@ ManageIQ.angular.app.controller('dialogUserController', ['API', 'dialogFieldRefr | |||
_.forEach(vm.dialog.dialog_tabs, function(tab) { | |||
_.forEach(tab.dialog_groups, function(group) { | |||
_.forEach(group.dialog_fields, function(field) { | |||
console.log(dialogReplaceData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this debug code? If so it should be removed.
Is it possible to build tests on this code or are there already tests? We've had a lot of problems with the multi-select stuff, so I think getting some tests around this would add confidence. |
@Fryguy maybe in one of our follow up cypress prs we can get some cypress tests built around the service order forms and the multi select components. With the current conversion work in place for the dialog editor and order form not sure if this is something we want to do or not though |
Fixes: #9284
Fixes an issue where the initial value for select and multi select drop downs is broken.
Before:


After:

