add edit form to Person entity
This commit is contained in:
77
src/admin-components/resources/person/edit.tsx
Normal file
77
src/admin-components/resources/person/edit.tsx
Normal file
@@ -0,0 +1,77 @@
|
||||
import React from "react";
|
||||
import {
|
||||
BooleanField, BooleanInput,
|
||||
DateInput,
|
||||
Edit,
|
||||
Labeled,
|
||||
SimpleForm,
|
||||
TextInput,
|
||||
} from 'react-admin';
|
||||
import { Box, Card, CardContent, CardHeader, Stack } from "@mui/material";
|
||||
|
||||
export const PersonEdit = () => {
|
||||
return (
|
||||
<Edit>
|
||||
<SimpleForm>
|
||||
<Card sx={{ width: "100%", m: 1 }}>
|
||||
<CardHeader title="General info" />
|
||||
<CardContent>
|
||||
<Stack
|
||||
sx={{
|
||||
flexWrap: "wrap",
|
||||
justifyContent: "flex-start",
|
||||
alignItems: "center",
|
||||
}}
|
||||
direction="row"
|
||||
columnGap={5}
|
||||
rowGap={2}
|
||||
>
|
||||
<Labeled label="Name">
|
||||
<Stack direction="row" gap={1}>
|
||||
<TextInput sx={{ textTransform: "" }} source="title" />
|
||||
<TextInput source="firstName" />
|
||||
<TextInput source="lastName" />
|
||||
</Stack>
|
||||
</Labeled>
|
||||
<TextInput source="email" fullWidth="false" />
|
||||
<BooleanInput
|
||||
source="userAccess"
|
||||
label="Access to the Platform"
|
||||
/>
|
||||
<Labeled label="Position">
|
||||
<TextInput source="jobPosition" />
|
||||
</Labeled>
|
||||
<Labeled label="Phone number">
|
||||
<TextInput source="phoneNumber" />
|
||||
</Labeled>
|
||||
<Labeled label="Mobile number">
|
||||
<TextInput source="mobileNumber" />
|
||||
</Labeled>
|
||||
<Box />
|
||||
</Stack>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Card sx={{ width: "100%", m: 1 }}>
|
||||
<CardHeader title="Platform info" />
|
||||
<CardContent>
|
||||
<Stack
|
||||
sx={{ justifyContent: "flex-start", alignItems: "center" }}
|
||||
direction="row"
|
||||
gap={5}
|
||||
>
|
||||
<Labeled label="Last changes date">
|
||||
<DateInput source="updateDate" />
|
||||
</Labeled>
|
||||
<Labeled label="User Access Active From">
|
||||
<DateInput source="userAccessFrom" />
|
||||
</Labeled>
|
||||
<Labeled label="User Access Active To">
|
||||
<DateInput source="userAccessTo" />
|
||||
</Labeled>
|
||||
</Stack>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</SimpleForm>
|
||||
</Edit>
|
||||
);
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
export { PersonList } from './list.tsx';
|
||||
export { PersonShow } from './show.tsx';
|
||||
export { PersonEdit } from './edit.tsx';
|
||||
export * from './components';
|
||||
|
||||
Reference in New Issue
Block a user