@openmrs/esm-stock-management-app 1.0.1-pre.702 → 1.0.1-pre.710
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/627.js +1 -1
- package/dist/627.js.map +1 -1
- package/dist/973.js +1 -1
- package/dist/973.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 +9 -9
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/stock-items/add-bulk-stock-item/stock-items-bulk-import.component.tsx +1 -1
- package/src/stock-items/add-bulk-stock-item/stock-items-bulk-import.test.tsx +105 -0
- package/src/stock-operations/add-stock-operation/validationSchema.ts +13 -0
package/dist/627.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";(globalThis.webpackChunk_openmrs_esm_stock_management_app=globalThis.webpackChunk_openmrs_esm_stock_management_app||[]).push([[627],{7627:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var r=n(1672),o=n.n(r),l=n(3397),a=n(2167),i=n(7248);function c(e,t,n,r,o,l,a){try{var i=e[l](a),c=i.value}catch(e){return void n(e)}i.done?t(c):Promise.resolve(c).then(r,o)}function u(){var e;return e=function(e){var t;return function(e,t){var n,r,o,l,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function i(l){return function(i){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,i])}}}(this,(function(n){return t=new AbortController,[2,(0,i.openmrsFetch)("".concat(i.restBaseUrl,"/stockmanagement/stockitemimport"),{method:"POST",signal:t.signal,body:e})]}))},u=function(){var t=this,n=arguments;return new Promise((function(r,o){var l=e.apply(t,n);function a(e){c(l,r,o,a,i,"next",e)}function i(e){c(l,r,o,a,i,"throw",e)}a(void 0)}))},u.apply(this,arguments)}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const f=function(e){var t,n,c=e.closeModal,f=(0,l.useTranslation)().t,p=(t=(0,r.useState)(),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,l=[],a=!0,i=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(i)throw o}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),m=p[0],d=p[1];return o().createElement("div",null,o().createElement(a.l09,null,o().createElement(a.xBx,{closeModal:c,title:f("importStockItems","Import Stock Items")}),o().createElement(a.fef,null,o().createElement(a.bAu,{accept:[".csv"],multiple:!1,name:"file",buttonLabel:"Select file",labelDescription:"Only .csv files at 2mb or less",filenameStatus:"edit",labelTitle:"",size:"
|
1
|
+
"use strict";(globalThis.webpackChunk_openmrs_esm_stock_management_app=globalThis.webpackChunk_openmrs_esm_stock_management_app||[]).push([[627],{7627:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var r=n(1672),o=n.n(r),l=n(3397),a=n(2167),i=n(7248);function c(e,t,n,r,o,l,a){try{var i=e[l](a),c=i.value}catch(e){return void n(e)}i.done?t(c):Promise.resolve(c).then(r,o)}function u(){var e;return e=function(e){var t;return function(e,t){var n,r,o,l,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function i(l){return function(i){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,i])}}}(this,(function(n){return t=new AbortController,[2,(0,i.openmrsFetch)("".concat(i.restBaseUrl,"/stockmanagement/stockitemimport"),{method:"POST",signal:t.signal,body:e})]}))},u=function(){var t=this,n=arguments;return new Promise((function(r,o){var l=e.apply(t,n);function a(e){c(l,r,o,a,i,"next",e)}function i(e){c(l,r,o,a,i,"throw",e)}a(void 0)}))},u.apply(this,arguments)}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const f=function(e){var t,n,c=e.closeModal,f=(0,l.useTranslation)().t,p=(t=(0,r.useState)(),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,l=[],a=!0,i=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(l.push(r.value),!t||l.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(i)throw o}}return l}}(t,n)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),m=p[0],d=p[1];return o().createElement("div",null,o().createElement(a.l09,null,o().createElement(a.xBx,{closeModal:c,title:f("importStockItems","Import Stock Items")}),o().createElement(a.fef,null,o().createElement(a.bAu,{accept:[".csv"],multiple:!1,name:"file",buttonLabel:"Select file",labelDescription:"Only .csv files at 2mb or less",filenameStatus:"edit",labelTitle:"",size:"sm",onChange:function(e){var t,n,r=null==e||null===(n=e.target)||void 0===n||null===(t=n.files)||void 0===t?void 0:t[0];r?d(r):e.preventDefault()}})),o().createElement(a.mzw,null,o().createElement(a.zxk,{kind:"secondary",onClick:c},f("cancel","Cancel")),o().createElement(a.zxk,{type:"button",onClick:function(){if(m){var e=new FormData;m&&(e.append("file",m,"Import_Stock_Items.csv"),e.append("hasHeader","true")),function(e){return u.apply(this,arguments)}(e).then((function(){(0,i.showSnackbar)({isLowContrast:!0,title:f("rejectOrder","Uploaded Order"),kind:"success",subtitle:f("SuccessfullyUploadedStockItem","You have successfully uploaded stock items")}),c()}),(function(e){(0,i.showSnackbar)({title:f("errorUploadingItems","An error occurred uploading stock items"),kind:"error",isLowContrast:!0,subtitle:null==e?void 0:e.message})}))}}},f("uploadStockItems","Upload StockItems")))))}}}]);
|
package/dist/627.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"627.js","mappings":"sXAEsBA,I,eAAf,SAAgCC,G,IAC/BC,E,8jCAEN,OAFMA,EAAkB,IAAIC,gBAErB,C,GAAAC,EAAAA,EAAAA,cAAa,GAAe,OAAZC,EAAAA,YAAY,oCAAmC,CACpEC,OAAQ,OAIRC,OAAQL,EAAgBK,OACxBN,KAAMA,I,GAEV,EAXsBD,E,8KAAAA,EAAAA,MAAAA,KAAAA,U,2GCiFtB,QAzE4D,Y,QAAGQ,EAAAA,EAAAA,WACvD,GAAQC,EAAAA,EAAAA,kBAANC,EACgCC,G,GAAAA,EAAAA,EAAAA,Y,EAAQA,E,+zBAAzCC,EAAiCD,EAAAA,GAAnBE,EAAmBF,EAAAA,GAyCxC,OACE,kBAACG,MAAAA,KACC,kBAACC,EAAAA,IAAIA,KACH,kBAACC,EAAAA,IAAWA,CAACR,WAAYA,EAAYS,MAAOP,EAAE,mBAAoB,wBAClE,kBAACQ,EAAAA,IAASA,KACR,kBAACC,EAAAA,IAAYA,CACXC,OAAQ,CAAC,QACTC,UAAU,EACVC,KAAM,OACNC,YAAY,cACZC,iBAAiB,iCACjBC,eAAe,OACfC,WAAW,GACXC,KAAK,
|
1
|
+
{"version":3,"file":"627.js","mappings":"sXAEsBA,I,eAAf,SAAgCC,G,IAC/BC,E,8jCAEN,OAFMA,EAAkB,IAA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CACXC,eAAe,EACf3B,MAAOP,EAAE,cAAe,kBACxB0B,KAAM,UACNS,SAAUnC,EAAE,gCAAkC,gDAEhDF,GACF,IACA,SAACsC,IACCH,EAAAA,EAAAA,cAAa,CACX1B,MAAOP,EAAE,sBAAuB,2CAChC0B,KAAM,QACNQ,eAAe,EACfC,SAAUC,aAAAA,EAAAA,EAAKC,SAEnB,GAvBF,CAyBF,GAiCWrC,EAAE,mBAAoB,wBAMnC,C","sources":["webpack://@openmrs/esm-stock-management-app/./src/stock-items/add-bulk-stock-item/stock-items-bulk-import.resource.ts","webpack://@openmrs/esm-stock-management-app/./src/stock-items/add-bulk-stock-item/stock-items-bulk-import.component.tsx"],"names":["UploadStockItems","body","abortController","AbortController","openmrsFetch","restBaseUrl","method","signal","closeModal","useTranslation","t","useState","selectedFile","setSelectedFile","div","Form","ModalHeader","title","ModalBody","FileUploader","accept","multiple","name","buttonLabel","labelDescription","filenameStatus","labelTitle","size","onChange","event","file","target","files","preventDefault","ModalFooter","Button","kind","onClick","type","formData","FormData","append","then","showSnackbar","isLowContrast","subtitle","err","message"],"sourceRoot":""}
|