diff --git a/package.json b/package.json index b975e12..c4ac3a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sysvale/citizen-components", - "version": "1.15.3", + "version": "1.15.4", "type": "module", "publishConfig": { "access": "public" diff --git a/src/components/InternalComponents/__snapshots__/CitizenForm.test.ts.snap b/src/components/InternalComponents/__snapshots__/CitizenForm.test.ts.snap index 06f11b2..0a23609 100644 --- a/src/components/InternalComponents/__snapshots__/CitizenForm.test.ts.snap +++ b/src/components/InternalComponents/__snapshots__/CitizenForm.test.ts.snap @@ -35,7 +35,7 @@ exports[`CitizenForm > is rendered correctly 1`] = `
- +
diff --git a/src/constants/citizenFormFields.ts b/src/constants/citizenFormFields.ts index e191e75..479d9a2 100644 --- a/src/constants/citizenFormFields.ts +++ b/src/constants/citizenFormFields.ts @@ -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', diff --git a/src/models/Citizen.ts b/src/models/Citizen.ts index 40abc9f..24bfbcd 100644 --- a/src/models/Citizen.ts +++ b/src/models/Citizen.ts @@ -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' }, ]; @@ -146,6 +146,10 @@ export class Citizen { } get isPregnant() { + if(!this._gender) { + return false; + } + return this._gender.value === 'F' && this.pregnant; }