[ARVADOS] updated: f900ccf514a3653a64002fe07d9ce5b16adcfd51
git at public.curoverse.com
git at public.curoverse.com
Thu May 8 16:38:22 EDT 2014
Summary of changes:
.../app/views/application/_show_metadata.html.erb | 4 ++--
.../workbench/test/integration/collections_test.rb | 9 +++++++++
services/api/test/fixtures/links.yml | 16 ++++++++++++++++
3 files changed, 27 insertions(+), 2 deletions(-)
via f900ccf514a3653a64002fe07d9ce5b16adcfd51 (commit)
from 97d8fa64264069fe6d8ae6c8131fd3cc2f347189 (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 f900ccf514a3653a64002fe07d9ce5b16adcfd51
Author: Brett Smith <brett at curoverse.com>
Date: Thu May 8 16:38:46 2014 -0400
2759: Workbench shouldn't try to make links from Link names.
Because the name attribute can include arbitrary text, it might
resemble an Arvados object UUID. If that happens, the
_arvados_attr_value partial will try to make a link from it. All
sorts of weirdness could happen as a result (our specific bug was a
bad URL fed to Workbench's API client), so don't even try. Just
render the name directly as editable text.
Closes #2759.
diff --git a/apps/workbench/app/views/application/_show_metadata.html.erb b/apps/workbench/app/views/application/_show_metadata.html.erb
index f36240b..551806f 100644
--- a/apps/workbench/app/views/application/_show_metadata.html.erb
+++ b/apps/workbench/app/views/application/_show_metadata.html.erb
@@ -18,7 +18,7 @@
<tr>
<td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "uuid", attrvalue: link.uuid } %></td>
<td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "link_class", attrvalue: link.link_class } %></td>
- <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "name", attrvalue: link.name } %></td>
+ <td><%= render_editable_attribute link, 'name' %></td>
<td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "properties", attrvalue: link.properties } %></td>
<td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "head_uuid", attrvalue: link.head_uuid } %></td>
</tr>
@@ -47,7 +47,7 @@ No metadata.
<td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "uuid", attrvalue: link.uuid } %></td>
<td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "tail_uuid", attrvalue: link.tail_uuid } %></td>
<td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "link_class", attrvalue: link.link_class } %></td>
- <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "name", attrvalue: link.name } %></td>
+ <td><%= render_editable_attribute link, 'name' %></td>
<td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "properties", attrvalue: link.properties } %></td>
</tr>
<% end %>
diff --git a/apps/workbench/test/integration/collections_test.rb b/apps/workbench/test/integration/collections_test.rb
index bd426f7..4a33693 100644
--- a/apps/workbench/test/integration/collections_test.rb
+++ b/apps/workbench/test/integration/collections_test.rb
@@ -39,4 +39,13 @@ class CollectionsTest < ActionDispatch::IntegrationTest
change_persist 'persistent', 'cache'
end
+ test "Collection page renders default name links" do
+ uuid = api_fixture('collections')['foo_file']['uuid']
+ coll_name = api_fixture('links')['foo_collection_name_in_afolder']['name']
+ visit page_with_token('active', "/collections/#{uuid}")
+ assert(page.has_text?(coll_name), "Collection page did not include name")
+ # Now check that the page is otherwise normal, and the collection name
+ # isn't only showing up in an error message.
+ assert(page.has_link?('foo'), "Collection page did not include file link")
+ end
end
diff --git a/services/api/test/fixtures/links.yml b/services/api/test/fixtures/links.yml
index 1385467..ba6e83e 100644
--- a/services/api/test/fixtures/links.yml
+++ b/services/api/test/fixtures/links.yml
@@ -346,6 +346,22 @@ job_name_in_afolder:
name: "I'm a job in a folder"
properties: {}
+foo_collection_name_in_afolder:
+ uuid: zzzzz-o0j2j-foofoldername12
+ owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+ created_at: 2014-04-21 15:37:48 -0400
+ modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
+ modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+ modified_at: 2014-04-21 15:37:48 -0400
+ updated_at: 2014-04-21 15:37:48 -0400
+ tail_uuid: zzzzz-j7d0g-v955i6s2oi1cbso
+ head_uuid: 1f4b0bc7583c2a7f9102c395f4ffc5e3+45
+ link_class: name
+ # This should resemble the default name assigned when a
+ # Collection is added to a Folder.
+ name: "1f4b0bc7583c2a7f9102c395f4ffc5e3+45 added sometime"
+ properties: {}
+
foo_collection_tag:
uuid: zzzzz-o0j2j-eedahfaho8aphiv
owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list