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
6 changes: 3 additions & 3 deletions app/Livewire/Conducting/QualityAssessment/PaperModal.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function showPaperQuality($paper)
{

$this->canEdit = $this->userCanEdit();

// Limpar estado anterior
$this->resetState();

Expand Down Expand Up @@ -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');
}

Expand Down Expand Up @@ -368,4 +368,4 @@ public function render()
'questions' => $this->questions,
]);
}
}
}
2 changes: 1 addition & 1 deletion app/Livewire/Conducting/Snowballing/PaperModal.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,4 @@ public function render()
{
return view('livewire.conducting.snowballing.paper-modal');
}
}
}
6 changes: 4 additions & 2 deletions app/Livewire/Conducting/StudySelection/PaperModal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down Expand Up @@ -296,4 +298,4 @@ public function render()
{
return view('livewire.conducting.study-selection.paper-modal');
}
}
}
10 changes: 9 additions & 1 deletion app/Livewire/Planning/QualityAssessment/QuestionQuality.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
Expand Down Expand Up @@ -223,4 +231,4 @@ public function render()
{
return view('livewire.planning.quality-assessment.question-quality');
}
}
}
20 changes: 14 additions & 6 deletions app/Livewire/Planning/SearchString/SearchTerm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -293,7 +301,7 @@ public function deleteSynonym(string $termId)
if (!$this->checkEditPermission($this->toastMessages . '.denied')) {
return;
}

try {
$currentSynonym = SynonymModel::findOrFail($termId);
$currentSynonym->delete();
Expand Down Expand Up @@ -362,4 +370,4 @@ public function render()
)
)->extends('layouts.app');
}
}
}
5 changes: 4 additions & 1 deletion lang/en/project/planning.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
],
]
Expand Down Expand Up @@ -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.',
],
],

Expand Down Expand Up @@ -875,4 +878,4 @@
'denied' => 'A viewer cannot add, edit or delete data extraction questions.',
]
]
];
];
6 changes: 5 additions & 1 deletion lang/pt_BR/project/planning.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.',

],
]
],
Expand Down Expand Up @@ -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.',
],
],

Expand Down Expand Up @@ -871,4 +875,4 @@
'denied' => 'A viewer cannot add, edit or delete data extraction questions.',
]
]
];
];
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<div>
<div class="modal fade" id="paperModalQuality" tabindex="-1" role="dialog" aria-labelledby="paperModalLabel" aria-hidden="true">
<div class="modal fade" id="paperModalQuality" tabindex="-1" role="dialog" aria-labelledby="paperModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
<div class="modal-content">

Expand All @@ -25,16 +26,17 @@
<p>{{ $paper['database_name'] }}</p>
</div>
<div class="col-2">
<a class="btn py-1 px-3 btn-outline-dark" data-toggle="tooltip" data-original-title="Doi" href="https://doi.org/{{ $paper['doi'] }}" target="_blank">
<a class="btn py-1 px-3 btn-outline-dark" data-toggle="tooltip" data-original-title="Doi"
href="https://doi.org/{{ $paper['doi'] }}" target="_blank">
<i class="fa-solid fa-arrow-up-right-from-square"></i>
DOI
</a>
<a class="btn py-1 px-3 btn-outline-success" data-toggle="tooltip" data-original-title="URL" href="{{ $paper['url'] }}" target="_blank">
<a class="btn py-1 px-3 btn-outline-success" data-toggle="tooltip" data-original-title="URL"
href="{{ $paper['url'] }}" target="_blank">
<i class="fa-solid fa-link"></i>
URL
</a>
<a class="btn py-1 px-3 btn-outline-primary"
data-toggle="tooltip"
<a class="btn py-1 px-3 btn-outline-primary" data-toggle="tooltip"
data-original-title="Buscar no Google Scholar"
href="https://scholar.google.com/scholar?q={{ urlencode($paper['title']) }}"
target="_blank">
Expand All @@ -55,7 +57,8 @@
<span class="card-header pb-0">
<h5>{{ __('project/conducting.quality-assessment.modal.quality-questions' )}}</h5>
<hr class="py-0 m-0 mt-1 mb-3" style="background: #b0b0b0" />
@livewire('conducting.quality-assessment.quality-score', ['paper' => $paper['id_paper'],'projectId' => $this->projectId], key($paper['id_paper']))
@livewire('conducting.quality-assessment.quality-score', ['paper' =>
$paper['id_paper'],'projectId' => $this->projectId], key($paper['id_paper']))
</span>

<ul class='list-group'>
Expand Down Expand Up @@ -87,9 +90,7 @@

<ul class='list-group list-group-flush'>
@foreach ($questions as $question)
<x-search.item
wire:key="{{ $question->description }}"
target="search-papers"
<x-search.item wire:key="{{ $question->description }}" target="search-papers"
class="list-group-item d-flex row w-100">
<div class='w-10 pl-2'>
<span data-search>{{ $question->id }}</span>
Expand All @@ -109,17 +110,19 @@ class="list-group-item d-flex row w-100">
</div>
<div class='w-20 ms-auto'>
<span data-search>
<x-select
disabled="{{ !$canEdit }}"
<x-select disabled="{{ !$canEdit }}"
wire:model="selected_questions_score.{{ $question->id_qa }}"
wire:change="updateScore({{ $question->id_qa }}, $event.target.value)">
@if(!isset($selected_questions_score[$question->id_qa]))
<option selected disabled>{{ __('project/conducting.quality-assessment.modal.select-score') }}</option>
<option selected disabled>
{{ __('project/conducting.quality-assessment.modal.select-score') }}
</option>
@endif

