@openmrs/esm-stock-management-app 1.0.1-pre.453 → 1.0.1-pre.464
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/474.js +1 -0
- package/dist/474.js.map +1 -0
- package/dist/876.js +2 -0
- package/dist/876.js.map +1 -0
- 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 +35 -35
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/core/components/overlay/overlay.scss +2 -1
- package/src/createDashboardLink.tsx +2 -2
- package/src/dashboard/dashboard-view.component.tsx +17 -0
- package/src/dashboard/home-dashboard.component.tsx +51 -0
- package/src/dashboard/home-dashboard.scss +28 -0
- package/src/index.ts +68 -6
- package/src/root.component.tsx +24 -2
- package/src/routes.json +157 -8
- package/src/side-menu/side-menu.component.tsx +6 -0
- package/src/stock-items/add-stock-item/stock-item-category-selector/stock-item-category-selector.component.tsx +6 -1
- package/src/stock-items/add-stock-item/stock-item-details/stock-item-details.component.tsx +20 -0
- package/src/stock-settings/stock-settings.component.tsx +27 -2
- package/src/stock-settings/stock-settings.scss +23 -0
- package/src/types/index.ts +5 -0
- package/dist/180.js +0 -2
- package/dist/180.js.map +0 -1
- package/dist/457.js +0 -1
- package/dist/457.js.map +0 -1
- package/src/dashboard/stock-management-dashboard-side-nav.component.tsx +0 -54
- package/src/dashboard/stock-management-dashboard.component.tsx +0 -43
- package/src/dashboard/stock-management-dashboard.scss +0 -8
- /package/dist/{180.js.LICENSE.txt → 876.js.LICENSE.txt} +0 -0
@@ -61,10 +61,18 @@ const StockItemDetails = forwardRef<never, StockItemDetailsProps>(
|
|
61
61
|
|
62
62
|
const [isSaving, setIsSaving] = useState(false);
|
63
63
|
const [isDrug, setIsDrug] = useState(false);
|
64
|
+
const [selectedItemType, setSelectedItemType] = useState("");
|
64
65
|
const [hasExpiration, setHasExpiration] = useState(false);
|
65
66
|
|
66
67
|
useEffect(() => {
|
67
68
|
setIsDrug(model.isDrug ?? false);
|
69
|
+
setSelectedItemType(
|
70
|
+
model.isDrug === true
|
71
|
+
? "Pharmaceuticals"
|
72
|
+
: model.isDrug === false
|
73
|
+
? "Non Pharmaceuticals"
|
74
|
+
: undefined
|
75
|
+
);
|
68
76
|
setHasExpiration(model.hasExpiration ?? false);
|
69
77
|
}, [model.hasExpiration, model.isDrug]);
|
70
78
|
|
@@ -85,7 +93,12 @@ const StockItemDetails = forwardRef<never, StockItemDetailsProps>(
|
|
85
93
|
invalid={!!errors.isDrug}
|
86
94
|
invalidText={errors.isDrug && errors?.isDrug?.message}
|
87
95
|
onChange={(selection: boolean) => {
|
96
|
+
const selectedOption = radioOptions.find(
|
97
|
+
(option) => option.value === selection
|
98
|
+
);
|
99
|
+
const selectedLabel = selectedOption ? selectedOption.label : "";
|
88
100
|
setIsDrug(selection);
|
101
|
+
setSelectedItemType(selectedLabel);
|
89
102
|
}}
|
90
103
|
options={radioOptions} // Pass radioOptions directly
|
91
104
|
/>
|
@@ -201,6 +214,13 @@ const StockItemDetails = forwardRef<never, StockItemDetailsProps>(
|
|
201
214
|
name="categoryUuid"
|
202
215
|
controllerName="categoryUuid"
|
203
216
|
control={control}
|
217
|
+
itemType={
|
218
|
+
selectedItemType === "Pharmaceuticals"
|
219
|
+
? "Drugs"
|
220
|
+
: selectedItemType === "Non Pharmaceuticals"
|
221
|
+
? "Non Drugs"
|
222
|
+
: undefined
|
223
|
+
}
|
204
224
|
title={t("category:", "Category") + ":"}
|
205
225
|
placeholder={t("chooseACategory", "Choose a category")}
|
206
226
|
invalid={!!errors.categoryUuid}
|
@@ -1,9 +1,34 @@
|
|
1
1
|
import React from "react";
|
2
|
+
import { useTranslation } from "react-i18next";
|
3
|
+
import styles from "./stock-settings.scss";
|
4
|
+
import { navigate } from "@openmrs/esm-framework";
|
5
|
+
import { Button } from "@carbon/react";
|
6
|
+
import { UserSettings } from "@carbon/react/icons";
|
2
7
|
|
3
8
|
function StockSettings() {
|
9
|
+
const { t } = useTranslation();
|
10
|
+
|
4
11
|
return (
|
5
|
-
<div
|
6
|
-
<
|
12
|
+
<div className={styles.StockSettings}>
|
13
|
+
<div className={styles.title}>
|
14
|
+
{t(
|
15
|
+
"comingSoonUnderDev",
|
16
|
+
"Exciting updates are on the way! In the meantime, use the link below to access Admin UI settings."
|
17
|
+
)}
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<Button
|
21
|
+
onClick={() =>
|
22
|
+
navigate({
|
23
|
+
to: `\${openmrsBase}/admin/maintenance/settings.list?show=Stockmanagement`,
|
24
|
+
})
|
25
|
+
}
|
26
|
+
size="md"
|
27
|
+
renderIcon={() => <UserSettings className="cds--btn__icon" size={24} />}
|
28
|
+
kind="ghost"
|
29
|
+
>
|
30
|
+
{t("adminSettings", "Admin settings")}
|
31
|
+
</Button>
|
7
32
|
</div>
|
8
33
|
);
|
9
34
|
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
@use '@carbon/colors';
|
2
|
+
@use '@carbon/layout';
|
3
|
+
@use "../root.scss" as *;
|
4
|
+
|
5
|
+
.StockSettings {
|
6
|
+
display: flex;
|
7
|
+
justify-content: center;
|
8
|
+
flex-direction: column;
|
9
|
+
justify-content: flex-end;
|
10
|
+
min-height: calc(layout.$layout-07 * 1.25);
|
11
|
+
border: 1px solid colors.$gray-20;
|
12
|
+
margin: layout.$spacing-03;
|
13
|
+
align-items: center;
|
14
|
+
background-color: colors.$white-0;
|
15
|
+
|
16
|
+
&>button {
|
17
|
+
margin-bottom: layout.$layout-03;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
.title {
|
22
|
+
@extend .productiveHeading01;
|
23
|
+
}
|