Fix file previews bugs [SCI-5284] (#3026)

This commit is contained in:
aignatov-bio 2021-01-05 09:11:22 +01:00 committed by GitHub
parent a53bfbdd33
commit f795d5180d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 1 deletions

View file

@ -4,7 +4,6 @@
@include md-card-style;
grid-row: span 6;
height: 23em;
overflow: hidden;
padding: 1em;
position: relative;
width: var(--attachment-column-width);

View file

@ -161,6 +161,7 @@ class AssetsController < ApplicationController
render_403 && return unless can_manage_protocol_in_module?(step.protocol) ||
can_manage_protocol_in_repository?(step.protocol)
step_asset = StepAsset.create!(step: step, asset: asset)
asset.update!(view_mode: step.assets_view_mode)
step.protocol&.update(updated_at: Time.zone.now)
edit_url = edit_asset_url(step_asset.asset_id)

View file

@ -49,6 +49,7 @@ class MarvinJsService
def connect_asset(asset, params, current_user)
if params[:object_type] == 'Step'
object = params[:object_type].constantize.find(params[:object_id])
asset.update!(view_mode: object.assets_view_mode)
object.assets << asset
elsif params[:object_type] == 'Result'
my_module = MyModule.find_by(id: params[:object_id])