Skip to content

Commit cf20fa1

Browse files
authored
Merge pull request #9220 from GilbertCherrie/fix_request_form_fields
Fix request form automation fields
2 parents 43bb230 + 6e88ba0 commit cf20fa1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

app/views/miq_request/_request_dialog_details.html.haml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@
2828
= h(field.values.detect { |k, _v| k == wf.value(field.name) }.try(:last) || wf.value(field.name))
2929

3030
- when "DialogFieldDropDownList"
31-
= h(field.value.blank? ? _("<None>") : field.value.to_s.gsub("\x1F", ", "))
31+
- if field.value.instance_of?(Array)
32+
= h(field.value.blank? ? _("<None>") : h(field.value.join(", ")))
33+
- else
34+
= h(field.value.blank? ? _("<None>") : h(field.value))
3235

3336
- when 'DialogFieldTagControl'
34-
- value = wf.value(field.name) || '' # it returns in format Clasification::id
35-
- classifications = value.split(',').map do |c|
36-
- classification = Classification.find_by(id: c.split('::').second)
37-
- classification.description if classification
37+
- value = wf.value(field.name) || ''
38+
- classifications = Classification.where(:id => value).pluck(:description)
3839
- if classifications.empty?
3940
= h('')
4041
-else

0 commit comments

Comments
 (0)