ApiLogicServer 15.0.14__py3-none-any.whl → 15.0.20__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 +4 -4
- 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 +162 -0
- api_logic_server_cli/genai/genai_svcs.py +49 -10
- api_logic_server_cli/logging.yml +5 -0
- api_logic_server_cli/prototypes/.DS_Store +0 -0
- api_logic_server_cli/prototypes/base/config/config.py +4 -3
- 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 +170 -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/.DS_Store +0 -0
- api_logic_server_cli/prototypes/nw/ui/.DS_Store +0 -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 +58 -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 +211 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/CustomerDemographic.js +57 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Department.js +98 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Employee.js +100 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeAudit.js +106 -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 +87 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Order.js +98 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/OrderDetail.js +112 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Product.js +103 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Region.js +65 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/SampleDBVersion.js +73 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Shipper.js +67 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Supplier.js +87 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Territory.js +90 -0
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Union.js +61 -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.14.dist-info → apilogicserver-15.0.20.dist-info}/METADATA +1 -1
- {apilogicserver-15.0.14.dist-info → apilogicserver-15.0.20.dist-info}/RECORD +84 -16
- {apilogicserver-15.0.14.dist-info → apilogicserver-15.0.20.dist-info}/WHEEL +0 -0
- {apilogicserver-15.0.14.dist-info → apilogicserver-15.0.20.dist-info}/entry_points.txt +0 -0
- {apilogicserver-15.0.14.dist-info → apilogicserver-15.0.20.dist-info}/licenses/LICENSE +0 -0
- {apilogicserver-15.0.14.dist-info → apilogicserver-15.0.20.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
List,SelectInput,
|
|
4
|
+
FunctionField,
|
|
5
|
+
Datagrid,
|
|
6
|
+
TextField,
|
|
7
|
+
NumberField,
|
|
8
|
+
ReferenceField,
|
|
9
|
+
Show,
|
|
10
|
+
TabbedShowLayout,
|
|
11
|
+
Tab,
|
|
12
|
+
SimpleShowLayout,
|
|
13
|
+
TextInput,
|
|
14
|
+
NumberInput,
|
|
15
|
+
ReferenceInput,
|
|
16
|
+
Create,
|
|
17
|
+
SimpleForm,
|
|
18
|
+
Edit,
|
|
19
|
+
Filter,
|
|
20
|
+
Pagination,
|
|
21
|
+
BooleanField
|
|
22
|
+
} from 'react-admin';
|
|
23
|
+
|
|
24
|
+
// Filter component for OrderDetail
|
|
25
|
+
const OrderDetailFilter = (props) => (
|
|
26
|
+
<Filter {...props}>
|
|
27
|
+
<TextInput label="Search by ID" source="Id" alwaysOn />
|
|
28
|
+
<ReferenceInput label="Order" source="OrderId" reference="Order" allowEmpty>
|
|
29
|
+
<NumberInput />
|
|
30
|
+
</ReferenceInput>
|
|
31
|
+
<ReferenceInput label="Product" source="ProductId" reference="Product" allowEmpty>
|
|
32
|
+
<NumberInput />
|
|
33
|
+
</ReferenceInput>
|
|
34
|
+
</Filter>
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
// List component for OrderDetail
|
|
38
|
+
export const OrderDetailList = (props) => (
|
|
39
|
+
<List {...props} filters={<OrderDetailFilter />} perPage={7} pagination={Pagination} sort={{ field: 'Id', order: 'ASC' }}>
|
|
40
|
+
<Datagrid rowClick="show">
|
|
41
|
+
<TextField source="Id" />
|
|
42
|
+
<ReferenceField label="Order" source="OrderId" reference="Order">
|
|
43
|
+
<TextField source="ShipName" />
|
|
44
|
+
</ReferenceField>
|
|
45
|
+
<ReferenceField label="Product" source="ProductId" reference="Product">
|
|
46
|
+
<TextField source="ProductName" />
|
|
47
|
+
</ReferenceField>
|
|
48
|
+
<FunctionField label="Quantity" source="Quantity" render={record => `${record.Quantity}`} />
|
|
49
|
+
<FunctionField label="Unit Price" source="UnitPrice" render={record => `$${record.UnitPrice}`} />
|
|
50
|
+
<FunctionField label="Discount" source="Discount" render={record => `${record.Discount * 100}%`} />
|
|
51
|
+
<FunctionField label="Amount" source="Amount" render={record => `$${record.Amount}`} />
|
|
52
|
+
</Datagrid>
|
|
53
|
+
</List>
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
// Show component for OrderDetail
|
|
57
|
+
export const OrderDetailShow = (props) => (
|
|
58
|
+
<Show {...props}>
|
|
59
|
+
<TabbedShowLayout>
|
|
60
|
+
<Tab label="Details">
|
|
61
|
+
<SimpleShowLayout>
|
|
62
|
+
<TextField source="Id" />
|
|
63
|
+
<ReferenceField label="Order" source="OrderId" reference="Order">
|
|
64
|
+
<TextField source="ShipName" />
|
|
65
|
+
</ReferenceField>
|
|
66
|
+
<ReferenceField label="Product" source="ProductId" reference="Product">
|
|
67
|
+
<TextField source="ProductName" />
|
|
68
|
+
</ReferenceField>
|
|
69
|
+
<NumberField label="Quantity" source="Quantity" />
|
|
70
|
+
<NumberField label="Unit Price" source="UnitPrice" options={{ style: 'currency', currency: 'USD' }} />
|
|
71
|
+
<NumberField label="Discount" source="Discount" />
|
|
72
|
+
<NumberField label="Amount" source="Amount" options={{ style: 'currency', currency: 'USD' }} />
|
|
73
|
+
</SimpleShowLayout>
|
|
74
|
+
</Tab>
|
|
75
|
+
</TabbedShowLayout>
|
|
76
|
+
</Show>
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
// Create component for OrderDetail
|
|
80
|
+
export const OrderDetailCreate = (props) => (
|
|
81
|
+
<Create {...props}>
|
|
82
|
+
<SimpleForm>
|
|
83
|
+
<ReferenceInput label="Order" source="OrderId" reference="Order">
|
|
84
|
+
<SelectInput optionText="ShipName" />
|
|
85
|
+
</ReferenceInput>
|
|
86
|
+
<ReferenceInput label="Product" source="ProductId" reference="Product">
|
|
87
|
+
<SelectInput optionText="ProductName" />
|
|
88
|
+
</ReferenceInput>
|
|
89
|
+
<NumberInput source="Quantity" />
|
|
90
|
+
<NumberInput source="UnitPrice" />
|
|
91
|
+
<NumberInput source="Discount" />
|
|
92
|
+
</SimpleForm>
|
|
93
|
+
</Create>
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
// Edit component for OrderDetail
|
|
97
|
+
export const OrderDetailEdit = (props) => (
|
|
98
|
+
<Edit {...props}>
|
|
99
|
+
<SimpleForm>
|
|
100
|
+
<ReferenceInput label="Order" source="OrderId" reference="Order">
|
|
101
|
+
<SelectInput optionText="ShipName" />
|
|
102
|
+
</ReferenceInput>
|
|
103
|
+
<ReferenceInput label="Product" source="ProductId" reference="Product">
|
|
104
|
+
<SelectInput optionText="ProductName" />
|
|
105
|
+
</ReferenceInput>
|
|
106
|
+
<NumberInput source="Quantity" />
|
|
107
|
+
<NumberInput source="UnitPrice" />
|
|
108
|
+
<NumberInput source="Discount" />
|
|
109
|
+
<NumberField source="Amount" disabled />
|
|
110
|
+
</SimpleForm>
|
|
111
|
+
</Edit>
|
|
112
|
+
);
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
List, Datagrid, TextField, ReferenceField, Show, SimpleShowLayout, TabbedShowLayout, Tab,
|
|
4
|
+
Create, SimpleForm, TextInput, NumberInput, NumberField, DateField, BooleanField, Edit,
|
|
5
|
+
ReferenceManyField, ReferenceInput, SelectInput, Filter, Pagination
|
|
6
|
+
} from 'react-admin';
|
|
7
|
+
|
|
8
|
+
// Filters for the Product List
|
|
9
|
+
const ProductFilter = (props) => (
|
|
10
|
+
<Filter {...props}>
|
|
11
|
+
<TextInput label="Search by Product Name" source="ProductName" alwaysOn />
|
|
12
|
+
<ReferenceInput label="Category" source="CategoryId" reference="Category" allowEmpty>
|
|
13
|
+
<SelectInput optionText="CategoryName_ColumnName" />
|
|
14
|
+
</ReferenceInput>
|
|
15
|
+
<ReferenceInput label="Supplier" source="SupplierId" reference="Supplier" allowEmpty>
|
|
16
|
+
<SelectInput optionText="CompanyName" />
|
|
17
|
+
</ReferenceInput>
|
|
18
|
+
</Filter>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// List view of Products
|
|
22
|
+
export const ProductList = (props) => (
|
|
23
|
+
<List {...props} filters={<ProductFilter />} pagination={<Pagination rowsPerPageOptions={[5, 10, 25]} />}>
|
|
24
|
+
<Datagrid rowClick="show">
|
|
25
|
+
<TextField source="ProductName" />
|
|
26
|
+
<ReferenceField source="CategoryId" reference="Category">
|
|
27
|
+
<TextField source="CategoryName_ColumnName" />
|
|
28
|
+
</ReferenceField>
|
|
29
|
+
<NumberField source="UnitPrice" options={{ style: 'currency', currency: 'USD' }} />
|
|
30
|
+
<NumberField source="UnitsInStock" />
|
|
31
|
+
<NumberField source="UnitsOnOrder" />
|
|
32
|
+
<NumberField source="ReorderLevel" />
|
|
33
|
+
<BooleanField source="Discontinued" />
|
|
34
|
+
<TextField source="Id" />
|
|
35
|
+
</Datagrid>
|
|
36
|
+
</List>
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
// Show view of Products
|
|
40
|
+
export const ProductShow = (props) => (
|
|
41
|
+
<Show {...props}>
|
|
42
|
+
<SimpleShowLayout>
|
|
43
|
+
<TextField source="ProductName" />
|
|
44
|
+
<ReferenceField source="CategoryId" reference="Category">
|
|
45
|
+
<TextField source="CategoryName_ColumnName" />
|
|
46
|
+
</ReferenceField>
|
|
47
|
+
<NumberField source="UnitPrice" options={{ style: 'currency', currency: 'USD' }} />
|
|
48
|
+
<NumberField source="UnitsInStock" />
|
|
49
|
+
<NumberField source="UnitsOnOrder" />
|
|
50
|
+
<NumberField source="ReorderLevel" />
|
|
51
|
+
<BooleanField source="Discontinued" />
|
|
52
|
+
<TextField source="Id" />
|
|
53
|
+
</SimpleShowLayout>
|
|
54
|
+
<TabbedShowLayout>
|
|
55
|
+
<Tab label="Order Details">
|
|
56
|
+
<ReferenceManyField reference="OrderDetail" target="ProductId" addLabel={false}>
|
|
57
|
+
<Datagrid>
|
|
58
|
+
<ReferenceField source="OrderId" reference="Order">
|
|
59
|
+
<TextField source="Id" />
|
|
60
|
+
</ReferenceField>
|
|
61
|
+
<NumberField source="Quantity" />
|
|
62
|
+
<NumberField source="UnitPrice" options={{ style: 'currency', currency: 'USD' }} />
|
|
63
|
+
<TextField source="Id" />
|
|
64
|
+
</Datagrid>
|
|
65
|
+
</ReferenceManyField>
|
|
66
|
+
</Tab>
|
|
67
|
+
</TabbedShowLayout>
|
|
68
|
+
</Show>
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
// Create view for Products
|
|
72
|
+
export const ProductCreate = (props) => (
|
|
73
|
+
<Create {...props}>
|
|
74
|
+
<SimpleForm>
|
|
75
|
+
<TextInput source="ProductName" />
|
|
76
|
+
<ReferenceInput source="CategoryId" reference="Category">
|
|
77
|
+
<SelectInput optionText="CategoryName_ColumnName" />
|
|
78
|
+
</ReferenceInput>
|
|
79
|
+
<NumberInput source="UnitPrice" />
|
|
80
|
+
<NumberInput source="UnitsInStock" />
|
|
81
|
+
<NumberInput source="UnitsOnOrder" />
|
|
82
|
+
<NumberInput source="ReorderLevel" />
|
|
83
|
+
<BooleanField source="Discontinued" />
|
|
84
|
+
</SimpleForm>
|
|
85
|
+
</Create>
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
// Edit view for Products
|
|
89
|
+
export const ProductEdit = (props) => (
|
|
90
|
+
<Edit {...props}>
|
|
91
|
+
<SimpleForm>
|
|
92
|
+
<TextInput source="ProductName" />
|
|
93
|
+
<ReferenceInput source="CategoryId" reference="Category">
|
|
94
|
+
<SelectInput optionText="CategoryName_ColumnName" />
|
|
95
|
+
</ReferenceInput>
|
|
96
|
+
<NumberInput source="UnitPrice" />
|
|
97
|
+
<NumberInput source="UnitsInStock" />
|
|
98
|
+
<NumberInput source="UnitsOnOrder" />
|
|
99
|
+
<NumberInput source="ReorderLevel" />
|
|
100
|
+
<BooleanField source="Discontinued" />
|
|
101
|
+
</SimpleForm>
|
|
102
|
+
</Edit>
|
|
103
|
+
);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
List,
|
|
4
|
+
Datagrid,
|
|
5
|
+
TextField,
|
|
6
|
+
ReferenceField,
|
|
7
|
+
Show,
|
|
8
|
+
SimpleShowLayout,
|
|
9
|
+
Create,
|
|
10
|
+
SimpleForm,
|
|
11
|
+
TextInput,
|
|
12
|
+
Edit,
|
|
13
|
+
Pagination,
|
|
14
|
+
Filter,
|
|
15
|
+
} from 'react-admin';
|
|
16
|
+
|
|
17
|
+
// Filters for list screens
|
|
18
|
+
const RegionFilters = (props) => (
|
|
19
|
+
<Filter {...props}>
|
|
20
|
+
<TextInput label="Search" source="q" alwaysOn />
|
|
21
|
+
<TextInput label="Region Description" source="RegionDescription" alwaysOn />
|
|
22
|
+
</Filter>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
// Custom pagination component
|
|
26
|
+
const RegionPagination = props => <Pagination rowsPerPageOptions={[5, 10, 25]} {...props} />;
|
|
27
|
+
|
|
28
|
+
// Region List Component
|
|
29
|
+
export const RegionList = props => (
|
|
30
|
+
<List {...props} filters={<RegionFilters />} pagination={<RegionPagination />} perPage={7}>
|
|
31
|
+
<Datagrid rowClick="show">
|
|
32
|
+
<TextField source="RegionDescription" label="Region Description" sortable />
|
|
33
|
+
<TextField source="Id" label="Region ID" sortable={false} />
|
|
34
|
+
</Datagrid>
|
|
35
|
+
</List>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
// Region Show Component
|
|
39
|
+
export const RegionShow = props => (
|
|
40
|
+
<Show {...props}>
|
|
41
|
+
<SimpleShowLayout>
|
|
42
|
+
<TextField source="RegionDescription" label="Region Description" />
|
|
43
|
+
<TextField source="Id" label="Region ID" />
|
|
44
|
+
</SimpleShowLayout>
|
|
45
|
+
</Show>
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
// Region Create Component
|
|
49
|
+
export const RegionCreate = props => (
|
|
50
|
+
<Create {...props}>
|
|
51
|
+
<SimpleForm>
|
|
52
|
+
<TextInput source="RegionDescription" label="Region Description" />
|
|
53
|
+
</SimpleForm>
|
|
54
|
+
</Create>
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
// Region Edit Component
|
|
58
|
+
export const RegionEdit = props => (
|
|
59
|
+
<Edit {...props}>
|
|
60
|
+
<SimpleForm>
|
|
61
|
+
<TextInput source="RegionDescription" label="Region Description" />
|
|
62
|
+
<TextField source="Id" label="Region ID" disabled />
|
|
63
|
+
</SimpleForm>
|
|
64
|
+
</Edit>
|
|
65
|
+
);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
List,Pagination,
|
|
4
|
+
Datagrid,
|
|
5
|
+
TextField,
|
|
6
|
+
Show,
|
|
7
|
+
TabbedShowLayout,
|
|
8
|
+
Tab,
|
|
9
|
+
SimpleShowLayout,
|
|
10
|
+
TextInput,
|
|
11
|
+
Create,
|
|
12
|
+
SimpleForm,
|
|
13
|
+
Edit,
|
|
14
|
+
Filter,
|
|
15
|
+
NumberField
|
|
16
|
+
} from 'react-admin';
|
|
17
|
+
|
|
18
|
+
// SampleDBVersion Filter
|
|
19
|
+
const SampleDBVersionFilter = (props) => (
|
|
20
|
+
<Filter {...props}>
|
|
21
|
+
<TextInput label="Search" source="q" alwaysOn />
|
|
22
|
+
</Filter>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
// SampleDBVersion List
|
|
26
|
+
export const SampleDBVersionList = (props) => (
|
|
27
|
+
<List {...props} filters={<SampleDBVersionFilter />}
|
|
28
|
+
perPage={7}
|
|
29
|
+
sort={{ field: 'Id', order: 'ASC' }}
|
|
30
|
+
pagination={<Pagination rowsPerPageOptions={[7, 14, 28]} />}
|
|
31
|
+
>
|
|
32
|
+
<Datagrid rowClick="show">
|
|
33
|
+
<NumberField source="Id" label="ID" />
|
|
34
|
+
<TextField source="Notes" label="Notes" />
|
|
35
|
+
</Datagrid>
|
|
36
|
+
</List>
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
// SampleDBVersion Show
|
|
40
|
+
export const SampleDBVersionShow = (props) => (
|
|
41
|
+
<Show {...props}>
|
|
42
|
+
<TabbedShowLayout>
|
|
43
|
+
<Tab label="Details">
|
|
44
|
+
<SimpleShowLayout>
|
|
45
|
+
<NumberField source="Id" label="ID" />
|
|
46
|
+
<TextField source="Notes" label="Notes" />
|
|
47
|
+
</SimpleShowLayout>
|
|
48
|
+
</Tab>
|
|
49
|
+
{/* Add additional tabs for related resources if applicable */}
|
|
50
|
+
</TabbedShowLayout>
|
|
51
|
+
</Show>
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
// SampleDBVersion Create
|
|
55
|
+
export const SampleDBVersionCreate = (props) => (
|
|
56
|
+
<Create {...props}>
|
|
57
|
+
<SimpleForm>
|
|
58
|
+
<TextInput source="Notes" label="Notes" />
|
|
59
|
+
{/* Add fields as needed */}
|
|
60
|
+
</SimpleForm>
|
|
61
|
+
</Create>
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
// SampleDBVersion Edit
|
|
65
|
+
export const SampleDBVersionEdit = (props) => (
|
|
66
|
+
<Edit {...props}>
|
|
67
|
+
<SimpleForm>
|
|
68
|
+
<NumberField source="Id" label="ID" disabled />
|
|
69
|
+
<TextInput source="Notes" label="Notes" />
|
|
70
|
+
{/* Add additional fields or modify existing ones as needed */}
|
|
71
|
+
</SimpleForm>
|
|
72
|
+
</Edit>
|
|
73
|
+
);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
List,
|
|
3
|
+
Datagrid,
|
|
4
|
+
TextField,
|
|
5
|
+
NumberField,
|
|
6
|
+
Show,
|
|
7
|
+
TabbedShowLayout,
|
|
8
|
+
Tab,
|
|
9
|
+
SimpleShowLayout,
|
|
10
|
+
TextInput,
|
|
11
|
+
Create,
|
|
12
|
+
SimpleForm,
|
|
13
|
+
Edit,
|
|
14
|
+
Filter,
|
|
15
|
+
Pagination
|
|
16
|
+
} from 'react-admin';
|
|
17
|
+
|
|
18
|
+
// Define a filter component for the Shipper resource
|
|
19
|
+
const ShipperFilter = (props) => (
|
|
20
|
+
<Filter {...props}>
|
|
21
|
+
<TextInput label="Search" source="q" alwaysOn />
|
|
22
|
+
<TextInput label="Company Name" source="CompanyName" />
|
|
23
|
+
</Filter>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
// List view for Shipper resource
|
|
27
|
+
export const ShipperList = (props) => (
|
|
28
|
+
<List {...props} filters={<ShipperFilter />} pagination={<Pagination rowsPerPage={7} />}>
|
|
29
|
+
<Datagrid rowClick="show">
|
|
30
|
+
<TextField source="CompanyName" label="Company Name"/>
|
|
31
|
+
<TextField source="Phone" label="Phone"/>
|
|
32
|
+
<NumberField source="Id" label="ID"/>
|
|
33
|
+
</Datagrid>
|
|
34
|
+
</List>
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
// Show view for Shipper resource
|
|
38
|
+
export const ShipperShow = (props) => (
|
|
39
|
+
<Show {...props}>
|
|
40
|
+
<SimpleShowLayout>
|
|
41
|
+
<TextField source="CompanyName" label="Company Name"/>
|
|
42
|
+
<TextField source="Phone" label="Phone"/>
|
|
43
|
+
<NumberField source="Id" label="ID"/>
|
|
44
|
+
</SimpleShowLayout>
|
|
45
|
+
</Show>
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
// Create view for Shipper resource
|
|
49
|
+
export const ShipperCreate = (props) => (
|
|
50
|
+
<Create {...props}>
|
|
51
|
+
<SimpleForm>
|
|
52
|
+
<TextInput source="CompanyName" label="Company Name"/>
|
|
53
|
+
<TextInput source="Phone" label="Phone"/>
|
|
54
|
+
</SimpleForm>
|
|
55
|
+
</Create>
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
// Edit view for Shipper resource
|
|
59
|
+
export const ShipperEdit = (props) => (
|
|
60
|
+
<Edit {...props}>
|
|
61
|
+
<SimpleForm>
|
|
62
|
+
<TextInput source="CompanyName" label="Company Name"/>
|
|
63
|
+
<TextInput source="Phone" label="Phone"/>
|
|
64
|
+
<NumberField source="Id" label="ID"/>
|
|
65
|
+
</SimpleForm>
|
|
66
|
+
</Edit>
|
|
67
|
+
);
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { List, Show, SimpleShowLayout, Datagrid, TextField, NumberField, ReferenceField, Filter, TextInput, ShowController, Tab, TabbedShowLayout, NumberInput, Edit, SimpleForm, Create, ReferenceInput, SelectInput, EditButton, SimpleList } from 'react-admin';
|
|
3
|
+
|
|
4
|
+
// Filters applied to the supplier list
|
|
5
|
+
const SupplierFilter = (props) => (
|
|
6
|
+
<Filter {...props}>
|
|
7
|
+
<TextInput label="Search by Company Name" source="CompanyName" alwaysOn />
|
|
8
|
+
<TextInput label="Search by Country" source="Country" />
|
|
9
|
+
</Filter>
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
// Listing Suppliers
|
|
13
|
+
export const SupplierList = (props) => (
|
|
14
|
+
<List {...props} filters={<SupplierFilter />} pagination={false}>
|
|
15
|
+
<Datagrid rowClick="show">
|
|
16
|
+
<TextField source="id" label="ID" />
|
|
17
|
+
<TextField source="CompanyName" label="Company Name" />
|
|
18
|
+
<TextField source="ContactName" label="Contact Name" />
|
|
19
|
+
<TextField source="ContactTitle" label="Contact Title" />
|
|
20
|
+
<TextField source="City" label="City" />
|
|
21
|
+
<TextField source="Country" label="Country" />
|
|
22
|
+
<EditButton />
|
|
23
|
+
</Datagrid>
|
|
24
|
+
</List>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
// Show Supplier
|
|
28
|
+
export const SupplierShow = (props) => (
|
|
29
|
+
<ShowController {...props}>
|
|
30
|
+
{(controllerProps) => (
|
|
31
|
+
<Show {...controllerProps}>
|
|
32
|
+
<SimpleShowLayout>
|
|
33
|
+
<TextField source="CompanyName" label="Company Name" />
|
|
34
|
+
<TextField source="ContactName" label="Contact Name" />
|
|
35
|
+
<TextField source="ContactTitle" label="Contact Title" />
|
|
36
|
+
<TextField source="Address" label="Address" />
|
|
37
|
+
<TextField source="City" label="City" />
|
|
38
|
+
<TextField source="Region" label="Region" />
|
|
39
|
+
<TextField source="PostalCode" label="Postal Code" />
|
|
40
|
+
<TextField source="Country" label="Country" />
|
|
41
|
+
<TextField source="Phone" label="Phone" />
|
|
42
|
+
<TextField source="Fax" label="Fax" />
|
|
43
|
+
<TextField source="HomePage" label="Homepage" />
|
|
44
|
+
<TextField source="id" label="ID" />
|
|
45
|
+
</SimpleShowLayout>
|
|
46
|
+
</Show>
|
|
47
|
+
)}
|
|
48
|
+
</ShowController>
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// Create a new Supplier
|
|
52
|
+
export const SupplierCreate = (props) => (
|
|
53
|
+
<Create {...props}>
|
|
54
|
+
<SimpleForm>
|
|
55
|
+
<TextInput source="CompanyName" label="Company Name" />
|
|
56
|
+
<TextInput source="ContactName" label="Contact Name" />
|
|
57
|
+
<TextInput source="ContactTitle" label="Contact Title" />
|
|
58
|
+
<TextInput source="Address" label="Address" />
|
|
59
|
+
<TextInput source="City" label="City" />
|
|
60
|
+
<TextInput source="Region" label="Region" />
|
|
61
|
+
<TextInput source="PostalCode" label="Postal Code" />
|
|
62
|
+
<TextInput source="Country" label="Country" />
|
|
63
|
+
<TextInput source="Phone" label="Phone" />
|
|
64
|
+
<TextInput source="Fax" label="Fax" />
|
|
65
|
+
<TextInput source="HomePage" label="Homepage" />
|
|
66
|
+
</SimpleForm>
|
|
67
|
+
</Create>
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
// Edit an existing Supplier
|
|
71
|
+
export const SupplierEdit = (props) => (
|
|
72
|
+
<Edit {...props}>
|
|
73
|
+
<SimpleForm>
|
|
74
|
+
<TextInput source="CompanyName" label="Company Name" />
|
|
75
|
+
<TextInput source="ContactName" label="Contact Name" />
|
|
76
|
+
<TextInput source="ContactTitle" label="Contact Title" />
|
|
77
|
+
<TextInput source="Address" label="Address" />
|
|
78
|
+
<TextInput source="City" label="City" />
|
|
79
|
+
<TextInput source="Region" label="Region" />
|
|
80
|
+
<TextInput source="PostalCode" label="Postal Code" />
|
|
81
|
+
<TextInput source="Country" label="Country" />
|
|
82
|
+
<TextInput source="Phone" label="Phone" />
|
|
83
|
+
<TextInput source="Fax" label="Fax" />
|
|
84
|
+
<TextInput source="HomePage" label="Homepage" />
|
|
85
|
+
</SimpleForm>
|
|
86
|
+
</Edit>
|
|
87
|
+
);
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// src/Territory.js
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
List,
|
|
5
|
+
Show,SelectInput,
|
|
6
|
+
Datagrid,
|
|
7
|
+
SimpleShowLayout,
|
|
8
|
+
TabbedShowLayout,
|
|
9
|
+
Tab,
|
|
10
|
+
TextField,
|
|
11
|
+
ReferenceField,
|
|
12
|
+
FunctionField,
|
|
13
|
+
TextInput,
|
|
14
|
+
ReferenceInput,
|
|
15
|
+
Create,
|
|
16
|
+
Edit,
|
|
17
|
+
SimpleForm,
|
|
18
|
+
Filter,
|
|
19
|
+
NumberField,
|
|
20
|
+
BooleanField,
|
|
21
|
+
ReferenceManyField,
|
|
22
|
+
} from 'react-admin';
|
|
23
|
+
|
|
24
|
+
// Filter component for the Territory list view
|
|
25
|
+
const TerritoryFilter = (props) => (
|
|
26
|
+
<Filter {...props}>
|
|
27
|
+
<TextInput label="Search by Description" source="q" alwaysOn />
|
|
28
|
+
</Filter>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
// TerritoryList component for displaying a list of territories
|
|
32
|
+
export const TerritoryList = (props) => (
|
|
33
|
+
<List {...props} filters={<TerritoryFilter />}>
|
|
34
|
+
<Datagrid rowClick="show">
|
|
35
|
+
<TextField source="TerritoryDescription" label="Territory Description" />
|
|
36
|
+
<TextField source="Id" label="ID" />
|
|
37
|
+
<ReferenceField label="Region" source="RegionId" reference="Region">
|
|
38
|
+
<TextField source="RegionDescription" />
|
|
39
|
+
</ReferenceField>
|
|
40
|
+
</Datagrid>
|
|
41
|
+
</List>
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
// TerritoryShow component for displaying territory details
|
|
45
|
+
export const TerritoryShow = (props) => (
|
|
46
|
+
<Show {...props}>
|
|
47
|
+
<SimpleShowLayout>
|
|
48
|
+
<TextField source="TerritoryDescription" label="Territory Description" />
|
|
49
|
+
<TextField source="Id" label="ID" />
|
|
50
|
+
<ReferenceField label="Region" source="RegionId" reference="Region">
|
|
51
|
+
<TextField source="RegionDescription" />
|
|
52
|
+
</ReferenceField>
|
|
53
|
+
<ReferenceManyField
|
|
54
|
+
label="Employees in Territory"
|
|
55
|
+
reference="EmployeeTerritory"
|
|
56
|
+
target="TerritoryId"
|
|
57
|
+
>
|
|
58
|
+
<Datagrid rowClick="show">
|
|
59
|
+
<ReferenceField label="Employee" source="EmployeeId" reference="Employee">
|
|
60
|
+
<FunctionField render={(record) => `${record.FirstName} ${record.LastName}`} />
|
|
61
|
+
</ReferenceField>
|
|
62
|
+
</Datagrid>
|
|
63
|
+
</ReferenceManyField>
|
|
64
|
+
</SimpleShowLayout>
|
|
65
|
+
</Show>
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
// TerritoryCreate component for creating new territories
|
|
69
|
+
export const TerritoryCreate = (props) => (
|
|
70
|
+
<Create {...props}>
|
|
71
|
+
<SimpleForm>
|
|
72
|
+
<TextInput source="TerritoryDescription" label="Territory Description" />
|
|
73
|
+
<ReferenceInput label="Region" source="RegionId" reference="Region">
|
|
74
|
+
<SelectInput optionText="RegionDescription" />
|
|
75
|
+
</ReferenceInput>
|
|
76
|
+
</SimpleForm>
|
|
77
|
+
</Create>
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
// TerritoryEdit component for editing existing territories
|
|
81
|
+
export const TerritoryEdit = (props) => (
|
|
82
|
+
<Edit {...props}>
|
|
83
|
+
<SimpleForm>
|
|
84
|
+
<TextInput source="TerritoryDescription" label="Territory Description" />
|
|
85
|
+
<ReferenceInput label="Region" source="RegionId" reference="Region">
|
|
86
|
+
<SelectInput optionText="RegionDescription" />
|
|
87
|
+
</ReferenceInput>
|
|
88
|
+
</SimpleForm>
|
|
89
|
+
</Edit>
|
|
90
|
+
);
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { List, Datagrid, TextField, NumberField, Show, SimpleShowLayout, ReferenceManyField, TabbedShowLayout, Tab, TextInput, Create, SimpleForm, Edit, ReferenceField, ReferenceInput, SelectInput, Filter, Pagination } from 'react-admin';
|
|
3
|
+
|
|
4
|
+
// Filter component to be used in List view
|
|
5
|
+
const UnionFilter = (props) => (
|
|
6
|
+
<Filter {...props}>
|
|
7
|
+
<TextInput label="Search by Name" source="q" alwaysOn />
|
|
8
|
+
</Filter>
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
// List view for Unions
|
|
12
|
+
export const UnionList = (props) => (
|
|
13
|
+
<List {...props} filters={<UnionFilter />} pagination={<Pagination rowsPerPageOptions={[7, 14, 28]} />} perPage={7}>
|
|
14
|
+
<Datagrid rowClick="show">
|
|
15
|
+
<TextField source="Name" label="Union Name" />
|
|
16
|
+
<NumberField source="Id" label="Union ID" />
|
|
17
|
+
</Datagrid>
|
|
18
|
+
</List>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// Show view for a Union
|
|
22
|
+
export const UnionShow = (props) => (
|
|
23
|
+
<Show {...props}>
|
|
24
|
+
<SimpleShowLayout>
|
|
25
|
+
<TextField source="Name" label="Union Name" />
|
|
26
|
+
<NumberField source="Id" label="Union ID" />
|
|
27
|
+
<TabbedShowLayout>
|
|
28
|
+
<Tab label="Employees">
|
|
29
|
+
<ReferenceManyField reference="Employee" target="UnionId" addLabel={false}>
|
|
30
|
+
<Datagrid>
|
|
31
|
+
<TextField source="LastName" />
|
|
32
|
+
<TextField source="FirstName" />
|
|
33
|
+
<ReferenceField source="WorksForDepartmentId" reference="Department">
|
|
34
|
+
<TextField source="DepartmentName" />
|
|
35
|
+
</ReferenceField>
|
|
36
|
+
</Datagrid>
|
|
37
|
+
</ReferenceManyField>
|
|
38
|
+
</Tab>
|
|
39
|
+
</TabbedShowLayout>
|
|
40
|
+
</SimpleShowLayout>
|
|
41
|
+
</Show>
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
// Create view for a new Union
|
|
45
|
+
export const UnionCreate = (props) => (
|
|
46
|
+
<Create {...props}>
|
|
47
|
+
<SimpleForm>
|
|
48
|
+
<TextInput source="Name" label="Union Name" />
|
|
49
|
+
</SimpleForm>
|
|
50
|
+
</Create>
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
// Edit view for an existing Union
|
|
54
|
+
export const UnionEdit = (props) => (
|
|
55
|
+
<Edit {...props}>
|
|
56
|
+
<SimpleForm>
|
|
57
|
+
<TextInput source="Name" label="Union Name" />
|
|
58
|
+
<NumberField source="Id" label="Union ID" />
|
|
59
|
+
</SimpleForm>
|
|
60
|
+
</Edit>
|
|
61
|
+
);
|