From 9e354412815d995e83d28e1b2358ae38cf4b0421 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 29 May 2024 15:50:42 -0700 Subject: [PATCH] Importer fixes --- resources/views/livewire/importer.blade.php | 29 ++++++++------------- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/resources/views/livewire/importer.blade.php b/resources/views/livewire/importer.blade.php index 6d0e30d539..f006573c8e 100644 --- a/resources/views/livewire/importer.blade.php +++ b/resources/views/livewire/importer.blade.php @@ -150,10 +150,9 @@ {{ trans('general.import_type') }} -
+
{{ Form::select('activeFile.import_type', $importTypes, $activeFile->import_type, [ 'id' => 'import_type', - 'class' => 'livewire-select2', 'style' => 'min-width: 350px', 'data-placeholder' => trans('general.select_var', ['thing' => trans('general.import_type')]), 'placeholder' => '', //needed so that the form-helper will put an empty option first @@ -170,9 +169,7 @@
@if ($activeFile->import_type === 'asset' && $snipeSettings->auto_increment_assets == 1 && $update) @@ -182,16 +179,12 @@ @endif @@ -230,11 +223,11 @@
-
+
{{ Form::select('field_map.'.$index, $columnOptions[$activeFile->import_type], @$field_map[$index], [ - 'class' => 'mappings livewire-select2', + 'class' => 'mappings', 'placeholder' => trans('general.importer.do_not_import'), 'style' => 'min-width: 100%', 'data-livewire-component' => $this->getId() @@ -349,17 +342,17 @@ var mappings = JSON.parse(mappings_raw) // console.warn("Here is the mappings:") // console.dir(mappings) - // console.warn("Uh, active file id is, I guess: "+$wire.$set('activeFile.id')) + // console.warn("Uh, active file id is, I guess: "+$wire.$get('activeFile.id')) var this_file = $wire.$get('file_id'); // okay, I actually don't know what I'm doing here. $.post({ {{-- I want to do something like: route('api.imports.importFile', $activeFile->id) }} --}} url: "api/v1/imports/process/"+this_file, // maybe? Good a guess as any..FIXME. HARDCODED DUMB FILE contentType: 'application/json', data: JSON.stringify({ - 'import-update': !!$wire.$set('update'), - 'send-welcome': !!$wire.$set('send_welcome'), - 'import-type': $wire.$set('activeFile.import_type'), - 'run-backup': !!$wire.$set('run_backup'), + 'import-update': !!$wire.$get('update'), + 'send-welcome': !!$wire.$get('send_welcome'), + 'import-type': $wire.$get('activeFile.import_type'), + 'run-backup': !!$wire.$get('run_backup'), 'column-mappings': mappings }), headers: {