Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat registration fields - colorraces and textarea obs #12

Merged
merged 2 commits into from
Sep 20, 2024
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: 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
Loading