@foreach ($question->qualityScores as $score)
<option value="{{ $score->id_score }}"
@if(isset($selected_questions_score[$question->id_qa]) && $selected_questions_score[$question->id_qa] == $score->id_score)
@if(isset($selected_questions_score[$question->id_qa]) &&
$selected_questions_score[$question->id_qa] == $score->id_score)
selected
@endif>
{{ $score->score_rule }}
Expand All @@ -136,15 +139,9 @@ class="list-group-item d-flex row w-100">

<div class="d-flex flex-column mt-3">
<label>{{ __('project/conducting.quality-assessment.resolve.paper-conflict-note') }}</label>
<textarea
id="note"
class="form-control"
rows="2"
wire:model="note"
wire:blur="saveNote"
<textarea id="note" class="form-control" rows="2" wire:model="note" wire:blur="saveNote"
placeholder="{{ __('project/conducting.quality-assessment.resolve.paper-conflict-writer') }}"
@if(!$canEdit) disabled @endif
required>
@if(!$canEdit) disabled @endif required>
</textarea>
</div>

Expand All @@ -156,24 +153,32 @@ class="form-control"
<p>{{ __('project/conducting.quality-assessment.modal.option.select' )}}</p>

<div class="btn-group mt-2" role="group">
<input type="radio" class="btn-check" wire:model="selected_status" wire:change="updateStatusManual" value="Unclassified" name="btnradio" id="btnradio2" autocomplete="off" @if(!$canEdit) disabled @endif>
<label class="btn btn-outline-primary" for="btnradio2">{{ __('project/conducting.study-selection.modal.option.unclassified' )}}</label>

<input type="radio" class="btn-check" wire:model="selected_status" wire:change="updateStatusManual" value="Removed" name="btnradio" id="btnradio1" autocomplete="off" @if(!$canEdit) disabled @endif>
<label class="btn btn-outline-primary" for="btnradio1">{{ __('project/conducting.study-selection.modal.option.remove' )}}</label>
<input type="radio" class="btn-check" wire:model="selected_status"
wire:change="updateStatusManual" value="Unclassified" name="btnradio" id="btnradio2"
autocomplete="off" @if(!$canEdit) disabled @endif>
<label class="btn btn-outline-primary"
for="btnradio2">{{ __('project/conducting.study-selection.modal.option.unclassified' )}}</label>

<input type="radio" class="btn-check" wire:model="selected_status"
wire:change="updateStatusManual" value="Removed" name="btnradio" id="btnradio1"
autocomplete="off" @if(!$canEdit) disabled @endif>
<label class="btn btn-outline-primary"
for="btnradio1">{{ __('project/conducting.study-selection.modal.option.remove' )}}</label>

</div>
@endif

@endif
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ __('project/conducting.quality-assessment.modal.close' )}}</button>
<button type="button" class="btn btn-secondary"
data-bs-dismiss="modal">{{ __('project/conducting.quality-assessment.modal.close' )}}</button>
</div>
</div>
</div>
</div>
<div wire:ignore.self class="modal fade" id="successModalQuality" tabindex="-1" role="dialog" aria-labelledby="successModalLabel" aria-hidden="true">
<div wire:ignore.self class="modal fade" id="successModalQuality" tabindex="-1" role="dialog"
aria-labelledby="successModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
Expand All @@ -192,27 +197,46 @@ class="form-control"
</div>
@script
<script>
$(document).ready(function() {
// Mostrar o modal do paper
Livewire.on('show-paper-quality', () => {
$('#paperModalQuality').modal('show');
});

// Mostrar o modal de sucesso
Livewire.on('show-success-quality', () => {
$('#paperModalQuality').modal('hide');
$('#successModalQuality').modal('show');
});

// Reabrir o modal do paper após o modal de sucesso ser fechado
$('#successModalQuality').on('hidden.bs.modal', function() {
$('#paperModalQuality').modal('show');
});
$(document).ready(function() {
// Mostrar o modal do paper
$wire.on('show-paper-quality', () => {
$('#paperModalQuality').modal('show');
});

// Mostrar toast de sucesso ao invés de um modal
Livewire.on('show-success-quality', (message) => {
console.log('show-success-quality', message);
$('#paperModalQuality').modal('hide');

if (message) {
toasty({
message: message,
type: 'success'
});
}
});

// Recarga do modal de paper
Livewire.on('reload-paper-quality', () => {
Livewire.emit('showPaperQuality', @json($paper));
// Reabrir o modal do paper após o modal de sucesso (caso continue usando)
$('#successModalQuality').on('hidden.bs.modal', function() {
$('#paperModalQuality').modal('show');
});
});

// Recarga do modal de paper com dados atualizados
Livewire.on('reload-paper-quality', () => {
Livewire.emit('showPaperQuality', @json($paper));
});

// Exibir toast customizado vindo do backend
$wire.on('paper-quality-toast', ([{
message,
type
}]) => {
toasty({
message,
type
});
});
</script>

@endscript
Loading
Loading