Cleaned up the last of the FIXME's (or downgraded them to TODO's)

This commit is contained in:
Brady Wetherington 2023-02-28 22:34:44 -08:00
parent 5cf66851f7
commit 54cb38603b
5 changed files with 15 additions and 17 deletions

View file

@ -62,7 +62,7 @@ class Importer extends Component
{
\Log::debug("Alert object received: ".print_r($obj,true));
$this->message = $obj;
$this->message_type = "danger"; // FIXME - when does this get reset? Only when you click the 'x'?
$this->message_type = "danger";
}
public function toggleEvent($id)
@ -80,12 +80,16 @@ class Importer extends Component
foreach($this->files as $file) {
\Log::debug("File id is: ".$file->id);
if($id == $file->id) {
// FIXME - should I do a try/catch on this and use the file_delete_failure or whatever, if needed?
Storage::delete('imports/'.$file->file_path); // FIXME - last time I ran this, it *didn't* delete the file?!
$file->delete();
if(Storage::delete('private_uploads/imports/'.$file->file_path)) {
$file->delete();
$this->message = trans('admin/hardware/message.import.file_delete_success');
$this->message_type = 'success';
$this->message = trans('admin/hardware/message.import.file_delete_success');
$this->message_type = 'success';
return;
} else {
$this->message = trans('admin/hardware/message.import.file_delete_error');
$this->message_type = 'danger';
}
}
}
}

View file

@ -106,7 +106,7 @@ class ImporterFile extends Component
{
$customFields = [];
foreach($this->customFields AS $field) {
$customFields[$field->id] = $field->name;
$customFields[$field->db_column_name()] = $field->name;
}
switch($type) {
@ -128,7 +128,7 @@ class ImporterFile extends Component
default:
$results = self::$general;
}
asort($results); // FIXME - this isn't sorting right yet.
asort($results, SORT_FLAG_CASE|SORT_STRING);
return $results;
}

View file

@ -238,7 +238,7 @@ class CustomField extends Model
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v3.0]
* @return \Illuminate\Database\Eloquent\Relations\Relation
* @return string
*/
public function db_column_name()
{

View file

@ -24,7 +24,7 @@
<div class="box">
<div class="box-body">
<div class="alert alert-warning">
<strong>Warning</strong> Some Errors occurred while importing {{-- FIXME: hardcoded string --}}
<strong>Warning</strong> Some Errors occurred while importing {{-- TODO: hardcoded string --}}
</div>
<div class="errors-table">
@ -153,7 +153,7 @@
},
progress: function(e, data) {
@this.progress = parseInt((data.loaded / data.total * 100, 10));
@this.progress_message = @this.progress+'% Complete'; // FIXME - this should come from server (so it can be internationalized)
@this.progress_message = @this.progress+'% Complete'; // TODO - this should come from server (so it can be internationalized)
},
fail: function(e, data) {
@this.progress_bar_class = "progress-bar-danger";

View file

@ -223,12 +223,6 @@ Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'authorize:superuser
|
*/
//Route::group(['prefix' => 'import', 'middleware' => ['auth']], function () {
// Route::get('/',
// [ImportsController::class, 'index']
// )->name('imports.index');
//});
Route::get('/import',
\App\Http\Livewire\Importer::class
)->middleware('auth')->name('imports.index');