ApiLogicServer 15.0.19__py3-none-any.whl → 15.0.22__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/genai/genai_admin_app.py +33 -9
- api_logic_server_cli/prototypes/.DS_Store +0 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-App-Resource-Learning-Prompt.md +119 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-App-js-Learning-Prompt.md +71 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/{Admin-App-Learning-Prompt.md → z-unused-Admin-App-Learning-Prompt.md} +60 -35
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/package.json +3 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/Config.js +527 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/app_loader.js +24 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/.eslintrc +5 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/.yarnrc.yml +4 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/default-settings.js +25 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/default-settings.ts +25 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/errors.js +116 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/errors.ts +116 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/index.test.tsx +7 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/index.tsx +11 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/ra-jsonapi-client.js +577 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/ra-jsonapi-client.ts +577 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/resourceLookup.js +124 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/resourceLookup.ts +124 -0
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/styles.module.css +9 -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/src/App.js +30 -31
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Category.js +62 -62
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Customer.js +143 -48
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/CustomerDemographic.js +20 -37
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Department.js +38 -39
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Employee.js +85 -134
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeAudit.js +89 -77
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeTerritory.js +59 -59
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Location.js +45 -49
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Order.js +42 -60
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/OrderDetail.js +97 -106
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Product.js +60 -62
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Region.js +36 -41
- 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 +57 -54
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Supplier.js +71 -87
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Territory.js +47 -41
- api_logic_server_cli/prototypes/nw/ui/react_admin/src/Union.js +18 -34
- {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.22.dist-info}/METADATA +1 -1
- {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.22.dist-info}/RECORD +50 -31
- api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/dataProvider.js +0 -110
- {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.22.dist-info}/WHEEL +0 -0
- {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.22.dist-info}/entry_points.txt +0 -0
- {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.22.dist-info}/licenses/LICENSE +0 -0
- {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.22.dist-info}/top_level.txt +0 -0
|
@@ -1,64 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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';
|
|
4
17
|
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<TextInput label="Search by Company Name" source="CompanyName" alwaysOn />
|
|
12
|
-
</Filter>
|
|
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>
|
|
13
24
|
);
|
|
14
25
|
|
|
15
|
-
// List view for Shipper resource
|
|
16
|
-
export const ShipperList = (props
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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>
|
|
24
35
|
);
|
|
25
36
|
|
|
26
|
-
// Show view for Shipper resource
|
|
27
|
-
export const ShipperShow = (props
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<Tab label="Related Resource Example">
|
|
36
|
-
<ReferenceField label="Custom Label" source="relationSource" reference="RelatedResource">
|
|
37
|
-
<TextField source="fieldName" />
|
|
38
|
-
</ReferenceField>
|
|
39
|
-
</Tab>
|
|
40
|
-
</TabbedShowLayout>*/}
|
|
41
|
-
</SimpleShowLayout>
|
|
42
|
-
</Show>
|
|
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>
|
|
43
46
|
);
|
|
44
47
|
|
|
45
|
-
// Create view for
|
|
46
|
-
export const ShipperCreate = (props
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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>
|
|
53
56
|
);
|
|
54
57
|
|
|
55
|
-
// Edit view for
|
|
56
|
-
export const ShipperEdit = (props
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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>
|
|
64
67
|
);
|
|
@@ -1,103 +1,87 @@
|
|
|
1
|
-
// Supplier.js
|
|
2
|
-
|
|
3
1
|
import React from 'react';
|
|
4
|
-
import {
|
|
5
|
-
List,
|
|
6
|
-
Datagrid,
|
|
7
|
-
TextField,
|
|
8
|
-
ReferenceField,
|
|
9
|
-
Show,
|
|
10
|
-
SimpleShowLayout,
|
|
11
|
-
TabbedShowLayout,
|
|
12
|
-
Tab,
|
|
13
|
-
Edit,
|
|
14
|
-
Create,
|
|
15
|
-
SimpleForm,
|
|
16
|
-
TextInput,
|
|
17
|
-
NumberInput,
|
|
18
|
-
SelectInput,
|
|
19
|
-
ReferenceInput,
|
|
20
|
-
Filter,
|
|
21
|
-
Pagination,
|
|
22
|
-
} from 'react-admin';
|
|
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';
|
|
23
3
|
|
|
24
|
-
// Filters
|
|
4
|
+
// Filters applied to the supplier list
|
|
25
5
|
const SupplierFilter = (props) => (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</Filter>
|
|
6
|
+
<Filter {...props}>
|
|
7
|
+
<TextInput label="Search by Company Name" source="CompanyName" alwaysOn />
|
|
8
|
+
<TextInput label="Search by Country" source="Country" />
|
|
9
|
+
</Filter>
|
|
31
10
|
);
|
|
32
11
|
|
|
33
|
-
//
|
|
12
|
+
// Listing Suppliers
|
|
34
13
|
export const SupplierList = (props) => (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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>
|
|
46
25
|
);
|
|
47
26
|
|
|
48
|
-
//
|
|
27
|
+
// Show Supplier
|
|
49
28
|
export const SupplierShow = (props) => (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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>
|
|
65
49
|
);
|
|
66
50
|
|
|
67
|
-
//
|
|
51
|
+
// Create a new Supplier
|
|
68
52
|
export const SupplierCreate = (props) => (
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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>
|
|
84
68
|
);
|
|
85
69
|
|
|
86
|
-
//
|
|
70
|
+
// Edit an existing Supplier
|
|
87
71
|
export const SupplierEdit = (props) => (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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>
|
|
103
87
|
);
|
|
@@ -1,84 +1,90 @@
|
|
|
1
|
+
// src/Territory.js
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import {
|
|
3
4
|
List,
|
|
5
|
+
Show,SelectInput,
|
|
4
6
|
Datagrid,
|
|
5
|
-
TextField,
|
|
6
|
-
NumberField,
|
|
7
|
-
NumberInput,
|
|
8
|
-
TextInput,
|
|
9
|
-
Show,
|
|
10
7
|
SimpleShowLayout,
|
|
11
8
|
TabbedShowLayout,
|
|
12
9
|
Tab,
|
|
10
|
+
TextField,
|
|
11
|
+
ReferenceField,
|
|
12
|
+
FunctionField,
|
|
13
|
+
TextInput,
|
|
14
|
+
ReferenceInput,
|
|
13
15
|
Create,
|
|
14
|
-
SimpleForm,
|
|
15
16
|
Edit,
|
|
16
|
-
|
|
17
|
-
ReferenceInput,
|
|
18
|
-
SelectInput,
|
|
17
|
+
SimpleForm,
|
|
19
18
|
Filter,
|
|
20
|
-
|
|
19
|
+
NumberField,
|
|
20
|
+
BooleanField,
|
|
21
|
+
ReferenceManyField,
|
|
21
22
|
} from 'react-admin';
|
|
22
23
|
|
|
23
|
-
//
|
|
24
|
+
// Filter component for the Territory list view
|
|
24
25
|
const TerritoryFilter = (props) => (
|
|
25
26
|
<Filter {...props}>
|
|
26
|
-
<TextInput label="Search" source="
|
|
27
|
-
<TextInput label="Region" source="RegionId" />
|
|
27
|
+
<TextInput label="Search by Description" source="q" alwaysOn />
|
|
28
28
|
</Filter>
|
|
29
29
|
);
|
|
30
30
|
|
|
31
|
-
//
|
|
32
|
-
export const TerritoryList = props => (
|
|
33
|
-
<List {...props} filters={<TerritoryFilter />}
|
|
34
|
-
sort={{ field: 'TerritoryDescription', order: 'ASC' }}>
|
|
31
|
+
// TerritoryList component for displaying a list of territories
|
|
32
|
+
export const TerritoryList = (props) => (
|
|
33
|
+
<List {...props} filters={<TerritoryFilter />}>
|
|
35
34
|
<Datagrid rowClick="show">
|
|
36
35
|
<TextField source="TerritoryDescription" label="Territory Description" />
|
|
37
|
-
<
|
|
38
|
-
<
|
|
36
|
+
<TextField source="Id" label="ID" />
|
|
37
|
+
<ReferenceField label="Region" source="RegionId" reference="Region">
|
|
38
|
+
<TextField source="RegionDescription" />
|
|
39
|
+
</ReferenceField>
|
|
39
40
|
</Datagrid>
|
|
40
41
|
</List>
|
|
41
42
|
);
|
|
42
43
|
|
|
43
|
-
//
|
|
44
|
-
export const TerritoryShow = props => (
|
|
44
|
+
// TerritoryShow component for displaying territory details
|
|
45
|
+
export const TerritoryShow = (props) => (
|
|
45
46
|
<Show {...props}>
|
|
46
47
|
<SimpleShowLayout>
|
|
47
48
|
<TextField source="TerritoryDescription" label="Territory Description" />
|
|
48
|
-
<
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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>
|
|
62
64
|
</SimpleShowLayout>
|
|
63
65
|
</Show>
|
|
64
66
|
);
|
|
65
67
|
|
|
66
|
-
//
|
|
67
|
-
export const TerritoryCreate = props => (
|
|
68
|
+
// TerritoryCreate component for creating new territories
|
|
69
|
+
export const TerritoryCreate = (props) => (
|
|
68
70
|
<Create {...props}>
|
|
69
71
|
<SimpleForm>
|
|
70
72
|
<TextInput source="TerritoryDescription" label="Territory Description" />
|
|
71
|
-
<
|
|
73
|
+
<ReferenceInput label="Region" source="RegionId" reference="Region">
|
|
74
|
+
<SelectInput optionText="RegionDescription" />
|
|
75
|
+
</ReferenceInput>
|
|
72
76
|
</SimpleForm>
|
|
73
77
|
</Create>
|
|
74
78
|
);
|
|
75
79
|
|
|
76
|
-
//
|
|
77
|
-
export const TerritoryEdit = props => (
|
|
80
|
+
// TerritoryEdit component for editing existing territories
|
|
81
|
+
export const TerritoryEdit = (props) => (
|
|
78
82
|
<Edit {...props}>
|
|
79
83
|
<SimpleForm>
|
|
80
84
|
<TextInput source="TerritoryDescription" label="Territory Description" />
|
|
81
|
-
<
|
|
85
|
+
<ReferenceInput label="Region" source="RegionId" reference="Region">
|
|
86
|
+
<SelectInput optionText="RegionDescription" />
|
|
87
|
+
</ReferenceInput>
|
|
82
88
|
</SimpleForm>
|
|
83
89
|
</Edit>
|
|
84
90
|
);
|
|
@@ -1,57 +1,38 @@
|
|
|
1
|
-
// Union.js - React Admin resource definitions and components for the Union entity.
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
List,
|
|
5
|
-
Datagrid,
|
|
6
|
-
TextField,
|
|
7
|
-
NumberField,
|
|
8
|
-
Show,
|
|
9
|
-
SimpleShowLayout,
|
|
10
|
-
TabbedShowLayout,
|
|
11
|
-
Tab,
|
|
12
|
-
TextInput,
|
|
13
|
-
Create,
|
|
14
|
-
SimpleForm,
|
|
15
|
-
Edit,
|
|
16
|
-
ReferenceManyField,
|
|
17
|
-
EditButton,
|
|
18
|
-
ShowButton,
|
|
19
|
-
Pagination,
|
|
20
|
-
Filter,
|
|
21
|
-
} from 'react-admin';
|
|
2
|
+
import { List, Datagrid, TextField, NumberField, Show, SimpleShowLayout, ReferenceManyField, TabbedShowLayout, Tab, TextInput, Create, SimpleForm, Edit, ReferenceField, ReferenceInput, SelectInput, Filter, Pagination } from 'react-admin';
|
|
22
3
|
|
|
4
|
+
// Filter component to be used in List view
|
|
23
5
|
const UnionFilter = (props) => (
|
|
24
6
|
<Filter {...props}>
|
|
25
|
-
<TextInput label="Search by Name" source="
|
|
7
|
+
<TextInput label="Search by Name" source="q" alwaysOn />
|
|
26
8
|
</Filter>
|
|
27
9
|
);
|
|
28
10
|
|
|
11
|
+
// List view for Unions
|
|
29
12
|
export const UnionList = (props) => (
|
|
30
|
-
<List
|
|
31
|
-
{...props}
|
|
32
|
-
filters={<UnionFilter />}
|
|
33
|
-
pagination={<Pagination rowsPerPageOptions={[10, 25, 50]} />}
|
|
34
|
-
sort={{ field: 'Name', order: 'ASC' }}
|
|
35
|
-
>
|
|
13
|
+
<List {...props} filters={<UnionFilter />} pagination={<Pagination rowsPerPageOptions={[7, 14, 28]} />} perPage={7}>
|
|
36
14
|
<Datagrid rowClick="show">
|
|
37
15
|
<TextField source="Name" label="Union Name" />
|
|
38
|
-
<NumberField source="Id" label="ID" />
|
|
39
|
-
<ShowButton />
|
|
16
|
+
<NumberField source="Id" label="Union ID" />
|
|
40
17
|
</Datagrid>
|
|
41
18
|
</List>
|
|
42
19
|
);
|
|
43
20
|
|
|
21
|
+
// Show view for a Union
|
|
44
22
|
export const UnionShow = (props) => (
|
|
45
23
|
<Show {...props}>
|
|
46
24
|
<SimpleShowLayout>
|
|
47
25
|
<TextField source="Name" label="Union Name" />
|
|
26
|
+
<NumberField source="Id" label="Union ID" />
|
|
48
27
|
<TabbedShowLayout>
|
|
49
|
-
<Tab label="
|
|
50
|
-
<ReferenceManyField reference="Employee" target="UnionId"
|
|
28
|
+
<Tab label="Employees">
|
|
29
|
+
<ReferenceManyField reference="Employee" target="UnionId" addLabel={false}>
|
|
51
30
|
<Datagrid>
|
|
52
|
-
<TextField source="LastName"
|
|
53
|
-
<TextField source="FirstName"
|
|
54
|
-
<
|
|
31
|
+
<TextField source="LastName" />
|
|
32
|
+
<TextField source="FirstName" />
|
|
33
|
+
<ReferenceField source="WorksForDepartmentId" reference="Department">
|
|
34
|
+
<TextField source="DepartmentName" />
|
|
35
|
+
</ReferenceField>
|
|
55
36
|
</Datagrid>
|
|
56
37
|
</ReferenceManyField>
|
|
57
38
|
</Tab>
|
|
@@ -60,6 +41,7 @@ export const UnionShow = (props) => (
|
|
|
60
41
|
</Show>
|
|
61
42
|
);
|
|
62
43
|
|
|
44
|
+
// Create view for a new Union
|
|
63
45
|
export const UnionCreate = (props) => (
|
|
64
46
|
<Create {...props}>
|
|
65
47
|
<SimpleForm>
|
|
@@ -68,10 +50,12 @@ export const UnionCreate = (props) => (
|
|
|
68
50
|
</Create>
|
|
69
51
|
);
|
|
70
52
|
|
|
53
|
+
// Edit view for an existing Union
|
|
71
54
|
export const UnionEdit = (props) => (
|
|
72
55
|
<Edit {...props}>
|
|
73
56
|
<SimpleForm>
|
|
74
57
|
<TextInput source="Name" label="Union Name" />
|
|
58
|
+
<NumberField source="Id" label="Union ID" />
|
|
75
59
|
</SimpleForm>
|
|
76
60
|
</Edit>
|
|
77
61
|
);
|