X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/605522fc29649de26b7038e73339ffb35d12768e..2873926cdbfc8012b276db11d24cea3ad6a4bdd4:/apps/workbench/app/models/pipeline_instance.rb diff --git a/apps/workbench/app/models/pipeline_instance.rb b/apps/workbench/app/models/pipeline_instance.rb index 3e9eda2cf8..89acbb0dbb 100644 --- a/apps/workbench/app/models/pipeline_instance.rb +++ b/apps/workbench/app/models/pipeline_instance.rb @@ -1,10 +1,24 @@ class PipelineInstance < ArvadosBase attr_accessor :pipeline_template - def self.goes_in_folders? + def self.goes_in_projects? true end + def friendly_link_name + pipeline_name = self.name + if pipeline_name.nil? or pipeline_name.empty? + template = PipelineTemplate.where(uuid: self.pipeline_template_uuid).first + if template + template.name + else + self.uuid + end + else + pipeline_name + end + end + def content_summary begin PipelineTemplate.find(pipeline_template_uuid).name @@ -28,11 +42,11 @@ class PipelineInstance < ArvadosBase end end end - + def attribute_editable? attr, *args - super(attr, *args) && (attr.to_sym == :name || - (attr.to_sym == :components and - (self.state == 'New' || self.state == 'Ready'))) + super && (attr.to_sym == :name || attr.to_sym == :description || + (attr.to_sym == :components and + (self.state == 'New' || self.state == 'Ready'))) end def attributes_for_display @@ -42,4 +56,19 @@ class PipelineInstance < ArvadosBase def self.creatable? false end + + def component_input_title(component_name, input_name) + component = components[component_name] + return nil if component.nil? + param_info = component[:script_parameters].andand[input_name.to_sym] + if param_info.is_a?(Hash) and param_info[:title] + param_info[:title] + else + "\"#{input_name.to_s}\" parameter for #{component[:script]} script in #{component_name} component" + end + end + + def textile_attributes + [ 'description' ] + end end