Skip to content

Conversation

GilbertCherrie
Copy link
Member

@GilbertCherrie GilbertCherrie commented Jun 10, 2025

Fixes: #9284

Fixes an issue where the initial value for select and multi select drop downs is broken.

Before:
Screenshot 2025-06-19 at 2 10 58 PM
Screenshot 2025-06-19 at 2 05 45 PM

After:
Screenshot 2025-06-19 at 2 04 01 PM
Screenshot 2025-06-19 at 2 04 05 PM

@GilbertCherrie GilbertCherrie requested a review from a team as a code owner June 10, 2025 20:36
@miq-bot miq-bot added the wip label Jun 10, 2025
@miq-bot
Copy link
Member

miq-bot commented Jun 10, 2025

Checked commit GilbertCherrie@0b70385 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.62.0, and yamllint
1 file checked, 1 offense detected

app/controllers/miq_request_controller.rb

@GilbertCherrie GilbertCherrie requested a review from Fryguy June 19, 2025 18:09
@GilbertCherrie GilbertCherrie added bug and removed wip labels Jun 19, 2025
@GilbertCherrie GilbertCherrie changed the title [WIP] Fixed the copy request dialog form Fixed the copy request dialog form Jul 2, 2025
@GilbertCherrie GilbertCherrie force-pushed the fix_copy_request_dialog_form branch from 0b70385 to 55d6ffe Compare August 6, 2025 16:21
@GilbertCherrie
Copy link
Member Author

@elsamaryv please review

@GilbertCherrie GilbertCherrie force-pushed the fix_copy_request_dialog_form branch from 55d6ffe to 1716255 Compare August 7, 2025 14:09
@GilbertCherrie GilbertCherrie force-pushed the fix_copy_request_dialog_form branch from 1716255 to c82ee93 Compare August 7, 2025 14:09
@@ -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"
Copy link
Member

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?

Comment on lines +354 to +359
val = val.split("\u001F")
tags = []
val.each do |tag|
tags.push(Classification.find_by(:id => tag.split('::').second).description)
end
val = tags
Copy link
Member

Choose a reason for hiding this comment

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

Simpler:

Suggested change
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);
Copy link
Member

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.

@Fryguy
Copy link
Member

Fryguy commented Aug 18, 2025

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.

@GilbertCherrie
Copy link
Member Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Form Field Display Issue with "Copy Original Request" Button and Multiselect Options
4 participants