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,51 +1,134 @@
1
- import React from 'react';
2
- import {
3
- List,
4
- Datagrid,
5
- TextField,
6
- NumberField,
7
- Show,
8
- SimpleShowLayout,
9
- TabbedShowLayout,
10
- Tab,
11
- ReferenceManyField,
12
- TextInput,
13
- Edit,
14
- SimpleForm,
15
- Create,
16
- NumberInput,
17
- Pagination,
18
- Filter,
19
- ReferenceField,
20
- FunctionField
21
- } from 'react-admin';
22
- import { Grid, Box } from '@mui/material';
1
+ import React, { useState } from 'react';
2
+ import { List, FunctionField, Datagrid, TextField, DateField, NumberField, ReferenceField, ReferenceManyField, Show, TabbedShowLayout, Tab, SimpleShowLayout, TextInput, NumberInput, DateTimeInput, ReferenceInput, SelectInput, Create, SimpleForm, Edit, Filter, Pagination, BooleanField, BooleanInput, TopToolbar, Button, useListContext } from 'react-admin'; // mandatory import
3
+ import { ToggleButton, ToggleButtonGroup, Box, Card, CardContent, CardActions, Typography } from '@mui/material';
4
+ import { ViewList, ViewModule } from '@mui/icons-material';
23
5
 
24
- // Filters for the Customer list
6
+ // Filters for the list view
25
7
  const CustomerFilter = (props) => (
26
8
  <Filter {...props}>
27
- <TextInput label="Search by Company" source="CompanyName" alwaysOn />
28
- <TextInput label="Search by Contact" source="ContactName" />
9
+ <TextInput label="Search" source="q" alwaysOn />
10
+ <TextInput label="Company Name" source="CompanyName" />
11
+ <TextInput label="Contact Name" source="ContactName" />
12
+ <TextInput label="City" source="City" />
13
+ <TextInput label="Country" source="Country" />
29
14
  </Filter>
30
15
  );
31
16
 
