Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 13 additions & 18 deletions app/Livewire/Conducting/FileUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ public function mount()
$projectId = request()->segment(2);
$this->currentProject = ProjectModel::findOrFail($projectId);
$this->databases = $this->currentProject->databases;


}

public function resetFields()
Expand Down Expand Up @@ -188,7 +186,6 @@ public function save()
$this->dispatch('import-success');
$this->dispatch('refreshPapersCount');
FacadesLog::info('Eventos de importação e atualização de contagem de papers despachados com sucesso.');

} catch (\Exception $e) {
// Lidar com erros no processo de criação de BibUpload ou despachar job/processamento CSV
$errorMessage = $e->getMessage();
Expand All @@ -202,7 +199,6 @@ public function save()

$this->handleException($e);
}

} else {
// Mensagem de erro caso o banco de dados do projeto não seja encontrado
FacadesLog::error('Banco de dados do projeto não encontrado.', ['project_id' => $this->currentProject->id_project]);
Expand All @@ -228,7 +224,7 @@ public function save()
/**
* @throws ParserException
*/
private function extractBibTexReferences($filePath)
private function extractBibTexReferences($filePath)
{
$contents = file_get_contents($filePath);
$parser = new Parser();
Expand Down Expand Up @@ -261,23 +257,23 @@ private function mapCsvFields($csvRow)
{
return [
'type' => $csvRow['Content Type'] ?? '',
'citation-key' => '',
'citation-key' => !empty($csvRow['Citation Key']) ? $csvRow['Citation Key'] : null,
'title' => !empty($csvRow['Item Title']) ? $csvRow['Item Title'] : null,
'author' =>!empty($csvRow['Authors']) ? $csvRow['Authors'] : null,
'author' => !empty($csvRow['Authors']) ? $csvRow['Authors'] : null,
'booktitle' => $csvRow['Book Series Title'] ?? '',
'volume' => $csvRow['Journal Volume'] ?? '',
'pages' => '',
'numpages' => '',
'abstract' => '',
'keywords' => '',
'pages' => $csvRow['Number of Pages'] ?? '',
'numpages' => $csvRow['Number of Pages'] ?? '',
'abstract' => $csvRow['Abstract'] ?? '',
'keywords' => $csvRow['Keywords'] ?? '',
'doi' => !empty($csvRow['Item DOI']) ? $csvRow['Item DOI'] : null,
'journal' => $csvRow['Publication Title'] ?? '',
'issn' => '',
'location' => '',
'isbn' => '',
'address' => '',
'issn' => $csvRow['ISSN'] ?? '',
'location' => $csvRow['Publication Place'] ?? '',
'isbn' => $csvRow['ISBN'] ?? '',
'address' => $csvRow['Address'] ?? '',
'url' => $csvRow['URL'] ?? '',
'publisher' => '',
'publisher' => $csvRow['Publisher'] ?? '',
'year' => $csvRow['Publication Year'] ?? '',
];
}
Expand Down Expand Up @@ -314,7 +310,6 @@ public function deleteFile($id)
//atualizar os demais módulos
$this->dispatch('import-success');
$this->dispatch('refreshPapersCount');

});
} catch (\Exception $e) {
$toastMessage = __($this->toastMessages . '.file_delete_error', ['message' => $e->getMessage()]);
Expand All @@ -336,4 +331,4 @@ public function render()
})->get(),
]);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<!-- O restante do conteúdo do paperModal -->
<div class="row">
<div class="col-4">
@livewire('conducting.study-selection.paper-authors', ['paperId' => $paper['id_paper'], 'projectId' => $this->projectId], key($paper['id_paper']))
<b>{{ __('project/conducting.study-selection.modal.author' )}}:</b>
<p>{{ $paper['author'] }}</p>
</div>
<div class="col-2">
<b>{{ __('project/conducting.study-selection.modal.year' )}}:</b>
Expand Down Expand Up @@ -171,7 +172,7 @@
setTimeout(() => {
$('#paperModal').modal('show');
}, 800); // Delay to ensure the modal is shown after the paper data is set and the modal is ready
});
});

// Show the success modal on success event
Livewire.on('show-success', () => {
Expand Down
Loading