X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/949ed4898bc5af8eaf0fdd21c00f7242168cfe22..b79c440b6af5cf4855e3fb3fb510b3eb8de1da9c:/apps/workbench/app/helpers/application_helper.rb diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb index c3856c2f29..428c14f828 100644 --- a/apps/workbench/app/helpers/application_helper.rb +++ b/apps/workbench/app/helpers/application_helper.rb @@ -260,12 +260,18 @@ module ApplicationHelper display_value = value_info[:link_name] end end + if (attr == :components) and (subattr.size > 2) + chooser_title = "Choose a dataset for #{object.component_input_title(subattr[0], subattr[2])}:" + else + chooser_title = "Choose a dataset:" + end modal_path = choose_collections_path \ - ({ title: 'Choose a dataset:', - filters: [['tail_uuid', '=', object.owner_uuid]].to_json, + ({ title: chooser_title, + filters: [['owner_uuid', '=', object.owner_uuid]].to_json, action_name: 'OK', action_href: pipeline_instance_path(id: object.uuid), action_method: 'patch', + preconfigured_search_str: "#{value_info[:search_for]}", action_data: { merge: true, selection_param: selection_param, @@ -428,4 +434,13 @@ module ApplicationHelper RESOURCE_CLASS_ICONS.fetch(class_name, default) end end + + def chooser_preview_url_for object + case object.class.to_s + when 'Collection' + polymorphic_path(object, tab_pane: 'chooser_preview') + else + nil + end + end end