marketplacepos 5.46.2 → 5.46.4
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/{chunk-CBJR2A72.js → chunk-2GS6DJ33.js} +1 -1
- package/Marketplace/chunk-2REDCSBO.js +1 -0
- package/Marketplace/{chunk-BAXQ2L7B.js → chunk-2WHJU6CS.js} +1 -1
- package/Marketplace/{chunk-FNU2TKTQ.js → chunk-32YMOC74.js} +1 -1
- package/Marketplace/{chunk-WAKKUK6E.js → chunk-34DHFHCG.js} +1 -1
- package/Marketplace/{chunk-CWXOXH6M.js → chunk-4L5TB6FG.js} +1 -1
- package/Marketplace/{chunk-FGFIV3VO.js → chunk-57MSCWQ4.js} +1 -1
- package/Marketplace/{chunk-Z67623R4.js → chunk-5BCJEYHC.js} +1 -1
- package/Marketplace/chunk-5G2U27IM.js +1 -0
- package/Marketplace/chunk-5JBIRETU.js +1 -0
- package/Marketplace/chunk-5KMDUD2M.js +1 -0
- package/Marketplace/{chunk-PL3Q6PGC.js → chunk-5RAWBW2Q.js} +1 -1
- package/Marketplace/{chunk-II5QZVLR.js → chunk-6DYFCRDG.js} +1 -1
- package/Marketplace/{chunk-PLHWGG4D.js → chunk-6K6XBSWF.js} +2 -2
- package/Marketplace/chunk-7ZMHGW2W.js +1 -0
- package/Marketplace/{chunk-72OHPB5Q.js → chunk-AR6PLQ6X.js} +2 -2
- package/Marketplace/{chunk-3BALA33G.js → chunk-B3HL4DNT.js} +1 -1
- package/Marketplace/{chunk-BDKGOINV.js → chunk-BG4CT2T7.js} +1 -1
- package/Marketplace/chunk-BIHR6KWH.js +1 -0
- package/Marketplace/{chunk-CGEIIRYF.js → chunk-BPAZ4TES.js} +1 -1
- package/Marketplace/chunk-BVPWV5YO.js +3 -0
- package/Marketplace/{chunk-3YP6ORBR.js → chunk-C7YK5TDP.js} +1 -1
- package/Marketplace/{chunk-B2WOBUES.js → chunk-CZBE6NFO.js} +1 -1
- package/Marketplace/{chunk-WAZXTB4X.js → chunk-DGIH7HSJ.js} +1 -1
- package/Marketplace/chunk-DLZRRLED.js +1 -0
- package/Marketplace/chunk-DZJWZ52D.js +1 -0
- package/Marketplace/{chunk-HGZ5B6WR.js → chunk-EEZKQOJW.js} +1 -1
- package/Marketplace/{chunk-AMYZMAYI.js → chunk-F4X5RWKY.js} +1 -1
- package/Marketplace/chunk-FF4PEO2O.js +1 -0
- package/Marketplace/chunk-FY73EXB5.js +1 -0
- package/Marketplace/{chunk-3434HH7H.js → chunk-GCOS7VK3.js} +1 -1
- package/Marketplace/chunk-GHFADTRR.js +1 -0
- package/Marketplace/chunk-HGDEIMTN.js +1 -0
- package/Marketplace/{chunk-LCZ6SUUA.js → chunk-HGGI2V4H.js} +1 -1
- package/Marketplace/{chunk-YXBR6VYQ.js → chunk-HS64MICX.js} +1 -1
- package/Marketplace/chunk-IJVKHW3C.js +1 -0
- package/Marketplace/{chunk-ZLNAFA4X.js → chunk-KEQ7PUNM.js} +1 -1
- package/Marketplace/chunk-KVOROMP7.js +1 -0
- package/Marketplace/{chunk-XXAV6VNB.js → chunk-LRKVYKNL.js} +1 -1
- package/Marketplace/{chunk-3GRC47DP.js → chunk-NABJFAKJ.js} +1 -1
- package/Marketplace/{chunk-PE4SWUEZ.js → chunk-NLJHQ4MQ.js} +1 -1
- package/Marketplace/{chunk-CIPLCKUF.js → chunk-NRUVGW2I.js} +1 -1
- package/Marketplace/{chunk-CBAQUD22.js → chunk-NTWV33QC.js} +1 -1
- package/Marketplace/{chunk-FYRDNKYT.js → chunk-P35PCOWA.js} +1 -1
- package/Marketplace/{chunk-HITTNWB6.js → chunk-PHLSX23M.js} +1 -1
- package/Marketplace/{chunk-6VZVNRUE.js → chunk-PNF6K247.js} +2 -2
- package/Marketplace/chunk-QNX7E4P2.js +1 -0
- package/Marketplace/chunk-QTTNQJAK.js +1 -0
- package/Marketplace/chunk-RI627B2Z.js +1 -0
- package/Marketplace/{chunk-UHJEXTOG.js → chunk-RU43F4UK.js} +1 -1
- package/Marketplace/chunk-RXQX7567.js +1 -0
- package/Marketplace/{chunk-LFGPYQCI.js → chunk-SBLG2UP7.js} +1 -1
- package/Marketplace/chunk-SWV5QK47.js +5 -0
- package/Marketplace/{chunk-A57T33JT.js → chunk-T4OUIM2Z.js} +1 -1
- package/Marketplace/chunk-TEJITT3W.js +1 -0
- package/Marketplace/{chunk-YA3VMYDA.js → chunk-TFM5EMU4.js} +1 -1
- package/Marketplace/{chunk-NWWYOZ4V.js → chunk-TKV7XWBT.js} +1 -1
- package/Marketplace/{chunk-SZGOLKC6.js → chunk-TYSVSEYQ.js} +1 -1
- package/Marketplace/chunk-UBA54WUZ.js +1 -0
- package/Marketplace/{chunk-6RMBCW2O.js → chunk-UWC2EVFY.js} +1 -1
- package/Marketplace/{chunk-OE7TF7SI.js → chunk-W4MTON2T.js} +1 -1
- package/Marketplace/{chunk-OVPVQS4J.js → chunk-WIMLQM6B.js} +1 -1
- package/Marketplace/{chunk-RJ5D24ZW.js → chunk-WY37QAZ4.js} +1 -1
- package/Marketplace/{chunk-77MWKV5I.js → chunk-XSJBP4EN.js} +2 -2
- package/Marketplace/{chunk-OHSVQSCM.js → chunk-YJKAX7P2.js} +1 -1
- package/Marketplace/{chunk-QSHR75ZI.js → chunk-ZKROHCYD.js} +1 -1
- package/Marketplace/chunk-ZMF3NFLA.js +1 -0
- package/Marketplace/index.html +2 -2
- package/Marketplace/main-QTIXFWWZ.js +1 -0
- package/package.json +1 -1
- package/Marketplace/chunk-45FZJ4W3.js +0 -1
- package/Marketplace/chunk-4DMKVXM7.js +0 -1
- package/Marketplace/chunk-4JQLXONG.js +0 -1
- package/Marketplace/chunk-7AZDAPB7.js +0 -1
- package/Marketplace/chunk-7F74QXF6.js +0 -1
- package/Marketplace/chunk-7VLMA7MW.js +0 -1
- package/Marketplace/chunk-GPX77ZSI.js +0 -1
- package/Marketplace/chunk-GRQD4D2I.js +0 -1
- package/Marketplace/chunk-NDLOPOFD.js +0 -1
- package/Marketplace/chunk-OEAOBG75.js +0 -1
- package/Marketplace/chunk-OHVOVAKD.js +0 -1
- package/Marketplace/chunk-P5YM6T6I.js +0 -1
- package/Marketplace/chunk-PW42BQIY.js +0 -1
- package/Marketplace/chunk-Q2B5GUDO.js +0 -1
- package/Marketplace/chunk-QVP2CM7Y.js +0 -5
- package/Marketplace/chunk-RM2OSYMV.js +0 -1
- package/Marketplace/chunk-TM6DZ3ZF.js +0 -1
- package/Marketplace/chunk-UX3OTI5X.js +0 -1
- package/Marketplace/chunk-V6GFM5AQ.js +0 -1
- package/Marketplace/chunk-WEYKQCVQ.js +0 -1
- package/Marketplace/chunk-WWLC64XZ.js +0 -3
- package/Marketplace/chunk-XPBMYV5W.js +0 -1
- package/Marketplace/chunk-Z3J3CSGS.js +0 -1
- package/Marketplace/main-FUX6VJVF.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as V,b as ft}from"./chunk-IJVKHW3C.js";import"./chunk-YERZ6W22.js";import{a as ut}from"./chunk-4L5TB6FG.js";import{a as dt}from"./chunk-LDL3A7NM.js";import"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{e as mt}from"./chunk-PYXL7UF7.js";import"./chunk-RXQX7567.js";import{m as st,n as pt}from"./chunk-HJXYT6MI.js";import{A as ct,h as rt,m as lt}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as at,J as ot,d as Q,f as X,g as Z,j as tt,k as et,m as it,n as nt}from"./chunk-FXQKRJWU.js";import{$c as g,Fc as $,Gb as T,Gc as o,Hc as C,Ic as _,Jc as A,Kc as H,Lc as W,Mb as p,Mc as q,Nc as J,Qc as j,Ra as w,Rc as z,Sc as K,Tc as U,Uc as Y,Yb as s,Z as D,ac as F,ad as E,bd as y,cd as G,dc as S,ec as L,gc as k,hc as B,ic as e,jc as n,kc as R,lc as h,mc as N,oc as O,pa as P,pb as M,rb as r,tc as I,uc as f,v as b,ya as d,za as u}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var _t=(t,c)=>({"bg-gradient-danger":t,"bg-gradient-warning":c}),gt=()=>["/menu/products/status/notification/detailV2"],St=t=>({ID:t}),Ct=(t,c,i)=>({"text-warning":t,"text-success":c,"text-danger":i});function vt(t,c){t&1&&(e(0,"div"),o(1," Scan in progress. You will be notified once it is complete. "),n())}function xt(t,c){if(t&1&&(e(0,"div"),o(1),g(2,"number"),n()),t&2){let i=c.$implicit;r(),A(" ",i.Key,": ",E(2,2,i.Value)," ")}}function ht(t,c){if(t&1&&(e(0,"div",22)(1,"div",21),o(2,"Status Product:"),n(),k(3,xt,3,4,"div",null,L),n()),t&2){let i=f(2).$implicit;r(3),B(i.ParsedStatus)}}function Nt(t,c){if(t&1&&(e(0,"div",21),o(1),n(),e(2,"div"),o(3),n(),p(4,ht,5,0,"div",22)),t&2){let i=f().$implicit;r(),_(" ",i.ProcessLabel," "),r(2),C(i.ProcessDescription),r(),S(i!=null&&i.ParsedStatus&&(i==null||i.ParsedStatus==null?null:i.ParsedStatus.length)>0?4:-1)}}function It(t,c){if(t&1&&(h(0),o(1),g(2,"number"),e(3,"span"),o(4,"s"),n(),N()),t&2){let i=f().$implicit;r(),_(" ",y(2,1,i.DurationInSecond,"1.1-1")," ")}}function Et(t,c){t&1&&o(0," - ")}function yt(t,c){t&1&&o(0," In Progress ")}function Vt(t,c){t&1&&o(0," Completed ")}function bt(t,c){t&1&&o(0," Failed ")}function Dt(t,c){if(t&1&&(h(0),e(1,"tr",16)(2,"td")(3,"a",17),o(4),n()(),e(5,"td")(6,"div",18),R(7,"img",19),e(8,"span"),o(9),n()()(),e(10,"td"),p(11,vt,2,0,"div")(12,Nt,5,3),n(),e(13,"td"),p(14,It,5,4,"ng-container",20)(15,Et,1,0,"ng-template",null,0,G),n(),e(17,"td")(18,"div",21),p(19,yt,1,0)(20,Vt,1,0)(21,bt,1,0),n()(),e(22,"td",22)(23,"div"),o(24),n(),e(25,"div"),o(26),g(27,"date"),n()()(),N()),t&2){let i,a=c.$implicit,m=$(16),l=f();r(),s("ngClass",U(17,_t,a.Status==1,a.Status==0)),r(2),s("routerLink",z(20,gt))("queryParams",K(21,St,a.ID)),r(),_(" ",a.ID," "),r(3),s("src",a.Img,M),r(2),C(a.ChannelName),r(2),S(a.StateID==l.scanState.InProgress?11:12),r(3),s("ngIf",a.DurationInSecond)("ngIfElse",m),r(4),F(Y(23,Ct,a.StateID==l.scanState.InProgress,a.StateID==l.scanState.Completed,a.StateID==l.scanState.Failed)),r(),S((i=a.StateID)===l.scanState.InProgress?19:i===l.scanState.Completed?20:i===l.scanState.Failed?21:-1),r(5),C(a.LoginID),r(2),_(" ",y(27,14,a.Created,"dd MMM yyyy HH:mm")," ")}}var Kt=(()=>{class t{constructor(){this.notificationService=P(V),this.filter=w({RowCount:20,PageNumber:1,ChannelID:null}),this.scanState=ft,this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotificationList(this.filter()).pipe(b(i=>(i.Data=i.Data.map(a=>(a.StatusProduct&&(a.ParsedStatus=JSON.parse(a.StatusProduct)),a)),i)),D(1))}onFilter(){this.initNotifications()}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-notificationV2"]],features:[j([V])],decls:36,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification",3,"onSubmit","hideSearchBox"],["routerLink","/menu/products/status/notification",1,"btn","btn-outline-secondary","btn-lg"],[1,"fw-bold","mb-2"],[3,"ngModelChange","ngModel"],[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"],[2,"width","260px"],[4,"ngFor","ngForOf"],[1,"col-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked"],[3,"ngClass"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","gap-3"],[1,"channelLogo-md",3,"src","alt"],[4,"ngIf","ngIfElse"],[1,"fw-bold"],[1,"lh-base"]],template:function(a,m){if(a&1){let l=O();J(0),g(1,"async"),e(2,"mainpanel",1),I("onSubmit",function(){return d(l),u(m.onFilter())}),e(3,"actions")(4,"a",2),o(5," Back "),n()(),e(6,"filters")(7,"div")(8,"label",3),o(9,"Channel"),n(),e(10,"channel-select-options",4),q("ngModelChange",function(x){return d(l),W(m.filter().ChannelID,x)||(m.filter().ChannelID=x),u(x)}),n()()(),e(11,"content")(12,"div",5)(13,"div",6)(14,"div",7)(15,"div",8)(16,"table",9)(17,"thead",10)(18,"tr",11)(19,"th",12),o(20,"Job ID"),n(),e(21,"th"),o(22,"Channel"),n(),e(23,"th"),o(24,"Process"),n(),e(25,"th"),o(26,"Duration"),n(),e(27,"th"),o(28,"Status"),n(),e(29,"th"),o(30,"Creator"),n()()(),e(31,"tbody"),p(32,Dt,28,27,"ng-container",13),n()()()()(),e(33,"div",6)(34,"div",14)(35,"app-custom-paginator",15),I("next",function(){return d(l),u(m.initNotifications())})("previous",function(){return d(l),u(m.initNotifications())}),n()()()()()()}if(a&2){let l=E(1,7,m.notifications$);r(2),s("hideSearchBox",!0),r(8),H("ngModel",m.filter().ChannelID),r(22),s("ngForOf",l==null?null:l.Data),r(3),s("filter",m.filter())("totaldata",l==null||l.Data==null?null:l.Data.length)("paginationTotal",l==null?null:l.Count)("hasClicked",!0)}},dependencies:[nt,Q,X,Z,tt,it,et,ct,rt,lt,pt,st,dt,mt,ot,at,ut],encapsulation:2})}}return t})();export{Kt as NotificationV2Component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as q}from"./chunk-IITU3NV6.js";import{a as j,b as V}from"./chunk-2O4IEGGR.js";import{na as $}from"./chunk-RC5PUUVM.js";import{b as s,c as a}from"./chunk-RXQX7567.js";import{A as F,a as R,h as A,m as D}from"./chunk-5PS6ZS3N.js";import{a as I}from"./chunk-V3USB3ZU.js";import{r as U,s as W}from"./chunk-MFQQEEHJ.js";import{j as O,n as z}from"./chunk-FXQKRJWU.js";import{$c as E,Ga as _,Gb as w,Gc as y,Ic as M,Ka as T,Kc as v,Lc as L,Mb as g,Mc as P,Oa as h,Qc as B,Ra as c,Yb as d,Z as S,ad as x,dc as k,ia as b,ic as u,jc as r,pa as m,rb as p,tc as f,uc as N,v as C}from"./chunk-OJMQBH6T.js";function J(n,G){if(n&1&&(u(0,"div",4),y(1),r()),n&2){let e=N();p(),M(" ",e.selectedCategoryLabel()," ")}}function K(n,G){n&1&&(u(0,"label",3),y(1,"Channel"),r())}var he=(()=>{class n{constructor(){this.multiwarehousTreeService=m(q),this.destroyRef=m(_),this.selectedCategoryLabel=c("Select a Channel"),this.disabled=c(!1),this.selectedNode=c(null),this.multiple=h(!1),this.floatingLabel=h(!1),this.onChannelChange=new T,this.channels$=this.multiwarehousTreeService.getChannelTree$().pipe(C(e=>e.map(t=>{t.children=t.children.map(i=>(i.icon="fa-solid fa-warehouse",i));let o=this.getChannelType(t.typeid);return t.icon=`custom-icon-${o}`,t.expandedIcon=null,t.collapsedIcon=null,t.styleClass=`custom-icon-${o}`,t.logo=a.getChannelLogoByTypeId(t.typeid),t})),S(1)),this.htmlBody=document.querySelector("body"),this.onChange=e=>{},this.onTouched=()=>{}}getChannelType(e){switch(e){case s.Tokopedia:return"tokopedia";case s.Shopee:return"shopee";case s.Lazada:return"lazada";case s.Shopify:return"shopify";case s.WooCommerce:return"woocommerce";case s.Tiktok:return"tiktok";case s.Plugo:return"plugo";case s.ShopifyV2:return"shopify"}}initSelectedNode(e){this.channels$.pipe(I(this.destroyRef)).subscribe(t=>{if(this.multiple()){let o=[];for(let i of e){let l=a.searchByIdWithParentDFS(t,i),H=Object.assign({},l);o.push(H)}this.selectedNode.set(o),this.emitMultipleNodes()}else{let o=a.searchByIdWithParentDFS(t,e),i=Object.assign({},o);this.selectedNode.set(i),this.emitSingleNode(i)}})}onNodeSelect(e){let t=Object.assign({},e.node);this.multiple()?this.emitMultipleNodes():this.emitSingleNode(t)}emitMultipleNodes(){let e=Object.assign([],this.selectedNode()),t=e.map(o=>o.id);this.onChange(t),this.onChannelChange.emit(e),this.generateLabel()}emitSingleNode(e){this.onChange(e.id),this.onChannelChange.emit(e),this.generateLabel()}onNodeUnSelect(e){if(this.multiple()){let t=e.node;this.selectedNode.update(o=>o.filter(i=>i.id!==t.id)),this.emitMultipleNodes(),this.generateLabel()}}generateLabel(){let e="Select a Channel";if(this.multiple()){e="";for(let t of this.selectedNode())e+=a.getLabelPathTree(t)+", ";this.selectedCategoryLabel.set(e)}else{let t=this.selectedNode();t?(e=a.getLabelPathTree(t),this.selectedCategoryLabel.set(e)):this.selectedCategoryLabel.set(e)}}onClear(){this.onChange(null)}onClick(){let e=this.getBodyTop(),t=document.querySelector(".p-overlay.p-component"),o=e+t.getBoundingClientRect().top,i=t.getAttribute("style")||"";t.setAttribute("style",`${i} top: ${o+e}px;`)}getBodyTop(){return this.htmlBody.getBoundingClientRect().top*-1}writeValue(e){a.IsNotEmpty(e)&&this.initSelectedNode(e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled.set(e)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=w({type:n,selectors:[["multiwarehouse-tree-select"]],inputs:{multiple:[1,"multiple"],floatingLabel:[1,"floatingLabel"]},outputs:{onChannelChange:"onChannelChange"},features:[B([{provide:R,useExisting:b(()=>n),multi:!0}])],decls:5,vars:9,consts:[["matTooltipPosition","above",1,"p-float-label",3,"matTooltip"],["appendTo","body","containerStyleClass","w-100","id","selectChannel",1,"multiwarehouse-select",3,"click","onNodeSelect","ngModelChange","onClear","onNodeUnselect","filter","filterInputAutoFocus","options","ngModel","selectionMode"],["pTemplate","value","type","default"],["for","selectChannel"],["matTooltipPosition","above"]],template:function(t,o){t&1&&(u(0,"span",0)(1,"p-treeSelect",1),E(2,"async"),f("click",function(){return o.onClick()})("onNodeSelect",function(l){return o.onNodeSelect(l)}),P("ngModelChange",function(l){return L(o.selectedNode,l)||(o.selectedNode=l),l}),f("onClear",function(){return o.onClear()})("onNodeUnselect",function(l){return o.onNodeUnSelect(l)}),g(3,J,2,1,"ng-template",2),r(),g(4,K,2,0,"label",3),r()),t&2&&(d("matTooltip",o.selectedCategoryLabel()),p(),d("filter",!0)("filterInputAutoFocus",!0)("options",x(2,7,o.channels$)),v("ngModel",o.selectedNode),d("selectionMode",o.multiple()?"multiple":"single"),p(3),k(o.floatingLabel()?4:-1))},dependencies:[z,O,V,j,$,F,A,D,W,U],styles:["[_nghost-%COMP%] .p-treeselect{width:100%;display:inline-flex;border:1px solid #ced4da;font-size:.875rem!important} .p-element .p-icon-wrapper{width:14px} .p-float-label .multiwarehouse-select.p-treeselect{padding:7px!important;min-height:.6rem!important} .custom-icon-tokopedia.p-tree-node-icon, .custom-icon-shopee.p-tree-node-icon, .custom-icon-woocommerce.p-tree-node-icon, .custom-icon-lazada.p-tree-node-icon, .custom-icon-tiktok.p-tree-node-icon, .custom-icon-shopify.p-tree-node-icon, .custom-icon-plugo.p-tree-node-icon{background-size:contain;background-repeat:no-repeat;width:20px;height:20px;display:inline-block} .custom-icon-tokopedia.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png)} .custom-icon-woocommerce.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp)} .custom-icon-shopee.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png)} .custom-icon-tiktok.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png)} .custom-icon-lazada.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1680681836/icons/marketplace_icons/Lazadanew.png)} .custom-icon-shopify.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1707987435/icons/marketplace_icons/shopify.png)} .custom-icon-plugo.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1739236419/icons/marketplace_icons/plugo.ico)} .custom-icon-shopee .fa-warehouse.p-tree-node-icon, .custom-icon-tiktok .fa-warehouse.p-tree-node-icon, .custom-icon-tokopedia .fa-warehouse.p-tree-node-icon, .custom-icon-lazada .fa-warehouse.p-tree-node-icon, .custom-icon-shopify .fa-warehouse.p-tree-node-icon, .custom-icon-woocommerce .fa-warehouse.p-tree-node-icon, .custom-icon-plugo .fa-warehouse.p-tree-node-icon{background-image:none!important;display:inline-block!important}"]})}}return n})();export{he as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Y}from"./chunk-4L5TB6FG.js";import"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import{a as H}from"./chunk-CGOB6Y3X.js";import{e as F}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PYXL7UF7.js";import"./chunk-RXQX7567.js";import{m as J,n as G}from"./chunk-HJXYT6MI.js";import{A as j,c as K,h as R,m as N,p as O}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as T,j as W,l as D,n as U}from"./chunk-FXQKRJWU.js";import{$c as P,Gb as I,Gc as a,Hc as E,Kc as h,Lc as g,Mb as w,Mc as f,Nc as V,Oc as L,Pc as x,Ra as C,Yb as m,Z as b,ad as v,dc as k,ic as n,jc as i,kc as A,oc as _,pa as B,rb as d,tc as M,uc as u,ya as p,za as s}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function q(o,S){if(o&1){let t=_();n(0,"input",30),f("ngModelChange",function(e){p(t);let r=u();return g(r.sku,e)||(r.sku=e),s(e)}),i()}if(o&2){let t=u();h("ngModel",t.sku)}}function z(o,S){if(o&1){let t=_();n(0,"input",31),f("ngModelChange",function(e){p(t);let r=u();return g(r.itemId,e)||(r.itemId=e),s(e)}),i()}if(o&2){let t=u();h("ngModel",t.itemId)}}function Q(o,S){if(o&1&&(n(0,"pre",28),a(1),P(2,"json"),i()),o&2){u();let t=x(35);d(),E(v(2,1,t))}}function X(o,S){o&1&&(n(0,"p",29),a(1," Your data will be shown here once it's available "),i())}var me=(()=>{class o{constructor(){this.httpService=B(F),this.selectedChannel=C(null),this.sku=C(null),this.itemId=C(null),this.searchBy="sku"}initProductLog(){let t={ChannelID:this.selectedChannel()};this.searchBy==="sku"?t.SKU=this.sku():t.ItemID=this.itemId(),this.productLog$=this.httpService.post(H.GetProductApiLog,t).pipe(b(1))}copyToClipboard(t){if(!t)return;let c=typeof t=="string"?t:JSON.stringify(t,null,2);navigator.clipboard.writeText(c),alert("Copied to clipboard!")}static{this.\u0275fac=function(c){return new(c||o)}}static{this.\u0275cmp=I({type:o,selectors:[["app-product-api"]],decls:50,vars:14,consts:[["headerTitle","Origin Product Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],[1,"mb-2"],[1,"form-check","form-check-inline"],["type","radio","name","searchBy","id","searchBySku",1,"form-check-input",3,"ngModelChange","ngModel","value"],["for","searchBySku",1,"form-check-label"],["type","radio","name","searchBy","id","searchByItemId",1,"form-check-input",3,"ngModelChange","ngModel","value"],["for","searchByItemId",1,"form-check-label"],["type","text","class","form-control","placeholder","Product Code / SKU",3,"ngModel","ngModelChange",4,"ngIf"],["type","text","class","form-control","placeholder","ItemID is Product id from seller center",3,"ngModel","ngModelChange",4,"ngIf"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","productLogText"],[1,"text-center","my-12","text-muted"],["type","text","placeholder","Product Code / SKU",1,"form-control",3,"ngModelChange","ngModel"],["type","text","placeholder","ItemID is Product id from seller center",1,"form-control",3,"ngModelChange","ngModel"]],template:function(c,e){if(c&1){let r=_();n(0,"mainpanel",0)(1,"actions")(2,"button",1),M("click",function(){return p(r),s(e.initProductLog())}),A(3,"i",2),a(4," Search "),i()(),n(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),a(12,"Channel"),i(),n(13,"p",8),a(14," View logs related to Product API Detail "),i()(),n(15,"div",9)(16,"channel-select-options",10),f("ngModelChange",function(l){return p(r),g(e.selectedChannel,l)||(e.selectedChannel=l),s(l)}),i()()(),n(17,"div",11)(18,"div",7)(19,"h6"),a(20,"Product Code / SKU"),i(),n(21,"p",8),a(22," Product SKU or Code from Channel Product "),i()(),n(23,"div",9)(24,"div",12)(25,"div",13)(26,"input",14),f("ngModelChange",function(l){return p(r),g(e.searchBy,l)||(e.searchBy=l),s(l)}),i(),n(27,"label",15),a(28,"Search by SKU"),i()(),n(29,"div",13)(30,"input",16),f("ngModelChange",function(l){return p(r),g(e.searchBy,l)||(e.searchBy=l),s(l)}),i(),n(31,"label",17),a(32,"Search by ItemID"),i()()(),w(33,q,1,1,"input",18)(34,z,1,1,"input",19),i()()()(),V(35),P(36,"async"),n(37,"div",20)(38,"div",21)(39,"div",22)(40,"div",23)(41,"h5"),a(42,"Response"),i(),n(43,"button",24),M("click",function(){p(r);let l=x(35);return s(e.copyToClipboard(l))}),a(44," Copy "),i()(),n(45,"div",25)(46,"div",26)(47,"div",27),w(48,Q,3,3,"pre",28)(49,X,2,0,"p",29),i()()()()()()()()()}if(c&2){m("hideSearchBox",!0)("hideSearchDropdown",!0),d(16),h("ngModel",e.selectedChannel),d(10),h("ngModel",e.searchBy),m("value","sku"),d(4),h("ngModel",e.searchBy),m("value","itemid"),d(3),m("ngIf",e.searchBy==="sku"),d(),m("ngIf",e.searchBy==="itemid"),d();let r=L(v(36,11,e.productLog$));d(8),m("disabled",!r),d(5),k(r?48:49)}},dependencies:[U,T,W,D,j,K,O,R,N,G,J,Y],encapsulation:2})}}return o})();export{me as ProductApiComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-C7YK5TDP.js";import{c as q}from"./chunk-RXQX7567.js";import{n as w}from"./chunk-FXQKRJWU.js";import{$b as U,Gb as h,Gc as p,Hc as S,Ic as d,Jb as F,Mb as b,Oa as f,Sc as k,Yb as g,dc as x,ec as I,gc as T,hc as P,ic as r,jc as i,kc as _,oc as j,pa as v,pb as u,rb as o,tc as C,uc as s,ya as E,za as M}from"./chunk-OJMQBH6T.js";var A=(()=>{class t{transform(e){return q.getChannelLogoByTypeId(e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275pipe=F({name:"channelImage",type:t,pure:!0})}}return t})();function R(t,m){if(t&1&&_(0,"img",8),t&2){let e=s().$implicit;g("src",e==null?null:e.ThumbnailURL,u)}}function z(t,m){t&1&&_(0,"img",9)}function B(t,m){if(t&1&&b(0,R,1,1,"img",8)(1,z,1,0,"img",9),t&2){let e=m.$implicit;x(e!=null&&e.ThumbnailURL?0:1)}}function O(t,m){if(t&1){let e=j();r(0,"img",17),C("click",function(a){E(e);let l=s().$implicit;return s().onZoomImage(a,l==null?null:l.ImageURL),M(a.stopPropagation())}),i()}if(t&2){let e=s().$implicit;g("src",e==null?null:e.ThumbnailURL,u)}}function $(t,m){t&1&&_(0,"img",13)}function Z(t,m){if(t&1&&(r(0,"div",15),p(1),i()),t&2){let e=s().$implicit;o(),d("x",e.Quantity,"")}}function W(t,m){if(t&1&&(r(0,"li")(1,"div",10)(2,"div",11),b(3,O,1,1,"img",12)(4,$,1,0,"img",13),r(5,"div",14)(6,"div",15),p(7),i(),r(8,"div",16),p(9),i()()(),b(10,Z,2,1,"div",15),i()()),t&2){let e=m.$implicit;o(3),x(e!=null&&e.ThumbnailURL?3:4),o(4),S(e.Name),o(2),S(e.Code),o(),x(e.Quantity>1?10:-1)}}var Y=(()=>{class t{constructor(){this.variants=f(),this.biggerPictureService=v(y)}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=h({type:t,selectors:[["variants-dropdown"]],inputs:{variants:[1,"variants"]},decls:15,vars:2,consts:[[1,"dropdown","pe-6"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","dropdown-toggle","border-0","d-flex","align-items-center","justify-content-between","gap-4","w-100",2,"padding","0px"],[1,"text-start"],[1,"fs-6"],[1,"d-flex","align-items-center","gap-2"],[1,"fa-regular","fa-angle-down"],[1,"dropdown-menu","p-3"],[1,"ms-6","mt-3","text-black"],[1,"thumb-square","border","border-opacity-10",3,"src"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","border-opacity-10","thumb-square"],[1,"dropdown-item","d-flex","align-items-center","gap-5","justify-content-between",2,"padding-left","8px","padding-right","8px"],[1,"d-flex","align-items-center","justify-content-start","gap-5"],[1,"thumb-square-lg","border","border-opacity-10",2,"cursor","zoom-in",3,"src"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"thumb-square-lg","border","border-opacity-10"],[1,"lh-base"],[1,"text-black"],[1,"text-muted"],[1,"thumb-square-lg","border","border-opacity-10",2,"cursor","zoom-in",3,"click","src"]],template:function(n,a){if(n&1&&(r(0,"div",0)(1,"button",1)(2,"div",2)(3,"div",3),p(4),i(),r(5,"div",4),T(6,B,2,1,null,null,I),i()(),r(8,"div"),_(9,"i",5),i()(),r(10,"ul",6)(11,"h5",7),p(12),i(),T(13,W,11,4,"li",null,I),i()()),n&2){let l,c;o(4),d("",(l=a.variants())==null?null:l.length," items"),o(2),P(a.variants()),o(6),d("",(c=a.variants())==null?null:c.length," Items"),o(),P(a.variants())}},dependencies:[w],styles:[".dropdown-toggle[_ngcontent-%COMP%]:after{display:none!important}.dropdown[_ngcontent-%COMP%] .dropdown-menu.show[_ngcontent-%COMP%]{top:unset!important}.thumb-square[_ngcontent-%COMP%]{width:26px;height:26px;object-fit:contain;object-position:center}.thumb-square-lg[_ngcontent-%COMP%]{width:50px;height:50px;object-fit:contain;object-position:center}"]})}}return t})();var N=t=>({cursor:t}),rt=(()=>{class t{constructor(){this.variant=f(),this.biggerPictureService=v(y)}onZoomImage(e){let n=this.variant()?.ImageURL;n&&this.biggerPictureService.openBiggerPicture(e,n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=h({type:t,selectors:[["variant-with-image"]],inputs:{variant:[1,"variant"]},decls:8,vars:7,consts:[[1,"d-flex","align-items-center","gap-5"],[1,"thumb-square-lg","border","border-opacity-10",2,"cursor","zoom-in",3,"click","src"],[1,"lh-base"],[1,"text-black"],[1,"text-muted"]],template:function(n,a){if(n&1&&(r(0,"div",0)(1,"div")(2,"img",1),C("click",function(c){return a.onZoomImage(c)}),i()(),r(3,"div",2)(4,"div",3),p(5),i(),r(6,"div",4),p(7),i()()()),n&2){let l,c,V,D;o(2),U(k(5,N,(l=a.variant())!=null&&l.ImageURL?"zoom-in":"")),g("src",((c=a.variant())==null?null:c.ThumbnailURL)||"https://cdn.dealpos.app/template/products_thumb.png",u),o(3),d(" ",(V=a.variant())==null?null:V.Name," "),o(2),d(" ",(D=a.variant())==null?null:D.Code," ")}},dependencies:[w],styles:[".thumb-square-lg[_ngcontent-%COMP%]{width:50px;height:50px;object-fit:contain;object-position:center}"]})}}return t})();export{A as a,Y as b,rt as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=function(o){return o[o.Tokopedia=1]="Tokopedia",o[o.WooCommerce=2]="WooCommerce",o[o.None=3]="None",o[o.KalCare=4]="KalCare",o[o.Shopee=5]="Shopee",o[o.Tiktok=6]="Tiktok",o[o.Lazada=7]="Lazada",o[o.Shopify=8]="Shopify",o[o.Plugo=9]="Plugo",o[o.ShopifyV2=10]="ShopifyV2",o}(s||{});var i=function(o){return o.SHOOPE="https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",o.WOOCOMMERCE="https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",o.TOKOPEDIA="https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",o.TIKTOK="https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",o.LAZADA="https://res.cloudinary.com/pos/image/upload/v1680681836/icons/marketplace_icons/Lazadanew.png",o.KALCARE="https://res.cloudinary.com/pos/image/upload/v1654230268/icons/marketplace_icons/kalcare.png",o.SHOPIFY="https://res.cloudinary.com/pos/image/upload/v1707987435/icons/marketplace_icons/shopify.png",o.PLUGO="https://res.cloudinary.com/pos/image/upload/v1739236419/icons/marketplace_icons/plugo.ico",o.PLUGONEW="https://res.cloudinary.com/pos/image/upload/v1739263497/icons/marketplace_icons/plugonew.ico",o}(i||{});var D=(()=>{class o{static{this.GuidEMpty="00000000-0000-0000-0000-000000000000"}static{this.MinDate="0001-01-01T00:00:00"}static IsNotEmpty(t){return t!=""&&t!=o.GuidEMpty&&t!=null&&t!=null}static IsEmpty(t){return t==""||t==null||t==null||t==o.GuidEMpty}static getChannelLogoByTypeId(t){let e;switch(t){case s.Tokopedia:e=i.TOKOPEDIA;break;case s.Shopee:e=i.SHOOPE;break;case s.WooCommerce:e=i.WOOCOMMERCE;break;case s.Lazada:e=i.LAZADA;break;case s.Tiktok:e=i.TIKTOK;break;case s.KalCare:e=i.KALCARE;break;case s.Shopify:e=i.SHOPIFY;break;case s.Plugo:e=i.PLUGO;break;case s.ShopifyV2:e=i.SHOPIFY;break}return e}static getChannelLogoByName(t=""){t=t.toLowerCase();let e;switch(t){case"tokopedia":e=i.TOKOPEDIA;break;case"shoppe":e=i.SHOOPE;break;case"woocommerce":e=i.WOOCOMMERCE;break;case"tiktok":e=i.TIKTOK;break;case"lazada":e=i.LAZADA;break;case"kalCare":e=i.KALCARE;break;case"plugo":e=i.PLUGO;break;case"shopifyv2":e=i.SHOPIFY;break}return e}static getChannelName(t){let e;switch(t){case s.Shopee:e="Shopee";break;case s.Tokopedia:e="Tokopedia";break;case s.Lazada:e="Lazada";break;case s.Tiktok:e="Tiktok";break;case s.WooCommerce:e="WooCommerce";break;case s.KalCare:e="KalCare";break;case s.Plugo:e="Plugo";break;case s.ShopifyV2:e="Shopify";break}return e}static assignChannelLogo(t){return t=t.map(e=>(e.logo=this.getChannelLogoByTypeId(e.TypeID),e)),t}static getCssChannelColor(t){let e;switch(t){case s.Shopee:e="#ee4d2d";break;case s.Tokopedia:e="var(--G500,#03AC0E)";break;case s.Lazada:e="#FF00B2";break;case s.Tiktok:e="black";break;case s.WooCommerce:e="#674399";break;case s.KalCare:e="rgb(128, 188, 0)";break;case s.Plugo:e="#F2A954";break}return e}static getDaysDiff(t,e){var a=e.getTime()-t.getTime(),r=a/(1e3*60*60*24);return r}static addDays(t,e){let a=new Date(Number(t));return a.setDate(t.getDate()-e),a}static isValidDate(t){return t instanceof Date&&!isNaN(t)}static getImageInfo(t){return new Promise((e,a)=>{let r=new Image;r.src=t,r.decode().then(()=>{e({img:t,height:r.height,width:r.width})}).catch(()=>{a(new Error(`Image load error for ${t}`))})})}static formatTitleFromDate(t,e){let a=null,r=new Date(t),c=new Date(e);return r.getDate()!=c.getDate()&&(a="dd"),r.getMonth()!=c.getMonth()&&(a="dd MMM"),r.getFullYear()!=c.getFullYear()&&(a="dd MMM yyyy"),a}static openDownloadFile(t,e){var a=window.URL.createObjectURL(t),r=document.createElement("a");r.href=a,r.download=e,r.click()}static compare(t,e,a){return(t<e?-1:1)*(a?1:-1)}static isDateExpired(t){let e=new Date,a=!1;return t.getTime()<e.getTime()&&(a=!0),a}static getLabelPathTree(t){let e=[],a=t;for(;a;)e.unshift(a.label),a=a.parent;return e.join(" / ")}static searchByIdWithParentDFS(t,e){let a=[...t],r;for(typeof e=="number"?r=JSON.stringify(e):r=e;a.length>0;){let c=a.pop();if(c.id===r)return c;if(c.children&&c.children.length>0)for(let n of c.children)n.parent=c,a.push(n)}return null}static getTimeDifference(t){let e=new Date(t),a=new Date,r=Math.abs(e.getTime()-a.getTime()),c=1e3,n=6e4,d=60*n,l=24*d,m=Math.floor(r/l),p=Math.floor(r%l/d),u=Math.floor(r%d/n),g=Math.floor(r%n/c);return{days:m,hours:p,minutes:u,seconds:g}}static convertToReadableDate(t){let{days:e,hours:a,minutes:r,seconds:c}=o.getTimeDifference(t),n="";return e>0&&a>0&&r>0&&(n=`${e} days, ${a} hours and ${r} minutes ago`),e>0&&a>0&&r==0&&(n=`${e} days and ${a} hours ago`),e>0&&a==0&&(n=`${e} days ago`),e==0&&a>0&&r>0&&(n=`${a} hours and ${r} minutes ago`),e==0&&a>0&&r==0&&(n=`${a} hours ago`),e==0&&a==0&&r>0&&(n=`${r} minutes ago`),e==0&&a==0&&r==0&&c>0&&(n=`${c} seconds ago`),n}static isValidGUID(t){return/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(t)}static convertTimestampToDate(t){if(!Number.isFinite(t))return new Date(t);let e=t<1e12?t*1e3:t;return new Date(e)}static parseJwt(t){var e=t.split(".")[1],a=e.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(atob(a).split("").map(function(c){return"%"+("00"+c.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(r)}}return o})();export{i as a,s as b,D as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-PIBVGTHJ.js";import{a as fe}from"./chunk-EPBVNII2.js";import"./chunk-4YRBARG2.js";import"./chunk-7G6GQTSH.js";import{a as U}from"./chunk-UMP6ZMEJ.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as
|
|
1
|
+
import{a as D}from"./chunk-PIBVGTHJ.js";import{a as fe}from"./chunk-EPBVNII2.js";import"./chunk-4YRBARG2.js";import"./chunk-7G6GQTSH.js";import{a as U}from"./chunk-UMP6ZMEJ.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as pe}from"./chunk-ACIMXBIC.js";import{a as re}from"./chunk-Z3ITXK3D.js";import"./chunk-CGOB6Y3X.js";import{b as ae}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as oe}from"./chunk-RXQX7567.js";import{m as me,n as ue}from"./chunk-HJXYT6MI.js";import{A as ie}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{b as le,c as se}from"./chunk-ERXVXBTU.js";import{r as de,s as ce}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{E as Y,G as ee,H as te,J as ne,d as K,g as Q,j as W,m as X,n as P}from"./chunk-FXQKRJWU.js";import{$c as _,Gb as x,Gc as s,Hc as h,Ic as z,Jb as L,Mb as m,Nc as q,Oc as $,Pc as C,Qc as j,Sc as I,Tc as J,Yb as p,Z as V,aa as w,ac as S,ad as y,dc as T,ec as k,gc as A,hc as H,ic as a,jc as l,kc as u,lc as g,mc as v,ob as F,oc as B,pa as b,rb as r,rd as Z,tc as G,uc as c,v as M,ya as N,za as R}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as E,b as O}from"./chunk-66YHNWRR.js";var ge=(()=>{class t{transform(e){return typeof e=="number"&&(e=e.toString()),e!=null?e.replace(/\n/g,"<br />"):e}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275pipe=L({name:"newlines",type:t,pure:!0})}}return t})();var Ce=t=>({disabled:t}),_e=(t,d)=>({labelFilledInput:t,labelEmptyInput:d});function ye(t,d){if(t&1&&(a(0,"p"),s(1),_(2,"number"),l()),t&2){let e=c();r(),h(e.inputValueType()==="number"?y(2,1,e.inputValue):e.inputValue)}}function xe(t,d){if(t&1&&(u(0,"p",3),_(1,"newlines")),t&2){let e=c();p("innerHTML",y(1,1,e.inputValue),F)}}function Ie(t,d){if(t&1&&(g(0),s(1),v()),t&2){let e=c();r(),z(" ",e.labelValue," ")}}var ve=(()=>{class t{constructor(){this.inputValue="",this.labelValue="",this.inputType="input",this.labelVisible=!0,this.disabled=!1,this.class="mb-6",this.tooltip="",this.isInputFilled=!1,this.isNotEmpty=pe.IsNotEmpty}inputValueType(){return typeof this.inputValue}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["lib-info-page-input"]],inputs:{inputValue:"inputValue",labelValue:"labelValue",inputType:"inputType",labelVisible:"labelVisible",disabled:"disabled",class:"class",tooltip:"tooltip"},decls:5,vars:14,consts:[["matTooltipPosition","above",3,"ngClass","matTooltip"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"innerHTML"]],template:function(o,n){o&1&&(a(0,"div",0),m(1,ye,3,3,"p",1)(2,xe,2,3,"p",2),a(3,"label"),m(4,Ie,2,1,"ng-container",1),l()()),o&2&&(S(n.class),p("ngClass",I(9,Ce,n.disabled))("matTooltip",n.tooltip),r(),p("ngIf",n.isNotEmpty(n.inputValue)&&n.inputType=="input"),r(),p("ngIf",n.isNotEmpty(n.inputValue)&&n.inputType=="textarea"),r(),S(J(11,_e,n.isNotEmpty(n.inputValue),!n.isNotEmpty(n.inputValue))),r(),p("ngIf",n.labelVisible))},dependencies:[P,K,Q,X,ge,ce,de],styles:["div[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;margin-bottom:1rem;border-radius:.25rem!important}p[_ngcontent-%COMP%]{margin-top:18px;margin-bottom:18px;padding-left:.75rem!important;font-size:.875rem}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}.labelEmptyInput[_ngcontent-%COMP%]{margin-top:18px;margin-bottom:18px;padding-left:.75rem!important;font-size:.875rem;color:#ccc}.disabled[_ngcontent-%COMP%]{background-color:#e9ecef;opacity:1}"]})}}return t})();var Pe=t=>({ID:t});function Me(t,d){if(t&1){let e=B();a(0,"button",24),G("click",function(){N(e);let n=c(2),i=C(0);return R(n.onDeleteUser(i==null||i.selectedUser==null?null:i.selectedUser.ID))}),u(1,"i",25),s(2," Delete "),l()}}function Se(t,d){if(t&1&&(g(0),m(1,Me,3,0,"button",23),v()),t&2){let e,o=c(),n=C(0);r(),T((n==null||n.selectedUser==null?null:n.selectedUser.Name)!==((e=o.currentLoginUser())==null?null:e.username)?1:-1)}}function Te(t,d){if(t&1&&(g(0),a(1,"a",26),u(2,"i",27),s(3," Edit "),l(),v()),t&2){c();let e=C(0);r(),p("queryParams",I(1,Pe,e==null||e.selectedUser==null?null:e.selectedUser.ID))}}function Ue(t,d){t&1&&(a(0,"div",20),s(1," All channels assigned to this user "),l())}function De(t,d){if(t&1&&u(0,"p-chip",28),t&2){let e=d.$implicit;p("label",e.Name)("image",e.logo)("alt",e.Name)}}function Ee(t,d){if(t&1&&A(0,De,1,3,"p-chip",28,k),t&2){c();let e=C(0);H(e==null?null:e.selectedChannels)}}var ot=(()=>{class t{constructor(){this.userService=b(D),this.activatedRoute=b(Y),this.toastService=b(ae),this.router=b(ee),this.userLoader$=this.activatedRoute.queryParams.pipe(w(e=>{let o=e.ID||null;return this.userService.getUserFormLoader(o).pipe(V(1),M(n=>(n.Options.Channels=oe.assignChannelLogo(n.Options.Channels),n)))}),M(e=>{let o=e.Options.Users.find(f=>f.ID===e.Form?.ID),n=e.Options.Groups.find(f=>f.ID===e.Form?.GroupID),i=e.Options.Channels.filter(f=>e.UserChannels?.includes(f.ID));return O(E({},e),{selectedUser:o||null,selectedGroup:n||null,selectedChannels:i||[],DownloadOrderDaysRange:e.Form?.DownloadOrderDaysRange||"0"})})),this.userEditRole=U.UserEdit,this.userDeleteRole=U.UserDelete,this.currentLoginUser=Z(()=>{let e=localStorage.getItem(re.AUTHORIZATION);return e?JSON.parse(e):null})}onDeleteUser(e){confirm("Are you sure you want to delete this user?")&&this.userService.deleteUsers([e]).subscribe({next:()=>{this.router.navigate(["/menu/users/users"]),this.toastService.success("User deleted successfully","Success")}})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-user-info"]],features:[j([D])],decls:50,vars:12,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","group","aria-label","User Actions",1,"btn-group"],[4,"ngxPermissionsOnly"],[1,"container-fluid","py-5","bg-light-gray"],[1,"row","mt-8"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body","mt-8","pb-4"],[1,"row"],[1,"col-6"],[1,"info-label-group"],["id","myTab","role","tablist",1,"nav","nav-tabs"],["role","presentation",1,"nav-item"],["id","channel-tab","data-bs-toggle","tab","data-bs-target","#channel-tab-pane","type","button","role","tab","aria-controls","channel-tab-pane","aria-selected","true",1,"nav-link","active"],["id","restriction-tab","data-bs-toggle","tab","data-bs-target","#restriction-tab-pane","type","button","role","tab","aria-controls","restriction-tab-pane","aria-selected","false",1,"nav-link"],[1,"card","rounded-0","border-top-0"],[1,"card-body","pb-4"],["id","myTabContent",1,"tab-content"],["id","channel-tab-pane","role","tabpanel","aria-labelledby","channel-tab","tabindex","0",1,"tab-pane","fade","show","active"],[1,"text-center","fs-5","opacity-50"],["id","restriction-tab-pane","role","tabpanel","aria-labelledby","restriction-tab-pane","tabindex","1",1,"tab-pane","fade"],["tooltip","How many days of past orders this user can download.","labelValue","Download Order Days Range","inputType","input",3,"inputValue"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash","me-1"],["role","button","routerLink","/menu/users/users/form",1,"btn","btn-outline-secondary",3,"queryParams"],[1,"fa","fa-edit","me-1"],[1,"me-3","mb-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"label","image","alt"]],template:function(o,n){if(o&1&&(q(0),_(1,"async"),a(2,"mainpanel",0)(3,"actions")(4,"div",1),m(5,Se,2,1,"ng-container",2)(6,Te,4,3,"ng-container",2),l()(),a(7,"content")(8,"div",3)(9,"div",4)(10,"div",5)(11,"div",6)(12,"div",7)(13,"h3"),s(14,"User Information"),l()(),a(15,"div",8)(16,"div",9)(17,"div",10)(18,"div",11)(19,"label"),s(20,"Selected User"),l(),a(21,"div")(22,"span"),s(23),l()()()(),a(24,"div",10)(25,"div",11)(26,"label"),s(27,"Selected Group"),l(),a(28,"div")(29,"span"),s(30),l()()()()()()()()(),a(31,"div",9)(32,"div",5)(33,"ul",12)(34,"li",13)(35,"button",14),s(36," Channels Filter "),l()(),a(37,"li",13)(38,"button",15),s(39," Restriction "),l()()(),a(40,"div",16)(41,"div",17)(42,"div",18)(43,"div",19),m(44,Ue,2,0,"div",20)(45,Ee,2,0),l(),a(46,"div",21)(47,"div",9)(48,"div",10),u(49,"lib-info-page-input",22),l()()()()()()()()()()()),o&2){let i=$(y(1,9,n.userLoader$));r(2),p("headerTitle",(i==null||i.selectedUser==null?null:i.selectedUser.Name)+" Info")("hideSearchBox",!0)("hideSearchDropdown",!0),r(3),p("ngxPermissionsOnly",n.userDeleteRole),r(),p("ngxPermissionsOnly",n.userEditRole),r(17),h(i==null||i.selectedUser==null?null:i.selectedUser.Name),r(7),h(i==null||i.selectedGroup==null?null:i.selectedGroup.Name),r(14),T((i==null||i.selectedChannels==null?null:i.selectedChannels.length)===0?44:45),r(5),p("inputValue",i==null?null:i.DownloadOrderDaysRange)}},dependencies:[P,W,ue,me,ie,ne,te,fe,se,le,ve],styles:[".nav-tabs[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%]:hover, .nav-tabs[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%]:focus, .nav-tabs[_ngcontent-%COMP%] .nav-item.show[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:hover, .nav-tabs[_ngcontent-%COMP%] .nav-item.show[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:focus{background-color:#fff!important;border-color:#dee2e6 #dee2e6 #fff}"]})}}return t})();export{ot as UserInfoComponent};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-BMYBLBSP.js";import{b as ie}from"./chunk-PHUHUFYL.js";import{a as X}from"./chunk-5RAWBW2Q.js";import"./chunk-EHUVS2VB.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import{a as Y,b as Z}from"./chunk-WRJFUNM3.js";import"./chunk-JVNHFIYT.js";import{i as Q}from"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as J}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-RXQX7567.js";import{m as ee,n as te}from"./chunk-HJXYT6MI.js";import{A as q,c as G,h as z,m as K}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as W,H as j,J as $,f as x,g as V,h as A,n as H}from"./chunk-FXQKRJWU.js";import{Fc as v,Gb as C,Gc as p,Hb as k,Hc as B,Ic as L,Ka as M,Kc as O,Lc as F,Mb as m,Mc as R,Qc as P,Sc as w,Yb as l,ic as n,ja as I,jc as i,ka as T,kc as c,lc as f,mc as _,oa as U,ob as N,oc as S,rb as a,tc as y,uc as d,xb as D,ya as g,za as h}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var _e=e=>[e];function ge(e,s){if(e&1&&(f(0),n(1,"a",9),p(2),i(),_()),e&2){let t=s.$implicit;a(),l("routerLink",w(2,_e,t.url)),a(),L(" ",t.title,"")}}var ce=(()=>{class e{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-download"]],standalone:!1,decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(o,r){o&1&&(n(0,"nav",0)(1,"div",1)(2,"div"),c(3,"nav-tab",2),i()(),n(4,"div")(5,"div",3)(6,"a",4),c(7,"i",5),i(),n(8,"div",6)(9,"div",7),m(10,ge,3,4,"ng-container",8),i()()()()(),c(11,"router-outlet")),o&2&&(a(3),l("Tabs",r.tabs),a(7),l("ngForOf",r.moreMenu))},dependencies:[x,Y,W,j],encapsulation:2})}}return e})();var E=(()=>{class e{constructor(t){this.httpService=t}download(t){return this.httpService.post("/api/Product/downloadurl",t)}static{this.\u0275fac=function(o){return new(o||e)(U(J))}}static{this.\u0275prov=I({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Se=e=>({"background-color":e});function Ce(e,s){if(e&1&&(n(0,"th"),p(1),i()),e&2){let t=s.$implicit;a(),B(t.column)}}function ye(e,s){if(e&1&&(f(0),n(1,"td"),c(2,"span",6),i(),_()),e&2){let t=s.$implicit,o=d().$implicit;a(2),l("innerHTML",o[t.prop],N)}}function ve(e,s){if(e&1&&(n(0,"tr",5),m(1,ye,3,1,"ng-container",3),i()),e&2){let t=s.$implicit,o=d();l("ngStyle",w(2,Se,t.Status>200?"#F4D6D5":"#DEE9C9")),a(),l("ngForOf",o.configs)}}var de=(()=>{class e{constructor(){this.eventClose=new M}ngOnInit(){}onClose(){this.eventClose.emit()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},standalone:!1,decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(o,r){o&1&&(n(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),m(4,Ce,2,1,"th",3),i()(),n(5,"tbody"),m(6,ve,2,4,"tr",4),i()()()),o&2&&(a(4),l("ngForOf",r.configs),a(2),l("ngForOf",r.data))},dependencies:[x,A],encapsulation:2})}}return e})();function xe(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onNewStepperState(u))}),c(2,"i",16),p(3," New "),i(),_()}}function be(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t),d();let r=v(11);return h(r.previous())}),p(2," Back "),i(),_()}}function Ee(e,s){if(e&1){let t=S();f(0),n(1,"button",17),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onStepperNext(u))}),p(2," Next "),i(),_()}}function De(e,s){if(e&1){let t=S();f(0),n(1,"button",18),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onSubmit(u))}),p(2,"Download"),i(),_()}if(e&2){let t=d();a(),l("disabled",!t.urls)}}function Ie(e,s){e&1&&(c(0,"i",19),n(1,"span"),p(2,"Instruction"),i())}function Te(e,s){e&1&&(n(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),p(4,"Note"),i()(),n(5,"div",24)(6,"ol",25)(7,"li"),p(8," Use this form to Download Products from Tokopedia using product URL "),i(),n(9,"li"),p(10," Copy Product URL from "),n(11,"a",26),p(12,"https://seller.tokopedia.com/ "),i(),p(13," and paste in this form "),i(),n(14,"li"),p(15," Use New Line when you want to input several product URLs "),i()()()()())}function Ue(e,s){e&1&&(c(0,"i",27),n(1,"span"),p(2,"Download"),i())}function Me(e,s){if(e&1){let t=S();n(0,"div",20)(1,"textarea",28),R("ngModelChange",function(r){g(t);let u=d();return F(u.urls,r)||(u.urls=r),h(r)}),i()()}if(e&2){let t=d();a(),l("placeholder",t.urlPlaceholder),O("ngModel",t.urls)}}function Ne(e,s){e&1&&(c(0,"i",29),n(1,"span"),p(2,"Finish"),i())}function ke(e,s){if(e&1&&(n(0,"div",20),c(1,"app-response-api-list",30),i()),e&2){let t=d();a(),l("data",t.downloadResponses)("configs",t.configs)}}function Be(e,s){e&1&&(n(0,"h6"),p(1,"1"),i())}function Le(e,s){e&1&&(n(0,"h6"),p(1,"2"),i())}function Oe(e,s){e&1&&(n(0,"h6"),p(1,"3"),i())}var ue=(()=>{class e{constructor(t,o){this.downloadService=t,this.authService=o,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
|
|
2
|
+
https://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat`,this.currentDomain=this.authService.getDomain()}onStepperChange(t){this.stepperState=t.selectedStep.state}onSubmit(t){let o=this.urls.split(/\r?\n/);this.downloadService.download(o).subscribe(r=>{this.downloadResponses=r,this.mappingLinkToProduct(),this.onStepperNext(t)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(t=>(t.Name=t?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${t.ID}" target="_blank">
|
|
3
|
+
${t?.Name}
|
|
4
|
+
</a>`:"-",t))}onNewStepperState(t){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",t.reset(),this.onStepperNext(t)}onStepperNext(t){t.selected.completed=!0,t.next()}static{this.\u0275fac=function(o){return new(o||e)(D(E),D(Q))}}static{this.\u0275cmp=C({type:e,selectors:[["app-by-url"]],standalone:!1,features:[P([{provide:ne,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:11,consts:[["stepper",""],["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["linear","",1,"stepper-downloadByUrl",3,"selectionChange","selectedIndex"],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","DOWNLOAD",3,"editable","completed"],["state","FINISH"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"click","disabled"],[1,"fa-solid","fa-info","me-3"],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],[1,"fa-solid","fa-download","me-3"],["name","url","cols","30","rows","25",1,"form-control",3,"ngModelChange","placeholder","ngModel"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],["status","error",3,"data","configs"]],template:function(o,r){if(o&1){let u=S();n(0,"mainpanel",1)(1,"actions"),m(2,xe,4,0,"ng-container",2)(3,be,3,0,"ng-container",2)(4,Ee,3,0,"ng-container",2)(5,De,3,1,"ng-container",2),i(),n(6,"content")(7,"div",3)(8,"div",4)(9,"div",5)(10,"mat-stepper",6,0),y("selectionChange",function(fe){return g(u),h(r.onStepperChange(fe))}),n(12,"mat-step",7),m(13,Ie,3,0,"ng-template",8)(14,Te,16,0,"ng-template",9),i(),n(15,"mat-step",10),m(16,Ue,3,0,"ng-template",8)(17,Me,2,2,"ng-template",9),i(),n(18,"mat-step",11),m(19,Ne,3,0,"ng-template",8)(20,ke,2,2,"ng-template",9),i(),m(21,Be,2,0,"ng-template",12)(22,Le,2,0,"ng-template",13)(23,Oe,2,0,"ng-template",14),i()()()()()()}o&2&&(l("hideSearchBox",!0)("hideSearchDropdown",!0),a(2),l("ngIf",r.stepperState=="FINISH"),a(),l("ngIf",r.stepperState=="DOWNLOAD"),a(),l("ngIf",r.stepperState=="GUIDE"),a(),l("ngIf",r.stepperState=="DOWNLOAD"),a(5),l("selectedIndex",1),a(2),l("editable",r.stepperState!="FINISH")("completed",!0),a(3),l("editable",r.stepperState!="FINISH")("completed",!1))},dependencies:[V,G,z,K,ee,le,oe,pe,re,ae,de],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}
|
|
5
|
+
`],encapsulation:2})}}return e})();var Fe=[{path:"",component:ce,children:[{path:"by-url",component:ue,data:{title:"Download Product By Url"},canActivate:[X]},{pathMatch:"full",path:"",redirectTo:"by-url"}]}],ct=(()=>{class e{static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275mod=k({type:e})}static{this.\u0275inj=T({providers:[E],imports:[H,q,Z,te,se,ie,$.forChild(Fe)]})}}return e})();export{ct as DownloadModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as w}from"./chunk-
|
|
1
|
+
import{b as w}from"./chunk-UWC2EVFY.js";import"./chunk-ACIMXBIC.js";import"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-RXQX7567.js";import{m as k,n as B}from"./chunk-HJXYT6MI.js";import"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{E as P,H as T,J as R,g as D,j as C,k as b,m as y,n as M}from"./chunk-FXQKRJWU.js";import{$c as c,Gb as h,Gc as n,Hc as d,Ic as _,Mb as s,Yb as m,aa as I,ad as E,bd as x,ic as i,jc as t,lc as f,mc as u,rb as o,uc as S,v as g,xb as v}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function N(a,p){if(a&1&&(i(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),n(4,"Perflog"),t()(),i(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),n(9),t()()()()()()),a&2){let e=S().ngIf;o(9),d(e.Perflog)}}function L(a,p){if(a&1&&(f(0),i(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),n(5,"StackTrace"),t()(),i(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),n(10),t()()()()()(),u()),a&2){let e=S().ngIf;o(10),d(e==null?null:e.StackTrace)}}function A(a,p){if(a&1&&(f(0),i(1,"mainpanel",1)(2,"actions")(3,"a",2),n(4,"Back"),t()(),i(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),n(12,"General"),t()(),i(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),n(18,"Created Date"),t(),i(19,"div")(20,"span"),n(21),c(22,"date"),t()()()(),i(23,"div",10)(24,"div",11)(25,"label"),n(26,"Status"),t(),i(27,"div")(28,"span"),n(29),t()()()()(),i(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),n(34,"Duration"),t(),i(35,"div")(36,"span"),n(37),c(38,"number"),t()()()(),i(39,"div",10)(40,"div",11)(41,"label"),n(42,"Label"),t(),i(43,"div")(44,"span"),n(45),t()()()()()()()()(),i(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),n(51,"Message"),t()(),i(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),n(56),t()()()()()(),s(57,N,10,1,"div",16)(58,L,11,1,"ng-container",0),t()()()(),u()),a&2){let e=p.ngIf;o(),m("headerTitle","Notification "+e.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),o(20),d(x(22,10,e.Created,"dd MMM yyyy HH:mm:ss")),o(8),d(e.StatusLabel),o(8),_("",x(38,13,e.DurationInSecond,"1.1-1")," s"),o(8),d(e.Label),o(11),d(e.Message),o(),m("ngIf",e==null?null:e.Perflog),o(),m("ngIf",e==null?null:e.StackTrace)}}var K=(()=>{class a{constructor(e,r){this.activatedRoute=e,this.notificationService=r}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(I(e=>{let r=e.ID;return this.notificationService.getNotificationDetail(r).pipe(g(l=>(l.DurationInSecond=parseInt(l.Duration)/1e3,l)))}))}static{this.\u0275fac=function(r){return new(r||a)(v(P),v(w))}}static{this.\u0275cmp=h({type:a,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/products/status/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(r,l){r&1&&(s(0,A,59,16,"ng-container",0),c(1,"async")),r&2&&m("ngIf",E(1,1,l.notification$))},dependencies:[M,D,C,y,b,B,k,R,T],encapsulation:2})}}return a})();export{K as DetailComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-5RAWBW2Q.js";import{a as h,b as C}from"./chunk-WRJFUNM3.js";import"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-RXQX7567.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as f,J as n,n as o}from"./chunk-FXQKRJWU.js";import{Gb as l,Hb as c,Yb as s,ic as u,jc as d,ka as p,kc as i,rb as m}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var v=(()=>{class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,g){t&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),d()()(),i(4,"router-outlet")),t&2&&(m(3),s("Tabs",g.priceTabs))},dependencies:[o,C,h,n,f],encapsulation:2})}}return e})();var b=[{path:"",component:v,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-5JBIRETU.js").then(e=>e.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-LRKVYKNL.js").then(e=>e.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=c({type:e})}static{this.\u0275inj=p({imports:[o,n.forChild(b)]})}}return e})();export{D as PriceRoutingModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ae}from"./chunk-67HPC5Y3.js";import{a as ie}from"./chunk-OLANEXLB.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.js";import{a as oe,b as re}from"./chunk-ABYG6YZT.js";import"./chunk-RAQRGWCZ.js";import"./chunk-HVCIQI7B.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import{i as Q}from"./chunk-
|
|
1
|
+
import{a as ae}from"./chunk-67HPC5Y3.js";import{a as ie}from"./chunk-OLANEXLB.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.js";import{a as oe,b as re}from"./chunk-ABYG6YZT.js";import"./chunk-RAQRGWCZ.js";import"./chunk-HVCIQI7B.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import"./chunk-ACIMXBIC.js";import{i as Q}from"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as K}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{a as X,b as Z,d as $,e as ee}from"./chunk-PYXL7UF7.js";import{c as J}from"./chunk-RXQX7567.js";import{m as te,n as ne}from"./chunk-HJXYT6MI.js";import{A as Y,c as U,h as j,m as q,o as G}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as A,J as H,f as W,g as F,k as B,m as k,n as z}from"./chunk-FXQKRJWU.js";import{$c as L,Fc as P,Gb as T,Gc as l,Hc as S,Ic as y,Kc as c,Lc as u,Mb as w,Mc as h,Sc as I,Yb as m,ad as N,bd as V,cd as R,ic as t,jc as n,kc as C,lc as M,mc as x,oc as O,pb as b,rb as r,tc as E,uc as v,xb as D,ya as p,za as s}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var le=a=>({ID:a});function de(a,f){if(a&1&&(t(0,"span",17),C(1,"img",18),n(),l(2)),a&2){let e=f.item;r(),m("src",e.Img,b)("alt",e.Name),r(),y(" ",e.Name," ")}}function me(a,f){if(a&1&&(t(0,"tr")(1,"td"),l(2),n(),t(3,"td"),C(4,"img",28),n(),t(5,"td"),l(6),n(),t(7,"td",29)(8,"a",30),l(9),L(10,"number"),n()(),t(11,"td"),l(12),n(),t(13,"td"),l(14),L(15,"date"),n()()),a&2){let e=f.$implicit;r(2),S(e._source.ChannelName),r(2),m("src",e.logo,b),r(2),S(e._source.DateRange),r(2),m("queryParams",I(12,le,e._source.ID)),r(),y(" ",N(10,7,e._source.CountOrder)," "),r(3),S(e._source.UserLogin),r(2),y(" ",V(15,9,e._source["@timestamp_received"],"dd MMM yyyy HH:mm")," ")}}function pe(a,f){if(a&1){let e=O();M(0),t(1,"div",19)(2,"table",20)(3,"thead")(4,"tr",21)(5,"th",22),l(6,"Channel"),n(),t(7,"th",23),l(8,"Type"),n(),t(9,"th",24),l(10,"Download Date Range"),n(),t(11,"th",25),l(12,"Count"),n(),t(13,"th"),l(14,"User Login"),n(),t(15,"th"),l(16,"Created"),n()()(),t(17,"tbody"),w(18,me,16,14,"tr",26),n()(),t(19,"mat-paginator",27),E("page",function(i){p(e);let d=v();return s(d.onPaginationChange(i))}),n()(),x()}if(a&2){let e=v();r(18),m("ngForOf",e.downloadOrders),r(),m("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function se(a,f){a&1&&(t(0,"div",31),C(1,"app-empty-state"),n())}var xe=(()=>{class a{constructor(e,g){this.http=e,this.authService=g,this.filter={PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""},this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(e=>{this.filter=e.Filter,this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter).subscribe(e=>{this.downloadOrders=e.hits,this.setChannelLogo(),this.paginationTotal=e.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}setChannelLogo(){this.downloadOrders=this.downloadOrders.map(e=>(e.logo=J.getChannelLogoByTypeId(e._source.TypeID),e))}onPaginationChange(e){this.filter.PageNumber=e.pageIndex+1,this.getDownloadOrders()}static{this.\u0275fac=function(g){return new(g||a)(D(K),D(Q))}}static{this.\u0275cmp=T({type:a,selectors:[["app-download-order-log"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/Order/Download_Order_Log/Detail",3,"queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(g,i){if(g&1){let d=O();t(0,"mainpanel",1),E("onSubmit",function(){return p(d),s(i.getDownloadOrders())}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),n(),t(5,"ng-select",3),h("ngModelChange",function(o){return p(d),u(i.filter.ChannelID,o)||(i.filter.ChannelID=o),s(o)}),w(6,de,3,3,"ng-template",4),n()(),t(7,"div",5)(8,"label",6),l(9,"From/To"),n(),t(10,"div",7)(11,"datepicker",8),h("dateChange",function(o){return p(d),u(i.filter.From,o)||(i.filter.From=o),s(o)}),n()(),t(12,"div")(13,"datepicker",9),h("dateChange",function(o){return p(d),u(i.filter.To,o)||(i.filter.To=o),s(o)}),n()()(),t(14,"div",5)(15,"label",10),l(16,"Page Number"),n(),t(17,"input",11),h("ngModelChange",function(o){return p(d),u(i.filter.PageNumber,o)||(i.filter.PageNumber=o),s(o)}),n()(),t(18,"div",5)(19,"label",10),l(20,"Page Size"),n(),t(21,"input",12),h("ngModelChange",function(o){return p(d),u(i.filter.RowCount,o)||(i.filter.RowCount=o),s(o)}),n()()(),t(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),w(26,pe,20,4,"ng-container",16)(27,se,2,0,"ng-template",null,0,R),n()()()()()}if(g&2){let d=P(28);m("hideSearchBox",!0),r(5),m("clearable",!0)("items",i.channelOptions),c("ngModel",i.filter.ChannelID),r(6),c("date",i.filter.From),r(2),c("date",i.filter.To),r(4),c("ngModel",i.filter.PageNumber),r(4),c("ngModel",i.filter.RowCount),r(5),m("ngIf",(i.downloadOrders==null?null:i.downloadOrders.length)>0)("ngIfElse",d)}},dependencies:[z,W,F,k,B,re,oe,ne,te,ee,$,X,Z,Y,U,G,j,q,ae,H,A,ie],encapsulation:2})}}return a})();export{xe as DownloadOrderLogComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as wt}from"./chunk-RHHHL4OR.js";import{b as vt}from"./chunk-IHSGQFDX.js";import{a as Tt}from"./chunk-HIC5QC3Y.js";import{a as mt}from"./chunk-UMP6ZMEJ.js";import{b as pt,e as dt}from"./chunk-WN5DZGA4.js";import{b as ct}from"./chunk-
|
|
1
|
+
import{a as wt}from"./chunk-RHHHL4OR.js";import{b as vt}from"./chunk-IHSGQFDX.js";import{a as Tt}from"./chunk-HIC5QC3Y.js";import{a as mt}from"./chunk-UMP6ZMEJ.js";import{b as pt,e as dt}from"./chunk-WN5DZGA4.js";import{b as ct}from"./chunk-RXQX7567.js";import{b as _t,c as Ct,h as bt,j as xt,k as Pt}from"./chunk-HJXYT6MI.js";import{A as lt,c as at,h as rt,m as st}from"./chunk-5PS6ZS3N.js";import{a as gt,c as ut}from"./chunk-ERXVXBTU.js";import{r as ht,s as ft}from"./chunk-MFQQEEHJ.js";import{g as L,i as ot,m as $,n as R}from"./chunk-FXQKRJWU.js";import{$c as I,Fc as V,G as W,Gb as S,Gc as m,Hc as w,Ic as A,Jb as Z,K as z,Ka as D,Kc as et,Lc as it,Mb as u,Mc as nt,Oa as f,Ra as C,X as J,Yb as h,Z as Y,ad as y,ca as q,cd as U,dc as P,ea as F,f as H,fa as K,g as G,ic as r,ja as M,jc as s,kc as j,lc as T,mc as v,nc as tt,oa as Q,oc as _,pa as X,rb as a,rd as N,tc as b,uc as l,v as x,xb as E,ya as d,za as g}from"./chunk-OJMQBH6T.js";function Mt(i,p){i&1&&tt(0)}function Dt(i,p){if(i&1&&(T(0),u(1,Mt,1,0,"ng-container",5),v()),i&2){l(2);let t=V(4);a(),h("ngTemplateOutlet",t)}}function Et(i,p){if(i&1&&(r(0,"div",6)(1,"label"),m(2,"Editing Data"),s(),r(3,"div")(4,"span"),m(5),I(6,"number"),s()()()),i&2){let t=l(2);a(5),w(y(6,1,t.value))}}function St(i,p){if(i&1&&(T(0),u(1,Dt,2,1,"ng-container",4)(2,Et,7,3,"ng-template",null,1,U),v()),i&2){let t=V(3),e=l();a(),h("ngIf",e.hasPriceEdit)("ngIfElse",t)}}function Vt(i,p){if(i&1){let t=_();r(0,"div",7)(1,"input",8),nt("ngModelChange",function(n){d(t);let o=l();return it(o.value,n)||(o.value=n),g(n)}),s(),r(2,"label",9),m(3),s()()}if(i&2){let t=l();a(),et("ngModel",t.value),h("max",t.maxEditInventory),a(2),w(t.item.Table)}}var te=(()=>{class i{constructor(t,e,n){this.dialogRef=t,this.item=e,this.permissionService=n,this.maxEditInventory=1e5,this.permissionService.hasPermission(mt.PriceUpdate).then(o=>this.hasPriceEdit=o)}ngOnInit(){this.selectedChannel=this.item.Variant.Channel.find(t=>t.ChannelID==this.item.ChannelID),this.selectedChannel.ID=this.item.Variant.ID,this.selectedChannel.Sku=this.item.Variant.Code,this.item.Table=="inventory"?(this.value=this.selectedChannel.Inventory,this.maxEditInventory=this.selectedChannel?.TypeID==ct.Tokopedia?1e5:null):this.item.Table=="price"&&(this.value=this.selectedChannel.Price,this.maxEditInventory=null),this.selectedChannel.ItemName=this.item.Name,this.selectedChannel.VarName=this.item.Variant.Model,this.initModalConfig()}initModalConfig(){let t=this.item.Table=="inventory"?"Update Inventory":"Update Price";this.modalConfig=new xt,this.modalConfig.title=`${t} ${this.item?.Name} in ${this.selectedChannel?.Title}`}onSubmit(){this.item.Table=="inventory"?this.selectedChannel.Inventory=this.value:this.item.Table=="price"&&(this.selectedChannel.Price=this.value),this.dialogRef.close(this.selectedChannel)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(e){return new(e||i)(E(_t),E(Ct),E(gt))}}static{this.\u0275cmp=S({type:i,selectors:[["app-table-dialog"]],decls:5,vars:4,consts:[["INVENTORY",""],["DISABLED",""],[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["matTooltipPosition","above","matTooltip","Cannot edit Unit Price because you dont have access ProductEditor role",1,"info-label-group","mt-3",2,"background","#e9ecef","opacity","1"],[1,"form-label-group","mt-3"],["type","text","name","edit","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"],["for","edit",1,"text-capitalize"]],template:function(e,n){if(e&1){let o=_();r(0,"modal-material",2),b("onClose",function(){return d(o),g(n.onClose())})("onCancel",function(){return d(o),g(n.onClose())})("onOk",function(){return d(o),g(n.onSubmit())}),r(1,"div",3),u(2,St,4,2,"ng-container",4)(3,Vt,4,3,"ng-template",null,0,U),s()()}if(e&2){let o=V(4);h("dynamicValidated",n.value)("config",n.modalConfig),a(2),h("ngIf",n.item.Table=="price")("ngIfElse",o)}},dependencies:[R,L,ot,$,bt,Tt,vt,wt,Pt,lt,at,rt,st,ut,ft,ht],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-left:1rem;margin-right:1rem}.mat-dialog-content[_ngcontent-%COMP%]{padding-left:.5rem;padding-right:.5rem;margin-left:.5rem;margin-right:.5rem}.font-lg[_ngcontent-%COMP%]{font-size:large}.font-lgr[_ngcontent-%COMP%]{font-size:larger}"]})}}return i})();var ie=(()=>{class i{transform(t,e,n=0){if(!t)return t;let o=e?parseInt(e,10):10;return t.length>o?t.substring(n,o)+"...":t}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275pipe=Z({name:"stringLimit",type:i,pure:!0})}}return i})();function Lt(i,p){if(i&1){let t=_();r(0,"span",6),b("click",function(){d(t);let n=l();return g(n.onGetRowCount())}),r(1,"i",7),m(2,"?"),s()()}}function $t(i,p){if(i&1&&(T(0),r(1,"span"),m(2),I(3,"number"),s(),v()),i&2){let t=l();a(2),w(y(3,1,t.rowCount()))}}function Rt(i,p){if(i&1){let t=_();r(0,"a",10),b("click",function(){d(t);let n=l(2);return g(n.onNextPage())}),j(1,"i",11),m(2," Next"),s()}}function Ot(i,p){if(i&1){let t=_();r(0,"a",12),b("click",function(){d(t);let n=l(2);return g(n.onLastPage())}),j(1,"i",13),m(2," Last"),s()}}function kt(i,p){if(i&1&&(r(0,"div",5),u(1,Rt,3,0,"a",8)(2,Ot,3,0,"a",9),s()),i&2){let t=l();a(),P(t.disableNextButton()&&!t.goToLastPage()?1:-1),a(),P(t.disableNextButton()&&!t.goToLastPage()?2:-1)}}var le=(()=>{class i{constructor(){this.totalData=f(0),this.rowCount=f(),this.pageNumber=f(),this.disableNextButton=f(),this.goToLastPage=f(),this.hideCount=f(),this.nextPage=new D,this.lastPage=new D,this.getRowCount=new D}onNextPage(){this.nextPage.emit()}onLastPage(){this.lastPage.emit()}onGetRowCount(){this.getRowCount.emit()}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=S({type:i,selectors:[["infinite-paginator"]],inputs:{totalData:[1,"totalData"],rowCount:[1,"rowCount"],pageNumber:[1,"pageNumber"],disableNextButton:[1,"disableNextButton"],goToLastPage:[1,"goToLastPage"],hideCount:[1,"hideCount"]},outputs:{nextPage:"onNextPage",lastPage:"onLastPage",getRowCount:"onGetRowCount"},decls:9,vars:7,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],[2,"cursor","pointer"],[4,"ngIf"],[1,"btn-group"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"div",1)(2,"div",2),m(3),I(4,"number"),u(5,Lt,3,0,"span",3)(6,$t,4,3,"ng-container",4),m(7),s()(),u(8,kt,3,2,"div",5),s()),e&2&&(a(3),A(" Showing 1 - ",y(4,5,n.totalData())," of "),a(2),P(n.hideCount()?5:-1),a(),h("ngIf",!n.hideCount()&&n.rowCount()),a(),A(" records ~ ",n.pageNumber()," Page "),a(),P(n.totalData()>0?8:-1))},dependencies:[R,L,$],encapsulation:2})}}return i})();var ue=(()=>{class i{constructor(t){this.http=t,this.pagination$=new G(null),this._pageNumber=C(1),this.pageNumber=N(()=>this._pageNumber()),this._hideCount=C(!0),this.hideCount=N(()=>this._hideCount()),this._disableNextButton=C(!0),this.disableNextButton=N(()=>this._disableNextButton()),this._goToLastPage=C(!1),this.isLastPage=N(()=>this._goToLastPage()),this.totalData=C(0),this.destroy$=new H,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this._pageNumber.set(t.PageNumber)}setPaginationButtonState(t,e){e==0?this._disableNextButton.set(!0):this._disableNextButton.set(!(e<t.RowCount*t.PageNumber))}reloadPagination(t){t.PageNumber=1,this.pagination$.next(t),this._hideCount.set(!0),this._goToLastPage.set(!1)}onLastPage(t={}){let e=JSON.parse(JSON.stringify(t));this.totalRowCount$=this.http.post(`/api/${this.fethRowCountEndpoint}`,e).pipe(x(n=>n.Total),F(n=>{this._hideCount.set(!1),e.RowCount=n,e.PageNumber=1,this.pagination$.next(e),this._goToLastPage.set(!0)}))}paginationFunction(){return this.pagination$.pipe(q(this.destroy$),W(t=>t!=null),z(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(x(e=>e.Data?e.Data:[]))),K(this.pagination$),J((t,e)=>{let[n,o]=t,[c]=e;return o.PageNumber==1?[c,o]:[n.concat(c),o]}),F(([t,e])=>{this.setPageNumberFooter(e);let n=this.calculateProductLength(t);this.totalData.set(n),this.setPaginationButtonState(e,n)}),x(([t])=>t),Y())}getRowCount(t){this._hideCount.set(!1),this.totalRowCount$=this.http.post(`/API/${this.fethRowCountEndpoint}`,t).pipe(x(e=>e.Total))}calculateProductLength(t=[]){return t.reduce((n,o)=>n+(o.Variants?.length?o.Variants?.length:0),0)}static{this.\u0275fac=function(e){return new(e||i)(Q(dt))}}static{this.\u0275prov=M({token:i,factory:i.\u0275fac})}}return i})();var be=(()=>{class i{constructor(){this.toastr=X(pt)}responseHandling(t=[],e=[],n,o=[]){let c=t.length>0,k=e.length>0;if(!k&&c&&this.toastr.success(`${this.generateSuccessMessage(t.length,o)}`,"Success",{enableHtml:!0}),k&&c){let B=`<li>${this.generateSuccessMessage(t.length)}</li>`,It=this.generateErrorMessage(n,e),yt=`<ol>${B} ${It}</ol>`;this.toastr.warning(yt,"Warning",{enableHtml:!0})}if(k&&!c){let B=`<ol>${this.generateErrorMessage(n,e)}</ol>`;this.toastr.error(B,"Error",{enableHtml:!0})}}generateSuccessMessage(t,e=[]){let n=e.length>1?e.length:1;return`
|
|
2
2
|
<div>
|
|
3
3
|
<span class="fw-bold">Successfully</span> updated ${t} variants in ${n} channels
|
|
4
4
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k}from"./chunk-PIBVGTHJ.js";import{a as be}from"./chunk-A44LN77B.js";import{a as Me}from"./chunk-PQQSREEC.js";import{a as Ve}from"./chunk-GH5FTODR.js";import{a as Te,b as De}from"./chunk-EPBVNII2.js";import{b as ke,c as Ee}from"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as Y}from"./chunk-UMP6ZMEJ.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as ue}from"./chunk-Z3ITXK3D.js";import"./chunk-CGOB6Y3X.js";import{b as Z}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{d as Ce,e as fe}from"./chunk-PYXL7UF7.js";import{c as de}from"./chunk-PW42BQIY.js";import{b as xe,c as te,d as ye,j as Se,k as ve,m as Ue,n as we}from"./chunk-HJXYT6MI.js";import{A as H,b as me,h as q,m as j}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as _e,b as ge,c as he}from"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as ce,J as pe,j as $,n as z}from"./chunk-FXQKRJWU.js";import{$b as K,$c as F,G as se,Gb as B,Gc as g,Hc as Q,Ic as D,Kb as le,Kc as U,Lc as w,Mb as f,Mc as M,Nc as O,Oc as N,Pc as h,Qc as W,Ra as S,Rc as X,Sc as ee,Yb as _,Z as E,ad as A,dc as v,ea as J,ec as V,gc as P,hc as I,ic as o,jc as s,kc as L,lc as b,mc as T,oc as y,pa as x,pb as ae,q as oe,rb as a,rd as R,tc as C,uc as l,v as G,ya as c,za as p}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as ne,b as re}from"./chunk-66YHNWRR.js";var ie=function(i){return i.ERROR="https://res.cloudinary.com/pos/image/upload/v1705387550/POS/Images/Cashier/globalerror.svg",i.UNAUTHORIZED="https://res.cloudinary.com/pos/image/upload/v1702547639/POS/Images/Dashboard/locked.svg",i.EMPTY_LIST="https://res.cloudinary.com/pos/image/upload/v1705388070/POS/Images/Cashier/globalnodata.svg",i.REMOVE="https://res.cloudinary.com/pos/image/upload/v1706156973/icons/globalerrorclear.svg",i}(ie||{});var Pe=()=>({display:"d-flex"});function Ae(i,m){if(i&1&&(o(0,"div",6),L(1,"img",9),o(2,"p",10),g(3," All users already migrated. "),s()()),i&2){let e=l();a(),_("src",e.emptyStateIcon,ae)}}function Re(i,m){if(i&1){let e=y();o(0,"div",14)(1,"p-checkBox",15),M("ngModelChange",function(t){let n=c(e).$implicit;return w(n.selected,t)||(n.selected=t),p(t)}),C("ngModelChange",function(){c(e);let t=l(2),n=h(0);return p(t.onUserCheckChange(n))}),s(),o(2,"label",16),g(3),s()()}if(i&2){let e=m.$implicit;a(),K(X(7,Pe)),_("binary",!0)("id",e.ID),U("ngModel",e.selected),a(),_("for",e.ID),a(),D(" ",e.Name," ")}}function Ge(i,m){if(i&1){let e=y();o(0,"div",11)(1,"p-checkBox",12),M("ngModelChange",function(t){c(e);let n=l();return w(n.isCheckAll,t)||(n.isCheckAll=t),p(t)}),C("ngModelChange",function(t){c(e);let n=l(),d=h(0);return p(n.onCheckAllChange(t,d))}),s(),o(2,"label",13),g(3," Check All "),s()(),P(4,Re,4,8,"div",14,V)}if(i&2){let e=l(),r=h(0);a(),K(X(4,Pe)),_("binary",!0),U("ngModel",e.isCheckAll),a(3),I(r)}}var Ie=(()=>{class i extends be{constructor(){super(),this.dialogRef=x(xe),this.data=x(te),this.userService=x(k),this.dialogData=x(te),this.toastr=x(Z),this.userGroups=R(()=>this.dialogData.userGroups||[]),this.availableUsers=R(()=>{let e=new Map;return this.dialogData.availableUsers.forEach(r=>e.set(r.ID,r)),e}),this.migrateLoader$=this.userService.getUserMigrateLoader().pipe(G(e=>e.Data),G(e=>e.filter(t=>this.availableUsers().has(t.ID)===!1)),G(e=>e.map(t=>(t.selected=!0,t))),E(1)),this.isCheckAll=S(!0),this.selectedGroup=S(null),this.emptyStateIcon=ie.EMPTY_LIST,this.config=new Se,this.config.title="Migrate Users",this.config.customWidth="600px"}ngAfterViewInit(){this.initTopPosition()}ngOnDestroy(){this.stopOverlayObserver()}onUserCheckChange(e){let r=e.every(t=>t.selected);this.isCheckAll.set(r)}onCheckAllChange(e,r){this.isCheckAll.set(e),r.forEach(t=>t.selected=e)}onClose(){this.dialogRef.close(!1)}onSubmit(e){let r=e.filter(n=>n.selected);if(r.length===0){this.toastr.error("Please select at least one user","Error");return}if(de.IsEmpty(this.selectedGroup())){this.toastr.error("Please select a user group","Error");return}let t={userIds:r.map(n=>n.ID),groupId:this.selectedGroup()};this.userService.migrateUser(t).subscribe(()=>{this.dialogRef.close(!0),this.toastr.success("Users migrated successfully","Success")})}onClickSelect(){setTimeout(()=>{this.adjustOverlayPosition()},0)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-migrate-dialog"]],features:[W([k]),le],decls:15,vars:8,consts:[[3,"onClose","onCancel","onOk","config"],["content",""],[1,"row"],[1,"col","border-end"],[1,"modal-title","mb-8"],[1,"user-list-scroll","mt-5",2,"max-height","300x","overflow-y","auto","overflow-x","hidden","box-sizing","border-box"],[1,"d-flex","flex-column","align-items-center","mt-5"],[1,"col"],["optionLabel","Name","optionValue","ID","placeholder","Select a group","filterBy","Name","appendTo","body",1,"w-100",3,"click","ngModelChange","options","filter","ngModel"],["alt","No users found",2,"width","100px","height","100px",3,"src"],[1,"text-muted","mt-4","opacity-50",2,"margin-bottom","0px"],[1,"d-flex","w-100","align-items-center","mb-4"],["id","checkBoxAll",3,"ngModelChange","binary","ngModel"],["for","checkBoxAll",1,"ms-2"],[1,"d-flex","w-100","align-items-center","mb-3","ms-10"],[3,"ngModelChange","binary","id","ngModel"],[1,"ms-2",3,"for"]],template:function(r,t){if(r&1){let n=y();O(0),F(1,"async"),o(2,"modal-material",0),C("onClose",function(){return c(n),p(t.onClose())})("onCancel",function(){return c(n),p(t.onClose())})("onOk",function(){c(n);let u=h(0);return p(t.onSubmit(u))}),o(3,"div",1)(4,"div",2)(5,"div",3)(6,"h5",4),g(7,"Users from POS"),s(),o(8,"div",5),f(9,Ae,4,1,"div",6)(10,Ge,6,5),s()(),o(11,"div",7)(12,"h5",4),g(13,"Assign Group"),s(),o(14,"p-select",8),C("click",function(){return c(n),p(t.onClickSelect())}),M("ngModelChange",function(u){return c(n),w(t.selectedGroup,u)||(t.selectedGroup=u),p(u)}),s()()()()()}if(r&2){let n=N(A(1,5,t.migrateLoader$));a(2),_("config",t.config),a(7),v((n==null?null:n.length)===0?9:10),a(5),_("options",t.userGroups())("filter",!0),U("ngModel",t.selectedGroup)}},dependencies:[z,$,ve,H,q,j,ke,Me],styles:[".user-list-scroll[_ngcontent-%COMP%]{max-height:160px;overflow-y:auto;overflow-x:hidden;box-sizing:border-box}"]})}}return i})();var Le=i=>({ID:i});function Be(i,m){if(i&1){let e=y();o(0,"button",13),C("click",function(){c(e);let t=l(2),n=h(0);return p(t.onDeleteUser(n==null?null:n.Filter))}),L(1,"i",14),g(2),s()}if(i&2){let e,r=l(2);a(2),D(" Delete (",(e=r.selectedUsers())==null?null:e.length,") ")}}function We(i,m){if(i&1&&(b(0),f(1,Be,3,1,"button",12),T()),i&2){let e,r=l();a(),v(((e=r.selectedUsers())==null?null:e.length)>0?1:-1)}}function $e(i,m){if(i&1){let e=y();b(0),o(1,"button",15),C("click",function(){c(e);let t=l(),n=h(0),d=h(2);return p(t.onMigrateUser(n==null||n.Options==null?null:n.Options.Groups,d==null?null:d.Data))}),g(2," Migrate "),s(),T()}}function ze(i,m){i&1&&(b(0),o(1,"a",16),g(2," Invite "),s(),T())}function qe(i,m){if(i&1){let e=y();b(0),o(1,"th",17)(2,"div",18)(3,"input",19),C("change",function(t){c(e);let n=l(),d=h(2);return p(n.onCheckAllUser(t.target.checked,d==null?null:d.Data))}),s()()(),T()}}function je(i,m){if(i&1){let e=y();o(0,"div",18)(1,"input",23),M("ngModelChange",function(t){c(e);let n=l(2).$implicit;return w(n.checked,t)||(n.checked=t),p(t)}),C("ngModelChange",function(){c(e);let t=l(3),n=h(2);return p(t.onSelectUser(n==null?null:n.Data))}),s()()}if(i&2){let e=l(2).$implicit;a(),U("ngModel",e.checked)}}function He(i,m){if(i&1&&(b(0),o(1,"td"),f(2,je,2,1,"div",18),s(),T()),i&2){let e,r=l().$implicit,t=l();a(2),v(r.Name!==((e=t.currentLoginUser())==null?null:e.username)?2:-1)}}function Ye(i,m){if(i&1&&(o(0,"a",20),g(1),s()),i&2){let e=l().$implicit;_("queryParams",ee(2,Le,e.UserID)),a(),D(" ",e.Name," ")}}function Ze(i,m){if(i&1&&(o(0,"span"),g(1),s()),i&2){let e=l().$implicit;a(),Q(e.Name)}}function Je(i,m){if(i&1&&(o(0,"a",21),g(1),s()),i&2){let e=l().$implicit;_("queryParams",ee(2,Le,e.GroupID)),a(),D(" ",e.GroupName," ")}}function Ke(i,m){if(i&1&&(o(0,"span"),g(1),s()),i&2){let e=l().$implicit;a(),Q(e.GroupName)}}function Qe(i,m){if(i&1&&L(0,"p-chip",24),i&2){let e=m.$implicit;_("label",e.Name)("image",e.Logo)("alt",e.Name)}}function Xe(i,m){if(i&1&&P(0,Qe,1,3,"p-chip",24,V),i&2){let e=l().$implicit;I(e.Channels)}}function et(i,m){i&1&&(o(0,"span"),g(1,"All Channels"),s())}function tt(i,m){if(i&1&&(o(0,"tr"),f(1,He,3,1,"ng-container",3),o(2,"td"),f(3,Ye,2,4,"a",20)(4,Ze,2,1,"span"),s(),o(5,"td"),f(6,Je,2,4,"a",21)(7,Ke,2,1,"span"),s(),o(8,"td")(9,"div",22),f(10,Xe,2,0)(11,et,2,0,"span"),s()()()),i&2){let e=m.$implicit,r=l();a(),_("ngxPermissionsOnly",r.userDeleteRole),a(2),v(r.hasUserEditRole()?3:4),a(3),v(r.hasUserEditRole()?6:7),a(4),v((e.Channels==null?null:e.Channels.length)>0?10:11)}}function it(i,m){if(i&1){let e=y();o(0,"app-mat-paginator-no-count",25),C("next",function(){c(e);let t=l(),n=h(0);return p(t.onNextPage(n==null?null:n.Filter))})("previous",function(){c(e);let t=l(),n=h(0);return p(t.onPrevPage(n==null?null:n.Filter))}),s()}if(i&2){l();let e=h(0),r=h(2);_("filter",e==null?null:e.Filter)("totaldata",r==null||r.Data==null?null:r.Data.length)("paginationTotal",r==null?null:r.Count)("hasClicked",!0)("alwaysShowNextButton",!0)}}var zt=(()=>{class i{constructor(){this.usersService=x(k),this.permissionService=x(_e),this.toastService=x(Z),this.dialog=x(ye),this.userInviteOptions=S([]),this.searchText=S(null),this.selectedGroup=S(null),this.userLoader$=this.usersService.getLoader().pipe(J(e=>{this.userInviteOptions.set(e.Options.Users),this.initUsers(e.Filter)}),E(1)),this.users$=oe({Count:0,Data:[]}),this.userAddRole=Y.UserInvite,this.userDeleteRole=Y.UserDelete,this.hasUserEditRole=S(!1),this.selectedUsers=S([]),this.currentLoginUser=R(()=>{let e=localStorage.getItem(ue.AUTHORIZATION);return e?JSON.parse(e):null}),this.permissionService.hasPermission(Y.UserEdit).then(e=>{this.hasUserEditRole.set(e)})}initUsers(e){let r=re(ne({},e),{Name:this.searchText(),GroupID:this.selectedGroup()});this.users$=this.usersService.getUsers(r).pipe(J(t=>this.filterUserInvtiteOptions(t.Data)),E(1))}filterUserInvtiteOptions(e){this.userInviteOptions.update(r=>r.filter(t=>e.findIndex(n=>n.UserID===t.ID)===-1))}onCheckAllUser(e,r){r.forEach(n=>{n.Name!==this.currentLoginUser()?.username&&(n.checked=e)});let t=r.filter(n=>n.checked);this.selectedUsers.set(t)}onSelectUser(e){let r=e.filter(t=>t.checked);this.selectedUsers.set(r)}onDeleteUser(e={PageNumber:1,PageSize:10}){let r=this.selectedUsers().map(n=>n.UserID);confirm("Are you sure you want to delete selected users?")&&this.usersService.deleteUsers(r).subscribe(()=>{this.selectedUsers.set([]),this.toastService.success("User deleted successfully","Success"),this.initUsers(e)})}onMigrateUser(e,r){this.dialog.open(Ie,{data:{userGroups:e,availableUsers:r}}).afterClosed().pipe(se(t=>t===!0)).subscribe(()=>{this.initUsers({PageNumber:1,PageSize:10})})}onNextPage(e){e.PageNumber+=1,this.initUsers(e)}onPrevPage(e){e.PageNumber-=1,this.initUsers(e)}onSuccessUpdateUser(e){e.PageNumber=1,this.initUsers(e)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-users"]],features:[W([k])],decls:33,vars:17,consts:[["headerTitle","Users","description","Manage your users and their permissions",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","ID","placeholder","Select Group",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[4,"ngxPermissionsOnly"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","15%"],[3,"filter","totaldata","paginationTotal","hasClicked","alwaysShowNextButton"],[3,"onSuccessUpdateUser","groups","users"],[1,"btn","btn-danger","me-3"],[1,"btn","btn-danger","me-3",3,"click"],[1,"fa","fa-trash","me-1"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["role","button","routerLink","/menu/users/users/form",1,"btn","btn-success"],[2,"width","5px"],[1,"d-flex"],["name","selectAll","type","checkbox",3,"change"],["routerLink","/menu/users/users/info",3,"queryParams"],["routerLink","/menu/users/groups/info",3,"queryParams"],[1,"lh-base"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"me-3","mb-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"label","image","alt"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","alwaysShowNextButton"]],template:function(r,t){if(r&1){let n=y();O(0),F(1,"async"),O(2),F(3,"async"),o(4,"mainpanel",0),M("textChange",function(u){return c(n),w(t.searchText,u)||(t.searchText=u),p(u)}),C("onSubmit",function(){c(n);let u=h(0);return p(t.initUsers(u==null?null:u.Filter))}),o(5,"filters")(6,"div")(7,"label",1),g(8,"Group"),s(),o(9,"ng-select",2),M("ngModelChange",function(u){return c(n),w(t.selectedGroup,u)||(t.selectedGroup=u),p(u)}),s()()(),o(10,"actions"),f(11,We,2,1,"ng-container",3)(12,$e,3,0,"ng-container",3)(13,ze,3,0,"ng-container",3),s(),o(14,"content")(15,"div",4)(16,"div",5)(17,"div",6)(18,"table",7)(19,"thead",8)(20,"tr"),f(21,qe,4,0,"ng-container",3),o(22,"th",9),g(23,"Login ID"),s(),o(24,"th",9),g(25,"Group"),s(),o(26,"th"),g(27,"Channel"),s()()(),o(28,"tbody"),P(29,tt,12,4,"tr",null,V),s()(),f(31,it,1,5,"app-mat-paginator-no-count",10),s()()()()(),o(32,"invite-group",11),C("onSuccessUpdateUser",function(){c(n);let u=h(0);return p(t.onSuccessUpdateUser(u==null?null:u.Filter))}),s()}if(r&2){let n=N(A(1,11,t.userLoader$));a(2);let d=N(A(3,14,t.users$));a(2),U("text",t.searchText),a(5),_("clearable",!0)("items",n==null||n.Options==null?null:n.Options.Groups),U("ngModel",t.selectedGroup),a(2),_("ngxPermissionsOnly",t.userDeleteRole),a(),_("ngxPermissionsOnly",t.userAddRole),a(),_("ngxPermissionsOnly",t.userAddRole),a(8),_("ngxPermissionsOnly",t.userDeleteRole),a(8),I(d==null?null:d.Data),a(2),v(n?31:-1),a(),_("groups",n==null||n.Options==null?null:n.Options.Groups)("users",t.userInviteOptions())}},dependencies:[z,$,we,Ue,pe,ce,Ve,he,ge,fe,Ce,H,me,q,j,Ee,De,Te],encapsulation:2})}}return i})();export{zt as UsersComponent};
|
|
1
|
+
import{a as k}from"./chunk-PIBVGTHJ.js";import{a as be}from"./chunk-A44LN77B.js";import{a as Me}from"./chunk-PQQSREEC.js";import{a as Ve}from"./chunk-GH5FTODR.js";import{a as Te,b as De}from"./chunk-EPBVNII2.js";import{b as ke,c as Ee}from"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as Y}from"./chunk-UMP6ZMEJ.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as ue}from"./chunk-Z3ITXK3D.js";import"./chunk-CGOB6Y3X.js";import{b as Z}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{d as Ce,e as fe}from"./chunk-PYXL7UF7.js";import{c as de}from"./chunk-RXQX7567.js";import{b as xe,c as te,d as ye,j as Se,k as ve,m as Ue,n as we}from"./chunk-HJXYT6MI.js";import{A as H,b as me,h as q,m as j}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as _e,b as ge,c as he}from"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as ce,J as pe,j as $,n as z}from"./chunk-FXQKRJWU.js";import{$b as K,$c as F,G as se,Gb as B,Gc as g,Hc as Q,Ic as D,Kb as le,Kc as U,Lc as w,Mb as f,Mc as M,Nc as O,Oc as N,Pc as h,Qc as W,Ra as S,Rc as X,Sc as ee,Yb as _,Z as E,ad as A,dc as v,ea as J,ec as V,gc as P,hc as I,ic as o,jc as s,kc as L,lc as b,mc as T,oc as y,pa as x,pb as ae,q as oe,rb as a,rd as R,tc as C,uc as l,v as G,ya as c,za as p}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as ne,b as re}from"./chunk-66YHNWRR.js";var ie=function(i){return i.ERROR="https://res.cloudinary.com/pos/image/upload/v1705387550/POS/Images/Cashier/globalerror.svg",i.UNAUTHORIZED="https://res.cloudinary.com/pos/image/upload/v1702547639/POS/Images/Dashboard/locked.svg",i.EMPTY_LIST="https://res.cloudinary.com/pos/image/upload/v1705388070/POS/Images/Cashier/globalnodata.svg",i.REMOVE="https://res.cloudinary.com/pos/image/upload/v1706156973/icons/globalerrorclear.svg",i}(ie||{});var Pe=()=>({display:"d-flex"});function Ae(i,m){if(i&1&&(o(0,"div",6),L(1,"img",9),o(2,"p",10),g(3," All users already migrated. "),s()()),i&2){let e=l();a(),_("src",e.emptyStateIcon,ae)}}function Re(i,m){if(i&1){let e=y();o(0,"div",14)(1,"p-checkBox",15),M("ngModelChange",function(t){let n=c(e).$implicit;return w(n.selected,t)||(n.selected=t),p(t)}),C("ngModelChange",function(){c(e);let t=l(2),n=h(0);return p(t.onUserCheckChange(n))}),s(),o(2,"label",16),g(3),s()()}if(i&2){let e=m.$implicit;a(),K(X(7,Pe)),_("binary",!0)("id",e.ID),U("ngModel",e.selected),a(),_("for",e.ID),a(),D(" ",e.Name," ")}}function Ge(i,m){if(i&1){let e=y();o(0,"div",11)(1,"p-checkBox",12),M("ngModelChange",function(t){c(e);let n=l();return w(n.isCheckAll,t)||(n.isCheckAll=t),p(t)}),C("ngModelChange",function(t){c(e);let n=l(),d=h(0);return p(n.onCheckAllChange(t,d))}),s(),o(2,"label",13),g(3," Check All "),s()(),P(4,Re,4,8,"div",14,V)}if(i&2){let e=l(),r=h(0);a(),K(X(4,Pe)),_("binary",!0),U("ngModel",e.isCheckAll),a(3),I(r)}}var Ie=(()=>{class i extends be{constructor(){super(),this.dialogRef=x(xe),this.data=x(te),this.userService=x(k),this.dialogData=x(te),this.toastr=x(Z),this.userGroups=R(()=>this.dialogData.userGroups||[]),this.availableUsers=R(()=>{let e=new Map;return this.dialogData.availableUsers.forEach(r=>e.set(r.ID,r)),e}),this.migrateLoader$=this.userService.getUserMigrateLoader().pipe(G(e=>e.Data),G(e=>e.filter(t=>this.availableUsers().has(t.ID)===!1)),G(e=>e.map(t=>(t.selected=!0,t))),E(1)),this.isCheckAll=S(!0),this.selectedGroup=S(null),this.emptyStateIcon=ie.EMPTY_LIST,this.config=new Se,this.config.title="Migrate Users",this.config.customWidth="600px"}ngAfterViewInit(){this.initTopPosition()}ngOnDestroy(){this.stopOverlayObserver()}onUserCheckChange(e){let r=e.every(t=>t.selected);this.isCheckAll.set(r)}onCheckAllChange(e,r){this.isCheckAll.set(e),r.forEach(t=>t.selected=e)}onClose(){this.dialogRef.close(!1)}onSubmit(e){let r=e.filter(n=>n.selected);if(r.length===0){this.toastr.error("Please select at least one user","Error");return}if(de.IsEmpty(this.selectedGroup())){this.toastr.error("Please select a user group","Error");return}let t={userIds:r.map(n=>n.ID),groupId:this.selectedGroup()};this.userService.migrateUser(t).subscribe(()=>{this.dialogRef.close(!0),this.toastr.success("Users migrated successfully","Success")})}onClickSelect(){setTimeout(()=>{this.adjustOverlayPosition()},0)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-migrate-dialog"]],features:[W([k]),le],decls:15,vars:8,consts:[[3,"onClose","onCancel","onOk","config"],["content",""],[1,"row"],[1,"col","border-end"],[1,"modal-title","mb-8"],[1,"user-list-scroll","mt-5",2,"max-height","300x","overflow-y","auto","overflow-x","hidden","box-sizing","border-box"],[1,"d-flex","flex-column","align-items-center","mt-5"],[1,"col"],["optionLabel","Name","optionValue","ID","placeholder","Select a group","filterBy","Name","appendTo","body",1,"w-100",3,"click","ngModelChange","options","filter","ngModel"],["alt","No users found",2,"width","100px","height","100px",3,"src"],[1,"text-muted","mt-4","opacity-50",2,"margin-bottom","0px"],[1,"d-flex","w-100","align-items-center","mb-4"],["id","checkBoxAll",3,"ngModelChange","binary","ngModel"],["for","checkBoxAll",1,"ms-2"],[1,"d-flex","w-100","align-items-center","mb-3","ms-10"],[3,"ngModelChange","binary","id","ngModel"],[1,"ms-2",3,"for"]],template:function(r,t){if(r&1){let n=y();O(0),F(1,"async"),o(2,"modal-material",0),C("onClose",function(){return c(n),p(t.onClose())})("onCancel",function(){return c(n),p(t.onClose())})("onOk",function(){c(n);let u=h(0);return p(t.onSubmit(u))}),o(3,"div",1)(4,"div",2)(5,"div",3)(6,"h5",4),g(7,"Users from POS"),s(),o(8,"div",5),f(9,Ae,4,1,"div",6)(10,Ge,6,5),s()(),o(11,"div",7)(12,"h5",4),g(13,"Assign Group"),s(),o(14,"p-select",8),C("click",function(){return c(n),p(t.onClickSelect())}),M("ngModelChange",function(u){return c(n),w(t.selectedGroup,u)||(t.selectedGroup=u),p(u)}),s()()()()()}if(r&2){let n=N(A(1,5,t.migrateLoader$));a(2),_("config",t.config),a(7),v((n==null?null:n.length)===0?9:10),a(5),_("options",t.userGroups())("filter",!0),U("ngModel",t.selectedGroup)}},dependencies:[z,$,ve,H,q,j,ke,Me],styles:[".user-list-scroll[_ngcontent-%COMP%]{max-height:160px;overflow-y:auto;overflow-x:hidden;box-sizing:border-box}"]})}}return i})();var Le=i=>({ID:i});function Be(i,m){if(i&1){let e=y();o(0,"button",13),C("click",function(){c(e);let t=l(2),n=h(0);return p(t.onDeleteUser(n==null?null:n.Filter))}),L(1,"i",14),g(2),s()}if(i&2){let e,r=l(2);a(2),D(" Delete (",(e=r.selectedUsers())==null?null:e.length,") ")}}function We(i,m){if(i&1&&(b(0),f(1,Be,3,1,"button",12),T()),i&2){let e,r=l();a(),v(((e=r.selectedUsers())==null?null:e.length)>0?1:-1)}}function $e(i,m){if(i&1){let e=y();b(0),o(1,"button",15),C("click",function(){c(e);let t=l(),n=h(0),d=h(2);return p(t.onMigrateUser(n==null||n.Options==null?null:n.Options.Groups,d==null?null:d.Data))}),g(2," Migrate "),s(),T()}}function ze(i,m){i&1&&(b(0),o(1,"a",16),g(2," Invite "),s(),T())}function qe(i,m){if(i&1){let e=y();b(0),o(1,"th",17)(2,"div",18)(3,"input",19),C("change",function(t){c(e);let n=l(),d=h(2);return p(n.onCheckAllUser(t.target.checked,d==null?null:d.Data))}),s()()(),T()}}function je(i,m){if(i&1){let e=y();o(0,"div",18)(1,"input",23),M("ngModelChange",function(t){c(e);let n=l(2).$implicit;return w(n.checked,t)||(n.checked=t),p(t)}),C("ngModelChange",function(){c(e);let t=l(3),n=h(2);return p(t.onSelectUser(n==null?null:n.Data))}),s()()}if(i&2){let e=l(2).$implicit;a(),U("ngModel",e.checked)}}function He(i,m){if(i&1&&(b(0),o(1,"td"),f(2,je,2,1,"div",18),s(),T()),i&2){let e,r=l().$implicit,t=l();a(2),v(r.Name!==((e=t.currentLoginUser())==null?null:e.username)?2:-1)}}function Ye(i,m){if(i&1&&(o(0,"a",20),g(1),s()),i&2){let e=l().$implicit;_("queryParams",ee(2,Le,e.UserID)),a(),D(" ",e.Name," ")}}function Ze(i,m){if(i&1&&(o(0,"span"),g(1),s()),i&2){let e=l().$implicit;a(),Q(e.Name)}}function Je(i,m){if(i&1&&(o(0,"a",21),g(1),s()),i&2){let e=l().$implicit;_("queryParams",ee(2,Le,e.GroupID)),a(),D(" ",e.GroupName," ")}}function Ke(i,m){if(i&1&&(o(0,"span"),g(1),s()),i&2){let e=l().$implicit;a(),Q(e.GroupName)}}function Qe(i,m){if(i&1&&L(0,"p-chip",24),i&2){let e=m.$implicit;_("label",e.Name)("image",e.Logo)("alt",e.Name)}}function Xe(i,m){if(i&1&&P(0,Qe,1,3,"p-chip",24,V),i&2){let e=l().$implicit;I(e.Channels)}}function et(i,m){i&1&&(o(0,"span"),g(1,"All Channels"),s())}function tt(i,m){if(i&1&&(o(0,"tr"),f(1,He,3,1,"ng-container",3),o(2,"td"),f(3,Ye,2,4,"a",20)(4,Ze,2,1,"span"),s(),o(5,"td"),f(6,Je,2,4,"a",21)(7,Ke,2,1,"span"),s(),o(8,"td")(9,"div",22),f(10,Xe,2,0)(11,et,2,0,"span"),s()()()),i&2){let e=m.$implicit,r=l();a(),_("ngxPermissionsOnly",r.userDeleteRole),a(2),v(r.hasUserEditRole()?3:4),a(3),v(r.hasUserEditRole()?6:7),a(4),v((e.Channels==null?null:e.Channels.length)>0?10:11)}}function it(i,m){if(i&1){let e=y();o(0,"app-mat-paginator-no-count",25),C("next",function(){c(e);let t=l(),n=h(0);return p(t.onNextPage(n==null?null:n.Filter))})("previous",function(){c(e);let t=l(),n=h(0);return p(t.onPrevPage(n==null?null:n.Filter))}),s()}if(i&2){l();let e=h(0),r=h(2);_("filter",e==null?null:e.Filter)("totaldata",r==null||r.Data==null?null:r.Data.length)("paginationTotal",r==null?null:r.Count)("hasClicked",!0)("alwaysShowNextButton",!0)}}var zt=(()=>{class i{constructor(){this.usersService=x(k),this.permissionService=x(_e),this.toastService=x(Z),this.dialog=x(ye),this.userInviteOptions=S([]),this.searchText=S(null),this.selectedGroup=S(null),this.userLoader$=this.usersService.getLoader().pipe(J(e=>{this.userInviteOptions.set(e.Options.Users),this.initUsers(e.Filter)}),E(1)),this.users$=oe({Count:0,Data:[]}),this.userAddRole=Y.UserInvite,this.userDeleteRole=Y.UserDelete,this.hasUserEditRole=S(!1),this.selectedUsers=S([]),this.currentLoginUser=R(()=>{let e=localStorage.getItem(ue.AUTHORIZATION);return e?JSON.parse(e):null}),this.permissionService.hasPermission(Y.UserEdit).then(e=>{this.hasUserEditRole.set(e)})}initUsers(e){let r=re(ne({},e),{Name:this.searchText(),GroupID:this.selectedGroup()});this.users$=this.usersService.getUsers(r).pipe(J(t=>this.filterUserInvtiteOptions(t.Data)),E(1))}filterUserInvtiteOptions(e){this.userInviteOptions.update(r=>r.filter(t=>e.findIndex(n=>n.UserID===t.ID)===-1))}onCheckAllUser(e,r){r.forEach(n=>{n.Name!==this.currentLoginUser()?.username&&(n.checked=e)});let t=r.filter(n=>n.checked);this.selectedUsers.set(t)}onSelectUser(e){let r=e.filter(t=>t.checked);this.selectedUsers.set(r)}onDeleteUser(e={PageNumber:1,PageSize:10}){let r=this.selectedUsers().map(n=>n.UserID);confirm("Are you sure you want to delete selected users?")&&this.usersService.deleteUsers(r).subscribe(()=>{this.selectedUsers.set([]),this.toastService.success("User deleted successfully","Success"),this.initUsers(e)})}onMigrateUser(e,r){this.dialog.open(Ie,{data:{userGroups:e,availableUsers:r}}).afterClosed().pipe(se(t=>t===!0)).subscribe(()=>{this.initUsers({PageNumber:1,PageSize:10})})}onNextPage(e){e.PageNumber+=1,this.initUsers(e)}onPrevPage(e){e.PageNumber-=1,this.initUsers(e)}onSuccessUpdateUser(e){e.PageNumber=1,this.initUsers(e)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-users"]],features:[W([k])],decls:33,vars:17,consts:[["headerTitle","Users","description","Manage your users and their permissions",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","ID","placeholder","Select Group",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[4,"ngxPermissionsOnly"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","15%"],[3,"filter","totaldata","paginationTotal","hasClicked","alwaysShowNextButton"],[3,"onSuccessUpdateUser","groups","users"],[1,"btn","btn-danger","me-3"],[1,"btn","btn-danger","me-3",3,"click"],[1,"fa","fa-trash","me-1"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["role","button","routerLink","/menu/users/users/form",1,"btn","btn-success"],[2,"width","5px"],[1,"d-flex"],["name","selectAll","type","checkbox",3,"change"],["routerLink","/menu/users/users/info",3,"queryParams"],["routerLink","/menu/users/groups/info",3,"queryParams"],[1,"lh-base"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"me-3","mb-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"label","image","alt"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","alwaysShowNextButton"]],template:function(r,t){if(r&1){let n=y();O(0),F(1,"async"),O(2),F(3,"async"),o(4,"mainpanel",0),M("textChange",function(u){return c(n),w(t.searchText,u)||(t.searchText=u),p(u)}),C("onSubmit",function(){c(n);let u=h(0);return p(t.initUsers(u==null?null:u.Filter))}),o(5,"filters")(6,"div")(7,"label",1),g(8,"Group"),s(),o(9,"ng-select",2),M("ngModelChange",function(u){return c(n),w(t.selectedGroup,u)||(t.selectedGroup=u),p(u)}),s()()(),o(10,"actions"),f(11,We,2,1,"ng-container",3)(12,$e,3,0,"ng-container",3)(13,ze,3,0,"ng-container",3),s(),o(14,"content")(15,"div",4)(16,"div",5)(17,"div",6)(18,"table",7)(19,"thead",8)(20,"tr"),f(21,qe,4,0,"ng-container",3),o(22,"th",9),g(23,"Login ID"),s(),o(24,"th",9),g(25,"Group"),s(),o(26,"th"),g(27,"Channel"),s()()(),o(28,"tbody"),P(29,tt,12,4,"tr",null,V),s()(),f(31,it,1,5,"app-mat-paginator-no-count",10),s()()()()(),o(32,"invite-group",11),C("onSuccessUpdateUser",function(){c(n);let u=h(0);return p(t.onSuccessUpdateUser(u==null?null:u.Filter))}),s()}if(r&2){let n=N(A(1,11,t.userLoader$));a(2);let d=N(A(3,14,t.users$));a(2),U("text",t.searchText),a(5),_("clearable",!0)("items",n==null||n.Options==null?null:n.Options.Groups),U("ngModel",t.selectedGroup),a(2),_("ngxPermissionsOnly",t.userDeleteRole),a(),_("ngxPermissionsOnly",t.userAddRole),a(),_("ngxPermissionsOnly",t.userAddRole),a(8),_("ngxPermissionsOnly",t.userDeleteRole),a(8),I(d==null?null:d.Data),a(2),v(n?31:-1),a(),_("groups",n==null||n.Options==null?null:n.Options.Groups)("users",t.userInviteOptions())}},dependencies:[z,$,we,Ue,pe,ce,Ve,he,ge,fe,Ce,H,me,q,j,Ee,De,Te],encapsulation:2})}}return i})();export{zt as UsersComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ae}from"./chunk-OLANEXLB.js";import{a as oe,b as le}from"./chunk-ABYG6YZT.js";import"./chunk-RAQRGWCZ.js";import"./chunk-HVCIQI7B.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import{i as X}from"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as Q}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-PYXL7UF7.js";import{c as K}from"./chunk-RXQX7567.js";import{m as ne,n as ie}from"./chunk-HJXYT6MI.js";import{A as G,h as H,m as U}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as V,k as J,l as W,n as k}from"./chunk-FXQKRJWU.js";import{$c as m,Gb as P,Gc as p,Hc as C,Ic as y,Kc as j,Lc as O,Mb as u,Mc as q,Qc as z,Yb as d,Z as M,aa as D,ad as c,bd as A,dc as R,ec as B,g as L,gc as T,hc as $,ic as i,ja as w,jc as a,kc as f,oc as F,pa as g,pb as S,rb as l,tc as v,uc as x,v as I,ya as E,za as N}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as _}from"./chunk-66YHNWRR.js";var b=(()=>{class n{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(D(e=>this.getLogs$(e).pipe()))}getLogs$(e){return this.httpService.post("/api/Channel/GetChannelLogPaged",e)}onPaginationChange(e){let t=this._pageination.value;t.PageNumber=e.pageIndex+1,this._pageination.next(t)}onFilter(e){let t=this._pageination.value;t.PageNumber=1,t=_(_({},t),e),this._pageination.next(t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=w({token:n,factory:n.\u0275fac})}}return n})();function pe(n,h){if(n&1&&(i(0,"span",10),f(1,"img",11),a(),p(2)),n&2){let e=h.item;l(),d("src",e.Img,S)("alt",e.Name),l(),y(" ",e.Name," ")}}function me(n,h){if(n&1&&(i(0,"tr")(1,"td"),f(2,"img",17),i(3,"span"),p(4),a()(),i(5,"td")(6,"span",18),p(7),m(8,"json"),a()(),i(9,"td"),p(10),m(11,"json"),a(),i(12,"td"),p(13),m(14,"date"),a()()),n&2){let e=h.$implicit;l(2),d("src",e.Img,S),l(2),y(" ",e.ChannelName," "),l(3),C(c(8,5,e.Request)),l(3),C(c(11,7,e.Response)),l(3),C(A(14,9,e.Created,"dd-MM-yyyy hh:mm:ss"))}}function se(n,h){if(n&1){let e=F();i(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),p(5,"Channel"),a(),i(6,"th"),p(7,"Request"),a(),i(8,"th"),p(9,"Response"),a(),i(10,"th",15),p(11,"Created"),a()()(),i(12,"tbody"),T(13,me,15,12,"tr",null,B),m(15,"async"),a()(),i(16,"mat-paginator",16),m(17,"async"),m(18,"async"),m(19,"async"),m(20,"async"),v("page",function(r){E(e);let o=x();return N(o.channelLogService.onPaginationChange(r))}),a()()}if(n&2){let e,t,r,o,s=x();l(13),$((e=c(15,3,s.channelLogs$))==null?null:e.Data),l(3),d("length",(t=c(17,5,s.channelLogs$))==null?null:t.Count)("pageSize",(r=c(18,7,s.filter$))==null?null:r.RowCount)("pageIndex",(o=c(19,9,s.filter$))!=null&&o.PageNumber?0:((o=c(20,11,s.filter$))==null?null:o.PageNumber)-1)}}function ce(n,h){n&1&&(i(0,"div",9),f(1,"app-empty-state"),a())}var Fe=(()=>{class n{constructor(){this.channelLogService=g(b),this.authService=g(X),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(e=>(e.Data?e.Data=e.Data.map(t=>(t.Response=t.Response?JSON.parse(t.Response):"",t.Request=t.Request?JSON.parse(t.Request):"",t.Img=K.getChannelLogoByTypeId(t.TypeID),t)):e.Data=[],e)),M(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-channel-log"]],features:[z([b])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"],[1,""]],template:function(t,r){if(t&1&&(i(0,"mainpanel",0),v("onSubmit",function(){return r.onSubmitFilter()}),i(1,"filters")(2,"div",1)(3,"div")(4,"label",2),p(5,"Channel"),a(),i(6,"ng-select",3),q("ngModelChange",function(s){return O(r.channelID,s)||(r.channelID=s),s}),u(7,pe,3,3,"ng-template",4),a()()()(),i(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,se,21,13,"div",8),m(13,"async"),u(14,ce,2,0,"div",9),a()()()()()),t&2){let o;d("hideSearchBox",!0),l(6),d("clearable",!0)("items",r.channelOptions),j("ngModel",r.channelID),l(6),R(((o=c(13,5,r.channelLogs$))==null||o.Data==null?null:o.Data.length)>0?12:14)}},dependencies:[k,V,W,J,ie,ne,ae,le,oe,te,ee,Y,Z,G,H,U],encapsulation:2})}}return n})();export{Fe as ChannelLogComponent};
|