mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-04 04:04:36 +08:00
Show error for broken file in repository row [SCI-6838] (#4146)
This commit is contained in:
parent
1f0225043f
commit
a5065b82cb
4 changed files with 34 additions and 16 deletions
|
@ -2,23 +2,29 @@
|
|||
|
||||
$.fn.dataTable.render.RepositoryAssetValue = function(data) {
|
||||
var asset = data.value;
|
||||
return `
|
||||
<div class="asset-value-cell">
|
||||
${asset.icon_html}
|
||||
<div>
|
||||
<a class="file-preview-link"
|
||||
id="modal_link${asset.id}"
|
||||
data-no-turbolink="true"
|
||||
data-id="true"
|
||||
data-status="asset-present"
|
||||
data-preview-url="${asset.preview_url}"
|
||||
href="${asset.url}"
|
||||
>
|
||||
${asset.file_name}
|
||||
</a>
|
||||
if (asset.id) {
|
||||
return `
|
||||
<div class="asset-value-cell">
|
||||
${asset.icon_html}
|
||||
<div>
|
||||
<a class="file-preview-link"
|
||||
id="modal_link${asset.id}"
|
||||
data-no-turbolink="true"
|
||||
data-id="true"
|
||||
data-status="asset-present"
|
||||
data-preview-url="${asset.preview_url}"
|
||||
href="${asset.url}"
|
||||
>
|
||||
${asset.file_name}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
`;
|
||||
}
|
||||
return `<div class="processing-error">
|
||||
<i class="fas fa-exclamation-triangle"></i>
|
||||
${I18n.t('my_modules.repository.full_view.error')}
|
||||
</div>`;
|
||||
};
|
||||
|
||||
$.fn.dataTable.render.defaultRepositoryAssetValue = function() {
|
||||
|
|
|
@ -16,6 +16,15 @@
|
|||
}
|
||||
}
|
||||
|
||||
.processing-error {
|
||||
color: $brand-danger;
|
||||
margin-left: 2px;
|
||||
|
||||
.fa-exclamation-triangle {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.repository-table-error {
|
||||
background: $color-white;
|
||||
display: none;
|
||||
|
|
|
@ -13,6 +13,8 @@ module RepositoryDatatable
|
|||
file_name: asset.file_name,
|
||||
icon_html: FileIconsHelper.file_extension_icon_html(asset)
|
||||
}
|
||||
rescue StandardError => e
|
||||
Rails.logger.error e.message
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -986,6 +986,7 @@ en:
|
|||
modal_live_header: ': Live version'
|
||||
modal_snapshot_header: ': Snapshot of %{snapshot_date}'
|
||||
assign_modal_header: 'Assign from %{repository_name} inventory'
|
||||
error: 'Error'
|
||||
snapshots:
|
||||
simple_view:
|
||||
live_bottom_label: 'Live version'
|
||||
|
|
Loading…
Add table
Reference in a new issue