Skip to content

Commit

Permalink
date registration
Browse files Browse the repository at this point in the history
  • Loading branch information
TI JONNY committed Dec 19, 2024
1 parent 9f32867 commit 6082f8c
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# REACT_APP_API_PATH=http://localhost:3000/
REACT_APP_API_PATH=https://br-ipti-beneficiarios.azurewebsites.net/
REACT_APP_API_PATH=http://localhost:3000/
# REACT_APP_API_PATH=https://br-ipti-beneficiarios.azurewebsites.net/
2 changes: 1 addition & 1 deletion src/Components/Card/CardRegistration/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const CardRegistration = ({
<Padding />
<Column>
<div className="status" style={{fontWeight: "500",
padding: 4, textAlign: "center", minWidth: "96px", maxWidth: "128px", color: "white", borderRadius: "16px", backgroundColor: `${status === statuGlobal.APPROVED
padding: 4, textAlign: "center", minWidth: "96px", maxWidth: "150px",color: "white", borderRadius: "16px", backgroundColor: `${status === statuGlobal.APPROVED
? color.green
: status === statuGlobal.PENDING
? color.colorCardOrange
Expand Down
3 changes: 2 additions & 1 deletion src/Context/Beneficiaries/BeneficiaresCreate/state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export const BeneficiariesCreateState = () => {
number: "",
complement: "",
state: undefined,
city: undefined
city: undefined,
date_registration: new Date(Date.now())
};


Expand Down
1 change: 1 addition & 0 deletions src/Context/Beneficiaries/BeneficiaresCreate/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface BeneficiariesCreateType {
project: number | undefined,
deficiency_description: string | undefined
kinship: string
date_registration: string | undefined | any
};
tsOne: Tsone | undefined;
project: any | undefined;
Expand Down
3 changes: 2 additions & 1 deletion src/Context/Beneficiaries/BeneficiaresEdit/state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ export const BeneficiariesEditState = () => {
number: registrations?.number ?? "",
complement: registrations?.complement ?? "",
state: registrations?.state_fk ?? "",
city: registrations?.city_fk ?? ""
city: registrations?.city_fk ?? "",
date_registration: new Date(registrations?.date_registration) ?? ""
};

const CreateRegisterClassroom = (data: CreateRegistrationClassroomType) => {
Expand Down
1 change: 1 addition & 0 deletions src/Context/Beneficiaries/BeneficiaresEdit/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export interface Registration {
neighborhood: any
city_fk: any
state_fk: any
date_registration: any
register_term: RegisterTerm[]
register_classroom: RegisterClassroom[]
}
Expand Down
4 changes: 2 additions & 2 deletions src/Context/Classroom/Registration/state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export const RegistrationClassroomState = () => {
responsable_telephone: registration?.registration.responsable_telephone,
status: getStatus(registration?.status!),
deficiency_description: registration?.registration.deficiency_description,
kinship: registration?.registration.kinship

kinship: registration?.registration.kinship,
date_registration: registration?.registration.date_registration ?? ""
};

const handleUpdateRegistration = (data: UpdateRegister, id: number) => {
Expand Down
2 changes: 2 additions & 0 deletions src/Context/Classroom/Registration/type.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface UpdateRegister
registration_classroom_id?: number
deficiency_description: any
kinship: string | undefined | null
date_registration: any
}
export interface RegistrationType {
avatar_url: string
Expand Down Expand Up @@ -60,4 +61,5 @@ export interface Registration {
updatedAt: string
kinship: string
register_term?: any
date_registration: any
}
15 changes: 15 additions & 0 deletions src/Pages/Beneficiaries/BeneficiariesCreate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,21 @@ const RegistrationPage = () => {
) : null}
</div>
) : null}
{values.project && <div className="col-12 md:col-6">
<label>Data de matricula</label>
<Padding />
<CalendarComponent
value={values.date_registration}
name="date_registration"
dateFormat="dd/mm/yy"
onChange={handleChange}
/>
{errors.date_registration && touched.date_registration ? (
<div style={{ color: "red", marginTop: "8px" }}>
{String(errors.date_registration)}
</div>
) : null}
</div>}
</div>{" "}
<Padding />
<h3>Endereço</h3>
Expand Down
20 changes: 18 additions & 2 deletions src/Pages/Beneficiaries/BeneficiariesEdit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import ModalCreateRegisterClassroom from "./ModalCreateRegisterClassroom";
import { validaCPF } from "../../../Controller/controllerValidCPF";
import ModalAddTerm from "./ModalAddTerm";
import Icon from "../../../Components/Icon";
import CalendarComponent from "../../../Components/Calendar";


const BeneficiariesEdit = () => {
Expand Down Expand Up @@ -160,7 +161,7 @@ const BeneficiariesEditPage = () => {
}}
>
{({ values, handleChange, errors, touched, setFieldValue }) => {

console.log(values)
const errorArray = getErrorsAsArray(errors);
return (
<Form>
Expand Down Expand Up @@ -303,6 +304,21 @@ const BeneficiariesEditPage = () => {
</div>
) : null}
</div>
<div className="col-12 md:col-6">
<label>Data de matricula</label>
<Padding />
<CalendarComponent
value={values.date_registration}
name="date_registration"
dateFormat="dd/mm/yy"
onChange={handleChange}
/>
{errors.date_registration && touched.date_registration ? (
<div style={{ color: "red", marginTop: "8px" }}>
{String(errors.date_registration)}
</div>
) : null}
</div>
</div>{" "}
<div className="grid">
<div className="col-12 md:col-6">
Expand Down Expand Up @@ -399,7 +415,7 @@ const BeneficiariesEditPage = () => {
<Padding padding="8px" />
<h3>Termo</h3>
<Padding padding="8px" />

<DataTable
value={props.registrations?.register_term}
tableStyle={{ minWidth: "50rem" }}
Expand Down
2 changes: 1 addition & 1 deletion src/Pages/Beneficiaries/BeneficiariesList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const BeneficiariesListPage = () => {
body={(rowData) => {
return <>{formatarData(rowData.createdAt)}</>;
}}
header="Data de criação"
header="Data de matricula"
></Column>
<Column header="Ações" body={ActionBeneficiariesBody}></Column>
</DataTable>
Expand Down

0 comments on commit 6082f8c

Please sign in to comment.