@openmrs/esm-stock-management-app 1.0.1-pre.406 → 1.0.1-pre.411

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,9 +32,9 @@
32
32
  "initial": false,
33
33
  "entry": false,
34
34
  "recorded": false,
35
- "size": 1033651,
35
+ "size": 1033865,
36
36
  "sizes": {
37
- "javascript": 1033441,
37
+ "javascript": 1033655,
38
38
  "consume-shared": 210
39
39
  },
40
40
  "names": [],
@@ -48,7 +48,7 @@
48
48
  "auxiliaryFiles": [
49
49
  "39.js.map"
50
50
  ],
51
- "hash": "94b7d138985a7d25",
51
+ "hash": "36d7594192fbb296",
52
52
  "childrenByOrder": {}
53
53
  },
54
54
  {
@@ -110,10 +110,10 @@
110
110
  "initial": true,
111
111
  "entry": true,
112
112
  "recorded": false,
113
- "size": 4724831,
113
+ "size": 4725045,
114
114
  "sizes": {
115
115
  "consume-shared": 252,
116
- "javascript": 4702883,
116
+ "javascript": 4703097,
117
117
  "share-init": 252,
118
118
  "runtime": 21444
119
119
  },
@@ -130,7 +130,7 @@
130
130
  "auxiliaryFiles": [
131
131
  "main.js.map"
132
132
  ],
133
- "hash": "418aee604a9f031d",
133
+ "hash": "ae5edd249b6c153d",
134
134
  "childrenByOrder": {}
135
135
  },
136
136
  {
@@ -212,9 +212,9 @@
212
212
  "initial": false,
213
213
  "entry": false,
214
214
  "recorded": false,
215
- "size": 1643,
215
+ "size": 1706,
216
216
  "sizes": {
217
- "javascript": 1643
217
+ "javascript": 1706
218
218
  },
219
219
  "names": [],
220
220
  "idHints": [],
@@ -226,7 +226,7 @@
226
226
  "574.js"
227
227
  ],
228
228
  "auxiliaryFiles": [],
229
- "hash": "b3e5d6afecdfdf79",
229
+ "hash": "79c30f90fd2e5c04",
230
230
  "childrenByOrder": {}
231
231
  },
232
232
  {
package/dist/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.24.0"},"extensions":[{"name":"stock-management-dashboard","slot":"stock-management-dashboard-slot","component":"stockManagementDashboard"},{"name":"stock-management-admin-card-link","slot":"system-admin-page-card-link-slot","component":"stockManagementAdminCardLink"},{"name":"stock-operation-dialog","component":"stockOperationDialog"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsDialog"},{"name":"delete-stock-modal","component":"deleteStockModal"},{"name":"delete-stock-user-scope-modal","component":"deleteUserScopeModal"},{"name":"stock-management-app-menu-item","component":"stockManagementAppMenuItem","slot":"app-menu-item-slot","meta":{"name":" Stock Management"}},{"name":"delete-stock-rule-modal","component":"deleteStockRuleModal"},{"name":"delete-packaging-unit-modal","component":"deletePackagingUnitModal"},{"name":"delete-packaging-unit-button","component":"deletePackagingUnitButton"}],"pages":[{"component":"stockManagement","route":"stock-management"}],"version":"1.0.1-pre.406"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.24.0"},"extensions":[{"name":"stock-management-dashboard","slot":"stock-management-dashboard-slot","component":"stockManagementDashboard"},{"name":"stock-management-admin-card-link","slot":"system-admin-page-card-link-slot","component":"stockManagementAdminCardLink"},{"name":"stock-operation-dialog","component":"stockOperationDialog"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsDialog"},{"name":"delete-stock-modal","component":"deleteStockModal"},{"name":"delete-stock-user-scope-modal","component":"deleteUserScopeModal"},{"name":"stock-management-app-menu-item","component":"stockManagementAppMenuItem","slot":"app-menu-item-slot","meta":{"name":" Stock Management"}},{"name":"delete-stock-rule-modal","component":"deleteStockRuleModal"},{"name":"delete-packaging-unit-modal","component":"deletePackagingUnitModal"},{"name":"delete-packaging-unit-button","component":"deletePackagingUnitButton"}],"pages":[{"component":"stockManagement","route":"stock-management"}],"version":"1.0.1-pre.411"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-stock-management-app",
3
- "version": "1.0.1-pre.406",
3
+ "version": "1.0.1-pre.411",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Stock management microfrontend for OpenMRS 3.x",
6
6
  "browser": "dist/openmrs-esm-stock-management-app.js",
