diff --git a/app/Livewire/Conducting/QualityAssessment/PaperModal.php b/app/Livewire/Conducting/QualityAssessment/PaperModal.php index 300666e24..e67951c92 100644 --- a/app/Livewire/Conducting/QualityAssessment/PaperModal.php +++ b/app/Livewire/Conducting/QualityAssessment/PaperModal.php @@ -61,7 +61,7 @@ public function showPaperQuality($paper) { $this->canEdit = $this->userCanEdit(); - + // Limpar estado anterior $this->resetState(); @@ -222,7 +222,7 @@ public function updateScore($questionId, $scoreId) // Se desejar, você pode adicionar uma mensagem de sucesso ou atualizar algum estado $this->dispatch('reload-paper-modal'); - $this->dispatch('show-success-quality'); + $this->dispatch('show-success-quality', 'Score atualizado com sucesso.'); $this->dispatch('show-success-quality-score'); } @@ -368,4 +368,4 @@ public function render() 'questions' => $this->questions, ]); } -} +} \ No newline at end of file diff --git a/app/Livewire/Conducting/Snowballing/PaperModal.php b/app/Livewire/Conducting/Snowballing/PaperModal.php index 0daa37634..99ae77308 100644 --- a/app/Livewire/Conducting/Snowballing/PaperModal.php +++ b/app/Livewire/Conducting/Snowballing/PaperModal.php @@ -193,4 +193,4 @@ public function render() { return view('livewire.conducting.snowballing.paper-modal'); } -} +} \ No newline at end of file diff --git a/app/Livewire/Conducting/StudySelection/PaperModal.php b/app/Livewire/Conducting/StudySelection/PaperModal.php index e535f7f37..9545ecc25 100644 --- a/app/Livewire/Conducting/StudySelection/PaperModal.php +++ b/app/Livewire/Conducting/StudySelection/PaperModal.php @@ -181,7 +181,9 @@ public function changePreSelected($criteriaId, $type) session()->flash('successMessage', "Criteria updated successfully. New status: " . $this->getPaperStatusDescription($this->paper['status_selection'])); // Atualiza a view para mostrar o alert - $this->dispatch('show-success'); + $message = 'Nota salva com sucesso.'; + session()->flash('successMessage', $message); + $this->dispatch('show-success',$message); $this->dispatch('refreshPaperStatus'); } @@ -296,4 +298,4 @@ public function render() { return view('livewire.conducting.study-selection.paper-modal'); } -} +} \ No newline at end of file diff --git a/app/Livewire/Planning/QualityAssessment/QuestionQuality.php b/app/Livewire/Planning/QualityAssessment/QuestionQuality.php index 58e656691..fb2619a76 100644 --- a/app/Livewire/Planning/QualityAssessment/QuestionQuality.php +++ b/app/Livewire/Planning/QualityAssessment/QuestionQuality.php @@ -181,6 +181,14 @@ public function submit() return; } + if ($this->weight <= 0) { + $this->toast( + message: __('project/planning.quality-assessment.question-quality.livewire.toasts.min_weight'), + type: 'error' + ); + return; + } + $updateIf = [ 'id_qa' => $this->currentQuestion?->id_qa, ]; @@ -223,4 +231,4 @@ public function render() { return view('livewire.planning.quality-assessment.question-quality'); } -} +} \ No newline at end of file diff --git a/app/Livewire/Planning/SearchString/SearchTerm.php b/app/Livewire/Planning/SearchString/SearchTerm.php index cb51dd8ff..20f94e2c3 100644 --- a/app/Livewire/Planning/SearchString/SearchTerm.php +++ b/app/Livewire/Planning/SearchString/SearchTerm.php @@ -224,12 +224,20 @@ public function addSynonyms() { $this->validateOnly('synonym'); - if (!$this->termId['value'] || !$this->synonym) { - $this->addError('termId', 'The term id is required'); + if (empty($this->termId['value'])) { + $this->toast( + message: __('project/planning.search-string.term.livewire.toasts.validation'), + type: 'error' + ); + return; } - if (empty(trim($this->synonym))) { - $this->addError('synonym', 'The synonym is required'); + if (empty($this->synonym)) { + $this->toast( + message: __('project/planning.search-string.term.livewire.toasts.synonym'), + type: 'error' + ); + return; } $updateIf = [ @@ -293,7 +301,7 @@ public function deleteSynonym(string $termId) if (!$this->checkEditPermission($this->toastMessages . '.denied')) { return; } - + try { $currentSynonym = SynonymModel::findOrFail($termId); $currentSynonym->delete(); @@ -362,4 +370,4 @@ public function render() ) )->extends('layouts.app'); } -} +} \ No newline at end of file diff --git a/lang/en/project/planning.php b/lang/en/project/planning.php index b0cc0847d..acef5d10f 100644 --- a/lang/en/project/planning.php +++ b/lang/en/project/planning.php @@ -437,6 +437,8 @@ 'added' => 'Search Term added successfully.', 'updated' => 'Search Term updated successfully.', 'deleted' => 'Search Term deleted successfully.', + 'validation' => 'The search term field is required.', + 'synonym' => 'The synonym field is required.', 'denied' => 'A viewer cannot add, edit or delete search terms.', ], ] @@ -685,6 +687,7 @@ 'added' => 'Question Quality added successfully.', 'updated' => 'Question Quality updated successfully.', 'deleted' => 'Question Quality deleted successfully.', + 'min_weight' => 'The weight must be greater than 0.', ], ], @@ -875,4 +878,4 @@ 'denied' => 'A viewer cannot add, edit or delete data extraction questions.', ] ] -]; +]; \ No newline at end of file diff --git a/lang/pt_BR/project/planning.php b/lang/pt_BR/project/planning.php index e4d709ef2..a2f21bf50 100644 --- a/lang/pt_BR/project/planning.php +++ b/lang/pt_BR/project/planning.php @@ -435,7 +435,10 @@ 'added' => 'Termo de Busca adicionado com sucesso.', 'updated' => 'Termo de Busca atualizado com sucesso.', 'deleted' => 'Termo de Busca deletado com sucesso.', + 'validation' => 'O termo de busca é inválido. Por favor, insira um termo de busca válido.', 'denied' => 'Um visualizador não pode adicionar, editar ou excluir termos de busca.', + 'synonym' => 'O sinônimo é inválido. Por favor, insira um sinônimo válido.', + ], ] ], @@ -681,6 +684,7 @@ 'added' => 'Questão de Qualidade adicionada com sucesso.', 'updated' => 'Questão de Qualidade atualizada com sucesso.', 'deleted' => 'Questão de Qualidade deletada com sucesso.', + 'min_weight' => 'O peso mínimo deve ser maior que 0.', ], ], @@ -871,4 +875,4 @@ 'denied' => 'A viewer cannot add, edit or delete data extraction questions.', ] ] -]; +]; \ No newline at end of file diff --git a/resources/views/livewire/conducting/quality-assessment/paper-modal.blade.php b/resources/views/livewire/conducting/quality-assessment/paper-modal.blade.php index 1f6cf6850..36d91dc55 100644 --- a/resources/views/livewire/conducting/quality-assessment/paper-modal.blade.php +++ b/resources/views/livewire/conducting/quality-assessment/paper-modal.blade.php @@ -1,5 +1,6 @@