Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2023-09-26 15:26:21 +01:00
commit 3aeea007b2
4 changed files with 18 additions and 1 deletions

View file

@ -484,8 +484,17 @@ class Importer extends Component
public function selectFile($id)
{
$this->clearMessage();
$this->activeFile = Import::find($id);
if (!$this->activeFile) {
$this->message = trans('admin/hardware/message.import.file_missing');
$this->message_type = 'danger';
return;
}
$this->field_map = null;
foreach($this->activeFile->header_row as $element) {
if(isset($this->activeFile->field_map[$element])) {
@ -520,6 +529,12 @@ class Importer extends Component
}
}
public function clearMessage()
{
$this->message = null;
$this->message_type = null;
}
public function render()
{
$this->files = Import::orderBy('id','desc')->get(); //HACK - slows down renders.

View file

@ -51,6 +51,7 @@ return [
'success' => 'Your file has been imported',
'file_delete_success' => 'Your file has been been successfully deleted',
'file_delete_error' => 'The file was unable to be deleted',
'file_missing' => 'The file selected is missing',
'header_row_has_malformed_characters' => 'One or more attributes in the header row contain malformed UTF-8 characters',
'content_row_has_malformed_characters' => 'One or more attributes in the first row of content contain malformed UTF-8 characters',
],

View file

@ -303,6 +303,7 @@
};
data.process().done( function () {data.submit();});
@this.progress = 0;
@this.clearMessage();
},
progress: function(e, data) {
@this.progress = parseInt((data.loaded / data.total * 100, 10));

View file

@ -42,7 +42,7 @@
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
},
reorderableColumns: true,
// reorderableColumns: true,
stickyHeader: true,
stickyHeaderOffsetLeft: parseInt($('body').css('padding-left'), 10),
stickyHeaderOffsetRight: parseInt($('body').css('padding-right'), 10),