@openmrs/esm-stock-management-app 1.0.1-pre.465 → 1.0.1-pre.469
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/474.js +1 -1
- package/dist/474.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.buildmanifest.json +6 -6
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/config-schema.ts +22 -0
- package/src/core/print/PrintTemplate.ts +6 -7
- package/src/core/utils/imageUtils.ts +4 -4
- package/src/stock-items/add-stock-item/packaging-units/packaging-units.component.tsx +7 -1
- package/src/stock-operations/stock-operations-dialog/stock-operations-print-button.component.tsx +1 -7
- package/src/stock-operations/stock-operations-table.component.tsx +0 -1
@@ -86,10 +86,10 @@
|
|
86
86
|
"initial": true,
|
87
87
|
"entry": true,
|
88
88
|
"recorded": false,
|
89
|
-
"size":
|
89
|
+
"size": 4770073,
|
90
90
|
"sizes": {
|
91
91
|
"consume-shared": 252,
|
92
|
-
"javascript":
|
92
|
+
"javascript": 4748124,
|
93
93
|
"share-init": 252,
|
94
94
|
"runtime": 21445
|
95
95
|
},
|
@@ -106,7 +106,7 @@
|
|
106
106
|
"auxiliaryFiles": [
|
107
107
|
"main.js.map"
|
108
108
|
],
|
109
|
-
"hash": "
|
109
|
+
"hash": "4584f840c7b06eb6",
|
110
110
|
"childrenByOrder": {}
|
111
111
|
},
|
112
112
|
{
|
@@ -138,9 +138,9 @@
|
|
138
138
|
"initial": false,
|
139
139
|
"entry": false,
|
140
140
|
"recorded": false,
|
141
|
-
"size":
|
141
|
+
"size": 1098361,
|
142
142
|
"sizes": {
|
143
|
-
"javascript":
|
143
|
+
"javascript": 1098151,
|
144
144
|
"consume-shared": 210
|
145
145
|
},
|
146
146
|
"names": [],
|
@@ -154,7 +154,7 @@
|
|
154
154
|
"auxiliaryFiles": [
|
155
155
|
"474.js.map"
|
156
156
|
],
|
157
|
-
"hash": "
|
157
|
+
"hash": "3d31f10ff5724cc8",
|
158
158
|
"childrenByOrder": {}
|
159
159
|
},
|
160
160
|
{
|
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-nav-menu","slot":"stock-sidebar-slot","component":"stockNavMenu","online":true,"offline":true},{"name":"overview-db-link","slot":"stock-page-dashboard-slot","component":"stockOverviewLink","meta":{"name":"overview","slot":"overview-dashboard-slot","title":"overview"},"order":0,"online":true,"offline":true},{"name":"stock-overview-db","slot":"overview-dashboard-slot","component":"stockOverview"},{"name":"operations-db-link","slot":"stock-page-dashboard-slot","component":"stockOperationsLink","meta":{"name":"operations","slot":"operations-dashboard-slot","title":"operations"},"order":2,"online":true,"offline":true},{"name":"stock-operations-db","slot":"operations-dashboard-slot","component":"stockOperations"},{"name":"items-db-link","slot":"stock-page-dashboard-slot","component":"stockItemsLink","meta":{"name":"items","slot":"items-dashboard-slot","title":"items"},"order":1,"online":true,"offline":true},{"name":"stock-items-db","slot":"items-dashboard-slot","component":"stockItems"},{"name":"user-scopes-db-link","slot":"stock-page-dashboard-slot","component":"stockUserScopesLink","meta":{"name":"user-scopes","slot":"user-scopes-dashboard-slot","title":"user-scopes"},"order":3,"online":true,"offline":true},{"name":"stock-user-scopes-db","slot":"user-scopes-dashboard-slot","component":"stockUserScopes"},{"name":"sources-db-link","slot":"stock-page-dashboard-slot","component":"stockSourcesLink","meta":{"name":"sources","slot":"sources-dashboard-slot","title":"Sources"},"order":2,"online":true,"offline":true},{"name":"stock-sources-db","slot":"sources-dashboard-slot","component":"stockSources"},{"name":"locations-db-link","slot":"stock-page-dashboard-slot","component":"stockLocationsLink","meta":{"name":"locations","slot":"locations-dashboard-slot","title":"Locations"},"order":4,"online":true,"offline":true},{"name":"stock-locations-db","slot":"locations-dashboard-slot","component":"stockLocations"},{"name":"reports-db-link","slot":"stock-page-dashboard-slot","component":"stockReportsLink","meta":{"name":"reports","slot":"reports-dashboard-slot","title":"Reports"},"order":5,"online":true,"offline":true},{"name":"stock-reports-db","slot":"reports-dashboard-slot","component":"stockReports"},{"name":"settings-db-link","slot":"stock-page-dashboard-slot","component":"stockSettingsLink","meta":{"name":"settings","slot":"settings-dashboard-slot","title":"Settings"},"order":6,"online":true,"offline":true},{"name":"stock-settings-db","slot":"settings-dashboard-slot","component":"stockSettings"},{"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":"root","route":"stock-management"}],"version":"1.0.1-pre.
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.24.0"},"extensions":[{"name":"stock-nav-menu","slot":"stock-sidebar-slot","component":"stockNavMenu","online":true,"offline":true},{"name":"overview-db-link","slot":"stock-page-dashboard-slot","component":"stockOverviewLink","meta":{"name":"overview","slot":"overview-dashboard-slot","title":"overview"},"order":0,"online":true,"offline":true},{"name":"stock-overview-db","slot":"overview-dashboard-slot","component":"stockOverview"},{"name":"operations-db-link","slot":"stock-page-dashboard-slot","component":"stockOperationsLink","meta":{"name":"operations","slot":"operations-dashboard-slot","title":"operations"},"order":2,"online":true,"offline":true},{"name":"stock-operations-db","slot":"operations-dashboard-slot","component":"stockOperations"},{"name":"items-db-link","slot":"stock-page-dashboard-slot","component":"stockItemsLink","meta":{"name":"items","slot":"items-dashboard-slot","title":"items"},"order":1,"online":true,"offline":true},{"name":"stock-items-db","slot":"items-dashboard-slot","component":"stockItems"},{"name":"user-scopes-db-link","slot":"stock-page-dashboard-slot","component":"stockUserScopesLink","meta":{"name":"user-scopes","slot":"user-scopes-dashboard-slot","title":"user-scopes"},"order":3,"online":true,"offline":true},{"name":"stock-user-scopes-db","slot":"user-scopes-dashboard-slot","component":"stockUserScopes"},{"name":"sources-db-link","slot":"stock-page-dashboard-slot","component":"stockSourcesLink","meta":{"name":"sources","slot":"sources-dashboard-slot","title":"Sources"},"order":2,"online":true,"offline":true},{"name":"stock-sources-db","slot":"sources-dashboard-slot","component":"stockSources"},{"name":"locations-db-link","slot":"stock-page-dashboard-slot","component":"stockLocationsLink","meta":{"name":"locations","slot":"locations-dashboard-slot","title":"Locations"},"order":4,"online":true,"offline":true},{"name":"stock-locations-db","slot":"locations-dashboard-slot","component":"stockLocations"},{"name":"reports-db-link","slot":"stock-page-dashboard-slot","component":"stockReportsLink","meta":{"name":"reports","slot":"reports-dashboard-slot","title":"Reports"},"order":5,"online":true,"offline":true},{"name":"stock-reports-db","slot":"reports-dashboard-slot","component":"stockReports"},{"name":"settings-db-link","slot":"stock-page-dashboard-slot","component":"stockSettingsLink","meta":{"name":"settings","slot":"settings-dashboard-slot","title":"Settings"},"order":6,"online":true,"offline":true},{"name":"stock-settings-db","slot":"settings-dashboard-slot","component":"stockSettings"},{"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":"root","route":"stock-management"}],"version":"1.0.1-pre.469"}
|
package/package.json
CHANGED
package/src/config-schema.ts
CHANGED
@@ -35,6 +35,23 @@ export const configSchema = {
|
|
35
35
|
_description: "UUID for the stock item category",
|
36
36
|
_default: "6d24eb6e-b42f-4706-ab2d-ae4472161f6a",
|
37
37
|
},
|
38
|
+
logo: {
|
39
|
+
src: {
|
40
|
+
_type: Type.String,
|
41
|
+
_default: null,
|
42
|
+
_description: "A path or URL to an image.",
|
43
|
+
},
|
44
|
+
alt: {
|
45
|
+
_type: Type.String,
|
46
|
+
_default: "Logo",
|
47
|
+
_description: "Alt text, shown on hover",
|
48
|
+
},
|
49
|
+
name: {
|
50
|
+
_type: Type.String,
|
51
|
+
_default: null,
|
52
|
+
_description: "The organization name displayed when image is absent",
|
53
|
+
},
|
54
|
+
},
|
38
55
|
};
|
39
56
|
|
40
57
|
export type ConfigObject = {
|
@@ -45,4 +62,9 @@ export type ConfigObject = {
|
|
45
62
|
stockSourceTypeUUID: string;
|
46
63
|
dispensingUnitsUUID: string;
|
47
64
|
stockItemCategoryUUID: string;
|
65
|
+
logo: {
|
66
|
+
src: string;
|
67
|
+
alt: string;
|
68
|
+
name: string;
|
69
|
+
};
|
48
70
|
};
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { PrintCss } from "./PrintStyles";
|
2
|
-
import {
|
2
|
+
import { PRINT_LOGO } from "../../constants";
|
3
3
|
import { GetPrintLogo, PrintLogoData } from "../utils/imageUtils";
|
4
|
+
import { getConfig } from "@openmrs/esm-framework";
|
4
5
|
|
5
6
|
export const GetPrintTemplate = (
|
6
7
|
body: string,
|
@@ -27,6 +28,8 @@ ${PrintCss}
|
|
27
28
|
};
|
28
29
|
|
29
30
|
export const GetLogoSection = async () => {
|
31
|
+
const config = await getConfig("@openmrs/esm-stock-management-app");
|
32
|
+
const logoText = config?.logo?.name;
|
30
33
|
let printLogoData: PrintLogoData | null = null;
|
31
34
|
if (PRINT_LOGO) {
|
32
35
|
try {
|
@@ -35,7 +38,7 @@ export const GetLogoSection = async () => {
|
|
35
38
|
console.info(e);
|
36
39
|
}
|
37
40
|
}
|
38
|
-
return printLogoData ||
|
41
|
+
return printLogoData || logoText
|
39
42
|
? `
|
40
43
|
<div class="logo" >
|
41
44
|
${
|
@@ -45,11 +48,7 @@ export const GetLogoSection = async () => {
|
|
45
48
|
: `<img alt='' src='${printLogoData.image}' />`
|
46
49
|
: ""
|
47
50
|
}
|
48
|
-
${
|
49
|
-
PRINT_LOGO_TEXT
|
50
|
-
? `<span class='logo-text text'>${PRINT_LOGO_TEXT}</span>`
|
51
|
-
: ""
|
52
|
-
}
|
51
|
+
${logoText ? `<span class='logo-text text'>${logoText}</span>` : ""}
|
53
52
|
</div>
|
54
53
|
`
|
55
54
|
: "";
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import {
|
2
|
-
|
1
|
+
import { getConfig } from "@openmrs/esm-framework";
|
3
2
|
export interface PrintLogoData {
|
4
3
|
image: string;
|
5
4
|
isSvg: boolean;
|
6
5
|
}
|
7
6
|
|
8
|
-
export const GetPrintLogo = (): Promise<PrintLogoData | null> => {
|
9
|
-
const
|
7
|
+
export const GetPrintLogo = async (): Promise<PrintLogoData | null> => {
|
8
|
+
const config = await getConfig("@openmrs/esm-stock-management-app");
|
9
|
+
const printLogoUrl = config?.logo?.src;
|
10
10
|
return new Promise((resolve, reject) => {
|
11
11
|
if (!printLogoUrl) {
|
12
12
|
resolve(null);
|
@@ -29,6 +29,7 @@ import DeleteModalButton from "./packaging-units-delete-modal-button.component";
|
|
29
29
|
import { handleMutate } from "../../../utils";
|
30
30
|
|
31
31
|
import styles from "./packaging-units.scss";
|
32
|
+
import { closeOverlay } from "../../../core/components/overlay/hook";
|
32
33
|
|
33
34
|
interface PackagingUnitsProps {
|
34
35
|
isEditing?: boolean;
|
@@ -177,7 +178,9 @@ const PackagingUnits: React.FC<PackagingUnitsProps> = ({
|
|
177
178
|
handleTabChange(0);
|
178
179
|
});
|
179
180
|
};
|
180
|
-
|
181
|
+
const handleCancelPackagingUnits = () => {
|
182
|
+
handleTabChange(0);
|
183
|
+
};
|
181
184
|
const handleNewUnitFactorChange = (value: string | number) => {
|
182
185
|
setNewUnit({
|
183
186
|
...newUnit,
|
@@ -269,6 +272,9 @@ const PackagingUnits: React.FC<PackagingUnitsProps> = ({
|
|
269
272
|
)}
|
270
273
|
/>
|
271
274
|
<div className={styles.packageUnitsBtn}>
|
275
|
+
<Button kind="secondary" onClick={handleCancelPackagingUnits}>
|
276
|
+
{t("cancel", "Cancel")}
|
277
|
+
</Button>
|
272
278
|
<Button
|
273
279
|
name="save"
|
274
280
|
type="submit"
|
package/src/stock-operations/stock-operations-dialog/stock-operations-print-button.component.tsx
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import React from "react";
|
2
2
|
|
3
3
|
import { Button } from "@carbon/react";
|
4
|
-
import { useConfig } from "@openmrs/esm-framework";
|
5
4
|
import { useTranslation } from "react-i18next";
|
6
5
|
import { Printer } from "@carbon/react/icons";
|
7
6
|
import { StockOperationDTO } from "../../core/api/types/stockOperation/StockOperationDTO";
|
@@ -29,11 +28,6 @@ const StockOperationPrintButton: React.FC<StockOperationCancelButtonProps> = ({
|
|
29
28
|
}) => {
|
30
29
|
const { t } = useTranslation();
|
31
30
|
|
32
|
-
const { config } = useConfig();
|
33
|
-
|
34
|
-
// const { printItemCost, printBalanceOnHand } = config;
|
35
|
-
|
36
|
-
// on print stock operation
|
37
31
|
const onPrintStockOperation = async () => {
|
38
32
|
try {
|
39
33
|
let parentOperation: StockOperationDTO | null | undefined;
|
@@ -152,7 +146,7 @@ const StockOperationPrintButton: React.FC<StockOperationCancelButtonProps> = ({
|
|
152
146
|
kind="tertiary"
|
153
147
|
renderIcon={(props) => <Printer size={16} {...props} />}
|
154
148
|
>
|
155
|
-
{t("print", "Print
|
149
|
+
{t("print", "Print")}
|
156
150
|
</Button>
|
157
151
|
);
|
158
152
|
};
|