X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e08c67024acccb83a30d2010c34862973b883585..2935de4fbccf43b7daedb9412f2ada1bf65c52ab:/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 c3b14755f3..936905713e 100644 --- a/apps/workbench/app/models/pipeline_instance.rb +++ b/apps/workbench/app/models/pipeline_instance.rb @@ -5,6 +5,24 @@ class PipelineInstance < ArvadosBase true end + def friendly_link_name lookup=nil + pipeline_name = self.name + if pipeline_name.nil? or pipeline_name.empty? + template = if lookup and lookup[self.pipeline_template_uuid] + lookup[self.pipeline_template_uuid] + else + PipelineTemplate.where(uuid: self.pipeline_template_uuid).first + end + if template + template.name + else + self.uuid + end + else + pipeline_name + end + end + def content_summary begin PipelineTemplate.find(pipeline_template_uuid).name @@ -28,9 +46,9 @@ class PipelineInstance < ArvadosBase end end end - + def attribute_editable? attr, *args - super && (attr.to_sym == :name || + super && (attr.to_sym == :name || attr.to_sym == :description || (attr.to_sym == :components and (self.state == 'New' || self.state == 'Ready'))) end @@ -42,4 +60,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