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.
Files changed (51) hide show
  1. api_logic_server_cli/api_logic_server.py +4 -4
  2. api_logic_server_cli/api_logic_server_info.yaml +2 -2
  3. api_logic_server_cli/genai/genai_admin_app.py +33 -9
  4. api_logic_server_cli/prototypes/.DS_Store +0 -0
  5. api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-App-Resource-Learning-Prompt.md +119 -0
  6. api_logic_server_cli/prototypes/manager/system/genai/app_templates/app_learning/Admin-App-js-Learning-Prompt.md +71 -0
  7. 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
  8. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/package.json +3 -0
  9. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/Config.js +527 -0
  10. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/app_loader.js +24 -0
  11. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/.eslintrc +5 -0
  12. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/.yarnrc.yml +4 -0
  13. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/default-settings.js +25 -0
  14. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/default-settings.ts +25 -0
  15. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/errors.js +116 -0
  16. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/errors.ts +116 -0
  17. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/index.test.tsx +7 -0
  18. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/index.tsx +11 -0
  19. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/ra-jsonapi-client.js +577 -0
  20. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/ra-jsonapi-client.ts +577 -0
  21. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/resourceLookup.js +124 -0
  22. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/resourceLookup.ts +124 -0
  23. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/rav4-jsonapi-client/styles.module.css +9 -0
  24. api_logic_server_cli/prototypes/nw/.DS_Store +0 -0
  25. api_logic_server_cli/prototypes/nw/ui/.DS_Store +0 -0
  26. api_logic_server_cli/prototypes/nw/ui/react_admin/.DS_Store +0 -0
  27. api_logic_server_cli/prototypes/nw/ui/react_admin/src/App.js +30 -31
  28. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Category.js +62 -62
  29. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Customer.js +143 -48
  30. api_logic_server_cli/prototypes/nw/ui/react_admin/src/CustomerDemographic.js +20 -37
  31. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Department.js +38 -39
  32. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Employee.js +85 -134
  33. api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeAudit.js +89 -77
  34. api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeTerritory.js +59 -59
  35. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Location.js +45 -49
  36. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Order.js +42 -60
  37. api_logic_server_cli/prototypes/nw/ui/react_admin/src/OrderDetail.js +97 -106
  38. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Product.js +60 -62
  39. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Region.js +36 -41
  40. api_logic_server_cli/prototypes/nw/ui/react_admin/src/SampleDBVersion.js +73 -0
  41. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Shipper.js +57 -54
  42. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Supplier.js +71 -87
  43. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Territory.js +47 -41
  44. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Union.js +18 -34
  45. {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.22.dist-info}/METADATA +1 -1
  46. {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.22.dist-info}/RECORD +50 -31
  47. api_logic_server_cli/prototypes/manager/system/genai/app_templates/react-admin-template/src/dataProvider.js +0 -110
  48. {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.22.dist-info}/WHEEL +0 -0
  49. {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.22.dist-info}/entry_points.txt +0 -0
  50. {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.22.dist-info}/licenses/LICENSE +0 -0
  51. {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.22.dist-info}/top_level.txt +0 -0
@@ -1,121 +1,112 @@
1
- // `OrderDetail.js`
2
-
3
1
  import React from 'react';
4
2
  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,
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
28
22
  } from 'react-admin';
29
23
 
30
- // Filters for the OrderDetail list, allowing users to search and sort.
24
+ // Filter component for OrderDetail
31
25
  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>
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>
41
35
  );
42
36
 
43
- // Main list view with sorting, filtering, and pagination.
37
+ // List component for OrderDetail
44
38
  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>
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>
67
77
  );
68
78
 
69
- // The Create view for OrderDetail with inline validation and auto-complete dropdowns for related references.
79
+ // Create component for OrderDetail
70
80
  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>
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>
83
94
  );
84
95
 
85
- // The Edit view for OrderDetail with form fields for updating exiting records.
96
+ // Edit component for OrderDetail
86
97
  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>
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>
101
112
  );
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
- );
@@ -1,105 +1,103 @@
1
1
  import React from 'react';
2
2
  import {
3
- List, Datagrid, TextField, ReferenceField, NumberField, BooleanField,
4
- Show, SimpleShowLayout, TabbedShowLayout, Tab, Create, SimpleForm, Edit, Pagination,
5
- TextInput, NumberInput, ReferenceInput, SelectInput, Filter
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
6
  } from 'react-admin';
7
7
 
8
+ // Filters for the Product List
8
9
  const ProductFilter = (props) => (
9
10
  <Filter {...props}>
10
11
  <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" />
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>
14
18
  </Filter>
15
19
  );
16
20
 
17
- // List Component
21
+ // List view of Products
18
22
  export const ProductList = (props) => (
19
- <List {...props} filters={<ProductFilter />} pagination={<Pagination rowsPerPageOptions={[7]} />}>
23
+ <List {...props} filters={<ProductFilter />} pagination={<Pagination rowsPerPageOptions={[5, 10, 25]} />}>
20
24
  <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" />
25
+ <TextField source="ProductName" />
26
+ <ReferenceField source="CategoryId" reference="Category">
27
+ <TextField source="CategoryName_ColumnName" />
32
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" />
33
35
  </Datagrid>
34
36
  </List>
35
37
  );
