- # preload data
- preload_uuids = []
- items = []
- selectables = []
-
- attrtext = attrvalue
- if dataclass.is_a? Class and dataclass < ArvadosBase
- objects = get_n_objects_of_class dataclass, 10
- objects.each do |item|
- items << item
- preload_uuids << item.uuid
- end
- if attrvalue and !attrvalue.empty?
- preload_uuids << attrvalue
- end
- preload_links_for_objects preload_uuids
-
- if attrvalue and !attrvalue.empty?
- links_for_object(attrvalue).each do |link|
- if link.link_class.in? ["tag", "identifier"]
- attrtext += " [#{link.name}]"
- end
- end
- selectables.append({name: attrtext, uuid: attrvalue, type: dataclass.to_s})
- end
- itemuuids = []
- items.each do |item|
- itemuuids << item.uuid
- selectables.append({name: item.uuid, uuid: item.uuid, type: dataclass.to_s})
- end
-
- itemuuids.each do |itemuuid|
- links_for_object(itemuuid).each do |link|
- if link.link_class.in? ["tag", "identifier"]
- selectables.each do |selectable|
- if selectable['uuid'] == link.head_uuid
- selectable['name'] += ' [' + link.name + ']'
- end
- end
- end
- end
- end
- end
-
- lt = link_to attrtext, '#', {
+ # When datatype is a String or Fixnum, link_to the attrvalue
+ lt = link_to attrvalue, '#', {