Fix downloading of BioEddie files in reports [SCI-6037] (#3623)

This commit is contained in:
Alex Kriuchykhin 2022-02-02 10:41:57 +01:00 committed by GitHub
parent f1e04cc604
commit 2a6b33deec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 7 deletions

View file

@ -25,9 +25,15 @@
</a>
<% else %>
<em>
<%= t("projects.reports.elements.result_asset.file_name",
file: truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
<%= link_to t('projects.reports.elements.download'), asset_download_url(asset, disposition: 'attachment'), class: 'download-link', target: :_blank %>
<% if asset.file.metadata[:asset_type] == 'bio_eddie' %>
<%= t("projects.reports.elements.result_asset.file_name", file: truncate("#{asset.file.metadata[:name]}.helm", length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
<a class="btn btn-light file-download-link" href="data:text/plain;charset=utf-8,<%= asset.file.metadata[:description] %>" download="<%= asset.file.metadata[:name] %>.helm" data-turbolinks="false">
<span class="fas fa-download"></span> <%= t('Download')%>
</a>
<% else %>
<%= t("projects.reports.elements.result_asset.file_name", file: truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
<%= link_to t('projects.reports.elements.download'), asset_download_url(asset, disposition: 'attachment'), class: 'download-link', target: :_blank %>
<% end %>
</em>
<% end %>
</div>

View file

@ -18,9 +18,15 @@
</a>
<% else %>
<em>
<%= t('projects.reports.elements.step_asset.file_name',
file: truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
<%= link_to t('projects.reports.elements.download'), asset_download_url(asset, disposition: 'attachment'), class: 'download-link', target: :_blank %>
<% if asset.file.metadata[:asset_type] == 'bio_eddie' %>
<%= t('projects.reports.elements.step_asset.file_name', file: truncate("#{asset.file.metadata[:name]}.helm", length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
<a class="btn btn-light file-download-link" href="data:text/plain;charset=utf-8,<%= asset.file.metadata[:description] %>" download="<%= asset.file.metadata[:name] %>.helm" data-turbolinks="false">
<span class="fas fa-download"></span> <%= t('Download')%>
</a>
<% else %>
<%= t('projects.reports.elements.step_asset.file_name', file: truncate(asset.file_name, length: Constants::FILENAME_TRUNCATION_LENGTH)) %>
<%= link_to t('projects.reports.elements.download'), asset_download_url(asset, disposition: 'attachment'), class: 'download-link', target: :_blank %>
<% end %>
</em>
<% end %>
</div>

View file

@ -48,7 +48,7 @@
<% end %>
<% end %>
<% if asset.file.metadata[:asset_type] == 'bio_eddie' %>
<a class="btn btn-light file-download-link" href="data:text/plain;charset=utf-8,<%= asset.file.metadata[:description] %>" download="<%= asset.file.metadata[:name] %>.helm" data-turbolinks="false">
<a class="btn btn-light file-download-link" href="data:text/plain;charset=utf-8,<%= asset.file.metadata[:description] %>" download="<%= asset.file.metadata[:name] %>.helm" data-turbolinks="false">
<span class="fas fa-download"></span> <%= t('Download')%>
</a>
<% else %>