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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ yarn-error.log
/.vscode
/.docker
.DS_Store
config/app.php
63 changes: 63 additions & 0 deletions app/Livewire/Planning/Criteria/Criteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
use Illuminate\Validation\Rule;
use Livewire\Component;
use App\Models\Project as ProjectModel;
use App\Models\Project\Conducting\StudySelection\PapersSelection as PapersSelectionModel;
use App\Models\Member as MemberModel;
use App\Models\EvaluationCriteria as EvaluationCriteriaModel;
use App\Models\Criteria as CriteriaModel;
use App\Utils\ActivityLogHelper as Log;
use App\Utils\ToastHelper;
Expand Down Expand Up @@ -189,15 +192,66 @@ public function selectRule($rule, $type)
'rule' => $rule,
])->count();

// Check if there are any criteria of the same type
$projectCriterias = CriteriaModel::where([
'id_project' => $this->currentProject->id_project,
'type' => $type,
])->count();

// If there are no criteria of the same type, show a error toast message
if ($projectCriterias === 0){
$this->toast(
message: __('project/planning.criteria.livewire.toasts.no_criteria'),
type: 'error'
);
return;
}

if ($selectedCount === 0) {
CriteriaModel::where($where)
->first()->update(['pre_selected' => 1]);
}
break;
}

$this->resetPaperEvaluations();
$this->updateCriterias();
}

private function resetPaperEvaluations()
{

// Get all members related to the current project
$members = MemberModel::where('id_project', $this->currentProject->id_project)
->pluck('id_members'); // Retrieve all member IDs for the project

// Get all evaluation records related to the members of the current project
$papersSelection = PapersSelectionModel::whereIn('id_member', $members)
->where('id_status', '!=', 3) // Exclude already "not evaluated" papers
->get();

// Delete inclusion and exclusion criteria selected in the evaluation_criteria table
EvaluationCriteriaModel::whereIn('id_member', $members)
->whereIn('id_paper', $papersSelection->pluck('id_paper')) // Filter by affected papers
->delete();

// Check if there are evaluation records made by members,
// if none exist, there is nothing to do
if ($papersSelection->count() === 0) {
return;
}

// Update the selection status to "not evaluated"
foreach ($papersSelection as $paperSelection) {
$paperSelection->update(['id_status' => 3]);
}

$this->toast(
message: __('project/planning.criteria.livewire.toasts.reset_paper_evaluations'),
type: 'success'
);
}

/**
* Update the items.
*/
Expand Down Expand Up @@ -306,10 +360,15 @@ public function submit()
);

$this->selectRule($updatedOrCreated->rule, $this->type['value']);

$this->toast(
message: $toastMessage,
type: 'success'
);

