mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-07 13:44:23 +08:00
Fix inventory multiline file uploads [SCI-7473]
This commit is contained in:
parent
41a7609c3e
commit
95348b82e8
2 changed files with 8 additions and 6 deletions
|
@ -38,6 +38,7 @@ var AssetColumnHelper = (function() {
|
||||||
value="${blob.signed_id}"/>`);
|
value="${blob.signed_id}"/>`);
|
||||||
|
|
||||||
filesUploadedCntr += 1;
|
filesUploadedCntr += 1;
|
||||||
|
|
||||||
if (filesUploadedCntr === filesToUploadCntr) {
|
if (filesUploadedCntr === filesToUploadCntr) {
|
||||||
resolve('done');
|
resolve('done');
|
||||||
}
|
}
|
||||||
|
@ -52,12 +53,13 @@ var AssetColumnHelper = (function() {
|
||||||
let empty = $cell.is(':empty');
|
let empty = $cell.is(':empty');
|
||||||
let fileName = $cell.find('a.file-preview-link').text();
|
let fileName = $cell.find('a.file-preview-link').text();
|
||||||
let placeholder = I18n.t('repositories.table.assets.select_file_btn', { max_size: GLOBAL_CONSTANTS.FILE_MAX_SIZE_MB });
|
let placeholder = I18n.t('repositories.table.assets.select_file_btn', { max_size: GLOBAL_CONSTANTS.FILE_MAX_SIZE_MB });
|
||||||
|
let rowId = $cell.parent().attr('id');
|
||||||
|
|
||||||
$cell.html(`
|
$cell.html(`
|
||||||
<div class="file-editing">
|
<div class="file-editing">
|
||||||
<div class="file-hidden-field-container hidden"></div>
|
<div class="file-hidden-field-container hidden"></div>
|
||||||
<input class=""
|
<input class=""
|
||||||
id="repository_file_${columnId}"
|
id="repository_file_${columnId}_${rowId}"
|
||||||
form="${formId}"
|
form="${formId}"
|
||||||
type="file"
|
type="file"
|
||||||
data-col-id="${columnId}"
|
data-col-id="${columnId}"
|
||||||
|
@ -66,7 +68,7 @@ var AssetColumnHelper = (function() {
|
||||||
data-type="RepositoryAssetValue">
|
data-type="RepositoryAssetValue">
|
||||||
<div class="file-upload-button ${empty ? 'new-file' : ''}">
|
<div class="file-upload-button ${empty ? 'new-file' : ''}">
|
||||||
<i class="fas fa-paperclip icon"></i>
|
<i class="fas fa-paperclip icon"></i>
|
||||||
<label data-placeholder="${placeholder}" for="repository_file_${columnId}">${fileName}</label>
|
<label data-placeholder="${placeholder}" for="repository_file_${columnId}_${rowId}">${fileName}</label>
|
||||||
<span class="delete-action fas fa-trash"> </span>
|
<span class="delete-action fas fa-trash"> </span>
|
||||||
</div>
|
</div>
|
||||||
</div>`);
|
</div>`);
|
||||||
|
|
|
@ -26,7 +26,7 @@ var RepositoryDatatableRowEditor = (function() {
|
||||||
let $row = $form.closest('tr');
|
let $row = $form.closest('tr');
|
||||||
let valid = true;
|
let valid = true;
|
||||||
let directUrl = $table.data('direct-upload-url');
|
let directUrl = $table.data('direct-upload-url');
|
||||||
let $files = $row.find('input[type=file]');
|
let $files = $table.find('input[type=file]');
|
||||||
$row.find('.has-error').removeClass('has-error').find('span').remove();
|
$row.find('.has-error').removeClass('has-error').find('span').remove();
|
||||||
|
|
||||||
// Validations here
|
// Validations here
|
||||||
|
|
Loading…
Add table
Reference in a new issue