From 71bcc78243f3019dd6df811984d86654fc9b855b Mon Sep 17 00:00:00 2001 From: wandji Date: Wed, 23 Aug 2023 12:12:46 +0100 Subject: [PATCH] Verify sequence asset preview for non-editable role and add css class [SCI-8967] (#6012) * Verify sequence asset preview for non-editable user role and add css class [SCI-8967] * Add safe navigation operator when checking gene sequence blob meta asset_type [SCI-9867] --- app/assets/stylesheets/shared/file_preview.scss | 5 +++++ app/views/shared/file_preview/_content.html.erb | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/shared/file_preview.scss b/app/assets/stylesheets/shared/file_preview.scss index 01d2e29b4..dbf903698 100644 --- a/app/assets/stylesheets/shared/file_preview.scss +++ b/app/assets/stylesheets/shared/file_preview.scss @@ -38,6 +38,11 @@ background-color: var(--sn-white); } + .gene-sequence-asset { + height: 500px; + width: 500px; + } + &.processing { background-image: url("/images/medium/loading_white.svg"); background-position: center; diff --git a/app/views/shared/file_preview/_content.html.erb b/app/views/shared/file_preview/_content.html.erb index 9ecedcf80..3501d3153 100644 --- a/app/views/shared/file_preview/_content.html.erb +++ b/app/views/shared/file_preview/_content.html.erb @@ -62,8 +62,8 @@ <%= render partial: 'shared/pdf_viewer', locals: { asset: asset, report_document: false } %> <% else %> <%= image_tag asset.large_preview, - class: 'asset-image', - style: 'opacity: 0' %> + class: class_names('asset-image', 'gene-sequence-asset': asset.blob&.metadata["asset_type"] == 'gene_sequence'), + style: 'opacity: 0' %> <% end %> <% else %> <%= render partial: 'shared/file_preview/file_icon', locals: { asset: asset } %>