@openmrs/esm-stock-management-app 3.1.1-pre.1177 → 3.1.1-pre.1184
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 +0 -5
- package/.husky/pre-push +0 -3
- package/dist/130.js +1 -1
- package/dist/130.js.map +1 -1
- package/dist/2177.js +1 -1
- package/dist/2177.js.map +1 -1
- package/dist/3220.js +1 -1
- package/dist/3220.js.map +1 -1
- package/dist/4300.js +1 -1
- package/dist/4732.js +1 -1
- package/dist/4732.js.map +1 -1
- package/dist/5125.js +1 -1
- package/dist/5125.js.map +1 -1
- package/dist/5333.js +1 -1
- package/dist/5333.js.map +1 -1
- package/dist/5609.js +1 -1
- package/dist/5609.js.map +1 -1
- package/dist/6184.js +1 -1
- package/dist/6184.js.map +1 -1
- package/dist/6757.js +1 -1
- package/dist/6757.js.map +1 -1
- package/dist/8161.js +1 -1
- package/dist/8161.js.map +1 -1
- package/dist/9186.js +1 -1
- package/dist/9186.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 +42 -42
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/constants.ts +2 -3
- package/src/core/components/carbon/controlled-combo-box.component.tsx +12 -9
- package/src/core/components/carbon/controlled-radio-button-group.component.tsx +21 -16
- package/src/core/components/table/table.component.tsx +26 -17
- package/src/core/components/table/table.scss +4 -0
- package/src/core/components/table/types.ts +12 -0
- package/src/core/components/tabs/vertical-tabs.component.tsx +2 -6
- package/src/declarations.d.ts +0 -3
- package/src/stock-home/stock-home-inventory-card.component.tsx +2 -2
- package/src/stock-items/add-stock-item/add-stock-item.component.tsx +1 -1
- package/src/stock-items/add-stock-item/batch-information/batch-information-locations/batch-information-locations-filter.component.tsx +0 -3
- package/src/stock-items/add-stock-item/batch-information/batch-information.component.tsx +4 -4
- package/src/stock-items/add-stock-item/dispensing-package-measurement/dispensing-package-measurement.component.tsx +2 -5
- package/src/stock-items/add-stock-item/drug-selector/drug-selector.component.tsx +4 -8
- package/src/stock-items/add-stock-item/packaging-units/packaging-units-delete.modal.tsx +2 -2
- package/src/stock-items/add-stock-item/packaging-units/packaging-units.component.tsx +32 -18
- package/src/stock-items/add-stock-item/packaging-units-concept-selector/packaging-units-concept-selector.component.tsx +2 -5
- package/src/stock-items/add-stock-item/preferred-vendor-selector/preferred-vendor-selector.component.tsx +0 -3
- package/src/stock-items/add-stock-item/stock-item-category-selector/stock-item-category-selector.component.tsx +2 -5
- package/src/stock-items/add-stock-item/stock-item-details/stock-item-details.component.tsx +10 -10
- package/src/stock-items/add-stock-item/stock-item-references/stock-item-references.component.tsx +36 -27
- package/src/stock-items/add-stock-item/stock-item-references/stock-references-selector.component.tsx +2 -5
- package/src/stock-items/add-stock-item/stock-item-rules/add-stock-rules.component.tsx +16 -16
- package/src/stock-items/add-stock-item/stock-item-rules/stock-item-rules.component.tsx +10 -9
- package/src/stock-items/add-stock-item/stock-item-rules/stock-rules-filter.component.tsx +8 -3
- package/src/stock-items/add-stock-item/stock-item-units-edit/stock-item-units-edit.component.tsx +2 -2
- package/src/stock-items/add-stock-item/transactions/printout/printable-bincard-transaction-header.component.tsx +5 -5
- package/src/stock-items/add-stock-item/transactions/printout/printable-stockcard-transaction-header.component.tsx +3 -3
- package/src/stock-items/add-stock-item/transactions/printout/transactions-print-action.component.tsx +2 -5
- package/src/stock-items/add-stock-item/transactions/printout/transactions-print-bincard-preview.modal.tsx +1 -1
- package/src/stock-items/add-stock-item/transactions/transaction-filters/transaction-locations-filter.component.tsx +0 -3
- package/src/stock-items/components/filter-stock-items/filter-stock-items.component.tsx +6 -4
- package/src/stock-items/edit-stock-item/edit-stock-item-action-menu.component.tsx +1 -1
- package/src/stock-items/stock-items-table.component.tsx +21 -15
- package/src/stock-items/stock-items-table.resource.ts +1 -1
- package/src/stock-items/stock-items.resource.ts +1 -2
- package/src/stock-locations/add-locations-form.workspace.tsx +9 -11
- package/src/stock-locations/location-admin-form.component.tsx +9 -4
- package/src/stock-locations/stock-locations-table.component.tsx +3 -3
- package/src/stock-lookups/stock-lookups.resource.ts +2 -2
- package/src/stock-management-admin-card-link.component.tsx +1 -1
- package/src/stock-operations/add-stock-operation/stock-operations-expanded-row/stock-items-table.tsx +12 -8
- package/src/stock-operations/add-stock-operation/stock-operations-expanded-row/stock-operation-expanded-row.component.tsx +4 -4
- package/src/stock-operations/edit-stock-operation/edit-stock-operation-action-menu.component.tsx +6 -7
- package/src/stock-operations/stock-operation-operations-filter/stock-operation-operations-filter.component.tsx +7 -3
- package/src/stock-operations/stock-operation-sources-filter/stock-operation-sources-filter.component.tsx +8 -4
- package/src/stock-operations/stock-operation-statuses-filter/stock-operation-statuses-filter.component.tsx +16 -14
- package/src/stock-operations/stock-operation-types-selector/stock-operation-types-selector.component.tsx +4 -4
- package/src/stock-operations/stock-operations-filters.component.tsx +4 -2
- package/src/stock-operations/stock-operations-forms/input-components/batch-no-selector.component.tsx +2 -2
- package/src/stock-operations/stock-operations-forms/input-components/batch-no-selector.test.tsx +1 -1
- package/src/stock-operations/stock-operations-forms/input-components/qty-uim-selector.test.tsx +1 -1
- package/src/stock-operations/stock-operations-forms/input-components/quantity-uom-selector.component.tsx +3 -3
- package/src/stock-operations/stock-operations-forms/input-components/stock-item-search.component.tsx +3 -4
- package/src/stock-operations/stock-operations-forms/input-components/stock-operation-reason-selector.component.tsx +3 -3
- package/src/stock-operations/stock-operations-forms/input-components/users-selector.component.tsx +6 -6
- package/src/stock-operations/stock-operations-forms/step2.test.tsx +1 -5
- package/src/stock-operations/stock-operations-forms/steps/base-operation-details-form-step.tsx +15 -16
- package/src/stock-operations/stock-operations-forms/steps/quantity-uom-cell.component.tsx +1 -1
- package/src/stock-operations/stock-operations-forms/steps/received-items.component.tsx +2 -2
- package/src/stock-operations/stock-operations-forms/steps/stock-operation-items-form-step.component.tsx +24 -21
- package/src/stock-operations/stock-operations-forms/steps/stock-operation-submission-form-step.component.tsx +4 -4
- package/src/stock-operations/stock-operations-forms/stock-item-form/stock-item-form.workspace.tsx +60 -53
- package/src/stock-operations/stock-operations-forms/stock-operation-form.component.tsx +17 -12
- package/src/stock-operations/stock-operations-modal/stock-operations-completed-dispatch-button.component.tsx +1 -1
- package/src/stock-operations/stock-operations-modal/stock-operations-issue-stock-button.component.tsx +1 -1
- package/src/stock-operations/stock-operations-modal/stock-operations-print-button.component.tsx +6 -2
- package/src/stock-operations/stock-operations-modal/stock-operations-reject-button.component.tsx +4 -5
- package/src/stock-operations/stock-operations-modal/stock-operations.modal.tsx +4 -2
- package/src/stock-operations/stock-operations-table.component.tsx +16 -12
- package/src/stock-operations/stock-operations-table.resource.ts +1 -0
- package/src/stock-reports/generate-report/create-stock-report.workspace.tsx +31 -35
- package/src/stock-reports/report-list/stock-reports.component.tsx +5 -9
- package/src/stock-reports/stock-reports.resource.ts +1 -1
- package/src/stock-sources/add-stock-sources/add-stock-sources.workspace.tsx +6 -6
- package/src/stock-sources/stock-sources-items-table.component.tsx +14 -10
- package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.workspace.tsx +52 -53
- package/src/stock-user-role-scopes/delete-stock-user-scope/delete-stock-user-scope.component.tsx +1 -1
- package/src/stock-user-role-scopes/delete-stock-user-scope.modal.tsx +4 -1
- package/src/stock-user-role-scopes/stock-user-role-scopes-items-table.component.tsx +8 -12
- package/translations/en.json +105 -71
- package/src/core/components/carbon/controlled-dropdown.component.tsx +0 -37
|
@@ -165,7 +165,7 @@ const StockReports: React.FC = () => {
|
|
|
165
165
|
type="button"
|
|
166
166
|
size="sm"
|
|
167
167
|
className="submitButton clear-padding-margin"
|
|
168
|
-
iconDescription={'Edit'}
|
|
168
|
+
iconDescription={t('edit', 'Edit')}
|
|
169
169
|
kind="ghost"
|
|
170
170
|
renderIcon={View}
|
|
171
171
|
// onClick={(e) => onViewItem(batchJob.uuid, e)}
|
|
@@ -194,7 +194,7 @@ const StockReports: React.FC = () => {
|
|
|
194
194
|
</div>
|
|
195
195
|
),
|
|
196
196
|
}));
|
|
197
|
-
}, [reports, onDownloadReportClick]);
|
|
197
|
+
}, [reports, onDownloadReportClick, t]);
|
|
198
198
|
|
|
199
199
|
if (isLoading) {
|
|
200
200
|
return <DataTableSkeleton role="progressbar" />;
|
|
@@ -203,12 +203,8 @@ const StockReports: React.FC = () => {
|
|
|
203
203
|
return (
|
|
204
204
|
<div className={styles.container}>
|
|
205
205
|
<h2 className={styles.tableHeader}>{t('stockReportsTableHeader', 'List of reports requested by users.')}</h2>
|
|
206
|
-
<DataTable
|
|
207
|
-
rows
|
|
208
|
-
headers={tableHeaders}
|
|
209
|
-
isSortable={true}
|
|
210
|
-
useZebraStyles={true}
|
|
211
|
-
render={({ rows, headers, getHeaderProps, getTableProps, getRowProps, onInputChange }) => (
|
|
206
|
+
<DataTable rows={tableRows} headers={tableHeaders} isSortable useZebraStyles>
|
|
207
|
+
{({ rows, headers, getHeaderProps, getTableProps, getRowProps, onInputChange }) => (
|
|
212
208
|
<TableContainer>
|
|
213
209
|
<TableToolbar
|
|
214
210
|
style={{
|
|
@@ -288,7 +284,7 @@ const StockReports: React.FC = () => {
|
|
|
288
284
|
) : null}
|
|
289
285
|
</TableContainer>
|
|
290
286
|
)}
|
|
291
|
-
|
|
287
|
+
</DataTable>
|
|
292
288
|
<Pagination
|
|
293
289
|
page={currentPage}
|
|
294
290
|
pageSize={currentPageSize}
|
|
@@ -5,7 +5,7 @@ import { useState } from 'react';
|
|
|
5
5
|
|
|
6
6
|
export function useReportTypes() {
|
|
7
7
|
const apiUrl = `${restBaseUrl}/stockmanagement/report?v=default`;
|
|
8
|
-
const { data, error, isLoading } = useSWR<{ data: { results: ReportType } }, Error>(apiUrl, openmrsFetch);
|
|
8
|
+
const { data, error, isLoading } = useSWR<{ data: { results: ReportType[] } }, Error>(apiUrl, openmrsFetch);
|
|
9
9
|
return {
|
|
10
10
|
reportTypes: data?.data?.results ?? [],
|
|
11
11
|
isLoading,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Button, Form, Select, TextInput, SelectItem, ButtonSet, FormGroup, Stack } from '@carbon/react';
|
|
2
1
|
import React, { type ChangeEvent, useCallback, useState } from 'react';
|
|
3
2
|
import classNames from 'classnames';
|
|
3
|
+
import { Button, Form, Select, TextInput, SelectItem, ButtonSet, FormGroup, Stack } from '@carbon/react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { Save } from '@carbon/react/icons';
|
|
6
6
|
import {
|
|
7
7
|
getCoreTranslation,
|
|
8
8
|
restBaseUrl,
|
|
9
9
|
showSnackbar,
|
|
10
|
-
type DefaultWorkspaceProps,
|
|
11
10
|
useConfig,
|
|
12
11
|
useLayoutType,
|
|
12
|
+
type DefaultWorkspaceProps,
|
|
13
13
|
} from '@openmrs/esm-framework';
|
|
14
14
|
import { useConcept } from '../../stock-lookups/stock-lookups.resource';
|
|
15
15
|
import { type StockSource } from '../../core/api/types/stockOperation/StockSource';
|
|
@@ -62,8 +62,7 @@ const StockSourcesAddOrUpdate: React.FC<AddStockSourceProps> = ({ model, closeWo
|
|
|
62
62
|
isLowContrast: true,
|
|
63
63
|
title: t('addedSource', 'Add Source'),
|
|
64
64
|
kind: 'success',
|
|
65
|
-
subtitle: t('stockSourceAddedSuccessfully', 'Stock
|
|
66
|
-
timeoutInMs: 5000,
|
|
65
|
+
subtitle: t('stockSourceAddedSuccessfully', 'Stock source added successfully'),
|
|
67
66
|
});
|
|
68
67
|
|
|
69
68
|
handleMutate(`${restBaseUrl}/stockmanagement/stocksource`);
|
|
@@ -84,6 +83,7 @@ const StockSourcesAddOrUpdate: React.FC<AddStockSourceProps> = ({ model, closeWo
|
|
|
84
83
|
},
|
|
85
84
|
[formModel, model, t, closeWorkspace],
|
|
86
85
|
);
|
|
86
|
+
|
|
87
87
|
return (
|
|
88
88
|
<Form className={styles.container}>
|
|
89
89
|
<Stack className={styles.form} gap={5}>
|
|
@@ -112,7 +112,7 @@ const StockSourcesAddOrUpdate: React.FC<AddStockSourceProps> = ({ model, closeWo
|
|
|
112
112
|
<Select
|
|
113
113
|
name="sourceType"
|
|
114
114
|
className="select-field"
|
|
115
|
-
labelText={t('sourceType', 'Source
|
|
115
|
+
labelText={t('sourceType', 'Source type')}
|
|
116
116
|
id="sourceType"
|
|
117
117
|
value={formModel?.sourceType ? formModel.sourceType.uuid : ''}
|
|
118
118
|
onChange={onSourceTypeChange}
|
|
@@ -129,7 +129,7 @@ const StockSourcesAddOrUpdate: React.FC<AddStockSourceProps> = ({ model, closeWo
|
|
|
129
129
|
[styles.desktop]: !isTablet,
|
|
130
130
|
})}
|
|
131
131
|
>
|
|
132
|
-
<Button kind="secondary" onClick={closeWorkspace} className={styles.button}>
|
|
132
|
+
<Button kind="secondary" onClick={() => closeWorkspace()} className={styles.button}>
|
|
133
133
|
{getCoreTranslation('cancel')}
|
|
134
134
|
</Button>
|
|
135
135
|
<Button type="submit" className={styles.button} onClick={handleSave} kind="primary" renderIcon={Save}>
|
|
@@ -21,11 +21,12 @@ import { useTranslation } from 'react-i18next';
|
|
|
21
21
|
import { isDesktop, restBaseUrl } from '@openmrs/esm-framework';
|
|
22
22
|
import { handleMutate } from '../utils';
|
|
23
23
|
import { ResourceRepresentation } from '../core/api/api';
|
|
24
|
-
import
|
|
24
|
+
import { type CustomTableHeader } from '../core/components/table/types';
|
|
25
25
|
import AddStockSourceActionButton from './add-stock-source-button.component';
|
|
26
26
|
import EditStockSourceActionsMenu from './edit-stock-source/edit-stock-source.component';
|
|
27
27
|
import StockSourcesDeleteActionMenu from './stock-sources-delete/stock-sources-delete.component';
|
|
28
28
|
import StockSourcesFilter from './stock-sources-filter/stock-sources-filter.component';
|
|
29
|
+
import useStockSourcesPage from './stock-sources-items-table.resource';
|
|
29
30
|
import styles from './stock-sources.scss';
|
|
30
31
|
|
|
31
32
|
const StockSourcesItems: React.FC = () => {
|
|
@@ -83,12 +84,8 @@ const StockSourcesItems: React.FC = () => {
|
|
|
83
84
|
<h2 className={styles.tableHeader}>
|
|
84
85
|
{t('stockSourcesTableHeader', 'List of partners who provide stock to the facility.')}
|
|
85
86
|
</h2>
|
|
86
|
-
<DataTable
|
|
87
|
-
rows
|
|
88
|
-
headers={tableHeaders}
|
|
89
|
-
isSortable
|
|
90
|
-
useZebraStyles
|
|
91
|
-
render={({ rows, headers, getHeaderProps, getTableProps, getRowProps, onInputChange }) => (
|
|
87
|
+
<DataTable rows={filteredTableRows} headers={tableHeaders} isSortable useZebraStyles>
|
|
88
|
+
{({ rows, headers, getHeaderProps, getTableProps, getRowProps, onInputChange }) => (
|
|
92
89
|
<TableContainer>
|
|
93
90
|
<TableToolbar
|
|
94
91
|
style={{
|
|
@@ -125,12 +122,19 @@ const StockSourcesItems: React.FC = () => {
|
|
|
125
122
|
<TableHeader
|
|
126
123
|
{...getHeaderProps({
|
|
127
124
|
header,
|
|
128
|
-
isSortable: header.isSortable,
|
|
125
|
+
isSortable: (header as CustomTableHeader).isSortable,
|
|
129
126
|
})}
|
|
130
127
|
className={isDesktop ? styles.desktopHeader : styles.tabletHeader}
|
|
131
128
|
key={`${header.key}`}
|
|
132
129
|
>
|
|
133
|
-
{
|
|
130
|
+
{(() => {
|
|
131
|
+
const customHeader = header as CustomTableHeader;
|
|
132
|
+
return typeof customHeader.header === 'object' &&
|
|
133
|
+
customHeader.header !== null &&
|
|
134
|
+
'content' in customHeader.header
|
|
135
|
+
? (customHeader.header.content as React.ReactNode)
|
|
136
|
+
: (customHeader.header as React.ReactNode);
|
|
137
|
+
})()}
|
|
134
138
|
</TableHeader>
|
|
135
139
|
),
|
|
136
140
|
)}
|
|
@@ -164,7 +168,7 @@ const StockSourcesItems: React.FC = () => {
|
|
|
164
168
|
) : null}
|
|
165
169
|
</TableContainer>
|
|
166
170
|
)}
|
|
167
|
-
|
|
171
|
+
</DataTable>
|
|
168
172
|
<Pagination
|
|
169
173
|
page={currentPage}
|
|
170
174
|
pageSize={currentPageSize}
|
package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.workspace.tsx
CHANGED
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
DATE_PICKER_CONTROL_FORMAT,
|
|
43
43
|
DATE_PICKER_FORMAT,
|
|
44
44
|
formatForDatePicker,
|
|
45
|
-
|
|
45
|
+
INVENTORY_ADMINISTRATOR_ROLE_UUID,
|
|
46
46
|
INVENTORY_CLERK_ROLE_UUID,
|
|
47
47
|
INVENTORY_DISPENSING_ROLE_UUID,
|
|
48
48
|
INVENTORY_MANAGER_ROLE_UUID,
|
|
@@ -124,6 +124,7 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({ model, ed
|
|
|
124
124
|
setFilteredItems(filtered);
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
|
+
|
|
127
128
|
useEffect(() => {
|
|
128
129
|
if (model?.userUuid) {
|
|
129
130
|
setSelectedUserUuid(model.userUuid);
|
|
@@ -133,6 +134,7 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({ model, ed
|
|
|
133
134
|
const handleSearchQueryChange = (query: string) => {
|
|
134
135
|
filterItems(query);
|
|
135
136
|
};
|
|
137
|
+
|
|
136
138
|
const onStockOperationTypeChanged = (event: React.ChangeEvent<HTMLInputElement>): void => {
|
|
137
139
|
const operationType = formModel?.operationTypes?.find((x) => x.operationTypeUuid === event?.target?.value);
|
|
138
140
|
if (operationType) {
|
|
@@ -187,7 +189,7 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({ model, ed
|
|
|
187
189
|
INVENTORY_MANAGER_ROLE_UUID,
|
|
188
190
|
INVENTORY_DISPENSING_ROLE_UUID,
|
|
189
191
|
INVENTORY_REPORTING_ROLE_UUID,
|
|
190
|
-
|
|
192
|
+
INVENTORY_ADMINISTRATOR_ROLE_UUID,
|
|
191
193
|
];
|
|
192
194
|
|
|
193
195
|
const filteredStockRoles = data.selectedItem?.roles
|
|
@@ -226,7 +228,7 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({ model, ed
|
|
|
226
228
|
isLowContrast: true,
|
|
227
229
|
title: t('addUserRole', 'Add User role'),
|
|
228
230
|
kind: 'success',
|
|
229
|
-
subtitle: t('
|
|
231
|
+
subtitle: t('successfullySaved', 'You have successfully saved user role scope'),
|
|
230
232
|
});
|
|
231
233
|
closeWorkspace();
|
|
232
234
|
},
|
|
@@ -242,32 +244,36 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({ model, ed
|
|
|
242
244
|
},
|
|
243
245
|
);
|
|
244
246
|
};
|
|
247
|
+
|
|
245
248
|
if (isLoading || loadingRoles || loadingUsers) {
|
|
246
249
|
return (
|
|
247
250
|
<InlineLoading status="active" iconDescription="Loading" description={t('loadingData', 'Loading data...')} />
|
|
248
251
|
);
|
|
249
252
|
}
|
|
253
|
+
|
|
250
254
|
return (
|
|
251
255
|
<Form className={styles.container}>
|
|
252
256
|
<Stack className={styles.form} gap={5}>
|
|
253
257
|
<div>
|
|
254
258
|
{users?.results?.length > 0 && (
|
|
255
|
-
|
|
256
|
-
<
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
259
|
+
<FormGroup legendText={t('user', 'User')}>
|
|
260
|
+
<ComboBox
|
|
261
|
+
id="userName"
|
|
262
|
+
initialSelectedItem={usersResults.find((user) => user.uuid === model?.userUuid) ?? null}
|
|
263
|
+
items={filteredItems.length ? filteredItems : usersResults}
|
|
264
|
+
itemToString={(item) => {
|
|
265
|
+
if (!item || typeof item !== 'object') return '';
|
|
266
|
+
const itemWithPerson = item as { person?: { display?: string }; display?: string };
|
|
267
|
+
return `${itemWithPerson?.person?.display ?? itemWithPerson?.display ?? ''}`;
|
|
268
|
+
}}
|
|
269
|
+
titleText={t('user', 'User')}
|
|
270
|
+
onChange={onUserChanged}
|
|
271
|
+
onInputChange={handleSearchQueryChange}
|
|
272
|
+
placeholder={t('filterUsers', 'Filter users')}
|
|
273
|
+
shouldFilterItem={() => true}
|
|
274
|
+
size="md"
|
|
275
|
+
/>
|
|
276
|
+
</FormGroup>
|
|
271
277
|
)}
|
|
272
278
|
</div>
|
|
273
279
|
<Select
|
|
@@ -286,13 +292,13 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({ model, ed
|
|
|
286
292
|
})
|
|
287
293
|
)}
|
|
288
294
|
</Select>
|
|
289
|
-
<CheckboxGroup className={styles.checkboxGrid}>
|
|
295
|
+
<CheckboxGroup className={styles.checkboxGrid} legendText="">
|
|
290
296
|
<Checkbox
|
|
291
297
|
checked={formModel?.enabled}
|
|
292
298
|
id="chk-userEnabled"
|
|
293
299
|
labelText={t('enabled', 'Enabled')}
|
|
294
300
|
onChange={onEnabledChanged}
|
|
295
|
-
value={model?.enabled}
|
|
301
|
+
value={model?.enabled ? 'true' : 'false'}
|
|
296
302
|
/>
|
|
297
303
|
<Checkbox
|
|
298
304
|
checked={formModel?.permanent}
|
|
@@ -300,35 +306,29 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({ model, ed
|
|
|
300
306
|
labelText={t('permanent', 'Permanent')}
|
|
301
307
|
name="isPermanent"
|
|
302
308
|
onChange={onPermanentChanged}
|
|
303
|
-
value={model?.permanent}
|
|
309
|
+
value={model?.permanent ? 'true' : 'false'}
|
|
304
310
|
/>
|
|
305
311
|
|
|
306
312
|
{!formModel?.permanent && (
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
name="activeTo"
|
|
327
|
-
placeholder={DATE_PICKER_FORMAT}
|
|
328
|
-
value={formatForDatePicker(formModel?.activeTo)}
|
|
329
|
-
/>
|
|
330
|
-
</DatePicker>
|
|
331
|
-
</>
|
|
313
|
+
<DatePicker
|
|
314
|
+
dateFormat={DATE_PICKER_CONTROL_FORMAT}
|
|
315
|
+
datePickerType="range"
|
|
316
|
+
light
|
|
317
|
+
locale="en"
|
|
318
|
+
minDate={formatForDatePicker(MinDate)}
|
|
319
|
+
onChange={onActiveDatesChange}
|
|
320
|
+
>
|
|
321
|
+
<DatePickerInput
|
|
322
|
+
id="date-picker-input-id-start"
|
|
323
|
+
labelText={t('activeFrom', 'Active From')}
|
|
324
|
+
placeholder={DATE_PICKER_FORMAT}
|
|
325
|
+
/>
|
|
326
|
+
<DatePickerInput
|
|
327
|
+
id="date-picker-input-id-finish"
|
|
328
|
+
labelText={t('activeTo', 'Active To')}
|
|
329
|
+
placeholder={DATE_PICKER_FORMAT}
|
|
330
|
+
/>
|
|
331
|
+
</DatePicker>
|
|
332
332
|
)}
|
|
333
333
|
</CheckboxGroup>
|
|
334
334
|
<FormGroup legendText={t('stockOperations', 'Stock operations')}>
|
|
@@ -336,7 +336,7 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({ model, ed
|
|
|
336
336
|
{t('roleDescription', 'The role will be applicable to only selected stock operations.')}
|
|
337
337
|
</span>
|
|
338
338
|
</FormGroup>
|
|
339
|
-
<CheckboxGroup className={styles.checkboxGrid}>
|
|
339
|
+
<CheckboxGroup className={styles.checkboxGrid} legendText="">
|
|
340
340
|
{stockOperations?.length > 0 &&
|
|
341
341
|
stockOperations.map((type) => {
|
|
342
342
|
return (
|
|
@@ -358,7 +358,7 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({ model, ed
|
|
|
358
358
|
{t('toggleMessage', 'Use the toggle to apply this scope to the locations under the selected location.')}
|
|
359
359
|
</span>
|
|
360
360
|
</FormGroup>
|
|
361
|
-
<CheckboxGroup className={styles.checkboxGrid}>
|
|
361
|
+
<CheckboxGroup className={styles.checkboxGrid} legendText="">
|
|
362
362
|
{stockLocations?.length > 0 &&
|
|
363
363
|
stockLocations.map((type) => {
|
|
364
364
|
const checkedLocation = findCheckedLocation(type);
|
|
@@ -386,9 +386,8 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({ model, ed
|
|
|
386
386
|
hideLabel
|
|
387
387
|
id={`tg-loc-child-${type.id}`}
|
|
388
388
|
key={`tg-loc-child-key-${type.id}`}
|
|
389
|
-
|
|
389
|
+
toggled={getToggledValue(type.id)}
|
|
390
390
|
size="sm"
|
|
391
|
-
value={type.id}
|
|
392
391
|
/>
|
|
393
392
|
)}
|
|
394
393
|
</div>
|
|
@@ -402,10 +401,10 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({ model, ed
|
|
|
402
401
|
[styles.desktop]: !isTablet,
|
|
403
402
|
})}
|
|
404
403
|
>
|
|
405
|
-
<Button kind="secondary" onClick={closeWorkspace} className={styles.button}>
|
|
404
|
+
<Button kind="secondary" onClick={() => closeWorkspace()} className={styles.button}>
|
|
406
405
|
{getCoreTranslation('cancel')}
|
|
407
406
|
</Button>
|
|
408
|
-
<Button type="submit" className={styles.button}
|
|
407
|
+
<Button type="submit" className={styles.button} renderIcon={Save}>
|
|
409
408
|
{getCoreTranslation('save')}
|
|
410
409
|
</Button>
|
|
411
410
|
</ButtonSet>
|
package/src/stock-user-role-scopes/delete-stock-user-scope/delete-stock-user-scope.component.tsx
CHANGED
|
@@ -29,7 +29,7 @@ const StockUserScopeDeleteActionMenu: React.FC<StockUserScopDeleteActionMenuProp
|
|
|
29
29
|
setDeletingUserScope(false);
|
|
30
30
|
showSnackbar({
|
|
31
31
|
isLowContrast: true,
|
|
32
|
-
title: t('
|
|
32
|
+
title: t('deletingStockUserScope', 'Delete Stock User Scope'),
|
|
33
33
|
kind: 'success',
|
|
34
34
|
subtitle: t('stockUserScopeDeletedSuccessfully', 'Stock User Scope Deleted Successfully'),
|
|
35
35
|
});
|
|
@@ -22,7 +22,10 @@ const DeleteStockUserScopeModal: React.FC<DeleteStockUserScopeModalProps> = ({ c
|
|
|
22
22
|
</ModalHeader>
|
|
23
23
|
<ModalBody>
|
|
24
24
|
<p className={styles.bodyLong01}>
|
|
25
|
-
{t(
|
|
25
|
+
{t(
|
|
26
|
+
'deleteUserScopeConfirmation',
|
|
27
|
+
"Are you sure you want to delete this User Scope? This action can't be undone.",
|
|
28
|
+
)}
|
|
26
29
|
</p>
|
|
27
30
|
</ModalBody>
|
|
28
31
|
<ModalFooter>
|
|
@@ -61,12 +61,12 @@ function StockUserRoleScopesItems() {
|
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
id: 2,
|
|
64
|
-
header: t('
|
|
64
|
+
header: t('locations', 'Locations'),
|
|
65
65
|
key: 'locations',
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
id: 3,
|
|
69
|
-
header: t('stockOperations', 'Stock
|
|
69
|
+
header: t('stockOperations', 'Stock operations'),
|
|
70
70
|
key: 'stockOperations',
|
|
71
71
|
},
|
|
72
72
|
{
|
|
@@ -76,7 +76,7 @@ function StockUserRoleScopesItems() {
|
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
id: 5,
|
|
79
|
-
header: t('
|
|
79
|
+
header: t('activeFrom', 'Active From'),
|
|
80
80
|
key: 'activeFrom',
|
|
81
81
|
},
|
|
82
82
|
{
|
|
@@ -86,7 +86,7 @@ function StockUserRoleScopesItems() {
|
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
id: 7,
|
|
89
|
-
header: t('enabled', 'Enabled
|
|
89
|
+
header: t('enabled', 'Enabled'),
|
|
90
90
|
key: 'enabled',
|
|
91
91
|
},
|
|
92
92
|
{
|
|
@@ -111,7 +111,7 @@ function StockUserRoleScopesItems() {
|
|
|
111
111
|
`${userRoleScope?.userFamilyName} ${userRoleScope.userGivenName}`
|
|
112
112
|
) : (
|
|
113
113
|
<Link
|
|
114
|
-
|
|
114
|
+
href={URL_USER_ROLE_SCOPE(userRoleScope?.uuid)}
|
|
115
115
|
>{`${userRoleScope?.userFamilyName} ${userRoleScope.userGivenName}`}</Link>
|
|
116
116
|
),
|
|
117
117
|
|
|
@@ -164,12 +164,8 @@ function StockUserRoleScopesItems() {
|
|
|
164
164
|
'To access stock management features, users must have assigned roles specifying location and stock operation type scopes.',
|
|
165
165
|
)}
|
|
166
166
|
</h2>
|
|
167
|
-
<DataTable
|
|
168
|
-
headers
|
|
169
|
-
isSortable
|
|
170
|
-
rows={tableRows ?? []}
|
|
171
|
-
useZebraStyles
|
|
172
|
-
render={({ rows, headers, getHeaderProps, getTableProps, getRowProps, onInputChange }) => (
|
|
167
|
+
<DataTable headers={tableHeaders} isSortable rows={tableRows ?? []} useZebraStyles>
|
|
168
|
+
{({ rows, headers, getHeaderProps, getTableProps, getRowProps, onInputChange }) => (
|
|
173
169
|
<TableContainer>
|
|
174
170
|
<TableToolbar
|
|
175
171
|
style={{
|
|
@@ -238,7 +234,7 @@ function StockUserRoleScopesItems() {
|
|
|
238
234
|
) : null}
|
|
239
235
|
</TableContainer>
|
|
240
236
|
)}
|
|
241
|
-
|
|
237
|
+
</DataTable>
|
|
242
238
|
<Pagination
|
|
243
239
|
page={currentPage}
|
|
244
240
|
pageSize={currentPageSize}
|