// Reset the evaluations case already existed any evaluation made before the creation or editing of any criteria
$this->resetPaperEvaluations();

} catch (\Exception $e) {
$this->toast(
message: $e->getMessage(),
Expand Down Expand Up @@ -360,6 +419,10 @@ public function delete(string $criteriaId)
message: $this->translate('deleted'),
type: 'success'
);

// Reset the evaluations case already existed any evaluation made before the delete of any criteria
$this->resetPaperEvaluations();

$this->updateCriterias();
} catch (\Exception $e) {
$this->toast(
Expand Down
10 changes: 6 additions & 4 deletions lang/en/project/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
return [

'create_project' => 'Create Project',

'title' => 'Title',
'enter_title' => 'Enter the title',

'description' => 'Description',
'enter_description' => 'Enter the description',

'objectives' => 'Objectives',
'enter_objectives' => 'Enter the objectives',

'copy_planning' => 'Copy Planning',
'none' => 'None',
'option1' => 'Option 1',
Expand All @@ -22,5 +22,7 @@
'option5' => 'Option 5',
'noProjects' => 'User does not have any created projects yet',

'systematic-review' => 'Systematic Review',

'create' => 'Create'
];
14 changes: 13 additions & 1 deletion lang/en/project/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@

<p>This feature simplifies the creation, organization, and editing of project-related documents by integrating system information in a practical and efficient way.</p>
',
'content-options'=> [
'planning' => 'Planning',
'import-studies' => 'Import Studies',
'study-selection'=> 'Study Selection',
'quality-assessment' => 'Quality Assessment',
'snowballing' => 'Snowballing',
],
'enter_description' => 'Select options to generate the latex content...',
],
'bibtex' => [
Expand Down Expand Up @@ -62,7 +69,12 @@
<li>Ensure that your project information is complete to guarantee the correct export of references.</li>
</ul>
</div>',
'enter_description' => 'Select options to generate the references...',
'content-options'=> [
'study-selection' => 'Study Selection',
'quality-assessment' => 'Quality Assessment',
'snowballing' => 'Snowballing',
],
'enter_description' => 'Select options to generate the references...',
],
],
'button' => [
Expand Down
10 changes: 10 additions & 0 deletions lang/en/project/planning.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@
'form' => [
'description' => 'Generic search string',
'enter-description' => 'Enter search string description',
'no-database'=> 'No database found for this project.',
'add' => 'Add Search String',
'update' => 'Update Search String',
'placeholder' => 'Enter the search string',
Expand Down Expand Up @@ -534,6 +535,8 @@
'deleted' => 'Criteria deleted',
],
'toasts' => [
'reset_paper_evaluations' => 'All paper evaluations have been reset to "Not Evaluated".',
'no_criteria'=> 'No criteria found.',
'added' => 'Criteria added successfully',
'deleted' => 'Criteria deleted successfully',
'updated' => 'Criteria updated successfully',
Expand Down Expand Up @@ -833,6 +836,9 @@

',
],
'type-selection'=> [
'title' => 'Select a Type',
],
'id' => 'ID',
'dont-use' => 'Do not use special characters',
'description' => 'Description',
Expand All @@ -856,6 +862,10 @@
</ul>
',
],
'question-selection'=> [
'title' => 'Select a Question',

],
'question' => 'Question',
'option' => 'Option',
'add-option' => 'Add Option',
Expand Down
97 changes: 97 additions & 0 deletions lang/en/project/reporting.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,97 @@
'snowballing' => 'Snowballing',
],

'overview'=> [
'systematic-mapping-study' => [
'title' => 'Systematic Mapping Study on Domain-Specific Language Development Tools Funnel',
'database' => [
'title' => 'Database',
'content'=>'Search in Digital Libraries',
],
'imported-studies' => 'Imported Studies',
'duplicates' => [
'title'=> 'Duplicates',
'content'=>'Duplicates Removal',
],
'studies' => 'Studies',
'study-selection' => [
'title'=> 'Study Selection',
'content'=>'I/E Removed',
],
'studies-I/E-included'=> 'Studies I/E Included',
'quality-assessment' => [
'title' => 'Quality Assessment',
'content'=> 'QA rejected',
],
'studies-accepted' => [
'title' => '#Avaiable Data Extraction',
'content'=>'Studies accepted',
],
'not-duplicate' => 'Not Duplicates',
'status-selection' => 'Status Selection',
'status-quality'=> 'Status Quality',
'status-extration' => 'Status Extraction',
],
'stages-systematic-review'=>'Stages of Systematic Literature Review or Systematic Mapping Study',
'project-activities-overtime'=> 'Project Activities Over Time',
'total-activities'=> 'Atividades Totais',
'project'=> 'Project',
],
'imported-studies'=> [
'papers-database'=> [
'title'=> 'Papers by Database',
'content'=> 'Papers',
],
'number-papers-year' => [
'title'=> 'Number of Papers by Year',
'year'=> 'Year',
'number-of-papers'=> 'Number of Papers',
],
],