@@ -38,13 +38,16 @@ const StockHomeInventoryCard = () => {
38
38
 
39
39
  mergedArray = mergedArray.filter((item) => item.hasExpiration);
40
40
 
41
- const filteredData = mergedArray.filter((item) => {
42
- const expirationDate = new Date(item.expiration);
43
- const differenceInDays = Math.ceil(
44
- (expirationDate.getTime() - currentDate.getTime()) / (1000 * 60 * 60 * 24)
45
- );
46
- return differenceInDays <= 180 && differenceInDays >= 0;
47
- });
41
+ const filteredData = mergedArray
42
+ .filter((item) => {
43
+ const expirationDate = new Date(item.expiration);
44
+ const differenceInDays = Math.ceil(
45
+ (expirationDate.getTime() - currentDate.getTime()) /
46
+ (1000 * 60 * 60 * 24)
47
+ );
48
+ return differenceInDays <= 180 && differenceInDays >= 0;
49
+ })
50
+ .slice(0, 5);
48
51
 
49
52
  return (
50
53
  <>
@@ -5,6 +5,7 @@ import { ComboBox, TextInputSkeleton } from "@carbon/react";
5
5
  import { useConcept } from "../../../stock-lookups/stock-lookups.resource";
6
6
  import { type ConfigObject } from "../../../config-schema";
7
7
  import { useConfig } from "@openmrs/esm-framework";
8
+ import { useTranslation } from "react-i18next";
8
9
 
9
10
  interface StockItemCategorySelectorProps<T> {
10
11
  categoryUuid?: string;
@@ -23,6 +24,8 @@ interface StockItemCategorySelectorProps<T> {
23
24
  const StockItemCategorySelector = <T,>(
24
25
  props: StockItemCategorySelectorProps<T>
25
26
  ) => {
27
+ const { t } = useTranslation();
28
+
26
29
  const { stockItemCategoryUUID } = useConfig<ConfigObject>();
27
30
  const {
28
31
  items: { answers: categories },
@@ -52,10 +55,10 @@ const StockItemCategorySelector = <T,>(
52
55
  categories?.find((p) => p.uuid === props.categoryUuid) || {}
53
56
  }
54
57
  itemToString={(item?: Concept) =>
55
- item && item?.display ? `${item?.display}` : ""
58
+ item && item?.display ? `${t(item?.display)}` : ""
56
59
  }
57
60
  shouldFilterItem={() => true}
58
- value={categories?.find((p) => p.uuid === value)?.display ?? ""}
61
+ value={t(categories?.find((p) => p.uuid === value)?.display) ?? ""}
59
62
  placeholder={props.placeholder}
60
63
  ref={ref}
61
64
  invalid={props.invalid}
@@ -4,8 +4,8 @@ export interface RadioOption {
4
4
  }
5
5
 
6
6
  export const radioOptions: RadioOption[] = [
7
- { label: "Drug", value: true },
8
- { label: "Other", value: false },
7
+ { label: "Pharmaceuticals", value: true },
8
+ { label: "Non Pharmaceuticals", value: false },
9
9
  ];
10
10
 
11
11
  export const expirationOptions: RadioOption[] = [
@@ -19,8 +19,12 @@ const FilterStockItems: React.FC<FilterStockItemsProps> = ({
19
19
  className={styles.spacing}
20
20
  >
21
21
  <RadioButton labelText="All" value="" id="is-drug-all" />
22
- <RadioButton labelText="Drugs" value="true" id="is-drug-drug" />
23
- <RadioButton labelText="Other" value="false" id="is-drug-other" />
22
+ <RadioButton labelText="Pharmaceuticals" value="true" id="is-drug-drug" />
23
+ <RadioButton
24
+ labelText="Non Pharmaceuticals"
25
+ value="false"
26
+ id="is-drug-other"
27
+ />
24
28
  </RadioButtonGroup>
25
29
  );
26
30
  };
@@ -118,7 +118,9 @@ const BaseOperationDetails: React.FC<BaseOperationDetailsProps> = ({
118
118
  maxDate={formatForDatePicker(today())}
119
119
  locale="en"
120
120
  dateFormat={DATE_PICKER_CONTROL_FORMAT}
121
- onChange={onChange}
121
+ onChange={([newDate]) => {
122
+ onChange(newDate);
123
+ }}
122
124
  >
123
125
  <DatePickerInput
124
126
  invalid={!!errors.operationDate}
@@ -127,7 +129,7 @@ const BaseOperationDetails: React.FC<BaseOperationDetailsProps> = ({
127
129
  name="operationDate"
128
130
  placeholder={DATE_PICKER_FORMAT}
129
131
  labelText={t("operationDate", "Operation Date")}
130
- value={formatForDatePicker(model?.operationDate)}
132
+ defaultValue={formatForDatePicker(model?.operationDate)}
131
133
  />
132
134
  </DatePicker>
133
135
  )}
@@ -20,5 +20,7 @@
20
20
  "patientGetterExplainer": "Try clicking the button below to fetch a patient from the backend",
21
21
  "resources": "Resources",
22
22
  "usefulLinks": "Below are some links to useful resources",
23
- "welcomeText": "Welcome to the O3 Template app"
23
+ "welcomeText": "Welcome to the O3 Template app",
24
+ "Is a Drug": "Pharmaceuticals",
25
+ "Non Drug": "Non Pharmaceuticals"
24
26
  }