ApiLogicServer 15.0.12__py3-none-any.whl → 15.0.19__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 -1
- api_logic_server_cli/api_logic_server_info.yaml +2 -2
- api_logic_server_cli/cli.py +44 -1
- api_logic_server_cli/create_from_model/__pycache__/api_logic_server_utils.cpython-312.pyc +0 -0
- api_logic_server_cli/create_from_model/api_logic_server_utils.py +14 -0
- api_logic_server_cli/genai/genai_admin_app copy.py +150 -0
- api_logic_server_cli/genai/genai_admin_app.py +155 -0
- api_logic_server_cli/genai/genai_svcs.py +49 -10
- api_logic_server_cli/logging.yml +5 -0
- api_logic_server_cli/prototypes/base/config/config.py +9 -15
- api_logic_server_cli/prototypes/base/docs/training/admin_app_1_context.prompt.md +3 -0
- api_logic_server_cli/prototypes/base/docs/training/admin_app_2_functionality.prompt.md +69 -0
- api_logic_server_cli/prototypes/base/docs/training/admin_app_3_architecture.prompt.md +29 -0
- api_logic_server_cli/prototypes/base/docs/training/admin_app_unused.md +156 -0
- api_logic_server_cli/prototypes/base/integration/mcp/mcp_client_executor.py +15 -12
- api_logic_server_cli/prototypes/basic_demo/customizations/docs/mcp_learning/mcp_discovery.json +108 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-App-Learning-Prompt.md +154 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/notes.md +7 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/.DS_Store +0 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/README.md +17 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/README_create_react_app.md +70 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/package-lock.json +18469 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/package.json +44 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/public/favicon.ico +0 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/public/index.html +43 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/public/logo192.png +0 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/public/logo512.png +0 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/public/manifest.json +25 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/public/robots.txt +3 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/App.css +38 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/App.js +25 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/App.test.js +8 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/dataProvider.js +110 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/index.css +13 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/index.js +17 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/logo.svg +1 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/reportWebVitals.js +13 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/setupTests.js +5 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/.DS_Store +0 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/README.md +19 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/README_create_react_app.md +70 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/package-lock.json +18469 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/package.json +44 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/public/favicon.ico +0 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/public/index.html +43 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/public/logo192.png +0 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/public/logo512.png +0 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/public/manifest.json +25 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/public/robots.txt +3 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/App.css +38 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/App.js +59 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/App.test.js +8 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Category.js +82 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Customer.js +116 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/CustomerDemographic.js +74 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Department.js +99 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Employee.js +149 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeAudit.js +94 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeTerritory.js +98 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Location.js +91 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Order.js +116 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/OrderDetail.js +121 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Product.js +105 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Region.js +70 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Shipper.js +64 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Supplier.js +103 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Territory.js +84 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Union.js +77 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/dataProvider.js +110 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/index.css +13 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/index.js +17 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/logo.svg +1 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/reportWebVitals.js +13 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/setupTests.js +5 -0
- {apilogicserver-15.0.12.dist-info → apilogicserver-15.0.19.dist-info}/METADATA +1 -1
- {apilogicserver-15.0.12.dist-info → apilogicserver-15.0.19.dist-info}/RECORD +80 -15
- {apilogicserver-15.0.12.dist-info → apilogicserver-15.0.19.dist-info}/WHEEL +0 -0
- {apilogicserver-15.0.12.dist-info → apilogicserver-15.0.19.dist-info}/entry_points.txt +0 -0
- {apilogicserver-15.0.12.dist-info → apilogicserver-15.0.19.dist-info}/licenses/LICENSE +0 -0
- {apilogicserver-15.0.12.dist-info → apilogicserver-15.0.19.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
```javascript
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
List,
|
|
5
|
+
Datagrid,
|
|
6
|
+
TextField,
|
|
7
|
+
NumberField,
|
|
8
|
+
ReferenceField,
|
|
9
|
+
Show,
|
|
10
|
+
SimpleShowLayout,
|
|
11
|
+
TabbedShowLayout,
|
|
12
|
+
Tab,
|
|
13
|
+
TextInput,
|
|
14
|
+
NumberInput,
|
|
15
|
+
ReferenceInput,
|
|
16
|
+
SelectInput,
|
|
17
|
+
Create,
|
|
18
|
+
SimpleForm,
|
|
19
|
+
Edit,
|
|
20
|
+
Filter,
|
|
21
|
+
DateField,
|
|
22
|
+
ReferenceManyField,
|
|
23
|
+
BooleanField,
|
|
24
|
+
BooleanInput,
|
|
25
|
+
ImageField
|
|
26
|
+
} from 'react-admin';
|
|
27
|
+
|
|
28
|
+
const EmployeeFilter = (props) => (
|
|
29
|
+
<Filter {...props}>
|
|
30
|
+
<TextInput label="Search" source="q" alwaysOn />
|
|
31
|
+
<TextInput label="Last Name" source="LastName" />
|
|
32
|
+
<ReferenceInput label="Department" source="WorksForDepartmentId" reference="Department" allowEmpty>
|
|
33
|
+
<SelectInput optionText="name" />
|
|
34
|
+
</ReferenceInput>
|
|
35
|
+
</Filter>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const EmployeeList = (props) => (
|
|
39
|
+
<List filters={<EmployeeFilter />} {...props}>
|
|
40
|
+
<Datagrid rowClick="show">
|
|
41
|
+
<TextField source="LastName" label="Last Name" />
|
|
42
|
+
<TextField source="FirstName" label="First Name" />
|
|
43
|
+
<TextField source="Title" />
|
|
44
|
+
<TextField source="Email" />
|
|
45
|
+
<NumberField source="Salary" label="Salary" options={{ style: 'currency', currency: 'USD' }} />
|
|
46
|
+
<TextField source="EmployeeType" label="Employee Type" />
|
|
47
|
+
<ImageField source="PhotoPath" label="Photo" />
|
|
48
|
+
<NumberField source="ProperSalary" label="Proper Salary" options={{ style: 'currency', currency: 'USD' }}/>
|
|
49
|
+
<DateField source="HireDate" label="Hire Date" />
|
|
50
|
+
</Datagrid>
|
|
51
|
+
</List>
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const EmployeeShow = (props) => (
|
|
55
|
+
<Show {...props}>
|
|
56
|
+
<SimpleShowLayout>
|
|
57
|
+
<TextField source="LastName" label="Last Name" />
|
|
58
|
+
<TextField source="FirstName" label="First Name" />
|
|
59
|
+
<TextField source="Title" />
|
|
60
|
+
<TextField source="Email" />
|
|
61
|
+
<NumberField source="Salary" label="Salary" options={{ style: 'currency', currency: 'USD' }} />
|
|
62
|
+
<TextField source="EmployeeType" label="Employee Type" />
|
|
63
|
+
<ImageField source="PhotoPath" label="Photo" />
|
|
64
|
+
<NumberField source="ProperSalary" label="Proper Salary" options={{ style: 'currency', currency: 'USD' }}/>
|
|
65
|
+
<DateField source="HireDate" label="Hire Date" />
|
|
66
|
+
<TextField source="Notes" label="Notes" />
|
|
67
|
+
</SimpleShowLayout>
|
|
68
|
+
<TabbedShowLayout>
|
|
69
|
+
<Tab label="Audits">
|
|
70
|
+
<ReferenceManyField reference="EmployeeAudit" target="EmployeeId" label="Employee Audits">
|
|
71
|
+
<Datagrid>
|
|
72
|
+
<TextField source="Title" />
|
|
73
|
+
<TextField source="CreatedOn" label="Created On" />
|
|
74
|
+
</Datagrid>
|
|
75
|
+
</ReferenceManyField>
|
|
76
|
+
</Tab>
|
|
77
|
+
<Tab label="Territories">
|
|
78
|
+
<ReferenceManyField reference="EmployeeTerritory" target="EmployeeId" label="Territories">
|
|
79
|
+
<Datagrid>
|
|
80
|
+
<ReferenceField label="Territory Description" source="TerritoryId" reference="Territory">
|
|
81
|
+
<TextField source="TerritoryDescription" />
|
|
82
|
+
</ReferenceField>
|
|
83
|
+
</Datagrid>
|
|
84
|
+
</ReferenceManyField>
|
|
85
|
+
</Tab>
|
|
86
|
+
<Tab label="Orders">
|
|
87
|
+
<ReferenceManyField reference="Order" target="EmployeeId" label="Orders">
|
|
88
|
+
<Datagrid>
|
|
89
|
+
<TextField source="ShipName" />
|
|
90
|
+
<DateField source="OrderDate" />
|
|
91
|
+
<NumberField source="AmountTotal" options={{ style: 'currency', currency: 'USD' }} />
|
|
92
|
+
</Datagrid>
|
|
93
|
+
</ReferenceManyField>
|
|
94
|
+
</Tab>
|
|
95
|
+
</TabbedShowLayout>
|
|
96
|
+
</Show>
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const EmployeeEdit = (props) => (
|
|
100
|
+
<Edit {...props}>
|
|
101
|
+
<SimpleForm>
|
|
102
|
+
<TextInput source="LastName" label="Last Name" />
|
|
103
|
+
<TextInput source="FirstName" label="First Name" />
|
|
104
|
+
<TextInput source="Title" />
|
|
105
|
+
<TextInput source="Email" />
|
|
106
|
+
<NumberInput source="Salary" label="Salary" />
|
|
107
|
+
<SelectInput source="EmployeeType" choices={[
|
|
108
|
+
{ id: 'Salaried', name: 'Salaried' },
|
|
109
|
+
{ id: 'Hourly', name: 'Hourly' }
|
|
110
|
+
]} />
|
|
111
|
+
<ImageField source="PhotoPath" label="Photo" />
|
|
112
|
+
<DateField source="HireDate" label="Hire Date" />
|
|
113
|
+
<TextInput multiline source="Notes" label="Notes" />
|
|
114
|
+
<ReferenceInput label="On Loan Department" source="OnLoanDepartmentId" reference="Department">
|
|
115
|
+
<SelectInput optionText="DepartmentName" />
|
|
116
|
+
</ReferenceInput>
|
|
117
|
+
<ReferenceInput label="Works For Department" source="WorksForDepartmentId" reference="Department">
|
|
118
|
+
<SelectInput optionText="DepartmentName" />
|
|
119
|
+
</ReferenceInput>
|
|
120
|
+
</SimpleForm>
|
|
121
|
+
</Edit>
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
const EmployeeCreate = (props) => (
|
|
125
|
+
<Create {...props}>
|
|
126
|
+
<SimpleForm>
|
|
127
|
+
<TextInput source="LastName" label="Last Name*" />
|
|
128
|
+
<TextInput source="FirstName" label="First Name" />
|
|
129
|
+
<TextInput source="Title" />
|
|
130
|
+
<TextInput source="Email" />
|
|
131
|
+
<NumberInput source="Salary" label="Salary" />
|
|
132
|
+
<SelectInput source="EmployeeType" choices={[
|
|
133
|
+
{ id: 'Salaried', name: 'Salaried' },
|
|
134
|
+
{ id: 'Hourly', name: 'Hourly' }
|
|
135
|
+
]} />
|
|
136
|
+
<DateField source="HireDate" label="Hire Date" />
|
|
137
|
+
<TextInput multiline source="Notes" label="Notes" />
|
|
138
|
+
<ReferenceInput label="On Loan Department" source="OnLoanDepartmentId" reference="Department">
|
|
139
|
+
<SelectInput optionText="DepartmentName" />
|
|
140
|
+
</ReferenceInput>
|
|
141
|
+
<ReferenceInput label="Works For Department" source="WorksForDepartmentId" reference="Department">
|
|
142
|
+
<SelectInput optionText="DepartmentName" />
|
|
143
|
+
</ReferenceInput>
|
|
144
|
+
</SimpleForm>
|
|
145
|
+
</Create>
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
export { EmployeeList, EmployeeShow, EmployeeEdit, EmployeeCreate };
|
|
149
|
+
```
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
```jsx
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
List, FunctionField, Datagrid, TextField, DateField, NumberField,
|
|
5
|
+
ReferenceField, ReferenceManyField, Show, TabbedShowLayout, Tab,
|
|
6
|
+
SimpleShowLayout, TextInput, NumberInput, DateTimeInput, ReferenceInput,
|
|
7
|
+
SelectInput, Create, SimpleForm, Edit, Filter, Pagination, BooleanField, BooleanInput
|
|
8
|
+
} from 'react-admin';
|
|
9
|
+
|
|
10
|
+
// EmployeeAudit List Component
|
|
11
|
+
export const EmployeeAuditList = (props) => (
|
|
12
|
+
<List {...props} filters={<EmployeeAuditFilter />} perPage={7} pagination={<Pagination />}>
|
|
13
|
+
<Datagrid rowClick="show">
|
|
14
|
+
<TextField source="LastName" label="Last Name" />
|
|
15
|
+
<TextField source="Title" />
|
|
16
|
+
<NumberField source="Salary" options={{ style: 'currency', currency: 'USD' }} />
|
|
17
|
+
<TextField source="CreatedBy" />
|
|
18
|
+
<DateField source="CreatedOn" showTime />
|
|
19
|
+
<TextField source="UpdatedBy" />
|
|
20
|
+
<DateField source="UpdatedOn" showTime />
|
|
21
|
+
</Datagrid>
|
|
22
|
+
</List>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
// EmployeeAudit Show Component
|
|
26
|
+
export const EmployeeAuditShow = (props) => (
|
|
27
|
+
<Show {...props}>
|
|
28
|
+
<TabbedShowLayout>
|
|
29
|
+
<Tab label="Summary">
|
|
30
|
+
<SimpleShowLayout>
|
|
31
|
+
<TextField source="LastName" label="Last Name" />
|
|
32
|
+
<TextField source="Title" />
|
|
33
|
+
<NumberField source="Salary" options={{ style: 'currency', currency: 'USD' }} />
|
|
34
|
+
<TextField source="FirstName" />
|
|
35
|
+
<TextField source="CreatedBy" />
|
|
36
|
+
<DateField source="CreatedOn" showTime />
|
|
37
|
+
<TextField source="UpdatedBy" />
|
|
38
|
+
<DateField source="UpdatedOn" showTime />
|
|
39
|
+
</SimpleShowLayout>
|
|
40
|
+
</Tab>
|
|
41
|
+
<Tab label="Employee">
|
|
42
|
+
<ReferenceManyField reference="Employee" target="EmployeeId" addLabel={false}>
|
|
43
|
+
<Datagrid rowClick="show">
|
|
44
|
+
<TextField source="LastName" />
|
|
45
|
+
<TextField source="FirstName" />
|
|
46
|
+
<TextField source="Title" />
|
|
47
|
+
</Datagrid>
|
|
48
|
+
</ReferenceManyField>
|
|
49
|
+
</Tab>
|
|
50
|
+
</TabbedShowLayout>
|
|
51
|
+
</Show>
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
// EmployeeAudit Filter Component (used in EmployeeAuditList)
|
|
55
|
+
const EmployeeAuditFilter = (props) => (
|
|
56
|
+
<Filter {...props}>
|
|
57
|
+
<TextInput label="Search by Last Name" source="LastName" alwaysOn />
|
|
58
|
+
<TextInput label="Title" source="Title" />
|
|
59
|
+
<DateTimeInput label="Creation Date" source="CreatedOn" />
|
|
60
|
+
</Filter>
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// EmployeeAudit Create Component
|
|
64
|
+
export const EmployeeAuditCreate = (props) => (
|
|
65
|
+
<Create {...props}>
|
|
66
|
+
<SimpleForm>
|
|
67
|
+
<TextInput source="LastName" label="Last Name" />
|
|
68
|
+
<TextInput source="Title" />
|
|
69
|
+
<NumberInput source="Salary" label="Salary" />
|
|
70
|
+
<TextInput source="FirstName" />
|
|
71
|
+
<TextInput source="CreatedBy" />
|
|
72
|
+
<DateTimeInput source="CreatedOn" />
|
|
73
|
+
<TextInput source="UpdatedBy" />
|
|
74
|
+
<DateTimeInput source="UpdatedOn" />
|
|
75
|
+
</SimpleForm>
|
|
76
|
+
</Create>
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
// EmployeeAudit Edit Component
|
|
80
|
+
export const EmployeeAuditEdit = (props) => (
|
|
81
|
+
<Edit {...props}>
|
|
82
|
+
<SimpleForm>
|
|
83
|
+
<TextInput source="LastName" label="Last Name" />
|
|
84
|
+
<TextInput source="Title" />
|
|
85
|
+
<NumberInput source="Salary" label="Salary" />
|
|
86
|
+
<TextInput source="FirstName" />
|
|
87
|
+
<TextInput source="CreatedBy" />
|
|
88
|
+
<DateTimeInput source="CreatedOn" />
|
|
89
|
+
<TextInput source="UpdatedBy" />
|
|
90
|
+
<DateTimeInput source="UpdatedOn" />
|
|
91
|
+
</SimpleForm>
|
|
92
|
+
</Edit>
|
|
93
|
+
);
|
|
94
|
+
```
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
```jsx
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
List,
|
|
5
|
+
Datagrid,
|
|
6
|
+
TextField,
|
|
7
|
+
ReferenceField,
|
|
8
|
+
Show,
|
|
9
|
+
SimpleShowLayout,
|
|
10
|
+
TabbedShowLayout,
|
|
11
|
+
Tab,
|
|
12
|
+
Create,
|
|
13
|
+
SimpleForm,
|
|
14
|
+
ReferenceInput,
|
|
15
|
+
SelectInput,
|
|
16
|
+
TextInput,
|
|
17
|
+
Edit
|
|
18
|
+
} from 'react-admin';
|
|
19
|
+
import { Card, CardContent } from '@mui/material';
|
|
20
|
+
|
|
21
|
+
// List view for EmployeeTerritory
|
|
22
|
+
export const EmployeeTerritoryList = (props) => (
|
|
23
|
+
<List {...props} perPage={7} title="Employee Territories">
|
|
24
|
+
<Datagrid rowClick="show">
|
|
25
|
+
<TextField source="Id" label="ID" />
|
|
26
|
+
<ReferenceField source="TerritoryId" reference="Territory" label="Territory Description">
|
|
27
|
+
<TextField source="TerritoryDescription" />
|
|
28
|
+
</ReferenceField>
|
|
29
|
+
<ReferenceField source="EmployeeId" reference="Employee" label="Employee Last Name">
|
|
30
|
+
<TextField source="LastName" />
|
|
31
|
+
</ReferenceField>
|
|
32
|
+
</Datagrid>
|
|
33
|
+
</List>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
// Show view for EmployeeTerritory
|
|
37
|
+
export const EmployeeTerritoryShow = (props) => (
|
|
38
|
+
<Show {...props} title="Employee Territory">
|
|
39
|
+
<SimpleShowLayout>
|
|
40
|
+
<TextField source="Id" label="ID" />
|
|
41
|
+
<ReferenceField source="TerritoryId" reference="Territory" label="Territory Description">
|
|
42
|
+
<TextField source="TerritoryDescription" />
|
|
43
|
+
</ReferenceField>
|
|
44
|
+
<ReferenceField source="EmployeeId" reference="Employee" label="Employee Last Name">
|
|
45
|
+
<TextField source="LastName" />
|
|
46
|
+
</ReferenceField>
|
|
47
|
+
|
|
48
|
+
{/* Tabs for related data */}
|
|
49
|
+
<Card>
|
|
50
|
+
<CardContent>
|
|
51
|
+
<TabbedShowLayout>
|
|
52
|
+
<Tab label="Territory">
|
|
53
|
+
<ReferenceField source="TerritoryId" reference="Territory" label="Territory Description">
|
|
54
|
+
<TextField source="TerritoryDescription" />
|
|
55
|
+
</ReferenceField>
|
|
56
|
+
</Tab>
|
|
57
|
+
<Tab label="Employee">
|
|
58
|
+
<ReferenceField source="EmployeeId" reference="Employee" label="Employee Last Name">
|
|
59
|
+
<TextField source="LastName" />
|
|
60
|
+
</ReferenceField>
|
|
61
|
+
</Tab>
|
|
62
|
+
</TabbedShowLayout>
|
|
63
|
+
</CardContent>
|
|
64
|
+
</Card>
|
|
65
|
+
</SimpleShowLayout>
|
|
66
|
+
</Show>
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
// Create view for EmployeeTerritory
|
|
70
|
+
export const EmployeeTerritoryCreate = (props) => (
|
|
71
|
+
<Create {...props} title="Create a new Employee Territory">
|
|
72
|
+
<SimpleForm>
|
|
73
|
+
<ReferenceInput source="TerritoryId" reference="Territory" label="Territory Description">
|
|
74
|
+
<SelectInput optionText="TerritoryDescription" />
|
|
75
|
+
</ReferenceInput>
|
|
76
|
+
<ReferenceInput source="EmployeeId" reference="Employee" label="Employee Last Name">
|
|
77
|
+
<SelectInput optionText="LastName" />
|
|
78
|
+
</ReferenceInput>
|
|
79
|
+
<TextInput source="Id" disabled label="ID" />
|
|
80
|
+
</SimpleForm>
|
|
81
|
+
</Create>
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
// Edit view for EmployeeTerritory
|
|
85
|
+
export const EmployeeTerritoryEdit = (props) => (
|
|
86
|
+
<Edit {...props} title="Edit Employee Territory">
|
|
87
|
+
<SimpleForm>
|
|
88
|
+
<TextInput source="Id" disabled label="ID" />
|
|
89
|
+
<ReferenceInput source="TerritoryId" reference="Territory" label="Territory Description">
|
|
90
|
+
<SelectInput optionText="TerritoryDescription" />
|
|
91
|
+
</ReferenceInput>
|
|
92
|
+
<ReferenceInput source="EmployeeId" reference="Employee" label="Employee Last Name">
|
|
93
|
+
<SelectInput optionText="LastName" />
|
|
94
|
+
</ReferenceInput>
|
|
95
|
+
</SimpleForm>
|
|
96
|
+
</Edit>
|
|
97
|
+
);
|
|
98
|
+
```
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
List,
|
|
4
|
+
Datagrid,
|
|
5
|
+
TextField,
|
|
6
|
+
EditButton,
|
|
7
|
+
ShowButton,
|
|
8
|
+
SimpleShowLayout,
|
|
9
|
+
TabbedShowLayout,
|
|
10
|
+
Tab,
|
|
11
|
+
Show,
|
|
12
|
+
Create,
|
|
13
|
+
Edit,
|
|
14
|
+
SimpleForm,
|
|
15
|
+
TextInput,
|
|
16
|
+
ReferenceManyField,
|
|
17
|
+
ReferenceInput,
|
|
18
|
+
SelectInput,
|
|
19
|
+
required,
|
|
20
|
+
Filter,
|
|
21
|
+
Pagination,
|
|
22
|
+
} from 'react-admin';
|
|
23
|
+
import { Box } from '@mui/material';
|
|
24
|
+
|
|
25
|
+
const LocationFilter = (props) => (
|
|
26
|
+
<Filter {...props}>
|
|
27
|
+
<TextInput label="Search" source="q" alwaysOn />
|
|
28
|
+
<TextInput label="Country" source="country" defaultValue="" />
|
|
29
|
+
</Filter>
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
export const LocationList = props => (
|
|
33
|
+
<List filters={<LocationFilter />} pagination={<Pagination rowsPerPageOptions={[5, 10, 25, 50]} />} {...props}>
|
|
34
|
+
<Datagrid rowClick="show">
|
|
35
|
+
<TextField source="country" label="Country" sortable={true} />
|
|
36
|
+
<TextField source="city" label="City" />
|
|
37
|
+
<TextField source="notes" label="Notes" />
|
|
38
|
+
<EditButton />
|
|
39
|
+
<ShowButton />
|
|
40
|
+
</Datagrid>
|
|
41
|
+
</List>
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
export const LocationShow = props => (
|
|
45
|
+
<Show {...props}>
|
|
46
|
+
<TabbedShowLayout>
|
|
47
|
+
<Tab label="Details">
|
|
48
|
+
<SimpleShowLayout>
|
|
49
|
+
<TextField source="country" label="Country" />
|
|
50
|
+
<TextField source="city" label="City" />
|
|
51
|
+
<TextField source="notes" label="Notes" />
|
|
52
|
+
</SimpleShowLayout>
|
|
53
|
+
</Tab>
|
|
54
|
+
<Tab label="Orders">
|
|
55
|
+
<ReferenceManyField
|
|
56
|
+
reference="Order"
|
|
57
|
+
target="Location"
|
|
58
|
+
label="Orders in this Location"
|
|
59
|
+
pagination={<Pagination rowsPerPageOptions={[5, 10, 25, 50]} />}
|
|
60
|
+
>
|
|
61
|
+
<Datagrid>
|
|
62
|
+
<TextField source="id" label="Order ID" />
|
|
63
|
+
<TextField source="shipName" label="Ship Name" />
|
|
64
|
+
<TextField source="orderDate" label="Order Date" />
|
|
65
|
+
<ShowButton />
|
|
66
|
+
</Datagrid>
|
|
67
|
+
</ReferenceManyField>
|
|
68
|
+
</Tab>
|
|
69
|
+
</TabbedShowLayout>
|
|
70
|
+
</Show>
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
export const LocationCreate = props => (
|
|
74
|
+
<Create {...props}>
|
|
75
|
+
<SimpleForm>
|
|
76
|
+
<TextInput source="country" label="Country" validate={required()} />
|
|
77
|
+
<TextInput source="city" label="City" validate={required()} />
|
|
78
|
+
<TextInput source="notes" label="Notes" />
|
|
79
|
+
</SimpleForm>
|
|
80
|
+
</Create>
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
export const LocationEdit = props => (
|
|
84
|
+
<Edit {...props}>
|
|
85
|
+
<SimpleForm>
|
|
86
|
+
<TextInput source="country" label="Country" validate={required()} />
|
|
87
|
+
<TextInput source="city" label="City" validate={required()} />
|
|
88
|
+
<TextInput source="notes" label="Notes" />
|
|
89
|
+
</SimpleForm>
|
|
90
|
+
</Edit>
|
|
91
|
+
);
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// src/Order.js
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
List,
|
|
5
|
+
Datagrid,
|
|
6
|
+
TextField,
|
|
7
|
+
DateField,
|
|
8
|
+
NumberField,
|
|
9
|
+
BooleanField,
|
|
10
|
+
ReferenceField,
|
|
11
|
+
ReferenceManyField,
|
|
12
|
+
Show,
|
|
13
|
+
TabbedShowLayout,
|
|
14
|
+
Tab,
|
|
15
|
+
SimpleShowLayout,
|
|
16
|
+
SimpleForm,
|
|
17
|
+
TextInput,
|
|
18
|
+
DateTimeInput,
|
|
19
|
+
ReferenceInput,
|
|
20
|
+
SelectInput,
|
|
21
|
+
Create,
|
|
22
|
+
Edit,
|
|
23
|
+
FunctionField,
|
|
24
|
+
Pagination,
|
|
25
|
+
Filter
|
|
26
|
+
} from 'react-admin';
|
|
27
|
+
|
|
28
|
+
const OrderFilter = (props) => (
|
|
29
|
+
<Filter {...props}>
|
|
30
|
+
<TextInput label="Search Ship Name" source="ShipName" alwaysOn />
|
|
31
|
+
<TextInput label="Country" source="Country" />
|
|
32
|
+
<DateTimeInput label="Order Date" source="OrderDate" />
|
|
33
|
+
</Filter>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export const OrderList = (props) => (
|
|
37
|
+
<List {...props} filters={<OrderFilter />} perPage={7} pagination={<Pagination />}>
|
|
38
|
+
<Datagrid rowClick="show">
|
|
39
|
+
<TextField source="Id" />
|
|
40
|
+
<DateField source="OrderDate" />
|
|
41
|
+
<TextField source="ShipName" />
|
|
42
|
+
<TextField source="ShipAddress" />
|
|
43
|
+
<TextField source="ShipCity" />
|
|
44
|
+
<TextField source="ShipCountry" />
|
|
45
|
+
<BooleanField source="Ready" />
|
|
46
|
+
<ReferenceField label="Customer" source="CustomerId" reference="Customer">
|
|
47
|
+
<FunctionField render={record => record ? `${record.CompanyName}` : ''} />
|
|
48
|
+
</ReferenceField>
|
|
49
|
+
</Datagrid>
|
|
50
|
+
</List>
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
export const OrderShow = (props) => (
|
|
54
|
+
<Show {...props}>
|
|
55
|
+
<SimpleShowLayout>
|
|
56
|
+
<TextField source="Id" />
|
|
57
|
+
<DateField source="OrderDate" />
|
|
58
|
+
<TextField source="ShipName" />
|
|
59
|
+
<TextField source="ShipAddress" />
|
|
60
|
+
<TextField source="ShipCity" />
|
|
61
|
+
<TextField source="ShipCountry" />
|
|
62
|
+
<BooleanField source="Ready" />
|
|
63
|
+
<NumberField source="AmountTotal" options={{ style: 'currency', currency: 'USD' }} />
|
|
64
|
+
<ReferenceField label="Customer" source="CustomerId" reference="Customer">
|
|
65
|
+
<FunctionField render={record => record ? `${record.CompanyName}` : ''} />
|
|
66
|
+
</ReferenceField>
|
|
67
|
+
</SimpleShowLayout>
|
|
68
|
+
<TabbedShowLayout>
|
|
69
|
+
<Tab label="Order Details">
|
|
70
|
+
<ReferenceManyField reference="OrderDetail" target="OrderId" label="Order Detail List">
|
|
71
|
+
<Datagrid>
|
|
72
|
+
<ReferenceField source="ProductId" reference="Product">
|
|
73
|
+
<FunctionField render={record => record ? `${record.ProductName}` : ''} />
|
|
74
|
+
</ReferenceField>
|
|
75
|
+
<NumberField source="UnitPrice" options={{ style: 'currency', currency: 'USD' }} />
|
|
76
|
+
<NumberField source="Quantity" />
|
|
77
|
+
<NumberField source="Discount" options={{ style: 'percent' }} />
|
|
78
|
+
<NumberField source="Amount" options={{ style: 'currency', currency: 'USD' }} />
|
|
79
|
+
</Datagrid>
|
|
80
|
+
</ReferenceManyField>
|
|
81
|
+
</Tab>
|
|
82
|
+
</TabbedShowLayout>
|
|
83
|
+
</Show>
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
export const OrderCreate = (props) => (
|
|
87
|
+
<Create {...props}>
|
|
88
|
+
<SimpleForm>
|
|
89
|
+
<ReferenceInput source="CustomerId" reference="Customer" required>
|
|
90
|
+
<SelectInput optionText="CompanyName" />
|
|
91
|
+
</ReferenceInput>
|
|
92
|
+
<DateTimeInput source="OrderDate" />
|
|
93
|
+
<TextInput source="ShipName" />
|
|
94
|
+
<TextInput source="ShipAddress" />
|
|
95
|
+
<TextInput source="ShipCity" />
|
|
96
|
+
<TextInput source="ShipCountry" />
|
|
97
|
+
<BooleanField source="Ready" /> # FIXEDME - BooleanField
|
|
98
|
+
</SimpleForm>
|
|
99
|
+
</Create>
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
export const OrderEdit = (props) => (
|
|
103
|
+
<Edit {...props}>
|
|
104
|
+
<SimpleForm>
|
|
105
|
+
<ReferenceInput source="CustomerId" reference="Customer" required>
|
|
106
|
+
<SelectInput optionText="CompanyName" />
|
|
107
|
+
</ReferenceInput>
|
|
108
|
+
<DateTimeInput source="OrderDate" />
|
|
109
|
+
<TextInput source="ShipName" />
|
|
110
|
+
<TextInput source="ShipAddress" />
|
|
111
|
+
<TextInput source="ShipCity" />
|
|
112
|
+
<TextInput source="ShipCountry" />
|
|
113
|
+
<BooleanField source="Ready" /> # FIXEDME - BooleanField
|
|
114
|
+
</SimpleForm>
|
|
115
|
+
</Edit>
|
|
116
|
+
);
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// `OrderDetail.js`
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import {
|
|
5
|
+
List,
|
|
6
|
+
Datagrid,
|
|
7
|
+
TextField,
|
|
8
|
+
NumberField,
|
|
9
|
+
DateField,
|
|
10
|
+
FunctionField,
|
|
11
|
+
Show,
|
|
12
|
+
SimpleShowLayout,
|
|
13
|
+
TabbedShowLayout,
|
|
14
|
+
Tab,
|
|
15
|
+
ReferenceField,
|
|
16
|
+
TextInput,
|
|
17
|
+
NumberInput,
|
|
18
|
+
ReferenceInput,
|
|
19
|
+
SelectInput,
|
|
20
|
+
DateTimeInput,
|
|
21
|
+
BooleanInput,
|
|
22
|
+
SimpleForm,
|
|
23
|
+
Create,
|
|
24
|
+
Edit,
|
|
25
|
+
Filter,
|
|
26
|
+
Pagination,
|
|
27
|
+
BooleanField,
|
|
28
|
+
} from 'react-admin';
|
|
29
|
+
|
|
30
|
+
// Filters for the OrderDetail list, allowing users to search and sort.
|
|
31
|
+
const OrderDetailFilter = (props) => (
|
|
32
|
+
<Filter {...props}>
|
|
33
|
+
<TextInput label="Search" source="q" alwaysOn />
|
|
34
|
+
<ReferenceInput label="Product" source="ProductId" reference="Product" allowEmpty>
|
|
35
|
+
<SelectInput optionText="ProductName" />
|
|
36
|
+
</ReferenceInput>
|
|
37
|
+
<ReferenceInput label="Order" source="OrderId" reference="Order" allowEmpty>
|
|
38
|
+
<SelectInput optionText="Id" />
|
|
39
|
+
</ReferenceInput>
|
|
40
|
+
</Filter>
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
// Main list view with sorting, filtering, and pagination.
|
|
44
|
+
export const OrderDetailList = (props) => (
|
|
45
|
+
<List
|
|
46
|
+
{...props}
|
|
47
|
+
filters={<OrderDetailFilter />}
|
|
48
|
+
perPage={7} // Shows 7 per page as specified
|
|
49
|
+
sort={{ field: 'Id', order: 'ASC' }}
|
|
50
|
+
pagination={<Pagination />}
|
|
51
|
+
>
|
|
52
|
+
<Datagrid rowClick="show">
|
|
53
|
+
<TextField source="Id" />
|
|
54
|
+
<ReferenceField label="Product" source="ProductId" reference="Product">
|
|
55
|
+
<TextField source="ProductName" />
|
|
56
|
+
</ReferenceField>
|
|
57
|
+
<ReferenceField label="Order" source="OrderId" reference="Order">
|
|
58
|
+
<TextField source="Id" />
|
|
59
|
+
</ReferenceField>
|
|
60
|
+
<NumberField source="UnitPrice" />
|
|
61
|
+
<NumberField source="Quantity" />
|
|
62
|
+
<NumberField source="Discount" />
|
|
63
|
+
<NumberField source="Amount" />
|
|
64
|
+
<DateField source="ShippedDate" />
|
|
65
|
+
</Datagrid>
|
|
66
|
+
</List>
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
// The Create view for OrderDetail with inline validation and auto-complete dropdowns for related references.
|
|
70
|
+
export const OrderDetailCreate = (props) => (
|
|
71
|
+
<Create {...props}>
|
|
72
|
+
<SimpleForm>
|
|
73
|
+
<ReferenceInput source="ProductId" reference="Product">
|
|
74
|
+
<SelectInput optionText="ProductName" />
|
|
75
|
+
</ReferenceInput>
|
|
76
|
+
<ReferenceInput source="OrderId" reference="Order" disabled>
|
|
77
|
+
<SelectInput optionText="Id" />
|
|
78
|
+
</ReferenceInput>
|
|
79
|
+
<NumberInput source="Quantity" />
|
|
80
|
+
<NumberInput source="Discount" />
|
|
81
|
+
</SimpleForm>
|
|
82
|
+
</Create>
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
// The Edit view for OrderDetail with form fields for updating exiting records.
|
|
86
|
+
export const OrderDetailEdit = (props) => (
|
|
87
|
+
<Edit {...props}>
|
|
88
|
+
<SimpleForm>
|
|
89
|
+
<TextField source="Id" />
|
|
90
|
+
<ReferenceInput source="ProductId" reference="Product">
|
|
91
|
+
<SelectInput optionText="ProductName" />
|
|
92
|
+
</ReferenceInput>
|
|
93
|
+
<ReferenceInput source="OrderId" reference="Order" disabled>
|
|
94
|
+
<SelectInput optionText="Id" />
|
|
95
|
+
</ReferenceInput>
|
|
96
|
+
<NumberInput source="Quantity" />
|
|
97
|
+
<NumberInput source="Discount" />
|
|
98
|
+
<DateTimeInput source="ShippedDate" disabled />
|
|
99
|
+
</SimpleForm>
|
|
100
|
+
</Edit>
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
// The Show view for detailed display of OrderDetail and related records.
|
|
104
|
+
export const OrderDetailShow = (props) => (
|
|
105
|
+
<Show {...props}>
|
|
106
|
+
<SimpleShowLayout>
|
|
107
|
+
<TextField source="Id" />
|
|
108
|
+
<ReferenceField label="Product" source="ProductId" reference="Product">
|
|
109
|
+
<TextField source="ProductName" />
|
|
110
|
+
</ReferenceField>
|
|
111
|
+
<ReferenceField label="Order" source="OrderId" reference="Order">
|
|
112
|
+
<TextField source="Id" />
|
|
113
|
+
</ReferenceField>
|
|
114
|
+
<NumberField source="UnitPrice" />
|
|
115
|
+
<NumberField source="Quantity" />
|
|
116
|
+
<NumberField source="Discount" />
|
|
117
|
+
<NumberField source="Amount" />
|
|
118
|
+
<DateField source="ShippedDate" />
|
|
119
|
+
</SimpleShowLayout>
|
|
120
|
+
</Show>
|
|
121
|
+
);
|