closes #3637
[arvados.git] / apps / workbench / app / models / collection.rb
index 764817509ac98ccb936a9d1d162758ef7da7cef4..78b0c363762883d6a7075b0c501b8cba77acf116 100644 (file)
@@ -57,7 +57,11 @@ class Collection < ArvadosBase
   end
 
   def attribute_editable? attr, *args
-    false
+    if %w(name description manifest_text).include? attr.to_s
+      true
+    else
+      super
+    end
   end
 
   def self.creatable?
@@ -72,4 +76,28 @@ class Collection < ArvadosBase
     arvados_api_client.api "collections/#{self.uuid}/", "used_by"
   end
 
+  def uuid
+    if self[:uuid].nil?
+      return self[:portable_data_hash]
+    else
+      super
+    end
+  end
+
+  def portable_data_hash
+    if self[:portable_data_hash].nil?
+      return self[:uuid]
+    else
+      super
+    end
+  end
+
+  def friendly_link_name
+    if self.respond_to? :name
+      self.name
+    else
+      self.portable_data_hash
+    end
+  end
+
 end