mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-03 19:24:48 +08:00
Fix file previews bugs [SCI-5284] (#3026)
This commit is contained in:
parent
a53bfbdd33
commit
f795d5180d
3 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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])
|
||||
|
|
Loading…
Reference in a new issue