ApiLogicServer 15.0.14__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.
Files changed (80) hide show
  1. api_logic_server_cli/api_logic_server.py +2 -2
  2. api_logic_server_cli/api_logic_server_info.yaml +2 -2
  3. api_logic_server_cli/cli.py +44 -1
  4. api_logic_server_cli/create_from_model/__pycache__/api_logic_server_utils.cpython-312.pyc +0 -0
  5. api_logic_server_cli/create_from_model/api_logic_server_utils.py +14 -0
  6. api_logic_server_cli/genai/genai_admin_app copy.py +150 -0
  7. api_logic_server_cli/genai/genai_admin_app.py +155 -0
  8. api_logic_server_cli/genai/genai_svcs.py +49 -10
  9. api_logic_server_cli/logging.yml +5 -0
  10. api_logic_server_cli/prototypes/base/config/config.py +4 -3
  11. api_logic_server_cli/prototypes/base/docs/training/admin_app_1_context.prompt.md +3 -0
  12. api_logic_server_cli/prototypes/base/docs/training/admin_app_2_functionality.prompt.md +69 -0
  13. api_logic_server_cli/prototypes/base/docs/training/admin_app_3_architecture.prompt.md +29 -0
  14. api_logic_server_cli/prototypes/base/docs/training/admin_app_unused.md +156 -0
  15. api_logic_server_cli/prototypes/base/integration/mcp/mcp_client_executor.py +15 -12
  16. api_logic_server_cli/prototypes/basic_demo/customizations/docs/mcp_learning/mcp_discovery.json +108 -0
  17. api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-App-Learning-Prompt.md +154 -0
  18. api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/notes.md +7 -0
  19. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/.DS_Store +0 -0
  20. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/README.md +17 -0
  21. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/README_create_react_app.md +70 -0
  22. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/package-lock.json +18469 -0
  23. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/package.json +44 -0
  24. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/public/favicon.ico +0 -0
  25. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/public/index.html +43 -0
  26. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/public/logo192.png +0 -0
  27. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/public/logo512.png +0 -0
  28. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/public/manifest.json +25 -0
  29. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/public/robots.txt +3 -0
  30. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/App.css +38 -0
  31. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/App.js +25 -0
  32. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/App.test.js +8 -0
  33. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/dataProvider.js +110 -0
  34. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/index.css +13 -0
  35. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/index.js +17 -0
  36. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/logo.svg +1 -0
  37. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/reportWebVitals.js +13 -0
  38. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/setupTests.js +5 -0
  39. api_logic_server_cli/prototypes/nw/ui/react_admin/.DS_Store +0 -0
  40. api_logic_server_cli/prototypes/nw/ui/react_admin/README.md +19 -0
  41. api_logic_server_cli/prototypes/nw/ui/react_admin/README_create_react_app.md +70 -0
  42. api_logic_server_cli/prototypes/nw/ui/react_admin/package-lock.json +18469 -0
  43. api_logic_server_cli/prototypes/nw/ui/react_admin/package.json +44 -0
  44. api_logic_server_cli/prototypes/nw/ui/react_admin/public/favicon.ico +0 -0
  45. api_logic_server_cli/prototypes/nw/ui/react_admin/public/index.html +43 -0
  46. api_logic_server_cli/prototypes/nw/ui/react_admin/public/logo192.png +0 -0
  47. api_logic_server_cli/prototypes/nw/ui/react_admin/public/logo512.png +0 -0
  48. api_logic_server_cli/prototypes/nw/ui/react_admin/public/manifest.json +25 -0
  49. api_logic_server_cli/prototypes/nw/ui/react_admin/public/robots.txt +3 -0
  50. api_logic_server_cli/prototypes/nw/ui/react_admin/src/App.css +38 -0
  51. api_logic_server_cli/prototypes/nw/ui/react_admin/src/App.js +59 -0
  52. api_logic_server_cli/prototypes/nw/ui/react_admin/src/App.test.js +8 -0
  53. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Category.js +82 -0
  54. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Customer.js +116 -0
  55. api_logic_server_cli/prototypes/nw/ui/react_admin/src/CustomerDemographic.js +74 -0
  56. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Department.js +99 -0
  57. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Employee.js +149 -0
  58. api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeAudit.js +94 -0
  59. api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeTerritory.js +98 -0
  60. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Location.js +91 -0
  61. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Order.js +116 -0
  62. api_logic_server_cli/prototypes/nw/ui/react_admin/src/OrderDetail.js +121 -0
  63. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Product.js +105 -0
  64. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Region.js +70 -0
  65. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Shipper.js +64 -0
  66. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Supplier.js +103 -0
  67. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Territory.js +84 -0
  68. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Union.js +77 -0
  69. api_logic_server_cli/prototypes/nw/ui/react_admin/src/dataProvider.js +110 -0
  70. api_logic_server_cli/prototypes/nw/ui/react_admin/src/index.css +13 -0
  71. api_logic_server_cli/prototypes/nw/ui/react_admin/src/index.js +17 -0
  72. api_logic_server_cli/prototypes/nw/ui/react_admin/src/logo.svg +1 -0
  73. api_logic_server_cli/prototypes/nw/ui/react_admin/src/reportWebVitals.js +13 -0
  74. api_logic_server_cli/prototypes/nw/ui/react_admin/src/setupTests.js +5 -0
  75. {apilogicserver-15.0.14.dist-info → apilogicserver-15.0.19.dist-info}/METADATA +1 -1
  76. {apilogicserver-15.0.14.dist-info → apilogicserver-15.0.19.dist-info}/RECORD +80 -15
  77. {apilogicserver-15.0.14.dist-info → apilogicserver-15.0.19.dist-info}/WHEEL +0 -0
  78. {apilogicserver-15.0.14.dist-info → apilogicserver-15.0.19.dist-info}/entry_points.txt +0 -0
  79. {apilogicserver-15.0.14.dist-info → apilogicserver-15.0.19.dist-info}/licenses/LICENSE +0 -0
  80. {apilogicserver-15.0.14.dist-info → apilogicserver-15.0.19.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,105 @@
1
+ import React from 'react';
2
+ import {
3
+ List, Datagrid, TextField, ReferenceField, NumberField, BooleanField,
4
+ Show, SimpleShowLayout, TabbedShowLayout, Tab, Create, SimpleForm, Edit, Pagination,
5
+ TextInput, NumberInput, ReferenceInput, SelectInput, Filter
6
+ } from 'react-admin';
7
+
8
+ const ProductFilter = (props) => (
9
+ <Filter {...props}>
10
+ <TextInput label="Search by Product Name" source="ProductName" alwaysOn />
11
+ <NumberInput label="Unit Price" source="UnitPrice" />
12
+ <TextInput label="Category" source="CategoryId" />
13
+ <TextInput label="Supplier" source="SupplierId" />
14
+ </Filter>
15
+ );
16
+
17
+ // List Component
18
+ export const ProductList = (props) => (
19
+ <List {...props} filters={<ProductFilter />} pagination={<Pagination rowsPerPageOptions={[7]} />}>
20
+ <Datagrid rowClick="show">
21
+ <TextField source="ProductName" label="Product Name" />
22
+ <TextField source="QuantityPerUnit" label="Quantity Per Unit" />
23
+ <NumberField source="UnitPrice" label="Unit Price" options={{ style: 'currency', currency: 'USD' }} />
24
+ <NumberField source="UnitsInStock" label="Units In Stock" />
25
+ <BooleanField source="Discontinued" label="Discontinued" />
26
+ <TextField source="UnitsOnOrder" label="Units On Order" />
27
+ <ReferenceField label="Category" source="CategoryId" reference="Category">
28
+ <TextField source="CategoryName" />
29
+ </ReferenceField>
30
+ <ReferenceField label="Supplier" source="SupplierId" reference="Supplier">
31
+ <TextField source="CompanyName" />
32
+ </ReferenceField>
33
+ </Datagrid>
34
+ </List>
35
+ );
36
+
37
+ // Show Component
38
+ export const ProductShow = (props) => (
39
+ <Show {...props}>
40
+ <SimpleShowLayout>
41
+ <TextField source="ProductName" label="Product Name" />
42
+ <TextField source="QuantityPerUnit" label="Quantity Per Unit" />
43
+ <NumberField source="UnitPrice" label="Unit Price" options={{ style: 'currency', currency: 'USD' }} />
44
+ <NumberField source="UnitsInStock" label="Units In Stock" />
45
+ <NumberField source="UnitsOnOrder" label="Units On Order" />
46
+ <NumberField source="ReorderLevel" label="Reorder Level" />
47
+ <BooleanField source="Discontinued" label="Discontinued" />
48
+ <ReferenceField label="Category" source="CategoryId" reference="Category">
49
+ <TextField source="CategoryName" />
50
+ </ReferenceField>
51
+ <ReferenceField label="Supplier" source="SupplierId" reference="Supplier">
52
+ <TextField source="CompanyName" />
53
+ </ReferenceField>
54
+ </SimpleShowLayout>
55
+ <TabbedShowLayout>
56
+ <Tab label="Order Details">
57
+ <ReferenceField reference="OrderDetail" source="Id">
58
+ <TextField source="Id" />
59
+ </ReferenceField>
60
+ </Tab>
61
+ </TabbedShowLayout>
62
+ </Show>
63
+ );
64
+
65
+ // Create Component
66
+ export const ProductCreate = (props) => (
67
+ <Create {...props}>
68
+ <SimpleForm>
69
+ <TextInput source="ProductName" label="Product Name" />
70
+ <TextInput source="QuantityPerUnit" label="Quantity Per Unit" />
71
+ <NumberInput source="UnitPrice" label="Unit Price" />
72
+ <NumberInput source="UnitsInStock" label="Units In Stock" />
73
+ <NumberInput source="UnitsOnOrder" label="Units On Order" />
74
+ <NumberInput source="ReorderLevel" label="Reorder Level" />
75
+ <BooleanField source="Discontinued" label="Discontinued" /> # FIXEDME - BooleanField
76
+ <ReferenceInput label="Category" source="CategoryId" reference="Category">
77
+ <SelectInput optionText="CategoryName" />
78
+ </ReferenceInput>
79
+ <ReferenceInput label="Supplier" source="SupplierId" reference="Supplier">
80
+ <SelectInput optionText="CompanyName" />
81
+ </ReferenceInput>
82
+ </SimpleForm>
83
+ </Create>
84
+ );
85
+
86
+ // Edit Component
87
+ export const ProductEdit = (props) => (
88
+ <Edit {...props}>
89
+ <SimpleForm>
90
+ <TextInput source="ProductName" label="Product Name" />
91
+ <TextInput source="QuantityPerUnit" label="Quantity Per Unit" />
92
+ <NumberInput source="UnitPrice" label="Unit Price" />
93
+ <NumberInput source="UnitsInStock" label="Units In Stock" />
94
+ <NumberInput source="UnitsOnOrder" label="Units On Order" />
95
+ <NumberInput source="ReorderLevel" label="Reorder Level" />
96
+ <BooleanField source="Discontinued" label="Discontinued" /> # FIXEDME - BooleanField
97
+ <ReferenceInput label="Category" source="CategoryId" reference="Category">
98
+ <SelectInput optionText="CategoryName" />
99
+ </ReferenceInput>
100
+ <ReferenceInput label="Supplier" source="SupplierId" reference="Supplier">
101
+ <SelectInput optionText="CompanyName" />
102
+ </ReferenceInput>
103
+ </SimpleForm>
104
+ </Edit>
105
+ );
@@ -0,0 +1,70 @@
1
+ // Region.jsx - This file defines the React Admin components for the Region resource.
2
+
3
+ import React from 'react';
4
+ import {
5
+ List,
6
+ Datagrid,
7
+ TextField,
8
+ Show,
9
+ SimpleShowLayout,
10
+ TabbedShowLayout,
11
+ Tab,
12
+ Edit,
13
+ Create, Filter, // FIXEDME missing imports
14
+ SimpleForm,
15
+ TextInput,
16
+ ReferenceManyField
17
+ } from 'react-admin';
18
+
19
+ const RegionList = (props) => (
20
+ <List {...props} filters={<RegionFilter />}>
21
+ <Datagrid rowClick="show">
22
+ <TextField source="RegionDescription" label="Region Description" />
23
+ <TextField source="Id" label="ID" />
24
+ </Datagrid>
25
+ </List>
26
+ );
27
+
28
+ const RegionShow = (props) => (
29
+ <Show {...props}>
30
+ <SimpleShowLayout>
31
+ <TextField source="RegionDescription" label="Region Description" />
32
+ <TextField source="Id" label="ID" />
33
+ </SimpleShowLayout>
34
+ <TabbedShowLayout>
35
+ <Tab label="Related Territories">
36
+ <ReferenceManyField reference="EmployeeTerritory" target="RegionId" label="Employee Territories">
37
+ <Datagrid rowClick="show">
38
+ <TextField source="TerritoryDescription" label="Territory Description" />
39
+ <TextField source="Id" label="ID" />
40
+ </Datagrid>
41
+ </ReferenceManyField>
42
+ </Tab>
43
+ </TabbedShowLayout>
44
+ </Show>
45
+ );
46
+
47
+ const RegionEdit = (props) => (
48
+ <Edit {...props}>
49
+ <SimpleForm>
50
+ <TextInput source="RegionDescription" label="Region Description" />
51
+ </SimpleForm>
52
+ </Edit>
53
+ );
54
+
55
+
56
+ const RegionCreate = (props) => (
57
+ <Create {...props}>
58
+ <SimpleForm>
59
+ <TextInput source="RegionDescription" label="Region Description*" required />
60
+ </SimpleForm>
61
+ </Create>
62
+ );
63
+
64
+ const RegionFilter = (props) => (
65
+ <Filter {...props}>
66
+ <TextInput label="Search by Description" source="RegionDescription" alwaysOn />
67
+ </Filter>
68
+ );
69
+
70
+ export { RegionList, RegionShow, RegionCreate, RegionEdit };
@@ -0,0 +1,64 @@
1
+ // Importing necessary components and modules from react-admin and material-ui
2
+ import React from 'react';
3
+ import { List, Datagrid, TextField, NumberField, Show, SimpleShowLayout, Create, SimpleForm, Edit, TextInput, ReferenceField, TabbedShowLayout, Tab, ReferenceInput, SelectInput, Pagination, Filter } from 'react-admin';
4
+
5
+ // Filter component for the Shipper resource
6
+ type FilterProps = {
7
+ [key: string]: any,
8
+ };
9
+ const ShipperFilter = (props: FilterProps) => (
10
+ <Filter {...props}>
11
+ <TextInput label="Search by Company Name" source="CompanyName" alwaysOn />
12
+ </Filter>
13
+ );
14
+
15
+ // List view for Shipper resource with pagination, sorting, and filtering
16
+ export const ShipperList = (props: any) => (
17
+ <List {...props} filters={<ShipperFilter />} perPage={7} pagination={<Pagination />}>
18
+ <Datagrid rowClick="show">
19
+ <TextField source="CompanyName" label="Company Name" sortable={true} />
20
+ <TextField source="Phone" label="Phone" />
21
+ <NumberField source="Id" label="ID" />
22
+ </Datagrid>
23
+ </List>
24
+ );
25
+
26
+ // Show view for Shipper resource with fields organized in a simple layout
27
+ export const ShipperShow = (props: any) => (
28
+ <Show {...props} title="Shipper Details">
29
+ <SimpleShowLayout>
30
+ <TextField source="CompanyName" label="Company Name" />
31
+ <TextField source="Phone" label="Phone" />
32
+ <NumberField source="Id" label="ID" />
33
+ {/* Example for future tabbed relation */}
34
+ {/*<TabbedShowLayout>
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>
43
+ );
44
+
45
+ // Create view for adding a new Shipper
46
+ export const ShipperCreate = (props: any) => (
47
+ <Create {...props} title="Create a new Shipper">
48
+ <SimpleForm>
49
+ <TextInput source="CompanyName" label="Company Name" />
50
+ <TextInput source="Phone" label="Phone" />
51
+ </SimpleForm>
52
+ </Create>
53
+ );
54
+
55
+ // Edit view for editing a Shipper
56
+ export const ShipperEdit = (props: any) => (
57
+ <Edit {...props} title="Edit Shipper">
58
+ <SimpleForm>
59
+ <TextInput source="CompanyName" label="Company Name" />
60
+ <TextInput source="Phone" label="Phone" />
61
+ <NumberField source="Id" label="ID" />
62
+ </SimpleForm>
63
+ </Edit>
64
+ );
@@ -0,0 +1,103 @@
1
+ // Supplier.js
2
+
3
+ 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';
23
+
24
+ // Filters for the Supplier List
25
+ const SupplierFilter = (props) => (
26
+ <Filter {...props}>
27
+ <TextInput label="Search by Company Name" source="CompanyName" alwaysOn />
28
+ <TextInput label="Search by Contact Name" source="ContactName" />
29
+ <TextInput label="Search by City" source="City" />
30
+ </Filter>
31
+ );
32
+
33
+ // Supplier List Component
34
+ export const SupplierList = (props) => (
35
+ <List filters={<SupplierFilter />} pagination={<Pagination />} {...props}>
36
+ <Datagrid rowClick="show">
37
+ <TextField source="CompanyName" label="Company Name" />
38
+ <TextField source="ContactName" label="Contact Name" />
39
+ <TextField source="ContactTitle" label="Contact Title" />
40
+ <TextField source="Address" label="Address" />
41
+ <TextField source="City" label="City" />
42
+ <TextField source="Country" label="Country" />
43
+ <TextField source="Phone" label="Phone" />
44
+ </Datagrid>
45
+ </List>
46
+ );
47
+
48
+ // Supplier Show Component
49
+ export const SupplierShow = (props) => (
50
+ <Show {...props}>
51
+ <SimpleShowLayout>
52
+ <TextField source="CompanyName" label="Company Name" />
53
+ <TextField source="ContactName" label="Contact Name" />
54
+ <TextField source="ContactTitle" label="Contact Title" />
55
+ <TextField source="Address" label="Address" />
56
+ <TextField source="City" label="City" />
57
+ <TextField source="Region" label="Region" />
58
+ <TextField source="PostalCode" label="Postal Code" />
59
+ <TextField source="Country" label="Country" />
60
+ <TextField source="Phone" label="Phone" />
61
+ <TextField source="Fax" label="Fax" />
62
+ <TextField source="HomePage" label="Home Page" />
63
+ </SimpleShowLayout>
64
+ </Show>
65
+ );
66
+
67
+ // Supplier Create Component
68
+ export const SupplierCreate = (props) => (
69
+ <Create {...props}>
70
+ <SimpleForm>
71
+ <TextInput source="CompanyName" label="Company Name" />
72
+ <TextInput source="ContactName" label="Contact Name" />
73
+ <TextInput source="ContactTitle" label="Contact Title" />
74
+ <TextInput source="Address" label="Address" />
75
+ <TextInput source="City" label="City" />
76
+ <TextInput source="Region" label="Region" />
77
+ <TextInput source="PostalCode" label="Postal Code" />
78
+ <TextInput source="Country" label="Country" />
79
+ <TextInput source="Phone" label="Phone" />
80
+ <TextInput source="Fax" label="Fax" />
81
+ <TextInput source="HomePage" label="Home Page" />
82
+ </SimpleForm>
83
+ </Create>
84
+ );
85
+
86
+ // Supplier Edit Component
87
+ export const SupplierEdit = (props) => (
88
+ <Edit {...props}>
89
+ <SimpleForm>
90
+ <TextInput source="CompanyName" label="Company Name" />
91
+ <TextInput source="ContactName" label="Contact Name" />
92
+ <TextInput source="ContactTitle" label="Contact Title" />
93
+ <TextInput source="Address" label="Address" />
94
+ <TextInput source="City" label="City" />
95
+ <TextInput source="Region" label="Region" />
96
+ <TextInput source="PostalCode" label="Postal Code" />
97
+ <TextInput source="Country" label="Country" />
98
+ <TextInput source="Phone" label="Phone" />
99
+ <TextInput source="Fax" label="Fax" />
100
+ <TextInput source="HomePage" label="Home Page" />
101
+ </SimpleForm>
102
+ </Edit>
103
+ );
@@ -0,0 +1,84 @@
1
+ import React from 'react';
2
+ import {
3
+ List,
4
+ Datagrid,
5
+ TextField,
6
+ NumberField,
7
+ NumberInput,
8
+ TextInput,
9
+ Show,
10
+ SimpleShowLayout,
11
+ TabbedShowLayout,
12
+ Tab,
13
+ Create,
14
+ SimpleForm,
15
+ Edit,
16
+ ReferenceManyField,
17
+ ReferenceInput,
18
+ SelectInput,
19
+ Filter,
20
+ Pagination
21
+ } from 'react-admin';
22
+
23
+ // Define filters for Territories list which include search capabilities
24
+ const TerritoryFilter = (props) => (
25
+ <Filter {...props}>
26
+ <TextInput label="Search" source="TerritoryDescription" alwaysOn />
27
+ <TextInput label="Region" source="RegionId" />
28
+ </Filter>
29
+ );
30
+
31
+ // List component to display Territories
32
+ export const TerritoryList = props => (
33
+ <List {...props} filters={<TerritoryFilter />} pagination={<Pagination />}
34
+ sort={{ field: 'TerritoryDescription', order: 'ASC' }}>
35
+ <Datagrid rowClick="show">
36
+ <TextField source="TerritoryDescription" label="Territory Description" />
37
+ <NumberField source="Id" label="ID" />
38
+ <NumberField source="RegionId" label="Region ID" />
39
+ </Datagrid>
40
+ </List>
41
+ );
42
+
43
+ // Show component to display details of a specific Territory
44
+ export const TerritoryShow = props => (
45
+ <Show {...props}>
46
+ <SimpleShowLayout>
47
+ <TextField source="TerritoryDescription" label="Territory Description" />
48
+ <NumberField source="Id" label="ID" />
49
+ <NumberField source="RegionId" label="Region ID" />
50
+
51
+ {/* Related Employee Territories shown in a tabbed layout */}
52
+ <TabbedShowLayout>
53
+ <Tab label="Employee Territories List">
54
+ <ReferenceManyField reference="EmployeeTerritory" target="TerritoryId" label="Employee Territories">
55
+ <Datagrid rowClick="show">
56
+ <TextField source="Id" label="ID" />
57
+ <NumberField source="EmployeeId" label="Employee ID" />
58
+ </Datagrid>
59
+ </ReferenceManyField>
60
+ </Tab>
61
+ </TabbedShowLayout>
62
+ </SimpleShowLayout>
63
+ </Show>
64
+ );
65
+
66
+ // Create component for adding a new territory
67
+ export const TerritoryCreate = props => (
68
+ <Create {...props}>
69
+ <SimpleForm>
70
+ <TextInput source="TerritoryDescription" label="Territory Description" />
71
+ <NumberInput source="RegionId" label="Region ID" />
72
+ </SimpleForm>
73
+ </Create>
74
+ );
75
+
76
+ // Edit component for modifying existing territory data
77
+ export const TerritoryEdit = props => (
78
+ <Edit {...props}>
79
+ <SimpleForm>
80
+ <TextInput source="TerritoryDescription" label="Territory Description" />
81
+ <NumberInput source="RegionId" label="Region ID" />
82
+ </SimpleForm>
83
+ </Edit>
84
+ );
@@ -0,0 +1,77 @@
1
+ // Union.js - React Admin resource definitions and components for the Union entity.
2
+ 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';
22
+
23
+ const UnionFilter = (props) => (
24
+ <Filter {...props}>
25
+ <TextInput label="Search by Name" source="Name" alwaysOn />
26
+ </Filter>
27
+ );
28
+
29
+ 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
+ >
36
+ <Datagrid rowClick="show">
37
+ <TextField source="Name" label="Union Name" />
38
+ <NumberField source="Id" label="ID" />
39
+ <ShowButton />
40
+ </Datagrid>
41
+ </List>
42
+ );
43
+
44
+ export const UnionShow = (props) => (
45
+ <Show {...props}>
46
+ <SimpleShowLayout>
47
+ <TextField source="Name" label="Union Name" />
48
+ <TabbedShowLayout>
49
+ <Tab label="Members">
50
+ <ReferenceManyField reference="Employee" target="UnionId" label="Union Employees">
51
+ <Datagrid>
52
+ <TextField source="LastName" label="Last Name" />
53
+ <TextField source="FirstName" label="First Name" />
54
+ <ShowButton />
55
+ </Datagrid>
56
+ </ReferenceManyField>
57
+ </Tab>
58
+ </TabbedShowLayout>
59
+ </SimpleShowLayout>
60
+ </Show>
61
+ );
62
+
63
+ export const UnionCreate = (props) => (
64
+ <Create {...props}>
65
+ <SimpleForm>
66
+ <TextInput source="Name" label="Union Name" />
67
+ </SimpleForm>
68
+ </Create>
69
+ );
70
+
71
+ export const UnionEdit = (props) => (
72
+ <Edit {...props}>
73
+ <SimpleForm>
74
+ <TextInput source="Name" label="Union Name" />
75
+ </SimpleForm>
76
+ </Edit>
77
+ );
@@ -0,0 +1,110 @@
1
+ import { fetchUtils } from 'react-admin';
2
+
3
+ const apiUrl = 'http://localhost:5656/api';
4
+ const httpClient = fetchUtils.fetchJson;
5
+
6
+ const convertId = (record) => ({
7
+ ...record.attributes,
8
+ id: record.id,
9
+ });
10
+
11
+ export const dataProvider = {
12
+ getList: async (resource, params) => {
13
+ const { page, perPage } = params.pagination;
14
+ const { field, order } = params.sort;
15
+ const query = {
16
+ [`page[number]`]: page,
17
+ [`page[size]`]: perPage,
18
+ [`sort`]: order === 'ASC' ? field : `-${field}`,
19
+ };
20
+
21
+ // Filters (e.g. filter[name]=Alice)
22
+ Object.entries(params.filter || {}).forEach(([key, value]) => {
23
+ query[`filter[${key}]`] = value;
24
+ });
25
+
26
+ const url = `${apiUrl}/${resource}?${new URLSearchParams(query).toString()}`;
27
+ const { json } = await httpClient(url);
28
+ return {
29
+ data: json.data.map(convertId),
30
+ total: json.meta?.total || json.data.length,
31
+ };
32
+ },
33
+
34
+ getOne: async (resource, params) => {
35
+ const url = `${apiUrl}/${resource}/${params.id}`;
36
+ const { json } = await httpClient(url);
37
+ return {
38
+ data: convertId(json.data),
39
+ };
40
+ },
41
+
42
+ getMany: async (resource, params) => {
43
+ const promises = params.ids.map((id) =>
44
+ httpClient(`${apiUrl}/${resource}/${id}`).then(({ json }) => convertId(json.data))
45
+ );
46
+ const data = await Promise.all(promises);
47
+ return { data };
48
+ },
49
+
50
+ getManyReference: async (resource, params) => {
51
+ const { page, perPage } = params.pagination;
52
+ const { field, order } = params.sort;
53
+ const query = {
54
+ [`page[number]`]: page,
55
+ [`page[size]`]: perPage,
56
+ [`sort`]: order === 'ASC' ? field : `-${field}`,
57
+ [`filter[${params.target}]`]: params.id,
58
+ };
59
+
60
+ const url = `${apiUrl}/${resource}?${new URLSearchParams(query).toString()}`;
61
+ const { json } = await httpClient(url);
62
+ return {
63
+ data: json.data.map(convertId),
64
+ total: json.meta?.total || json.data.length,
65
+ };
66
+ },
67
+
68
+ create: async (resource, params) => {
69
+ const url = `${apiUrl}/${resource}`;
70
+ const body = {
71
+ data: {
72
+ type: resource,
73
+ attributes: params.data,
74
+ },
75
+ };
76
+ const { json } = await httpClient(url, {
77
+ method: 'POST',
78
+ body: JSON.stringify(body),
79
+ });
80
+ return {
81
+ data: convertId(json.data),
82
+ };
83
+ },
84
+
85
+ update: async (resource, params) => {
86
+ const url = `${apiUrl}/${resource}/${params.id}`;
87
+ const body = {
88
+ data: {
89
+ type: resource,
90
+ id: params.id,
91
+ attributes: params.data,
92
+ },
93
+ };
94
+ const { json } = await httpClient(url, {
95
+ method: 'PATCH',
96
+ body: JSON.stringify(body),
97
+ });
98
+ return {
99
+ data: convertId(json.data),
100
+ };
101
+ },
102
+
103
+ delete: async (resource, params) => {
104
+ const url = `${apiUrl}/${resource}/${params.id}`;
105
+ await httpClient(url, {
106
+ method: 'DELETE',
107
+ });
108
+ return { data: { id: params.id } };
109
+ },
110
+ };
@@ -0,0 +1,13 @@
1
+ body {
2
+ margin: 0;
3
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4
+ 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5
+ sans-serif;
6
+ -webkit-font-smoothing: antialiased;
7
+ -moz-osx-font-smoothing: grayscale;
8
+ }
9
+
10
+ code {
11
+ font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12
+ monospace;
13
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import './index.css';
4
+ import App from './App';
5
+ import reportWebVitals from './reportWebVitals';
6
+
7
+ const root = ReactDOM.createRoot(document.getElementById('root'));
8
+ root.render(
9
+ <React.StrictMode>
10
+ <App />
11
+ </React.StrictMode>
12
+ );
13
+
14
+ // If you want to start measuring performance in your app, pass a function
15
+ // to log results (for example: reportWebVitals(console.log))
16
+ // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
17
+ reportWebVitals();
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>
@@ -0,0 +1,13 @@
1
+ const reportWebVitals = onPerfEntry => {
2
+ if (onPerfEntry && onPerfEntry instanceof Function) {
3
+ import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4
+ getCLS(onPerfEntry);
5
+ getFID(onPerfEntry);
6
+ getFCP(onPerfEntry);
7
+ getLCP(onPerfEntry);
8
+ getTTFB(onPerfEntry);
9
+ });
10
+ }
11
+ };
12
+
13
+ export default reportWebVitals;