[ARVADOS] updated: c3457ad20bfd00c99facef396f1dbdbcbdbad241
git at public.curoverse.com
git at public.curoverse.com
Fri Apr 25 17:10:29 EDT 2014
Summary of changes:
apps/workbench/app/helpers/application_helper.rb | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
via c3457ad20bfd00c99facef396f1dbdbcbdbad241 (commit)
from b914818fb9e794dab68c428a52666507352a6770 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit c3457ad20bfd00c99facef396f1dbdbcbdbad241
Author: Tom Clegg <tom at curoverse.com>
Date: Fri Apr 25 17:10:12 2014 -0400
Fix crash when tags exist for items offered in selection widget.
diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index 7231ff8..b172313 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -218,27 +218,27 @@ module ApplicationHelper
dn += '[value]'
end
- items = []
+ selectables = []
attrtext = attrvalue
if dataclass and dataclass.is_a? Class
if attrvalue and !attrvalue.empty?
Link.where(head_uuid: attrvalue, link_class: ["tag", "identifier"]).each do |tag|
attrtext += " [#{tag.name}]"
end
- items.append({name: attrtext, uuid: attrvalue, type: dataclass.to_s})
+ selectables.append({name: attrtext, uuid: attrvalue, type: dataclass.to_s})
end
#dataclass.where(uuid: attrvalue).each do |item|
- # items.append({name: item.uuid, uuid: item.uuid, type: dataclass.to_s})
+ # selectables.append({name: item.uuid, uuid: item.uuid, type: dataclass.to_s})
#end
itemuuids = []
dataclass.limit(10).each do |item|
itemuuids << item.uuid
- items.append({name: item.uuid, uuid: item.uuid, type: dataclass.to_s})
+ selectables.append({name: item.uuid, uuid: item.uuid, type: dataclass.to_s})
end
Link.where(head_uuid: itemuuids, link_class: ["tag", "identifier"]).each do |tag|
- items.each do |item|
- if item.uuid == tag.head_uuid
- item.name += ' [' + tag.name + ']'
+ selectables.each do |selectable|
+ if selectable['uuid'] == tag.head_uuid
+ selectable['name'] += ' [' + tag.name + ']'
end
end
end
@@ -260,8 +260,8 @@ module ApplicationHelper
lt += raw("\n<script>")
- if items.any?
- lt += raw("add_form_selection_sources(#{items.to_json});\n")
+ if selectables.any?
+ lt += raw("add_form_selection_sources(#{selectables.to_json});\n")
end
lt += raw("$('##{id}').editable({source: function() { return select_form_sources('#{dataclass}'); } });\n")
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list