marketplacepos 2.7.3 → 2.7.5
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/Marketplace/25.b70d86f301c02577.js +1 -0
- package/Marketplace/360.35d9782330672e00.js +1 -0
- package/Marketplace/369.19d90a301af16090.js +1 -0
- package/Marketplace/392.f4537160149f627a.js +1 -0
- package/Marketplace/397.bd20bd794e4994a8.js +1 -0
- package/Marketplace/3rdpartylicenses.txt +0 -50
- package/Marketplace/512.2796526d3f4c83f5.js +1 -0
- package/Marketplace/516.23780ce40d15b408.js +1 -0
- package/Marketplace/587.69b186b4d297a852.js +1 -0
- package/Marketplace/61.868e35095821a091.js +1 -0
- package/Marketplace/616.b7e1ec6933570169.js +1 -0
- package/Marketplace/643.7de8ebbdb10aeed8.js +1 -0
- package/Marketplace/717.26634e93ca9b60ed.js +1 -0
- package/Marketplace/72.b0c5b137e38d6dbc.js +1 -0
- package/Marketplace/833.552ef7db8cfcde45.js +1 -0
- package/Marketplace/859.b43bda3adda95fa3.js +1 -0
- package/Marketplace/863.67b36200543c45b1.js +1 -0
- package/Marketplace/874.8531eff61a70fef4.js +1 -0
- package/Marketplace/877.460b82caffdbeb26.js +1 -0
- package/Marketplace/913.08c7bf72f6b8e4f8.js +1 -0
- package/Marketplace/993.f25cf4b5757f3e91.js +1 -0
- package/Marketplace/997.6b3f954f35ff3ac0.js +1 -0
- package/Marketplace/common.1ae3037cc1f5de4e.js +1 -0
- package/Marketplace/index.html +2 -2
- package/Marketplace/main.3c2864f277c98596.js +1 -0
- package/Marketplace/runtime.2751fd0e9a5e9d78.js +1 -0
- package/Marketplace/{styles.ca007450064f7ae0.css → styles.bd36b2077413d718.css} +1 -1
- package/package.json +1 -1
- package/Marketplace/174.ef0e2b8b4c9d2b0b.js +0 -1
- package/Marketplace/25.43ab1ee524b9049a.js +0 -1
- package/Marketplace/291.779ede87479fb9b2.js +0 -1
- package/Marketplace/360.45dba871a275bde4.js +0 -1
- package/Marketplace/369.fe9dd78b5ae1f834.js +0 -1
- package/Marketplace/397.5668d07ae2910130.js +0 -1
- package/Marketplace/512.8bb0df7db698606b.js +0 -1
- package/Marketplace/516.6cbc60a45960d8fd.js +0 -1
- package/Marketplace/587.b913510ac1ecfe12.js +0 -1
- package/Marketplace/61.b5326b8a8507ca2b.js +0 -1
- package/Marketplace/616.ce2eff13bf85dd2a.js +0 -1
- package/Marketplace/628.161d18d5f92f87c9.js +0 -1
- package/Marketplace/643.cee753340fd82dfa.js +0 -1
- package/Marketplace/717.b70435564cbfa38c.js +0 -1
- package/Marketplace/72.23a9b1a59cf7bfca.js +0 -1
- package/Marketplace/796.f712080a257b33c0.js +0 -1
- package/Marketplace/863.73daa64a1cf098b8.js +0 -1
- package/Marketplace/874.23cc68e9ff331b03.js +0 -1
- package/Marketplace/913.c2ffbc12dd99b85d.js +0 -1
- package/Marketplace/997.c2b107d851cf971c.js +0 -1
- package/Marketplace/common.8f5889e94b19f645.js +0 -1
- package/Marketplace/main.f4b54c0122a625bf.js +0 -1
- package/Marketplace/runtime.aa1e68d995bcf102.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[512],{5512:(v,p,o)=>{o.r(p),o.d(p,{LogisticModule:()=>a});var d=o(6895),m=o(6806),f=o(3154),t=o(4650),C=o(1318),L=o(7185),c=o(4006),u=o(7481),h=o(8796);function T(i,e){if(1&i&&(t.TgZ(0,"span",14),t._UZ(1,"img",15),t.qZA(),t._uU(2)),2&i){const n=e.item,s=t.oxw();t.xp6(1),t.Q6J("src",s.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.hij(" ",n.Name," ")}}function Z(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA(),t.TgZ(7,"td")(8,"input",16),t.NdJ("ngModelChange",function(g){const b=t.CHM(n).$implicit;return t.KtG(b.ProductSKU=g)}),t.qZA()()()}if(2&i){const n=e.$implicit;t.xp6(2),t.Oqu(n.Name),t.xp6(2),t.Oqu(n.Service),t.xp6(2),t.Oqu(n.Type),t.xp6(2),t.Q6J("ngModel",n.ProductSKU)}}class r{constructor(e,n){this.http=e,this.toastr=n,this.filter={ChannelID:""},this.pageData={Title:"Logistic",Nav:[]},this.LoaderChannel()}ngOnInit(){}Validate(){for(let e of this.list)void 0===this.dataold.find(s=>s.ProductSKU==e.ProductSKU&&s.Name==e.Name)&&(e.IsChange=!0);return Promise.resolve(this.list)}Submit(){this.Validate().then(e=>{this.http.post("/api/Logistic/Submit",this.list).subscribe(n=>{this.toastr.success("Success","Update Complete!",{timeOut:5e3,enableHtml:!0}),this.Get()})})}LoaderChannel(){this.http.post("/api/Logistic/Load",{}).subscribe(e=>{this.Channel=e.Options.Channel,this.filter=e.Filter,this.Name=this.Channel[0].Name,this.Get()})}Get(){this.dataold=[],this.http.post("/api/Logistic/Get",this.filter).subscribe(e=>{let n=this.Channel.find(s=>s.ID==this.filter.ChannelID);null!=n&&(this.Name=n.Name),this.list=e,this.dataold=JSON.parse(JSON.stringify(this.list))})}getChannelLogo(e){return f.g.getChannelLogoByTypeId(e)}}r.\u0275fac=function(e){return new(e||r)(t.Y36(C.O),t.Y36(L._W))},r.\u0275cmp=t.Xpm({type:r,selectors:[["app-logistic"]],decls:29,vars:6,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"headerTitle","hideSearchDropdown","onSubmit"],["container",""],[1,"mb-3","fw-normal"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],["type","text","placeholder","SKU",1,"form-control","w-50",3,"ngModel","ngModelChange"]],template:function(e,n){1&e&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(){return n.Get()}),t.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h5",2),t._uU(5,"Select a Channel"),t.qZA(),t.TgZ(6,"ng-select",3),t.NdJ("ngModelChange",function(g){return n.filter.ChannelID=g}),t.YNc(7,T,3,2,"ng-template",4),t.qZA()()()(),t.TgZ(8,"actions")(9,"a",5),t.NdJ("click",function(){return n.Submit()}),t._uU(10,"Submit"),t.qZA()(),t.TgZ(11,"content")(12,"div",6)(13,"div",7)(14,"div",8)(15,"div",9)(16,"table",10)(17,"thead",11)(18,"tr",12)(19,"th"),t._uU(20,"Logistic"),t.qZA(),t.TgZ(21,"th"),t._uU(22,"Service"),t.qZA(),t.TgZ(23,"th"),t._uU(24,"Type"),t.qZA(),t.TgZ(25,"th"),t._uU(26,"SKU"),t.qZA()()(),t.TgZ(27,"tbody"),t.YNc(28,Z,9,4,"tr",13),t.qZA()()()()()()()()),2&e&&(t.Q6J("headerTitle","Logistic Courier - "+n.Name)("hideSearchDropdown",!1),t.xp6(6),t.Q6J("clearable",!0)("items",n.Channel)("ngModel",n.filter.ChannelID),t.xp6(22),t.Q6J("ngForOf",n.list))},dependencies:[d.sg,c.Fj,c.JJ,c.On,u.p,h.w9,h.ir]});const S=[{path:"",component:r}];class l{}l.\u0275fac=function(e){return new(e||l)},l.\u0275mod=t.oAB({type:l}),l.\u0275inj=t.cJS({imports:[d.ez,m.Bz.forChild(S)]});class a{}a.\u0275fac=function(e){return new(e||a)},a.\u0275mod=t.oAB({type:a}),a.\u0275inj=t.cJS({imports:[d.ez,m.Bz,l,c.u5,u.R,h.A0]})}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[516],{8231:(v,I,r)=>{r.d(I,{j:()=>S});var g=r(5412),m=r(3154),d=r(9694),C=r(6779),t=r(4650),P=r(6806),u=r(6895),D=r(4006),e=r(1948),n=r(9549),a=r(4385),o=r(3238),i=r(266),c=r(6401);function f(h,s){if(1&h&&(t.TgZ(0,"mat-option",9)(1,"div",10),t._UZ(2,"img",11),t.TgZ(3,"span"),t._uU(4),t.qZA()()()),2&h){const l=s.$implicit;t.Q6J("value",l.ID)("disabled",l.disabled),t.xp6(1),t.Q6J("matTooltip",l.disabled?"Single Product Scan disabled for this type of Channel":null),t.xp6(1),t.Q6J("src",l.Img,t.LSH),t.xp6(2),t.Oqu(l.Name)}}function M(h,s){if(1&h){const l=t.EpF();t.TgZ(0,"div")(1,"h5",12),t._uU(2,"Scan Type"),t.qZA(),t.TgZ(3,"mat-radio-group",13),t.NdJ("ngModelChange",function(_){t.CHM(l);const T=t.oxw();return t.KtG(T.filter.ScanFull=_)}),t.TgZ(4,"mat-radio-button",14),t._uU(5," Full (Include Inactive Products) "),t.qZA(),t.TgZ(6,"mat-radio-button",15),t._uU(7," Active "),t.qZA()()()}if(2&h){const l=t.oxw();t.xp6(3),t.Q6J("ngModel",l.filter.ScanFull),t.xp6(1),t.Q6J("value",!0),t.xp6(2),t.Q6J("value",!1)}}function E(h,s){if(1&h){const l=t.EpF();t.TgZ(0,"div",16)(1,"h5",3),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"mat-radio-group",17),t.NdJ("ngModelChange",function(_){t.CHM(l);const T=t.oxw();return t.KtG(T.filter.UpdatedProduct=_)}),t.TgZ(5,"mat-radio-button",18),t._uU(6," Scan All Products "),t.qZA(),t.TgZ(7,"mat-radio-button",19),t._uU(8," Scan Updated Products "),t.qZA()()()}if(2&h){const l=t.oxw();t.xp6(2),t.hij(" Last Scan: ",t.xi3(3,4,l.selectedChannel.LastSync,"dd MMMM yyyy HH:mm")," "),t.xp6(2),t.Q6J("ngModel",l.filter.UpdatedProduct),t.xp6(1),t.Q6J("value",!1),t.xp6(2),t.Q6J("value",!0)}}function O(h,s){if(1&h){const l=t.EpF();t.TgZ(0,"div",16)(1,"h5",3),t._uU(2," Scan Option "),t.qZA(),t.TgZ(3,"mat-radio-group",20),t.NdJ("ngModelChange",function(_){t.CHM(l);const T=t.oxw();return t.KtG(T.filter.Async=_)}),t.TgZ(4,"mat-radio-button",21),t._uU(5," Asynchronous (Get Notified when Complete) "),t.qZA(),t.TgZ(6,"mat-radio-button",22),t._uU(7," Synchronous (Wait until Complete) "),t.qZA()()()}if(2&h){const l=t.oxw();t.xp6(3),t.Q6J("ngModel",l.filter.Async),t.xp6(1),t.Q6J("value",!0),t.xp6(2),t.Q6J("value",!1)}}class S{constructor(s,l,p){this.dialogRef=s,this.data=l,this.router=p,this.channelType=d.x,this.disabledChannelOption=!1,this.filter={ChannelID:m.g.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=!!m.g.IsNotEmpty(l.isSingleChannel)&&this.data.isSingleChannel,this.disabledChannelOption=!m.g.IsEmpty(l.disabledChannelOption)&&this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new C.O,this.modalConfig.title="Scan Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1,1==this.channelOptions.length&&(this.filter.ChannelID=this.data.channelOptions[0].ID,this.selectedChannel=this.data.channelOptions[0])}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(s=>(s.disabled=!0,(s.TypeID==d.x.Tiktok||s.TypeID==d.x.Tokopedia||s.TypeID==d.x.Lazada)&&(s.disabled=!1),s)).sort(s=>s.disabled?1:-1))}onSelectChannel(s){let l=this.filterChannelById(s);this.selectedChannel=1==this.channelOptions.length?this.channelOptions[0]:l,this.filter.Async=!0,l&&l.TypeID==d.x.Tokopedia?(this.filter.ScanFull=!0,this.isTokopedia=!0):(this.filter.ScanFull=!1,this.isTokopedia=!1),this.iniHasScanUpdate(),this.setDefaultConfigUpdate()}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&m.g.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==d.x.ShopeeV2||this.selectedChannel.TypeID==d.x.Tiktok||this.selectedChannel.TypeID==d.x.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.hasScanUpdate=!(this.selectedChannel?.TypeID==d.x.WooCommerce||this.selectedChannel?.TypeID==d.x.KalCare||this.selectedChannel?.TypeID==d.x.None||!m.g.IsNotEmpty(this.selectedChannel?.LastSync)||this.isSingleChannel)}filterChannelById(s){let l;return this.channelOptions&&(l=this.channelOptions.find(p=>p.ID==s)),l}submit(){this.selectedChannel.TypeID==d.x.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):(this.beforeSubmit(),this.dialogRef.close(this.filter))}beforeSubmit(){this.filter.UpdatedProduct&&(this.filter.Async=!1)}isNotEmpty(s){return m.g.IsNotEmpty(s)}onClose(){this.dialogRef.close()}}S.\u0275fac=function(s){return new(s||S)(t.Y36(g.so),t.Y36(g.WI),t.Y36(P.F0))},S.\u0275cmp=t.Xpm({type:S,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content","",2,"min-height","90px"],[1,"mx-4"],[1,"mb-3","fw-normal"],["appearance","outline",1,"mat-formfield-channel"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"disabled","ngModel","ngModelChange"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],[4,"ngIf"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mb-3","fw-normal","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModel","ngModelChange"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"mt-8"],["name","ScanFull",1,"form-control","h-100","round",3,"ngModel","ngModelChange"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan only products that have been updated since the last channel scan",1,"me-5",3,"value"],["name","Async",1,"form-control","h-100","round",3,"ngModel","ngModelChange"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(s,l){1&s&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return l.submit()})("onClose",function(){return l.onClose()})("onCancel",function(){return l.onClose()}),t.TgZ(1,"div",1)(2,"div",2)(3,"h5",3),t._uU(4,"Select a Channel"),t.qZA(),t.TgZ(5,"mat-form-field",4)(6,"mat-select",5),t.NdJ("ngModelChange",function(_){return l.filter.ChannelID=_})("ngModelChange",function(_){return l.onSelectChannel(_)}),t.YNc(7,f,5,5,"mat-option",6),t.qZA()(),t.YNc(8,M,8,3,"div",7),t.YNc(9,E,9,7,"div",8),t.YNc(10,O,8,3,"div",8),t.qZA()()()),2&s&&(t.Q6J("dynamicValidated",l.isNotEmpty(l.filter.ChannelID))("config",l.modalConfig),t.xp6(6),t.Q6J("disabled",l.disabledChannelOption)("ngModel",l.filter.ChannelID),t.xp6(1),t.Q6J("ngForOf",l.channelOptions),t.xp6(1),t.Q6J("ngIf",!l.isSingleChannel&&!l.isTokopedia&&l.isNotEmpty(l.filter.ChannelID)),t.xp6(1),t.Q6J("ngIf",l.hasScanUpdate),t.xp6(1),t.Q6J("ngIf",!(null!=l.filter&&l.filter.UpdatedProduct)&&!l.isSingleChannel&&l.isNotEmpty(l.filter.ChannelID)))},dependencies:[u.sg,u.O5,D.JJ,D.On,e.VQ,e.U0,n.KE,a.gD,o.ey,i.gM,c.M,u.uU],styles:["mat-form-field.mat-formfield-channel{width:100%;height:60px}.mat-dialog-title{margin-bottom:0%;margin-left:24px}.vertical-radio{display:flex;flex-direction:column;margin:15px 0}mat-form-field.mat-formfield-channel .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:13px;padding-bottom:16px}mat-form-field.mat-formfield-channel .mat-mdc-text-field-wrapper{height:50px}mat-select.mat-select-channel{font-size:14px!important}mat-option.channel-option{font-size:14px!important}\n"],encapsulation:2})},6082:(v,I,r)=>{r.d(I,{M:()=>u});var g=r(8505),m=r(9694),d=r(3154),C=r(4650),t=r(1318),P=r(7185);class u{constructor(e,n){this.httpService=e,this.toastrService=n}loader(e=d.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:e})}filterChannelByTypeId(e,n){return e.filter(a=>-1!==n.findIndex(o=>a.TypeID==o))}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(e){return this.httpService.post("/api/product/TotalProductLive",{ID:e})}clearCacheChannel(e){return this.httpService.post("/api/Channel/ClearCacheChannel",{ID:e})}uploadSingleProduct(e,n){return this.httpService.post("api/product/UploadMultipleChannel",{Channel:n,Products:e})}uploadMultipleProduct(e,n){return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",{Channel:n,Products:e})}scanSingle(e,n){return this.httpService.post("/api/product/ScanSingle",{ID:e,SKU:n})}scanNotInChannel(e){return this.httpService.post("/api/product/ScanNotinChannel",{ID:e})}findAllSoldInChannel(e){return this.httpService.post("/api/product/GetSoldInChannel",e)}scanAll(e,n,a,o=!1){return this.httpService.post("/api/product/ScanOptimized",{ID:e,ScanFull:n,UpdatedProduct:a,Async:o})}scanCompareToPos(e){return this.httpService.post("/api/product/CompareMarketplaceToPOS",e)}getVariantCodesProduct(e){return e.Variants.map(a=>a.Code)}downloadMultipleProduct(e){let n=e.map(a=>({ChannelItemID:a.ChannelItemID,ChannelID:a.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",n).pipe((0,g.b)(a=>{this.toastrService.success(`${a.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(e){return this.httpService.post("/api/product/DownloadProductFromChannel",{ChannelItemID:e.ChannelItemID,ChannelID:e.ChannelID}).pipe((0,g.b)(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(e=[]){let n=[];return e.forEach(a=>{a.Variants.forEach(o=>{n=[...n,o.Code]})}),n}filterUnselectedChannel(e,n){let o,a=[];if(e.forEach(i=>{a=[...a,...i.Channel]}),a&&0!=a.length){let i=[];o=n.filter(c=>(i=a.filter(f=>f.ChannelID==c.ID),i.length!==e.length))}else o=n;return o}findChannelById(e,n){return n.find(a=>a.ID==e)}sortChannel(e=[]){return e.sort((n,a)=>n.TypeID<a.TypeID?1:n.TypeID===a.TypeID?0:-1)}hasSelection(e=[]){return this.selectedProduct(e).length>0}selectedProduct(e=[]){return e.filter(n=>n.selected)}hasSelectionVariant(e){return this.selectedVariantProduct(e).length>0}selectedVariantProduct(e){let n=[];return e.forEach(a=>{n=[...n,...null!=a.Variants?a.Variants.filter(o=>o.selected):""]}),n}getChannelProduct(e){const n=e.Variants;let a=[];for(let o of n)if(null!=o.Channel)for(let i of o.Channel)0==a.filter(c=>c.ChannelID==i.ChannelID).length&&a.push(i);return this.sortChannel(a)}successToastrScanAllProduct(e,n,a){if(a){const o=e?.NotInPOS?.Product?e?.NotInPOS?.Product:0,i=e?.InChannel?.Product?e?.InChannel?.Product:0;this.toastrService.success(`\n ${o+i} found in ${n.Name} </br>\n (${i} In POS + ${o} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastrService.success(`${e.InChannel?e.InChannel.Product:0} product updates in ${n.Name} </br> \n since ${e.LastUpdate}`,"Scan Complete!",{enableHtml:!0})}checkProductHasScanButton(e,n){let a,o;return e.map(i=>(i.Channel=this.getChannelProduct(i),a=this.filterUnselectedChannel([i],n),o=this.filterChannelByTypeId(a,[m.x.Tiktok,m.x.Tokopedia]),i.hasScan=o.length>0,i))}checkProductHasUploadBtn(e,n){let a;return e.map(o=>(o.Channel=this.getChannelProduct(o),a=this.filterUnselectedChannel([o],n),o.hasUpload=a.length>0,o))}showToastrSuccessUploadMultiple(e,n){let a=e.filter(c=>0==c.Status),o=e.filter(c=>1==c.Status),i=this.generateToastrMessage(a,o,n);this.toastrService.success(i.message,"Success",{enableHtml:!0})}showToastErrorUploadMultiple(e,n){let a=e?.error?.Message.filter(c=>0==c.Status),o=e?.error?.Message.filter(c=>1==c.Status),i=this.generateToastrMessage(a,o,n);"WARNING"==i.status?this.toastrService.warning(i.message,"Warning!",{enableHtml:!0}):this.toastrService.error(i.message,`Error - ${e.status}`,{enableHtml:!0})}generateToastrMessage(e,n,a){let i,o="";return 0==e.length&&n.length>0?(i="SUCCESS",o=this.createSuccessResponse(n,a)):e.length>0&&0==n.length?(i="ERROR",o=this.createErrResponse(e,a)):(i="WARNING",o=`${this.createSuccessResponse(n,a)} ${this.createErrResponse(e,a)}`),o=`<ol>${o}</ol>`,{status:i,message:o}}createErrResponse(e,n){let a="";return e.forEach((o,i)=>{a+=`<li><b>${o.Response}</b> for ${n.Name} in ${o.Name}</li>`}),a}createSuccessResponse(e,n){let a="";return e.forEach((o,i)=>{a+=`<li>Product ${n.Name} was <b>successfully</b> uploaded to ${o.Name}</li>`}),a}getHostName(){if(d.g.IsEmpty(this.hostName)){const e=localStorage.getItem("Authorization");this.hostName=JSON.parse(e)?.Host}return this.hostName}}u.\u0275fac=function(e){return new(e||u)(C.LFG(t.O),C.LFG(P._W))},u.\u0275prov=C.Yz7({token:u,factory:u.\u0275fac,providedIn:"root"})}}]);
|