36
38
 
37
- // Show Component
39
+ // Show view of Products
38
40
  export const ProductShow = (props) => (
39
41
  <Show {...props}>
40
42
  <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" />
43
+ <TextField source="ProductName" />
44
+ <ReferenceField source="CategoryId" reference="Category">
45
+ <TextField source="CategoryName_ColumnName" />
53
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" />
54
53
  </SimpleShowLayout>
55
54
  <TabbedShowLayout>
56
55
  <Tab label="Order Details">
57
- <ReferenceField reference="OrderDetail" source="Id">
58
- <TextField source="Id" />
59
- </ReferenceField>
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>
60
66
  </Tab>
61
67
  </TabbedShowLayout>
62
68
  </Show>
63
69
  );
64
70
 
65
- // Create Component
71
+ // Create view for Products
66
72
  export const ProductCreate = (props) => (
67
73
  <Create {...props}>
68
74
  <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" />
75
+ <TextInput source="ProductName" />
76
+ <ReferenceInput source="CategoryId" reference="Category">
77
+ <SelectInput optionText="CategoryName_ColumnName" />
81
78
  </ReferenceInput>
79
+ <NumberInput source="UnitPrice" />
80
+ <NumberInput source="UnitsInStock" />
81
+ <NumberInput source="UnitsOnOrder" />
82
+ <NumberInput source="ReorderLevel" />
83
+ <BooleanField source="Discontinued" />
82
84
  </SimpleForm>
83
85
  </Create>
84
86
  );
85
87
 
86
- // Edit Component
88
+ // Edit view for Products
87
89
  export const ProductEdit = (props) => (
88
90
  <Edit {...props}>
89
91
  <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" />
92
+ <TextInput source="ProductName" />
93
+ <ReferenceInput source="CategoryId" reference="Category">
94
+ <SelectInput optionText="CategoryName_ColumnName" />
102
95
  </ReferenceInput>
96
+ <NumberInput source="UnitPrice" />
97
+ <NumberInput source="UnitsInStock" />
98
+ <NumberInput source="UnitsOnOrder" />
99
+ <NumberInput source="ReorderLevel" />
100
+ <BooleanField source="Discontinued" />
103
101
  </SimpleForm>
104
102
  </Edit>
105
- );
103
+ );
@@ -1,70 +1,65 @@
1
- // Region.jsx - This file defines the React Admin components for the Region resource.
2
-
3
1
  import React from 'react';
4
2
  import {
5
3
  List,
6
4
  Datagrid,
7
5
  TextField,
6
+ ReferenceField,
8
7
  Show,
9
8
  SimpleShowLayout,
10
- TabbedShowLayout,
11
- Tab,
12
- Edit,
13
- Create, Filter, // FIXEDME missing imports
9
+ Create,
14
10
  SimpleForm,
15
11
  TextInput,
16
- ReferenceManyField
17
- } from 'react-admin';
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
+ );
18
24
 
19
- const RegionList = (props) => (
20
- <List {...props} filters={<RegionFilter />}>
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}>
21
31
  <Datagrid rowClick="show">
22
- <TextField source="RegionDescription" label="Region Description" />
23
- <TextField source="Id" label="ID" />
32
+ <TextField source="RegionDescription" label="Region Description" sortable />
33
+ <TextField source="Id" label="Region ID" sortable={false} />
24
34
  </Datagrid>
25
35
  </List>
26
36
  );
27
37
 
28
- const RegionShow = (props) => (
38
+ // Region Show Component
39
+ export const RegionShow = props => (
29
40
  <Show {...props}>
30
41
  <SimpleShowLayout>
31
42
  <TextField source="RegionDescription" label="Region Description" />
32
- <TextField source="Id" label="ID" />
43
+ <TextField source="Id" label="Region ID" />
33
44
  </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
45
  </Show>
45
46
  );
46
47
 
47
- const RegionEdit = (props) => (
48
- <Edit {...props}>
48
+ // Region Create Component
49
+ export const RegionCreate = props => (
50
+ <Create {...props}>
49
51
  <SimpleForm>
50
52
  <TextInput source="RegionDescription" label="Region Description" />
51
53
  </SimpleForm>
52
- </Edit>
54
+ </Create>
53
55
  );
54
56
 
55
-
56
- const RegionCreate = (props) => (
57
- <Create {...props}>
57
+ // Region Edit Component
58
+ export const RegionEdit = props => (
59
+ <Edit {...props}>
58
60
  <SimpleForm>
59
- <TextInput source="RegionDescription" label="Region Description*" required />
61
+ <TextInput source="RegionDescription" label="Region Description" />
62
+ <TextField source="Id" label="Region ID" disabled />
60
63
  </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 };
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
+ );