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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sysvale/citizen-components",
"version": "1.15.3",
"version": "1.15.4",
"type": "module",
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ exports[`CitizenForm > is rendered correctly 1`] = `
<cds-checkbox-stub data-v-1916aed6="" modelvalue="false" label="Está gestante" variant="green" indeterminate="false" prominent="false" disabled="true" name="pregnant" required="false" rules="" colspan="4" component="CdsCheckbox" data-testid="test-pregnant" state="default" class="field__container" fluid=""></cds-checkbox-stub>
</div>
<div data-v-051eccea="" data-v-1916aed6="" class="grid-item">
<cds-text-input-stub data-v-1916aed6="" label="Nome da mãe" disabled="false" state="default" inputtype="text" required="true" placeholder="Nome da mãe" errormessage="Valor inválido" fluid="true" tooltipicon="info-outline" supportingtext="" lazy="false" mobile="false" floatinglabel="false" disableautocomplete="false" name="mother_name" rules="min:5" colspan="12" component="CdsTextInput" data-testid="test-mother_name" class="field__container"></cds-text-input-stub>
<cds-text-input-stub data-v-1916aed6="" label="Nome da mãe" disabled="false" state="default" inputtype="text" required="true" placeholder="Nome da mãe" errormessage="Valor inválido" fluid="true" tooltipicon="info-outline" supportingtext="" lazy="false" mobile="false" floatinglabel="false" disableautocomplete="false" name="mother_name" rules="required|min:5" colspan="12" component="CdsTextInput" data-testid="test-mother_name" class="field__container"></cds-text-input-stub>
</div>
<div data-v-051eccea="" data-v-1916aed6="" class="grid-item">
<cds-text-input-stub data-v-1916aed6="" label="Telefone" disabled="false" state="default" inputtype="text" required="false" placeholder="(00) 00000-0000" errormessage="Valor inválido" fluid="true" mask="(##) #####-####" tooltipicon="info-outline" supportingtext="" lazy="false" mobile="false" floatinglabel="false" disableautocomplete="false" name="phone" rules="" colspan="3" component="CdsTextInput" data-testid="test-phone" class="field__container"></cds-text-input-stub>
Expand Down
2 changes: 1 addition & 1 deletion src/constants/citizenFormFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default (hiddenFields: string[]): CitizenFormField[] => {
name: 'mother_name',
label: 'Nome da mãe',
required: true,
rules: 'min:5',
rules: 'required|min:5',
colSpan: 12,
placeholder: 'Nome da mãe',
component: 'CdsTextInput',
Expand Down
6 changes: 5 additions & 1 deletion src/models/Citizen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class Citizen {
{ label: 'CNS', value: this.cns ? maskCns(this.cns) : 'Não informado', field: 'cns' },
{ label: 'RG', value: this.identification_document || 'Não informado', field: 'identification_document' },
{ label: 'Data de nascimento', value: DateTime.fromISO(this.birth_date).toFormat('dd/MM/yyyy'), field: 'birth_date' },
{ label: 'Sexo', value: this._gender.name, field: 'gender' },
{ label: 'Sexo', value: this._gender ? this._gender.name : 'Não informado', field: 'gender' },
{ label: 'Raça/Cor', value: this.race?.name || 'Não informado', field: 'race' },
];

Expand All @@ -146,6 +146,10 @@ export class Citizen {
}

get isPregnant() {
if(!this._gender) {
return false;
}

return this._gender.value === 'F' && this.pregnant;
}

Expand Down