ApiLogicServer 15.0.19__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.
Files changed (32) 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 +12 -5
  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-Learning-Prompt.md +33 -17
  6. api_logic_server_cli/prototypes/nw/.DS_Store +0 -0
  7. api_logic_server_cli/prototypes/nw/ui/.DS_Store +0 -0
  8. api_logic_server_cli/prototypes/nw/ui/react_admin/.DS_Store +0 -0
  9. api_logic_server_cli/prototypes/nw/ui/react_admin/src/App.js +30 -31
  10. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Category.js +62 -62
  11. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Customer.js +143 -48
  12. api_logic_server_cli/prototypes/nw/ui/react_admin/src/CustomerDemographic.js +20 -37
  13. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Department.js +38 -39
  14. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Employee.js +85 -134
  15. api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeAudit.js +89 -77
  16. api_logic_server_cli/prototypes/nw/ui/react_admin/src/EmployeeTerritory.js +59 -59
  17. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Location.js +45 -49
  18. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Order.js +42 -60
  19. api_logic_server_cli/prototypes/nw/ui/react_admin/src/OrderDetail.js +97 -106
  20. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Product.js +60 -62
  21. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Region.js +36 -41
  22. api_logic_server_cli/prototypes/nw/ui/react_admin/src/SampleDBVersion.js +73 -0
  23. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Shipper.js +57 -54
  24. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Supplier.js +71 -87
  25. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Territory.js +47 -41
  26. api_logic_server_cli/prototypes/nw/ui/react_admin/src/Union.js +18 -34
  27. {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.20.dist-info}/METADATA +1 -1
  28. {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.20.dist-info}/RECORD +32 -29
  29. {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.20.dist-info}/WHEEL +0 -0
  30. {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.20.dist-info}/entry_points.txt +0 -0
  31. {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.20.dist-info}/licenses/LICENSE +0 -0
  32. {apilogicserver-15.0.19.dist-info → apilogicserver-15.0.20.dist-info}/top_level.txt +0 -0
@@ -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
+ );
@@ -1,64 +1,67 @@
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';
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
- // 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>
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 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>
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 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>
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 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>
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 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>
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 for the Supplier List
4
+ // Filters applied to the supplier list
25
5
  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>
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
- // Supplier List Component
12
+ // Listing Suppliers
34
13
  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>
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
- // Supplier Show Component
27
+ // Show Supplier
49
28
  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>
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
- // Supplier Create Component
51
+ // Create a new Supplier
68
52
  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>
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
- // Supplier Edit Component
70
+ // Edit an existing Supplier
87
71
  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>
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
  );