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 app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ protected function validator(array $data)
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
'password_confirmation' => ['same:password'],
]);
}

Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/Planning/Criteria/Criteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected function rules()
return [
'currentProject' => 'required',
'criteriaId' => 'required|string|max:20|regex:/^[a-zA-Z0-9]+$/',
'description' => 'required|string|regex:/^[\pL\pN\s\?\/:#\\\\]+$/u|max:255',
'description' => 'required|string|regex:/^[\pL\pN\s\.,;:\?"\'\(\)\[\]\{\}\/\\\\_\-+=#@!%&*]+$/u|max:255',
'type' => 'required|array',
'type.*.value' => 'string'
];
Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/Planning/DataExtraction/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Option extends Component

// Regras de validação para os campos do formulário.
protected $rules = [
'description' => 'required|string|regex:/^[\pL\pN\s\?\/:#\\\\-]+$/u|max:255',
'description' => 'required|string|regex:/^[\pL\pN\s\.,;:\?"\'\(\)\[\]\{\}\/\\\\_\-+=#@!%&*]+$/u|max:255',
'questionId' => 'required|array',
'questionId.*.value' => 'exists:question_extraction,id',
];
Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/Planning/DataExtraction/Question.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Question extends Component
// Regra de validação para os campos do formulário.
protected $rules = [
'questionId' => ['required', 'max:255', 'regex:/^(?!\s*$)[a-zA-Z0-9\s]+$/'],
'description' => 'required|string|regex:/^[\pL\pN\s\?\/:#\\\\-]+$/u|max:255',
'description' => 'required|string|regex:/^[\pL\pN\s\.,;:\?"\'\(\)\[\]\{\}\/\\\\_\-+=#@!%&*]+$/u|max:255',
'type' => 'required|array',
];

Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/Planning/Overall/Domains.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Domains extends Component
*/
protected $rules = [
'currentProject' => 'required',
'description' => 'required|string|max:255',
'description' => 'required|string|regex:/^[\pL\pN\s\.,;:\?"\'\(\)\[\]\{\}\/\\\\_\-+=#@!%&*]+$/u|max:255',
];

/**
Expand Down
48 changes: 24 additions & 24 deletions app/Livewire/Planning/Overall/Keywords.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
/**
* Componente Livewire responsável pelo gerenciamento das palavras-chave
* de um projeto de revisão sistemática da literatura.
*
*
* As palavras-chave são termos ou frases que representam conceitos-chave
* na pesquisa e são fundamentais para:
* - Categorizar e organizar as fontes de literatura
* - Facilitar a identificação de informações relevantes
* - Auxiliar na construção de strings de busca
* - Definir o escopo temático da revisão sistemática
*
*
* Este componente faz parte da fase de planejamento geral da revisão sistemática,
* onde os pesquisadores definem os termos principais que guiarão suas buscas
* nas bases de dados acadêmicas.
*
*
* Funcionalidades:
* - Adicionar novas palavras-chave ao projeto
* - Editar palavras-chave existentes
Expand All @@ -39,64 +39,64 @@ class Keywords extends Component
/**
* Caminho base para as traduções específicas deste componente.
* Utilizado para internacionalização (PT/BR e EN).
*
*
* @var string
*/
private $translationPath = 'project/planning.overall.keyword.livewire';

/**
* Caminho para as mensagens de toast específicas deste componente.
* Utilizado para feedback visual ao usuário após operações CRUD.
*
*
* @var string
*/
private $toastMessages = 'project/planning.overall.keyword.livewire.toasts';

/**
* Instância do projeto atual sendo editado.
* Contém todos os dados do projeto de revisão sistemática.
*
*
* @var ProjectModel
*/
public $currentProject;

/**
* Palavra-chave atualmente sendo editada.
* Null quando não há edição em andamento (modo criação).
*
*
* @var KeywordModel|null
*/
public $currentKeyword;

/**
* Coleção de todas as palavras-chave associadas ao projeto atual.
* Atualizada dinamicamente conforme operações CRUD são realizadas.
*
*
* @var \Illuminate\Database\Eloquent\Collection
*/
public $keywords = [];

/**
* Fields to be filled by the form.
*/

/**
* Descrição da palavra-chave.
* Campo principal que define o termo ou frase da palavra-chave.
* Utilizado tanto para criação quanto para edição.
*
*
* @var string|null
*/
public $description;

/**
* Form state.
*/

