mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +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
|
@ -32,12 +32,13 @@ var AssetColumnHelper = (function() {
|
|||
} else {
|
||||
$el
|
||||
.prev('.file-hidden-field-container')
|
||||
.html(`<input type="hidden"
|
||||
form="${$el.attr('form')}"
|
||||
name="repository_cells[${$el.data('col-id')}]"
|
||||
.html(`<input type="hidden"
|
||||
form="${$el.attr('form')}"
|
||||
name="repository_cells[${$el.data('col-id')}]"
|
||||
value="${blob.signed_id}"/>`);
|
||||
|
||||
filesUploadedCntr += 1;
|
||||
|
||||
if (filesUploadedCntr === filesToUploadCntr) {
|
||||
resolve('done');
|
||||
}
|
||||
|
@ -52,12 +53,13 @@ var AssetColumnHelper = (function() {
|
|||
let empty = $cell.is(':empty');
|
||||
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 rowId = $cell.parent().attr('id');
|
||||
|
||||
$cell.html(`
|
||||
<div class="file-editing">
|
||||
<div class="file-hidden-field-container hidden"></div>
|
||||
<input class=""
|
||||
id="repository_file_${columnId}"
|
||||
id="repository_file_${columnId}_${rowId}"
|
||||
form="${formId}"
|
||||
type="file"
|
||||
data-col-id="${columnId}"
|
||||
|
@ -66,7 +68,7 @@ var AssetColumnHelper = (function() {
|
|||
data-type="RepositoryAssetValue">
|
||||
<div class="file-upload-button ${empty ? 'new-file' : ''}">
|
||||
<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>
|
||||
</div>
|
||||
</div>`);
|
||||
|
|
|
@ -26,7 +26,7 @@ var RepositoryDatatableRowEditor = (function() {
|
|||
let $row = $form.closest('tr');
|
||||
let valid = true;
|
||||
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();
|
||||
|
||||
// Validations here
|
||||
|
|
Loading…
Reference in a new issue