@openmrs/esm-stock-management-app 1.0.1-pre.455 → 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-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
@@ -1 +1 @@
|
|
1
|
-
var _openmrs_esm_stock_management_app;(()=>{"use strict";var e,r,t,n,o,a,i,l,s,u,f,p,c,d,h,m,v,g={1371:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(935),t.e(
|
1
|
+
var _openmrs_esm_stock_management_app;(()=>{"use strict";var e,r,t,n,o,a,i,l,s,u,f,p,c,d,h,m,v,g={1371:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(935),t.e(876),t.e(672),t.e(474)]).then((()=>()=>t(2894)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},b={};function y(e){var r=b[e];if(void 0!==r)return r.exports;var t=b[e]={id:e,loaded:!1,exports:{}};return g[e].call(t.exports,t,t.exports,y),t.loaded=!0,t.exports}y.m=g,y.c=b,y.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return y.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,y.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var o=Object.create(null);y.r(o);var a={};e=e||[null,r({}),r([]),r(r)];for(var i=2&n&&t;"object"==typeof i&&!~e.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach((e=>a[e]=()=>t[e]));return a.default=()=>t,y.d(o,a),o},y.d=(e,r)=>{for(var t in r)y.o(r,t)&&!y.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},y.f={},y.e=e=>Promise.all(Object.keys(y.f).reduce(((r,t)=>(y.f[t](e,r),r)),[])),y.u=e=>e+".js",y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),y.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@openmrs/esm-stock-management-app:",y.l=(e,r,o,a)=>{if(t[e])t[e].push(r);else{var i,l;if(void 0!==o)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var f=s[u];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==n+o){i=f;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,y.nc&&i.setAttribute("nonce",y.nc),i.setAttribute("data-webpack",n+o),i.src=e),t[e]=[r];var p=(r,n)=>{i.onerror=i.onload=null,clearTimeout(c);var o=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},c=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),l&&document.head.appendChild(i)}},y.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},y.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{y.S={};var e={},r={};y.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];y.o(y.S,t)||(y.S[t]={});var a=y.S[t],i="@openmrs/esm-stock-management-app",l=(e,r,t,n)=>{var o=a[e]=a[e]||{},l=o[r];(!l||!l.loaded&&(!n!=!l.eager?n:i>l.from))&&(o[r]={get:t,from:i,eager:!!n})},s=[];return"default"===t&&(l("@openmrs/esm-framework","5.7.1-pre.2076",(()=>Promise.all([y.e(800),y.e(672)]).then((()=>()=>y(4800))))),l("dayjs","1.11.10",(()=>y.e(484).then((()=>()=>y(7484))))),l("react-i18next","11.18.6",(()=>Promise.all([y.e(672),y.e(629)]).then((()=>()=>y(707))))),l("react-router-dom","6.21.1",(()=>Promise.all([y.e(26),y.e(935),y.e(672)]).then((()=>()=>y(8026))))),l("react","18.2.0",(()=>y.e(294).then((()=>()=>y(7294))))),l("swr/_internal","2.2.5",(()=>Promise.all([y.e(46),y.e(672)]).then((()=>()=>y(46)))))),e[t]=s.length?Promise.all(s).then((()=>e[t]=1)):1}}})(),(()=>{var e;y.g.importScripts&&(e=y.g.location+"");var r=y.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),y.p=e})(),o=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},a=(e,r)=>{e=o(e),r=o(r);for(var t=0;;){if(t>=e.length)return t<r.length&&"u"!=(typeof r[t])[0];var n=e[t],a=(typeof n)[0];if(t>=r.length)return"u"==a;var i=r[t],l=(typeof i)[0];if(a!=l)return"o"==a&&"n"==l||"s"==l||"u"==a;if("o"!=a&&"u"!=a&&n!=i)return n<i;t++}},i=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,o=1;o<e.length;o++)n--,t+="u"==(typeof(l=e[o]))[0]?"-":(n>0?".":"")+(n=2,l);return t}var a=[];for(o=1;o<e.length;o++){var l=e[o];a.push(0===l?"not("+s()+")":1===l?"("+s()+" || "+s()+")":2===l?a.pop()+" "+a.pop():i(l))}return s();function s(){return a.pop().replace(/^\((.+)\)$/,"$1")}},l=(e,r)=>{if(0 in e){r=o(r);var t=e[0],n=t<0;n&&(t=-t-1);for(var a=0,i=1,s=!0;;i++,a++){var u,f,p=i<e.length?(typeof e[i])[0]:"";if(a>=r.length||"o"==(f=(typeof(u=r[a]))[0]))return!s||("u"==p?i>t&&!n:""==p!=n);if("u"==f){if(!s||"u"!=p)return!1}else if(s)if(p==f)if(i<=t){if(u!=e[i])return!1}else{if(n?u>e[i]:u<e[i])return!1;u!=e[i]&&(s=!1)}else if("s"!=p&&"n"!=p){if(n||i<=t)return!1;s=!1,i--}else{if(i<=t||f<p!=n)return!1;s=!1}else"s"!=p&&"n"!=p&&(s=!1,i--)}}var c=[],d=c.pop.bind(c);for(a=1;a<e.length;a++){var h=e[a];c.push(1==h?d()|d():2==h?d()&d():h?l(h,r):!d())}return!!d()},s=(e,r)=>{var t=e[r];return Object.keys(t).reduce(((e,r)=>!e||!t[e].loaded&&a(e,r)?r:e),0)},u=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+i(n)+")",f=(e,r,t,n)=>{var o=s(e,t);return l(n,o)||p(u(e,t,o,n)),c(e[t][o])},p=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},c=e=>(e.loaded=1,e.get()),d=(e=>function(r,t,n,o){var a=y.I(r);return a&&a.then?a.then(e.bind(e,r,y.S[r],t,n,o)):e(0,y.S[r],t,n,o)})(((e,r,t,n,o)=>r&&y.o(r,t)?f(r,0,t,n):o())),h={},m={1672:()=>d("default","react",[1,18],(()=>y.e(294).then((()=>()=>y(7294))))),1914:()=>d("default","react-router-dom",[1,6],(()=>y.e(26).then((()=>()=>y(8026))))),2653:()=>d("default","dayjs",[1,1],(()=>y.e(484).then((()=>()=>y(7484))))),3397:()=>d("default","react-i18next",[1,11],(()=>y.e(707).then((()=>()=>y(707))))),5512:()=>d("default","swr/_internal",[1,2],(()=>y.e(46).then((()=>()=>y(46))))),7248:()=>d("default","@openmrs/esm-framework",[1,5],(()=>y.e(800).then((()=>()=>y(4800)))))},v={474:[1914,2653,3397,5512,7248],672:[1672]},y.f.consumes=(e,r)=>{y.o(v,e)&&v[e].forEach((e=>{if(y.o(h,e))return r.push(h[e]);var t=r=>{h[e]=0,y.m[e]=t=>{delete y.c[e],t.exports=r()}},n=r=>{delete h[e],y.m[e]=t=>{throw delete y.c[e],r}};try{var o=m[e]();o.then?r.push(h[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}))},(()=>{var e={122:0};y.f.j=(r,t)=>{var n=y.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(672!=r){var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=y.p+y.u(r),i=new Error;y.l(a,(t=>{if(y.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+r,r)}else e[r]=0};var r=(r,t)=>{var n,o,[a,i,l]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in i)y.o(i,n)&&(y.m[n]=i[n]);l&&l(y)}for(r&&r(t);s<a.length;s++)o=a[s],y.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=globalThis.webpackChunk_openmrs_esm_stock_management_app=globalThis.webpackChunk_openmrs_esm_stock_management_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),y.nc=void 0;var _=y(1371);_openmrs_esm_stock_management_app=_})();
|
@@ -78,7 +78,7 @@
|
|
78
78
|
"auxiliaryFiles": [
|
79
79
|
"openmrs-esm-stock-management-app.js.map"
|
80
80
|
],
|
81
|
-
"hash": "
|
81
|
+
"hash": "bbd9be83379294ec",
|
82
82
|
"childrenByOrder": {}
|
83
83
|
},
|
84
84
|
{
|
@@ -86,10 +86,10 @@
|
|
86
86
|
"initial": true,
|
87
87
|
"entry": true,
|
88
88
|
"recorded": false,
|
89
|
-
"size":
|
89
|
+
"size": 4763084,
|
90
90
|
"sizes": {
|
91
91
|
"consume-shared": 252,
|
92
|
-
"javascript":
|
92
|
+
"javascript": 4741135,
|
93
93
|
"share-init": 252,
|
94
94
|
"runtime": 21445
|
95
95
|
},
|
@@ -106,33 +106,7 @@
|
|
106
106
|
"auxiliaryFiles": [
|
107
107
|
"main.js.map"
|
108
108
|
],
|
109
|
-
"hash": "
|
110
|
-
"childrenByOrder": {}
|
111
|
-
},
|
112
|
-
{
|
113
|
-
"rendered": true,
|
114
|
-
"initial": false,
|
115
|
-
"entry": false,
|
116
|
-
"recorded": false,
|
117
|
-
"reason": "split chunk (cache group: defaultVendors)",
|
118
|
-
"size": 3531909,
|
119
|
-
"sizes": {
|
120
|
-
"javascript": 3531909
|
121
|
-
},
|
122
|
-
"names": [],
|
123
|
-
"idHints": [
|
124
|
-
"vendors"
|
125
|
-
],
|
126
|
-
"runtime": [
|
127
|
-
"@openmrs/esm-stock-management-app"
|
128
|
-
],
|
129
|
-
"files": [
|
130
|
-
"180.js"
|
131
|
-
],
|
132
|
-
"auxiliaryFiles": [
|
133
|
-
"180.js.map"
|
134
|
-
],
|
135
|
-
"hash": "b8bd22da3add4f1c",
|
109
|
+
"hash": "e9a2b88cc084f4ab",
|
136
110
|
"childrenByOrder": {}
|
137
111
|
},
|
138
112
|
{
|
@@ -164,9 +138,9 @@
|
|
164
138
|
"initial": false,
|
165
139
|
"entry": false,
|
166
140
|
"recorded": false,
|
167
|
-
"size":
|
141
|
+
"size": 1091372,
|
168
142
|
"sizes": {
|
169
|
-
"javascript":
|
143
|
+
"javascript": 1091162,
|
170
144
|
"consume-shared": 210
|
171
145
|
},
|
172
146
|
"names": [],
|
@@ -175,12 +149,12 @@
|
|
175
149
|
"@openmrs/esm-stock-management-app"
|
176
150
|
],
|
177
151
|
"files": [
|
178
|
-
"
|
152
|
+
"474.js"
|
179
153
|
],
|
180
154
|
"auxiliaryFiles": [
|
181
|
-
"
|
155
|
+
"474.js.map"
|
182
156
|
],
|
183
|
-
"hash": "
|
157
|
+
"hash": "8f2f8e9691b245f7",
|
184
158
|
"childrenByOrder": {}
|
185
159
|
},
|
186
160
|
{
|
@@ -325,6 +299,32 @@
|
|
325
299
|
"hash": "63121f39673cb859",
|
326
300
|
"childrenByOrder": {}
|
327
301
|
},
|
302
|
+
{
|
303
|
+
"rendered": true,
|
304
|
+
"initial": false,
|
305
|
+
"entry": false,
|
306
|
+
"recorded": false,
|
307
|
+
"reason": "split chunk (cache group: defaultVendors)",
|
308
|
+
"size": 3512440,
|
309
|
+
"sizes": {
|
310
|
+
"javascript": 3512440
|
311
|
+
},
|
312
|
+
"names": [],
|
313
|
+
"idHints": [
|
314
|
+
"vendors"
|
315
|
+
],
|
316
|
+
"runtime": [
|
317
|
+
"@openmrs/esm-stock-management-app"
|
318
|
+
],
|
319
|
+
"files": [
|
320
|
+
"876.js"
|
321
|
+
],
|
322
|
+
"auxiliaryFiles": [
|
323
|
+
"876.js.map"
|
324
|
+
],
|
325
|
+
"hash": "32b9b72b6513844f",
|
326
|
+
"childrenByOrder": {}
|
327
|
+
},
|
328
328
|
{
|
329
329
|
"rendered": true,
|
330
330
|
"initial": false,
|
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-
|
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.464"}
|
package/package.json
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
width: 100%;
|
9
9
|
right: 0;
|
10
10
|
bottom: 0;
|
11
|
+
z-index: 9;
|
11
12
|
border-left: 1px solid $text-03;
|
12
13
|
background-color: white;
|
13
14
|
overflow-y: auto;
|
@@ -35,7 +36,7 @@
|
|
35
36
|
width: 0;
|
36
37
|
}
|
37
38
|
|
38
|
-
|
39
|
+
&>div {
|
39
40
|
margin-top: spacing.$spacing-09;
|
40
41
|
}
|
41
42
|
}
|
@@ -14,10 +14,10 @@ function DashboardExtension({
|
|
14
14
|
}) {
|
15
15
|
const { name, title } = dashboardLinkConfig;
|
16
16
|
const location = useLocation();
|
17
|
-
const spaBasePath = `${window.spaBase}/
|
17
|
+
const spaBasePath = `${window.spaBase}/stock-management`;
|
18
18
|
|
19
19
|
const navLink = useMemo(() => {
|
20
|
-
const pathArray = location.pathname.split("/
|
20
|
+
const pathArray = location.pathname.split("/");
|
21
21
|
const lastElement = pathArray[pathArray.length - 1];
|
22
22
|
return decodeURIComponent(lastElement);
|
23
23
|
}, [location.pathname]);
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { ExtensionSlot } from "@openmrs/esm-framework";
|
3
|
+
import { StockManagementHeader } from "../stock-management-header/stock-management-header.component";
|
4
|
+
|
5
|
+
const DashboardView: React.FC<{ dashboardSlot: string; title: string }> = ({
|
6
|
+
dashboardSlot,
|
7
|
+
title,
|
8
|
+
}) => {
|
9
|
+
return (
|
10
|
+
<>
|
11
|
+
<StockManagementHeader />
|
12
|
+
<ExtensionSlot name={dashboardSlot} state={{ dashboardTitle: title }} />
|
13
|
+
</>
|
14
|
+
);
|
15
|
+
};
|
16
|
+
|
17
|
+
export default DashboardView;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { useParams } from "react-router-dom";
|
3
|
+
import {
|
4
|
+
useLayoutType,
|
5
|
+
isDesktop,
|
6
|
+
useExtensionStore,
|
7
|
+
ExtensionSlot,
|
8
|
+
WorkspaceContainer,
|
9
|
+
} from "@openmrs/esm-framework";
|
10
|
+
import DashboardView from "./dashboard-view.component";
|
11
|
+
import styles from "./home-dashboard.scss";
|
12
|
+
import { type DashboardConfig } from "../types";
|
13
|
+
import Overlay from "../core/components/overlay/overlay.component";
|
14
|
+
|
15
|
+
export default function Dashboard() {
|
16
|
+
const params = useParams();
|
17
|
+
const extensionStore = useExtensionStore();
|
18
|
+
const layout = useLayoutType();
|
19
|
+
const ungroupedDashboards =
|
20
|
+
extensionStore.slots["stock-page-dashboard-slot"]?.assignedExtensions
|
21
|
+
.map((e) => e.meta)
|
22
|
+
.filter((e) => Object.keys(e).length) || [];
|
23
|
+
const dashboards = ungroupedDashboards as Array<DashboardConfig>;
|
24
|
+
const activeDashboard =
|
25
|
+
dashboards.find((dashboard) => dashboard.name === params?.dashboard) ||
|
26
|
+
dashboards[0];
|
27
|
+
|
28
|
+
return (
|
29
|
+
<>
|
30
|
+
<Overlay />
|
31
|
+
<div className={styles.homePageWrapper}>
|
32
|
+
<section
|
33
|
+
className={
|
34
|
+
isDesktop(layout)
|
35
|
+
? styles.dashboardContainer
|
36
|
+
: styles.dashboardContainerTablet
|
37
|
+
}
|
38
|
+
>
|
39
|
+
{isDesktop(layout) && (
|
40
|
+
<ExtensionSlot name="stock-sidebar-slot" key={layout} />
|
41
|
+
)}
|
42
|
+
<DashboardView
|
43
|
+
title={activeDashboard?.name}
|
44
|
+
dashboardSlot={activeDashboard?.slot}
|
45
|
+
/>
|
46
|
+
</section>
|
47
|
+
<WorkspaceContainer overlay contextKey="stock-management" />
|
48
|
+
</div>
|
49
|
+
</>
|
50
|
+
);
|
51
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
@use '@carbon/colors';
|
2
|
+
@use '@carbon/styles/scss/spacing';
|
3
|
+
|
4
|
+
.homePageWrapper {
|
5
|
+
display: flex;
|
6
|
+
}
|
7
|
+
|
8
|
+
.dashboardContainer {
|
9
|
+
display: flex;
|
10
|
+
flex-grow: 1;
|
11
|
+
flex-direction: column;
|
12
|
+
margin: 0;
|
13
|
+
margin-left: 16rem;
|
14
|
+
background-color: colors.$gray-10;
|
15
|
+
|
16
|
+
& a {
|
17
|
+
width: 100%;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
.dashboardContainerTablet {
|
22
|
+
flex-grow: 1;
|
23
|
+
}
|
24
|
+
|
25
|
+
.logoSection {
|
26
|
+
display: flex;
|
27
|
+
justify-content: center;
|
28
|
+
}
|
package/src/index.ts
CHANGED
@@ -5,12 +5,21 @@ import bulkImportComponent from "./stock-items/add-bulk-stock-item/stock-items-b
|
|
5
5
|
import deleteUserModalComponent from "./stock-user-role-scopes/delete-stock-user-scope-modal.component";
|
6
6
|
import deleteStockModalComponent from "./stock-sources/delete-stock-modal.component";
|
7
7
|
import stockOperationDialogComponent from "./stock-operations/stock-operations-dialog/stock-operations-dialog.component";
|
8
|
-
import stockManagementDashboardComponent from "./dashboard/stock-management-dashboard.component";
|
9
8
|
import stockManagementComponent from "./stock-management.component";
|
10
9
|
import stockManagementAdminCardLinkComponent from "./stock-management-admin-card-link.component";
|
11
10
|
import deletePackagingUnitModalButtonComponent from "./stock-items/add-stock-item/packaging-units/packaging-units-delete-modal-button.component";
|
12
11
|
import deletePackagingUnitComponent from "./stock-items/add-stock-item/packaging-units/packaging-units-delete-modal.component";
|
13
|
-
|
12
|
+
import Root from "./root.component";
|
13
|
+
import StockHomeLandingPage from "./stock-home/stock-home-landing-page-component";
|
14
|
+
import { createDashboardLink } from "./createDashboardLink";
|
15
|
+
import SideMenu from "./side-menu/side-menu.component";
|
16
|
+
import StockOperationsComponent from "./stock-operations/stock-operations.component";
|
17
|
+
import StockItems from "./stock-items/stock-items.component";
|
18
|
+
import StockUserScopes from "./stock-user-role-scopes/stock-user-role-scopes.component";
|
19
|
+
import StockSources from "./stock-sources/stock-sources.component";
|
20
|
+
import StockLocations from "./stock-locations/stock-locations.component";
|
21
|
+
import StockReports from "./stock-reports/report-list/stock-reports.component";
|
22
|
+
import StockSettings from "./stock-settings/stock-settings.component";
|
14
23
|
const moduleName = "@openmrs/esm-stock-management-app";
|
15
24
|
|
16
25
|
const options = {
|
@@ -29,17 +38,70 @@ export const stockManagementAdminCardLink = getSyncLifecycle(
|
|
29
38
|
stockManagementAdminCardLinkComponent,
|
30
39
|
options
|
31
40
|
);
|
41
|
+
export const stockNavMenu = getSyncLifecycle(SideMenu, options);
|
42
|
+
//t('overview','Overview')
|
43
|
+
export const stockOverview = getSyncLifecycle(StockHomeLandingPage, options);
|
44
|
+
export const stockOverviewLink = getSyncLifecycle(
|
45
|
+
createDashboardLink({ title: "Overview", name: "stock-management" }),
|
46
|
+
options
|
47
|
+
);
|
48
|
+
//t('operations','Operations')
|
49
|
+
export const stockOperations = getSyncLifecycle(
|
50
|
+
StockOperationsComponent,
|
51
|
+
options
|
52
|
+
);
|
53
|
+
export const stockOperationsLink = getSyncLifecycle(
|
54
|
+
createDashboardLink({ title: "Operations", name: "operations" }),
|
55
|
+
options
|
56
|
+
);
|
57
|
+
//t('items','Items')
|
58
|
+
export const stockItems = getSyncLifecycle(StockItems, options);
|
59
|
+
export const stockItemsLink = getSyncLifecycle(
|
60
|
+
createDashboardLink({ title: "Items", name: "items" }),
|
61
|
+
options
|
62
|
+
);
|
63
|
+
//t('useScopes','User role scopes')
|
64
|
+
export const stockUserScopes = getSyncLifecycle(StockUserScopes, options);
|
65
|
+
export const stockUserScopesLink = getSyncLifecycle(
|
66
|
+
createDashboardLink({ title: "User role scopes", name: "user-scopes" }),
|
67
|
+
options
|
68
|
+
);
|
32
69
|
|
33
|
-
|
34
|
-
|
70
|
+
//t("sources","Sources")
|
71
|
+
export const stockSources = getSyncLifecycle(StockSources, options);
|
72
|
+
export const stockSourcesLink = getSyncLifecycle(
|
73
|
+
createDashboardLink({ title: "Sources", name: "sources" }),
|
35
74
|
options
|
36
75
|
);
|
37
76
|
|
38
|
-
|
39
|
-
|
77
|
+
//t("locations","Locations")
|
78
|
+
export const stockLocations = getSyncLifecycle(StockLocations, options);
|
79
|
+
export const stockLocationsLink = getSyncLifecycle(
|
80
|
+
createDashboardLink({ title: "Locations", name: "locations" }),
|
40
81
|
options
|
41
82
|
);
|
42
83
|
|
84
|
+
//t("reports","Reports")
|
85
|
+
export const stockReports = getSyncLifecycle(StockReports, options);
|
86
|
+
export const stockReportsLink = getSyncLifecycle(
|
87
|
+
createDashboardLink({ title: "Reports", name: "reports" }),
|
88
|
+
options
|
89
|
+
);
|
90
|
+
|
91
|
+
//t("settings","Settings")
|
92
|
+
export const stockSettings = getSyncLifecycle(StockSettings, options);
|
93
|
+
export const stockSettingsLink = getSyncLifecycle(
|
94
|
+
createDashboardLink({ title: "Settings", name: "settings" }),
|
95
|
+
options
|
96
|
+
);
|
97
|
+
|
98
|
+
export const stockManagement = getSyncLifecycle(
|
99
|
+
stockManagementComponent,
|
100
|
+
options
|
101
|
+
);
|
102
|
+
|
103
|
+
export const root = getSyncLifecycle(Root, options);
|
104
|
+
|
43
105
|
export const stockOperationDialog = getSyncLifecycle(
|
44
106
|
stockOperationDialogComponent,
|
45
107
|
options
|
package/src/root.component.tsx
CHANGED
@@ -1,7 +1,29 @@
|
|
1
|
-
import React from "react";
|
1
|
+
import React, { useEffect } from "react";
|
2
|
+
import { BrowserRouter, Route, Routes } from "react-router-dom";
|
3
|
+
import { setLeftNav, unsetLeftNav } from "@openmrs/esm-framework";
|
4
|
+
import Dashboard from "./dashboard/home-dashboard.component";
|
2
5
|
|
3
6
|
const Root: React.FC = () => {
|
4
|
-
|
7
|
+
const spaBasePath = `${window.spaBase}/stock-management`;
|
8
|
+
|
9
|
+
useEffect(() => {
|
10
|
+
setLeftNav({ name: "stock-page-dashboard-slot", basePath: spaBasePath });
|
11
|
+
return () => unsetLeftNav("stock-page-dashboard-slot");
|
12
|
+
}, [spaBasePath]);
|
13
|
+
|
14
|
+
return (
|
15
|
+
<main className="omrs-main-content">
|
16
|
+
<BrowserRouter basename={window.spaBase}>
|
17
|
+
<Routes>
|
18
|
+
<Route path="/stock-management" element={<Dashboard />} />
|
19
|
+
<Route
|
20
|
+
path="/stock-management/:dashboard/*"
|
21
|
+
element={<Dashboard />}
|
22
|
+
/>
|
23
|
+
</Routes>
|
24
|
+
</BrowserRouter>
|
25
|
+
</main>
|
26
|
+
);
|
5
27
|
};
|
6
28
|
|
7
29
|
export default Root;
|
package/src/routes.json
CHANGED
@@ -4,10 +4,157 @@
|
|
4
4
|
"fhir2": ">=1.2",
|
5
5
|
"webservices.rest": "^2.24.0"
|
6
6
|
},
|
7
|
-
"extensions": [
|
8
|
-
|
9
|
-
"
|
10
|
-
"
|
7
|
+
"extensions": [
|
8
|
+
{
|
9
|
+
"name": "stock-nav-menu",
|
10
|
+
"slot": "stock-sidebar-slot",
|
11
|
+
"component": "stockNavMenu",
|
12
|
+
"online": true,
|
13
|
+
"offline": true
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"name": "overview-db-link",
|
17
|
+
"slot": "stock-page-dashboard-slot",
|
18
|
+
"component": "stockOverviewLink",
|
19
|
+
"meta": {
|
20
|
+
"name": "overview",
|
21
|
+
"slot": "overview-dashboard-slot",
|
22
|
+
"title": "overview"
|
23
|
+
},
|
24
|
+
"order": 0,
|
25
|
+
"online": true,
|
26
|
+
"offline": true
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"name": "stock-overview-db",
|
30
|
+
"slot": "overview-dashboard-slot",
|
31
|
+
"component": "stockOverview"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"name": "operations-db-link",
|
35
|
+
"slot": "stock-page-dashboard-slot",
|
36
|
+
"component": "stockOperationsLink",
|
37
|
+
"meta": {
|
38
|
+
"name": "operations",
|
39
|
+
"slot": "operations-dashboard-slot",
|
40
|
+
"title": "operations"
|
41
|
+
},
|
42
|
+
"order": 2,
|
43
|
+
"online": true,
|
44
|
+
"offline": true
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"name": "stock-operations-db",
|
48
|
+
"slot": "operations-dashboard-slot",
|
49
|
+
"component": "stockOperations"
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"name": "items-db-link",
|
53
|
+
"slot": "stock-page-dashboard-slot",
|
54
|
+
"component": "stockItemsLink",
|
55
|
+
"meta": {
|
56
|
+
"name": "items",
|
57
|
+
"slot": "items-dashboard-slot",
|
58
|
+
"title": "items"
|
59
|
+
},
|
60
|
+
"order": 1,
|
61
|
+
"online": true,
|
62
|
+
"offline": true
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"name": "stock-items-db",
|
66
|
+
"slot": "items-dashboard-slot",
|
67
|
+
"component": "stockItems"
|
68
|
+
},
|
69
|
+
{
|
70
|
+
"name": "user-scopes-db-link",
|
71
|
+
"slot": "stock-page-dashboard-slot",
|
72
|
+
"component": "stockUserScopesLink",
|
73
|
+
"meta": {
|
74
|
+
"name": "user-scopes",
|
75
|
+
"slot": "user-scopes-dashboard-slot",
|
76
|
+
"title": "user-scopes"
|
77
|
+
},
|
78
|
+
"order": 3,
|
79
|
+
"online": true,
|
80
|
+
"offline": true
|
81
|
+
},
|
82
|
+
{
|
83
|
+
"name": "stock-user-scopes-db",
|
84
|
+
"slot": "user-scopes-dashboard-slot",
|
85
|
+
"component": "stockUserScopes"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"name": "sources-db-link",
|
89
|
+
"slot": "stock-page-dashboard-slot",
|
90
|
+
"component": "stockSourcesLink",
|
91
|
+
"meta": {
|
92
|
+
"name": "sources",
|
93
|
+
"slot": "sources-dashboard-slot",
|
94
|
+
"title": "Sources"
|
95
|
+
},
|
96
|
+
"order": 2,
|
97
|
+
"online": true,
|
98
|
+
"offline": true
|
99
|
+
},
|
100
|
+
{
|
101
|
+
"name": "stock-sources-db",
|
102
|
+
"slot": "sources-dashboard-slot",
|
103
|
+
"component": "stockSources"
|
104
|
+
},
|
105
|
+
{
|
106
|
+
"name": "locations-db-link",
|
107
|
+
"slot": "stock-page-dashboard-slot",
|
108
|
+
"component": "stockLocationsLink",
|
109
|
+
"meta": {
|
110
|
+
"name": "locations",
|
111
|
+
"slot": "locations-dashboard-slot",
|
112
|
+
"title": "Locations"
|
113
|
+
},
|
114
|
+
"order": 4,
|
115
|
+
"online": true,
|
116
|
+
"offline": true
|
117
|
+
},
|
118
|
+
{
|
119
|
+
"name": "stock-locations-db",
|
120
|
+
"slot": "locations-dashboard-slot",
|
121
|
+
"component": "stockLocations"
|
122
|
+
},
|
123
|
+
{
|
124
|
+
"name": "reports-db-link",
|
125
|
+
"slot": "stock-page-dashboard-slot",
|
126
|
+
"component": "stockReportsLink",
|
127
|
+
"meta": {
|
128
|
+
"name": "reports",
|
129
|
+
"slot": "reports-dashboard-slot",
|
130
|
+
"title": "Reports"
|
131
|
+
},
|
132
|
+
"order": 5,
|
133
|
+
"online": true,
|
134
|
+
"offline": true
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"name": "stock-reports-db",
|
138
|
+
"slot": "reports-dashboard-slot",
|
139
|
+
"component": "stockReports"
|
140
|
+
},
|
141
|
+
{
|
142
|
+
"name": "settings-db-link",
|
143
|
+
"slot": "stock-page-dashboard-slot",
|
144
|
+
"component": "stockSettingsLink",
|
145
|
+
"meta": {
|
146
|
+
"name": "settings",
|
147
|
+
"slot": "settings-dashboard-slot",
|
148
|
+
"title": "Settings"
|
149
|
+
},
|
150
|
+
"order": 6,
|
151
|
+
"online": true,
|
152
|
+
"offline": true
|
153
|
+
},
|
154
|
+
{
|
155
|
+
"name": "stock-settings-db",
|
156
|
+
"slot": "settings-dashboard-slot",
|
157
|
+
"component": "stockSettings"
|
11
158
|
},
|
12
159
|
{
|
13
160
|
"name": "stock-management-admin-card-link",
|
@@ -51,8 +198,10 @@
|
|
51
198
|
"component": "deletePackagingUnitButton"
|
52
199
|
}
|
53
200
|
],
|
54
|
-
"pages": [
|
55
|
-
|
56
|
-
|
57
|
-
|
201
|
+
"pages": [
|
202
|
+
{
|
203
|
+
"component": "root",
|
204
|
+
"route": "stock-management"
|
205
|
+
}
|
206
|
+
]
|
58
207
|
}
|