@openmrs/esm-stock-management-app 3.0.1-pre.833 → 3.0.1-pre.840
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/119.js +1 -0
- package/dist/119.js.map +1 -0
- package/dist/467.js +1 -0
- package/dist/467.js.map +1 -0
- package/dist/574.js +1 -1
- package/dist/642.js.map +1 -1
- package/dist/{780.js → 769.js} +1 -1
- package/dist/769.js.map +1 -0
- package/dist/793.js +1 -1
- package/dist/93.js +1 -0
- package/dist/93.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 +87 -15
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/index.ts +21 -0
- package/src/routes.json +33 -19
- package/src/stock-items/add-stock-item/transactions/transactions.resource.tsx +5 -1
- package/src/stock-locations/stock-locations-table.component.tsx +1 -1
- package/src/stock-lookups/stock-lookups.resource.ts +1 -1
- package/src/stock-reports/generate-report/create-stock-report.scss +15 -16
- package/src/stock-reports/generate-report/{create-stock-report.component.tsx → create-stock-report.workspace.tsx} +29 -18
- package/src/stock-reports/report-list/new-report-button.component.tsx +5 -4
- package/src/stock-sources/add-stock-source-button.component.tsx +6 -5
- package/src/stock-sources/add-stock-sources/add-stock-sources.scss +24 -0
- package/src/stock-sources/add-stock-sources/add-stock-sources.test.tsx +68 -39
- package/src/stock-sources/add-stock-sources/{add-stock-sources.component.tsx → add-stock-sources.workspace.tsx} +65 -58
- package/src/stock-sources/edit-stock-source/edit-stock-source.component.tsx +7 -5
- package/src/stock-user-role-scopes/add-stock-user-role-scope-button.component.tsx +7 -6
- package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.scss +48 -0
- package/src/stock-user-role-scopes/add-stock-user-scope/{add-stock-user-role-scope.component.tsx → add-stock-user-role-scope.workspace.tsx} +188 -208
- package/src/stock-user-role-scopes/edit-stock-user-scope/edit-stock-user-scope-action-menu.component.tsx +7 -5
- package/src/stock-user-role-scopes/stock-user-role-scopes-items-table.component.tsx +20 -19
- package/src/stock-user-role-scopes/stock-user-role-scopes.scss +4 -0
- package/translations/en.json +2 -2
- package/dist/780.js.map +0 -1
- /package/src/stock-locations/{add-locations-form.component.tsx → add-locations-form.workspace.tsx} +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(165),t.e(672),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(165),t.e(672),t.e(769)]).then((()=>()=>t(4769)))},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","6.3.1-pre.2951",(()=>Promise.all([y.e(793),y.e(672)]).then((()=>()=>y(1793))))),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)))))),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))))),3775:()=>d("default","@openmrs/esm-framework",[1,6],(()=>y.e(793).then((()=>()=>y(1793)))))},v={672:[1672],769:[1914,2653,3397,3775]},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=_})();
|
@@ -76,6 +76,54 @@
|
|
76
76
|
"hash": "bf5e0110b574d273",
|
77
77
|
"childrenByOrder": {}
|
78
78
|
},
|
79
|
+
{
|
80
|
+
"rendered": true,
|
81
|
+
"initial": false,
|
82
|
+
"entry": false,
|
83
|
+
"recorded": false,
|
84
|
+
"size": 42269,
|
85
|
+
"sizes": {
|
86
|
+
"javascript": 42269
|
87
|
+
},
|
88
|
+
"names": [],
|
89
|
+
"idHints": [],
|
90
|
+
"runtime": [
|
91
|
+
"@openmrs/esm-stock-management-app",
|
92
|
+
"main"
|
93
|
+
],
|
94
|
+
"files": [
|
95
|
+
"93.js"
|
96
|
+
],
|
97
|
+
"auxiliaryFiles": [
|
98
|
+
"93.js.map"
|
99
|
+
],
|
100
|
+
"hash": "c3b9b6f7a3fd9c16",
|
101
|
+
"childrenByOrder": {}
|
102
|
+
},
|
103
|
+
{
|
104
|
+
"rendered": true,
|
105
|
+
"initial": false,
|
106
|
+
"entry": false,
|
107
|
+
"recorded": false,
|
108
|
+
"size": 66887,
|
109
|
+
"sizes": {
|
110
|
+
"javascript": 66887
|
111
|
+
},
|
112
|
+
"names": [],
|
113
|
+
"idHints": [],
|
114
|
+
"runtime": [
|
115
|
+
"@openmrs/esm-stock-management-app",
|
116
|
+
"main"
|
117
|
+
],
|
118
|
+
"files": [
|
119
|
+
"119.js"
|
120
|
+
],
|
121
|
+
"auxiliaryFiles": [
|
122
|
+
"119.js.map"
|
123
|
+
],
|
124
|
+
"hash": "90d89a5df2e91ec0",
|
125
|
+
"childrenByOrder": {}
|
126
|
+
},
|
79
127
|
{
|
80
128
|
"rendered": true,
|
81
129
|
"initial": true,
|
@@ -100,7 +148,7 @@
|
|
100
148
|
"auxiliaryFiles": [
|
101
149
|
"openmrs-esm-stock-management-app.js.map"
|
102
150
|
],
|
103
|
-
"hash": "
|
151
|
+
"hash": "34ffe0f627e82f42",
|
104
152
|
"childrenByOrder": {}
|
105
153
|
},
|
106
154
|
{
|
@@ -158,10 +206,10 @@
|
|
158
206
|
"initial": true,
|
159
207
|
"entry": true,
|
160
208
|
"recorded": false,
|
161
|
-
"size":
|
209
|
+
"size": 5632387,
|
162
210
|
"sizes": {
|
163
211
|
"consume-shared": 210,
|
164
|
-
"javascript":
|
212
|
+
"javascript": 5610856,
|
165
213
|
"share-init": 210,
|
166
214
|
"runtime": 21111
|
167
215
|
},
|
@@ -178,7 +226,7 @@
|
|
178
226
|
"auxiliaryFiles": [
|
179
227
|
"main.js.map"
|
180
228
|
],
|
181
|
-
"hash": "
|
229
|
+
"hash": "f858faf0fc1c4089",
|
182
230
|
"childrenByOrder": {}
|
183
231
|
},
|
184
232
|
{
|
@@ -295,6 +343,30 @@
|
|
295
343
|
"hash": "121c4ef0e9fc4b30",
|
296
344
|
"childrenByOrder": {}
|
297
345
|
},
|
346
|
+
{
|
347
|
+
"rendered": true,
|
348
|
+
"initial": false,
|
349
|
+
"entry": false,
|
350
|
+
"recorded": false,
|
351
|
+
"size": 58795,
|
352
|
+
"sizes": {
|
353
|
+
"javascript": 58795
|
354
|
+
},
|
355
|
+
"names": [],
|
356
|
+
"idHints": [],
|
357
|
+
"runtime": [
|
358
|
+
"@openmrs/esm-stock-management-app",
|
359
|
+
"main"
|
360
|
+
],
|
361
|
+
"files": [
|
362
|
+
"467.js"
|
363
|
+
],
|
364
|
+
"auxiliaryFiles": [
|
365
|
+
"467.js.map"
|
366
|
+
],
|
367
|
+
"hash": "a8bcfdf315ff33ab",
|
368
|
+
"childrenByOrder": {}
|
369
|
+
},
|
298
370
|
{
|
299
371
|
"rendered": true,
|
300
372
|
"initial": false,
|
@@ -324,9 +396,9 @@
|
|
324
396
|
"initial": false,
|
325
397
|
"entry": false,
|
326
398
|
"recorded": false,
|
327
|
-
"size":
|
399
|
+
"size": 13133,
|
328
400
|
"sizes": {
|
329
|
-
"javascript":
|
401
|
+
"javascript": 13133
|
330
402
|
},
|
331
403
|
"names": [],
|
332
404
|
"idHints": [],
|
@@ -338,7 +410,7 @@
|
|
338
410
|
"574.js"
|
339
411
|
],
|
340
412
|
"auxiliaryFiles": [],
|
341
|
-
"hash": "
|
413
|
+
"hash": "71575f86cc91a282",
|
342
414
|
"childrenByOrder": {}
|
343
415
|
},
|
344
416
|
{
|
@@ -362,7 +434,7 @@
|
|
362
434
|
"auxiliaryFiles": [
|
363
435
|
"606.js.map"
|
364
436
|
],
|
365
|
-
"hash": "
|
437
|
+
"hash": "cf676d297ed68b42",
|
366
438
|
"childrenByOrder": {}
|
367
439
|
},
|
368
440
|
{
|
@@ -434,7 +506,7 @@
|
|
434
506
|
"auxiliaryFiles": [
|
435
507
|
"642.js.map"
|
436
508
|
],
|
437
|
-
"hash": "
|
509
|
+
"hash": "64dbfc5dec65ec6e",
|
438
510
|
"childrenByOrder": {}
|
439
511
|
},
|
440
512
|
{
|
@@ -557,9 +629,9 @@
|
|
557
629
|
"initial": false,
|
558
630
|
"entry": false,
|
559
631
|
"recorded": false,
|
560
|
-
"size":
|
632
|
+
"size": 1233995,
|
561
633
|
"sizes": {
|
562
|
-
"javascript":
|
634
|
+
"javascript": 1233827,
|
563
635
|
"consume-shared": 168
|
564
636
|
},
|
565
637
|
"names": [],
|
@@ -568,12 +640,12 @@
|
|
568
640
|
"@openmrs/esm-stock-management-app"
|
569
641
|
],
|
570
642
|
"files": [
|
571
|
-
"
|
643
|
+
"769.js"
|
572
644
|
],
|
573
645
|
"auxiliaryFiles": [
|
574
|
-
"
|
646
|
+
"769.js.map"
|
575
647
|
],
|
576
|
-
"hash": "
|
648
|
+
"hash": "18b570b419bf5239",
|
577
649
|
"childrenByOrder": {}
|
578
650
|
},
|
579
651
|
{
|
@@ -622,7 +694,7 @@
|
|
622
694
|
"auxiliaryFiles": [
|
623
695
|
"793.js.map"
|
624
696
|
],
|
625
|
-
"hash": "
|
697
|
+
"hash": "7079af825a7748f6",
|
626
698
|
"childrenByOrder": {}
|
627
699
|
},
|
628
700
|
{
|
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":"
|
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":"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-management-app-menu-item","component":"stockManagementAppMenuItem","slot":"app-menu-item-slot","meta":{"name":" Stock Management"}},{"name":"delete-packaging-unit-button","component":"deletePackagingUnitButton"}],"modals":[{"name":"delete-stock-modal","component":"deleteStockModal"},{"name":"delete-stock-user-scope-modal","component":"deleteUserScopeModal"},{"name":"delete-stock-rule-modal","component":"deleteStockRuleModal"},{"name":"delete-packaging-unit-modal","component":"deletePackagingUnitModal"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsModal"},{"name":"stock-operation-dialog","component":"stockOperationModal"},{"name":"transactions-print-bincard-preview-modal","component":"transactionBincardPrintPreviewModal"},{"name":"transactions-print-stockcard-preview-modal","component":"transactionStockcardPrintPreviewModal"}],"workspaces":[{"name":"stock-operation-form-workspace","component":"stockOperationFormWorkspace","title":"Stock Operation","type":"form","canMaximize":true,"width":"extra-wide"},{"name":"stock-item-rules-form-workspace","component":"stockItemRulesFormWorkspace","title":"Stock Item Rules","type":"form"},{"name":"stock-item-form-workspace","component":"stockItemFormWorkspace","title":"Stock Items","type":"form","canMaximize":true,"width":"extra-wide"},{"name":"stock-sources-form-workspace","component":"stockSourcesFormWorkspace","title":"Stock Sources","type":"form","canMaximize":true,"width":"extra-wide"},{"name":"stock-location-form-workspace","component":"stockLocationsFormWorkspace","title":"Stock Locations","type":"form","canMaximize":true,"width":"extra-wide"},{"name":"stock-user-role-scopes-form-workspace","component":"stockUserScopesFormWorkspace","title":"User Role Scopes","type":"form","canMaximize":true,"width":"extra-wide"},{"name":"stock-reports-form-workspace","component":"stockReportsFormWorkspace","title":"Reports","type":"form","canMaximize":true,"width":"extra-wide"}],"pages":[{"component":"root","route":"stock-management"}],"version":"3.0.1-pre.840"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
@@ -139,6 +139,27 @@ export const stockItemRulesFormWorkspace = getAsyncLifecycle(
|
|
139
139
|
() => import('./stock-items/add-stock-item/stock-item-rules/add-stock-rules.component'),
|
140
140
|
options,
|
141
141
|
);
|
142
|
+
|
143
|
+
export const stockSourcesFormWorkspace = getAsyncLifecycle(
|
144
|
+
() => import('./stock-sources/add-stock-sources/add-stock-sources.workspace'),
|
145
|
+
options,
|
146
|
+
);
|
147
|
+
|
148
|
+
export const stockLocationsFormWorkspace = getAsyncLifecycle(
|
149
|
+
() => import('./stock-locations/add-locations-form.workspace'),
|
150
|
+
options,
|
151
|
+
);
|
152
|
+
|
153
|
+
export const stockReportsFormWorkspace = getAsyncLifecycle(
|
154
|
+
() => import('./stock-reports/generate-report/create-stock-report.workspace'),
|
155
|
+
options,
|
156
|
+
);
|
157
|
+
|
158
|
+
export const stockUserScopesFormWorkspace = getAsyncLifecycle(
|
159
|
+
() => import('./stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.workspace'),
|
160
|
+
options,
|
161
|
+
);
|
162
|
+
|
142
163
|
export function startupApp() {
|
143
164
|
defineConfigSchema(moduleName, configSchema);
|
144
165
|
}
|
package/src/routes.json
CHANGED
@@ -102,24 +102,6 @@
|
|
102
102
|
"slot": "sources-dashboard-slot",
|
103
103
|
"component": "stockSources"
|
104
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
105
|
{
|
124
106
|
"name": "reports-db-link",
|
125
107
|
"slot": "stock-page-dashboard-slot",
|
@@ -230,6 +212,38 @@
|
|
230
212
|
"type": "form",
|
231
213
|
"canMaximize": true,
|
232
214
|
"width": "extra-wide"
|
215
|
+
},
|
216
|
+
{
|
217
|
+
"name" : "stock-sources-form-workspace",
|
218
|
+
"component": "stockSourcesFormWorkspace",
|
219
|
+
"title": "Stock Sources",
|
220
|
+
"type": "form",
|
221
|
+
"canMaximize": true,
|
222
|
+
"width": "extra-wide"
|
223
|
+
},
|
224
|
+
{
|
225
|
+
"name" : "stock-location-form-workspace",
|
226
|
+
"component": "stockLocationsFormWorkspace",
|
227
|
+
"title": "Stock Locations",
|
228
|
+
"type": "form",
|
229
|
+
"canMaximize": true,
|
230
|
+
"width": "extra-wide"
|
231
|
+
},
|
232
|
+
{
|
233
|
+
"name" : "stock-user-role-scopes-form-workspace",
|
234
|
+
"component": "stockUserScopesFormWorkspace",
|
235
|
+
"title": "User Role Scopes",
|
236
|
+
"type": "form",
|
237
|
+
"canMaximize": true,
|
238
|
+
"width": "extra-wide"
|
239
|
+
},
|
240
|
+
{
|
241
|
+
"name" : "stock-reports-form-workspace",
|
242
|
+
"component": "stockReportsFormWorkspace",
|
243
|
+
"title": "Reports",
|
244
|
+
"type": "form",
|
245
|
+
"canMaximize": true,
|
246
|
+
"width": "extra-wide"
|
233
247
|
}
|
234
248
|
],
|
235
249
|
"pages": [
|
@@ -238,4 +252,4 @@
|
|
238
252
|
"route": "stock-management"
|
239
253
|
}
|
240
254
|
]
|
241
|
-
}
|
255
|
+
}
|
@@ -1,6 +1,10 @@
|
|
1
1
|
import { ResourceRepresentation } from '../../../core/api/api';
|
2
2
|
import { useEffect, useMemo, useState } from 'react';
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
type StockItemInventoryFilter,
|
5
|
+
useStockItemInventory,
|
6
|
+
useStockItemTransactions,
|
7
|
+
} from '../../stock-items.resource';
|
4
8
|
|
5
9
|
export function useStockItemsTransactions(filter?: StockItemInventoryFilter) {
|
6
10
|
const [stockItemFilter, setStockItemFilter] = useState<StockItemInventoryFilter>({
|
@@ -13,7 +13,7 @@ import { ResourceRepresentation } from '../core/api/api';
|
|
13
13
|
import DataList from '../core/components/table/table.component';
|
14
14
|
import { useTranslation } from 'react-i18next';
|
15
15
|
import { mutate } from 'swr';
|
16
|
-
import NewLocationForm from './add-locations-form.
|
16
|
+
import NewLocationForm from './add-locations-form.workspace';
|
17
17
|
import { Add } from '@carbon/react/icons';
|
18
18
|
import { handleMutate } from '../utils';
|
19
19
|
import { restBaseUrl } from '@openmrs/esm-framework';
|
@@ -2,28 +2,27 @@
|
|
2
2
|
@use '@carbon/styles/scss/type';
|
3
3
|
@use '@openmrs/esm-styleguide/src/vars' as *;
|
4
4
|
|
5
|
-
.
|
6
|
-
min-height: 15rem;
|
5
|
+
.formContainer {
|
7
6
|
display: flex;
|
8
7
|
flex-direction: column;
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
.reportButton {
|
13
|
-
padding: 1rem;
|
8
|
+
justify-content: space-between;
|
9
|
+
width: 100%;
|
10
|
+
height: 100%;
|
14
11
|
}
|
15
12
|
|
16
|
-
.
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
.button {
|
14
|
+
display: flex;
|
15
|
+
align-content: flex-start;
|
16
|
+
align-items: baseline;
|
17
|
+
min-width: 50%;
|
20
18
|
}
|
21
19
|
|
22
|
-
.
|
23
|
-
|
24
|
-
|
20
|
+
.buttonSet {
|
21
|
+
display: flex;
|
22
|
+
justify-content: space-between;
|
23
|
+
width: 100%;
|
25
24
|
}
|
26
25
|
|
27
|
-
.
|
28
|
-
padding
|
26
|
+
.body {
|
27
|
+
padding: 1rem;
|
29
28
|
}
|
@@ -12,17 +12,24 @@ import {
|
|
12
12
|
Form,
|
13
13
|
Checkbox,
|
14
14
|
NumberInput,
|
15
|
+
ButtonSet,
|
15
16
|
} from '@carbon/react';
|
16
17
|
import styles from './create-stock-report.scss';
|
17
18
|
import { useTranslation } from 'react-i18next';
|
18
|
-
import { closeOverlay } from '../../core/components/overlay/hook';
|
19
19
|
import { useReportTypes } from '../stock-reports.resource';
|
20
20
|
import { DATE_PICKER_CONTROL_FORMAT, DATE_PICKER_FORMAT, formatForDatePicker, today } from '../../constants';
|
21
21
|
import { Controller, useForm } from 'react-hook-form';
|
22
22
|
import { zodResolver } from '@hookform/resolvers/zod';
|
23
23
|
import { type StockReportSchema, reportSchema } from '../report-validation-schema';
|
24
24
|
import { useConcept, useStockTagLocations } from '../../stock-lookups/stock-lookups.resource';
|
25
|
-
import {
|
25
|
+
import {
|
26
|
+
type ConfigObject,
|
27
|
+
type DefaultWorkspaceProps,
|
28
|
+
restBaseUrl,
|
29
|
+
showSnackbar,
|
30
|
+
useConfig,
|
31
|
+
getCoreTranslation,
|
32
|
+
} from '@openmrs/esm-framework';
|
26
33
|
import { type Concept } from '../../core/api/types/concept/Concept';
|
27
34
|
import { createBatchJob } from '../../stock-batch/stock-batch.resource';
|
28
35
|
import {
|
@@ -35,9 +42,11 @@ import {
|
|
35
42
|
import { formatDisplayDate } from '../../core/utils/datetimeUtils';
|
36
43
|
import { BatchJobTypeReport } from '../../core/api/types/BatchJob';
|
37
44
|
import { handleMutate } from '../../utils';
|
38
|
-
|
45
|
+
import { Save } from '@carbon/react/icons';
|
46
|
+
|
47
|
+
type CreateReportProps = DefaultWorkspaceProps & {
|
39
48
|
model?: ReportModel;
|
40
|
-
}
|
49
|
+
};
|
41
50
|
|
42
51
|
export interface ReportModel {
|
43
52
|
reportSystemName?: string;
|
@@ -67,7 +76,7 @@ export interface ReportModel {
|
|
67
76
|
mostLeastMovingName?: string;
|
68
77
|
fullFillment?: string[];
|
69
78
|
}
|
70
|
-
const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
79
|
+
const CreateReport: React.FC<CreateReportProps> = ({ model, closeWorkspace }) => {
|
71
80
|
const { t } = useTranslation();
|
72
81
|
const { stockItemCategoryUUID } = useConfig<ConfigObject>();
|
73
82
|
|
@@ -163,7 +172,7 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
163
172
|
return <InlineLoading status="active" iconDescription="Loading" description="Loading data..." />;
|
164
173
|
}
|
165
174
|
|
166
|
-
const
|
175
|
+
const handleSave = async (report: StockReportSchema) => {
|
167
176
|
const reportSystemName = (reportTypes as any).find(
|
168
177
|
(reportType) => reportType.name === report.reportName,
|
169
178
|
)?.systemName;
|
@@ -314,7 +323,6 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
314
323
|
};
|
315
324
|
await createBatchJob(newItem)
|
316
325
|
.then((response) => {
|
317
|
-
closeOverlay();
|
318
326
|
if (response.status === 201) {
|
319
327
|
showSnackbar({
|
320
328
|
title: t('batchJob', 'Batch Job'),
|
@@ -322,12 +330,14 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
322
330
|
kind: 'success',
|
323
331
|
});
|
324
332
|
handleMutate(`${restBaseUrl}/stockmanagement/batchjob?batchJobType=Report&v=default`);
|
333
|
+
closeWorkspace();
|
325
334
|
} else {
|
326
335
|
showSnackbar({
|
327
336
|
title: t('BatchJobErrorTitle', 'Batch job'),
|
328
337
|
subtitle: t('batchJobErrorMessage', 'Error creating batch job'),
|
329
338
|
kind: 'error',
|
330
339
|
});
|
340
|
+
closeWorkspace();
|
331
341
|
}
|
332
342
|
})
|
333
343
|
.catch(() => {
|
@@ -336,6 +346,7 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
336
346
|
subtitle: t('batchJobErrorMessage', 'Error creating batch job'),
|
337
347
|
kind: 'error',
|
338
348
|
});
|
349
|
+
closeWorkspace();
|
339
350
|
});
|
340
351
|
hideSplash = false;
|
341
352
|
} finally {
|
@@ -344,9 +355,6 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
344
355
|
}
|
345
356
|
}
|
346
357
|
};
|
347
|
-
const onError = (error: any) => {
|
348
|
-
console.error(error);
|
349
|
-
};
|
350
358
|
const getReportParameter = (
|
351
359
|
name: string,
|
352
360
|
value: string,
|
@@ -358,8 +366,8 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
358
366
|
};
|
359
367
|
|
360
368
|
return (
|
361
|
-
<
|
362
|
-
<div className={styles.
|
369
|
+
<div className={styles.formContainer}>
|
370
|
+
<div className={styles.body}>
|
363
371
|
<>
|
364
372
|
<span>{t('reportName', 'Report')}</span>
|
365
373
|
<Controller
|
@@ -631,13 +639,16 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
631
639
|
/>
|
632
640
|
)}
|
633
641
|
</div>
|
634
|
-
|
635
|
-
|
636
|
-
|
642
|
+
|
643
|
+
<ButtonSet className={styles.buttonSet}>
|
644
|
+
<Button kind="secondary" onClick={closeWorkspace} className={styles.button}>
|
645
|
+
{getCoreTranslation('cancel', 'Cancel')}
|
637
646
|
</Button>
|
638
|
-
<Button type="submit"
|
639
|
-
|
640
|
-
|
647
|
+
<Button type="submit" className={styles.button} onClick={handleSave}>
|
648
|
+
{getCoreTranslation('save', 'Save')}
|
649
|
+
</Button>
|
650
|
+
</ButtonSet>
|
651
|
+
</div>
|
641
652
|
);
|
642
653
|
};
|
643
654
|
|
@@ -1,15 +1,16 @@
|
|
1
1
|
import { Button } from '@carbon/react';
|
2
2
|
import React, { useCallback } from 'react';
|
3
3
|
import { useTranslation } from 'react-i18next';
|
4
|
-
import
|
5
|
-
import { launchOverlay } from '../../core/components/overlay/hook';
|
4
|
+
import { launchWorkspace } from '@openmrs/esm-framework';
|
6
5
|
|
7
6
|
const NewReportActionButton: React.FC = () => {
|
8
7
|
const { t } = useTranslation();
|
9
8
|
|
10
9
|
const handleClick = useCallback(() => {
|
11
|
-
|
12
|
-
|
10
|
+
launchWorkspace('stock-reports-form-workspace', {
|
11
|
+
workspaceTitle: t('newReport', 'New Report'),
|
12
|
+
});
|
13
|
+
}, [t]);
|
13
14
|
|
14
15
|
return (
|
15
16
|
<Button onClick={handleClick} size="md" kind="primary">
|
@@ -1,19 +1,20 @@
|
|
1
1
|
import { Button } from '@carbon/react';
|
2
2
|
import React, { useCallback } from 'react';
|
3
3
|
import { useTranslation } from 'react-i18next';
|
4
|
-
import {
|
5
|
-
import StockSourcesAddOrUpdate from './add-stock-sources/add-stock-sources.component';
|
4
|
+
import { launchWorkspace } from '@openmrs/esm-framework';
|
6
5
|
|
7
6
|
const AddStockSourceActionButton: React.FC = () => {
|
8
7
|
const { t } = useTranslation();
|
9
8
|
|
10
9
|
const handleClick = useCallback(() => {
|
11
|
-
|
12
|
-
|
10
|
+
launchWorkspace('stock-sources-form-workspace', {
|
11
|
+
workspaceTitle: t('addNewStockSource', 'Add new source'),
|
12
|
+
});
|
13
|
+
}, [t]);
|
13
14
|
|
14
15
|
return (
|
15
16
|
<Button onClick={handleClick} size="md" kind="primary">
|
16
|
-
{t('addNewStockSource', 'Add
|
17
|
+
{t('addNewStockSource', 'Add new source')}
|
17
18
|
</Button>
|
18
19
|
);
|
19
20
|
};
|
@@ -15,3 +15,27 @@
|
|
15
15
|
.modalBody {
|
16
16
|
padding-bottom: layout.$spacing-05;
|
17
17
|
}
|
18
|
+
.formContainer {
|
19
|
+
display: flex;
|
20
|
+
flex-direction: column;
|
21
|
+
justify-content: space-between;
|
22
|
+
width: 100%;
|
23
|
+
height: 100%;
|
24
|
+
}
|
25
|
+
|
26
|
+
.button {
|
27
|
+
display: flex;
|
28
|
+
align-content: flex-start;
|
29
|
+
align-items: baseline;
|
30
|
+
min-width: 50%;
|
31
|
+
}
|
32
|
+
|
33
|
+
.buttonSet {
|
34
|
+
display: flex;
|
35
|
+
justify-content: space-between;
|
36
|
+
width: 100%;
|
37
|
+
}
|
38
|
+
|
39
|
+
.body {
|
40
|
+
padding: 1rem;
|
41
|
+
}
|