mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 21:24:23 +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,6 +2,7 @@
|
||||||
|
|
||||||
$.fn.dataTable.render.RepositoryAssetValue = function(data) {
|
$.fn.dataTable.render.RepositoryAssetValue = function(data) {
|
||||||
var asset = data.value;
|
var asset = data.value;
|
||||||
|
if (asset.id) {
|
||||||
return `
|
return `
|
||||||
<div class="asset-value-cell">
|
<div class="asset-value-cell">
|
||||||
${asset.icon_html}
|
${asset.icon_html}
|
||||||
|
@ -19,6 +20,11 @@ $.fn.dataTable.render.RepositoryAssetValue = function(data) {
|
||||||
</div>
|
</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() {
|
$.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 {
|
.repository-table-error {
|
||||||
background: $color-white;
|
background: $color-white;
|
||||||
display: none;
|
display: none;
|
||||||
|
|
|
@ -13,6 +13,8 @@ module RepositoryDatatable
|
||||||
file_name: asset.file_name,
|
file_name: asset.file_name,
|
||||||
icon_html: FileIconsHelper.file_extension_icon_html(asset)
|
icon_html: FileIconsHelper.file_extension_icon_html(asset)
|
||||||
}
|
}
|
||||||
|
rescue StandardError => e
|
||||||
|
Rails.logger.error e.message
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -986,6 +986,7 @@ en:
|
||||||
modal_live_header: ': Live version'
|
modal_live_header: ': Live version'
|
||||||
modal_snapshot_header: ': Snapshot of %{snapshot_date}'
|
modal_snapshot_header: ': Snapshot of %{snapshot_date}'
|
||||||
assign_modal_header: 'Assign from %{repository_name} inventory'
|
assign_modal_header: 'Assign from %{repository_name} inventory'
|
||||||
|
error: 'Error'
|
||||||
snapshots:
|
snapshots:
|
||||||
simple_view:
|
simple_view:
|
||||||
live_bottom_label: 'Live version'
|
live_bottom_label: 'Live version'
|
||||||
|
|
Loading…
Add table
Reference in a new issue