X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d843787b4ece9952597d7814cbf10fb383c72625..b6d7efab2c4bffa3fabd55b166e44cca8ac1391f:/apps/workbench/app/helpers/collections_helper.rb diff --git a/apps/workbench/app/helpers/collections_helper.rb b/apps/workbench/app/helpers/collections_helper.rb index 25f2cb53e6..0c89ca8783 100644 --- a/apps/workbench/app/helpers/collections_helper.rb +++ b/apps/workbench/app/helpers/collections_helper.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + module CollectionsHelper def d3ify_links(links) links.collect do |x| @@ -51,7 +55,7 @@ module CollectionsHelper f0 = '' if f0 == '.' f0 = f0[2..-1] if f0[0..1] == './' f0 += '/' if not f0.empty? - file_path = "#{f0}#{file[1]}" + "#{f0}#{file[1]}" end ## @@ -60,11 +64,15 @@ module CollectionsHelper def preview_allowed_for file_name file_type = MIME::Types.type_for(file_name).first if file_type.nil? - false + if file_name.downcase.end_with?('.cwl') # unknown mime type, but we support preview + true + else + false + end elsif (file_type.raw_media_type == "text") || (file_type.raw_media_type == "image") true elsif (file_type.raw_media_type == "application") && - (Rails.configuration.application_mimetypes_with_view_icon.include? (file_type.sub_type)) + Rails.configuration.Workbench.ApplicationMimetypesWithViewIcon[file_type.sub_type] true else false