@openmrs/esm-stock-management-app 3.0.1-pre.853 → 3.0.1-pre.855
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 +1 -4
- package/__mocks__/react-i18next.js +9 -8
- 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/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/627.js +1 -0
- package/dist/627.js.map +1 -0
- 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 +3 -6
- package/package.json +1 -1
- package/src/core/components/table/table.component.tsx +2 -2
- 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.modal.tsx → stock-items-bulk-import.component.tsx} +19 -20
- 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 +4 -6
- package/src/stock-items/add-stock-item/add-stock-item.scss +0 -5
- package/src/stock-items/add-stock-item/add-stock-item.test.tsx +43 -28
- package/src/stock-items/add-stock-item/packaging-units/packaging-units-delete-modal.component.tsx +4 -3
- package/src/stock-items/add-stock-item/packaging-units/packaging-units.component.tsx +10 -9
- 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 +19 -27
- 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 +9 -15
- package/src/stock-items/add-stock-item/stock-item-rules/add-stock-rules.scss +0 -1
- package/src/stock-items/add-stock-item/stock-item-rules/delete-stock-rule-modal.component.tsx +1 -2
- package/src/stock-items/add-stock-item/stock-item-rules/stock-item-rules.component.tsx +16 -14
- package/src/stock-items/add-stock-item/stock-item-rules/stock-item-rules.scss +3 -7
- package/src/stock-items/add-stock-item/transactions/printout/transactions-print-bincard-preview.modal.tsx +6 -14
- package/src/stock-items/add-stock-item/transactions/printout/transactions-print-stockcard-preview.modal.tsx +8 -14
- package/src/stock-items/edit-stock-item/edit-stock-item-action-menu.component.tsx +2 -2
- package/src/stock-items/stock-item.utils.tsx +5 -3
- package/src/stock-items/stock-items-table.component.tsx +45 -47
- package/src/stock-items/stock-items-table.resource.ts +2 -2
- package/src/stock-items/stock-items-table.scss +1 -5
- package/src/stock-items/stock-items-table.test.tsx +65 -106
- package/src/stock-locations/location-admin-form.component.tsx +4 -5
- package/src/stock-locations/stock-locations-table.component.tsx +8 -10
- package/src/stock-lookups/stock-lookups.resource.ts +2 -3
- package/src/stock-operations/stock-operations-dialog/stock-operations-dialog.component.tsx +2 -2
- 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 +25 -115
- package/src/stock-operations/stock-operations-forms/input-components/qty-uim-selector.test.tsx +65 -107
- 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 +153 -35
- package/src/stock-operations/stock-operations-forms/input-components/user-selector.test.tsx +29 -82
- package/src/stock-operations/stock-operations-forms/step1.test.tsx +69 -204
- package/src/stock-operations/stock-operations-forms/step2.test.tsx +63 -140
- package/src/stock-operations/stock-operations-forms/step3.test.tsx +60 -79
- package/src/stock-operations/stock-operations-forms/steps/stock-operation-items-form-step.component.tsx +5 -6
- package/src/stock-operations/stock-operations-forms/steps/stock-operation-submission-form-step.component.tsx +11 -12
- package/src/stock-operations/stock-operations-forms/stock-item-form/stock-item-form.scss +0 -1
- package/src/stock-operations/stock-operations-forms/stock-item-form/stock-item-form.workspace.tsx +12 -20
- package/src/stock-operations/stock-operations-forms/stock-operation-form.scss +0 -1
- package/src/stock-operations/stock-operations-forms/stock-operation-stepper/stepper.scss +3 -1
- package/src/stock-operations/stock-operations-forms/stock-operation-stepper/stock-operation-stepper.component.tsx +1 -2
- package/src/stock-reports/generate-report/create-stock-report.scss +2 -3
- package/src/stock-reports/generate-report/create-stock-report.workspace.tsx +25 -32
- 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 +25 -24
- package/src/stock-reports/report-list/stock-reports.scss +2 -10
- package/src/stock-sources/add-stock-sources/add-stock-sources.scss +4 -11
- package/src/stock-sources/add-stock-sources/add-stock-sources.test.tsx +36 -38
- package/src/stock-sources/add-stock-sources/add-stock-sources.workspace.tsx +30 -35
- package/src/stock-sources/delete-stock-modal.component.tsx +1 -2
- package/src/stock-sources/stock-sources-delete/stock-sources-delete.test.tsx +36 -27
- package/src/stock-sources/stock-sources-filter/stock-sources-filter.component.tsx +21 -33
- package/src/stock-sources/stock-sources-items-table.component.tsx +17 -16
- package/src/stock-sources/stock-sources-items-table.resource.ts +6 -8
- package/src/stock-sources/stock-sources-items-table.test.tsx +37 -60
- package/src/stock-sources/stock-sources.scss +2 -6
- package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.scss +13 -5
- 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 +1 -2
- package/translations/en.json +6 -5
- package/tsconfig.json +0 -4
- package/dist/33.js +0 -1
- package/dist/33.js.map +0 -1
@@ -1,10 +1,18 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import userEvent from '@testing-library/user-event';
|
3
2
|
import { renderHook, act, render, screen, waitFor } from '@testing-library/react';
|
4
|
-
import
|
5
|
-
import
|
3
|
+
import userEvent from '@testing-library/user-event';
|
4
|
+
import '@testing-library/jest-dom/extend-expect';
|
6
5
|
import StockSourcesItems from './stock-sources-items-table.component';
|
7
|
-
|
6
|
+
import useStockSourcesPage from './stock-sources-items-table.resource';
|
7
|
+
import { useTranslation } from 'react-i18next';
|
8
|
+
|
9
|
+
jest.mock('react-i18next', () => ({
|
10
|
+
useTranslation: jest.fn(),
|
11
|
+
}));
|
12
|
+
|
13
|
+
const mockTranslation = {
|
14
|
+
t: (key) => key,
|
15
|
+
};
|
8
16
|
|
9
17
|
jest.mock('./stock-sources-items-table.resource', () => ({
|
10
18
|
__esModule: true,
|
@@ -15,27 +23,13 @@ jest.mock('./stock-sources-items-table.resource', () => ({
|
|
15
23
|
describe('StockSourcesItems', () => {
|
16
24
|
const mockFilter = {};
|
17
25
|
const mockItems = {
|
18
|
-
results: [
|
19
|
-
{
|
20
|
-
uuid: '1',
|
21
|
-
name: 'Community',
|
22
|
-
acronym: 'Community',
|
23
|
-
sourceType: { display: 'Donation' },
|
24
|
-
creator: null,
|
25
|
-
dateCreated: null,
|
26
|
-
changedBy: null,
|
27
|
-
dateChanged: null,
|
28
|
-
retired: false,
|
29
|
-
dateRetired: null,
|
30
|
-
retiredBy: null,
|
31
|
-
retireReason: null,
|
32
|
-
},
|
33
|
-
] as unknown as StockSource[],
|
26
|
+
results: [{ name: 'Community', acronym: 'Community', sourceType: { display: 'Donation' } }],
|
34
27
|
totalCount: 1,
|
35
28
|
};
|
36
29
|
|
37
30
|
beforeEach(() => {
|
38
|
-
|
31
|
+
(useTranslation as jest.Mock).mockReturnValue(mockTranslation);
|
32
|
+
(useStockSourcesPage as jest.Mock).mockClear();
|
39
33
|
});
|
40
34
|
|
41
35
|
it('should return initial values', () => {
|
@@ -45,8 +39,8 @@ describe('StockSourcesItems', () => {
|
|
45
39
|
totalCount: 1,
|
46
40
|
};
|
47
41
|
|
48
|
-
|
49
|
-
items: mockItems.results
|
42
|
+
(useStockSourcesPage as jest.Mock).mockReturnValue({
|
43
|
+
items: mockItems.results,
|
50
44
|
isLoading: false,
|
51
45
|
totalItems: mockItems.totalCount,
|
52
46
|
currentPage: 1,
|
@@ -55,8 +49,6 @@ describe('StockSourcesItems', () => {
|
|
55
49
|
currentPageSize: 10,
|
56
50
|
setPageSize: jest.fn(),
|
57
51
|
error: null,
|
58
|
-
paginatedItems: mockItems.results as unknown as StockSource[],
|
59
|
-
tableHeaders: [],
|
60
52
|
});
|
61
53
|
|
62
54
|
const { result } = renderHook(() => useStockSourcesPage(mockFilter));
|
@@ -71,7 +63,7 @@ describe('StockSourcesItems', () => {
|
|
71
63
|
it('should update current page size', () => {
|
72
64
|
let currentPageSize = 10; // Track page size with a local variable
|
73
65
|
|
74
|
-
|
66
|
+
(useStockSourcesPage as jest.Mock).mockReturnValue({
|
75
67
|
items: mockItems.results,
|
76
68
|
isLoading: false,
|
77
69
|
totalItems: mockItems.totalCount,
|
@@ -79,12 +71,10 @@ describe('StockSourcesItems', () => {
|
|
79
71
|
pageSizes: [10, 20, 50],
|
80
72
|
goTo: jest.fn(),
|
81
73
|
currentPageSize,
|
82
|
-
setPageSize: jest.fn((size
|
83
|
-
currentPageSize = size;
|
74
|
+
setPageSize: jest.fn((size) => {
|
75
|
+
currentPageSize = size; // Update local variable
|
84
76
|
}),
|
85
77
|
error: null,
|
86
|
-
paginatedItems: mockItems.results,
|
87
|
-
tableHeaders: [],
|
88
78
|
});
|
89
79
|
|
90
80
|
const { result } = renderHook(() => useStockSourcesPage(mockFilter));
|
@@ -97,8 +87,8 @@ describe('StockSourcesItems', () => {
|
|
97
87
|
});
|
98
88
|
|
99
89
|
it('should handle loading and error states', () => {
|
100
|
-
|
101
|
-
items: []
|
90
|
+
(useStockSourcesPage as jest.Mock).mockReturnValue({
|
91
|
+
items: { results: [], totalCount: 0 },
|
102
92
|
isLoading: true,
|
103
93
|
error: null,
|
104
94
|
totalItems: 0,
|
@@ -107,8 +97,6 @@ describe('StockSourcesItems', () => {
|
|
107
97
|
pageSizes: [10, 20, 50],
|
108
98
|
goTo: jest.fn(),
|
109
99
|
setPageSize: jest.fn(),
|
110
|
-
paginatedItems: [] as unknown as StockSource[],
|
111
|
-
tableHeaders: [],
|
112
100
|
});
|
113
101
|
|
114
102
|
const { result } = renderHook(() => useStockSourcesPage(mockFilter));
|
@@ -119,7 +107,7 @@ describe('StockSourcesItems', () => {
|
|
119
107
|
});
|
120
108
|
|
121
109
|
test('renders loading state when data is being fetched', () => {
|
122
|
-
|
110
|
+
(useStockSourcesPage as jest.Mock).mockReturnValue({
|
123
111
|
items: [],
|
124
112
|
isLoading: true,
|
125
113
|
totalItems: 0,
|
@@ -129,12 +117,9 @@ describe('StockSourcesItems', () => {
|
|
129
117
|
goTo: jest.fn(),
|
130
118
|
currentPageSize: 10,
|
131
119
|
setPageSize: jest.fn(),
|
132
|
-
paginatedItems: [],
|
133
|
-
error: null,
|
134
120
|
});
|
135
121
|
|
136
122
|
render(<StockSourcesItems />);
|
137
|
-
|
138
123
|
expect(screen.getByRole('progressbar')).toBeInTheDocument();
|
139
124
|
});
|
140
125
|
|
@@ -148,27 +133,25 @@ describe('StockSourcesItems', () => {
|
|
148
133
|
},
|
149
134
|
];
|
150
135
|
|
151
|
-
|
152
|
-
items: mockItems
|
136
|
+
(useStockSourcesPage as jest.Mock).mockReturnValue({
|
137
|
+
items: mockItems,
|
153
138
|
isLoading: false,
|
154
139
|
totalItems: 1,
|
155
140
|
tableHeaders: [
|
156
|
-
{
|
157
|
-
{
|
141
|
+
{ key: 'name', header: 'Name' },
|
142
|
+
{ key: 'sourceType', header: 'Source Type' },
|
158
143
|
],
|
159
144
|
currentPage: 1,
|
160
145
|
pageSizes: [10, 20, 50],
|
161
146
|
goTo: jest.fn(),
|
162
147
|
currentPageSize: 10,
|
163
148
|
setPageSize: jest.fn(),
|
164
|
-
paginatedItems: mockItems as unknown as StockSource[],
|
165
|
-
error: null,
|
166
149
|
});
|
167
150
|
|
168
151
|
render(<StockSourcesItems />);
|
169
152
|
|
170
|
-
expect(screen.getByText(
|
171
|
-
expect(screen.getByText(
|
153
|
+
expect(screen.getByText('Source A')).toBeInTheDocument();
|
154
|
+
expect(screen.getByText('Internal')).toBeInTheDocument();
|
172
155
|
});
|
173
156
|
|
174
157
|
test('filters data based on source type', async () => {
|
@@ -189,18 +172,16 @@ describe('StockSourcesItems', () => {
|
|
189
172
|
},
|
190
173
|
];
|
191
174
|
|
192
|
-
|
193
|
-
items: mockItems
|
175
|
+
(useStockSourcesPage as jest.Mock).mockReturnValue({
|
176
|
+
items: mockItems,
|
194
177
|
isLoading: false,
|
195
178
|
totalItems: 2,
|
196
|
-
tableHeaders: [{
|
179
|
+
tableHeaders: [{ key: 'name', header: 'Name' }],
|
197
180
|
currentPage: 1,
|
198
181
|
pageSizes: [10, 20, 50],
|
199
182
|
goTo: jest.fn(),
|
200
183
|
currentPageSize: 10,
|
201
184
|
setPageSize: jest.fn(),
|
202
|
-
paginatedItems: mockItems as unknown as StockSource[],
|
203
|
-
error: null,
|
204
185
|
});
|
205
186
|
|
206
187
|
render(<StockSourcesItems />);
|
@@ -221,7 +202,7 @@ describe('StockSourcesItems', () => {
|
|
221
202
|
});
|
222
203
|
|
223
204
|
test('renders a message when no stock sources are available', () => {
|
224
|
-
|
205
|
+
(useStockSourcesPage as jest.Mock).mockReturnValue({
|
225
206
|
items: [],
|
226
207
|
isLoading: false,
|
227
208
|
totalItems: 0,
|
@@ -231,14 +212,12 @@ describe('StockSourcesItems', () => {
|
|
231
212
|
goTo: jest.fn(),
|
232
213
|
currentPageSize: 10,
|
233
214
|
setPageSize: jest.fn(),
|
234
|
-
paginatedItems: [],
|
235
|
-
error: null,
|
236
215
|
});
|
237
216
|
|
238
217
|
render(<StockSourcesItems />);
|
239
218
|
|
240
|
-
expect(screen.getByText(
|
241
|
-
expect(screen.getByText(
|
219
|
+
expect(screen.getByText('noSourcesToDisplay')).toBeInTheDocument();
|
220
|
+
expect(screen.getByText('checkFilters')).toBeInTheDocument();
|
242
221
|
});
|
243
222
|
|
244
223
|
test('pagination works as expected', async () => {
|
@@ -247,7 +226,7 @@ describe('StockSourcesItems', () => {
|
|
247
226
|
const mockGoTo = jest.fn();
|
248
227
|
const mockSetPageSize = jest.fn();
|
249
228
|
|
250
|
-
|
229
|
+
(useStockSourcesPage as jest.Mock).mockReturnValue({
|
251
230
|
items: [],
|
252
231
|
isLoading: false,
|
253
232
|
totalItems: 20,
|
@@ -257,13 +236,11 @@ describe('StockSourcesItems', () => {
|
|
257
236
|
goTo: mockGoTo,
|
258
237
|
currentPageSize: 10,
|
259
238
|
setPageSize: mockSetPageSize,
|
260
|
-
paginatedItems: [],
|
261
|
-
error: null,
|
262
239
|
});
|
263
240
|
|
264
241
|
render(<StockSourcesItems />);
|
265
242
|
|
266
|
-
const nextPageButton = screen.getByLabelText(
|
243
|
+
const nextPageButton = screen.getByLabelText('Next page');
|
267
244
|
await user.click(nextPageButton);
|
268
245
|
|
269
246
|
expect(mockGoTo).toHaveBeenCalledWith(2);
|
@@ -1,6 +1,6 @@
|
|
1
|
-
@use '@carbon/colors';
|
1
|
+
@use '@carbon/styles/scss/colors';
|
2
2
|
@use '@carbon/layout';
|
3
|
-
@use '@carbon/type';
|
3
|
+
@use '@carbon/styles/scss/type';
|
4
4
|
@use '@openmrs/esm-styleguide/src/vars' as *;
|
5
5
|
|
6
6
|
.container {
|
@@ -217,7 +217,3 @@
|
|
217
217
|
margin-top: 0.5rem;
|
218
218
|
cursor: pointer;
|
219
219
|
}
|
220
|
-
|
221
|
-
.toolbarMenuAction {
|
222
|
-
max-width: none;
|
223
|
-
}
|
@@ -1,24 +1,25 @@
|
|
1
|
+
@use '@carbon/styles/scss/spacing';
|
2
|
+
@use '@carbon/styles/scss/type';
|
1
3
|
@use '@carbon/layout';
|
2
|
-
@use '@carbon/type';
|
3
4
|
@use '@openmrs/esm-styleguide/src/vars' as *;
|
4
5
|
|
5
6
|
.section {
|
6
|
-
margin:
|
7
|
+
margin: spacing.$spacing-03;
|
7
8
|
}
|
8
9
|
|
9
10
|
.sectionTitle {
|
10
11
|
@include type.type-style('heading-compact-02');
|
11
12
|
color: $text-02;
|
12
|
-
margin-bottom:
|
13
|
+
margin-bottom: spacing.$spacing-04;
|
13
14
|
}
|
14
15
|
|
15
16
|
.subTitle {
|
16
17
|
font-size: 14px;
|
17
|
-
margin-bottom:
|
18
|
+
margin-bottom: spacing.$spacing-04;
|
18
19
|
}
|
19
20
|
|
20
21
|
.modalBody {
|
21
|
-
padding-bottom:
|
22
|
+
padding-bottom: spacing.$spacing-05;
|
22
23
|
}
|
23
24
|
|
24
25
|
.checkboxGrid {
|
@@ -51,6 +52,13 @@
|
|
51
52
|
margin: layout.$spacing-05;
|
52
53
|
}
|
53
54
|
|
55
|
+
.button {
|
56
|
+
display: flex;
|
57
|
+
align-content: flex-start;
|
58
|
+
align-items: baseline;
|
59
|
+
min-width: 50%;
|
60
|
+
}
|
61
|
+
|
54
62
|
.buttonSet {
|
55
63
|
display: flex;
|
56
64
|
justify-content: space-between;
|
package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.workspace.tsx
CHANGED
@@ -403,10 +403,10 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({ model, ed
|
|
403
403
|
})}
|
404
404
|
>
|
405
405
|
<Button kind="secondary" onClick={closeWorkspace} className={styles.button}>
|
406
|
-
{getCoreTranslation('cancel')}
|
406
|
+
{getCoreTranslation('cancel', 'Cancel')}
|
407
407
|
</Button>
|
408
408
|
<Button type="submit" className={styles.button} onClick={addStockUserRole} renderIcon={Save}>
|
409
|
-
{getCoreTranslation('save')}
|
409
|
+
{getCoreTranslation('save', 'Save')}
|
410
410
|
</Button>
|
411
411
|
</ButtonSet>
|
412
412
|
</Form>
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { useTranslation } from 'react-i18next';
|
3
3
|
import { Button, ModalHeader, ModalBody, ModalFooter } from '@carbon/react';
|
4
|
-
import { getCoreTranslation } from '@openmrs/esm-framework';
|
5
4
|
import styles from './delete-stock-user-scope-modal.scss';
|
6
5
|
|
7
6
|
interface DeleteConfirmationProps {
|
@@ -27,7 +26,7 @@ const DeleteConfirmation: React.FC<DeleteConfirmationProps> = ({ close, onConfir
|
|
27
26
|
</ModalBody>
|
28
27
|
<ModalFooter>
|
29
28
|
<Button size="lg" kind="secondary" onClick={handleCancel}>
|
30
|
-
{
|
29
|
+
{t('cancel', 'Cancel')}
|
31
30
|
</Button>
|
32
31
|
<Button autoFocus kind="danger" onClick={handleDelete} size="lg">
|
33
32
|
{t('delete', 'Delete')}
|
package/translations/en.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"abbreviation": "Abbreviation",
|
3
|
-
"
|
3
|
+
"acronym": "Acronym/Code",
|
4
4
|
"action": "Actions",
|
5
5
|
"actionFrequency": "Notification Frequency (Minutes)",
|
6
6
|
"actions": "Actions",
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"addedSource": "Add Source",
|
12
12
|
"addItem": "Add stock item",
|
13
13
|
"addLocation": "Create new Location",
|
14
|
+
"addNewStock": "Add New",
|
14
15
|
"addNewStockRule": "Add New Rule",
|
15
16
|
"addNewStockSource": "Add new source",
|
16
17
|
"addNewUserRoleScope": "Add new user role scope",
|
@@ -93,6 +94,7 @@
|
|
93
94
|
"disposedStock": "Disposed stock",
|
94
95
|
"doesThisTransactionRequireApproval": "Does the transaction require approval ?",
|
95
96
|
"drug": "Drug",
|
97
|
+
"editItem": "Edit {{name}}",
|
96
98
|
"editOperationTitle": "Edit {{operationType}}",
|
97
99
|
"editStockItem": "Edit Stock Item",
|
98
100
|
"editStockOperation": "Edit stock operation",
|
@@ -188,6 +190,7 @@
|
|
188
190
|
"noInventoryAlerts": "No inventory alerts to display",
|
189
191
|
"noIssuedStock": "No issued stock to display",
|
190
192
|
"noIssuedStockDataAvailable": "No issued stock data available.",
|
193
|
+
"noItemsToDisplay": "No Stock Items to display",
|
191
194
|
"noneFulfillment": "Non Fulfillment",
|
192
195
|
"noOperationsToDisplay": "No Stock Operations to display",
|
193
196
|
"noPrivilagesTitle": "",
|
@@ -202,7 +205,6 @@
|
|
202
205
|
"notSet": "Not Set",
|
203
206
|
"noViewPrivilegesDescription": "Description: {{description}}",
|
204
207
|
"number": "Number",
|
205
|
-
"onlyCsvFilesAt2mbOrLess": "Only .csv files at 2MB or less",
|
206
208
|
"operationDate": "Operation Date",
|
207
209
|
"operationModalTitle": "{{title}} Operation",
|
208
210
|
"operationNumber": "Operation Number",
|
@@ -251,6 +253,7 @@
|
|
251
253
|
"refresh": "Refresh",
|
252
254
|
"reject": "Reject ",
|
253
255
|
"rejected": "Rejected",
|
256
|
+
"rejectOrder": "Uploaded Order",
|
254
257
|
"relatedStockRequisitionRequired": "Related stock requisition Required",
|
255
258
|
"remarks": "Remarks",
|
256
259
|
"removePackagingUnit": "Remove Packaging Unit",
|
@@ -277,9 +280,7 @@
|
|
277
280
|
"saveStockItemReferenceErrorTitle": "StockItem Reference",
|
278
281
|
"saveStockItemReferenceMessage": "Stock Item Reference saved successfully",
|
279
282
|
"search": "Search",
|
280
|
-
"searchStockOperations": "Search stock operations",
|
281
283
|
"searchThisList": "Search this list",
|
282
|
-
"selectFile": "Select file",
|
283
284
|
"SelectOption": "Select an option",
|
284
285
|
"selectTags": "Select tag(s)",
|
285
286
|
"source": "Source",
|
@@ -296,7 +297,6 @@
|
|
296
297
|
"stockItemEdited": "Stock Item Edited Successfully",
|
297
298
|
"stockItemError": "Error loading stock item",
|
298
299
|
"stockItems": "Stock Items",
|
299
|
-
"stockItemsUploadedSuccessfully": "Stock items uploaded successfully",
|
300
300
|
"stockManagement": "Stock Management",
|
301
301
|
"stockOperation": "Stock Operations",
|
302
302
|
"stockOperationAdded": "Stock operation added successfully",
|
@@ -326,6 +326,7 @@
|
|
326
326
|
"submittingForReview": "Submitting for review",
|
327
327
|
"success": "Success",
|
328
328
|
"successfullysaved": "You have successfully saved user role scope",
|
329
|
+
"SuccessfullyUploadedStockItem": "You have successfully uploaded stock items",
|
329
330
|
"tabletOverlay": "Tablet overlay",
|
330
331
|
"tags": "Tags",
|
331
332
|
"timeTaken": "Time Taken",
|
package/tsconfig.json
CHANGED
package/dist/33.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_stock_management_app=globalThis.webpackChunk_openmrs_esm_stock_management_app||[]).push([[33],{9033:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var r=n(1672),o=n.n(r),l=n(3397),a=n(5787),i=n(3775);function c(e,t,n,r,o,l,a){try{var i=e[l](a),c=i.value}catch(e){return void n(e)}i.done?t(c):Promise.resolve(c).then(r,o)}function s(){var e;return e=function(e){var t;return function(e,t){var n,r,o,l,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function i(l){return function(i){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,i])}}}(this,(function(n){return t=new AbortController,[2,(0,i.openmrsFetch)("".concat(i.restBaseUrl,"/stockmanagement/stockitemimport"),{method:"POST",signal:t.signal,body:e})]}))},s=function(){var t=this,n=arguments;return new Promise((function(r,o){var l=e.apply(t,n);function a(e){c(l,r,o,a,i,"next",e)}function i(e){c(l,r,o,a,i,"throw",e)}a(void 0)}))},s.apply(this,arguments)}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const f=function(e){var t,n,c=e.closeModal,f=(0,l.useTranslation)().t,p=(t=(0,r.useState)(),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,l=[],a=!0,i=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(i)throw o}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),m=p[0],d=p[1];return o().createElement("div",null,o().createElement(a.l09,null,o().createElement(a.xBx,{closeModal:c,title:f("importStockItems","Import stock items")}),o().createElement(a.fef,null,o().createElement(a.bAu,{accept:[".csv"],buttonLabel:f("selectFile","Select file"),filenameStatus:"edit",labelDescription:f("onlyCsvFilesAt2mbOrLess","Only .csv files at 2MB or less"),labelTitle:"",multiple:!1,name:"file",onChange:function(e){var t,n,r=null==e||null===(n=e.target)||void 0===n||null===(t=n.files)||void 0===t?void 0:t[0];r?d(r):e.preventDefault()},size:"sm"})),o().createElement(a.mzw,null,o().createElement(a.zxk,{kind:"secondary",onClick:c},(0,i.getCoreTranslation)("cancel")),o().createElement(a.zxk,{type:"button",onClick:function(){if(m){var e=new FormData;m&&(e.append("file",m,"Import_Stock_Items.csv"),e.append("hasHeader","true")),function(e){return s.apply(this,arguments)}(e).then((function(){(0,i.showSnackbar)({kind:"success",title:f("stockItemsUploadedSuccessfully","Stock items uploaded successfully")}),c()}),(function(e){(0,i.showSnackbar)({kind:"error",isLowContrast:!1,subtitle:null==e?void 0:e.message,title:f("errorUploadingItems","An error occurred uploading stock items")})}))}}},f("uploadStockItems","Upload stock items")))))}}}]);
|
package/dist/33.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"33.js","mappings":"qXAEsBA,I,eAAf,SAAgCC,G,IAC/BC,E,8jCAEN,OAFMA,EAAkB,IAAIC,gBAErB,C,GAAAC,EAAAA,EAAAA,cAAa,GAAe,OAAZC,EAAAA,YAAY,oCAAmC,CACpEC,OAAQ,OAIRC,OAAQL,EAAgBK,OACxBN,KAAMA,I,GAEV,EAXsBD,E,8KAAAA,EAAAA,MAAAA,KAAAA,U,2GCkFtB,QA1E4E,Y,QAAGQ,EAAAA,EAAAA,WACvE,GAAQC,EAAAA,EAAAA,kBAANC,EACgCC,G,GAAAA,EAAAA,EAAAA,Y,EAAQA,E,+zBAAzCC,EAAiCD,EAAAA,GAAnBE,EAAmBF,EAAAA,GA0CxC,OACE,kBAACG,MAAAA,KACC,kBAACC,EAAAA,IAAIA,KACH,kBAACC,EAAAA,IAAWA,CAACR,WAAYA,EAAYS,MAAOP,EAAE,mBAAoB,wBAClE,kBAACQ,EAAAA,IAASA,KACR,kBAACC,EAAAA,IAAYA,CACXC,OAAQ,CAAC,QACTC,YAAaX,EAAE,aAAc,eAC7BY,eAAe,OACfC,iBAAkBb,EAAE,0BAA2B,kCAC/Cc,WAAW,GACXC,UAAU,EACVC,KAAK,OACLC,SAtBY,SAACC,G,IACRA,EAAAA,EAAPC,EAAOD,SAAa,QAAbA,EAAAA,EAAOE,cAAPF,IAAAA,GAAoB,QAApBA,EAAAA,EAAeG,aAAfH,IAAAA,OAAAA,EAAAA,EAAuB,GAChCC,EACFhB,EAAgBgB,GAEhBD,EAAMI,gBAEV,EAgBUC,KAAK,QAGT,kBAACC,EAAAA,IAAWA,KACV,kBAACC,EAAAA,IAAMA,CAACC,KAAK,YAAYC,QAAS7B,IAC/B8B,EAAAA,EAAAA,oBAAmB,WAEtB,kBAACH,EAAAA,IAAMA,CAACI,KAAK,SAASF,QA7DN,WACtB,GAAKzB,EAAL,CAIA,IAAM4B,EAAW,IAAIC,SAEjB7B,IACF4B,EAASE,OAAO,OAAQ9B,EAAc,0BACtC4B,EAASE,OAAO,YAAa,SDrB5B,SAAgCzC,G,OAAjBD,EAAAA,MAAAA,KAAAA,U,CCwBlBA,CAAiBwC,GAAUG,MACzB,YACEC,EAAAA,EAAAA,cAAa,CACXR,KAAM,UACNnB,MAAOP,EAAE,iCAAkC,uCAE7CF,GACF,IACA,SAACqC,IACCD,EAAAA,EAAAA,cAAa,CACXR,KAAM,QACNU,eAAe,EACfC,SAAUF,aAAAA,EAAAA,EAAKG,QACf/B,MAAOP,EAAE,sBAAuB,4CAEpC,GAxBF,CA0BF,GAiCWA,EAAE,mBAAoB,yBAMnC,C","sources":["webpack://@openmrs/esm-stock-management-app/./src/stock-items/add-bulk-stock-item/stock-items-bulk-import.resource.ts","webpack://@openmrs/esm-stock-management-app/./src/stock-items/add-bulk-stock-item/stock-items-bulk-import.modal.tsx"],"names":["uploadStockItems","body","abortController","AbortController","openmrsFetch","restBaseUrl","method","signal","closeModal","useTranslation","t","useState","selectedFile","setSelectedFile","div","Form","ModalHeader","title","ModalBody","FileUploader","accept","buttonLabel","filenameStatus","labelDescription","labelTitle","multiple","name","onChange","event","file","target","files","preventDefault","size","ModalFooter","Button","kind","onClick","getCoreTranslation","type","formData","FormData","append","then","showSnackbar","err","isLowContrast","subtitle","message"],"sourceRoot":""}
|