From: Radhika Chippada Date: Wed, 11 Feb 2015 22:32:37 +0000 (-0500) Subject: 5185: in project data collections tab, show description when available; otherwise... X-Git-Tag: 1.1.0~1818^2~2 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/cd00c7d65d724ea78fe6e59dda333241a7c0775a 5185: in project data collections tab, show description when available; otherwise display modified time. --- diff --git a/apps/workbench/app/models/collection.rb b/apps/workbench/app/models/collection.rb index 1bd711be64..a8eebf367e 100644 --- a/apps/workbench/app/models/collection.rb +++ b/apps/workbench/app/models/collection.rb @@ -35,7 +35,13 @@ class Collection < ArvadosBase end def content_summary - ApplicationController.helpers.human_readable_bytes_html(total_bytes) + " " + super + if total_bytes > 0 + ApplicationController.helpers.human_readable_bytes_html(total_bytes) + " " + super + elsif description + description + else + super + " modified at " + modified_at.to_s + end end def total_bytes diff --git a/apps/workbench/test/integration/projects_test.rb b/apps/workbench/test/integration/projects_test.rb index 73a23d6d35..1a8fa6e791 100644 --- a/apps/workbench/test/integration/projects_test.rb +++ b/apps/workbench/test/integration/projects_test.rb @@ -712,6 +712,16 @@ class ProjectsTest < ActionDispatch::IntegrationTest "/projects/#{project['uuid']}#Advanced")) assert_text("API response") find("#page-wrapper .nav-tabs :first-child a").click - assert_text("bytes Collection") + assert_text("Collection modified at") + end + + test "verify description column in data collections tab" do + project = api_fixture('groups')['aproject'] + visit(page_with_token('active_trustedclient', "/projects/#{project['uuid']}")) + + collection = api_fixture('collections')['collection_to_move_around_in_aproject'] + assert_text collection['name'] + assert_text collection['description'] + assert_text 'Collection modified at' # there are collections with no descriptions end end diff --git a/services/api/test/fixtures/collections.yml b/services/api/test/fixtures/collections.yml index 9ddc45272c..d4391372ba 100644 --- a/services/api/test/fixtures/collections.yml +++ b/services/api/test/fixtures/collections.yml @@ -197,6 +197,7 @@ collection_to_move_around_in_aproject: updated_at: 2014-02-03T17:22:54Z manifest_text: ". 73feffa4b7f6bb68e44cf984c85f6e88+3 0:3:baz\n" name: collection_to_move_around + description: description for the collection to move around expired_collection: uuid: zzzzz-4zz18-mto52zx1s7sn3ih