@openmrs/esm-stock-management-app 1.0.1-pre.694 → 1.0.1-pre.702
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/574.js +1 -1
- package/dist/973.js +1 -1
- package/dist/973.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-stock-management-app.js.buildmanifest.json +9 -9
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/stock-operations/stock-operations-table.component.tsx +49 -42
- package/src/stock-operations/stock-operations-table.resource.tsx +10 -4
- package/translations/en.json +2 -1
@@ -134,10 +134,10 @@
|
|
134
134
|
"initial": true,
|
135
135
|
"entry": true,
|
136
136
|
"recorded": false,
|
137
|
-
"size":
|
137
|
+
"size": 5408566,
|
138
138
|
"sizes": {
|
139
139
|
"consume-shared": 252,
|
140
|
-
"javascript":
|
140
|
+
"javascript": 5386617,
|
141
141
|
"share-init": 252,
|
142
142
|
"runtime": 21445
|
143
143
|
},
|
@@ -154,7 +154,7 @@
|
|
154
154
|
"auxiliaryFiles": [
|
155
155
|
"main.js.map"
|
156
156
|
],
|
157
|
-
"hash": "
|
157
|
+
"hash": "bde00c76e90fc524",
|
158
158
|
"childrenByOrder": {}
|
159
159
|
},
|
160
160
|
{
|
@@ -326,9 +326,9 @@
|
|
326
326
|
"initial": false,
|
327
327
|
"entry": false,
|
328
328
|
"recorded": false,
|
329
|
-
"size":
|
329
|
+
"size": 11531,
|
330
330
|
"sizes": {
|
331
|
-
"javascript":
|
331
|
+
"javascript": 11531
|
332
332
|
},
|
333
333
|
"names": [],
|
334
334
|
"idHints": [],
|
@@ -340,7 +340,7 @@
|
|
340
340
|
"574.js"
|
341
341
|
],
|
342
342
|
"auxiliaryFiles": [],
|
343
|
-
"hash": "
|
343
|
+
"hash": "882eba03e470bb3e",
|
344
344
|
"childrenByOrder": {}
|
345
345
|
},
|
346
346
|
{
|
@@ -607,9 +607,9 @@
|
|
607
607
|
"initial": false,
|
608
608
|
"entry": false,
|
609
609
|
"recorded": false,
|
610
|
-
"size":
|
610
|
+
"size": 1749694,
|
611
611
|
"sizes": {
|
612
|
-
"javascript":
|
612
|
+
"javascript": 1749484,
|
613
613
|
"consume-shared": 210
|
614
614
|
},
|
615
615
|
"names": [],
|
@@ -623,7 +623,7 @@
|
|
623
623
|
"auxiliaryFiles": [
|
624
624
|
"973.js.map"
|
625
625
|
],
|
626
|
-
"hash": "
|
626
|
+
"hash": "4e40bb4e6400af3e",
|
627
627
|
"childrenByOrder": {}
|
628
628
|
}
|
629
629
|
]
|
package/dist/routes.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.24.0"},"extensions":[{"name":"stock-nav-menu","slot":"stock-sidebar-slot","component":"stockNavMenu","online":true,"offline":true},{"name":"overview-db-link","slot":"stock-page-dashboard-slot","component":"stockOverviewLink","meta":{"name":"overview","slot":"overview-dashboard-slot","title":"overview"},"order":0,"online":true,"offline":true},{"name":"stock-overview-db","slot":"overview-dashboard-slot","component":"stockOverview"},{"name":"operations-db-link","slot":"stock-page-dashboard-slot","component":"stockOperationsLink","meta":{"name":"operations","slot":"operations-dashboard-slot","title":"operations"},"order":2,"online":true,"offline":true},{"name":"stock-operations-db","slot":"operations-dashboard-slot","component":"stockOperations"},{"name":"items-db-link","slot":"stock-page-dashboard-slot","component":"stockItemsLink","meta":{"name":"items","slot":"items-dashboard-slot","title":"items"},"order":1,"online":true,"offline":true},{"name":"stock-items-db","slot":"items-dashboard-slot","component":"stockItems"},{"name":"user-scopes-db-link","slot":"stock-page-dashboard-slot","component":"stockUserScopesLink","meta":{"name":"user-scopes","slot":"user-scopes-dashboard-slot","title":"user-scopes"},"order":3,"online":true,"offline":true},{"name":"stock-user-scopes-db","slot":"user-scopes-dashboard-slot","component":"stockUserScopes"},{"name":"sources-db-link","slot":"stock-page-dashboard-slot","component":"stockSourcesLink","meta":{"name":"sources","slot":"sources-dashboard-slot","title":"Sources"},"order":2,"online":true,"offline":true},{"name":"stock-sources-db","slot":"sources-dashboard-slot","component":"stockSources"},{"name":"locations-db-link","slot":"stock-page-dashboard-slot","component":"stockLocationsLink","meta":{"name":"locations","slot":"locations-dashboard-slot","title":"Locations"},"order":4,"online":true,"offline":true},{"name":"stock-locations-db","slot":"locations-dashboard-slot","component":"stockLocations"},{"name":"reports-db-link","slot":"stock-page-dashboard-slot","component":"stockReportsLink","meta":{"name":"reports","slot":"reports-dashboard-slot","title":"Reports"},"order":5,"online":true,"offline":true},{"name":"stock-reports-db","slot":"reports-dashboard-slot","component":"stockReports"},{"name":"settings-db-link","slot":"stock-page-dashboard-slot","component":"stockSettingsLink","meta":{"name":"settings","slot":"settings-dashboard-slot","title":"Settings"},"order":6,"online":true,"offline":true},{"name":"stock-settings-db","slot":"settings-dashboard-slot","component":"stockSettings"},{"name":"stock-management-admin-card-link","slot":"system-admin-page-card-link-slot","component":"stockManagementAdminCardLink"},{"name":"stock-management-app-menu-item","component":"stockManagementAppMenuItem","slot":"app-menu-item-slot","meta":{"name":" Stock Management"}},{"name":"delete-packaging-unit-button","component":"deletePackagingUnitButton"}],"modals":[{"name":"delete-stock-modal","component":"deleteStockModal"},{"name":"delete-stock-user-scope-modal","component":"deleteUserScopeModal"},{"name":"delete-stock-rule-modal","component":"deleteStockRuleModal"},{"name":"delete-packaging-unit-modal","component":"deletePackagingUnitModal"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsModal"},{"name":"stock-operation-dialog","component":"stockOperationModal"}],"pages":[{"component":"root","route":"stock-management"}],"version":"1.0.1-pre.
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.24.0"},"extensions":[{"name":"stock-nav-menu","slot":"stock-sidebar-slot","component":"stockNavMenu","online":true,"offline":true},{"name":"overview-db-link","slot":"stock-page-dashboard-slot","component":"stockOverviewLink","meta":{"name":"overview","slot":"overview-dashboard-slot","title":"overview"},"order":0,"online":true,"offline":true},{"name":"stock-overview-db","slot":"overview-dashboard-slot","component":"stockOverview"},{"name":"operations-db-link","slot":"stock-page-dashboard-slot","component":"stockOperationsLink","meta":{"name":"operations","slot":"operations-dashboard-slot","title":"operations"},"order":2,"online":true,"offline":true},{"name":"stock-operations-db","slot":"operations-dashboard-slot","component":"stockOperations"},{"name":"items-db-link","slot":"stock-page-dashboard-slot","component":"stockItemsLink","meta":{"name":"items","slot":"items-dashboard-slot","title":"items"},"order":1,"online":true,"offline":true},{"name":"stock-items-db","slot":"items-dashboard-slot","component":"stockItems"},{"name":"user-scopes-db-link","slot":"stock-page-dashboard-slot","component":"stockUserScopesLink","meta":{"name":"user-scopes","slot":"user-scopes-dashboard-slot","title":"user-scopes"},"order":3,"online":true,"offline":true},{"name":"stock-user-scopes-db","slot":"user-scopes-dashboard-slot","component":"stockUserScopes"},{"name":"sources-db-link","slot":"stock-page-dashboard-slot","component":"stockSourcesLink","meta":{"name":"sources","slot":"sources-dashboard-slot","title":"Sources"},"order":2,"online":true,"offline":true},{"name":"stock-sources-db","slot":"sources-dashboard-slot","component":"stockSources"},{"name":"locations-db-link","slot":"stock-page-dashboard-slot","component":"stockLocationsLink","meta":{"name":"locations","slot":"locations-dashboard-slot","title":"Locations"},"order":4,"online":true,"offline":true},{"name":"stock-locations-db","slot":"locations-dashboard-slot","component":"stockLocations"},{"name":"reports-db-link","slot":"stock-page-dashboard-slot","component":"stockReportsLink","meta":{"name":"reports","slot":"reports-dashboard-slot","title":"Reports"},"order":5,"online":true,"offline":true},{"name":"stock-reports-db","slot":"reports-dashboard-slot","component":"stockReports"},{"name":"settings-db-link","slot":"stock-page-dashboard-slot","component":"stockSettingsLink","meta":{"name":"settings","slot":"settings-dashboard-slot","title":"Settings"},"order":6,"online":true,"offline":true},{"name":"stock-settings-db","slot":"settings-dashboard-slot","component":"stockSettings"},{"name":"stock-management-admin-card-link","slot":"system-admin-page-card-link-slot","component":"stockManagementAdminCardLink"},{"name":"stock-management-app-menu-item","component":"stockManagementAppMenuItem","slot":"app-menu-item-slot","meta":{"name":" Stock Management"}},{"name":"delete-packaging-unit-button","component":"deletePackagingUnitButton"}],"modals":[{"name":"delete-stock-modal","component":"deleteStockModal"},{"name":"delete-stock-user-scope-modal","component":"deleteUserScopeModal"},{"name":"delete-stock-rule-modal","component":"deleteStockRuleModal"},{"name":"delete-packaging-unit-modal","component":"deletePackagingUnitModal"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsModal"},{"name":"stock-operation-dialog","component":"stockOperationModal"}],"pages":[{"component":"root","route":"stock-management"}],"version":"1.0.1-pre.702"}
|
package/package.json
CHANGED
@@ -133,48 +133,55 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
133
133
|
);
|
134
134
|
|
135
135
|
const tableRows = useMemo(() => {
|
136
|
-
return items?.map((stockOperation, index) =>
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
136
|
+
return items?.map((stockOperation, index) => {
|
137
|
+
const commonNames = stockOperation?.stockOperationItems
|
138
|
+
? stockOperation?.stockOperationItems.map((item) => item.commonName).join(', ')
|
139
|
+
: '';
|
140
|
+
|
141
|
+
return {
|
142
|
+
...stockOperation,
|
143
|
+
id: stockOperation?.uuid,
|
144
|
+
key: `key-${stockOperation?.uuid}`,
|
145
|
+
operationTypeName: `${stockOperation?.operationTypeName}`,
|
146
|
+
operationNumber: (
|
147
|
+
<EditStockOperationActionMenu
|
148
|
+
model={stockOperation}
|
149
|
+
operations={operations}
|
150
|
+
operationUuid={operation.uuid}
|
151
|
+
operationNumber={''}
|
152
|
+
onEdit={() => handleEditClick(stockOperation, true)}
|
153
|
+
showIcon={false}
|
154
|
+
showprops={true}
|
155
|
+
/>
|
156
|
+
),
|
157
|
+
stockOperationItems: commonNames,
|
158
|
+
status: `${stockOperation?.status}`,
|
159
|
+
source: `${stockOperation?.sourceName ?? ''}`,
|
160
|
+
destination: `${stockOperation?.destinationName ?? ''}`,
|
161
|
+
location: (
|
162
|
+
<>
|
163
|
+
{stockOperation?.sourceName ?? ''}
|
164
|
+
{stockOperation?.sourceName && stockOperation?.destinationName ? <ArrowRight size={16} /> : ''}{' '}
|
165
|
+
{stockOperation?.destinationName ?? ''}
|
166
|
+
</>
|
167
|
+
),
|
168
|
+
responsiblePerson: `${
|
169
|
+
stockOperation?.responsiblePersonFamilyName ?? stockOperation?.responsiblePersonOther ?? ''
|
170
|
+
} ${stockOperation?.responsiblePersonGivenName ?? ''}`,
|
171
|
+
operationDate: formatDisplayDate(stockOperation?.operationDate),
|
172
|
+
actions: (
|
173
|
+
<EditStockOperationActionMenu
|
174
|
+
model={stockOperation}
|
175
|
+
operations={operations}
|
176
|
+
operationUuid={operation.uuid}
|
177
|
+
operationNumber={''}
|
178
|
+
onEdit={() => handleEditClick(stockOperation, true)}
|
179
|
+
showIcon={true}
|
180
|
+
showprops={false}
|
181
|
+
/>
|
182
|
+
),
|
183
|
+
};
|
184
|
+
});
|
178
185
|
}, [items, operations, handleEditClick, operation]);
|
179
186
|
|
180
187
|
if (isLoading && !filterApplied) {
|
@@ -8,6 +8,7 @@ export function useStockOperationPages(filter: StockOperationFilter) {
|
|
8
8
|
|
9
9
|
const pageSizes = [10, 20, 30, 40, 50];
|
10
10
|
const [currentPageSize, setPageSize] = useState(10);
|
11
|
+
console.log(items.results);
|
11
12
|
|
12
13
|
const { goTo, results: paginatedItems, currentPage } = usePagination(items.results, currentPageSize);
|
13
14
|
|
@@ -27,26 +28,31 @@ export function useStockOperationPages(filter: StockOperationFilter) {
|
|
27
28
|
},
|
28
29
|
{
|
29
30
|
id: 2,
|
31
|
+
header: t('stockOperationItems', 'Items'),
|
32
|
+
key: 'stockOperationItems',
|
33
|
+
},
|
34
|
+
{
|
35
|
+
id: 3,
|
30
36
|
header: t('status', 'Status'),
|
31
37
|
key: 'status',
|
32
38
|
},
|
33
39
|
{
|
34
|
-
id:
|
40
|
+
id: 4,
|
35
41
|
header: t('location', 'Location'),
|
36
42
|
key: 'location',
|
37
43
|
},
|
38
44
|
{
|
39
|
-
id:
|
45
|
+
id: 5,
|
40
46
|
header: t('responsiblePerson', 'Responsible Person'),
|
41
47
|
key: 'responsiblePerson',
|
42
48
|
},
|
43
49
|
{
|
44
|
-
id:
|
50
|
+
id: 6,
|
45
51
|
header: t('date', 'Date'),
|
46
52
|
key: 'operationDate',
|
47
53
|
},
|
48
54
|
{
|
49
|
-
id:
|
55
|
+
id: 7,
|
50
56
|
key: 'details',
|
51
57
|
},
|
52
58
|
{ key: 'actions', header: '' },
|