32
- // Customer List
33
- export const CustomerList = (props) => (
34
- <List filters={<CustomerFilter />} pagination={<Pagination />} {...props}>
35
- <Datagrid rowClick="show">
36
- <TextField source="CompanyName" label="Company Name" />
37
- <TextField source="ContactName" label="Contact Name" />
38
- <NumberField source="Balance" label="Balance" />
39
- <NumberField source="CreditLimit" label="Credit Limit" />
40
- <NumberField source="OrderCount" label="Order Count" />
41
- <NumberField source="UnpaidOrderCount" label="Unpaid Orders" />
42
- <TextField source="Phone" label="Phone" />
43
- <NumberField source="Id" label="ID" />
44
- </Datagrid>
45
- </List>
17
+ // Card view component for customers
18
+ const CustomerCard = ({ record, ...props }) => (
19
+ <Card sx={{ margin: 1, minWidth: 300, maxWidth: 350 }}>
20
+ <CardContent>
21
+ <Typography variant="h6" component="div" gutterBottom>
22
+ {record.CompanyName}
23
+ </Typography>
24
+ <Typography variant="body2" color="text.secondary">
25
+ Contact: {record.ContactName}
26
+ </Typography>
27
+ <Typography variant="body2" color="text.secondary">
28
+ {record.Address && `${record.Address}, `}{record.City}
29
+ {record.Region && `, ${record.Region}`}
30
+ </Typography>
31
+ <Typography variant="body2" color="text.secondary">
32
+ {record.Country}
33
+ </Typography>
34
+ {record.Phone && (
35
+ <Typography variant="body2" color="text.secondary">
36
+ Phone: {record.Phone}
37
+ </Typography>
38
+ )}
39
+ {record.Balance && (
40
+ <Typography variant="body2" color="text.primary" sx={{ mt: 1, fontWeight: 'bold' }}>
41
+ Balance: ${record.Balance.toLocaleString()}
42
+ </Typography>
43
+ )}
44
+ </CardContent>
45
+ <CardActions>
46
+ <Button
47
+ size="small"
48
+ onClick={() => window.location.href = `#/Customer/${record.Id}/show`}
49
+ >
50
+ View Details
51
+ </Button>
52
+ <Button
53
+ size="small"
54
+ onClick={() => window.location.href = `#/Customer/${record.Id}`}
55
+ >
56
+ Edit
57
+ </Button>
58
+ </CardActions>
59
+ </Card>
60
+ );
61
+
62
+ // Custom list actions with view toggle
63
+ const CustomerListActions = ({ viewMode, setViewMode }) => (
64
+ <TopToolbar>
65
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
66
+ <ToggleButtonGroup
67
+ value={viewMode}
68
+ exclusive
69
+ onChange={(event, newView) => {
70
+ if (newView !== null) {
71
+ setViewMode(newView);
72
+ }
73
+ }}
74
+ aria-label="view mode"
75
+ size="small"
76
+ >
77
+ <ToggleButton value="list" aria-label="list view">
78
+ <ViewList />
79
+ </ToggleButton>
80
+ <ToggleButton value="cards" aria-label="card view">
81
+ <ViewModule />
82
+ </ToggleButton>
83
+ </ToggleButtonGroup>
84
+ </Box>
85
+ </TopToolbar>
46
86
  );
47
87
 
48
- // Customer Show
88
+ // Custom card grid component that uses react-admin's data context
89
+ const CustomerCardGrid = () => {
90
+ const { data, isLoading } = useListContext();
91
+
92
+ if (isLoading) return <div>Loading...</div>;
93
+
94
+ return (
95
+ <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1, padding: 2 }}>
96
+ {data && data.map((record) => (
97
+ <CustomerCard key={record.Id} record={record} />
98
+ ))}
99
+ </Box>
100
+ );
101
+ };
102
+
103
+ export const CustomerList = (props) => {
104
+ const [viewMode, setViewMode] = useState('list');
105
+
106
+ return (
107
+ <List
108
+ filters={<CustomerFilter />}
109
+ {...props}
110
+ perPage={viewMode === 'cards' ? 12 : 7}
111
+ pagination={<Pagination />}
112
+ actions={<CustomerListActions viewMode={viewMode} setViewMode={setViewMode} />}
113
+ >
114
+ {viewMode === 'list' ? (
115
+ <Datagrid rowClick="show">
116
+ <TextField source="CompanyName" label="Company Name" />
117
+ <TextField source="ContactName" label="Contact Name" />
118
+ <TextField source="Address" label="Address" />
119
+ <TextField source="City" label="City" />
120
+ <TextField source="Country" label="Country" />
121
+ <TextField source="Phone" label="Phone" />
122
+ <TextField source="Fax" label="Fax" />
123
+ <NumberField source="Id" label="Customer ID"/>
124
+ </Datagrid>
125
+ ) : (
126
+ <CustomerCardGrid />
127
+ )}
128
+ </List>
129
+ );
130
+ };
131
+
49
132
  export const CustomerShow = (props) => (
50
133
  <Show {...props}>
51
134
  <SimpleShowLayout>
@@ -59,18 +142,27 @@ export const CustomerShow = (props) => (
59
142
  <TextField source="Country" label="Country" />
60
143
  <TextField source="Phone" label="Phone" />
61
144
  <TextField source="Fax" label="Fax" />
62
-
145
+ <NumberField source="Balance" options={{ style: 'currency', currency: 'USD' }} label="Balance" />
146
+ <NumberField source="CreditLimit" options={{ style: 'currency', currency: 'USD' }} label="Credit Limit" />
147
+ <NumberField source="OrderCount" label="Order Count" />
148
+ <NumberField source="UnpaidOrderCount" label="Unpaid Orders" />
149
+ <NumberField source="Id" label="Customer ID" />
150
+
63
151
  <TabbedShowLayout>
64
- <Tab label="Placed Order List">
152
+ <Tab label="Orders">
65
153
  <ReferenceManyField
154
+ label="Orders"
66
155
  reference="Order"
67
156
  target="CustomerId"
68
- label="Placed Orders"
157
+ perPage={7}
69
158
  >
70
159
  <Datagrid rowClick="show">
71
- <TextField source="Id" label="Order ID" />
72
- <TextField source="OrderDate" label="Order Date" />
73
- <TextField source="AmountTotal" label="Total Amount" />
160
+ <TextField source="ShipName" label="Ship Name" />
161
+ <DateField source="OrderDate" label="Order Date" />
162
+ <DateField source="ShippedDate" label="Shipped Date" />
163
+ <NumberField source="AmountTotal" label="Total Amount" options={{ style: 'currency', currency: 'USD' }}/>
164
+ <BooleanField source="Ready" label="Ready" />
165
+ <NumberField source="Id" label="Order ID" />
74
166
  </Datagrid>
75
167
  </ReferenceManyField>
76
168
  </Tab>
@@ -79,7 +171,6 @@ export const CustomerShow = (props) => (
79
171
  </Show>
80
172
  );
81
173
 
82
- // Customer Create
83
174
  export const CustomerCreate = (props) => (
84
175
  <Create {...props}>
85
176
  <SimpleForm>
@@ -93,11 +184,12 @@ export const CustomerCreate = (props) => (
93
184
  <TextInput source="Country" label="Country" />
94
185
  <TextInput source="Phone" label="Phone" />
95
186
  <TextInput source="Fax" label="Fax" />
187
+ <NumberInput source="Balance" label="Balance" />
188
+ <NumberInput source="CreditLimit" label="Credit Limit" />
96
189
  </SimpleForm>
97
190
  </Create>
98
191
  );
99
192
 
100
- // Customer Edit
101
193
  export const CustomerEdit = (props) => (
102
194
  <Edit {...props}>
103
195
  <SimpleForm>
@@ -111,6 +203,9 @@ export const CustomerEdit = (props) => (
111
203
  <TextInput source="Country" label="Country" />
112
204
  <TextInput source="Phone" label="Phone" />
113
205
  <TextInput source="Fax" label="Fax" />
206
+ <NumberInput source="Balance" label="Balance" />
207
+ <NumberInput source="CreditLimit" label="Credit Limit" />
208
+ <NumberField source="Id" label="Customer ID" />
114
209
  </SimpleForm>
115
210
  </Edit>
116
211
  );
@@ -2,73 +2,56 @@ import React from 'react';
2
2
  import {
3
3
  List,
4
4
  Datagrid,
5
- TextField,
5
+ TextField,
6
6
  Show,
7
7
  SimpleShowLayout,
8
- TabbedShowLayout,
9
- Tab,
8
+ Edit,
9
+ SimpleForm,
10
10
  TextInput,
11
11
  Create,
12
- SimpleForm,
13
- Edit,
14
- NumberField,
15
12
  Filter,
16
- Pagination
13
+ Pagination,
17
14
  } from 'react-admin';
18
15
 
19
- /**
20
- * Filters for searching CustomerDemographic entities by Id.
21
- */
22
16
  const CustomerDemographicFilter = (props) => (
23
17
  <Filter {...props}>
24
- <TextInput label="Search by Id" source="Id" alwaysOn />
18
+ <TextInput label="Search" source="q" alwaysOn />
19
+ <TextInput label="Customer Description" source="CustomerDesc" />
25
20
  </Filter>
26
21
  );
27
22
 
28
- /**
29
- * List view for CustomerDemographic.
30
- */
31
- export const CustomerDemographicList = props => (
32
- <List filters={<CustomerDemographicFilter />} {...props} perPage={7} pagination={<Pagination />}>
33
- <Datagrid rowClick="show" isRowSelectable={() => false}>
34
- <TextField label="Id" source="Id" />
35
- <TextField source="CustomerDesc" />
23
+ export const CustomerDemographicList = (props) => (
24
+ <List filters={<CustomerDemographicFilter />} pagination={<Pagination perPage={7} />} {...props}>
25
+ <Datagrid rowClick="show">
26
+ <TextField source="Id" label="ID" />
27
+ <TextField source="CustomerDesc" label="Customer Description" />
36
28
  </Datagrid>
37
29
  </List>
38
30
  );
39
31
 
40
- /**
41
- * Show view for CustomerDemographic.
42
- */
43
- export const CustomerDemographicShow = props => (
32
+ export const CustomerDemographicShow = (props) => (
44
33
  <Show {...props}>
45
34
  <SimpleShowLayout>
46
- <NumberField source="Id" />
47
- <TextField source="CustomerDesc" />
35
+ <TextField source="Id" label="ID" />
36
+ <TextField source="CustomerDesc" label="Customer Description" />
48
37
  </SimpleShowLayout>
49
38
  </Show>
50
39
  );
51
40
 
52
- /**
53
- * Form for creating a new CustomerDemographic.
54
- */
55
- export const CustomerDemographicCreate = props => (
41
+ export const CustomerDemographicCreate = (props) => (
56
42
  <Create {...props}>
57
43
  <SimpleForm>
58
- <TextInput label="Id (auto-generated)" source="Id" disabled />
59
- <TextInput source="CustomerDesc" />
44
+ <TextInput source="Id" label="ID" />
45
+ <TextInput source="CustomerDesc" label="Customer Description" />
60
46
  </SimpleForm>
61
47
  </Create>
62
48
  );
63
49
 
64
- /**
65
- * Form for editing an existing CustomerDemographic.
66
- */
67
- export const CustomerDemographicEdit = props => (
50
+ export const CustomerDemographicEdit = (props) => (
68
51
  <Edit {...props}>
69
52
  <SimpleForm>
70
- <TextInput label="Id" source="Id" disabled />
71
- <TextInput source="CustomerDesc" />
53
+ <TextInput source="Id" label="ID" disabled />
54
+ <TextInput source="CustomerDesc" label="Customer Description" />
72
55
  </SimpleForm>
73
56
  </Edit>
74
57
  );
@@ -6,70 +6,61 @@ import {
6
6
  NumberField,
7
7
  ReferenceField,
8
8
  Show,
9
+ SimpleShowLayout,
9
10
  TabbedShowLayout,
10
11
  Tab,
11
- SimpleShowLayout,
12
+ ReferenceManyField,
13
+ Edit,
14
+ SimpleForm,
12
15
  TextInput,
13
16
  NumberInput,
14
- ReferenceManyField,
17
+ ReferenceInput,
15
18
  Create,
16
- SimpleForm,
17
- Edit,
18
- Filter,
19
+ SelectInput, Pagination
19
20
  } from 'react-admin';
20
21
 
21
- // Define Filters for the List
22
- // FIXEDME - deleted bogus code: detailed;
23
-
24
- const DepartmentFilter = (props) => (
25
- <Filter {...props}>
26
- <TextInput label="Search by Department Name" source="DepartmentName" alwaysOn />
27
- <NumberInput label="Security Level" source="SecurityLevel" />
28
- </Filter>
29
- );
30
-
31
- // List Component
32
22
  export const DepartmentList = (props) => (
33
- <List filters={<DepartmentFilter />} {...props}>
23
+ <List {...props} filters={<DepartmentFilter />} pagination={<DepartmentPagination />}>
34
24
  <Datagrid rowClick="show">
35
25
  <TextField source="DepartmentName" label="Department Name" />
36
26
  <NumberField source="SecurityLevel" label="Security Level" />
27
+ <NumberField source="Id" label="ID" />
37
28
  </Datagrid>
38
29
  </List>
39
30
  );
40
31
 
41
- // Show Component
42
32
  export const DepartmentShow = (props) => (
43
33
  <Show {...props}>
44
34
  <SimpleShowLayout>
45
35
  <TextField source="DepartmentName" label="Department Name" />
46
36
  <NumberField source="SecurityLevel" label="Security Level" />
47
- <TextField source="Id" label="ID" />
37
+ <NumberField source="Id" label="ID" />
48
38
  </SimpleShowLayout>
49
39
  <TabbedShowLayout>
40
+ <Tab label="Departments">
41
+ <ReferenceManyField reference="Department" target="DepartmentId" label="" perPage={5} sort={{ field: 'Id', order: 'ASC' }}>
42
+ <Datagrid>
43
+ <ReferenceField source="DepartmentId" reference="Department"><TextField source="DepartmentName" /></ReferenceField>
44
+ <NumberField source="SecurityLevel" label="Security Level" />
45
+ <NumberField source="Id" label="ID" />
46
+ </Datagrid>
47
+ </ReferenceManyField>
48
+ </Tab>
50
49
  <Tab label="On Loan Employees">
51
- <ReferenceManyField
52
- reference="Employee"
53
- target="OnLoanDepartmentId"
54
- label="On Loan Employees"
55
- >
50
+ <ReferenceManyField reference="Employee" target="OnLoanDepartmentId" label="" perPage={5} sort={{ field: 'Id', order: 'ASC' }}>
56
51
  <Datagrid>
57
- <TextField source="LastName" label="Employee Last Name" />
58
- <TextField source="FirstName" label="Employee First Name" />
59
- <TextField source="Title" label="Title" />
52
+ <TextField source="LastName" label="Last Name" />
53
+ <TextField source="FirstName" label="First Name" />
54
+ <NumberField source="Id" label="Employee ID" />
60
55
  </Datagrid>
61
56
  </ReferenceManyField>
62
57
  </Tab>
63
58
  <Tab label="Works For Employees">
64
- <ReferenceManyField
65
- reference="Employee"
66
- target="WorksForDepartmentId"
67
- label="Works For Employees"
68
- >
59
+ <ReferenceManyField reference="Employee" target="WorksForDepartmentId" label="" perPage={5} sort={{ field: 'Id', order: 'ASC' }}>
69
60
  <Datagrid>
70
- <TextField source="LastName" label="Employee Last Name" />
71
- <TextField source="FirstName" label="Employee First Name" />
72
- <TextField source="Title" label="Title" />
61
+ <TextField source="LastName" label="Last Name" />
62
+ <TextField source="FirstName" label="First Name" />
63
+ <NumberField source="Id" label="Employee ID" />
73
64
  </Datagrid>
74
65
  </ReferenceManyField>
75
66
  </Tab>
@@ -77,7 +68,6 @@ export const DepartmentShow = (props) => (
77
68
  </Show>
78
69
  );
79
70
 
80
- // Create Component
81
71
  export const DepartmentCreate = (props) => (
82
72
  <Create {...props}>
83
73
  <SimpleForm>
@@ -87,13 +77,22 @@ export const DepartmentCreate = (props) => (
87
77
  </Create>
88
78
  );
89
79
 
90
- // Edit Component
91
80
  export const DepartmentEdit = (props) => (
92
81
  <Edit {...props}>
93
82
  <SimpleForm>
94
83
  <TextInput source="DepartmentName" label="Department Name" />
95
84
  <NumberInput source="SecurityLevel" label="Security Level" />
96
- <NumberInput source="Id" label="ID" disabled />
85
+ <NumberInput source="Id" label="ID" />
97
86
  </SimpleForm>
98
87
  </Edit>
99
- );
88
+ );
89
+
90
+ const DepartmentFilter = (props) => (
91
+ <div>
92
+ <TextInput label="Search By Name" source="DepartmentName" alwaysOn {...props} />
93
+ </div>
94
+ );
95
+
96
+ const DepartmentPagination = () => (
97
+ <Pagination rowsPerPageOptions={[5, 10, 25]} />
98
+ );