[ARVADOS] created: be0830dcdc10ff352d89a20fa2a24000a5ca8984
Git user
git at public.curoverse.com
Thu Jul 20 09:21:40 EDT 2017
at be0830dcdc10ff352d89a20fa2a24000a5ca8984 (commit)
commit be0830dcdc10ff352d89a20fa2a24000a5ca8984
Author: radhika <radhika at curoverse.com>
Date: Thu Jul 20 09:20:53 2017 -0400
1195: add .bed and .cwl to file types that can previewed
Arvados-DCO-1.1-Signed-off-by: Radhika Chippada <radhika at curoverse.com>
diff --git a/apps/workbench/app/helpers/collections_helper.rb b/apps/workbench/app/helpers/collections_helper.rb
index e249eaa..4708ab6 100644
--- a/apps/workbench/app/helpers/collections_helper.rb
+++ b/apps/workbench/app/helpers/collections_helper.rb
@@ -62,6 +62,8 @@ module CollectionsHelper
# Check if collection preview is allowed for the given filename with extension
#
def preview_allowed_for file_name
+ return true if file_name.end_with?('.cwl') # unknown mime type, but we want to offer preview
+
file_type = MIME::Types.type_for(file_name).first
if file_type.nil?
false
diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml
index 943432d..8b9bf15 100644
--- a/apps/workbench/config/application.default.yml
+++ b/apps/workbench/config/application.default.yml
@@ -209,7 +209,7 @@ common:
# would be enabled in a collection's show page.
# It is sufficient to list only applications here.
# No need to list text and image types.
- application_mimetypes_with_view_icon: [fasta, go, javascript, json, pdf, python, r, rtf, sam, sh, xml, xsl]
+ application_mimetypes_with_view_icon: [cwl, fasta, go, javascript, json, pdf, python, r, rtf, sam, sh, vnd.realvnc.bed, xml, xsl]
# the maximum number of bytes to load in the log viewer
log_viewer_max_bytes: 1000000
diff --git a/apps/workbench/test/helpers/collections_helper_test.rb b/apps/workbench/test/helpers/collections_helper_test.rb
index ae41d84..e02b2ab 100644
--- a/apps/workbench/test/helpers/collections_helper_test.rb
+++ b/apps/workbench/test/helpers/collections_helper_test.rb
@@ -29,6 +29,9 @@ class CollectionsHelperTest < ActionView::TestCase
["filename.xml", true],
["filename.xsl", true],
["filename.yml", true],
+ ["filename.yaml", true],
+ ["filename.bed", true],
+ ["filename.cwl", true],
["filename.bam", false],
["filename.tar", false],
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list