ApiLogicServer 15.0.26__py3-none-any.whl → 15.0.28__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- api_logic_server_cli/api_logic_server.py +2 -2
- api_logic_server_cli/api_logic_server_info.yaml +3 -3
- api_logic_server_cli/cli.py +1 -1
- api_logic_server_cli/genai/genai_admin_app.py +11 -6
- api_logic_server_cli/genai/genai_svcs.py +3 -3
- api_logic_server_cli/logging.yml +16 -1
- api_logic_server_cli/prototypes/.DS_Store +0 -0
- api_logic_server_cli/prototypes/basic_demo/.DS_Store +0 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/.DS_Store +0 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/.DS_Store +0 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/admin/.DS_Store +0 -0
- api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/.DS_Store +0 -0
- api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/README.md +0 -2
- api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/package.json +3 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/App.js +61 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/Config-reference.js +527 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/Config.js +527 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/Customer-reference.js +216 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/Customer.js +230 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/Item.js +170 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/Order.js +207 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/Product.js +140 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/SysEmail.js +157 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/SysMcp.js +110 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/app_loader.js +24 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/rav4-jsonapi-client/.eslintrc +5 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/rav4-jsonapi-client/.yarnrc.yml +4 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/rav4-jsonapi-client/default-settings.js +25 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/rav4-jsonapi-client/default-settings.ts +25 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/rav4-jsonapi-client/errors.js +116 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/rav4-jsonapi-client/errors.ts +116 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/rav4-jsonapi-client/index.test.tsx +7 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/rav4-jsonapi-client/index.tsx +11 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/rav4-jsonapi-client/ra-jsonapi-client.js +577 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/rav4-jsonapi-client/ra-jsonapi-client.ts +577 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/rav4-jsonapi-client/resourceLookup.js +124 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/rav4-jsonapi-client/resourceLookup.ts +124 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/ui/reference_react_app/src/rav4-jsonapi-client/styles.module.css +9 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-App-Resource-Learning-Prompt.md +2 -2
- api_logic_server_cli/prototypes/nw/ui/.DS_Store +0 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/.DS_Store +0 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/README.md +17 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/README_create_react_app.md +70 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/compile-errors.txt +324 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/package-lock.json +18493 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/package.json +47 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/public/favicon.ico +0 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/public/index.html +43 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/public/logo192.png +0 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/public/logo512.png +0 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/public/manifest.json +25 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/public/robots.txt +3 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/App.css +38 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/App.js +147 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/App.test.js +8 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Category.js +141 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Config.js +527 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Customer.js +193 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/CustomerDemographic.js +119 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Department.js +144 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Employee.js +213 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/EmployeeAudit.js +223 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/EmployeeTerritory.js +94 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Location.js +170 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Order.js +179 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/OrderDetail.js +201 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Product.js +226 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Region.js +104 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Shipper.js +120 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Supplier.js +143 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Territory.js +145 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/Union.js +119 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/app_loader.js +24 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/index.css +13 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/index.js +17 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/logo.svg +1 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/.eslintrc +5 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/.yarnrc.yml +4 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/default-settings.js +25 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/default-settings.ts +25 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/errors.js +116 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/errors.ts +116 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/index.test.tsx +7 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/index.tsx +11 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/ra-jsonapi-client.js +577 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/ra-jsonapi-client.ts +577 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/resourceLookup.js +124 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/resourceLookup.ts +124 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/rav4-jsonapi-client/styles.module.css +9 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/reportWebVitals.js +13 -0
- api_logic_server_cli/prototypes/nw/ui/reference_react_app/src/setupTests.js +5 -0
- {apilogicserver-15.0.26.dist-info → apilogicserver-15.0.28.dist-info}/METADATA +1 -1
- {apilogicserver-15.0.26.dist-info → apilogicserver-15.0.28.dist-info}/RECORD +114 -52
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/App.js +0 -58
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Category.js +0 -82
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Customer.js +0 -211
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/CustomerDemographic.js +0 -57
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Department.js +0 -98
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Employee.js +0 -100
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeAudit.js +0 -106
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeTerritory.js +0 -98
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Location.js +0 -87
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Order.js +0 -98
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/OrderDetail.js +0 -112
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Product.js +0 -103
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Region.js +0 -65
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Shipper.js +0 -67
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Supplier.js +0 -87
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Territory.js +0 -90
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Union.js +0 -61
- /api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/README_create_react_app.md +0 -0
- /api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/package-lock.json +0 -0
- /api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/public/favicon.ico +0 -0
- /api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/public/index.html +0 -0
- /api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/public/logo192.png +0 -0
- /api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/public/logo512.png +0 -0
- /api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/public/manifest.json +0 -0
- /api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/public/robots.txt +0 -0
- /api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/src/App.css +0 -0
- /api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/src/App.test.js +0 -0
- /api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/src/index.css +0 -0
- /api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/src/index.js +0 -0
- /api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/src/logo.svg +0 -0
- /api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/src/reportWebVitals.js +0 -0
- /api_logic_server_cli/prototypes/{nw/ui/react_admin → basic_demo/customizations/ui/reference_react_app}/src/setupTests.js +0 -0
- /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/SampleDBVersion.js +0 -0
- /api_logic_server_cli/prototypes/nw/ui/{react_admin → reference_react_app}/src/dataProvider.js +0 -0
- {apilogicserver-15.0.26.dist-info → apilogicserver-15.0.28.dist-info}/WHEEL +0 -0
- {apilogicserver-15.0.26.dist-info → apilogicserver-15.0.28.dist-info}/entry_points.txt +0 -0
- {apilogicserver-15.0.26.dist-info → apilogicserver-15.0.28.dist-info}/licenses/LICENSE +0 -0
- {apilogicserver-15.0.26.dist-info → apilogicserver-15.0.28.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
// begin MANDATORY imports (always generated EXACTLY)
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { List, FunctionField, Datagrid, TextField, EmailField, DateField, NumberField } from 'react-admin';
|
|
4
|
+
import { ReferenceField, ReferenceManyField } from 'react-admin';
|
|
5
|
+
import { TabbedShowLayout, Tab, SimpleShowLayout, TextInput, NumberInput, DateTimeInput } from 'react-admin';
|
|
6
|
+
import { ReferenceInput, SelectInput, SimpleForm, Show, Edit, Create } from 'react-admin';
|
|
7
|
+
import { Filter, Pagination, BooleanField, BooleanInput, Labeled } from 'react-admin';
|
|
8
|
+
import { EditButton, DeleteButton, CreateButton, ShowButton } from 'react-admin';
|
|
9
|
+
import { Grid, Typography, Box, Divider, Button } from '@mui/material';
|
|
10
|
+
import { useRecordContext, useRedirect, Link, required } from 'react-admin';
|
|
11
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
12
|
+
// end mandatory imports
|
|
13
|
+
|
|
14
|
+
const EmployeeAuditFilter = (props) => (
|
|
15
|
+
<Filter {...props}>
|
|
16
|
+
<TextInput label="Search" source="LastName" alwaysOn />
|
|
17
|
+
</Filter>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
// EmployeeAudit List
|
|
21
|
+
export const EmployeeAuditList = (props) => {
|
|
22
|
+
return (
|
|
23
|
+
<List filters={<EmployeeAuditFilter />} {...props}
|
|
24
|
+
sort={{ field: 'LastName', order: 'ASC' }}
|
|
25
|
+
pagination={<Pagination rowsPerPageOptions={[5, 10, 25]} showFirstLastButtons />}>
|
|
26
|
+
<Datagrid rowClick="show">
|
|
27
|
+
<TextField source="LastName" label="Last Name" />
|
|
28
|
+
<TextField source="FirstName" label="First Name" />
|
|
29
|
+
<TextField source="Title" label="Title" />
|
|
30
|
+
<NumberField source="Salary" label="Salary" options={{ style: 'currency', currency: 'USD' }} />
|
|
31
|
+
<DateField source="CreatedOn" label="Created On" />
|
|
32
|
+
<TextField source="CreatedBy" label="Created By" />
|
|
33
|
+
<DateField source="UpdatedOn" label="Updated On" />
|
|
34
|
+
<TextField source="UpdatedBy" label="Updated By" />
|
|
35
|
+
<EditButton />
|
|
36
|
+
<DeleteButton />
|
|
37
|
+
</Datagrid>
|
|
38
|
+
</List>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// EmployeeAudit Show
|
|
43
|
+
export const EmployeeAuditShow = (props) => {
|
|
44
|
+
return (
|
|
45
|
+
<Show {...props}>
|
|
46
|
+
<SimpleShowLayout>
|
|
47
|
+
<Box sx={{ mb: 3 }}>
|
|
48
|
+
<Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
|
|
49
|
+
Employee Audit Entry Details
|
|
50
|
+
</Typography>
|
|
51
|
+
<Grid container spacing={3} sx={{ mb: 2 }}>
|
|
52
|
+
<Grid item xs={12} sm={6} md={3}>
|
|
53
|
+
<Box sx={{ p: 1 }}>
|
|
54
|
+
<Labeled label="Last Name">
|
|
55
|
+
<TextField source="LastName" />
|
|
56
|
+
</Labeled>
|
|
57
|
+
</Box>
|
|
58
|
+
</Grid>
|
|
59
|
+
<Grid item xs={12} sm={6} md={3}>
|
|
60
|
+
<Box sx={{ p: 1 }}>
|
|
61
|
+
<Labeled label="First Name">
|
|
62
|
+
<TextField source="FirstName" />
|
|
63
|
+
</Labeled>
|
|
64
|
+
</Box>
|
|
65
|
+
</Grid>
|
|
66
|
+
<Grid item xs={12} sm={6} md={3}>
|
|
67
|
+
<Box sx={{ p: 1 }}>
|
|
68
|
+
<Labeled label="Title">
|
|
69
|
+
<TextField source="Title" />
|
|
70
|
+
</Labeled>
|
|
71
|
+
</Box>
|
|
72
|
+
</Grid>
|
|
73
|
+
<Grid item xs={12} sm={6} md={3}>
|
|
74
|
+
<Box sx={{ p: 1 }}>
|
|
75
|
+
<Labeled label="Salary">
|
|
76
|
+
<NumberField source="Salary" options={{ style: 'currency', currency: 'USD' }} />
|
|
77
|
+
</Labeled>
|
|
78
|
+
</Box>
|
|
79
|
+
</Grid>
|
|
80
|
+
</Grid>
|
|
81
|
+
<Divider sx={{ my: 2 }} />
|
|
82
|
+
</Box>
|
|
83
|
+
</SimpleShowLayout>
|
|
84
|
+
<TabbedShowLayout>
|
|
85
|
+
<Tab label="Details">
|
|
86
|
+
<Grid container spacing={3}>
|
|
87
|
+
<Grid item xs={12} sm={6} md={3}>
|
|
88
|
+
<Box sx={{ p: 1 }}>
|
|
89
|
+
<Labeled label="Created On">
|
|
90
|
+
<DateField source="CreatedOn" />
|
|
91
|
+
</Labeled>
|
|
92
|
+
</Box>
|
|
93
|
+
</Grid>
|
|
94
|
+
<Grid item xs={12} sm={6} md={3}>
|
|
95
|
+
<Box sx={{ p: 1 }}>
|
|
96
|
+
<Labeled label="Created By">
|
|
97
|
+
<TextField source="CreatedBy" />
|
|
98
|
+
</Labeled>
|
|
99
|
+
</Box>
|
|
100
|
+
</Grid>
|
|
101
|
+
<Grid item xs={12} sm={6} md={3}>
|
|
102
|
+
<Box sx={{ p: 1 }}>
|
|
103
|
+
<Labeled label="Updated On">
|
|
104
|
+
<DateField source="UpdatedOn" />
|
|
105
|
+
</Labeled>
|
|
106
|
+
</Box>
|
|
107
|
+
</Grid>
|
|
108
|
+
<Grid item xs={12} sm={6} md={3}>
|
|
109
|
+
<Box sx={{ p: 1 }}>
|
|
110
|
+
<Labeled label="Updated By">
|
|
111
|
+
<TextField source="UpdatedBy" />
|
|
112
|
+
</Labeled>
|
|
113
|
+
</Box>
|
|
114
|
+
</Grid>
|
|
115
|
+
</Grid>
|
|
116
|
+
</Tab>
|
|
117
|
+
</TabbedShowLayout>
|
|
118
|
+
</Show>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
// EmployeeAudit Create
|
|
123
|
+
export const EmployeeAuditCreate = (props) => {
|
|
124
|
+
return (
|
|
125
|
+
<Create {...props}>
|
|
126
|
+
<SimpleForm>
|
|
127
|
+
<Box sx={{ mb: 3 }}>
|
|
128
|
+
<Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
|
|
129
|
+
Create New Employee Audit Entry
|
|
130
|
+
</Typography>
|
|
131
|
+
<Grid container spacing={3} sx={{ mb: 2 }}>
|
|
132
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
133
|
+
<Box sx={{ p: 1 }}>
|
|
134
|
+
<TextInput source="LastName" label="Last Name" fullWidth validate={required()} />
|
|
135
|
+
</Box>
|
|
136
|
+
</Grid>
|
|
137
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
138
|
+
<Box sx={{ p: 1 }}>
|
|
139
|
+
<TextInput source="FirstName" label="First Name" fullWidth validate={required()} />
|
|
140
|
+
</Box>
|
|
141
|
+
</Grid>
|
|
142
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
143
|
+
<Box sx={{ p: 1 }}>
|
|
144
|
+
<TextInput source="Title" label="Title" fullWidth />
|
|
145
|
+
</Box>
|
|
146
|
+
</Grid>
|
|
147
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
148
|
+
<Box sx={{ p: 1 }}>
|
|
149
|
+
<NumberInput source="Salary" label="Salary" fullWidth />
|
|
150
|
+
</Box>
|
|
151
|
+
</Grid>
|
|
152
|
+
|
|
153
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
154
|
+
<Box sx={{ p: 1 }}>
|
|
155
|
+
<DateTimeInput source="CreatedOn" label="Created On" fullWidth disabled />
|
|
156
|
+
</Box>
|
|
157
|
+
</Grid>
|
|
158
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
159
|
+
<Box sx={{ p: 1 }}>
|
|
160
|
+
<TextInput source="CreatedBy" label="Created By" fullWidth />
|
|
161
|
+
</Box>
|
|
162
|
+
</Grid>
|
|
163
|
+
</Grid>
|
|
164
|
+
</Box>
|
|
165
|
+
</SimpleForm>
|
|
166
|
+
</Create>
|
|
167
|
+
);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
// EmployeeAudit Edit
|
|
171
|
+
export const EmployeeAuditEdit = (props) => {
|
|
172
|
+
return (
|
|
173
|
+
<Edit {...props} redirect={false}>
|
|
174
|
+
<SimpleForm>
|
|
175
|
+
<Box sx={{ mb: 3 }}>
|
|
176
|
+
<Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
|
|
177
|
+
Edit Employee Audit Entry
|
|
178
|
+
</Typography>
|
|
179
|
+
<Grid container spacing={3} sx={{ mb: 2 }}>
|
|
180
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
181
|
+
<Box sx={{ p: 1 }}>
|
|
182
|
+
<TextInput source="LastName" label="Last Name" fullWidth validate={required()} />
|
|
183
|
+
</Box>
|
|
184
|
+
</Grid>
|
|
185
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
186
|
+
<Box sx={{ p: 1 }}>
|
|
187
|
+
<TextInput source="FirstName" label="First Name" fullWidth validate={required()} />
|
|
188
|
+
</Box>
|
|
189
|
+
</Grid>
|
|
190
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
191
|
+
<Box sx={{ p: 1 }}>
|
|
192
|
+
<TextInput source="Title" label="Title" fullWidth />
|
|
193
|
+
</Box>
|
|
194
|
+
</Grid>
|
|
195
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
196
|
+
<Box sx={{ p: 1 }}>
|
|
197
|
+
<NumberInput source="Salary" label="Salary" fullWidth />
|
|
198
|
+
</Box>
|
|
199
|
+
</Grid>
|
|
200
|
+
|
|
201
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
202
|
+
<Box sx={{ p: 1 }}>
|
|
203
|
+
<DateTimeInput source="UpdatedOn" label="Updated On" fullWidth disabled />
|
|
204
|
+
</Box>
|
|
205
|
+
</Grid>
|
|
206
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
207
|
+
<Box sx={{ p: 1 }}>
|
|
208
|
+
<TextInput source="UpdatedBy" label="Updated By" fullWidth />
|
|
209
|
+
</Box>
|
|
210
|
+
</Grid>
|
|
211
|
+
</Grid>
|
|
212
|
+
</Box>
|
|
213
|
+
</SimpleForm>
|
|
214
|
+
</Edit>
|
|
215
|
+
);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
export default {
|
|
219
|
+
list: EmployeeAuditList,
|
|
220
|
+
show: EmployeeAuditShow,
|
|
221
|
+
create: EmployeeAuditCreate,
|
|
222
|
+
edit: EmployeeAuditEdit,
|
|
223
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// begin MANDATORY imports (always generated EXACTLY)
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { List, FunctionField, Datagrid, TextField, EmailField, DateField, NumberField } from 'react-admin';
|
|
4
|
+
import { ReferenceField, ReferenceManyField } from 'react-admin';
|
|
5
|
+
import { TabbedShowLayout, Tab, SimpleShowLayout, TextInput, NumberInput, DateTimeInput } from 'react-admin';
|
|
6
|
+
import { ReferenceInput, SelectInput, SimpleForm, Show, Edit, Create } from 'react-admin';
|
|
7
|
+
import { Filter, Pagination, BooleanField, BooleanInput, Labeled } from 'react-admin';
|
|
8
|
+
import { EditButton, DeleteButton, CreateButton, ShowButton } from 'react-admin';
|
|
9
|
+
import { Grid, Typography, Box, Divider, Button } from '@mui/material';
|
|
10
|
+
import { useRecordContext, useRedirect, Link, required } from 'react-admin';
|
|
11
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
12
|
+
// end mandatory imports
|
|
13
|
+
|
|
14
|
+
const EmployeeTerritoryFilter = (props) => (
|
|
15
|
+
<Filter {...props}>
|
|
16
|
+
<TextInput label="Search by Id" source="Id" alwaysOn />
|
|
17
|
+
</Filter>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
// EmployeeTerritory List
|
|
21
|
+
export const EmployeeTerritoryList = (props) => {
|
|
22
|
+
return (
|
|
23
|
+
<List filters={<EmployeeTerritoryFilter />} {...props} pagination={<Pagination rowsPerPageOptions={[5, 10, 25]} showFirstLastButtons />}>
|
|
24
|
+
<Datagrid rowClick="show">
|
|
25
|
+
<TextField source="Id" label="Employee Territory Id" />
|
|
26
|
+
{/* Reference Fields to display related resources */}
|
|
27
|
+
<ReferenceField source="EmployeeId" reference="Employee">
|
|
28
|
+
<TextField source="LastName" />
|
|
29
|
+
</ReferenceField>
|
|
30
|
+
<ReferenceField source="TerritoryId" reference="Territory">
|
|
31
|
+
<TextField source="TerritoryDescription" />
|
|
32
|
+
</ReferenceField>
|
|
33
|
+
<EditButton />
|
|
34
|
+
<DeleteButton />
|
|
35
|
+
</Datagrid>
|
|
36
|
+
</List>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// EmployeeTerritory Show
|
|
41
|
+
export const EmployeeTerritoryShow = (props) => {
|
|
42
|
+
return (
|
|
43
|
+
<Show {...props}>
|
|
44
|
+
<SimpleShowLayout>
|
|
45
|
+
<TextField source="Id" label="Employee Territory Id" />
|
|
46
|
+
<ReferenceField source="EmployeeId" reference="Employee">
|
|
47
|
+
<TextField source="LastName" />
|
|
48
|
+
</ReferenceField>
|
|
49
|
+
<ReferenceField source="TerritoryId" reference="Territory">
|
|
50
|
+
<TextField source="TerritoryDescription" />
|
|
51
|
+
</ReferenceField>
|
|
52
|
+
</SimpleShowLayout>
|
|
53
|
+
</Show>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// EmployeeTerritory Create
|
|
58
|
+
export const EmployeeTerritoryCreate = (props) => {
|
|
59
|
+
return (
|
|
60
|
+
<Create {...props}>
|
|
61
|
+
<SimpleForm>
|
|
62
|
+
<ReferenceInput source="EmployeeId" reference="Employee" fullWidth>
|
|
63
|
+
<SelectInput optionText="LastName" validate={required()} />
|
|
64
|
+
</ReferenceInput>
|
|
65
|
+
<ReferenceInput source="TerritoryId" reference="Territory" fullWidth>
|
|
66
|
+
<SelectInput optionText="TerritoryDescription" validate={required()} />
|
|
67
|
+
</ReferenceInput>
|
|
68
|
+
</SimpleForm>
|
|
69
|
+
</Create>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// EmployeeTerritory Edit
|
|
74
|
+
export const EmployeeTerritoryEdit = (props) => {
|
|
75
|
+
return (
|
|
76
|
+
<Edit {...props}>
|
|
77
|
+
<SimpleForm>
|
|
78
|
+
<ReferenceInput source="EmployeeId" reference="Employee" fullWidth>
|
|
79
|
+
<SelectInput optionText="LastName" validate={required()} />
|
|
80
|
+
</ReferenceInput>
|
|
81
|
+
<ReferenceInput source="TerritoryId" reference="Territory" fullWidth>
|
|
82
|
+
<SelectInput optionText="TerritoryDescription" validate={required()} />
|
|
83
|
+
</ReferenceInput>
|
|
84
|
+
</SimpleForm>
|
|
85
|
+
</Edit>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export default {
|
|
90
|
+
list: EmployeeTerritoryList,
|
|
91
|
+
show: EmployeeTerritoryShow,
|
|
92
|
+
create: EmployeeTerritoryCreate,
|
|
93
|
+
edit: EmployeeTerritoryEdit,
|
|
94
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// begin MANDATORY imports (always generated EXACTLY)
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { List, FunctionField, Datagrid, TextField, EmailField, DateField, NumberField } from 'react-admin';
|
|
4
|
+
import { ReferenceField, ReferenceManyField } from 'react-admin';
|
|
5
|
+
import { TabbedShowLayout, Tab, SimpleShowLayout, TextInput, NumberInput, DateTimeInput } from 'react-admin';
|
|
6
|
+
import { ReferenceInput, SelectInput, SimpleForm, Show, Edit, Create } from 'react-admin';
|
|
7
|
+
import { Filter, Pagination, BooleanField, BooleanInput, Labeled } from 'react-admin';
|
|
8
|
+
import { EditButton, DeleteButton, CreateButton, ShowButton } from 'react-admin';
|
|
9
|
+
import { Grid, Typography, Box, Divider, Button } from '@mui/material';
|
|
10
|
+
import { useRecordContext, useRedirect, Link, required } from 'react-admin';
|
|
11
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
12
|
+
// end mandatory imports
|
|
13
|
+
|
|
14
|
+
const LocationFilter = (props) => (
|
|
15
|
+
<Filter {...props}>
|
|
16
|
+
<TextInput label="Search by Country" source="country" alwaysOn />
|
|
17
|
+
<TextInput label="Search by City" source="city" />
|
|
18
|
+
</Filter>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// Location List
|
|
22
|
+
export const LocationList = (props) => {
|
|
23
|
+
return (
|
|
24
|
+
<List filters={<LocationFilter />} {...props} sort={{ field: 'country', order: 'ASC' }} pagination={<Pagination rowsPerPageOptions={[5, 10, 25]} showFirstLastButtons />}>
|
|
25
|
+
<Datagrid rowClick="show">
|
|
26
|
+
<TextField source="country" label="Country" />
|
|
27
|
+
<TextField source="city" label="City" />
|
|
28
|
+
<TextField source="notes" label="Notes" />
|
|
29
|
+
</Datagrid>
|
|
30
|
+
</List>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// Location Show
|
|
35
|
+
export const LocationShow = (props) => {
|
|
36
|
+
return (
|
|
37
|
+
<Show {...props}>
|
|
38
|
+
<SimpleShowLayout>
|
|
39
|
+
<Box sx={{ mb: 3 }}>
|
|
40
|
+
<Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
|
|
41
|
+
Location Information
|
|
42
|
+
</Typography>
|
|
43
|
+
<Grid container spacing={3} sx={{ mb: 2 }}>
|
|
44
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
45
|
+
<Box sx={{ p: 1 }}>
|
|
46
|
+
<TextField source="country" label="Country" />
|
|
47
|
+
</Box>
|
|
48
|
+
</Grid>
|
|
49
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
50
|
+
<Box sx={{ p: 1 }}>
|
|
51
|
+
<TextField source="city" label="City" />
|
|
52
|
+
</Box>
|
|
53
|
+
</Grid>
|
|
54
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
55
|
+
<Box sx={{ p: 1 }}>
|
|
56
|
+
<TextField source="notes" label="Notes" />
|
|
57
|
+
</Box>
|
|
58
|
+
</Grid>
|
|
59
|
+
</Grid>
|
|
60
|
+
<Divider sx={{ my: 2 }} />
|
|
61
|
+
</Box>
|
|
62
|
+
</SimpleShowLayout>
|
|
63
|
+
<TabbedShowLayout>
|
|
64
|
+
<Tab label="Orders">
|
|
65
|
+
<ReferenceManyField reference="Order" target="country_city" addLabel={false} pagination={<Pagination />}>
|
|
66
|
+
<Datagrid rowClick="show">
|
|
67
|
+
<TextField source="id" label="Order ID" />
|
|
68
|
+
<TextField source="ShipName" label="Ship Name" />
|
|
69
|
+
<TextField source="AmountTotal" label="Amount Total" />
|
|
70
|
+
</Datagrid>
|
|
71
|
+
</ReferenceManyField>
|
|
72
|
+
<AddOrderButton />
|
|
73
|
+
</Tab>
|
|
74
|
+
</TabbedShowLayout>
|
|
75
|
+
</Show>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// Custom Add Order Button
|
|
80
|
+
const AddOrderButton = () => {
|
|
81
|
+
const record = useRecordContext();
|
|
82
|
+
const redirect = useRedirect();
|
|
83
|
+
|
|
84
|
+
const handleClick = () => {
|
|
85
|
+
redirect(`/Order/create?source=${encodeURIComponent(JSON.stringify({ country: record?.country, city: record?.city }))}`);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<Button
|
|
90
|
+
variant="contained"
|
|
91
|
+
color="primary"
|
|
92
|
+
startIcon={<AddIcon />}
|
|
93
|
+
onClick={handleClick}
|
|
94
|
+
sx={{ mt: 2 }}
|
|
95
|
+
>
|
|
96
|
+
Add New Order
|
|
97
|
+
</Button>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// Location Create
|
|
102
|
+
export const LocationCreate = (props) => {
|
|
103
|
+
return (
|
|
104
|
+
<Create {...props}>
|
|
105
|
+
<SimpleForm>
|
|
106
|
+
<Box sx={{ mb: 3 }}>
|
|
107
|
+
<Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
|
|
108
|
+
Create New Location
|
|
109
|
+
</Typography>
|
|
110
|
+
<Grid container spacing={3} sx={{ mb: 2 }}>
|
|
111
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
112
|
+
<Box sx={{ p: 1 }}>
|
|
113
|
+
<TextInput source="country" label="Country" fullWidth validate={required()} />
|
|
114
|
+
</Box>
|
|
115
|
+
</Grid>
|
|
116
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
117
|
+
<Box sx={{ p: 1 }}>
|
|
118
|
+
<TextInput source="city" label="City" fullWidth validate={required()} />
|
|
119
|
+
</Box>
|
|
120
|
+
</Grid>
|
|
121
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
122
|
+
<Box sx={{ p: 1 }}>
|
|
123
|
+
<TextInput source="notes" label="Notes" fullWidth />
|
|
124
|
+
</Box>
|
|
125
|
+
</Grid>
|
|
126
|
+
</Grid>
|
|
127
|
+
</Box>
|
|
128
|
+
</SimpleForm>
|
|
129
|
+
</Create>
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// Location Edit
|
|
134
|
+
export const LocationEdit = (props) => {
|
|
135
|
+
return (
|
|
136
|
+
<Edit {...props} redirect={false}>
|
|
137
|
+
<SimpleForm>
|
|
138
|
+
<Box sx={{ mb: 3 }}>
|
|
139
|
+
<Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
|
|
140
|
+
Edit Location
|
|
141
|
+
</Typography>
|
|
142
|
+
<Grid container spacing={3} sx={{ mb: 2 }}>
|
|
143
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
144
|
+
<Box sx={{ p: 1 }}>
|
|
145
|
+
<TextInput source="country" label="Country" fullWidth validate={required()} />
|
|
146
|
+
</Box>
|
|
147
|
+
</Grid>
|
|
148
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
149
|
+
<Box sx={{ p: 1 }}>
|
|
150
|
+
<TextInput source="city" label="City" fullWidth validate={required()} />
|
|
151
|
+
</Box>
|
|
152
|
+
</Grid>
|
|
153
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
154
|
+
<Box sx={{ p: 1 }}>
|
|
155
|
+
<TextInput source="notes" label="Notes" fullWidth />
|
|
156
|
+
</Box>
|
|
157
|
+
</Grid>
|
|
158
|
+
</Grid>
|
|
159
|
+
</Box>
|
|
160
|
+
</SimpleForm>
|
|
161
|
+
</Edit>
|
|
162
|
+
);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export default {
|
|
166
|
+
list: LocationList,
|
|
167
|
+
show: LocationShow,
|
|
168
|
+
create: LocationCreate,
|
|
169
|
+
edit: LocationEdit,
|
|
170
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// begin MANDATORY imports (always generated EXACTLY)
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { List, FunctionField, Datagrid, TextField, EmailField, DateField, NumberField } from 'react-admin';
|
|
4
|
+
import { ReferenceField, ReferenceManyField } from 'react-admin';
|
|
5
|
+
import { TabbedShowLayout, Tab, SimpleShowLayout, TextInput, NumberInput, DateTimeInput } from 'react-admin';
|
|
6
|
+
import { ReferenceInput, SelectInput, SimpleForm, Show, Edit, Create } from 'react-admin';
|
|
7
|
+
import { Filter, Pagination, BooleanField, BooleanInput, Labeled } from 'react-admin';
|
|
8
|
+
import { EditButton, DeleteButton, CreateButton, ShowButton } from 'react-admin';
|
|
9
|
+
import { Grid, Typography, Box, Divider, Button } from '@mui/material';
|
|
10
|
+
import { useRecordContext, useRedirect, Link, required } from 'react-admin';
|
|
11
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
12
|
+
// end mandatory imports
|
|
13
|
+
|
|
14
|
+
const OrderFilter = (props) => (
|
|
15
|
+
<Filter {...props}>
|
|
16
|
+
<TextInput label="Search" source="ShipName" alwaysOn />
|
|
17
|
+
<BooleanInput label="Ready" source="Ready" />
|
|
18
|
+
</Filter>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// Order List
|
|
22
|
+
export const OrderList = (props) => {
|
|
23
|
+
return (
|
|
24
|
+
<List filters={<OrderFilter />} {...props} sort={{ field: 'OrderDate', order: 'DESC' }} pagination={<Pagination rowsPerPageOptions={[5, 10, 25]} showFirstLastButtons />}>
|
|
25
|
+
<Datagrid rowClick="show">
|
|
26
|
+
<TextField source="Id" label="Order ID" />
|
|
27
|
+
<ReferenceField label="Customer" source="CustomerId" reference="Customer">
|
|
28
|
+
<TextField source="CompanyName" />
|
|
29
|
+
</ReferenceField>
|
|
30
|
+
<DateField source="OrderDate" label="Order Date" />
|
|
31
|
+
<NumberField source="AmountTotal" label="Amount Total" options={{ style: 'currency', currency: 'USD' }} />
|
|
32
|
+
<BooleanField source="Ready" label="Ready" />
|
|
33
|
+
<EditButton />
|
|
34
|
+
<DeleteButton />
|
|
35
|
+
</Datagrid>
|
|
36
|
+
</List>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// Order Show
|
|
41
|
+
export const OrderShow = (props) => {
|
|
42
|
+
return (
|
|
43
|
+
<Show {...props}>
|
|
44
|
+
<TabbedShowLayout>
|
|
45
|
+
<Tab label="Summary">
|
|
46
|
+
<SimpleShowLayout>
|
|
47
|
+
<Box sx={{ mb: 3 }}>
|
|
48
|
+
<Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
|
|
49
|
+
Order Information
|
|
50
|
+
</Typography>
|
|
51
|
+
<Grid container spacing={3} sx={{ mb: 2 }}>
|
|
52
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
53
|
+
<Box sx={{ p: 1 }}>
|
|
54
|
+
<Labeled label="Order ID">
|
|
55
|
+
<TextField source="Id" />
|
|
56
|
+
</Labeled>
|
|
57
|
+
</Box>
|
|
58
|
+
</Grid>
|
|
59
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
60
|
+
<Box sx={{ p: 1 }}>
|
|
61
|
+
<Labeled label="Order Date">
|
|
62
|
+
<DateField source="OrderDate" />
|
|
63
|
+
</Labeled>
|
|
64
|
+
</Box>
|
|
65
|
+
</Grid>
|
|
66
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
67
|
+
<Box sx={{ p: 1 }}>
|
|
68
|
+
<ReferenceField label="Customer" source="CustomerId" reference="Customer">
|
|
69
|
+
<TextField source="CompanyName" />
|
|
70
|
+
</ReferenceField>
|
|
71
|
+
</Box>
|
|
72
|
+
</Grid>
|
|
73
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
74
|
+
<Box sx={{ p: 1 }}>
|
|
75
|
+
<Labeled label="Amount Total">
|
|
76
|
+
<NumberField source="AmountTotal" options={{ style: 'currency', currency: 'USD' }} />
|
|
77
|
+
</Labeled>
|
|
78
|
+
</Box>
|
|
79
|
+
</Grid>
|
|
80
|
+
</Grid>
|
|
81
|
+
<Divider sx={{ my: 2 }} />
|
|
82
|
+
</Box>
|
|
83
|
+
</SimpleShowLayout>
|
|
84
|
+
</Tab>
|
|
85
|
+
<Tab label="Order Details">
|
|
86
|
+
<ReferenceManyField reference="OrderDetail" target="OrderId" addLabel={false} pagination={<Pagination />}>
|
|
87
|
+
<Datagrid rowClick="edit">
|
|
88
|
+
<TextField source="Id" label="Detail ID" />
|
|
89
|
+
<ReferenceField label="Product" source="ProductId" reference="Product">
|
|
90
|
+
<TextField source="ProductName" />
|
|
91
|
+
</ReferenceField>
|
|
92
|
+
<NumberField source="Quantity" label="Quantity" />
|
|
93
|
+
<NumberField source="UnitPrice" label="Unit Price" options={{ style: 'currency', currency: 'USD' }} />
|
|
94
|
+
<EditButton />
|
|
95
|
+
<DeleteButton />
|
|
96
|
+
</Datagrid>
|
|
97
|
+
</ReferenceManyField>
|
|
98
|
+
</Tab>
|
|
99
|
+
</TabbedShowLayout>
|
|
100
|
+
</Show>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// Order Create
|
|
105
|
+
export const OrderCreate = (props) => {
|
|
106
|
+
return (
|
|
107
|
+
<Create {...props}>
|
|
108
|
+
<SimpleForm>
|
|
109
|
+
<Box sx={{ mb: 3 }}>
|
|
110
|
+
<Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
|
|
111
|
+
Create New Order
|
|
112
|
+
</Typography>
|
|
113
|
+
<Grid container spacing={3} sx={{ mb: 2 }}>
|
|
114
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
115
|
+
<Box sx={{ p: 1 }}>
|
|
116
|
+
<ReferenceInput source="CustomerId" reference="Customer" fullWidth>
|
|
117
|
+
<SelectInput optionText="CompanyName" validate={required()} />
|
|
118
|
+
</ReferenceInput>
|
|
119
|
+
</Box>
|
|
120
|
+
</Grid>
|
|
121
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
122
|
+
<Box sx={{ p: 1 }}>
|
|
123
|
+
<DateTimeInput label="Order Date" source="OrderDate" fullWidth />
|
|
124
|
+
</Box>
|
|
125
|
+
</Grid>
|
|
126
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
127
|
+
<Box sx={{ p: 1 }}>
|
|
128
|
+
<NumberInput source="Freight" label="Freight" fullWidth />
|
|
129
|
+
</Box>
|
|
130
|
+
</Grid>
|
|
131
|
+
</Grid>
|
|
132
|
+
</Box>
|
|
133
|
+
<BooleanInput source="Ready" label="Ready" />
|
|
134
|
+
</SimpleForm>
|
|
135
|
+
</Create>
|
|
136
|
+
);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// Order Edit
|
|
140
|
+
export const OrderEdit = (props) => {
|
|
141
|
+
return (
|
|
142
|
+
<Edit {...props} redirect={false}>
|
|
143
|
+
<SimpleForm>
|
|
144
|
+
<Box sx={{ mb: 3 }}>
|
|
145
|
+
<Typography variant="h5" component="h2" sx={{ mb: 2, fontWeight: 'bold' }}>
|
|
146
|
+
Edit Order
|
|
147
|
+
</Typography>
|
|
148
|
+
<Grid container spacing={3} sx={{ mb: 2 }}>
|
|
149
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
150
|
+
<Box sx={{ p: 1 }}>
|
|
151
|
+
<ReferenceInput source="CustomerId" reference="Customer" fullWidth>
|
|
152
|
+
<SelectInput optionText="CompanyName" validate={required()} />
|
|
153
|
+
</ReferenceInput>
|
|
154
|
+
</Box>
|
|
155
|
+
</Grid>
|
|
156
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
157
|
+
<Box sx={{ p: 1 }}>
|
|
158
|
+
<DateTimeInput label="Order Date" source="OrderDate" fullWidth />
|
|
159
|
+
</Box>
|
|
160
|
+
</Grid>
|
|
161
|
+
<Grid item xs={12} sm={6} md={4}>
|
|
162
|
+
<Box sx={{ p: 1 }}>
|
|
163
|
+
<NumberInput source="Freight" label="Freight" fullWidth />
|
|
164
|
+
</Box>
|
|
165
|
+
</Grid>
|
|
166
|
+
</Grid>
|
|
167
|
+
</Box>
|
|
168
|
+
<BooleanInput source="Ready" label="Ready" />
|
|
169
|
+
</SimpleForm>
|
|
170
|
+
</Edit>
|
|
171
|
+
);
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export default {
|
|
175
|
+
list: OrderList,
|
|
176
|
+
show: OrderShow,
|
|
177
|
+
create: OrderCreate,
|
|
178
|
+
edit: OrderEdit,
|
|
179
|
+
};
|