/**
* Estado do formulário para controle de operações.
* Controla se o formulário está em modo de edição ou criação.
*
*
* @var array
*/
public $form = [
Expand All @@ -108,7 +108,7 @@ class Keywords extends Component
*/
protected $rules = [
'currentProject' => 'required',
'description' => 'required|string|max:255',
'description' => 'required|string|regex:/^[\pL\pN\s\.,;:\?"\'\(\)\[\]\{\}\/\\\\_\-+=#@!%&*]+$/u|max:255',
];

/**
Expand All @@ -130,13 +130,13 @@ public function mount()
// Obtém o ID do projeto a partir da URL (segundo segmento)
// Ex: /projects/123/planning/overall -> projectId = 123
$projectId = request()->segment(2);

// Carrega o projeto atual ou falha se não encontrado
$this->currentProject = ProjectModel::findOrFail($projectId);

// Inicializa a palavra-chave atual como null (modo criação)
$this->currentKeyword = null;

// Carrega todas as palavras-chave associadas ao projeto
$this->keywords = KeywordModel::where(
'id_project',
Expand All @@ -159,10 +159,10 @@ public function resetFields()
{
// Limpa o campo de descrição
$this->description = '';

// Remove a referência à palavra-chave atual
$this->currentKeyword = null;

// Retorna o formulário ao modo de criação
$this->form['isEditing'] = false;
}
Expand Down Expand Up @@ -200,7 +200,7 @@ public function submit()
$updateIf = [
'id_keyword' => $this->currentKeyword?->id_keyword,
];

// Verifica se já existe uma palavra-chave com a mesma descrição no projeto
// Importante para evitar duplicatas que podem confundir a estratégia de busca
$existingKeyword = KeywordModel::where('description', $this->description)
Expand Down Expand Up @@ -300,7 +300,7 @@ public function delete(string $keywordId)

// Localiza a palavra-chave a ser excluída
$currentKeyword = KeywordModel::findOrFail($keywordId);

// Remove a palavra-chave do banco de dados
$currentKeyword->delete();

Expand All @@ -313,7 +313,7 @@ public function delete(string $keywordId)

// Atualiza a lista de palavras-chave na interface
$this->updateKeywords();

// Limpa os campos do formulário
$this->resetFields();
$this->toast(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class QuestionQuality extends Component
protected $rules = [
'currentProject' => 'required',
'questionId' => 'required|string|max:10|regex:/^[a-zA-Z0-9]+$/',
'description' => 'required|string|regex:/^[\pL\pN\s\?\/:#\\\\-]+$/u|max:255',
'description' => 'required|string|regex:/^[\pL\pN\s\.,;:\?"\'\(\)\[\]\{\}\/\\\\_\-+=#@!%&*]+$/u|max:255',
'weight' => 'required|regex:/^\d+(\.\d{1,2})?$/',
];

Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/Planning/Questions/ResearchQuestions.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class ResearchQuestions extends Component
protected $rules = [
'currentProject' => 'required',
'questionId' => 'required|string|max:20|regex:/^[a-zA-Z0-9]+$/',
'description' => 'required|string|regex:/^[\pL\pN\s\?\/:#\\\\-]+$/u|max:255',
'description' => 'required|string|regex:/^[\pL\pN\s\.,;:\?"\'\(\)\[\]\{\}\/\\\\_\-+=#@!%&*]+$/u|max:255',
];

/**
Expand Down
6 changes: 3 additions & 3 deletions app/Livewire/Planning/SearchString/SearchString.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function rules()
{
return [
'currentProject' => 'required',
'description' => 'required|string|max:255',
'description' => 'required|string|regex:/^[\pL\pN\s\.,;:\?"\'\(\)\[\]\{\}\/\\\\_\-+=#@!%&*]+$/u|max:255',
];
}

Expand Down Expand Up @@ -154,7 +154,7 @@ public function edit(string $searchStringId)
if (!$this->checkEditPermission($this->toastMessages . '.denied')) {
return;
}

$this->currentSearchString = SearchStringModel::findOrFail($searchStringId);
$this->description = $this->currentSearchString->description;
}
Expand Down Expand Up @@ -289,4 +289,4 @@ public function render()
return view('livewire.planning.search-string.search-string')
->with(compact('project'));
}
}
}
4 changes: 2 additions & 2 deletions app/Livewire/Planning/SearchString/SearchTerm.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class SearchTerm extends Component
*/
protected $rules = [
'currentProject' => 'required',
'description' => 'required|string|regex:/^[\pL\pN\s\?\/:#\\\\-]+$/u|max:255',
'synonym' => 'nullable|string|regex:/^[\pL\s]+$/u|max:255',
'description' => 'required|string|regex:/^[\pL\pN\s\.,;:\?"\'\(\)\[\]\{\}\/\\\\_\-+=#@!%&*]+$/u|max:255',
'synonym' => 'nullable|string|regex:/^[\pL\pN\s\.,;:\?"\'\(\)\[\]\{\}\/\\\\_\-+=#@!%&*]+$/u|max:255',
];

/**
Expand Down
3 changes: 2 additions & 1 deletion lang/en/auth/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
'sign_up' => 'Sign up',
'already_have_account' => 'Already have an account?',
'sign_in' => 'Sign in',
'username' => 'Username',
'username' => 'Username (firstname.lastname)',
'firstname' => 'Firstname',
'lastname' => 'Lastname',
'institution' => 'Institution',
'email' => 'Email',
'password' => 'Password',
'confirm_password' => 'Confirm Password',
'terms_error' => 'You must agree to the Terms and Conditions.',
];
3 changes: 2 additions & 1 deletion lang/pt_BR/auth/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
'sign_up' => 'Cadastrar',
'already_have_account' => 'Já tem uma conta?',
'sign_in' => 'Entrar',
'username' => 'Nome de usuário',
'username' => 'Nome de usuário (nome.sobrenome)',
'firstname' => 'Nome',
'lastname' => 'Sobrenome',
'institution' => 'Instituição',
'email' => 'E-mail',
'password' => 'Senha',
'confirm_password' => 'Confirme a Senha',
'terms_error' => 'Você deve concordar com os Termos e Condições.'
];
22 changes: 19 additions & 3 deletions resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<div class="flex flex-col mb-3 col-xl-6 col-lg-5 col-md-6 mx-auto">
<input type="text" name="username" class="form-control"
placeholder="{{ __('auth/register.username') }}"
aria-label="{{ __('auth.register.username') }}" value="{{ old('username') }}">
aria-label="{{ __('auth/register.username') }}" value="{{ old('username') }}">
@error('username')
<p class='text-danger text-xs pt-1'> {{ $message }} </p>
@enderror
Expand All @@ -103,8 +103,7 @@
<input type="password" name="password" id="password" class="form-control"
placeholder="{{ __('auth/register.password') }}"

aria-label="{{ __('auth.register.password') }} "value="{{ old('password') }}">
<small id="passwordStrength" class="text-muted">Digite uma senha segura</small>
aria-label="{{ __('auth/register.password') }}" value="{{ old('password') }}">
<span role="button" id="togglePassword"
class="position-absolute top-50 end-0 translate-middle-y me-3"
style="cursor: pointer; background: white; display: none;"
Expand All @@ -116,6 +115,23 @@ class="position-absolute top-50 end-0 translate-middle-y me-3"
<p class='text-danger text-xs pt-1'>{{ $message }}</p>
@enderror
</div>
<div class="flex flex-col mb-3 col-xl-6 col-lg-5 col-md-6 mx-auto position-relative">
<input type="password" name="password_confirmation" id="password_confirmation" class="form-control"
placeholder="{{ __('auth/register.confirm_password') }}"

aria-label="{{ __('auth/register.confirm_password') }}">
<span role="button" id="togglePassword"
class="position-absolute top-50 end-0 translate-middle-y me-3"
style="cursor: pointer; background: white; display: none;"
tabindex="-1">
<i class="fas fa-eye" id="eyeIcon"></i>
</span>

@error('password_confirmation')
<p class='text-danger text-xs pt-1'>{{ $message }}</p>
@enderror
</div>

<div class="form-check form-check-info text-start col-xl-6 col-lg-5 col-md-6 mx-auto">
<input class="form-check-input" type="checkbox" name="terms" id="flexCheckDefault">
<label class="form-check-label" for="flexCheckDefault">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
wire:model="description"
placeholder=""
maxlength="255"
pattern="[a-zA-ZÀ-ÿ0-9\s]+"
pattern="[A-Za-zÀ-ÿ0-9.,;:?!\()\\[\\]{}\/\ _\-+=#@!%&*]+"
required
/>
@error("description")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class="form-control w-md-25 w-100"
name="de_question_id"
list="de_questionId_suggestions"
maxlength="255"
pattern="[A-Za-z0-9]+"
pattern="[A-Za-zÀ-ÿ0-9.,;:?!\()\\[\\]{}\/\ _\-+=#@!%&*]+"
required

/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
wire:model="description"
placeholder="{{ __('project/planning.overall.domain.list.headers.enter_description') }}"
maxlength="255"
pattern="[A-Za-zÀ-ÿ\s]+"
pattern="[A-Za-zÀ-ÿ0-9.,;:?!\()\\[\\]{}\/\ _\-+=#@!%&*]+"
required
/>
@error("description")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
wire:model="description"
placeholder="{{ __('project/planning.overall.keyword.enter_description') }}"
maxlength="255"
pattern="[A-Za-zÀ-ÿ\s]+"
pattern="[A-Za-zÀ-ÿ0-9.,;:?!\()\\[\\]{}\/\ _\-+=#@!%&*]+"
required
/>
@error("description")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
label="{{ __('project/planning.quality-assessment.question-quality.id') }}"
placeholder="QA01"
wire:model="questionId"
pattern="[a-zA-ZÀ-ÿ0-9\s]+"
pattern="[A-Za-zÀ-ÿ0-9.,;:?!\()\\[\\]{}\/\ _\-+=#@!%&*]+"
required
autocomplete="on"
name="quality_question_id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class="form-control"
label="{{ __('project/planning.quality-assessment.question-score.score_rule.title') }}"
maxlength="20"
min="0"
pattern="[a-zA-ZÀ-ÿ\s]+"
pattern="[A-Za-zÀ-ÿ0-9.,;:?!\()\\[\\]{}\/\ _\-+=#@!%&*]+"
required
/>
<datalist id="score-rule-options">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class="form-control"
id="description"
wire:model="description"
placeholder="{{ __("project/planning.research-questions.form.enter_description") }}"
pattern="[A-Za-zÀ-ÿ\s]+"
pattern="[A-Za-zÀ-ÿ0-9.,;:?!\()\\[\\]{}\/\ _\-+=#@!%&*]+"
title="A descrição deve conter apenas letras e espaços."
required
></textarea>
Expand Down
Loading
Loading