'study-selection'=> [
'papers-per-selection' => [
'title'=> 'Papers per Status Selection',
'content'=> 'Papers',
],
'criteria-marked-user'=> [
'title'=> 'Criteria Marked by User',
'criteria-identified-study-selection' => 'Criteria Identified in Study Selection',
'number-times' => 'Number of Times',
'criteria' => 'Criteria',
'user' => 'User',
'value' => 'Value',
],
'number-papers-user-status-selection' => [
'title'=> 'Number of Papers by User and Status Selection',
'users' => 'Users',
'number-papers' => 'Number of Papers',
],
],
'quality-assessment'=> [
'papers-status-quality'=> [
'title'=> 'Papers per Status Quality',
'content'=> 'Papers',
],
'papers-general-score'=> [
'title'=> 'Papers per General Score',
'content'=> 'Papers',
],
'number-papers-user-status-quality'=> [
'title' => 'Number of Papers per User and Status Quality',
'users'=> 'User',
'number-papers' => 'Number of Papers',
]
],

'data-extraction'=> [
'data-extraction-wordcloud'=> 'Data Extraction Wordcloud',
'data-extraction-answer-packed-bubble'=> 'Data Extraction Answers - Packed Bubble',
'comparasion-answers-question'=> [
'title'=> 'Comparison of Answers per Question',
'content'=> 'Answers',
]
],
'reliability' =>[
'selection' =>[
'title' => 'Reliability Study Selection (Peer Review)',
Expand All @@ -25,12 +116,18 @@
'agreement'=>[
'title' => 'Simple Agreement',
'content'=>'',
'title-modal' => 'Simple Agreement Analysis',
'agreement-percentual'=> 'Agreement Percentual (%)',
],
'kappa'=>[
'title' => 'Method Kappa (Peer Review)',
'content'=>'',
'title-modal' => 'Kappa Analysis',
'kappa-value' => 'Kappa Value',
],
'pesquisador'=>'Researcher',
'peer-review'=>'Peer Review',
'study-selection'=> 'Study Selection',
'quality-assessment'=> 'Quality Assessment',
]
];
9 changes: 5 additions & 4 deletions lang/pt_BR/project/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
return [

'create_project' => 'Criar Projeto',

'title' => 'Titulo',
'enter_title' => 'Digite o titulo',

'description' => 'Descrição',
'enter_description' => 'Digite a descrição',

'objectives' => 'Objetivos',
'enter_objectives' => 'Digite os objetivos',

'copy_planning' => 'Copiar Planejamento',
'none' => 'Nenhum',
'option1' => 'Opção 1',
Expand All @@ -22,5 +22,6 @@
'option5' => 'Opção 5',
'noProjects' => 'Usuário ainda não possui projetos criados',

'systematic-review'=> 'Revisão Sistemática',
'create' => 'Criar'
];
13 changes: 13 additions & 0 deletions lang/pt_BR/project/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@

<p>Este recurso facilita a criação, organização e edição de documentos relacionados ao projeto, integrando as informações do sistema de maneira prática e eficiente.</p>
',
'content-options'=> [
'planning' => 'Planejamento',
'import-studies' => 'Importar Estudos',
'study-selection'=> 'Seleção de Estudos',
'quality-assessment' => 'Avaliação de Qualidade',
'snowballing' => 'Snowballing',
],
'enter_description' => 'Selecione as opções para gerar o conteúdo latex...',
],
'bibtex' => [
'title' => 'Referências BibTex',
Expand Down Expand Up @@ -61,6 +69,11 @@
<li>Certifique-se de que as informações do seu projeto estejam completas para garantir a exportação correta das referências.</li>
</ul>
</div>',
'content-options'=> [
'study-selection' => 'Seleção de Estudos',
'quality-assessment' => 'Avaliação de Qualidade',
'snowballing' => 'Snowballing',
],
'enter_description' => 'Selecione as opções para gerar as referências...',
],
],
Expand Down
Loading
Loading