@openmrs/esm-stock-management-app 3.0.1-pre.845 → 3.0.1-pre.853
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.
- package/.husky/pre-commit +4 -1
- package/__mocks__/react-i18next.js +8 -9
- package/dist/10.js +1 -1
- package/dist/10.js.map +1 -1
- package/dist/119.js +1 -1
- package/dist/119.js.map +1 -1
- package/dist/14.js +1 -1
- package/dist/14.js.map +1 -1
- package/dist/172.js +1 -1
- package/dist/172.js.map +1 -1
- package/dist/20.js +1 -1
- package/dist/20.js.map +1 -1
- package/dist/290.js +1 -1
- package/dist/290.js.map +1 -1
- package/dist/33.js +1 -0
- package/dist/33.js.map +1 -0
- package/dist/467.js +1 -1
- package/dist/467.js.map +1 -1
- package/dist/574.js +1 -1
- package/dist/606.js +1 -1
- package/dist/606.js.map +1 -1
- package/dist/642.js +1 -1
- package/dist/642.js.map +1 -1
- package/dist/675.js +1 -1
- package/dist/675.js.map +1 -1
- package/dist/727.js +1 -1
- package/dist/727.js.map +1 -1
- package/dist/842.js +1 -1
- package/dist/842.js.map +1 -1
- package/dist/93.js +1 -1
- package/dist/93.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 +70 -70
- package/dist/routes.json +1 -1
- package/jest.config.js +6 -3
- package/package.json +1 -1
- package/src/core/components/overlay/overlay.scss +1 -1
- package/src/core/components/privilages-component/privilages.scss +1 -1
- package/src/core/components/table/table.component.tsx +2 -2
- package/src/core/components/table/table.scss +1 -1
- package/src/core/components/tabs/vertical-tabs.scss +1 -1
- package/src/index.ts +5 -5
- package/src/stock-items/add-bulk-stock-item/add-stock-items-bulk-import-action-button.component.tsx +3 -3
- package/src/stock-items/add-bulk-stock-item/{stock-items-bulk-import.component.tsx → stock-items-bulk-import.modal.tsx} +20 -19
- package/src/stock-items/add-bulk-stock-item/stock-items-bulk-import.resource.ts +1 -1
- package/src/stock-items/add-bulk-stock-item/stock-items-bulk-import.test.tsx +59 -59
- package/src/stock-items/add-stock-item/add-stock-action-button.component.tsx +6 -6
- package/src/stock-items/add-stock-item/add-stock-item.component.tsx +6 -4
- package/src/stock-items/add-stock-item/add-stock-item.scss +5 -0
- package/src/stock-items/add-stock-item/add-stock-item.test.tsx +28 -43
- package/src/stock-items/add-stock-item/packaging-units/packaging-units-delete-modal.component.tsx +3 -4
- package/src/stock-items/add-stock-item/packaging-units/packaging-units.component.tsx +9 -10
- package/src/stock-items/add-stock-item/packaging-units/packaging-units.scss +4 -4
- package/src/stock-items/add-stock-item/stock-item-details/stock-item-details.component.tsx +27 -19
- package/src/stock-items/add-stock-item/stock-item-details/stock-item-details.scss +1 -1
- package/src/stock-items/add-stock-item/stock-item-references/stock-item-references.scss +4 -4
- package/src/stock-items/add-stock-item/stock-item-rules/add-stock-rules.component.tsx +15 -9
- package/src/stock-items/add-stock-item/stock-item-rules/add-stock-rules.scss +1 -0
- package/src/stock-items/add-stock-item/stock-item-rules/delete-stock-rule-modal.component.tsx +2 -1
- package/src/stock-items/add-stock-item/stock-item-rules/stock-item-rules.component.tsx +14 -16
- package/src/stock-items/add-stock-item/stock-item-rules/stock-item-rules.scss +7 -3
- package/src/stock-items/add-stock-item/transactions/printout/transactions-print-bincard-preview.modal.tsx +14 -6
- package/src/stock-items/add-stock-item/transactions/printout/transactions-print-stockcard-preview.modal.tsx +14 -8
- package/src/stock-items/edit-stock-item/edit-stock-item-action-menu.component.tsx +2 -2
- package/src/stock-items/stock-item.utils.tsx +3 -5
- package/src/stock-items/stock-items-table.component.tsx +47 -45
- package/src/stock-items/stock-items-table.resource.ts +2 -2
- package/src/stock-items/stock-items-table.scss +9 -8
- package/src/stock-items/stock-items-table.test.tsx +106 -65
- package/src/stock-items/stock-items.component.tsx +1 -1
- package/src/stock-locations/location-admin-form.component.tsx +5 -4
- package/src/stock-locations/stock-locations-table.component.tsx +10 -8
- package/src/stock-locations/stock-locations.component.tsx +1 -1
- package/src/stock-lookups/stock-lookups.resource.ts +3 -2
- package/src/stock-management-header/stock-management-header.scss +1 -1
- package/src/stock-operations/add-stock-operation/stock-operations-expanded-row/stock-operation-expanded-row.scss +1 -1
- package/src/stock-operations/stock-operations-dialog/stock-operations-dialog.component.tsx +2 -2
- package/src/stock-operations/stock-operations-filters.component.tsx +5 -5
- package/src/stock-operations/stock-operations-forms/input-components/batch-no-selector.component.tsx +11 -11
- package/src/stock-operations/stock-operations-forms/input-components/batch-no-selector.test.tsx +115 -25
- package/src/stock-operations/stock-operations-forms/input-components/qty-uim-selector.test.tsx +107 -65
- package/src/stock-operations/stock-operations-forms/input-components/quantity-uom-selector.component.tsx +9 -9
- package/src/stock-operations/stock-operations-forms/input-components/stock-operation-reason-selector.test.tsx +35 -153
- package/src/stock-operations/stock-operations-forms/input-components/user-selector.test.tsx +82 -29
- package/src/stock-operations/stock-operations-forms/step1.test.tsx +204 -69
- package/src/stock-operations/stock-operations-forms/step2.test.tsx +140 -63
- package/src/stock-operations/stock-operations-forms/step3.test.tsx +79 -60
- package/src/stock-operations/stock-operations-forms/steps/stock-operation-items-form-step.component.tsx +6 -5
- package/src/stock-operations/stock-operations-forms/steps/stock-operation-submission-form-step.component.tsx +12 -11
- package/src/stock-operations/stock-operations-forms/stock-item-form/stock-item-form.scss +1 -0
- package/src/stock-operations/stock-operations-forms/stock-item-form/stock-item-form.workspace.tsx +20 -12
- package/src/stock-operations/stock-operations-forms/stock-operation-form.scss +1 -0
- package/src/stock-operations/stock-operations-forms/stock-operation-stepper/stepper.scss +1 -3
- package/src/stock-operations/stock-operations-forms/stock-operation-stepper/stock-operation-stepper.component.tsx +2 -1
- package/src/stock-operations/stock-operations-table.component.tsx +66 -73
- package/src/stock-operations/stock-operations-table.scss +18 -9
- package/src/stock-operations/stock-operations.component.tsx +1 -1
- package/src/stock-reports/generate-report/create-stock-report.scss +3 -2
- package/src/stock-reports/generate-report/create-stock-report.workspace.tsx +32 -25
- package/src/stock-reports/report-list/stock-report-parameters.component.tsx +1 -1
- package/src/stock-reports/report-list/stock-report-status.component.tsx +1 -1
- package/src/stock-reports/report-list/stock-reports.component.tsx +24 -25
- package/src/stock-reports/report-list/stock-reports.scss +11 -3
- package/src/stock-sources/add-stock-sources/add-stock-sources.scss +12 -5
- package/src/stock-sources/add-stock-sources/add-stock-sources.test.tsx +38 -36
- package/src/stock-sources/add-stock-sources/add-stock-sources.workspace.tsx +35 -30
- package/src/stock-sources/delete-stock-modal.component.tsx +2 -1
- package/src/stock-sources/delete-stock-modal.scss +1 -1
- package/src/stock-sources/stock-sources-delete/stock-sources-delete.test.tsx +27 -36
- package/src/stock-sources/stock-sources-filter/stock-sources-filter.component.tsx +33 -21
- package/src/stock-sources/stock-sources-items-table.component.tsx +16 -17
- package/src/stock-sources/stock-sources-items-table.resource.ts +8 -6
- package/src/stock-sources/stock-sources-items-table.test.tsx +60 -37
- package/src/stock-sources/stock-sources.component.tsx +1 -1
- package/src/stock-sources/stock-sources.scss +6 -2
- package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.scss +5 -13
- package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.workspace.tsx +2 -2
- package/src/stock-user-role-scopes/delete-stock-user-scope-modal.component.tsx +2 -1
- package/src/stock-user-role-scopes/delete-stock-user-scope-modal.scss +1 -1
- package/src/stock-user-role-scopes/stock-user-role-scopes.component.tsx +1 -1
- package/src/stock-user-role-scopes/stock-user-role-scopes.scss +1 -1
- package/translations/en.json +5 -6
- package/tsconfig.json +4 -0
- package/dist/627.js +0 -1
- package/dist/627.js.map +0 -1
@@ -6,9 +6,9 @@
|
|
6
6
|
"entry": false,
|
7
7
|
"recorded": false,
|
8
8
|
"reason": "split chunk (cache group: default)",
|
9
|
-
"size":
|
9
|
+
"size": 48556,
|
10
10
|
"sizes": {
|
11
|
-
"javascript":
|
11
|
+
"javascript": 48556
|
12
12
|
},
|
13
13
|
"names": [],
|
14
14
|
"idHints": [],
|
@@ -22,7 +22,7 @@
|
|
22
22
|
"auxiliaryFiles": [
|
23
23
|
"10.js.map"
|
24
24
|
],
|
25
|
-
"hash": "
|
25
|
+
"hash": "17ed7dc17cd26a7c",
|
26
26
|
"childrenByOrder": {}
|
27
27
|
},
|
28
28
|
{
|
@@ -30,9 +30,9 @@
|
|
30
30
|
"initial": false,
|
31
31
|
"entry": false,
|
32
32
|
"recorded": false,
|
33
|
-
"size":
|
33
|
+
"size": 1235998,
|
34
34
|
"sizes": {
|
35
|
-
"javascript":
|
35
|
+
"javascript": 1235830,
|
36
36
|
"consume-shared": 168
|
37
37
|
},
|
38
38
|
"names": [],
|
@@ -46,7 +46,7 @@
|
|
46
46
|
"auxiliaryFiles": [
|
47
47
|
"14.js.map"
|
48
48
|
],
|
49
|
-
"hash": "
|
49
|
+
"hash": "f5a48af402e466e9",
|
50
50
|
"childrenByOrder": {}
|
51
51
|
},
|
52
52
|
{
|
@@ -54,9 +54,9 @@
|
|
54
54
|
"initial": false,
|
55
55
|
"entry": false,
|
56
56
|
"recorded": false,
|
57
|
-
"size":
|
57
|
+
"size": 15418,
|
58
58
|
"sizes": {
|
59
|
-
"javascript":
|
59
|
+
"javascript": 15418
|
60
60
|
},
|
61
61
|
"names": [],
|
62
62
|
"idHints": [],
|
@@ -70,7 +70,7 @@
|
|
70
70
|
"auxiliaryFiles": [
|
71
71
|
"20.js.map"
|
72
72
|
],
|
73
|
-
"hash": "
|
73
|
+
"hash": "93c6b6b454c03f48",
|
74
74
|
"childrenByOrder": {}
|
75
75
|
},
|
76
76
|
{
|
@@ -105,9 +105,33 @@
|
|
105
105
|
"initial": false,
|
106
106
|
"entry": false,
|
107
107
|
"recorded": false,
|
108
|
-
"size":
|
108
|
+
"size": 9330,
|
109
109
|
"sizes": {
|
110
|
-
"javascript":
|
110
|
+
"javascript": 9330
|
111
|
+
},
|
112
|
+
"names": [],
|
113
|
+
"idHints": [],
|
114
|
+
"runtime": [
|
115
|
+
"@openmrs/esm-stock-management-app",
|
116
|
+
"main"
|
117
|
+
],
|
118
|
+
"files": [
|
119
|
+
"33.js"
|
120
|
+
],
|
121
|
+
"auxiliaryFiles": [
|
122
|
+
"33.js.map"
|
123
|
+
],
|
124
|
+
"hash": "2bf9136ba0abb4d8",
|
125
|
+
"childrenByOrder": {}
|
126
|
+
},
|
127
|
+
{
|
128
|
+
"rendered": true,
|
129
|
+
"initial": false,
|
130
|
+
"entry": false,
|
131
|
+
"recorded": false,
|
132
|
+
"size": 42642,
|
133
|
+
"sizes": {
|
134
|
+
"javascript": 42642
|
111
135
|
},
|
112
136
|
"names": [],
|
113
137
|
"idHints": [],
|
@@ -121,7 +145,7 @@
|
|
121
145
|
"auxiliaryFiles": [
|
122
146
|
"93.js.map"
|
123
147
|
],
|
124
|
-
"hash": "
|
148
|
+
"hash": "bcb04e259b07cb83",
|
125
149
|
"childrenByOrder": {}
|
126
150
|
},
|
127
151
|
{
|
@@ -129,9 +153,9 @@
|
|
129
153
|
"initial": false,
|
130
154
|
"entry": false,
|
131
155
|
"recorded": false,
|
132
|
-
"size":
|
156
|
+
"size": 66521,
|
133
157
|
"sizes": {
|
134
|
-
"javascript":
|
158
|
+
"javascript": 66521
|
135
159
|
},
|
136
160
|
"names": [],
|
137
161
|
"idHints": [],
|
@@ -145,7 +169,7 @@
|
|
145
169
|
"auxiliaryFiles": [
|
146
170
|
"119.js.map"
|
147
171
|
],
|
148
|
-
"hash": "
|
172
|
+
"hash": "9e0ece5b55d8b927",
|
149
173
|
"childrenByOrder": {}
|
150
174
|
},
|
151
175
|
{
|
@@ -196,7 +220,7 @@
|
|
196
220
|
"auxiliaryFiles": [
|
197
221
|
"152.js.map"
|
198
222
|
],
|
199
|
-
"hash": "
|
223
|
+
"hash": "00aaf1426ecbea5b",
|
200
224
|
"childrenByOrder": {}
|
201
225
|
},
|
202
226
|
{
|
@@ -204,9 +228,9 @@
|
|
204
228
|
"initial": false,
|
205
229
|
"entry": false,
|
206
230
|
"recorded": false,
|
207
|
-
"size":
|
231
|
+
"size": 31487,
|
208
232
|
"sizes": {
|
209
|
-
"javascript":
|
233
|
+
"javascript": 31487
|
210
234
|
},
|
211
235
|
"names": [],
|
212
236
|
"idHints": [],
|
@@ -220,7 +244,7 @@
|
|
220
244
|
"auxiliaryFiles": [
|
221
245
|
"172.js.map"
|
222
246
|
],
|
223
|
-
"hash": "
|
247
|
+
"hash": "907bd3d7c926ba2e",
|
224
248
|
"childrenByOrder": {}
|
225
249
|
},
|
226
250
|
{
|
@@ -228,10 +252,10 @@
|
|
228
252
|
"initial": true,
|
229
253
|
"entry": true,
|
230
254
|
"recorded": false,
|
231
|
-
"size":
|
255
|
+
"size": 5612543,
|
232
256
|
"sizes": {
|
233
257
|
"consume-shared": 210,
|
234
|
-
"javascript":
|
258
|
+
"javascript": 5591013,
|
235
259
|
"share-init": 210,
|
236
260
|
"runtime": 21110
|
237
261
|
},
|
@@ -248,7 +272,7 @@
|
|
248
272
|
"auxiliaryFiles": [
|
249
273
|
"main.js.map"
|
250
274
|
],
|
251
|
-
"hash": "
|
275
|
+
"hash": "c16398c853a201ae",
|
252
276
|
"childrenByOrder": {}
|
253
277
|
},
|
254
278
|
{
|
@@ -272,7 +296,7 @@
|
|
272
296
|
"auxiliaryFiles": [
|
273
297
|
"235.js.map"
|
274
298
|
],
|
275
|
-
"hash": "
|
299
|
+
"hash": "189f7cff0509156c",
|
276
300
|
"childrenByOrder": {}
|
277
301
|
},
|
278
302
|
{
|
@@ -302,9 +326,9 @@
|
|
302
326
|
"initial": false,
|
303
327
|
"entry": false,
|
304
328
|
"recorded": false,
|
305
|
-
"size":
|
329
|
+
"size": 31559,
|
306
330
|
"sizes": {
|
307
|
-
"javascript":
|
331
|
+
"javascript": 31559
|
308
332
|
},
|
309
333
|
"names": [],
|
310
334
|
"idHints": [],
|
@@ -318,7 +342,7 @@
|
|
318
342
|
"auxiliaryFiles": [
|
319
343
|
"290.js.map"
|
320
344
|
],
|
321
|
-
"hash": "
|
345
|
+
"hash": "e892a72c4d88b49a",
|
322
346
|
"childrenByOrder": {}
|
323
347
|
},
|
324
348
|
{
|
@@ -394,9 +418,9 @@
|
|
394
418
|
"initial": false,
|
395
419
|
"entry": false,
|
396
420
|
"recorded": false,
|
397
|
-
"size":
|
421
|
+
"size": 61369,
|
398
422
|
"sizes": {
|
399
|
-
"javascript":
|
423
|
+
"javascript": 61369
|
400
424
|
},
|
401
425
|
"names": [],
|
402
426
|
"idHints": [],
|
@@ -410,7 +434,7 @@
|
|
410
434
|
"auxiliaryFiles": [
|
411
435
|
"467.js.map"
|
412
436
|
],
|
413
|
-
"hash": "
|
437
|
+
"hash": "9971a8a2606f5583",
|
414
438
|
"childrenByOrder": {}
|
415
439
|
},
|
416
440
|
{
|
@@ -442,9 +466,9 @@
|
|
442
466
|
"initial": false,
|
443
467
|
"entry": false,
|
444
468
|
"recorded": false,
|
445
|
-
"size":
|
469
|
+
"size": 13491,
|
446
470
|
"sizes": {
|
447
|
-
"javascript":
|
471
|
+
"javascript": 13491
|
448
472
|
},
|
449
473
|
"names": [],
|
450
474
|
"idHints": [],
|
@@ -456,7 +480,7 @@
|
|
456
480
|
"574.js"
|
457
481
|
],
|
458
482
|
"auxiliaryFiles": [],
|
459
|
-
"hash": "
|
483
|
+
"hash": "190c255666a90aed",
|
460
484
|
"childrenByOrder": {}
|
461
485
|
},
|
462
486
|
{
|
@@ -464,9 +488,9 @@
|
|
464
488
|
"initial": false,
|
465
489
|
"entry": false,
|
466
490
|
"recorded": false,
|
467
|
-
"size":
|
491
|
+
"size": 16600,
|
468
492
|
"sizes": {
|
469
|
-
"javascript":
|
493
|
+
"javascript": 16600
|
470
494
|
},
|
471
495
|
"names": [],
|
472
496
|
"idHints": [],
|
@@ -480,31 +504,7 @@
|
|
480
504
|
"auxiliaryFiles": [
|
481
505
|
"606.js.map"
|
482
506
|
],
|
483
|
-
"hash": "
|
484
|
-
"childrenByOrder": {}
|
485
|
-
},
|
486
|
-
{
|
487
|
-
"rendered": true,
|
488
|
-
"initial": false,
|
489
|
-
"entry": false,
|
490
|
-
"recorded": false,
|
491
|
-
"size": 9345,
|
492
|
-
"sizes": {
|
493
|
-
"javascript": 9345
|
494
|
-
},
|
495
|
-
"names": [],
|
496
|
-
"idHints": [],
|
497
|
-
"runtime": [
|
498
|
-
"@openmrs/esm-stock-management-app",
|
499
|
-
"main"
|
500
|
-
],
|
501
|
-
"files": [
|
502
|
-
"627.js"
|
503
|
-
],
|
504
|
-
"auxiliaryFiles": [
|
505
|
-
"627.js.map"
|
506
|
-
],
|
507
|
-
"hash": "32663bf91f830cc9",
|
507
|
+
"hash": "de055858f3d1b0f1",
|
508
508
|
"childrenByOrder": {}
|
509
509
|
},
|
510
510
|
{
|
@@ -536,9 +536,9 @@
|
|
536
536
|
"initial": false,
|
537
537
|
"entry": false,
|
538
538
|
"recorded": false,
|
539
|
-
"size":
|
539
|
+
"size": 217823,
|
540
540
|
"sizes": {
|
541
|
-
"javascript":
|
541
|
+
"javascript": 217823
|
542
542
|
},
|
543
543
|
"names": [],
|
544
544
|
"idHints": [],
|
@@ -552,7 +552,7 @@
|
|
552
552
|
"auxiliaryFiles": [
|
553
553
|
"642.js.map"
|
554
554
|
],
|
555
|
-
"hash": "
|
555
|
+
"hash": "0ff4c902817e1ac3",
|
556
556
|
"childrenByOrder": {}
|
557
557
|
},
|
558
558
|
{
|
@@ -581,9 +581,9 @@
|
|
581
581
|
"initial": false,
|
582
582
|
"entry": false,
|
583
583
|
"recorded": false,
|
584
|
-
"size":
|
584
|
+
"size": 27716,
|
585
585
|
"sizes": {
|
586
|
-
"javascript":
|
586
|
+
"javascript": 27716
|
587
587
|
},
|
588
588
|
"names": [],
|
589
589
|
"idHints": [],
|
@@ -597,7 +597,7 @@
|
|
597
597
|
"auxiliaryFiles": [
|
598
598
|
"675.js.map"
|
599
599
|
],
|
600
|
-
"hash": "
|
600
|
+
"hash": "56496672eaa23ddf",
|
601
601
|
"childrenByOrder": {}
|
602
602
|
},
|
603
603
|
{
|
@@ -621,7 +621,7 @@
|
|
621
621
|
"auxiliaryFiles": [
|
622
622
|
"703.js.map"
|
623
623
|
],
|
624
|
-
"hash": "
|
624
|
+
"hash": "ee5dd12815fcdaae",
|
625
625
|
"childrenByOrder": {}
|
626
626
|
},
|
627
627
|
{
|
@@ -653,9 +653,9 @@
|
|
653
653
|
"initial": false,
|
654
654
|
"entry": false,
|
655
655
|
"recorded": false,
|
656
|
-
"size":
|
656
|
+
"size": 331228,
|
657
657
|
"sizes": {
|
658
|
-
"javascript":
|
658
|
+
"javascript": 331228
|
659
659
|
},
|
660
660
|
"names": [],
|
661
661
|
"idHints": [],
|
@@ -669,7 +669,7 @@
|
|
669
669
|
"auxiliaryFiles": [
|
670
670
|
"727.js.map"
|
671
671
|
],
|
672
|
-
"hash": "
|
672
|
+
"hash": "2cdbfbc571536659",
|
673
673
|
"childrenByOrder": {}
|
674
674
|
},
|
675
675
|
{
|
@@ -810,7 +810,7 @@
|
|
810
810
|
"auxiliaryFiles": [
|
811
811
|
"842.js.map"
|
812
812
|
],
|
813
|
-
"hash": "
|
813
|
+
"hash": "7f297458351c949a",
|
814
814
|
"childrenByOrder": {}
|
815
815
|
},
|
816
816
|
{
|
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":"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":"expired-stock-modal","component":"expiredStockModal"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsModal"},{"name":"receiving-stock-modal","component":"receivingStockModal"},{"name":"stock-operation-dialog","component":"stockOperationModal"},{"name":"transactions-print-bincard-preview-modal","component":"transactionBincardPrintPreviewModal"},{"name":"transactions-print-stockcard-preview-modal","component":"transactionStockcardPrintPreviewModal"}],"workspaces":[{"name":"stock-operation-form-workspace","component":"stockOperationFormWorkspace","title":"Stock Operation","type":"form","canMaximize":true,"width":"extra-wide"},{"name":"stock-item-rules-form-workspace","component":"stockItemRulesFormWorkspace","title":"Stock Item Rules","type":"form"},{"name":"stock-item-form-workspace","component":"stockItemFormWorkspace","title":"Stock Items","type":"form","canMaximize":true,"width":"extra-wide"},{"name":"stock-sources-form-workspace","component":"stockSourcesFormWorkspace","title":"Stock Sources","type":"form","canMaximize":true,"width":"extra-wide"},{"name":"stock-location-form-workspace","component":"stockLocationsFormWorkspace","title":"Stock Locations","type":"form","canMaximize":true,"width":"extra-wide"},{"name":"stock-user-role-scopes-form-workspace","component":"stockUserScopesFormWorkspace","title":"User Role Scopes","type":"form","canMaximize":true,"width":"extra-wide"},{"name":"stock-reports-form-workspace","component":"stockReportsFormWorkspace","title":"Reports","type":"form","canMaximize":true,"width":"extra-wide"}],"pages":[{"component":"root","route":"stock-management"}],"version":"3.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":"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":"expired-stock-modal","component":"expiredStockModal"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsModal"},{"name":"receiving-stock-modal","component":"receivingStockModal"},{"name":"stock-operation-dialog","component":"stockOperationModal"},{"name":"transactions-print-bincard-preview-modal","component":"transactionBincardPrintPreviewModal"},{"name":"transactions-print-stockcard-preview-modal","component":"transactionStockcardPrintPreviewModal"}],"workspaces":[{"name":"stock-operation-form-workspace","component":"stockOperationFormWorkspace","title":"Stock Operation","type":"form","canMaximize":true,"width":"extra-wide"},{"name":"stock-item-rules-form-workspace","component":"stockItemRulesFormWorkspace","title":"Stock Item Rules","type":"form"},{"name":"stock-item-form-workspace","component":"stockItemFormWorkspace","title":"Stock Items","type":"form","canMaximize":true,"width":"extra-wide"},{"name":"stock-sources-form-workspace","component":"stockSourcesFormWorkspace","title":"Stock Sources","type":"form","canMaximize":true,"width":"extra-wide"},{"name":"stock-location-form-workspace","component":"stockLocationsFormWorkspace","title":"Stock Locations","type":"form","canMaximize":true,"width":"extra-wide"},{"name":"stock-user-role-scopes-form-workspace","component":"stockUserScopesFormWorkspace","title":"User Role Scopes","type":"form","canMaximize":true,"width":"extra-wide"},{"name":"stock-reports-form-workspace","component":"stockReportsFormWorkspace","title":"Reports","type":"form","canMaximize":true,"width":"extra-wide"}],"pages":[{"component":"root","route":"stock-management"}],"version":"3.0.1-pre.853"}
|
package/jest.config.js
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
/** @type {import('jest').Config} */
|
2
|
-
|
3
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
4
1
|
const path = require('path');
|
5
2
|
|
3
|
+
/** @type {import('jest').Config} */
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
6
5
|
module.exports = {
|
7
6
|
clearMocks: true,
|
8
7
|
collectCoverageFrom: ['**/src/**/*.component.tsx', '!**/node_modules/**', '!**/src/declarations.d.ts', '!**/e2e/**'],
|
@@ -15,6 +14,10 @@ module.exports = {
|
|
15
14
|
'\\.(s?css)$': 'identity-obj-proxy',
|
16
15
|
'^lodash-es/(.*)$': 'lodash/$1',
|
17
16
|
'^lodash-es$': 'lodash',
|
17
|
+
'^@tools$': path.resolve(__dirname, 'tools'),
|
18
|
+
'^@tools/(.*)$': path.resolve(__dirname, 'tools', '$1'),
|
19
|
+
'^@mocks$': path.resolve(__dirname, '__mocks__'),
|
20
|
+
'^@mocks/(.*)$': path.resolve(__dirname, '__mocks__', '$1'),
|
18
21
|
'^dexie$': require.resolve('dexie'),
|
19
22
|
'^react-i18next$': path.resolve(__dirname, '__mocks__', 'react-i18next.js'),
|
20
23
|
},
|
package/package.json
CHANGED
@@ -76,10 +76,10 @@ const DataList: React.FC<ListProps> = ({ columns, data, children, totalItems, go
|
|
76
76
|
};
|
77
77
|
const handleExport = (object) => {
|
78
78
|
const csvString = convertToCSV(list, columns);
|
79
|
-
if (object.currentTarget.innerText
|
79
|
+
if (object.currentTarget.innerText === 'Download As CSV') {
|
80
80
|
const blob = new Blob([csvString], { type: 'text/csv;charset=utf-8' });
|
81
81
|
saveAs(blob, 'data.csv');
|
82
|
-
} else if (object.currentTarget.innerText
|
82
|
+
} else if (object.currentTarget.innerText === 'Download As Json') {
|
83
83
|
const jsonBlob = new Blob([csvString], { type: 'application/json' });
|
84
84
|
saveAs(jsonBlob, 'data.json');
|
85
85
|
}
|
package/src/index.ts
CHANGED
@@ -15,8 +15,8 @@ import StockReports from './stock-reports/report-list/stock-reports.component';
|
|
15
15
|
import StockSettings from './stock-settings/stock-settings.component';
|
16
16
|
import StockSources from './stock-sources/stock-sources.component';
|
17
17
|
import StockUserScopes from './stock-user-role-scopes/stock-user-role-scopes.component';
|
18
|
-
import
|
19
|
-
import
|
18
|
+
import TransactionsBincardPrintPreviewModal from './stock-items/add-stock-item/transactions/printout/transactions-print-bincard-preview.modal';
|
19
|
+
import TransactionsStockcardPrintPreviewModal from './stock-items/add-stock-item/transactions/printout/transactions-print-stockcard-preview.modal';
|
20
20
|
|
21
21
|
const moduleName = '@openmrs/esm-stock-management-app';
|
22
22
|
|
@@ -59,7 +59,7 @@ export const expiredStockModal = getAsyncLifecycle(() => import('./stock-home/ex
|
|
59
59
|
});
|
60
60
|
|
61
61
|
export const importBulkStockItemsModal = getAsyncLifecycle(
|
62
|
-
() => import('./stock-items/add-bulk-stock-item/stock-items-bulk-import.
|
62
|
+
() => import('./stock-items/add-bulk-stock-item/stock-items-bulk-import.modal'),
|
63
63
|
{
|
64
64
|
featureName: 'import-bulk-stock-items-modal',
|
65
65
|
moduleName,
|
@@ -175,9 +175,9 @@ export const stockUserScopesFormWorkspace = getAsyncLifecycle(
|
|
175
175
|
options,
|
176
176
|
);
|
177
177
|
|
178
|
-
export const transactionBincardPrintPreviewModal = getSyncLifecycle(
|
178
|
+
export const transactionBincardPrintPreviewModal = getSyncLifecycle(TransactionsBincardPrintPreviewModal, options);
|
179
179
|
|
180
|
-
export const transactionStockcardPrintPreviewModal = getSyncLifecycle(
|
180
|
+
export const transactionStockcardPrintPreviewModal = getSyncLifecycle(TransactionsStockcardPrintPreviewModal, options);
|
181
181
|
|
182
182
|
export function startupApp() {
|
183
183
|
defineConfigSchema(moduleName, configSchema);
|
package/src/stock-items/add-bulk-stock-item/add-stock-items-bulk-import-action-button.component.tsx
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
import { Button } from '@carbon/react';
|
2
1
|
import React, { useCallback } from 'react';
|
3
2
|
import { useTranslation } from 'react-i18next';
|
3
|
+
import { Button } from '@carbon/react';
|
4
4
|
import { showModal } from '@openmrs/esm-framework';
|
5
5
|
|
6
6
|
const AddStockItemsBulktImportActionButton: React.FC = () => {
|
7
7
|
const { t } = useTranslation();
|
8
8
|
|
9
|
-
const
|
9
|
+
const handleLaunchImportBulkStockItemsModal = useCallback(() => {
|
10
10
|
const dispose = showModal('import-bulk-stock-items', {
|
11
11
|
closeModal: () => dispose(),
|
12
12
|
});
|
13
13
|
}, []);
|
14
14
|
|
15
15
|
return (
|
16
|
-
<Button
|
16
|
+
<Button iconDescription={t('import', 'Import')} kind="ghost" onClick={handleLaunchImportBulkStockItemsModal}>
|
17
17
|
{t('import', 'Import')}
|
18
18
|
</Button>
|
19
19
|
);
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import React, { useState } from 'react';
|
2
2
|
import { useTranslation } from 'react-i18next';
|
3
3
|
import { Button, Form, ModalBody, ModalFooter, ModalHeader, FileUploader } from '@carbon/react';
|
4
|
-
import {
|
5
|
-
import {
|
4
|
+
import { getCoreTranslation, showSnackbar } from '@openmrs/esm-framework';
|
5
|
+
import { uploadStockItems } from './stock-items-bulk-import.resource';
|
6
6
|
|
7
|
-
export interface
|
7
|
+
export interface ImportBulkStockItemsModalProps {
|
8
8
|
closeModal: () => void;
|
9
9
|
}
|
10
10
|
|
11
|
-
const
|
11
|
+
const ImportBulkStockItemsModal: React.FC<ImportBulkStockItemsModalProps> = ({ closeModal }) => {
|
12
12
|
const { t } = useTranslation();
|
13
13
|
const [selectedFile, setSelectedFile] = useState<any>();
|
14
14
|
|
@@ -16,27 +16,28 @@ const ImportDialogPopup: React.FC<ImportDialogPopupProps> = ({ closeModal }) =>
|
|
16
16
|
if (!selectedFile) {
|
17
17
|
return;
|
18
18
|
}
|
19
|
+
|
19
20
|
const formData = new FormData();
|
21
|
+
|
20
22
|
if (selectedFile) {
|
21
23
|
formData.append('file', selectedFile, 'Import_Stock_Items.csv');
|
22
24
|
formData.append('hasHeader', 'true');
|
23
25
|
}
|
24
|
-
|
26
|
+
|
27
|
+
uploadStockItems(formData).then(
|
25
28
|
() => {
|
26
29
|
showSnackbar({
|
27
|
-
isLowContrast: true,
|
28
|
-
title: t('rejectOrder', 'Uploaded Order'),
|
29
30
|
kind: 'success',
|
30
|
-
|
31
|
+
title: t('stockItemsUploadedSuccessfully', 'Stock items uploaded successfully'),
|
31
32
|
});
|
32
33
|
closeModal();
|
33
34
|
},
|
34
35
|
(err) => {
|
35
36
|
showSnackbar({
|
36
|
-
title: t('errorUploadingItems', 'An error occurred uploading stock items'),
|
37
37
|
kind: 'error',
|
38
|
-
isLowContrast:
|
38
|
+
isLowContrast: false,
|
39
39
|
subtitle: err?.message,
|
40
|
+
title: t('errorUploadingItems', 'An error occurred uploading stock items'),
|
40
41
|
});
|
41
42
|
},
|
42
43
|
);
|
@@ -54,26 +55,26 @@ const ImportDialogPopup: React.FC<ImportDialogPopupProps> = ({ closeModal }) =>
|
|
54
55
|
return (
|
55
56
|
<div>
|
56
57
|
<Form>
|
57
|
-
<ModalHeader closeModal={closeModal} title={t('importStockItems', 'Import
|
58
|
+
<ModalHeader closeModal={closeModal} title={t('importStockItems', 'Import stock items')} />
|
58
59
|
<ModalBody>
|
59
60
|
<FileUploader
|
60
61
|
accept={['.csv']}
|
61
|
-
|
62
|
-
name={'file'}
|
63
|
-
buttonLabel="Select file"
|
64
|
-
labelDescription="Only .csv files at 2mb or less"
|
62
|
+
buttonLabel={t('selectFile', 'Select file')}
|
65
63
|
filenameStatus="edit"
|
64
|
+
labelDescription={t('onlyCsvFilesAt2mbOrLess', 'Only .csv files at 2MB or less')}
|
66
65
|
labelTitle=""
|
67
|
-
|
66
|
+
multiple={false}
|
67
|
+
name="file"
|
68
68
|
onChange={onFileChanged}
|
69
|
+
size="sm"
|
69
70
|
/>
|
70
71
|
</ModalBody>
|
71
72
|
<ModalFooter>
|
72
73
|
<Button kind="secondary" onClick={closeModal}>
|
73
|
-
{
|
74
|
+
{getCoreTranslation('cancel')}
|
74
75
|
</Button>
|
75
76
|
<Button type="button" onClick={onConfirmUpload}>
|
76
|
-
{t('uploadStockItems', 'Upload
|
77
|
+
{t('uploadStockItems', 'Upload stock items')}
|
77
78
|
</Button>
|
78
79
|
</ModalFooter>
|
79
80
|
</Form>
|
@@ -81,4 +82,4 @@ const ImportDialogPopup: React.FC<ImportDialogPopupProps> = ({ closeModal }) =>
|
|
81
82
|
);
|
82
83
|
};
|
83
84
|
|
84
|
-
export default
|
85
|
+
export default ImportBulkStockItemsModal;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
2
2
|
|
3
|
-
export async function
|
3
|
+
export async function uploadStockItems(body: any) {
|
4
4
|
const abortController = new AbortController();
|
5
5
|
|
6
6
|
return openmrsFetch(`${restBaseUrl}/stockmanagement/stockitemimport`, {
|