@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,12 +1,13 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import dayjs from 'dayjs';
|
3
|
+
import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
|
2
4
|
import { useTranslation } from 'react-i18next';
|
3
|
-
import { Tile } from '@carbon/react';
|
4
5
|
import { ArrowRight } from '@carbon/react/icons';
|
5
|
-
import
|
6
|
+
import { isEmpty } from 'lodash-es';
|
7
|
+
import { Tile } from '@carbon/react';
|
6
8
|
import { ConfigurableLink } from '@openmrs/esm-framework';
|
7
|
-
import
|
8
|
-
|
9
|
-
import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
|
9
|
+
import styles from './metrics-card.scss';
|
10
|
+
|
10
11
|
dayjs.extend(isSameOrBefore);
|
11
12
|
|
12
13
|
interface MetricsCardProps {
|
@@ -16,8 +17,8 @@ interface MetricsCardProps {
|
|
16
17
|
children?: React.ReactNode;
|
17
18
|
view: string;
|
18
19
|
count?: { expiry6months: Array<any> };
|
19
|
-
|
20
|
-
disposedCount?: { expired: Array<any>;
|
20
|
+
outOfStockCount?: { itemsBelowMin: Array<any>; itemsAboveMax: Array<any> };
|
21
|
+
disposedCount?: { expired: Array<any>; poorQuality: Array<any> };
|
21
22
|
}
|
22
23
|
const MetricsCard: React.FC<MetricsCardProps> = ({
|
23
24
|
label,
|
@@ -26,7 +27,7 @@ const MetricsCard: React.FC<MetricsCardProps> = ({
|
|
26
27
|
children,
|
27
28
|
view,
|
28
29
|
count,
|
29
|
-
|
30
|
+
outOfStockCount,
|
30
31
|
disposedCount,
|
31
32
|
}) => {
|
32
33
|
const { t } = useTranslation();
|
@@ -40,8 +41,8 @@ const MetricsCard: React.FC<MetricsCardProps> = ({
|
|
40
41
|
</div>
|
41
42
|
{view && (
|
42
43
|
<ConfigurableLink className={styles.link} to={`\${openmrsSpaBase}/stock-management/orders`}>
|
43
|
-
<span
|
44
|
-
<ArrowRight size={16}
|
44
|
+
<span>{t('view', 'View')}</span>
|
45
|
+
<ArrowRight size={16} />
|
45
46
|
</ConfigurableLink>
|
46
47
|
)}
|
47
48
|
</div>
|
@@ -52,24 +53,26 @@ const MetricsCard: React.FC<MetricsCardProps> = ({
|
|
52
53
|
</div>
|
53
54
|
{!isEmpty(count) && (
|
54
55
|
<div className={styles.countGrid}>
|
55
|
-
<span
|
56
|
-
<
|
56
|
+
<span />
|
57
|
+
<span className={styles.in6MonthsLabel}>{t('in6Months', 'In 6 months')}</span>
|
58
|
+
<p />
|
59
|
+
<p className={styles.in6MonthsValue}>{count.expiry6months?.length}</p>
|
57
60
|
</div>
|
58
61
|
)}
|
59
|
-
{!isEmpty(
|
62
|
+
{!isEmpty(outOfStockCount) && (
|
60
63
|
<div className={styles.countGrid}>
|
61
|
-
<span
|
62
|
-
<span
|
63
|
-
<p
|
64
|
-
<p
|
64
|
+
<span className={styles.belowMinLabel}>{t('itemsBelowMin', 'Items Below Min')}</span>
|
65
|
+
<span className={styles.aboveMaxLabel}>{t('itemsAboveMax', 'Items Above Max')}</span>
|
66
|
+
<p className={styles.belowMinValue}>{outOfStockCount.itemsBelowMin?.length}</p>
|
67
|
+
<p className={styles.aboveMaxValue}>{outOfStockCount.itemsAboveMax?.length}</p>
|
65
68
|
</div>
|
66
69
|
)}
|
67
70
|
{!isEmpty(disposedCount) && (
|
68
71
|
<div className={styles.countGrid}>
|
69
|
-
<span
|
70
|
-
<span
|
71
|
-
<p
|
72
|
-
<p
|
72
|
+
<span className={styles.expiredLabel}>{t('expired', 'Expired')}</span>
|
73
|
+
<span className={styles.poorQualityLabel}>{t('poorQuality', 'Poor Quality')}</span>
|
74
|
+
<p className={styles.expiredValue}>{disposedCount.expired?.length}</p>
|
75
|
+
<p className={styles.poorQualityValue}>{disposedCount.poorQuality?.length}</p>
|
73
76
|
</div>
|
74
77
|
)}
|
75
78
|
</div>
|
@@ -1,36 +1,41 @@
|
|
1
|
+
@use '@carbon/colors';
|
1
2
|
@use '@carbon/layout';
|
2
3
|
@use '@carbon/type';
|
3
|
-
@use '@
|
4
|
-
|
4
|
+
@use '@openmrs/esm-styleguide/src/vars' as *;
|
5
|
+
|
5
6
|
.tileContainer {
|
6
|
-
border: 0.0625rem solid $ui-03;
|
7
|
-
flex-grow: 1;
|
8
|
-
height: 7.875rem;
|
9
|
-
padding: 0 layout.$spacing-04;
|
10
7
|
background-color: colors.$white;
|
8
|
+
border: 1px solid $ui-03;
|
11
9
|
display: flex;
|
12
10
|
flex-direction: column;
|
11
|
+
flex-grow: 1;
|
12
|
+
height: 7.875rem;
|
13
13
|
justify-content: space-between;
|
14
|
-
|
14
|
+
padding: layout.$spacing-05;
|
15
15
|
}
|
16
|
+
|
16
17
|
.tileHeader {
|
17
18
|
display: flex;
|
18
19
|
justify-content: space-between;
|
19
20
|
align-items: center;
|
20
21
|
margin-bottom: layout.$spacing-03;
|
21
22
|
}
|
23
|
+
|
22
24
|
.headerLabel {
|
23
25
|
@include type.type-style('label-02');
|
24
26
|
color: colors.$gray-70;
|
25
27
|
}
|
28
|
+
|
26
29
|
.totalsLabel {
|
27
30
|
@include type.type-style('label-01');
|
28
31
|
color: $text-02;
|
29
32
|
}
|
33
|
+
|
30
34
|
.totalsValue {
|
31
35
|
@include type.type-style('heading-04');
|
32
36
|
color: $ui-05;
|
33
37
|
}
|
38
|
+
|
34
39
|
.headerLabelContainer {
|
35
40
|
display: flex;
|
36
41
|
align-items: center;
|
@@ -38,26 +43,59 @@
|
|
38
43
|
justify-content: space-between;
|
39
44
|
width: 100%;
|
40
45
|
}
|
46
|
+
|
41
47
|
.link {
|
42
48
|
text-decoration: none;
|
43
49
|
display: flex;
|
44
50
|
align-items: flex-end;
|
51
|
+
color: $interactive-01;
|
52
|
+
|
53
|
+
svg {
|
54
|
+
margin-left: layout.$spacing-03;
|
55
|
+
}
|
45
56
|
}
|
57
|
+
|
46
58
|
.metricsGrid {
|
47
59
|
display: grid;
|
48
60
|
grid-template-columns: 1fr 1fr;
|
61
|
+
align-items: center;
|
49
62
|
}
|
63
|
+
|
50
64
|
.countGrid {
|
51
65
|
display: grid;
|
52
66
|
grid-template-columns: 1fr 1fr;
|
53
67
|
justify-self: flex-end;
|
54
68
|
column-gap: layout.$spacing-03;
|
69
|
+
align-items: center;
|
70
|
+
|
55
71
|
& > span {
|
56
72
|
font-size: 0.625rem !important;
|
57
73
|
margin: 0;
|
58
|
-
color: colors.$gray-70;
|
59
74
|
}
|
75
|
+
|
60
76
|
& > p {
|
61
77
|
margin: 0;
|
62
78
|
}
|
63
79
|
}
|
80
|
+
|
81
|
+
.in6MonthsLabel,
|
82
|
+
.belowMinLabel,
|
83
|
+
.expiredLabel {
|
84
|
+
color: colors.$red-60;
|
85
|
+
}
|
86
|
+
|
87
|
+
.in6MonthsValue,
|
88
|
+
.belowMinValue,
|
89
|
+
.expiredValue {
|
90
|
+
color: colors.$red-60;
|
91
|
+
}
|
92
|
+
|
93
|
+
.aboveMaxLabel,
|
94
|
+
.aboveMaxValue {
|
95
|
+
color: #319227;
|
96
|
+
}
|
97
|
+
|
98
|
+
.poorQualityLabel,
|
99
|
+
.poorQualityValue {
|
100
|
+
color: #faba5f;
|
101
|
+
}
|
package/src/index.ts
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
import { defineConfigSchema, getAsyncLifecycle, getSyncLifecycle } from '@openmrs/esm-framework';
|
2
2
|
import { configSchema } from './config-schema';
|
3
3
|
import { createDashboardLink } from './createDashboardLink';
|
4
|
+
import appMenu from './stock-app-menu-item/item.component';
|
5
|
+
import deletePackagingUnitModalButtonComponent from './stock-items/add-stock-item/packaging-units/packaging-units-delete-modal-button.component';
|
4
6
|
import Root from './root.component';
|
5
7
|
import SideMenu from './side-menu/side-menu.component';
|
6
|
-
import appMenu from './stock-app-menu-item/item.component';
|
7
8
|
import StockHomeLandingPage from './stock-home/stock-home-landing-page-component';
|
8
|
-
import deletePackagingUnitModalButtonComponent from './stock-items/add-stock-item/packaging-units/packaging-units-delete-modal-button.component';
|
9
|
-
import TransactionsBincardPrintPreview from './stock-items/add-stock-item/transactions/printout/transactions-print-bincard-preview.modal';
|
10
|
-
import TransactionsStockcardPrintPreview from './stock-items/add-stock-item/transactions/printout/transactions-print-stockcard-preview.modal';
|
11
9
|
import StockItems from './stock-items/stock-items.component';
|
12
10
|
import StockLocations from './stock-locations/stock-locations.component';
|
13
11
|
import stockManagementAdminCardLinkComponent from './stock-management-admin-card-link.component';
|
@@ -17,6 +15,8 @@ import StockReports from './stock-reports/report-list/stock-reports.component';
|
|
17
15
|
import StockSettings from './stock-settings/stock-settings.component';
|
18
16
|
import StockSources from './stock-sources/stock-sources.component';
|
19
17
|
import StockUserScopes from './stock-user-role-scopes/stock-user-role-scopes.component';
|
18
|
+
import TransactionsBincardPrintPreview from './stock-items/add-stock-item/transactions/printout/transactions-print-bincard-preview.modal';
|
19
|
+
import TransactionsStockcardPrintPreview from './stock-items/add-stock-item/transactions/printout/transactions-print-stockcard-preview.modal';
|
20
20
|
|
21
21
|
const moduleName = '@openmrs/esm-stock-management-app';
|
22
22
|
|
@@ -27,7 +27,59 @@ const options = {
|
|
27
27
|
|
28
28
|
export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
|
29
29
|
|
30
|
+
export const deleteStockModal = getAsyncLifecycle(() => import('./stock-sources/delete-stock-modal.component'), {
|
31
|
+
featureName: 'delete-stock-modal',
|
32
|
+
moduleName,
|
33
|
+
});
|
34
|
+
|
35
|
+
export const deleteUserScopeModal = getAsyncLifecycle(
|
36
|
+
() => import('./stock-user-role-scopes/delete-stock-user-scope-modal.component'),
|
37
|
+
{
|
38
|
+
featureName: 'delete-stock-user-scope-modal',
|
39
|
+
moduleName,
|
40
|
+
},
|
41
|
+
);
|
42
|
+
|
43
|
+
export const deletePackagingUnitModal = getAsyncLifecycle(
|
44
|
+
() => import('./stock-items/add-stock-item/packaging-units/packaging-units-delete-modal.component'),
|
45
|
+
{
|
46
|
+
featureName: 'delete-packaging-unit-modal',
|
47
|
+
moduleName,
|
48
|
+
},
|
49
|
+
);
|
50
|
+
|
51
|
+
export const deletePackagingUnitButton = getSyncLifecycle(deletePackagingUnitModalButtonComponent, {
|
52
|
+
featureName: 'delete-packaging-unit-button',
|
53
|
+
moduleName,
|
54
|
+
});
|
55
|
+
|
56
|
+
export const expiredStockModal = getAsyncLifecycle(() => import('./stock-home/expired-stock.modal'), {
|
57
|
+
featureName: 'expired-stock-modal',
|
58
|
+
moduleName,
|
59
|
+
});
|
60
|
+
|
61
|
+
export const importBulkStockItemsModal = getAsyncLifecycle(
|
62
|
+
() => import('./stock-items/add-bulk-stock-item/stock-items-bulk-import.component'),
|
63
|
+
{
|
64
|
+
featureName: 'import-bulk-stock-items-modal',
|
65
|
+
moduleName,
|
66
|
+
},
|
67
|
+
);
|
68
|
+
|
69
|
+
export const issuingStockModal = getAsyncLifecycle(() => import('./stock-home/issuing-stock.modal'), {
|
70
|
+
featureName: 'issuing-stock-modal',
|
71
|
+
moduleName,
|
72
|
+
});
|
73
|
+
|
74
|
+
export const root = getSyncLifecycle(Root, options);
|
75
|
+
|
76
|
+
export const receivingStockModal = getAsyncLifecycle(() => import('./stock-home/receiving-stock.modal'), {
|
77
|
+
featureName: 'receiving-stock-modal',
|
78
|
+
moduleName,
|
79
|
+
});
|
80
|
+
|
30
81
|
export const stockManagementAdminCardLink = getSyncLifecycle(stockManagementAdminCardLinkComponent, options);
|
82
|
+
|
31
83
|
export const stockNavMenu = getSyncLifecycle(SideMenu, options);
|
32
84
|
|
33
85
|
// t("overview","Overview")
|
@@ -46,6 +98,7 @@ export const stockOperationsLink = getSyncLifecycle(
|
|
46
98
|
|
47
99
|
// t("items","Items")
|
48
100
|
export const stockItems = getSyncLifecycle(StockItems, options);
|
101
|
+
|
49
102
|
export const stockItemsLink = getSyncLifecycle(createDashboardLink({ title: 'Items', name: 'items' }), options);
|
50
103
|
|
51
104
|
// t("useScopes","User role scopes")
|
@@ -79,37 +132,6 @@ export const stockSettingsLink = getSyncLifecycle(
|
|
79
132
|
|
80
133
|
export const stockManagement = getSyncLifecycle(stockManagementComponent, options);
|
81
134
|
|
82
|
-
export const root = getSyncLifecycle(Root, options);
|
83
|
-
|
84
|
-
export const deleteStockModal = getAsyncLifecycle(() => import('./stock-sources/delete-stock-modal.component'), {
|
85
|
-
featureName: 'delete-stock-modal',
|
86
|
-
moduleName,
|
87
|
-
});
|
88
|
-
|
89
|
-
export const deleteUserScopeModal = getAsyncLifecycle(
|
90
|
-
() => import('./stock-user-role-scopes/delete-stock-user-scope-modal.component'),
|
91
|
-
{
|
92
|
-
featureName: 'delete-stock-user-scope-modal',
|
93
|
-
moduleName,
|
94
|
-
},
|
95
|
-
);
|
96
|
-
|
97
|
-
export const deletePackagingUnitModal = getAsyncLifecycle(
|
98
|
-
() => import('./stock-items/add-stock-item/packaging-units/packaging-units-delete-modal.component'),
|
99
|
-
{
|
100
|
-
featureName: 'delete-packaging-unit-modal',
|
101
|
-
moduleName,
|
102
|
-
},
|
103
|
-
);
|
104
|
-
|
105
|
-
export const importBulkStockItemsModal = getAsyncLifecycle(
|
106
|
-
() => import('./stock-items/add-bulk-stock-item/stock-items-bulk-import.component'),
|
107
|
-
{
|
108
|
-
featureName: 'import-bulk-stock-items-modal',
|
109
|
-
moduleName,
|
110
|
-
},
|
111
|
-
);
|
112
|
-
|
113
135
|
export const stockOperationModal = getAsyncLifecycle(
|
114
136
|
() => import('./stock-operations/stock-operations-dialog/stock-operations-dialog.component'),
|
115
137
|
{
|
@@ -118,15 +140,8 @@ export const stockOperationModal = getAsyncLifecycle(
|
|
118
140
|
},
|
119
141
|
);
|
120
142
|
|
121
|
-
export const deletePackagingUnitButton = getSyncLifecycle(deletePackagingUnitModalButtonComponent, {
|
122
|
-
featureName: 'delete-packaging-unit-button',
|
123
|
-
moduleName,
|
124
|
-
});
|
125
|
-
|
126
143
|
export const stockManagementAppMenuItem = getSyncLifecycle(appMenu, options);
|
127
144
|
|
128
|
-
export const transactionBincardPrintPreviewModal = getSyncLifecycle(TransactionsBincardPrintPreview, options);
|
129
|
-
export const transactionStockcardPrintPreviewModal = getSyncLifecycle(TransactionsStockcardPrintPreview, options);
|
130
145
|
export const stockOperationFormWorkspace = getAsyncLifecycle(
|
131
146
|
() => import('./stock-operations/stock-operations-forms/stock-operation-form.component'),
|
132
147
|
options,
|
@@ -160,6 +175,10 @@ export const stockUserScopesFormWorkspace = getAsyncLifecycle(
|
|
160
175
|
options,
|
161
176
|
);
|
162
177
|
|
178
|
+
export const transactionBincardPrintPreviewModal = getSyncLifecycle(TransactionsBincardPrintPreview, options);
|
179
|
+
|
180
|
+
export const transactionStockcardPrintPreviewModal = getSyncLifecycle(TransactionsStockcardPrintPreview, options);
|
181
|
+
|
163
182
|
export function startupApp() {
|
164
183
|
defineConfigSchema(moduleName, configSchema);
|
165
184
|
}
|
package/src/routes.json
CHANGED
@@ -173,10 +173,18 @@
|
|
173
173
|
"name": "delete-packaging-unit-modal",
|
174
174
|
"component": "deletePackagingUnitModal"
|
175
175
|
},
|
176
|
+
{
|
177
|
+
"name": "expired-stock-modal",
|
178
|
+
"component": "expiredStockModal"
|
179
|
+
},
|
176
180
|
{
|
177
181
|
"name": "import-bulk-stock-items",
|
178
182
|
"component": "importBulkStockItemsModal"
|
179
183
|
},
|
184
|
+
{
|
185
|
+
"name": "receiving-stock-modal",
|
186
|
+
"component": "receivingStockModal"
|
187
|
+
},
|
180
188
|
{
|
181
189
|
"name": "stock-operation-dialog",
|
182
190
|
"component": "stockOperationModal"
|
@@ -214,7 +222,7 @@
|
|
214
222
|
"width": "extra-wide"
|
215
223
|
},
|
216
224
|
{
|
217
|
-
"name"
|
225
|
+
"name": "stock-sources-form-workspace",
|
218
226
|
"component": "stockSourcesFormWorkspace",
|
219
227
|
"title": "Stock Sources",
|
220
228
|
"type": "form",
|
@@ -222,7 +230,7 @@
|
|
222
230
|
"width": "extra-wide"
|
223
231
|
},
|
224
232
|
{
|
225
|
-
"name"
|
233
|
+
"name": "stock-location-form-workspace",
|
226
234
|
"component": "stockLocationsFormWorkspace",
|
227
235
|
"title": "Stock Locations",
|
228
236
|
"type": "form",
|
@@ -230,7 +238,7 @@
|
|
230
238
|
"width": "extra-wide"
|
231
239
|
},
|
232
240
|
{
|
233
|
-
"name"
|
241
|
+
"name": "stock-user-role-scopes-form-workspace",
|
234
242
|
"component": "stockUserScopesFormWorkspace",
|
235
243
|
"title": "User Role Scopes",
|
236
244
|
"type": "form",
|
@@ -238,7 +246,7 @@
|
|
238
246
|
"width": "extra-wide"
|
239
247
|
},
|
240
248
|
{
|
241
|
-
"name"
|
249
|
+
"name": "stock-reports-form-workspace",
|
242
250
|
"component": "stockReportsFormWorkspace",
|
243
251
|
"title": "Reports",
|
244
252
|
"type": "form",
|
package/src/stock-home/{stock-home-inventory-expiry.component.tsx → expired-stock.modal.tsx}
RENAMED
@@ -1,7 +1,25 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
ModalBody,
|
4
|
+
ModalHeader,
|
5
|
+
Table,
|
6
|
+
TableBody,
|
7
|
+
TableCell,
|
8
|
+
TableContainer,
|
9
|
+
TableHead,
|
10
|
+
TableHeader,
|
11
|
+
TableRow,
|
12
|
+
} from '@carbon/react';
|
13
|
+
import { useTranslation } from 'react-i18next';
|
14
|
+
|
15
|
+
interface ExpiredStockModalProps {
|
16
|
+
closeModal: () => void;
|
17
|
+
expiredStock: any[];
|
18
|
+
}
|
19
|
+
|
20
|
+
const ExpiredStockModal = ({ closeModal, expiredStock }: ExpiredStockModalProps) => {
|
21
|
+
const { t } = useTranslation();
|
3
22
|
|
4
|
-
const ExpiredStockModal = ({ open, onClose, expiredStock }) => {
|
5
23
|
const headers = [
|
6
24
|
{ key: 'drugName', header: 'Drug Name' },
|
7
25
|
{ key: 'batchNo', header: 'Batch No' },
|
@@ -21,15 +39,9 @@ const ExpiredStockModal = ({ open, onClose, expiredStock }) => {
|
|
21
39
|
};
|
22
40
|
|
23
41
|
return (
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
modalHeading="Expired Stock"
|
28
|
-
primaryButtonText="Close"
|
29
|
-
onSecondarySubmit={onClose}
|
30
|
-
size="lg"
|
31
|
-
>
|
32
|
-
<div>
|
42
|
+
<>
|
43
|
+
<ModalHeader closeModal={closeModal} title={t('expiredStock', 'Expired stock')} />
|
44
|
+
<ModalBody>
|
33
45
|
{expiredStock.length > 0 ? (
|
34
46
|
<TableContainer>
|
35
47
|
<Table>
|
@@ -54,10 +66,10 @@ const ExpiredStockModal = ({ open, onClose, expiredStock }) => {
|
|
54
66
|
</Table>
|
55
67
|
</TableContainer>
|
56
68
|
) : (
|
57
|
-
<p>No expired stock data available
|
69
|
+
<p>{t('noExpiredStockDataAvailable', 'No expired stock data available.')}</p>
|
58
70
|
)}
|
59
|
-
</
|
60
|
-
|
71
|
+
</ModalBody>
|
72
|
+
</>
|
61
73
|
);
|
62
74
|
};
|
63
75
|
|
@@ -1,7 +1,25 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
ModalBody,
|
4
|
+
ModalHeader,
|
5
|
+
Table,
|
6
|
+
TableBody,
|
7
|
+
TableCell,
|
8
|
+
TableContainer,
|
9
|
+
TableHead,
|
10
|
+
TableHeader,
|
11
|
+
TableRow,
|
12
|
+
} from '@carbon/react';
|
13
|
+
import { useTranslation } from 'react-i18next';
|
14
|
+
|
15
|
+
interface IssuingStockModalProps {
|
16
|
+
issuingStock: any[];
|
17
|
+
closeModal: () => void;
|
18
|
+
}
|
19
|
+
|
20
|
+
const IssuingStockModal = ({ issuingStock, closeModal }: IssuingStockModalProps) => {
|
21
|
+
const { t } = useTranslation();
|
3
22
|
|
4
|
-
const IssuingStockModal = ({ open, onClose, issuingStock }) => {
|
5
23
|
const headers = [
|
6
24
|
{ key: 'status', header: 'Status' },
|
7
25
|
{ key: 'sourceName', header: 'Source' },
|
@@ -12,15 +30,9 @@ const IssuingStockModal = ({ open, onClose, issuingStock }) => {
|
|
12
30
|
];
|
13
31
|
|
14
32
|
return (
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
modalHeading="Issued Stock"
|
19
|
-
primaryButtonText="Close"
|
20
|
-
onSecondarySubmit={onClose}
|
21
|
-
size="lg"
|
22
|
-
>
|
23
|
-
<div>
|
33
|
+
<>
|
34
|
+
<ModalHeader closeModal={closeModal} title={t('issuedStock', 'Issued stock')} />
|
35
|
+
<ModalBody>
|
24
36
|
{issuingStock && issuingStock.length > 0 ? (
|
25
37
|
<TableContainer>
|
26
38
|
<Table>
|
@@ -46,10 +58,10 @@ const IssuingStockModal = ({ open, onClose, issuingStock }) => {
|
|
46
58
|
</Table>
|
47
59
|
</TableContainer>
|
48
60
|
) : (
|
49
|
-
<p>No issued stock data available
|
61
|
+
<p>{t('noIssuedStockDataAvailable', 'No issued stock data available.')}</p>
|
50
62
|
)}
|
51
|
-
</
|
52
|
-
|
63
|
+
</ModalBody>
|
64
|
+
</>
|
53
65
|
);
|
54
66
|
};
|
55
67
|
|
package/src/stock-home/{stock-home-receiving-modal.component.tsx → receiving-stock.modal.tsx}
RENAMED
@@ -1,26 +1,33 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
ModalBody,
|
4
|
+
ModalHeader,
|
5
|
+
Table,
|
6
|
+
TableBody,
|
7
|
+
TableCell,
|
8
|
+
TableContainer,
|
9
|
+
TableHead,
|
10
|
+
TableHeader,
|
11
|
+
TableRow,
|
12
|
+
} from '@carbon/react';
|
13
|
+
import { useTranslation } from 'react-i18next';
|
14
|
+
|
15
|
+
const ReceivingStockModal = ({ closeModal, receivingStock }) => {
|
16
|
+
const { t } = useTranslation();
|
3
17
|
|
4
|
-
const ReceivingStockModal = ({ open, onClose, receivingStock }) => {
|
5
18
|
const headers = [
|
6
|
-
{ key: 'status', header: 'Status' },
|
7
|
-
{ key: 'sourceName', header: 'Source' },
|
8
|
-
{ key: 'destinationName', header: 'Destination' },
|
9
|
-
{ key: 'stockItemName', header: 'Stock Item' },
|
10
|
-
{ key: 'stockItemPackagingUOMName', header: 'Unit' },
|
11
|
-
{ key: 'quantity', header: 'Quantity' },
|
19
|
+
{ key: 'status', header: t('status', 'Status') },
|
20
|
+
{ key: 'sourceName', header: t('source', 'Source') },
|
21
|
+
{ key: 'destinationName', header: t('destination', 'Destination') },
|
22
|
+
{ key: 'stockItemName', header: t('stockItem', 'Stock Item') },
|
23
|
+
{ key: 'stockItemPackagingUOMName', header: t('unit', 'Unit') },
|
24
|
+
{ key: 'quantity', header: t('quantity', 'Quantity') },
|
12
25
|
];
|
13
26
|
|
14
27
|
return (
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
modalHeading="Received Stock"
|
19
|
-
primaryButtonText="Close"
|
20
|
-
onSecondarySubmit={onClose}
|
21
|
-
size="lg"
|
22
|
-
>
|
23
|
-
<div>
|
28
|
+
<>
|
29
|
+
<ModalHeader closeModal={closeModal} title={t('receivedStock', 'Received stock')} />
|
30
|
+
<ModalBody>
|
24
31
|
{receivingStock && receivingStock.length > 0 ? (
|
25
32
|
<TableContainer>
|
26
33
|
<Table>
|
@@ -48,10 +55,10 @@ const ReceivingStockModal = ({ open, onClose, receivingStock }) => {
|
|
48
55
|
</Table>
|
49
56
|
</TableContainer>
|
50
57
|
) : (
|
51
|
-
<p>No received stock data available
|
58
|
+
<p>{t('noReceivedStockDataAvailable', 'No received stock data available.')}</p>
|
52
59
|
)}
|
53
|
-
</
|
54
|
-
|
60
|
+
</ModalBody>
|
61
|
+
</>
|
55
62
|
);
|
56
63
|
};
|
57
64
|
|