projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
14322: Tweak JSON_KEEP_LOCATOR_REGEXP and comment
[arvados.git]
/
apps
/
workbench
/
app
/
helpers
/
application_helper.rb
diff --git
a/apps/workbench/app/helpers/application_helper.rb
b/apps/workbench/app/helpers/application_helper.rb
index 15bf77fa094f188e5b3f8be980c5c57e3d73bcfe..4c4b5ff34df52c471fa2ceaf566e8f9a5b606d02 100644
(file)
--- a/
apps/workbench/app/helpers/application_helper.rb
+++ b/
apps/workbench/app/helpers/application_helper.rb
@@
-495,11
+495,12
@@
module ApplicationHelper
chooser_title = "Choose a #{primary_type == 'Directory' ? 'dataset' : 'file'}:"
selection_param = object.class.to_s.underscore + dn
if attrvalue.is_a? Hash
chooser_title = "Choose a #{primary_type == 'Directory' ? 'dataset' : 'file'}:"
selection_param = object.class.to_s.underscore + dn
if attrvalue.is_a? Hash
- display_value = attrvalue[:"arv:collection"] || attrvalue[:location]
+ display_value = attrvalue[:"
http://arvados.org/cwl#collectionUUID"] || attrvalue[:"
arv:collection"] || attrvalue[:location]
re = CollectionsHelper.match_uuid_with_optional_filepath(display_value)
re = CollectionsHelper.match_uuid_with_optional_filepath(display_value)
+ locationre = CollectionsHelper.match(attrvalue[:location][5..-1])
if re
if re
- if re[4]
- display_value = "#{Collection.find(re[1]).name} / #{re[4][1..-1]}"
+ if
locationre and location
re[4]
+ display_value = "#{Collection.find(re[1]).name} / #{
location
re[4][1..-1]}"
else
display_value = Collection.find(re[1]).name
end
else
display_value = Collection.find(re[1]).name
end
@@
-677,8
+678,8
@@
module ApplicationHelper
render_runtime duration, use_words, round_to_min
end
render_runtime duration, use_words, round_to_min
end
- # Keep locators are expected to be of the form \"...<pdh/file_path>\"
- JSON_KEEP_LOCATOR_REGEXP = /([0-9a-f]{32}\+\d+[^'"]*
?
)(?=['"]|\z|$)/
+ # Keep locators are expected to be of the form \"...<pdh/file_path>\"
or \"...<uuid/file_path>\"
+ JSON_KEEP_LOCATOR_REGEXP = /([0-9a-f]{32}\+\d+[^'"]*
|[a-z0-9]{5}-4zz18-[a-z0-9]{15}[^'"]*
)(?=['"]|\z|$)/
def keep_locator_in_json str
# Return a list of all matches
str.scan(JSON_KEEP_LOCATOR_REGEXP).flatten
def keep_locator_in_json str
# Return a list of all matches
str.scan(JSON_KEEP_LOCATOR_REGEXP).flatten