@openmrs/esm-stock-management-app 3.0.1-pre.840 → 3.0.1-pre.848
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/dist/10.js +1 -1
- package/dist/119.js +1 -1
- package/dist/14.js +1 -0
- package/dist/14.js.map +1 -0
- package/dist/152.js +1 -0
- package/dist/152.js.map +1 -0
- package/dist/172.js +1 -1
- package/dist/172.js.map +1 -1
- package/dist/20.js +1 -1
- package/dist/235.js +1 -0
- package/dist/235.js.map +1 -0
- package/dist/290.js +1 -1
- package/dist/290.js.map +1 -1
- package/dist/467.js +1 -1
- package/dist/574.js +1 -1
- package/dist/606.js +1 -1
- package/dist/627.js +1 -1
- package/dist/642.js +1 -1
- package/dist/675.js +1 -1
- package/dist/703.js +1 -0
- package/dist/703.js.map +1 -0
- package/dist/727.js +1 -1
- package/dist/842.js +2 -0
- package/dist/842.js.map +1 -0
- 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 +1 -1
- package/dist/openmrs-esm-stock-management-app.js.buildmanifest.json +133 -61
- package/dist/openmrs-esm-stock-management-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/core/components/card/metrics-card-component.tsx +24 -21
- package/src/core/components/card/metrics-card.scss +46 -8
- 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.scss +1 -1
- package/src/core/components/tabs/vertical-tabs.scss +1 -1
- package/src/dashboard/home-dashboard.scss +0 -4
- package/src/index.ts +61 -42
- package/src/routes.json +12 -4
- package/src/stock-home/{stock-home-inventory-expiry.component.tsx → expired-stock.modal.tsx} +26 -14
- package/src/stock-home/{stock-home-issuing-modal.component.tsx → issuing-stock.modal.tsx} +26 -14
- package/src/stock-home/{stock-home-receiving-modal.component.tsx → receiving-stock.modal.tsx} +27 -20
- package/src/stock-home/stock-home-detail-card.scss +24 -30
- package/src/stock-home/stock-home-detail-cards.component.tsx +34 -33
- package/src/stock-home/stock-home-inventory-card.component.tsx +19 -33
- package/src/stock-home/{stock-home-inventory-expiry.resource.tsx → stock-home-inventory-expiry.resource.ts} +2 -7
- package/src/stock-home/{stock-home-inventory-items.resource.tsx → stock-home-inventory-items.resource.ts} +2 -1
- package/src/stock-home/stock-home-issuing-card.component.tsx +17 -28
- package/src/stock-home/stock-home-landing-page-component.tsx +1 -3
- package/src/stock-home/{stock-home-metrics.tsx → stock-home-metrics.component.tsx} +37 -40
- package/src/stock-home/stock-home-receiving-card.component.tsx +16 -27
- package/src/stock-home/stock-home.scss +5 -5
- 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-rules/add-stock-rule-button.component.tsx +1 -1
- package/src/stock-items/stock-items-table.scss +6 -9
- package/src/stock-items/stock-items.component.tsx +1 -1
- package/src/stock-locations/stock-locations.component.tsx +1 -1
- 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-filters.component.tsx +5 -5
- 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/report-list/stock-reports.scss +1 -1
- package/src/stock-sources/add-stock-sources/add-stock-sources.scss +1 -1
- package/src/stock-sources/delete-stock-modal.scss +1 -1
- package/src/stock-sources/stock-sources.component.tsx +1 -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 +34 -29
- package/dist/165.js +0 -2
- package/dist/165.js.map +0 -1
- package/dist/769.js +0 -1
- package/dist/769.js.map +0 -1
- /package/dist/{165.js.LICENSE.txt → 842.js.LICENSE.txt} +0 -0
- /package/src/stock-home/{stock-home-issuing.resource.tsx → stock-home-issuing.resource.ts} +0 -0
- /package/src/stock-home/{stock-home-receiving.resource.tsx → stock-home-receiving.resource.ts} +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
@use '@carbon/layout';
|
2
2
|
@use '@carbon/styles/scss/type';
|
3
|
-
@use '
|
3
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
4
4
|
|
5
5
|
.headerBtnContainer {
|
6
6
|
background-color: $ui-background;
|
@@ -74,6 +74,8 @@
|
|
74
74
|
.filterContainer {
|
75
75
|
display: flex;
|
76
76
|
align-items: center;
|
77
|
+
justify-content: space-between;
|
78
|
+
margin-bottom: layout.$spacing-05;
|
77
79
|
}
|
78
80
|
|
79
81
|
.dateAlign {
|
@@ -82,17 +84,12 @@
|
|
82
84
|
}
|
83
85
|
|
84
86
|
.filtersAlign {
|
85
|
-
|
87
|
+
margin-bottom: layout.$spacing-03;
|
88
|
+
min-width: auto;
|
89
|
+
width: auto;
|
86
90
|
|
87
91
|
:global(.cds--list-box__menu) {
|
88
92
|
min-width: 15rem;
|
89
93
|
z-index: 1;
|
90
94
|
}
|
91
95
|
}
|
92
|
-
|
93
|
-
.filterContainer {
|
94
|
-
display: flex;
|
95
|
-
align-items: center;
|
96
|
-
justify-content: space-between;
|
97
|
-
margin-bottom: layout.$spacing-05;
|
98
|
-
}
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
2
|
-
import { getStockOperationTypes, useConcept } from '../stock-lookups/stock-lookups.resource';
|
3
2
|
import { DropdownSkeleton, MultiSelect } from '@carbon/react';
|
3
|
+
import { getStockOperationTypes, useConcept } from '../stock-lookups/stock-lookups.resource';
|
4
4
|
import { StockFilters } from '../constants';
|
5
5
|
import { StockOperationStatusTypes } from '../core/api/types/stockOperation/StockOperationStatus';
|
6
6
|
import styles from '../stock-items/stock-items-table.scss';
|
7
7
|
|
8
8
|
interface StockOperationFiltersProps {
|
9
9
|
conceptUuid?: string;
|
10
|
-
onFilterChange: (selectedItems: any[], filterType: string) => void;
|
11
10
|
filterName: string;
|
11
|
+
onFilterChange: (selectedItems: any[], filterType: string) => void;
|
12
12
|
}
|
13
13
|
|
14
14
|
const StockOperationsFilters: React.FC<StockOperationFiltersProps> = ({ conceptUuid, onFilterChange, filterName }) => {
|
@@ -58,11 +58,12 @@ const StockOperationsFilters: React.FC<StockOperationFiltersProps> = ({ conceptU
|
|
58
58
|
|
59
59
|
return (
|
60
60
|
<MultiSelect
|
61
|
+
autoAlign
|
61
62
|
className={styles.filtersAlign}
|
63
|
+
disabled={!dataItems.length}
|
62
64
|
id="multiSelect"
|
63
65
|
label={filterName}
|
64
|
-
|
65
|
-
labelInline={true}
|
66
|
+
labelInline
|
66
67
|
items={dataItems}
|
67
68
|
itemToString={(item) => (item ? item.display : 'Not Set')}
|
68
69
|
onChange={({ selectedItems }) => {
|
@@ -74,7 +75,6 @@ const StockOperationsFilters: React.FC<StockOperationFiltersProps> = ({ conceptU
|
|
74
75
|
}
|
75
76
|
}}
|
76
77
|
placeholder={`Filter by ${filterName}`}
|
77
|
-
style={{ minWidth: 'auto', width: 'auto' }}
|
78
78
|
/>
|
79
79
|
);
|
80
80
|
};
|
@@ -1,9 +1,11 @@
|
|
1
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
1
2
|
import {
|
2
3
|
DataTable,
|
3
4
|
DataTableSkeleton,
|
4
5
|
DatePicker,
|
5
6
|
DatePickerInput,
|
6
7
|
InlineLoading,
|
8
|
+
Link,
|
7
9
|
Pagination,
|
8
10
|
Table,
|
9
11
|
TableBody,
|
@@ -22,22 +24,18 @@ import {
|
|
22
24
|
TableToolbarSearch,
|
23
25
|
TabPanel,
|
24
26
|
Tile,
|
25
|
-
Link,
|
26
27
|
} from '@carbon/react';
|
27
28
|
import { ArrowRight } from '@carbon/react/icons';
|
28
|
-
import { isDesktop, restBaseUrl } from '@openmrs/esm-framework';
|
29
|
-
import React, { useCallback, useMemo, useState } from 'react';
|
30
29
|
import { useTranslation } from 'react-i18next';
|
30
|
+
import { isDesktop, restBaseUrl } from '@openmrs/esm-framework';
|
31
31
|
import { DATE_PICKER_CONTROL_FORMAT, DATE_PICKER_FORMAT, StockFilters } from '../constants';
|
32
|
-
import { ResourceRepresentation } from '../core/api/api';
|
33
|
-
import { StockOperationType } from '../core/api/types/stockOperation/StockOperationType';
|
34
32
|
import { formatDisplayDate } from '../core/utils/datetimeUtils';
|
35
33
|
import { handleMutate } from '../utils';
|
34
|
+
import { ResourceRepresentation } from '../core/api/api';
|
35
|
+
import { useStockOperationPages } from './stock-operations-table.resource';
|
36
36
|
import EditStockOperationActionMenu from './edit-stock-operation/edit-stock-operation-action-menu.component';
|
37
37
|
import StockOperationTypesSelector from './stock-operation-types-selector/stock-operation-types-selector.component';
|
38
38
|
import StockOperationsFilters from './stock-operations-filters.component';
|
39
|
-
import { useStockOperationPages } from './stock-operations-table.resource';
|
40
|
-
|
41
39
|
import StockOperationExpandedRow from './add-stock-operation/stock-operations-expanded-row/stock-operation-expanded-row.component';
|
42
40
|
import styles from './stock-operations-table.scss';
|
43
41
|
|
@@ -47,6 +45,7 @@ interface StockOperationsTableProps {
|
|
47
45
|
|
48
46
|
const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
49
47
|
const { t } = useTranslation();
|
48
|
+
|
50
49
|
const handleRefresh = () => {
|
51
50
|
handleMutate(`${restBaseUrl}/stockmanagement/stockoperation`);
|
52
51
|
};
|
@@ -96,46 +95,48 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
96
95
|
}
|
97
96
|
};
|
98
97
|
|
99
|
-
const tableRows = useMemo(
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
?.
|
106
|
-
|
107
|
-
|
98
|
+
const tableRows = useMemo(
|
99
|
+
() =>
|
100
|
+
items?.map((stockOperation, index) => {
|
101
|
+
const threshHold = 1;
|
102
|
+
const itemCountGreaterThanThreshhold = (stockOperation?.stockOperationItems?.length ?? 0) > threshHold;
|
103
|
+
const commonNames =
|
104
|
+
stockOperation?.stockOperationItems
|
105
|
+
?.slice(0, itemCountGreaterThanThreshhold ? threshHold : undefined)
|
106
|
+
.map((item) => item.commonName)
|
107
|
+
.join(', ') ?? '';
|
108
108
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
109
|
+
return {
|
110
|
+
...stockOperation,
|
111
|
+
id: stockOperation?.uuid,
|
112
|
+
key: `key-${stockOperation?.uuid}`,
|
113
|
+
operationTypeName: `${stockOperation?.operationTypeName}`,
|
114
|
+
operationNumber: (
|
115
|
+
<EditStockOperationActionMenu stockOperation={stockOperation} showIcon={false} showprops={true} />
|
116
|
+
),
|
117
|
+
stockOperationItems: {
|
118
|
+
commonNames,
|
119
|
+
more: itemCountGreaterThanThreshhold ? stockOperation?.stockOperationItems?.length - threshHold : 0,
|
120
|
+
},
|
121
|
+
status: `${stockOperation?.status}`,
|
122
|
+
source: `${stockOperation?.sourceName ?? ''}`,
|
123
|
+
destination: `${stockOperation?.destinationName ?? ''}`,
|
124
|
+
location: (
|
125
|
+
<>
|
126
|
+
{stockOperation?.sourceName ?? ''}
|
127
|
+
{stockOperation?.sourceName && stockOperation?.destinationName ? <ArrowRight size={16} /> : ''}{' '}
|
128
|
+
{stockOperation?.destinationName ?? ''}
|
129
|
+
</>
|
130
|
+
),
|
131
|
+
responsiblePerson: `${
|
132
|
+
stockOperation?.responsiblePersonFamilyName ?? stockOperation?.responsiblePersonOther ?? ''
|
133
|
+
} ${stockOperation?.responsiblePersonGivenName ?? ''}`,
|
134
|
+
operationDate: formatDisplayDate(stockOperation?.operationDate),
|
135
|
+
actions: <EditStockOperationActionMenu stockOperation={stockOperation} showIcon={true} showprops={false} />,
|
136
|
+
};
|
137
|
+
}),
|
138
|
+
[items],
|
139
|
+
);
|
139
140
|
|
140
141
|
if (isLoading && !filterApplied) {
|
141
142
|
return (
|
@@ -144,26 +145,22 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
144
145
|
}
|
145
146
|
|
146
147
|
return (
|
147
|
-
<div
|
148
|
+
<div>
|
148
149
|
<TabPanel>{t('stockOperationTrackMovement', 'Stock operations to track movement of stock.')}</TabPanel>
|
149
|
-
<div id="table-tool-bar">
|
150
|
-
<div></div>
|
151
|
-
<div className="right-filters"></div>
|
152
|
-
</div>
|
153
150
|
<DataTable
|
154
|
-
rows={tableRows}
|
155
151
|
headers={tableHeaders}
|
156
|
-
isSortable
|
157
|
-
|
152
|
+
isSortable
|
153
|
+
rows={tableRows}
|
154
|
+
useZebraStyles
|
158
155
|
render={({
|
159
|
-
|
160
|
-
|
156
|
+
expandRow,
|
157
|
+
getExpandedRowProps,
|
161
158
|
getHeaderProps,
|
162
|
-
getTableProps,
|
163
159
|
getRowProps,
|
160
|
+
getTableProps,
|
161
|
+
headers,
|
164
162
|
onInputChange,
|
165
|
-
|
166
|
-
expandRow,
|
163
|
+
rows,
|
167
164
|
}) => (
|
168
165
|
<TableContainer>
|
169
166
|
<TableToolbar
|
@@ -175,34 +172,30 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
175
172
|
>
|
176
173
|
<TableToolbarContent className={styles.toolbarContent}>
|
177
174
|
<TableToolbarSearch
|
178
|
-
className={styles.patientListSearch}
|
179
175
|
expanded
|
176
|
+
labelText={t('searchStockOperations', 'Search stock operations')}
|
180
177
|
onChange={onInputChange}
|
181
|
-
placeholder=
|
182
|
-
size="sm"
|
178
|
+
placeholder={t('searchStockOperations', 'Search stock operations')}
|
183
179
|
/>
|
184
|
-
<div className={styles.
|
180
|
+
<div className={styles.container}>
|
185
181
|
<DatePicker
|
186
|
-
className={styles.
|
182
|
+
className={styles.datePicker}
|
187
183
|
datePickerType="range"
|
188
184
|
dateFormat={DATE_PICKER_CONTROL_FORMAT}
|
185
|
+
onChange={([startDate, endDate]) => handleDateFilterChange([startDate, endDate])}
|
189
186
|
value={[selectedFromDate, selectedToDate]}
|
190
|
-
onChange={([startDate, endDate]) => {
|
191
|
-
handleDateFilterChange([startDate, endDate]);
|
192
|
-
}}
|
193
187
|
>
|
194
|
-
<DatePickerInput placeholder={DATE_PICKER_FORMAT} />
|
195
|
-
<DatePickerInput placeholder={DATE_PICKER_FORMAT} />
|
188
|
+
<DatePickerInput labelText={t('startDate', 'Start date')} placeholder={DATE_PICKER_FORMAT} />
|
189
|
+
<DatePickerInput labelText={t('endDate', 'End date')} placeholder={DATE_PICKER_FORMAT} />
|
196
190
|
</DatePicker>
|
197
|
-
|
198
191
|
<StockOperationsFilters filterName={StockFilters.SOURCES} onFilterChange={handleOnFilterChange} />
|
199
|
-
|
200
192
|
<StockOperationsFilters filterName={StockFilters.STATUS} onFilterChange={handleOnFilterChange} />
|
201
|
-
|
202
193
|
<StockOperationsFilters filterName={StockFilters.OPERATION} onFilterChange={handleOnFilterChange} />
|
203
194
|
</div>
|
204
195
|
<TableToolbarMenu>
|
205
|
-
<TableToolbarAction onClick={handleRefresh}>
|
196
|
+
<TableToolbarAction className={styles.toolbarMenuAction} onClick={handleRefresh}>
|
197
|
+
{t('refresh', 'Refresh')}
|
198
|
+
</TableToolbarAction>
|
206
199
|
</TableToolbarMenu>
|
207
200
|
|
208
201
|
<StockOperationTypesSelector />
|
@@ -1,7 +1,7 @@
|
|
1
|
+
@use '@carbon/colors';
|
1
2
|
@use '@carbon/layout';
|
2
3
|
@use '@carbon/type';
|
3
|
-
@use '@
|
4
|
-
@use '~@openmrs/esm-styleguide/src/vars' as *;
|
4
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
5
5
|
|
6
6
|
.tileContainer {
|
7
7
|
background-color: $ui-02;
|
@@ -34,23 +34,20 @@
|
|
34
34
|
.toolbarContent {
|
35
35
|
display: flex;
|
36
36
|
align-items: center;
|
37
|
+
height: layout.$spacing-09;
|
38
|
+
margin-top: layout.$spacing-05;
|
37
39
|
}
|
38
40
|
|
39
|
-
.
|
41
|
+
.container {
|
40
42
|
display: flex;
|
41
43
|
align-items: center;
|
42
|
-
|
43
|
-
|
44
|
-
.dateAlign {
|
45
|
-
padding-top: layout.$spacing-03;
|
46
|
-
height: 100%;
|
44
|
+
justify-content: space-between;
|
47
45
|
}
|
48
46
|
|
49
47
|
.filterContainer {
|
50
48
|
display: flex;
|
51
49
|
align-items: center;
|
52
50
|
justify-content: space-between;
|
53
|
-
margin-bottom: layout.$spacing-05;
|
54
51
|
}
|
55
52
|
|
56
53
|
.rowLoadingContainer {
|
@@ -96,3 +93,15 @@
|
|
96
93
|
.relatedTransactionHeader {
|
97
94
|
color: colors.$green-50;
|
98
95
|
}
|
96
|
+
|
97
|
+
.toolbarMenuAction {
|
98
|
+
max-width: none;
|
99
|
+
}
|
100
|
+
|
101
|
+
.dataTableSkeleton {
|
102
|
+
margin-top: layout.$spacing-09;
|
103
|
+
}
|
104
|
+
|
105
|
+
.datePicker {
|
106
|
+
margin-bottom: layout.$spacing-05;
|
107
|
+
}
|