Fix 2.4.2 upgrade notes formatting refs #19330
[arvados.git] / apps / workbench / app / helpers / application_helper.rb
index 330d30976f93ff54cd6323c66a75b1c336e64ed7..697c469b563f3553f83c15a1089c0f96745d6b48 100644 (file)
@@ -176,7 +176,7 @@ module ApplicationHelper
         raw(link_name)
       else
         controller_class = resource_class.to_s.tableize
-        if controller_class.eql?('groups') and object.andand.group_class.eql?('project')
+        if controller_class.eql?('groups') and (object.andand.group_class.eql?('project') or object.andand.group_class.eql?('filter'))
           controller_class = 'projects'
         end
         (link_to raw(link_name), { controller: controller_class, action: 'show', id: ((opts[:name_link].andand.uuid) || link_uuid) }, style_opts) + raw(tags)
@@ -247,11 +247,15 @@ module ApplicationHelper
     end
 
     input_type = 'text'
+    opt_selection = nil
     attrtype = object.class.attribute_info[attr.to_sym].andand[:type]
     if attrtype == 'text' or attr == 'description'
       input_type = 'textarea'
     elsif attrtype == 'datetime'
       input_type = 'date'
+    elsif attrtype == 'boolean'
+      input_type = 'select'
+      opt_selection = ([{value: "true", text: "true"}, {value: "false", text: "false"}]).to_json
     else
       input_type = 'text'
     end
@@ -279,6 +283,7 @@ module ApplicationHelper
       "data-emptytext" => '(none)',
       "data-placement" => "bottom",
       "data-type" => input_type,
+      "data-source" => opt_selection,
       "data-title" => "Edit #{attr.to_s.gsub '_', ' '}",
       "data-name" => htmloptions['selection_name'] || attr,
       "data-object-uuid" => object.uuid,
@@ -559,7 +564,7 @@ module ApplicationHelper
                      "data-emptytext" => "none",
                      "data-placement" => "bottom",
                      "data-type" => "select",
-                     "data-source" => (opt_empty_selection + primary_type[:symbols].map {|i| {:value => i, :text => i} }).to_json,
+                     "data-source" => (opt_empty_selection + primary_type[:symbols].map {|i| {:value => cwl_shortname(i), :text => cwl_shortname(i)} }).to_json,
                      "data-url" => url_for(action: "update", id: object.uuid, controller: object.class.to_s.pluralize.underscore, merge: true),
                      "data-title" => "Set value for #{cwl_shortname(input_schema[:id])}",
                      "data-name" => dn,