mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 13:14:29 +08:00
Disable preview for form repository row snapshot assets [SCI-11788]
This commit is contained in:
parent
45718a0089
commit
4db268ec2c
4 changed files with 6 additions and 4 deletions
|
@ -22,7 +22,7 @@
|
|||
<div v-if="file_name">
|
||||
<div class="flex flex-row justify-between">
|
||||
<div class="w-full cursor-pointer relative" @mouseover="tooltipShowing = true" @mouseout="tooltipShowing = false">
|
||||
<a class="w-full inline-block file-preview-link truncate text-sn-science-blue" :id="modalPreviewLinkId" data-no-turbolink="true"
|
||||
<a :class="{ 'file-preview-link': !this?.snapshot }" class="w-full inline-block truncate text-sn-science-blue" :id="modalPreviewLinkId" data-no-turbolink="true"
|
||||
data-id="true" data-status="asset-present" :data-preview-url=this?.preview_url :href=this?.url>
|
||||
{{ file_name }}
|
||||
</a>
|
||||
|
@ -97,6 +97,7 @@ export default {
|
|||
this.file_name = this.colVal.file_name;
|
||||
this.icon_html = this.colVal.icon_html;
|
||||
this.medium_preview_url = this.colVal.medium_preview_url;
|
||||
this.snapshot = this.colVal.snapshot;
|
||||
},
|
||||
computed: {
|
||||
modalPreviewLinkId() {
|
||||
|
|
|
@ -51,7 +51,7 @@ class Asset < ApplicationRecord
|
|||
joins(file_attachment: :blob).order(sort)
|
||||
}
|
||||
|
||||
attr_accessor :file_content, :file_info
|
||||
attr_accessor :file_content, :file_info, :snapshot
|
||||
|
||||
before_save :reset_file_processing, if: -> { file.new_record? }
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ class FormRepositoryRowsFieldValue < FormFieldValue
|
|||
end
|
||||
|
||||
cell_value.asset = Asset.new(
|
||||
cell_attributes['repository_asset_value']['asset'].except('file')
|
||||
cell_attributes['repository_asset_value']['asset'].except('file').merge(snapshot: true)
|
||||
)
|
||||
|
||||
cell_value.asset.file = snapshot_file.blob
|
||||
|
|
|
@ -14,7 +14,8 @@ module RepositoryDatatable
|
|||
preview_url: asset_file_preview_path(asset),
|
||||
file_name: escape_input(asset.file_name),
|
||||
icon_html: sn_icon_for(asset),
|
||||
medium_preview_url: asset.previewable? && rails_representation_url(asset.medium_preview)
|
||||
medium_preview_url: asset.previewable? && rails_representation_url(asset.medium_preview),
|
||||
snapshot: asset.snapshot
|
||||
}
|
||||
rescue StandardError => e
|
||||
Rails.logger.error e.message
|
||||
|
|
Loading…
Add table
Reference in a new issue