@openmrs/esm-stock-management-app 1.0.1-pre.476 → 1.0.1-pre.484
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/271.js +1 -0
- package/dist/319.js +1 -0
- package/dist/460.js +1 -0
- package/dist/474.js +1 -1
- package/dist/474.js.map +1 -1
- package/dist/574.js +1 -1
- package/dist/757.js +1 -0
- package/dist/788.js +1 -0
- package/dist/807.js +1 -0
- package/dist/833.js +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-stock-management-app.js.buildmanifest.json +163 -9
- package/dist/routes.json +1 -1
- package/i18next-parser.config.js +1 -1
- package/package.json +2 -2
- package/src/core/components/card/metrics-card-component.tsx +3 -3
- package/src/core/components/privilages-component/privilages.component.tsx +7 -1
- package/src/core/components/table/table.component.tsx +1 -1
- package/src/stock-items/add-bulk-stock-item/stock-items-bulk-import.component.tsx +3 -2
- package/src/stock-items/add-stock-item/add-stock-action-button.component.tsx +2 -2
- package/src/stock-items/add-stock-item/packaging-units/packaging-units-delete-modal.component.tsx +4 -4
- package/src/stock-items/add-stock-item/stock-item-details/stock-item-details.component.tsx +30 -34
- package/src/stock-items/add-stock-item/stock-item-rules/add-stock-rule-button.component.tsx +1 -1
- package/src/stock-items/add-stock-item/stock-item-rules/add-stock-rules.component.tsx +2 -2
- package/src/stock-items/add-stock-item/stock-item-rules/stock-rules-delete.component.tsx +2 -2
- package/src/stock-items/edit-stock-item/edit-stock-item-action-menu.component.tsx +1 -1
- package/src/stock-items/stock-item.utils.tsx +20 -9
- package/src/stock-items/stock-items-table.component.tsx +1 -1
- package/src/stock-locations/add-locations-form.component.tsx +8 -2
- package/src/stock-locations/location-admin-form.component.tsx +8 -5
- package/src/stock-locations/stock-locations-table.component.tsx +4 -14
- package/src/stock-locations/stock-locations-table.resource.tsx +9 -21
- package/src/stock-operations/add-stock-operation/add-stock-operation.component.tsx +1 -0
- package/src/stock-operations/add-stock-operation/add-stock-operation.resource.tsx +1 -7
- package/src/stock-operations/add-stock-operation/add-stock-operation.utils.tsx +0 -1
- package/src/stock-operations/add-stock-operation/base-operation-details.component.tsx +10 -8
- package/src/stock-operations/add-stock-operation/stock-items-addition-row.component.tsx +2 -1
- package/src/stock-operations/add-stock-operation/stock-items-addition.component.tsx +2 -2
- package/src/stock-operations/edit-stock-operation/edit-stock-operation-action-menu.component.tsx +3 -0
- package/src/stock-operations/stock-operation.utils.tsx +28 -12
- package/src/stock-operations/stock-operations-dialog/stock-operations-issue-stock-button.component.tsx +1 -1
- package/src/stock-operations/stock-operations-table.component.tsx +9 -2
- package/src/stock-reports/generate-report/create-stock-report.component.tsx +33 -18
- package/src/stock-sources/add-stock-source-button.component.tsx +1 -1
- package/src/stock-sources/add-stock-sources/add-stock-sources.component.tsx +2 -2
- package/src/stock-sources/stock-sources-delete/stock-sources-delete.component.tsx +2 -2
- package/src/stock-user-role-scopes/add-stock-user-role-scope-button.component.tsx +5 -2
- package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.component.tsx +10 -8
- package/src/stock-user-role-scopes/delete-stock-user-scope/delete-stock-user-scope.component.tsx +3 -2
- package/src/stock-user-role-scopes/delete-stock-user-scope-modal.component.tsx +1 -3
- package/src/stock-user-role-scopes/stock-user-role-scopes-items-table.component.tsx +1 -1
- package/src/utils.ts +0 -10
- package/translations/am.json +292 -0
- package/translations/ar.json +292 -0
- package/translations/en.json +75 -57
- package/translations/es.json +292 -0
- package/translations/fr.json +292 -0
- package/translations/he.json +292 -0
- package/translations/km.json +292 -0
- package/translations/zh.json +292 -0
@@ -86,10 +86,10 @@
|
|
86
86
|
"initial": true,
|
87
87
|
"entry": true,
|
88
88
|
"recorded": false,
|
89
|
-
"size":
|
89
|
+
"size": 4766853,
|
90
90
|
"sizes": {
|
91
91
|
"consume-shared": 252,
|
92
|
-
"javascript":
|
92
|
+
"javascript": 4744904,
|
93
93
|
"share-init": 252,
|
94
94
|
"runtime": 21445
|
95
95
|
},
|
@@ -106,7 +106,29 @@
|
|
106
106
|
"auxiliaryFiles": [
|
107
107
|
"main.js.map"
|
108
108
|
],
|
109
|
-
"hash": "
|
109
|
+
"hash": "e52cb3631184607a",
|
110
|
+
"childrenByOrder": {}
|
111
|
+
},
|
112
|
+
{
|
113
|
+
"rendered": true,
|
114
|
+
"initial": false,
|
115
|
+
"entry": false,
|
116
|
+
"recorded": false,
|
117
|
+
"size": 7694,
|
118
|
+
"sizes": {
|
119
|
+
"javascript": 7694
|
120
|
+
},
|
121
|
+
"names": [],
|
122
|
+
"idHints": [],
|
123
|
+
"runtime": [
|
124
|
+
"@openmrs/esm-stock-management-app",
|
125
|
+
"main"
|
126
|
+
],
|
127
|
+
"files": [
|
128
|
+
"271.js"
|
129
|
+
],
|
130
|
+
"auxiliaryFiles": [],
|
131
|
+
"hash": "0cb37e3477f0eecc",
|
110
132
|
"childrenByOrder": {}
|
111
133
|
},
|
112
134
|
{
|
@@ -138,9 +160,53 @@
|
|
138
160
|
"initial": false,
|
139
161
|
"entry": false,
|
140
162
|
"recorded": false,
|
141
|
-
"size":
|
163
|
+
"size": 12770,
|
142
164
|
"sizes": {
|
143
|
-
"javascript":
|
165
|
+
"javascript": 12770
|
166
|
+
},
|
167
|
+
"names": [],
|
168
|
+
"idHints": [],
|
169
|
+
"runtime": [
|
170
|
+
"@openmrs/esm-stock-management-app",
|
171
|
+
"main"
|
172
|
+
],
|
173
|
+
"files": [
|
174
|
+
"319.js"
|
175
|
+
],
|
176
|
+
"auxiliaryFiles": [],
|
177
|
+
"hash": "78c810e8e20a403e",
|
178
|
+
"childrenByOrder": {}
|
179
|
+
},
|
180
|
+
{
|
181
|
+
"rendered": true,
|
182
|
+
"initial": false,
|
183
|
+
"entry": false,
|
184
|
+
"recorded": false,
|
185
|
+
"size": 10604,
|
186
|
+
"sizes": {
|
187
|
+
"javascript": 10604
|
188
|
+
},
|
189
|
+
"names": [],
|
190
|
+
"idHints": [],
|
191
|
+
"runtime": [
|
192
|
+
"@openmrs/esm-stock-management-app",
|
193
|
+
"main"
|
194
|
+
],
|
195
|
+
"files": [
|
196
|
+
"460.js"
|
197
|
+
],
|
198
|
+
"auxiliaryFiles": [],
|
199
|
+
"hash": "853e580ee18acb6d",
|
200
|
+
"childrenByOrder": {}
|
201
|
+
},
|
202
|
+
{
|
203
|
+
"rendered": true,
|
204
|
+
"initial": false,
|
205
|
+
"entry": false,
|
206
|
+
"recorded": false,
|
207
|
+
"size": 1095141,
|
208
|
+
"sizes": {
|
209
|
+
"javascript": 1094931,
|
144
210
|
"consume-shared": 210
|
145
211
|
},
|
146
212
|
"names": [],
|
@@ -154,7 +220,7 @@
|
|
154
220
|
"auxiliaryFiles": [
|
155
221
|
"474.js.map"
|
156
222
|
],
|
157
|
-
"hash": "
|
223
|
+
"hash": "229d6a418e7c76e6",
|
158
224
|
"childrenByOrder": {}
|
159
225
|
},
|
160
226
|
{
|
@@ -186,9 +252,9 @@
|
|
186
252
|
"initial": false,
|
187
253
|
"entry": false,
|
188
254
|
"recorded": false,
|
189
|
-
"size":
|
255
|
+
"size": 10901,
|
190
256
|
"sizes": {
|
191
|
-
"javascript":
|
257
|
+
"javascript": 10901
|
192
258
|
},
|
193
259
|
"names": [],
|
194
260
|
"idHints": [],
|
@@ -200,7 +266,7 @@
|
|
200
266
|
"574.js"
|
201
267
|
],
|
202
268
|
"auxiliaryFiles": [],
|
203
|
-
"hash": "
|
269
|
+
"hash": "73adef869115d16f",
|
204
270
|
"childrenByOrder": {}
|
205
271
|
},
|
206
272
|
{
|
@@ -272,6 +338,50 @@
|
|
272
338
|
"hash": "e9b7d1108fb062e0",
|
273
339
|
"childrenByOrder": {}
|
274
340
|
},
|
341
|
+
{
|
342
|
+
"rendered": true,
|
343
|
+
"initial": false,
|
344
|
+
"entry": false,
|
345
|
+
"recorded": false,
|
346
|
+
"size": 12879,
|
347
|
+
"sizes": {
|
348
|
+
"javascript": 12879
|
349
|
+
},
|
350
|
+
"names": [],
|
351
|
+
"idHints": [],
|
352
|
+
"runtime": [
|
353
|
+
"@openmrs/esm-stock-management-app",
|
354
|
+
"main"
|
355
|
+
],
|
356
|
+
"files": [
|
357
|
+
"757.js"
|
358
|
+
],
|
359
|
+
"auxiliaryFiles": [],
|
360
|
+
"hash": "0f431833a88f72aa",
|
361
|
+
"childrenByOrder": {}
|
362
|
+
},
|
363
|
+
{
|
364
|
+
"rendered": true,
|
365
|
+
"initial": false,
|
366
|
+
"entry": false,
|
367
|
+
"recorded": false,
|
368
|
+
"size": 9611,
|
369
|
+
"sizes": {
|
370
|
+
"javascript": 9611
|
371
|
+
},
|
372
|
+
"names": [],
|
373
|
+
"idHints": [],
|
374
|
+
"runtime": [
|
375
|
+
"@openmrs/esm-stock-management-app",
|
376
|
+
"main"
|
377
|
+
],
|
378
|
+
"files": [
|
379
|
+
"788.js"
|
380
|
+
],
|
381
|
+
"auxiliaryFiles": [],
|
382
|
+
"hash": "704ff9bb8200591c",
|
383
|
+
"childrenByOrder": {}
|
384
|
+
},
|
275
385
|
{
|
276
386
|
"rendered": true,
|
277
387
|
"initial": false,
|
@@ -299,6 +409,50 @@
|
|
299
409
|
"hash": "63121f39673cb859",
|
300
410
|
"childrenByOrder": {}
|
301
411
|
},
|
412
|
+
{
|
413
|
+
"rendered": true,
|
414
|
+
"initial": false,
|
415
|
+
"entry": false,
|
416
|
+
"recorded": false,
|
417
|
+
"size": 11294,
|
418
|
+
"sizes": {
|
419
|
+
"javascript": 11294
|
420
|
+
},
|
421
|
+
"names": [],
|
422
|
+
"idHints": [],
|
423
|
+
"runtime": [
|
424
|
+
"@openmrs/esm-stock-management-app",
|
425
|
+
"main"
|
426
|
+
],
|
427
|
+
"files": [
|
428
|
+
"807.js"
|
429
|
+
],
|
430
|
+
"auxiliaryFiles": [],
|
431
|
+
"hash": "b18f2b03183a99b3",
|
432
|
+
"childrenByOrder": {}
|
433
|
+
},
|
434
|
+
{
|
435
|
+
"rendered": true,
|
436
|
+
"initial": false,
|
437
|
+
"entry": false,
|
438
|
+
"recorded": false,
|
439
|
+
"size": 10017,
|
440
|
+
"sizes": {
|
441
|
+
"javascript": 10017
|
442
|
+
},
|
443
|
+
"names": [],
|
444
|
+
"idHints": [],
|
445
|
+
"runtime": [
|
446
|
+
"@openmrs/esm-stock-management-app",
|
447
|
+
"main"
|
448
|
+
],
|
449
|
+
"files": [
|
450
|
+
"833.js"
|
451
|
+
],
|
452
|
+
"auxiliaryFiles": [],
|
453
|
+
"hash": "dc7f9b3f51a934e7",
|
454
|
+
"childrenByOrder": {}
|
455
|
+
},
|
302
456
|
{
|
303
457
|
"rendered": true,
|
304
458
|
"initial": false,
|
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-operation-dialog","component":"stockOperationDialog"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsDialog"},{"name":"delete-stock-modal","component":"deleteStockModal"},{"name":"delete-stock-user-scope-modal","component":"deleteUserScopeModal"},{"name":"stock-management-app-menu-item","component":"stockManagementAppMenuItem","slot":"app-menu-item-slot","meta":{"name":" Stock Management"}},{"name":"delete-stock-rule-modal","component":"deleteStockRuleModal"},{"name":"delete-packaging-unit-modal","component":"deletePackagingUnitModal"},{"name":"delete-packaging-unit-button","component":"deletePackagingUnitButton"}],"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-operation-dialog","component":"stockOperationDialog"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsDialog"},{"name":"delete-stock-modal","component":"deleteStockModal"},{"name":"delete-stock-user-scope-modal","component":"deleteUserScopeModal"},{"name":"stock-management-app-menu-item","component":"stockManagementAppMenuItem","slot":"app-menu-item-slot","meta":{"name":" Stock Management"}},{"name":"delete-stock-rule-modal","component":"deleteStockRuleModal"},{"name":"delete-packaging-unit-modal","component":"deletePackagingUnitModal"},{"name":"delete-packaging-unit-button","component":"deletePackagingUnitButton"}],"pages":[{"component":"root","route":"stock-management"}],"version":"1.0.1-pre.484"}
|
package/i18next-parser.config.js
CHANGED
@@ -42,7 +42,7 @@ module.exports = {
|
|
42
42
|
lineEnding: "auto",
|
43
43
|
// Control the line ending. See options at https://github.com/ryanve/eol
|
44
44
|
|
45
|
-
locales: ["en"],
|
45
|
+
locales: ["en", "am", "ar", "he", "es", "fr", "km", "zh"],
|
46
46
|
// An array of the locales in your applications
|
47
47
|
|
48
48
|
namespaceSeparator: ":",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@openmrs/esm-stock-management-app",
|
3
|
-
"version": "1.0.1-pre.
|
3
|
+
"version": "1.0.1-pre.484",
|
4
4
|
"license": "MPL-2.0",
|
5
5
|
"description": "Stock management microfrontend for OpenMRS 3.x",
|
6
6
|
"browser": "dist/openmrs-esm-stock-management-app.js",
|
@@ -18,7 +18,7 @@
|
|
18
18
|
"verify": "turbo lint typescript coverage",
|
19
19
|
"coverage": "yarn test --coverage",
|
20
20
|
"prepare": "husky install",
|
21
|
-
"extract-translations": "i18next 'src/**/*.component.tsx' --config ./i18next-parser.config.js"
|
21
|
+
"extract-translations": "i18next 'src/**/*.component.tsx' 'src/**/*.tsx' --config ./i18next-parser.config.js"
|
22
22
|
},
|
23
23
|
"husky": {
|
24
24
|
"hooks": {
|
@@ -58,7 +58,7 @@ const MetricsCard: React.FC<MetricsCardProps> = ({
|
|
58
58
|
{!isEmpty(count) && (
|
59
59
|
<div className={styles.countGrid}>
|
60
60
|
<span style={{ color: "#DA1E28" }}>
|
61
|
-
{t("
|
61
|
+
{t("in6Months", "In 6 months")}
|
62
62
|
</span>
|
63
63
|
<p style={{ color: "#DA1E28" }}>{count.expiry6months?.length}</p>
|
64
64
|
</div>
|
@@ -66,10 +66,10 @@ const MetricsCard: React.FC<MetricsCardProps> = ({
|
|
66
66
|
{!isEmpty(outofstockCount) && (
|
67
67
|
<div className={styles.countGrid}>
|
68
68
|
<span style={{ color: "#DA1E28" }}>
|
69
|
-
{t("
|
69
|
+
{t("itemsBelowMin", "Items Below Min")}
|
70
70
|
</span>
|
71
71
|
<span style={{ color: "#319227" }}>
|
72
|
-
{t("
|
72
|
+
{t("itemsAboveMax", "Items Above Max")}
|
73
73
|
</span>
|
74
74
|
<p style={{ color: "#DA1E28" }}>
|
75
75
|
{outofstockCount.itemsbelowmin?.length}
|
@@ -24,7 +24,13 @@ export const PrivilagedView: React.FC<PrivilageComponentProps> = ({
|
|
24
24
|
<p className={styles.content}>{t("noPrivilagesTitle", `${title}`)}</p>
|
25
25
|
{description && (
|
26
26
|
<p className={styles.helper}>
|
27
|
-
{t(
|
27
|
+
{t(
|
28
|
+
"noViewPrivilegesDescription",
|
29
|
+
"Description: {{description}}",
|
30
|
+
{
|
31
|
+
description,
|
32
|
+
}
|
33
|
+
)}
|
28
34
|
</p>
|
29
35
|
)}
|
30
36
|
</div>
|
@@ -198,7 +198,7 @@ const DataList: React.FC<ListProps> = ({
|
|
198
198
|
<Tile className={styles.tile}>
|
199
199
|
<div className={styles.tileContent}>
|
200
200
|
<p className={styles.content}>
|
201
|
-
{t("
|
201
|
+
{t("noData", "No data to display")}
|
202
202
|
</p>
|
203
203
|
<p className={styles.helper}>
|
204
204
|
{t("checkFilters", "Check the filters above")}
|
@@ -37,7 +37,7 @@ const ImportDialogPopup: React.FC<ImportDialogPopupProps> = ({
|
|
37
37
|
title: t("rejectOrder", "Uploaded Order"),
|
38
38
|
kind: "success",
|
39
39
|
subtitle: t(
|
40
|
-
"
|
40
|
+
"SuccessfullyUploadedStockItem",
|
41
41
|
`You have successfully uploaded stock items`
|
42
42
|
),
|
43
43
|
});
|
@@ -46,7 +46,8 @@ const ImportDialogPopup: React.FC<ImportDialogPopupProps> = ({
|
|
46
46
|
(err) => {
|
47
47
|
showSnackbar({
|
48
48
|
title: t(
|
49
|
-
|
49
|
+
"errorUploadingItems",
|
50
|
+
"An error occurred uploading stock items"
|
50
51
|
),
|
51
52
|
kind: "error",
|
52
53
|
isLowContrast: true,
|
@@ -8,12 +8,12 @@ const AddStockItemActionButton: React.FC = () => {
|
|
8
8
|
const { t } = useTranslation();
|
9
9
|
|
10
10
|
const handleClick = useCallback(() => {
|
11
|
-
launchAddOrEditDialog(initialValues, false);
|
11
|
+
launchAddOrEditDialog(t, initialValues, false);
|
12
12
|
}, []);
|
13
13
|
|
14
14
|
return (
|
15
15
|
<Button onClick={handleClick} size="md" kind="primary">
|
16
|
-
{t("
|
16
|
+
{t("addNewStock", "Add New")}
|
17
17
|
</Button>
|
18
18
|
);
|
19
19
|
};
|
package/src/stock-items/add-stock-item/packaging-units/packaging-units-delete-modal.component.tsx
CHANGED
@@ -44,11 +44,11 @@ const DeletePackagingUnit: React.FC<DeletePackagingUnitProps> = ({
|
|
44
44
|
closeModal();
|
45
45
|
showSnackbar({
|
46
46
|
isLowContrast: true,
|
47
|
-
title: t("deletePackagingUnitTitle",
|
47
|
+
title: t("deletePackagingUnitTitle", "Delete packing item"),
|
48
48
|
kind: "success",
|
49
49
|
subtitle: t(
|
50
50
|
"deletePackagingUnitMesaage",
|
51
|
-
|
51
|
+
"Stock Item packing unit deleted Successfully"
|
52
52
|
),
|
53
53
|
});
|
54
54
|
},
|
@@ -56,7 +56,7 @@ const DeletePackagingUnit: React.FC<DeletePackagingUnitProps> = ({
|
|
56
56
|
showSnackbar({
|
57
57
|
title: t(
|
58
58
|
"deletePackingUnitErrorTitle",
|
59
|
-
|
59
|
+
"Error Deleting a stock item packing unit"
|
60
60
|
),
|
61
61
|
kind: "error",
|
62
62
|
isLowContrast: true,
|
@@ -78,7 +78,7 @@ const DeletePackagingUnit: React.FC<DeletePackagingUnitProps> = ({
|
|
78
78
|
<span>
|
79
79
|
{t(
|
80
80
|
"removePackagingUnitConfirmation",
|
81
|
-
|
81
|
+
"Would you really like to remove the packaging unit ${row?.packagingUomName} from the stock item?"
|
82
82
|
)}
|
83
83
|
</span>
|
84
84
|
<TextArea
|
@@ -66,13 +66,6 @@ const StockItemDetails = forwardRef<never, StockItemDetailsProps>(
|
|
66
66
|
|
67
67
|
useEffect(() => {
|
68
68
|
setIsDrug(model.isDrug ?? false);
|
69
|
-
setSelectedItemType(
|
70
|
-
model.isDrug === true
|
71
|
-
? "Pharmaceuticals"
|
72
|
-
: model.isDrug === false
|
73
|
-
? "Non Pharmaceuticals"
|
74
|
-
: undefined
|
75
|
-
);
|
76
69
|
setHasExpiration(model.hasExpiration ?? false);
|
77
70
|
}, [model.hasExpiration, model.isDrug]);
|
78
71
|
|
@@ -80,30 +73,34 @@ const StockItemDetails = forwardRef<never, StockItemDetailsProps>(
|
|
80
73
|
<form
|
81
74
|
className={`${rootStyles.formContainer} ${rootStyles.verticalForm}`}
|
82
75
|
>
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
76
|
+
{!isEditing && (
|
77
|
+
<FormGroup
|
78
|
+
className="clear-margin-bottom"
|
79
|
+
legendText={t("itemType", "Item Type")}
|
80
|
+
title={t("itemType", "Item Type")}
|
81
|
+
>
|
82
|
+
<ControlledRadioButtonGroup
|
83
|
+
control={control}
|
84
|
+
name="isDrug"
|
85
|
+
controllerName="isDrug"
|
86
|
+
legendText=""
|
87
|
+
invalid={!!errors.isDrug}
|
88
|
+
invalidText={errors.isDrug && errors?.isDrug?.message}
|
89
|
+
onChange={(selection: boolean) => {
|
90
|
+
const selectedOption = radioOptions.find(
|
91
|
+
(option) => option.value === selection
|
92
|
+
);
|
93
|
+
const selectedLabel = selectedOption
|
94
|
+
? selectedOption.label
|
95
|
+
: "";
|
96
|
+
setIsDrug(selection);
|
97
|
+
setSelectedItemType(selectedLabel);
|
98
|
+
}}
|
99
|
+
options={radioOptions} // Pass radioOptions directly
|
100
|
+
/>
|
101
|
+
</FormGroup>
|
102
|
+
)}
|
103
|
+
{selectedItemType === "Pharmaceuticals" ? (
|
107
104
|
<DrugSelector
|
108
105
|
name="drugUuid"
|
109
106
|
controllerName="drugUuid"
|
@@ -113,8 +110,7 @@ const StockItemDetails = forwardRef<never, StockItemDetailsProps>(
|
|
113
110
|
invalid={!!errors.drugUuid}
|
114
111
|
invalidText={errors.drugUuid && errors?.drugUuid?.message}
|
115
112
|
/>
|
116
|
-
)
|
117
|
-
{isDrug != undefined && !isDrug && (
|
113
|
+
) : selectedItemType === "Non Pharmaceuticals" ? (
|
118
114
|
<ConceptsSelector
|
119
115
|
name="conceptUuid"
|
120
116
|
controllerName="conceptUuid"
|
@@ -124,7 +120,7 @@ const StockItemDetails = forwardRef<never, StockItemDetailsProps>(
|
|
124
120
|
invalid={!!errors.drugUuid}
|
125
121
|
invalidText={errors.drugUuid && errors?.drugUuid?.message}
|
126
122
|
/>
|
127
|
-
)}
|
123
|
+
) : null}
|
128
124
|
<ControlledTextInput
|
129
125
|
id="commonName"
|
130
126
|
name="commonName"
|
@@ -22,7 +22,7 @@ const AddStockRuleActionButton: React.FC<AddStockRuleActionButtonProps> = ({
|
|
22
22
|
|
23
23
|
return (
|
24
24
|
<Button onClick={handleClick} size="md" kind="primary">
|
25
|
-
{t("
|
25
|
+
{t("addNewStockRule", "Add New Rule")}
|
26
26
|
</Button>
|
27
27
|
);
|
28
28
|
};
|
@@ -165,7 +165,7 @@ const StockRulesAddOrUpdate: React.FC<AddStockRuleProps> = ({
|
|
165
165
|
title: t("addedRule", "Add Rule"),
|
166
166
|
kind: "success",
|
167
167
|
subtitle: t(
|
168
|
-
"
|
168
|
+
"stockRuleAddedSuccessfully",
|
169
169
|
"Stock Rule Added Successfully"
|
170
170
|
),
|
171
171
|
});
|
@@ -173,7 +173,7 @@ const StockRulesAddOrUpdate: React.FC<AddStockRuleProps> = ({
|
|
173
173
|
},
|
174
174
|
(error) => {
|
175
175
|
showSnackbar({
|
176
|
-
title: t(
|
176
|
+
title: t("errorAddingRule", "Error adding a rule"),
|
177
177
|
kind: "error",
|
178
178
|
isLowContrast: true,
|
179
179
|
subtitle: error?.message,
|
@@ -30,7 +30,7 @@ const StockRulesDeleteActionMenu: React.FC<StockRulesDeleteActionMenuProps> = ({
|
|
30
30
|
title: t("deletingRule", "Delete Rule"),
|
31
31
|
kind: "success",
|
32
32
|
subtitle: t(
|
33
|
-
"
|
33
|
+
"stockRuleDeletedSuccessfully",
|
34
34
|
"Stock Rule Deleted Successfully"
|
35
35
|
),
|
36
36
|
});
|
@@ -38,7 +38,7 @@ const StockRulesDeleteActionMenu: React.FC<StockRulesDeleteActionMenuProps> = ({
|
|
38
38
|
(error) => {
|
39
39
|
setDeletingRule(false);
|
40
40
|
showSnackbar({
|
41
|
-
title: t(
|
41
|
+
title: t("errorDeletingRule", "Error deleting a rule"),
|
42
42
|
kind: "error",
|
43
43
|
isLowContrast: true,
|
44
44
|
subtitle: error?.message,
|
@@ -19,7 +19,7 @@ const EditStockItemActionsMenu: React.FC<EditStockItemActionsMenuProps> = ({
|
|
19
19
|
size="md"
|
20
20
|
onClick={() => {
|
21
21
|
data.isDrug = !!data.drugUuid;
|
22
|
-
launchAddOrEditDialog(data, true);
|
22
|
+
launchAddOrEditDialog(t, data, true);
|
23
23
|
}}
|
24
24
|
iconDescription={t("editStockItem", "Edit Stock Item")}
|
25
25
|
>
|
@@ -1,11 +1,13 @@
|
|
1
|
+
import React from "react";
|
1
2
|
import { closeOverlay, launchOverlay } from "../core/components/overlay/hook";
|
2
3
|
import { StockItemDTO } from "../core/api/types/stockItem/StockItem";
|
3
|
-
import
|
4
|
+
import { type TFunction } from "react-i18next";
|
4
5
|
import AddEditStockItem from "./add-stock-item/add-stock-item.component";
|
5
6
|
import { FetchResponse, showSnackbar } from "@openmrs/esm-framework";
|
6
7
|
import { createStockItem, updateStockItem } from "./stock-items.resource";
|
7
8
|
|
8
9
|
export const addOrEditStockItem = async (
|
10
|
+
t: TFunction,
|
9
11
|
stockItem: StockItemDTO,
|
10
12
|
isEditing = false
|
11
13
|
) => {
|
@@ -17,9 +19,13 @@ export const addOrEditStockItem = async (
|
|
17
19
|
if (response?.data) {
|
18
20
|
showSnackbar({
|
19
21
|
isLowContrast: true,
|
20
|
-
title:
|
22
|
+
title: isEditing
|
23
|
+
? `${t("editStockItem", "Edit Stock Item")}`
|
24
|
+
: `${t("addStockItem", "Add Stock Item")}`,
|
21
25
|
kind: "success",
|
22
|
-
subtitle:
|
26
|
+
subtitle: isEditing
|
27
|
+
? `${t("stockItemEdited", "Stock Item Edited Successfully")}`
|
28
|
+
: `${t("stockItemAdded", "Stock Item Added Successfully")}`,
|
23
29
|
});
|
24
30
|
|
25
31
|
if (!isEditing) {
|
@@ -28,12 +34,14 @@ export const addOrEditStockItem = async (
|
|
28
34
|
// launch edit dialog
|
29
35
|
const item = response.data;
|
30
36
|
item.isDrug = !!item.drugUuid;
|
31
|
-
launchAddOrEditDialog(item, true);
|
37
|
+
launchAddOrEditDialog(t, item, true);
|
32
38
|
}
|
33
39
|
}
|
34
40
|
} catch (error) {
|
35
41
|
showSnackbar({
|
36
|
-
title:
|
42
|
+
title: isEditing
|
43
|
+
? t("errorEditingStockItem", "Error editing a stock Item")
|
44
|
+
: t("errorAddingStockItem", "Error adding a stock Item"),
|
37
45
|
kind: "error",
|
38
46
|
isLowContrast: true,
|
39
47
|
subtitle: error?.responseBody?.error?.message,
|
@@ -42,16 +50,19 @@ export const addOrEditStockItem = async (
|
|
42
50
|
};
|
43
51
|
|
44
52
|
export const launchAddOrEditDialog = (
|
53
|
+
t: TFunction,
|
45
54
|
stockItem: StockItemDTO,
|
46
55
|
isEditing = false
|
47
56
|
) => {
|
48
57
|
launchOverlay(
|
49
|
-
|
50
|
-
|
51
|
-
|
58
|
+
isEditing
|
59
|
+
? `${t("editItem", "Edit {{name}}", {
|
60
|
+
name: stockItem?.drugName || stockItem.conceptName || "",
|
61
|
+
})} ${stockItem.isDrug ? "(Drug)" : "(Non Drug)"}`
|
62
|
+
: t("addItem", "Add stock item"),
|
52
63
|
<AddEditStockItem
|
53
64
|
model={stockItem}
|
54
|
-
onSave={(stockItem) => addOrEditStockItem(stockItem, isEditing)}
|
65
|
+
onSave={(stockItem) => addOrEditStockItem(t, stockItem, isEditing)}
|
55
66
|
isEditing={isEditing}
|
56
67
|
/>
|
57
68
|
);
|
@@ -146,7 +146,7 @@ const StockItemsTableComponent: React.FC<StockItemsTableProps> = () => {
|
|
146
146
|
size="md"
|
147
147
|
onClick={() => {
|
148
148
|
stockItem.isDrug = !!stockItem.drugUuid;
|
149
|
-
launchAddOrEditDialog(stockItem, true);
|
149
|
+
launchAddOrEditDialog(t, stockItem, true);
|
150
150
|
}}
|
151
151
|
iconDescription={t("editStockItem", "Edit Stock Item")}
|
152
152
|
renderIcon={(props) => <Edit size={16} {...props} />}
|