Skip to content

Commit

Permalink
Merge pull request #12 from ipti/feat-registration-fields
Browse files Browse the repository at this point in the history
Feat registration fields - colorraces and textarea obs
  • Loading branch information
jonnypaulino authored Sep 20, 2024
2 parents f2cf558 + ac64075 commit d65aada
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 44 deletions.
2 changes: 2 additions & 0 deletions src/context/Classroom/FormOphthalmological/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ const FormRegistrationState = () => {
baixaVisaoCentral: oneRegistration?.object.acompanhamento?.baixaVisaoCentral ?? false,
},
proximaConsulta: oneRegistration?.object.proximaConsulta ?? "",
observationConsulta: oneRegistration?.object.observationConsulta ?? "",

receitaEsfericoOlhoDireito: oneRegistration?.object.receitaEsfericoOlhoDireito ?? "",
receitaCilindricoOlhoDireito: oneRegistration?.object.receitaCilindricoOlhoDireito ?? "",
receitaEixoOlhoDireito: oneRegistration?.object.receitaEixoOlhoDireito ?? "",
Expand Down
2 changes: 1 addition & 1 deletion src/context/Registration/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const RegistrationState = () => {
const parseBool = value =>
['true', 'false'].includes(value) ? value === true : null
handleSubmitStudent({
...dataValues, sex: parseInt(dataValues.sex),
...dataValues, sex: parseInt(dataValues.sex), zone: parseInt(dataValues.zone),
birthday: dataValues.birthday,
filhoOculos: parseBool(dataValues.filhoOculos),
cpf: dataValues.cpf ? dataValues.cpf.replace(/\D/g, '') : null,
Expand Down
30 changes: 19 additions & 11 deletions src/screens/Classroom/CreateRegistration.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,29 @@ const CreateRegistrationState = () => {

const colorRace = [
{
id: 1,
id: 0,
name: "Não declarado"
},
{
id: 2,
},
{
id: 1,
name: "Branca"
},
{
id: 3,
},
{
id: 2,
name: "Preta"
},
{
id: 4,
},
{
id: 3,
name: "Parda"
},
},
{
id: 4,
name: "Amarela"
},
{
id: 5,
name: "Indígena"
},
]


Expand Down
23 changes: 21 additions & 2 deletions src/screens/Classroom/RegistrationConfirmed/FormConsulta/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { makeStyles } from "@material-ui/core/styles";
import { Checkbox, FormControlLabel, FormGroup, Grid, Radio, RadioGroup, TextField } from "@mui/material";
import { Checkbox, FormControlLabel, FormGroup, Grid, Radio, RadioGroup, TextField, TextareaAutosize } from "@mui/material";
import React from "react";
import MaskDate from "../../../../components/Mask/maskdate";
import styles from "../../../../styles";
Expand Down Expand Up @@ -322,7 +322,26 @@ const FormConsulta = ({ values, handleChange }) => {
</Column>
</Grid>

<Padding />
<Padding padding="8px" />

<Grid container>
<Grid item style={{ width: "100%" }} md={6}>
<p className={classes.label}>Observações</p>
<Column>
<TextareaAutosize
className={classes.inputStudent}
style={{ width: "100%", height: "128px", resize: "vertical" }}
name="observationConsulta"
onChange={handleChange}
value={values.observationConsulta}
variant="outlined"
/>
</Column>
</Grid>
</Grid>

<Padding padding="8px" />

<Grid item style={{ width: "100%" }} md={12}>
<p className={classes.label}>Considerar formulário como concluído?</p>
<FormGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TextField } from "@material-ui/core";
import { TextareaAutosize } from "@material-ui/core";
import { makeStyles } from "@material-ui/core/styles";
import { FormControlLabel, Grid, Radio, RadioGroup } from "@mui/material";
import { Checkbox, FormGroup } from "@mui/material";
Expand Down Expand Up @@ -119,29 +119,32 @@ const FormOphthalmologicalPage = ({ values, handleChange }) => {
/>
</RadioGroup>
</Grid>
<Grid item style={{ width: "100%" }} md={12}>
<p className={classes.label}>Observação</p>
<TextField
className={classes.inputStudent}
name="observation"
onChange={handleChange}
value={values.observation}
variant="outlined"
/>
<Grid container>
<Grid item style={{ width: "100%" }} md={6}>
<p className={classes.label}>Observações</p>
<TextareaAutosize
className={classes.inputStudent}
style={{ width: "100%", height: "128px", resize: "vertical" }}
name="observation"
onChange={handleChange}
value={values.observation}
variant="outlined"
/>
</Grid>
</Grid>

<Padding />
<Grid item style={{ width: "100%" }} md={12}>
<p className={classes.label}>Considerar formulário como concluído?</p>
<FormGroup>
<FormControlLabel control={<Checkbox
name="triagemCompleted"
defaultChecked={values.triagemCompleted}
onChange={handleChange}
value={values.triagemCompleted} />}
label="Considerar triagem como concluída" />
</FormGroup>
</Grid>
<Grid item style={{ width: "100%" }} md={12}>
<p className={classes.label}>Considerar formulário como concluído?</p>
<FormGroup>
<FormControlLabel control={<Checkbox
name="triagemCompleted"
defaultChecked={values.triagemCompleted}
onChange={handleChange}
value={values.triagemCompleted} />}
label="Considerar triagem como concluída" />
</FormGroup>
</Grid>
</>
);
};
Expand Down
18 changes: 13 additions & 5 deletions src/screens/Classroom/RegistrationConfirmed/FormPerson/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,29 @@ const FormPesonState = () => {

const colorRace = [
{
id: 1,
id: 0,
name: "Não declarado"
},
{
id: 2,
id: 1,
name: "Branca"
},
{
id: 3,
id: 2,
name: "Preta"
},
{
id: 4,
id: 3,
name: "Parda"
},
{
id: 4,
name: "Amarela"
},
{
id: 5,
name: "Indígena"
},
]

return { colorRace };
Expand All @@ -67,7 +75,7 @@ const FormPerson = ({ values, handleChange, setFieldValue }) => {
<h2> Dados básicos </h2>
<Grid container>
<Grid item md={6}>
<p className={classes.label}>Name</p>
<p className={classes.label}>Nome</p>
<Column>
<TextField
className={classes.inputStudent}
Expand Down
16 changes: 12 additions & 4 deletions src/screens/Registration/StepOne/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,29 @@ const StepOne = () => {

const colorRace = [
{
id: 1,
id: 0,
name: "Não declarado"
},
{
id: 2,
id: 1,
name: "Branca"
},
{
id: 3,
id: 2,
name: "Preta"
},
{
id: 4,
id: 3,
name: "Parda"
},
{
id: 4,
name: "Amarela"
},
{
id: 5,
name: "Indígena"
},
]


Expand Down

0 comments on commit d65aada

Please sign in to comment.