@knoflows/engine 0.1.0-alpha.8 → 0.1.0-alpha.9

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.
Files changed (37) hide show
  1. package/dist/engine.js +16 -139
  2. package/dist/migrations/20260917165450_baseline/migration.sql +127 -0
  3. package/dist/migrations/20260917165450_baseline/snapshot.json +1212 -0
  4. package/package.json +4 -2
  5. package/static/{chunk-CB7iIlL9.js → chunk-1SlEtaMr.js} +1 -1
  6. package/static/chunk-5H-9s7GP.js +7 -0
  7. package/static/{chunk-He--f9Sf.js → chunk-B-P3MXAn.js} +1 -1
  8. package/static/{chunk-bi3jOaJV.js → chunk-B76UD1mt.js} +1 -1
  9. package/static/{chunk-CoKTfrti.js → chunk-BFYi_kYd.js} +1 -1
  10. package/static/{chunk-DflfYru0.js → chunk-BG0Azip9.js} +1 -1
  11. package/static/{chunk-MRIst_Tv.js → chunk-BWr0M-hk.js} +1 -1
  12. package/static/{chunk-DjiFAEo3.js → chunk-BmSmqIC7.js} +1 -1
  13. package/static/{chunk-CxgNB2C8.js → chunk-Bpxo3nwV.js} +1 -1
  14. package/static/{chunk-CL0Sh0Qb.js → chunk-Bw9D3p4h.js} +1 -1
  15. package/static/{chunk-BEvII7Hn.js → chunk-C-T2O6LE.js} +1 -1
  16. package/static/{chunk-JcYd5MYJ.js → chunk-C1E15gBW.js} +1 -1
  17. package/static/{chunk-mmWflnUN.js → chunk-C1V4WljN.js} +1 -1
  18. package/static/{chunk-Dc_LNQ-q.js → chunk-C3wpjxgW.js} +1 -1
  19. package/static/{chunk-BiLgez1m.js → chunk-C4yhGGeB.js} +1 -1
  20. package/static/{chunk-DO1B2M6l.js → chunk-C5hSEJdm.js} +1 -1
  21. package/static/{chunk-fPx6gQSM.js → chunk-CTkRZ4w1.js} +1 -1
  22. package/static/{chunk-g1iNEPSG.js → chunk-CYX8w88D.js} +1 -1
  23. package/static/{chunk-BQgEbMSp.js → chunk-Cq4-aSSE.js} +1 -1
  24. package/static/{chunk-CQ708Y6F.js → chunk-Cwf9CcBI.js} +1 -1
  25. package/static/{chunk-BYIP8zBR.js → chunk-D32ZkSz4.js} +1 -1
  26. package/static/{chunk-Dqtz3Iow.js → chunk-DE9IK0Os.js} +1 -1
  27. package/static/{chunk-Cuaj1Fgz.js → chunk-DNtWpE65.js} +1 -1
  28. package/static/{chunk-BIFLxIMS.js → chunk-DdVQ8Ilm.js} +1 -1
  29. package/static/{chunk-DTLDtzu5.js → chunk-W0OF0P_2.js} +1 -1
  30. package/static/{chunk-Xv2Lx0k9.js → chunk-WzBVBHEz.js} +1 -1
  31. package/static/{chunk-CNj32s8G.js → chunk-XvSvuf-k.js} +1 -1
  32. package/static/{chunk-BrJS_1Y1.js → chunk-aWIxMbtR.js} +1 -1
  33. package/static/{chunk-BnnoOI-1.js → chunk-f1UVptf5.js} +1 -1
  34. package/static/{chunk-G2CzeazF.js → chunk-vj0RDTCf.js} +1 -1
  35. package/static/index.html +1 -1
  36. package/static/{main-R7YQQZVK.js → main-BRWQ5RNE.js} +1 -1
  37. package/static/chunk-DrlNmyyx.js +0 -7
@@ -1 +1 @@
1
- import {ak as YE,al as uu,C,aN as XI,ao as _r,at as Le,aO as Le$1,aP as N7,aQ as B7,Q as QE,ax as pt,ay as Se,aB as ly,aC as Z0,aR as BD,aS as $D,m as bD,p as gI,B as _D,h as gh,aT as _h,a4 as Mh,aU as fr,aV as pr,F as LD,f as _i,g as Kc,G as Pu,E as VD,I as Lu}from'./main-R7YQQZVK.js';var V=["*"];function x(o,A){if(o&1){let n=LD();_i(0,"nz-icon",1),gh("click",function(e){Pu(n);let i=VD();return Lu(i.closeTag(e))}),Kc();}}var I=(()=>{class o{renderer=C(XI);el=C(_r).nativeElement;dir=C(Le).valueSignal;nzMode="default";nzColor;nzChecked=false;nzBordered=true;nzOnClose=new Le$1;nzCheckedChange=new Le$1;isPresetColor=false;updateCheckedStatus(){this.nzMode==="checkable"&&(this.nzChecked=!this.nzChecked,this.nzCheckedChange.emit(this.nzChecked));}closeTag(n){this.nzOnClose.emit(n),n.defaultPrevented||this.renderer.removeChild(this.renderer.parentNode(this.el),this.el);}clearPresetColor(){let n=new RegExp(`(ant-tag-(?:${[...fr,...pr].join("|")}))`,"g"),t=this.el.classList.toString(),e=[],i=n.exec(t);for(;i!==null;)e.push(i[1]),i=n.exec(t);this.el.classList.remove(...e);}setPresetColor(){this.clearPresetColor(),this.nzColor?this.isPresetColor=N7(this.nzColor)||B7(this.nzColor):this.isPresetColor=false,this.isPresetColor&&this.el.classList.add(`ant-tag-${this.nzColor}`);}ngOnChanges(n){let{nzColor:t}=n;t&&this.setPresetColor();}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=QE({type:o,selectors:[["nz-tag"]],hostAttrs:[1,"ant-tag"],hostVars:12,hostBindings:function(t,e){t&1&&gh("click",function(){return e.updateCheckedStatus()}),t&2&&(_h("background-color",e.isPresetColor?"":e.nzColor),Mh("ant-tag-has-color",e.nzColor&&!e.isPresetColor)("ant-tag-checkable",e.nzMode==="checkable")("ant-tag-checkable-checked",e.nzChecked)("ant-tag-rtl",e.dir()==="rtl")("ant-tag-borderless",!e.nzBordered));},inputs:{nzMode:"nzMode",nzColor:"nzColor",nzChecked:[2,"nzChecked","nzChecked",Z0],nzBordered:[2,"nzBordered","nzBordered",Z0]},outputs:{nzOnClose:"nzOnClose",nzCheckedChange:"nzCheckedChange"},exportAs:["nzTag"],features:[ly],ngContentSelectors:V,decls:2,vars:1,consts:[["nzType","close","tabindex","-1",1,"ant-tag-close-icon"],["nzType","close","tabindex","-1",1,"ant-tag-close-icon",3,"click"]],template:function(t,e){t&1&&(BD(),$D(0),bD(1,x,1,0,"nz-icon",0)),t&2&&(gI(),_D(e.nzMode==="closeable"?1:-1));},dependencies:[pt,Se],encapsulation:2})}return o})(),W=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=YE({type:o});static \u0275inj=uu({imports:[I]})}return o})();export{I,W};
1
+ import {ak as YE,al as uu,C,aN as XI,ao as _r,at as Le,aO as Le$1,aP as N7,aQ as B7,Q as QE,ax as pt,ay as Se,aB as ly,aC as Z0,aR as BD,aS as $D,m as bD,p as gI,B as _D,h as gh,aT as _h,a4 as Mh,aU as fr,aV as pr,F as LD,f as _i,g as Kc,G as Pu,E as VD,I as Lu}from'./main-BRWQ5RNE.js';var V=["*"];function x(o,A){if(o&1){let n=LD();_i(0,"nz-icon",1),gh("click",function(e){Pu(n);let i=VD();return Lu(i.closeTag(e))}),Kc();}}var I=(()=>{class o{renderer=C(XI);el=C(_r).nativeElement;dir=C(Le).valueSignal;nzMode="default";nzColor;nzChecked=false;nzBordered=true;nzOnClose=new Le$1;nzCheckedChange=new Le$1;isPresetColor=false;updateCheckedStatus(){this.nzMode==="checkable"&&(this.nzChecked=!this.nzChecked,this.nzCheckedChange.emit(this.nzChecked));}closeTag(n){this.nzOnClose.emit(n),n.defaultPrevented||this.renderer.removeChild(this.renderer.parentNode(this.el),this.el);}clearPresetColor(){let n=new RegExp(`(ant-tag-(?:${[...fr,...pr].join("|")}))`,"g"),t=this.el.classList.toString(),e=[],i=n.exec(t);for(;i!==null;)e.push(i[1]),i=n.exec(t);this.el.classList.remove(...e);}setPresetColor(){this.clearPresetColor(),this.nzColor?this.isPresetColor=N7(this.nzColor)||B7(this.nzColor):this.isPresetColor=false,this.isPresetColor&&this.el.classList.add(`ant-tag-${this.nzColor}`);}ngOnChanges(n){let{nzColor:t}=n;t&&this.setPresetColor();}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=QE({type:o,selectors:[["nz-tag"]],hostAttrs:[1,"ant-tag"],hostVars:12,hostBindings:function(t,e){t&1&&gh("click",function(){return e.updateCheckedStatus()}),t&2&&(_h("background-color",e.isPresetColor?"":e.nzColor),Mh("ant-tag-has-color",e.nzColor&&!e.isPresetColor)("ant-tag-checkable",e.nzMode==="checkable")("ant-tag-checkable-checked",e.nzChecked)("ant-tag-rtl",e.dir()==="rtl")("ant-tag-borderless",!e.nzBordered));},inputs:{nzMode:"nzMode",nzColor:"nzColor",nzChecked:[2,"nzChecked","nzChecked",Z0],nzBordered:[2,"nzBordered","nzBordered",Z0]},outputs:{nzOnClose:"nzOnClose",nzCheckedChange:"nzCheckedChange"},exportAs:["nzTag"],features:[ly],ngContentSelectors:V,decls:2,vars:1,consts:[["nzType","close","tabindex","-1",1,"ant-tag-close-icon"],["nzType","close","tabindex","-1",1,"ant-tag-close-icon",3,"click"]],template:function(t,e){t&1&&(BD(),$D(0),bD(1,x,1,0,"nz-icon",0)),t&2&&(gI(),_D(e.nzMode==="closeable"?1:-1));},dependencies:[pt,Se],encapsulation:2})}return o})(),W=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=YE({type:o});static \u0275inj=uu({imports:[I]})}return o})();export{I,W};
@@ -1 +1 @@
1
- import {J,K as K$1}from'./chunk-Dqtz3Iow.js';import {U}from'./chunk-MRIst_Tv.js';import {C,U as U$1,T as Ie,V as Ve,a as ae,q as qo,H as Hw,s,r,o,Q as QE,M as Mi,L as Ln,K as Kt,f as _i,v as vw,R as Rw,g as Kc,m as bD,h as gh,N as ND,p as gI,P as Ph,O as Ow,B as _D,w as nl,x as ch,A as xD,E as VD,W as Lh,F as LD,G as Pu,I as Lu}from'./main-R7YQQZVK.js';var L=(t,p)=>p.id;function $(t,p){if(t&1&&(_i(0,"p",3),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function z(t,p){if(t&1&&(_i(0,"option",6),vw(1),Kc()),t&2){let e=p.$implicit;ch("value",e.id),gI(),Lh("",e.name," (",e.id,")");}}function H(t,p){if(t&1){let e=LD();_i(0,"label"),vw(1),Rw(2,"transloco"),_i(3,"input",10),Rw(4,"transloco"),gh("input",function(o){Pu(e);let s=VD(2);return Lu(s.setSubjectId(o))}),Kc()();}if(t&2){let e=VD(2);gI(),nl(" ",Ow(2,3,"jobs.start.subjectId")," "),gI(2),ch("value",e.subjectId())("placeholder",Ow(4,5,"jobs.start.subjectIdPlaceholder"));}}function G(t,p){if(t&1){let e=LD();bD(0,H,5,7,"label"),_i(1,"app-workflow-input-form",9),gh("valuesChange",function(o){Pu(e);let s=VD();return Lu(s.inputValues.set(o))}),Kc();}if(t&2){let e=VD();_D(e.needsSubjectId()?0:-1),gI(),ch("fields",p.inputSchema)("values",e.inputValues());}}function K(t,p){if(t&1&&(_i(0,"p",8),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.actionError());}}var re=(()=>{class t{constructor(){this.workflowsApi=C(U),this.jobsApi=C(U$1),this.router=C(Ie),this.transloco=C(Ve),this.route=C(ae),this.workflows=qo([]),this.selectedWorkflowId=qo(""),this.subjectId=qo(""),this.inputValues=qo({}),this.loadError=qo(null),this.actionError=qo(null),this.starting=qo(false),this.selectedWorkflow=Hw(()=>this.workflows().find(e=>e.id===this.selectedWorkflowId())??null),this.needsSubjectId=Hw(()=>{let e=this.selectedWorkflow();return e!=null&&e.appliesTo!=="none"}),this.workflowsApi.list({subjectHandling:"per-subject"}).subscribe({next:e=>{this.workflows.set(e);let n=this.route.snapshot.queryParamMap.get("workflowId"),o=n&&e.some(C=>C.id===n)?n:e[0]?.id;o&&this.selectWorkflow(o);let s=this.route.snapshot.queryParamMap.get("subjectId");s&&this.subjectId.set(s);},error:e=>{this.loadError.set(this.errorMessage(e,this.transloco.translate("jobs.errors.loadWorkflows")));}});}selectWorkflow(e){this.selectedWorkflowId.set(e);let n=this.workflows().find(o=>o.id===e);this.inputValues.set(J(n?.inputSchema??[])),this.actionError.set(null);}onWorkflowChange(e){let n=e.target.value;this.selectWorkflow(n);}setSubjectId(e){this.subjectId.set(e.target.value);}start(){let e=this.selectedWorkflow();if(e){if(this.needsSubjectId()&&!this.subjectId().trim()){this.actionError.set(this.transloco.translate("jobs.errors.subjectIdRequired"));return}this.actionError.set(null),this.starting.set(true),this.jobsApi.start(s(r({workflowId:e.id},this.needsSubjectId()?{subjectId:this.subjectId().trim()}:{}),{inputValues:r({},this.inputValues())})).subscribe({next:n=>{this.starting.set(false),this.router.navigate(["/jobs",n.id]);},error:n=>{this.starting.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.startFailed")));}});}}errorMessage(e,n){return e instanceof o||e instanceof Error?e.message:n}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-job-runner"]],decls:26,vars:23,consts:[[1,"runner"],["routerLink","/jobs"],[1,"lede"],["data-testid","load-error",1,"error"],["data-testid","start-form",1,"panel"],["data-testid","workflow-select",3,"change","value"],[3,"value"],["data-testid","start-button","type","button",3,"click","disabled"],["data-testid","action-error",1,"error"],[3,"valuesChange","fields","values"],["data-testid","subject-id","type","text",3,"input","value","placeholder"]],template:function(n,o){if(n&1&&(_i(0,"main",0)(1,"a",1),vw(2),Rw(3,"transloco"),Kc(),_i(4,"h1"),vw(5),Rw(6,"transloco"),Kc(),_i(7,"p",2),vw(8),Rw(9,"transloco"),Kc(),bD(10,$,2,1,"p",3),_i(11,"section",4)(12,"h2"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"label"),vw(16),Rw(17,"transloco"),_i(18,"select",5),gh("change",function(C){return o.onWorkflowChange(C)}),ND(19,z,2,3,"option",6,L),Kc()(),bD(21,G,2,3),_i(22,"button",7),gh("click",function(){return o.start()}),vw(23),Rw(24,"transloco"),Kc()(),bD(25,K,2,1,"p",8),Kc()),n&2){let s;gI(2),Ph(Ow(3,11,"jobs.detail.backToStart")),gI(3),Ph(Ow(6,13,"jobs.title")),gI(3),Ph(Ow(9,15,"jobs.lede")),gI(2),_D(o.loadError()?10:-1),gI(3),Ph(Ow(14,17,"jobs.start.heading")),gI(3),nl(" ",Ow(17,19,"jobs.start.workflow")," "),gI(2),ch("value",o.selectedWorkflowId()),gI(),xD(o.workflows()),gI(2),_D((s=o.selectedWorkflow())?21:-1,s),gI(),ch("disabled",o.starting()),gI(),nl(" ",Ow(24,21,o.starting()?"jobs.start.starting":"jobs.start.button")," "),gI(2),_D(o.actionError()?25:-1);}},dependencies:[Mi,Ln,K$1,Kt],styles:[".runner[_ngcontent-%COMP%]{max-width:52rem;margin:0 auto;padding:1.5rem;color:#1c1917;line-height:1.45}.lede[_ngcontent-%COMP%]{color:#57534e}.panel[_ngcontent-%COMP%]{margin-top:1.25rem;padding:1rem 0;border-top:1px solid #d6d3d1}label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.75rem 0;font-size:.95rem}input[type=text][_ngcontent-%COMP%], select[_ngcontent-%COMP%]{font:inherit;padding:.4rem .5rem;border:1px solid #a8a29e;background:#fff}button[_ngcontent-%COMP%]{font:inherit;margin-top:.5rem;padding:.45rem .9rem;border:1px solid #44403c;background:#f5f5f4;cursor:pointer}button[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{re as JobRunnerComponent};
1
+ import {J,K as K$1}from'./chunk-DE9IK0Os.js';import {U}from'./chunk-BWr0M-hk.js';import {C,U as U$1,T as Ie,V as Ve,a as ae,q as qo,H as Hw,s,r,o,Q as QE,M as Mi,L as Ln,K as Kt,f as _i,v as vw,R as Rw,g as Kc,m as bD,h as gh,N as ND,p as gI,P as Ph,O as Ow,B as _D,w as nl,x as ch,A as xD,E as VD,W as Lh,F as LD,G as Pu,I as Lu}from'./main-BRWQ5RNE.js';var L=(t,p)=>p.id;function $(t,p){if(t&1&&(_i(0,"p",3),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function z(t,p){if(t&1&&(_i(0,"option",6),vw(1),Kc()),t&2){let e=p.$implicit;ch("value",e.id),gI(),Lh("",e.name," (",e.id,")");}}function H(t,p){if(t&1){let e=LD();_i(0,"label"),vw(1),Rw(2,"transloco"),_i(3,"input",10),Rw(4,"transloco"),gh("input",function(o){Pu(e);let s=VD(2);return Lu(s.setSubjectId(o))}),Kc()();}if(t&2){let e=VD(2);gI(),nl(" ",Ow(2,3,"jobs.start.subjectId")," "),gI(2),ch("value",e.subjectId())("placeholder",Ow(4,5,"jobs.start.subjectIdPlaceholder"));}}function G(t,p){if(t&1){let e=LD();bD(0,H,5,7,"label"),_i(1,"app-workflow-input-form",9),gh("valuesChange",function(o){Pu(e);let s=VD();return Lu(s.inputValues.set(o))}),Kc();}if(t&2){let e=VD();_D(e.needsSubjectId()?0:-1),gI(),ch("fields",p.inputSchema)("values",e.inputValues());}}function K(t,p){if(t&1&&(_i(0,"p",8),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.actionError());}}var re=(()=>{class t{constructor(){this.workflowsApi=C(U),this.jobsApi=C(U$1),this.router=C(Ie),this.transloco=C(Ve),this.route=C(ae),this.workflows=qo([]),this.selectedWorkflowId=qo(""),this.subjectId=qo(""),this.inputValues=qo({}),this.loadError=qo(null),this.actionError=qo(null),this.starting=qo(false),this.selectedWorkflow=Hw(()=>this.workflows().find(e=>e.id===this.selectedWorkflowId())??null),this.needsSubjectId=Hw(()=>{let e=this.selectedWorkflow();return e!=null&&e.appliesTo!=="none"}),this.workflowsApi.list({subjectHandling:"per-subject"}).subscribe({next:e=>{this.workflows.set(e);let n=this.route.snapshot.queryParamMap.get("workflowId"),o=n&&e.some(C=>C.id===n)?n:e[0]?.id;o&&this.selectWorkflow(o);let s=this.route.snapshot.queryParamMap.get("subjectId");s&&this.subjectId.set(s);},error:e=>{this.loadError.set(this.errorMessage(e,this.transloco.translate("jobs.errors.loadWorkflows")));}});}selectWorkflow(e){this.selectedWorkflowId.set(e);let n=this.workflows().find(o=>o.id===e);this.inputValues.set(J(n?.inputSchema??[])),this.actionError.set(null);}onWorkflowChange(e){let n=e.target.value;this.selectWorkflow(n);}setSubjectId(e){this.subjectId.set(e.target.value);}start(){let e=this.selectedWorkflow();if(e){if(this.needsSubjectId()&&!this.subjectId().trim()){this.actionError.set(this.transloco.translate("jobs.errors.subjectIdRequired"));return}this.actionError.set(null),this.starting.set(true),this.jobsApi.start(s(r({workflowId:e.id},this.needsSubjectId()?{subjectId:this.subjectId().trim()}:{}),{inputValues:r({},this.inputValues())})).subscribe({next:n=>{this.starting.set(false),this.router.navigate(["/jobs",n.id]);},error:n=>{this.starting.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.startFailed")));}});}}errorMessage(e,n){return e instanceof o||e instanceof Error?e.message:n}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-job-runner"]],decls:26,vars:23,consts:[[1,"runner"],["routerLink","/jobs"],[1,"lede"],["data-testid","load-error",1,"error"],["data-testid","start-form",1,"panel"],["data-testid","workflow-select",3,"change","value"],[3,"value"],["data-testid","start-button","type","button",3,"click","disabled"],["data-testid","action-error",1,"error"],[3,"valuesChange","fields","values"],["data-testid","subject-id","type","text",3,"input","value","placeholder"]],template:function(n,o){if(n&1&&(_i(0,"main",0)(1,"a",1),vw(2),Rw(3,"transloco"),Kc(),_i(4,"h1"),vw(5),Rw(6,"transloco"),Kc(),_i(7,"p",2),vw(8),Rw(9,"transloco"),Kc(),bD(10,$,2,1,"p",3),_i(11,"section",4)(12,"h2"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"label"),vw(16),Rw(17,"transloco"),_i(18,"select",5),gh("change",function(C){return o.onWorkflowChange(C)}),ND(19,z,2,3,"option",6,L),Kc()(),bD(21,G,2,3),_i(22,"button",7),gh("click",function(){return o.start()}),vw(23),Rw(24,"transloco"),Kc()(),bD(25,K,2,1,"p",8),Kc()),n&2){let s;gI(2),Ph(Ow(3,11,"jobs.detail.backToStart")),gI(3),Ph(Ow(6,13,"jobs.title")),gI(3),Ph(Ow(9,15,"jobs.lede")),gI(2),_D(o.loadError()?10:-1),gI(3),Ph(Ow(14,17,"jobs.start.heading")),gI(3),nl(" ",Ow(17,19,"jobs.start.workflow")," "),gI(2),ch("value",o.selectedWorkflowId()),gI(),xD(o.workflows()),gI(2),_D((s=o.selectedWorkflow())?21:-1,s),gI(),ch("disabled",o.starting()),gI(),nl(" ",Ow(24,21,o.starting()?"jobs.start.starting":"jobs.start.button")," "),gI(2),_D(o.actionError()?25:-1);}},dependencies:[Mi,Ln,K$1,Kt],styles:[".runner[_ngcontent-%COMP%]{max-width:52rem;margin:0 auto;padding:1.5rem;color:#1c1917;line-height:1.45}.lede[_ngcontent-%COMP%]{color:#57534e}.panel[_ngcontent-%COMP%]{margin-top:1.25rem;padding:1rem 0;border-top:1px solid #d6d3d1}label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.75rem 0;font-size:.95rem}input[type=text][_ngcontent-%COMP%], select[_ngcontent-%COMP%]{font:inherit;padding:.4rem .5rem;border:1px solid #a8a29e;background:#fff}button[_ngcontent-%COMP%]{font:inherit;margin-top:.5rem;padding:.45rem .9rem;border:1px solid #44403c;background:#f5f5f4;cursor:pointer}button[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{re as JobRunnerComponent};
@@ -1 +1 @@
1
- import {_ as _n,C as Cn}from'./chunk-Cuaj1Fgz.js';import {C,ae as U,af as u,V as Ve,b as at,q as qo,u as ue,a9 as Ng,o,Q as QE,M as Mi,L as Ln,c as sd,z as zc,d as t7,K as Kt,f as _i,v as vw,R as Rw,g as Kc,m as bD,p as gI,P as Ph,O as Ow,w as nl,B as _D,E as VD,N as ND,x as ch,A as xD,F as LD,h as gh,a5 as ah,G as Pu,I as Lu}from'./main-R7YQQZVK.js';import {U as U$1}from'./chunk-MRIst_Tv.js';import {W,I}from'./chunk-DjiFAEo3.js';import {A as Ad,H as Hl,$ as $d,a as Al,V as Vd,b as Ai,X as Xl}from'./chunk-g1iNEPSG.js';import'./chunk-Dc_LNQ-q.js';import'./chunk-Xv2Lx0k9.js';function Z(t,p){return [...t.map(i=>({type:"view",id:i.id,name:i.name,workflowId:i.workflowId,subjectType:i.subjectType})),...p.map(i=>({type:"shortcut",id:i.id,name:i.name,workflowId:i.workflowId,subjectType:null}))].sort((i,c)=>i.name.localeCompare(c.name))}var ee=(t,p)=>p.type+p.id;function te(t,p){t&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ie(t,p){if(t&1&&(_i(0,"p",6),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function ne(t,p){if(t&1&&(_i(0,"p",7),vw(1),Kc()),t&2){let e=VD(2);gI(),Ph(e.deleteError());}}function oe(t,p){t&1&&(_i(0,"section",8)(1,"p"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"div",2)(5,"a",10),vw(6),Rw(7,"transloco"),Kc(),_i(8,"a",11),vw(9),Rw(10,"transloco"),Kc()()()),t&2&&(gI(2),Ph(Ow(3,3,"manage.views.emptyState")),gI(4),nl(" ",Ow(7,5,"manage.views.createView")," "),gI(3),nl(" ",Ow(10,7,"manage.views.createShortcut")," "));}function ae(t,p){if(t&1&&(vw(0),Rw(1,"transloco")),t&2){let e=VD().$implicit,i=VD(3);nl(" ",Ow(1,1,i.subjectTypeKey(e.subjectType))," ");}}function re(t,p){t&1&&(vw(0),Rw(1,"transloco")),t&2&&nl(" ",Ow(1,1,"manage.views.noSubjectType")," ");}function se(t,p){if(t&1){let e=LD();_i(0,"tr")(1,"td"),vw(2),Kc(),_i(3,"td")(4,"nz-tag"),vw(5),Rw(6,"transloco"),Kc()(),_i(7,"td"),vw(8),Kc(),_i(9,"td"),bD(10,ae,2,3)(11,re,2,3),Kc(),_i(12,"td",12)(13,"a",13),vw(14),Rw(15,"transloco"),Kc(),_i(16,"button",14),Rw(17,"transloco"),Rw(18,"transloco"),Rw(19,"transloco"),gh("nzOnConfirm",function(){let c=Pu(e).$implicit,v=VD(3);return Lu(v.deleteItem(c))}),vw(20),Rw(21,"transloco"),Kc()()();}if(t&2){let e=p.$implicit,i=VD(3);ah("data-testid","item-"+e.type+"-"+e.id),gI(),ah("data-testid","name-"+e.type+"-"+e.id),gI(),Ph(e.name),gI(2),ah("data-testid","type-"+e.type+"-"+e.id),gI(),Ph(Ow(6,17,i.typeKey(e.type))),gI(2),ah("data-testid","workflow-"+e.type+"-"+e.id),gI(),nl(" ",i.workflowName(e)," "),gI(),ah("data-testid","subject-type-"+e.type+"-"+e.id),gI(),_D(e.subjectType?10:11),gI(3),ch("routerLink",i.editLink(e)),ah("data-testid","edit-"+e.type+"-"+e.id),gI(),nl(" ",Ow(15,19,"manage.views.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(17,21,i.deleteConfirmKey(e)))("nzOkText",Ow(18,23,"manage.views.delete"))("nzCancelText",Ow(19,25,"common.cancel")),ah("data-testid","delete-"+e.type+"-"+e.id),gI(4),nl(" ",Ow(21,27,"manage.views.delete")," ");}}function de(t,p){if(t&1&&(_i(0,"nz-table",9)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"th"),vw(16),Rw(17,"transloco"),Kc()()(),_i(18,"tbody"),ND(19,se,22,29,"tr",null,ee),Kc()()),t&2){let e=VD(2);ch("nzData",e.items())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Ph(Ow(5,8,"manage.views.column.name")),gI(3),Ph(Ow(8,10,"manage.views.column.type")),gI(3),Ph(Ow(11,12,"manage.views.column.workflow")),gI(3),Ph(Ow(14,14,"manage.views.column.subjectType")),gI(3),Ph(Ow(17,16,"manage.views.column.actions")),gI(3),xD(e.items());}}function pe(t,p){if(t&1&&(bD(0,ne,2,1,"p",7),bD(1,oe,11,9,"section",8)(2,de,21,18,"nz-table",9)),t&2){let e=VD();_D(e.deleteError()?0:-1),gI(),_D(e.items().length===0?1:2);}}var Ne=(()=>{class t{constructor(){this.viewsApi=C(U),this.shortcutsApi=C(u),this.workflowsApi=C(U$1),this.transloco=C(Ve),this.destroyRef=C(at),this.items=qo([]),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.load();}typeKey(e){return `manage.views.type.${e}`}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}workflowName(e){return this.workflows().find(i=>i.id===e.workflowId)?.name??e.workflowId}editLink(e){return e.type==="view"?["/views",e.id,"edit"]:["/shortcuts",e.id,"edit"]}deleteConfirmKey(e){return e.type==="view"?"manage.views.deleteConfirmView":"manage.views.deleteConfirmShortcut"}deleteItem(e){this.deleteError.set(null),(e.type==="view"?this.viewsApi.delete(e.id):this.shortcutsApi.delete(e.id)).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.items.update(c=>c.filter(v=>!(v.type===e.type&&v.id===e.id)));},error:c=>{this.deleteError.set(this.errorMessage(c,this.transloco.translate("manage.views.deleteFailed")));}});}load(){this.loading.set(true),this.loadError.set(null),Ng({views:this.viewsApi.list(),shortcuts:this.shortcutsApi.list(),workflows:this.workflowsApi.list()}).pipe(ue(this.destroyRef)).subscribe({next:({views:e,shortcuts:i,workflows:c})=>{this.items.set(Z(e,i)),this.workflows.set(c),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("manage.views.loadFailed")));}});}errorMessage(e,i){return e instanceof o||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-views-and-shortcuts-manage"]],decls:15,vars:10,consts:[["data-testid","views-shortcuts-manage",1,"list-page"],[1,"header"],[1,"header-actions"],["nz-button","","nzType","primary","routerLink","/views/new","data-testid","create-view"],["nz-button","","routerLink","/shortcuts/new","data-testid","create-shortcut"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","delete-error",1,"error"],["data-testid","empty-state",1,"empty"],["data-testid","managed-items",3,"nzData","nzFrontPagination","nzShowPagination"],["nz-button","","nzType","primary","routerLink","/views/new","data-testid","empty-create-view"],["nz-button","","routerLink","/shortcuts/new","data-testid","empty-create-shortcut"],[1,"actions"],["nz-button","","nzType","link",3,"routerLink"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(i,c){i&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"div",2)(6,"a",3),vw(7),Rw(8,"transloco"),Kc(),_i(9,"a",4),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,te,3,3,"p",5)(13,ie,2,1,"p",6)(14,pe,3,2),Kc()),i&2&&(gI(3),Ph(Ow(4,4,"manage.views.title")),gI(4),nl(" ",Ow(8,6,"manage.views.createView")," "),gI(3),nl(" ",Ow(11,8,"manage.views.createShortcut")," "),gI(2),_D(c.loading()?12:c.loadError()?13:14));},dependencies:[Mi,Ln,sd,zc,t7,_n,Cn,Ad,Hl,$d,Al,Vd,Ai,Xl,W,I,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return t})();export{Ne as ViewsAndShortcutsManageComponent};
1
+ import {_ as _n,C as Cn}from'./chunk-DNtWpE65.js';import {C,ae as U,af as u,V as Ve,b as at,q as qo,u as ue,a9 as Ng,o,Q as QE,M as Mi,L as Ln,c as sd,z as zc,d as t7,K as Kt,f as _i,v as vw,R as Rw,g as Kc,m as bD,p as gI,P as Ph,O as Ow,w as nl,B as _D,E as VD,N as ND,x as ch,A as xD,F as LD,h as gh,a5 as ah,G as Pu,I as Lu}from'./main-BRWQ5RNE.js';import {U as U$1}from'./chunk-BWr0M-hk.js';import {W,I}from'./chunk-BmSmqIC7.js';import {A as Ad,H as Hl,$ as $d,a as Al,V as Vd,b as Ai,X as Xl}from'./chunk-CYX8w88D.js';import'./chunk-C3wpjxgW.js';import'./chunk-WzBVBHEz.js';function Z(t,p){return [...t.map(i=>({type:"view",id:i.id,name:i.name,workflowId:i.workflowId,subjectType:i.subjectType})),...p.map(i=>({type:"shortcut",id:i.id,name:i.name,workflowId:i.workflowId,subjectType:null}))].sort((i,c)=>i.name.localeCompare(c.name))}var ee=(t,p)=>p.type+p.id;function te(t,p){t&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ie(t,p){if(t&1&&(_i(0,"p",6),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function ne(t,p){if(t&1&&(_i(0,"p",7),vw(1),Kc()),t&2){let e=VD(2);gI(),Ph(e.deleteError());}}function oe(t,p){t&1&&(_i(0,"section",8)(1,"p"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"div",2)(5,"a",10),vw(6),Rw(7,"transloco"),Kc(),_i(8,"a",11),vw(9),Rw(10,"transloco"),Kc()()()),t&2&&(gI(2),Ph(Ow(3,3,"manage.views.emptyState")),gI(4),nl(" ",Ow(7,5,"manage.views.createView")," "),gI(3),nl(" ",Ow(10,7,"manage.views.createShortcut")," "));}function ae(t,p){if(t&1&&(vw(0),Rw(1,"transloco")),t&2){let e=VD().$implicit,i=VD(3);nl(" ",Ow(1,1,i.subjectTypeKey(e.subjectType))," ");}}function re(t,p){t&1&&(vw(0),Rw(1,"transloco")),t&2&&nl(" ",Ow(1,1,"manage.views.noSubjectType")," ");}function se(t,p){if(t&1){let e=LD();_i(0,"tr")(1,"td"),vw(2),Kc(),_i(3,"td")(4,"nz-tag"),vw(5),Rw(6,"transloco"),Kc()(),_i(7,"td"),vw(8),Kc(),_i(9,"td"),bD(10,ae,2,3)(11,re,2,3),Kc(),_i(12,"td",12)(13,"a",13),vw(14),Rw(15,"transloco"),Kc(),_i(16,"button",14),Rw(17,"transloco"),Rw(18,"transloco"),Rw(19,"transloco"),gh("nzOnConfirm",function(){let c=Pu(e).$implicit,v=VD(3);return Lu(v.deleteItem(c))}),vw(20),Rw(21,"transloco"),Kc()()();}if(t&2){let e=p.$implicit,i=VD(3);ah("data-testid","item-"+e.type+"-"+e.id),gI(),ah("data-testid","name-"+e.type+"-"+e.id),gI(),Ph(e.name),gI(2),ah("data-testid","type-"+e.type+"-"+e.id),gI(),Ph(Ow(6,17,i.typeKey(e.type))),gI(2),ah("data-testid","workflow-"+e.type+"-"+e.id),gI(),nl(" ",i.workflowName(e)," "),gI(),ah("data-testid","subject-type-"+e.type+"-"+e.id),gI(),_D(e.subjectType?10:11),gI(3),ch("routerLink",i.editLink(e)),ah("data-testid","edit-"+e.type+"-"+e.id),gI(),nl(" ",Ow(15,19,"manage.views.edit")," "),gI(2),ch("nzPopconfirmTitle",Ow(17,21,i.deleteConfirmKey(e)))("nzOkText",Ow(18,23,"manage.views.delete"))("nzCancelText",Ow(19,25,"common.cancel")),ah("data-testid","delete-"+e.type+"-"+e.id),gI(4),nl(" ",Ow(21,27,"manage.views.delete")," ");}}function de(t,p){if(t&1&&(_i(0,"nz-table",9)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"th"),vw(16),Rw(17,"transloco"),Kc()()(),_i(18,"tbody"),ND(19,se,22,29,"tr",null,ee),Kc()()),t&2){let e=VD(2);ch("nzData",e.items())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Ph(Ow(5,8,"manage.views.column.name")),gI(3),Ph(Ow(8,10,"manage.views.column.type")),gI(3),Ph(Ow(11,12,"manage.views.column.workflow")),gI(3),Ph(Ow(14,14,"manage.views.column.subjectType")),gI(3),Ph(Ow(17,16,"manage.views.column.actions")),gI(3),xD(e.items());}}function pe(t,p){if(t&1&&(bD(0,ne,2,1,"p",7),bD(1,oe,11,9,"section",8)(2,de,21,18,"nz-table",9)),t&2){let e=VD();_D(e.deleteError()?0:-1),gI(),_D(e.items().length===0?1:2);}}var Ne=(()=>{class t{constructor(){this.viewsApi=C(U),this.shortcutsApi=C(u),this.workflowsApi=C(U$1),this.transloco=C(Ve),this.destroyRef=C(at),this.items=qo([]),this.workflows=qo([]),this.loading=qo(true),this.loadError=qo(null),this.deleteError=qo(null),this.load();}typeKey(e){return `manage.views.type.${e}`}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}workflowName(e){return this.workflows().find(i=>i.id===e.workflowId)?.name??e.workflowId}editLink(e){return e.type==="view"?["/views",e.id,"edit"]:["/shortcuts",e.id,"edit"]}deleteConfirmKey(e){return e.type==="view"?"manage.views.deleteConfirmView":"manage.views.deleteConfirmShortcut"}deleteItem(e){this.deleteError.set(null),(e.type==="view"?this.viewsApi.delete(e.id):this.shortcutsApi.delete(e.id)).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.items.update(c=>c.filter(v=>!(v.type===e.type&&v.id===e.id)));},error:c=>{this.deleteError.set(this.errorMessage(c,this.transloco.translate("manage.views.deleteFailed")));}});}load(){this.loading.set(true),this.loadError.set(null),Ng({views:this.viewsApi.list(),shortcuts:this.shortcutsApi.list(),workflows:this.workflowsApi.list()}).pipe(ue(this.destroyRef)).subscribe({next:({views:e,shortcuts:i,workflows:c})=>{this.items.set(Z(e,i)),this.workflows.set(c),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("manage.views.loadFailed")));}});}errorMessage(e,i){return e instanceof o||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-views-and-shortcuts-manage"]],decls:15,vars:10,consts:[["data-testid","views-shortcuts-manage",1,"list-page"],[1,"header"],[1,"header-actions"],["nz-button","","nzType","primary","routerLink","/views/new","data-testid","create-view"],["nz-button","","routerLink","/shortcuts/new","data-testid","create-shortcut"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","delete-error",1,"error"],["data-testid","empty-state",1,"empty"],["data-testid","managed-items",3,"nzData","nzFrontPagination","nzShowPagination"],["nz-button","","nzType","primary","routerLink","/views/new","data-testid","empty-create-view"],["nz-button","","routerLink","/shortcuts/new","data-testid","empty-create-shortcut"],[1,"actions"],["nz-button","","nzType","link",3,"routerLink"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"]],template:function(i,c){i&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"div",2)(6,"a",3),vw(7),Rw(8,"transloco"),Kc(),_i(9,"a",4),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,te,3,3,"p",5)(13,ie,2,1,"p",6)(14,pe,3,2),Kc()),i&2&&(gI(3),Ph(Ow(4,4,"manage.views.title")),gI(4),nl(" ",Ow(8,6,"manage.views.createView")," "),gI(3),nl(" ",Ow(11,8,"manage.views.createShortcut")," "),gI(2),_D(c.loading()?12:c.loadError()?13:14));},dependencies:[Mi,Ln,sd,zc,t7,_n,Cn,Ad,Hl,$d,Al,Vd,Ai,Xl,W,I,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return t})();export{Ne as ViewsAndShortcutsManageComponent};
@@ -1 +1 @@
1
- import {W,I}from'./chunk-DjiFAEo3.js';import {A as Ad,H as Hl,$ as $d,a as Al,V as Vd,b as Ai,X as Xl}from'./chunk-g1iNEPSG.js';import {C,U as U$1,b as at,a0 as $0,q as qo,X as rd,Y as Bw,a9 as Ng,aa as Xi,ab as Dg,u as ue,Q as QE,M as Mi,L as Ln,K as Kt,m as bD,B as _D,f as _i,v as vw,R as Rw,g as Kc,p as gI,P as Ph,O as Ow,E as VD,N as ND,x as ch,A as xD,a5 as ah,a3 as xw,w as nl}from'./main-R7YQQZVK.js';var q=new Set(["completed","failed","cancelled"]);function G(e){return q.has(e)}function et(e){let o=e.stepHistory.find(t=>t.status==="running");if(o)return o;if((e.status==="waiting_for_human"||e.status==="waiting_for_children")&&e.currentStepExecutionId){let t=e.stepHistory.find(n=>n.id===e.currentStepExecutionId);if(t)return t}return G(e.status)&&e.stepHistory.length>0?e.stepHistory[e.stepHistory.length-1]??null:null}function it(e,o){let t=new Map;for(let n of o)t.set(n.stepDefinitionId,n);return e.map(n=>{let d=t.get(n.id)??null;return {definition:n,execution:d,reached:d!=null}})}function U(e){if(!e)return null;if(e.mode==="single"){let t=e.subject;return `${t.id} \xB7 ${t.title}`}let o=e.subjects.length;if(o===0)return null;if(o===1){let t=e.subjects[0];return `${t.id} \xB7 ${t.title}`}return `${o} subjects`}var Q=e=>["/jobs",e],V=(e,o)=>o.id;function X(e,o){e&1&&(_i(0,"p",0),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function Y(e,o){if(e&1&&(_i(0,"p",1),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.loadError());}}function Z(e,o){if(e&1&&(_i(0,"tr")(1,"td")(2,"a",3),vw(3),Kc()(),_i(4,"td")(5,"nz-tag"),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"td")(9,"span"),vw(10),Kc()(),_i(11,"td")(12,"span"),vw(13),Kc()(),_i(14,"td")(15,"span"),vw(16),Kc()()()),e&2){let t=o.$implicit,n=VD(2);ah("data-testid","job-row-"+t.id),gI(2),ch("routerLink",xw(14,Q,t.id)),ah("data-testid","job-link-"+t.id),gI(),nl(" ",t.id," "),gI(2),ah("data-testid","job-status-"+t.id),gI(),Ph(Ow(7,12,n.statusKey(t.status))),gI(3),ah("data-testid","job-subject-"+t.id),gI(),Ph(n.subjectText(t)),gI(2),ah("data-testid","job-started-"+t.id),gI(),Ph(t.createdAt),gI(2),ah("data-testid","job-completed-"+t.id),gI(),Ph(t.completedAt??"\u2014");}}function tt(e,o){if(e&1&&(_i(0,"nz-table",2)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"th"),vw(16),Rw(17,"transloco"),Kc()()(),_i(18,"tbody"),ND(19,Z,17,16,"tr",null,V),Kc()()),e&2){let t=VD();ch("nzData",t.displayJobs())("nzFrontPagination",false)("nzShowPagination",false)("nzSize","middle"),gI(4),Ph(Ow(5,9,"jobs.table.column.id")),gI(3),Ph(Ow(8,11,"jobs.table.column.status")),gI(3),Ph(Ow(11,13,"jobs.table.column.subject")),gI(3),Ph(Ow(14,15,"jobs.table.column.started")),gI(3),Ph(Ow(17,17,"jobs.table.column.completed")),gI(3),xD(t.displayJobs());}}var vt=(()=>{class e{constructor(){this.jobsApi=C(U$1),this.destroyRef=C(at),this.jobs=$0(null),this.jobIds=$0([]),this.loaded=qo([]),this.loading=qo(false),this.loadError=qo(null),rd(()=>{let t=this.jobs(),n=this.jobIds();if(t!=null){Bw(()=>{this.loaded.set([]),this.loading.set(false),this.loadError.set(null);});return}if(n.length===0){Bw(()=>{this.loaded.set([]),this.loading.set(false);});return}Bw(()=>{this.loading.set(true),this.loadError.set(null),Ng(n.map(d=>this.jobsApi.get(d).pipe(Xi(()=>Dg(null))))).pipe(ue(this.destroyRef)).subscribe({next:d=>{this.loaded.set(d.filter(W=>W!=null)),this.loading.set(false);},error:()=>{this.loading.set(false),this.loadError.set("Failed to load jobs");}});});});}displayJobs(){let t=this.jobs();return t??this.loaded()}statusKey(t){return `jobs.status.${t}`}subjectText(t){return U(t.subjectContext)??"\u2014"}static{this.\u0275fac=function(n){return new(n||e)};}static{this.\u0275cmp=QE({type:e,selectors:[["app-job-status-table"]],inputs:{jobs:[1,"jobs"],jobIds:[1,"jobIds"]},decls:3,vars:1,consts:[["data-testid","job-status-loading"],["data-testid","job-status-error",1,"error"],["data-testid","job-status-table",3,"nzData","nzFrontPagination","nzShowPagination","nzSize"],[3,"routerLink"]],template:function(n,d){n&1&&bD(0,X,3,3,"p",0)(1,Y,2,1,"p",1)(2,tt,21,19,"nz-table",2),n&2&&_D(d.loading()&&d.jobs()==null?0:d.loadError()?1:2);},dependencies:[Mi,Ln,Ad,Hl,$d,Al,Vd,Ai,Xl,W,I,Kt],styles:[".error[_ngcontent-%COMP%]{color:#9f1239}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return e})();export{G,U,et as e,it as i,vt as v};
1
+ import {W,I}from'./chunk-BmSmqIC7.js';import {A as Ad,H as Hl,$ as $d,a as Al,V as Vd,b as Ai,X as Xl}from'./chunk-CYX8w88D.js';import {C,U as U$1,b as at,a0 as $0,q as qo,X as rd,Y as Bw,a9 as Ng,aa as Xi,ab as Dg,u as ue,Q as QE,M as Mi,L as Ln,K as Kt,m as bD,B as _D,f as _i,v as vw,R as Rw,g as Kc,p as gI,P as Ph,O as Ow,E as VD,N as ND,x as ch,A as xD,a5 as ah,a3 as xw,w as nl}from'./main-BRWQ5RNE.js';var q=new Set(["completed","failed","cancelled"]);function G(e){return q.has(e)}function et(e){let o=e.stepHistory.find(t=>t.status==="running");if(o)return o;if((e.status==="waiting_for_human"||e.status==="waiting_for_children")&&e.currentStepExecutionId){let t=e.stepHistory.find(n=>n.id===e.currentStepExecutionId);if(t)return t}return G(e.status)&&e.stepHistory.length>0?e.stepHistory[e.stepHistory.length-1]??null:null}function it(e,o){let t=new Map;for(let n of o)t.set(n.stepDefinitionId,n);return e.map(n=>{let d=t.get(n.id)??null;return {definition:n,execution:d,reached:d!=null}})}function U(e){if(!e)return null;if(e.mode==="single"){let t=e.subject;return `${t.id} \xB7 ${t.title}`}let o=e.subjects.length;if(o===0)return null;if(o===1){let t=e.subjects[0];return `${t.id} \xB7 ${t.title}`}return `${o} subjects`}var Q=e=>["/jobs",e],V=(e,o)=>o.id;function X(e,o){e&1&&(_i(0,"p",0),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function Y(e,o){if(e&1&&(_i(0,"p",1),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.loadError());}}function Z(e,o){if(e&1&&(_i(0,"tr")(1,"td")(2,"a",3),vw(3),Kc()(),_i(4,"td")(5,"nz-tag"),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"td")(9,"span"),vw(10),Kc()(),_i(11,"td")(12,"span"),vw(13),Kc()(),_i(14,"td")(15,"span"),vw(16),Kc()()()),e&2){let t=o.$implicit,n=VD(2);ah("data-testid","job-row-"+t.id),gI(2),ch("routerLink",xw(14,Q,t.id)),ah("data-testid","job-link-"+t.id),gI(),nl(" ",t.id," "),gI(2),ah("data-testid","job-status-"+t.id),gI(),Ph(Ow(7,12,n.statusKey(t.status))),gI(3),ah("data-testid","job-subject-"+t.id),gI(),Ph(n.subjectText(t)),gI(2),ah("data-testid","job-started-"+t.id),gI(),Ph(t.createdAt),gI(2),ah("data-testid","job-completed-"+t.id),gI(),Ph(t.completedAt??"\u2014");}}function tt(e,o){if(e&1&&(_i(0,"nz-table",2)(1,"thead")(2,"tr")(3,"th"),vw(4),Rw(5,"transloco"),Kc(),_i(6,"th"),vw(7),Rw(8,"transloco"),Kc(),_i(9,"th"),vw(10),Rw(11,"transloco"),Kc(),_i(12,"th"),vw(13),Rw(14,"transloco"),Kc(),_i(15,"th"),vw(16),Rw(17,"transloco"),Kc()()(),_i(18,"tbody"),ND(19,Z,17,16,"tr",null,V),Kc()()),e&2){let t=VD();ch("nzData",t.displayJobs())("nzFrontPagination",false)("nzShowPagination",false)("nzSize","middle"),gI(4),Ph(Ow(5,9,"jobs.table.column.id")),gI(3),Ph(Ow(8,11,"jobs.table.column.status")),gI(3),Ph(Ow(11,13,"jobs.table.column.subject")),gI(3),Ph(Ow(14,15,"jobs.table.column.started")),gI(3),Ph(Ow(17,17,"jobs.table.column.completed")),gI(3),xD(t.displayJobs());}}var vt=(()=>{class e{constructor(){this.jobsApi=C(U$1),this.destroyRef=C(at),this.jobs=$0(null),this.jobIds=$0([]),this.loaded=qo([]),this.loading=qo(false),this.loadError=qo(null),rd(()=>{let t=this.jobs(),n=this.jobIds();if(t!=null){Bw(()=>{this.loaded.set([]),this.loading.set(false),this.loadError.set(null);});return}if(n.length===0){Bw(()=>{this.loaded.set([]),this.loading.set(false);});return}Bw(()=>{this.loading.set(true),this.loadError.set(null),Ng(n.map(d=>this.jobsApi.get(d).pipe(Xi(()=>Dg(null))))).pipe(ue(this.destroyRef)).subscribe({next:d=>{this.loaded.set(d.filter(W=>W!=null)),this.loading.set(false);},error:()=>{this.loading.set(false),this.loadError.set("Failed to load jobs");}});});});}displayJobs(){let t=this.jobs();return t??this.loaded()}statusKey(t){return `jobs.status.${t}`}subjectText(t){return U(t.subjectContext)??"\u2014"}static{this.\u0275fac=function(n){return new(n||e)};}static{this.\u0275cmp=QE({type:e,selectors:[["app-job-status-table"]],inputs:{jobs:[1,"jobs"],jobIds:[1,"jobIds"]},decls:3,vars:1,consts:[["data-testid","job-status-loading"],["data-testid","job-status-error",1,"error"],["data-testid","job-status-table",3,"nzData","nzFrontPagination","nzShowPagination","nzSize"],[3,"routerLink"]],template:function(n,d){n&1&&bD(0,X,3,3,"p",0)(1,Y,2,1,"p",1)(2,tt,21,19,"nz-table",2),n&2&&_D(d.loading()&&d.jobs()==null?0:d.loadError()?1:2);},dependencies:[Mi,Ln,Ad,Hl,$d,Al,Vd,Ai,Xl,W,I,Kt],styles:[".error[_ngcontent-%COMP%]{color:#9f1239}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return e})();export{G,U,et as e,it as i,vt as v};
@@ -1,4 +1,4 @@
1
- import {T}from'./chunk-BnnoOI-1.js';import {$ as $$1,B}from'./chunk-CQ708Y6F.js';import {S as Sk,p as px,D as Dx,j as jx,e as ex,u as uk,I as Ie$2}from'./chunk-BIFLxIMS.js';import {C,a as ae,T as Ie$1,ae as U,ag as $,b as at,V as Ve$1,aY as O$1,aZ as de,ai as Se$1,q as qo,H as Hw,u as ue,s,r,o,Q as QE,M as Mi,n as n8,aj as S4,J as J6,k as k3,L as Ln,c as sd,z as zc,d as t7,Z as y7,$ as $b,e as V5,D as D5,K as Kt,f as _i,v as vw,g as Kc,R as Rw,h as gh,m as bD,p as gI,P as Ph,O as Ow,x as ch,w as nl,B as _D,E as VD,F as LD,j as oE,N as ND,y as sE,A as xD,S as SD,l as lh,G as Pu,I as Lu,a4 as Mh,a5 as ah,a6 as Nw}from'./main-R7YQQZVK.js';import {U as U$1}from'./chunk-MRIst_Tv.js';import'./chunk-Xv2Lx0k9.js';var be=()=>[],O=(t,a)=>a.id,Me=(t,a)=>a.name;function Ie(t,a){t&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function Ee(t,a){if(t&1&&(_i(0,"p",6),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function Ve(t,a){if(t&1&&(_i(0,"li"),vw(1),Kc()),t&2){let e=a.$implicit;gI(),Ph(e);}}function ze(t,a){if(t&1&&(_i(0,"section",7)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul"),ND(5,Ve,2,1,"li",null,SD),Kc()()),t&2){let e=VD(2);gI(2),Ph(Ow(3,1,"views.editor.validation")),gI(3),xD(e.validationErrors());}}function ke(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.name);}}function Pe(t,a){t&1&&(_i(0,"p",13),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"views.editor.noEligibleInstances")," "));}function Se(t,a){t&1&&(_i(0,"p",16),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"views.editor.instanceNeeded")," "));}function Ne(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.displayName);}}function qe(t,a){if(t&1){let e=LD();_i(0,"div",15),bD(1,Se,3,3,"p",16),_i(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"nz-select",17),Rw(6,"transloco"),gh("ngModelChange",function(n){Pu(e);let s=VD(3);return Lu(s.onInstanceChange(n))}),ND(7,Ne,1,2,"nz-option",11,O),Kc(),oE(),Kc();}if(t&2){let e=VD(3);Mh("field-attention",e.needsInstanceAttention()),gI(),_D(e.needsInstanceAttention()?1:-1),gI(2),Ph(Ow(4,6,"views.editor.instance")),gI(2),ch("nzPlaceHolder",Ow(6,8,"views.editor.instancePlaceholder"))("ngModel",e.providerInstanceId()),sE(),gI(2),xD(e.eligibleInstances());}}function De(t,a){if(t&1&&bD(0,Pe,3,3,"p",13)(1,qe,9,10,"div",14),t&2){let e=VD(2);_D(e.eligibleInstances().length===0?0:1);}}function Ae(t,a){if(t&1){let e=LD();_i(0,"div",12)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"div",18)(5,"button",19),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.setQueryMode("template"))}),vw(6),Rw(7,"transloco"),Kc(),_i(8,"button",20),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.setQueryMode("raw"))}),vw(9),Rw(10,"transloco"),Kc()()();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,5,"views.editor.queryMode")),gI(3),ch("nzType",e.queryMode()==="template"?"primary":"default"),gI(),nl(" ",Ow(7,7,"views.editor.queryMode.template")," "),gI(2),ch("nzType",e.queryMode()==="raw"?"primary":"default"),gI(),nl(" ",Ow(10,9,"views.editor.queryMode.raw")," ");}}function Fe(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.label);}}function je(t,a){t&1&&(_i(0,"span",22),vw(1,"*"),Kc());}function Oe(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e)("nzLabel",e);}}function Be(t,a){if(t&1){let e=LD();_i(0,"nz-select",25),gh("ngModelChange",function(n){Pu(e);let s=VD().$implicit,g=VD(4);return Lu(g.setTemplateParam(s.name,n))}),ND(1,Oe,1,2,"nz-option",11,SD),Kc(),oE();}if(t&2){let e=VD().$implicit,i=VD(4);ch("ngModel",i.templateParamValue(e.name)),ah("data-testid","template-param-"+e.name),sE(),gI(),xD(e.options??Nw(2,be));}}function $e(t,a){if(t&1){let e=LD();_i(0,"input",26),gh("ngModelChange",function(n){Pu(e);let s=VD().$implicit,g=VD(4);return Lu(g.setTemplateParam(s.name,n))}),Kc(),oE();}if(t&2){let e=VD().$implicit,i=VD(4);ch("ngModel",i.templateParamValue(e.name)),ah("data-testid","template-param-"+e.name),sE();}}function Le(t,a){if(t&1&&(_i(0,"label",8)(1,"span"),vw(2),bD(3,je,2,0,"span",22),Kc(),bD(4,Be,3,3,"nz-select",23)(5,$e,1,2,"input",24),Kc()),t&2){let e=a.$implicit;gI(2),nl(" ",e.label," "),gI(),_D(e.required?3:-1),gI(),_D(e.type==="select"?4:5);}}function We(t,a){t&1&&ND(0,Le,6,3,"label",8,Me),t&2&&xD(a.params);}function Re(t,a){if(t&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",21),gh("ngModelChange",function(n){Pu(e);let s=VD(2);return Lu(s.selectTemplate(n))}),ND(5,Fe,1,2,"nz-option",11,O),Kc(),oE(),Kc(),bD(7,We,2,0);}if(t&2){let e,i=VD(2);gI(2),Ph(Ow(3,3,"views.editor.template")),gI(2),ch("ngModel",i.selectedTemplateId()),sE(),gI(),xD(i.templates()),gI(2),_D((e=i.selectedTemplate())?7:-1,e);}}function Je(t,a){if(t&1){let e=LD();_i(0,"label",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"textarea",27),gh("ngModelChange",function(n){Pu(e);let s=VD(2);return Lu(s.queryText.set(n))}),Kc(),oE(),_i(5,"span",28),vw(6),Rw(7,"transloco"),Kc()();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,3,"views.editor.query")),gI(2),ch("ngModel",e.queryText()),sE(),gI(2),Ph(Ow(7,5,"views.editor.queryHint"));}}function Qe(t,a){if(t&1){let e=LD();bD(0,ze,7,3,"section",7),_i(1,"label",8)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"input",9),gh("ngModelChange",function(n){Pu(e);let s=VD();return Lu(s.name.set(n))}),Kc(),oE(),Kc(),_i(6,"div",8)(7,"span"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"nz-select",10),gh("ngModelChange",function(n){Pu(e);let s=VD();return Lu(s.onWorkflowChange(n))}),ND(11,ke,1,2,"nz-option",11,O),Kc(),oE(),Kc(),bD(13,De,2,1),bD(14,Ae,11,11,"div",12),bD(15,Re,8,5)(16,Je,8,7,"label",8);}if(t&2){let e=VD();_D(e.validationErrors().length>0?0:-1),gI(3),Ph(Ow(4,8,"views.editor.name")),gI(2),ch("ngModel",e.name()),sE(),gI(3),Ph(Ow(9,10,"views.editor.workflow")),gI(2),ch("ngModel",e.workflowId()),sE(),gI(),xD(e.bindableWorkflows()),gI(2),_D(e.selectedWorkflow()&&e.settings()?13:-1),gI(),_D(e.hasTemplates()?14:-1),gI(),_D(e.queryMode()==="template"&&e.hasTemplates()?15:16);}}function Ue(t){let a=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),e=crypto.randomUUID().slice(0,8);return a.length>0?`${a}-${e}`:`view-${e}`}function Te(t){let a={};for(let e of t.params)a[e.name]=e.type==="select"?e.options?.[0]??"":"";return a}function He(t){let a=t?.trim()??"";return a.length>0?a:null}var bt=(()=>{class t{constructor(){this.route=C(ae),this.router=C(Ie$1),this.viewsApi=C(U),this.workflowsApi=C(U$1),this.settingsApi=C($),this.providersApi=C($$1),this.message=C(Sk),this.destroyRef=C(at),this.transloco=C(Ve$1),this.language=C(O$1),this.routeId=de(this.route.paramMap.pipe(Se$1(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.name=qo(""),this.workflowId=qo(""),this.providerInstanceId=qo(null),this.workflows=qo([]),this.subjectType=qo(null),this.queryText=qo(`{
1
+ import {T}from'./chunk-f1UVptf5.js';import {$ as $$1,B}from'./chunk-Cwf9CcBI.js';import {S as Sk,p as px,D as Dx,j as jx,e as ex,u as uk,I as Ie$2}from'./chunk-DdVQ8Ilm.js';import {C,a as ae,T as Ie$1,ae as U,ag as $,b as at,V as Ve$1,aY as O$1,aZ as de,ai as Se$1,q as qo,H as Hw,u as ue,s,r,o,Q as QE,M as Mi,n as n8,aj as S4,J as J6,k as k3,L as Ln,c as sd,z as zc,d as t7,Z as y7,$ as $b,e as V5,D as D5,K as Kt,f as _i,v as vw,g as Kc,R as Rw,h as gh,m as bD,p as gI,P as Ph,O as Ow,x as ch,w as nl,B as _D,E as VD,F as LD,j as oE,N as ND,y as sE,A as xD,S as SD,l as lh,G as Pu,I as Lu,a4 as Mh,a5 as ah,a6 as Nw}from'./main-BRWQ5RNE.js';import {U as U$1}from'./chunk-BWr0M-hk.js';import'./chunk-WzBVBHEz.js';var be=()=>[],O=(t,a)=>a.id,Me=(t,a)=>a.name;function Ie(t,a){t&1&&(_i(0,"p",5),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function Ee(t,a){if(t&1&&(_i(0,"p",6),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function Ve(t,a){if(t&1&&(_i(0,"li"),vw(1),Kc()),t&2){let e=a.$implicit;gI(),Ph(e);}}function ze(t,a){if(t&1&&(_i(0,"section",7)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul"),ND(5,Ve,2,1,"li",null,SD),Kc()()),t&2){let e=VD(2);gI(2),Ph(Ow(3,1,"views.editor.validation")),gI(3),xD(e.validationErrors());}}function ke(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.name);}}function Pe(t,a){t&1&&(_i(0,"p",13),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"views.editor.noEligibleInstances")," "));}function Se(t,a){t&1&&(_i(0,"p",16),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),nl(" ",Ow(2,1,"views.editor.instanceNeeded")," "));}function Ne(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.displayName);}}function qe(t,a){if(t&1){let e=LD();_i(0,"div",15),bD(1,Se,3,3,"p",16),_i(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"nz-select",17),Rw(6,"transloco"),gh("ngModelChange",function(n){Pu(e);let s=VD(3);return Lu(s.onInstanceChange(n))}),ND(7,Ne,1,2,"nz-option",11,O),Kc(),oE(),Kc();}if(t&2){let e=VD(3);Mh("field-attention",e.needsInstanceAttention()),gI(),_D(e.needsInstanceAttention()?1:-1),gI(2),Ph(Ow(4,6,"views.editor.instance")),gI(2),ch("nzPlaceHolder",Ow(6,8,"views.editor.instancePlaceholder"))("ngModel",e.providerInstanceId()),sE(),gI(2),xD(e.eligibleInstances());}}function De(t,a){if(t&1&&bD(0,Pe,3,3,"p",13)(1,qe,9,10,"div",14),t&2){let e=VD(2);_D(e.eligibleInstances().length===0?0:1);}}function Ae(t,a){if(t&1){let e=LD();_i(0,"div",12)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"div",18)(5,"button",19),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.setQueryMode("template"))}),vw(6),Rw(7,"transloco"),Kc(),_i(8,"button",20),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.setQueryMode("raw"))}),vw(9),Rw(10,"transloco"),Kc()()();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,5,"views.editor.queryMode")),gI(3),ch("nzType",e.queryMode()==="template"?"primary":"default"),gI(),nl(" ",Ow(7,7,"views.editor.queryMode.template")," "),gI(2),ch("nzType",e.queryMode()==="raw"?"primary":"default"),gI(),nl(" ",Ow(10,9,"views.editor.queryMode.raw")," ");}}function Fe(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.label);}}function je(t,a){t&1&&(_i(0,"span",22),vw(1,"*"),Kc());}function Oe(t,a){if(t&1&&lh(0,"nz-option",11),t&2){let e=a.$implicit;ch("nzValue",e)("nzLabel",e);}}function Be(t,a){if(t&1){let e=LD();_i(0,"nz-select",25),gh("ngModelChange",function(n){Pu(e);let s=VD().$implicit,g=VD(4);return Lu(g.setTemplateParam(s.name,n))}),ND(1,Oe,1,2,"nz-option",11,SD),Kc(),oE();}if(t&2){let e=VD().$implicit,i=VD(4);ch("ngModel",i.templateParamValue(e.name)),ah("data-testid","template-param-"+e.name),sE(),gI(),xD(e.options??Nw(2,be));}}function $e(t,a){if(t&1){let e=LD();_i(0,"input",26),gh("ngModelChange",function(n){Pu(e);let s=VD().$implicit,g=VD(4);return Lu(g.setTemplateParam(s.name,n))}),Kc(),oE();}if(t&2){let e=VD().$implicit,i=VD(4);ch("ngModel",i.templateParamValue(e.name)),ah("data-testid","template-param-"+e.name),sE();}}function Le(t,a){if(t&1&&(_i(0,"label",8)(1,"span"),vw(2),bD(3,je,2,0,"span",22),Kc(),bD(4,Be,3,3,"nz-select",23)(5,$e,1,2,"input",24),Kc()),t&2){let e=a.$implicit;gI(2),nl(" ",e.label," "),gI(),_D(e.required?3:-1),gI(),_D(e.type==="select"?4:5);}}function We(t,a){t&1&&ND(0,Le,6,3,"label",8,Me),t&2&&xD(a.params);}function Re(t,a){if(t&1){let e=LD();_i(0,"div",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",21),gh("ngModelChange",function(n){Pu(e);let s=VD(2);return Lu(s.selectTemplate(n))}),ND(5,Fe,1,2,"nz-option",11,O),Kc(),oE(),Kc(),bD(7,We,2,0);}if(t&2){let e,i=VD(2);gI(2),Ph(Ow(3,3,"views.editor.template")),gI(2),ch("ngModel",i.selectedTemplateId()),sE(),gI(),xD(i.templates()),gI(2),_D((e=i.selectedTemplate())?7:-1,e);}}function Je(t,a){if(t&1){let e=LD();_i(0,"label",8)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"textarea",27),gh("ngModelChange",function(n){Pu(e);let s=VD(2);return Lu(s.queryText.set(n))}),Kc(),oE(),_i(5,"span",28),vw(6),Rw(7,"transloco"),Kc()();}if(t&2){let e=VD(2);gI(2),Ph(Ow(3,3,"views.editor.query")),gI(2),ch("ngModel",e.queryText()),sE(),gI(2),Ph(Ow(7,5,"views.editor.queryHint"));}}function Qe(t,a){if(t&1){let e=LD();bD(0,ze,7,3,"section",7),_i(1,"label",8)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"input",9),gh("ngModelChange",function(n){Pu(e);let s=VD();return Lu(s.name.set(n))}),Kc(),oE(),Kc(),_i(6,"div",8)(7,"span"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"nz-select",10),gh("ngModelChange",function(n){Pu(e);let s=VD();return Lu(s.onWorkflowChange(n))}),ND(11,ke,1,2,"nz-option",11,O),Kc(),oE(),Kc(),bD(13,De,2,1),bD(14,Ae,11,11,"div",12),bD(15,Re,8,5)(16,Je,8,7,"label",8);}if(t&2){let e=VD();_D(e.validationErrors().length>0?0:-1),gI(3),Ph(Ow(4,8,"views.editor.name")),gI(2),ch("ngModel",e.name()),sE(),gI(3),Ph(Ow(9,10,"views.editor.workflow")),gI(2),ch("ngModel",e.workflowId()),sE(),gI(),xD(e.bindableWorkflows()),gI(2),_D(e.selectedWorkflow()&&e.settings()?13:-1),gI(),_D(e.hasTemplates()?14:-1),gI(),_D(e.queryMode()==="template"&&e.hasTemplates()?15:16);}}function Ue(t){let a=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),e=crypto.randomUUID().slice(0,8);return a.length>0?`${a}-${e}`:`view-${e}`}function Te(t){let a={};for(let e of t.params)a[e.name]=e.type==="select"?e.options?.[0]??"":"";return a}function He(t){let a=t?.trim()??"";return a.length>0?a:null}var bt=(()=>{class t{constructor(){this.route=C(ae),this.router=C(Ie$1),this.viewsApi=C(U),this.workflowsApi=C(U$1),this.settingsApi=C($),this.providersApi=C($$1),this.message=C(Sk),this.destroyRef=C(at),this.transloco=C(Ve$1),this.language=C(O$1),this.routeId=de(this.route.paramMap.pipe(Se$1(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.name=qo(""),this.workflowId=qo(""),this.providerInstanceId=qo(null),this.workflows=qo([]),this.subjectType=qo(null),this.queryText=qo(`{
2
2
 
3
3
  }`),this.queryMode=qo("template"),this.templates=qo([]),this.selectedTemplateId=qo(null),this.templateParams=qo({}),this.settings=qo(null),this.loadError=qo(null),this.validationErrors=qo([]),this.saving=qo(false),this.loading=qo(true),this.bindableWorkflows=Hw(()=>this.workflows().filter(e=>e.appliesTo!=="none")),this.selectedWorkflow=Hw(()=>this.bindableWorkflows().find(e=>e.id===this.workflowId())??null),this.subjectTypeOptions=Hw(()=>px(this.selectedWorkflow()?.appliesTo??"none")),this.eligibleInstances=Hw(()=>B(this.settings(),this.subjectTypeOptions())),this.selectedInstance=Hw(()=>this.eligibleInstances().find(e=>e.id===this.providerInstanceId())??null),this.needsInstanceAttention=Hw(()=>this.selectedWorkflow()!=null&&this.settings()!=null&&this.eligibleInstances().length>0&&this.selectedInstance()==null),this.isNew=Hw(()=>!this.routeId()),this.pageTitle=Hw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("views.editor.titleNew"):this.transloco.translate("views.editor.titleEdit",{id:this.routeId()}))),this.selectedTemplate=Hw(()=>this.templates().find(e=>e.id===this.selectedTemplateId())??null),this.hasTemplates=Hw(()=>this.templates().length>0),this.workflowsApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>this.workflows.set(e),error:e=>{this.workflows.set([]),this.message.error(this.errorMessage(e,this.transloco.translate("views.editor.loadFailed")));}}),this.settingsApi.getSettings().pipe(ue(this.destroyRef)).subscribe({next:e=>{this.settings.set(e),this.refreshTemplates();},error:e=>{this.settings.set(Dx),this.refreshTemplates(),this.message.error(this.errorMessage(e,this.transloco.translate("views.editor.loadFailed")));}}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(e=>{let i=e.get("id");if(this.validationErrors.set([]),this.loadError.set(null),this.pendingProvenance=void 0,!i){this.name.set(""),this.workflowId.set(""),this.providerInstanceId.set(null),this.subjectType.set(null),this.queryText.set(`{
4
4
 
@@ -1 +1 @@
1
- import {U as U$1}from'./chunk-MRIst_Tv.js';import {v as vt}from'./chunk-BEvII7Hn.js';import'./chunk-DjiFAEo3.js';import {S as Si,s as sn}from'./chunk-g1iNEPSG.js';import {F as Fe,o as oe}from'./chunk-Dc_LNQ-q.js';import'./chunk-Xv2Lx0k9.js';import {C,U,a as ae,V as Ve,b as at$1,q as qo,H as Hw,u as ue,s,r,o,Q as QE,M as Mi,n as n8,J as J6,k as k3,L as Ln,c as sd,z as zc,d as t7,$ as $b,e as V5,D as D5,K as Kt,f as _i,v as vw,R as Rw,g as Kc,h as gh,j as oE,l as lh,N as ND,m as bD,S as SD,p as gI,P as Ph,O as Ow,w as nl,x as ch,y as sE,A as xD,B as _D,E as VD,F as LD,G as Pu,I as Lu}from'./main-R7YQQZVK.js';var st=(e,d)=>d.id;function lt(e,d){if(e&1&&lh(0,"nz-option",10),e&2){let t=d.$implicit;ch("nzValue",t.id)("nzLabel",t.name+" ("+t.id+")");}}function at(e,d){e&1&&(_i(0,"p",11),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function dt(e,d){if(e&1&&(_i(0,"p",12),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.runningError());}}function pt(e,d){e&1&&(_i(0,"p",13),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),nl(" ",Ow(2,1,"jobs.list.runningEmpty")," "));}function ht(e,d){if(e&1&&lh(0,"app-job-status-table",14),e&2){let t=VD();ch("jobs",t.runningJobs());}}function gt(e,d){if(e&1&&(lh(0,"nz-option",10),Rw(1,"transloco"),Rw(2,"transloco")),e&2){let t=d.$implicit,s=VD();ch("nzValue",t)("nzLabel",t==="all"?Ow(1,2,"jobs.list.filterAll"):Ow(2,4,s.statusKey(t)));}}function mt(e,d){if(e&1&&lh(0,"nz-option",10),e&2){let t=d.$implicit;ch("nzValue",t.id)("nzLabel",t.name+" ("+t.id+")");}}function ct(e,d){e&1&&(_i(0,"p",18),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ut(e,d){if(e&1&&(_i(0,"p",19),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.historyError());}}function ft(e,d){e&1&&(_i(0,"p",20),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),nl(" ",Ow(2,1,"jobs.list.historyEmpty")," "));}function yt(e,d){if(e&1){let t=LD();_i(0,"nz-pagination",22),gh("nzPageIndexChange",function(n){Pu(t);let c=VD(2);return Lu(c.setHistoryPage(n))}),Kc();}if(e&2){let t=VD(2);ch("nzPageIndex",t.historyPageIndex())("nzPageSize",t.pageSize)("nzTotal",t.historyTotal());}}function bt(e,d){if(e&1&&(lh(0,"app-job-status-table",14),bD(1,yt,1,3,"nz-pagination",21)),e&2){let t=VD();ch("jobs",t.historyJobs()),gI(),_D(t.historyTotal()>t.pageSize||t.historyPageIndex()>1?1:-1);}}var _t=20,Ct=50,xt=3e3,rt=["completed","failed","cancelled"],Vt=(()=>{class e{constructor(){this.jobsApi=C(U),this.workflowsApi=C(U$1),this.route=C(ae),this.transloco=C(Ve),this.destroyRef=C(at$1),this.pageSize=_t,this.historyStatusOptions=["all",...rt],this.runningJobs=qo([]),this.historyJobs=qo([]),this.workflows=qo([]),this.runningLoading=qo(true),this.historyLoading=qo(true),this.runningError=qo(null),this.historyError=qo(null),this.runningWorkflowId=qo(""),this.historyWorkflowId=qo(""),this.historyStatusFilter=qo("all"),this.showChildJobs=qo(false),this.historyPageIndex=qo(1),this.polling=qo(false),this.historyTotal=Hw(()=>{let t=(this.historyPageIndex()-1)*this.pageSize,s=this.historyJobs().length;return s<this.pageSize?t+s:t+s+1}),this.pollHandle=null,this.onVisibility=()=>{if(document.hidden){this.stopPolling();return}this.loadRunning({silent:true}),this.loadHistory({silent:true}),this.startPolling();},this.destroyRef.onDestroy(()=>{this.stopPolling(),document.removeEventListener("visibilitychange",this.onVisibility);}),this.loadWorkflows(),this.route.queryParamMap.pipe(ue(this.destroyRef)).subscribe(t=>{let s=t.get("status");s&&rt.includes(s)?this.historyStatusFilter.set(s):this.historyStatusFilter.set("all"),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}),document.addEventListener("visibilitychange",this.onVisibility),this.startPolling();}statusKey(t){return `jobs.status.${t}`}isPolling(){return this.polling()}setHistoryStatusFilter(t){this.historyStatusFilter.set(t),this.historyPageIndex.set(1),this.loadHistory();}setRunningWorkflowId(t){this.runningWorkflowId.set(t),this.loadRunning();}setHistoryWorkflowId(t){this.historyWorkflowId.set(t),this.historyPageIndex.set(1),this.loadHistory();}setShowChildJobs(t){this.showChildJobs.set(t),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}setHistoryPage(t){this.historyPageIndex.set(t),this.loadHistory();}loadWorkflows(){this.workflowsApi.list().pipe(ue(this.destroyRef)).subscribe({next:t=>{this.workflows.set(t);},error:()=>{this.workflows.set([]);}});}loadRunning(t={}){let s$1=this.runningWorkflowId();t.silent||(this.runningLoading.set(true),this.runningError.set(null)),this.jobsApi.list(s(r({terminal:false,topLevelOnly:!this.showChildJobs()},s$1?{workflowId:s$1}:{}),{limit:Ct,offset:0})).pipe(ue(this.destroyRef)).subscribe({next:n=>{this.runningJobs.set(n),this.runningLoading.set(false);},error:n=>{this.runningLoading.set(false),!t.silent&&this.runningError.set(this.errorMessage(n,this.transloco.translate("jobs.list.loadFailed")));}});}loadHistory(t={}){let s$1=this.historyStatusFilter(),n=this.historyWorkflowId();t.silent||(this.historyLoading.set(true),this.historyError.set(null)),this.jobsApi.list(s(r(r({terminal:true,topLevelOnly:!this.showChildJobs()},s$1==="all"?{}:{status:s$1}),n?{workflowId:n}:{}),{limit:this.pageSize,offset:(this.historyPageIndex()-1)*this.pageSize})).pipe(ue(this.destroyRef)).subscribe({next:c=>{this.historyJobs.set(c),this.historyLoading.set(false);},error:c=>{this.historyLoading.set(false),!t.silent&&this.historyError.set(this.errorMessage(c,this.transloco.translate("jobs.list.loadFailed")));}});}startPolling(){this.pollHandle!=null||document.hidden||(this.pollHandle=setInterval(()=>{this.loadRunning({silent:true}),this.loadHistory({silent:true});},xt),this.polling.set(true));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}errorMessage(t,s){return t instanceof o||t instanceof Error?t.message:s}static{this.\u0275fac=function(s){return new(s||e)};}static{this.\u0275cmp=QE({type:e,selectors:[["app-job-list"]],decls:56,vars:36,consts:[["data-testid","jobs-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/jobs/new","data-testid","start-job"],["nz-checkbox","","data-testid","show-child-jobs",1,"child-toggle",3,"ngModelChange","ngModel"],["data-testid","jobs-running",1,"section"],[1,"section-header"],[1,"filters"],[1,"field"],["data-testid","running-workflow-filter",3,"ngModelChange","ngModel"],["nzValue","",3,"nzLabel"],[3,"nzValue","nzLabel"],["data-testid","running-loading"],["data-testid","running-error",1,"error"],["data-testid","running-empty",1,"section-empty"],[3,"jobs"],["data-testid","jobs-history",1,"section","section-history"],["data-testid","history-status-filter",3,"ngModelChange","ngModel"],["data-testid","history-workflow-filter",3,"ngModelChange","ngModel"],["data-testid","history-loading"],["data-testid","history-error",1,"error"],["data-testid","history-empty",1,"section-empty"],["data-testid","jobs-pagination",3,"nzPageIndex","nzPageSize","nzTotal"],["data-testid","jobs-pagination",3,"nzPageIndexChange","nzPageIndex","nzPageSize","nzTotal"]],template:function(s,n){s&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"a",2),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"label",3),gh("ngModelChange",function(y){return n.setShowChildJobs(y)}),vw(9),Rw(10,"transloco"),Kc(),oE(),_i(11,"section",4)(12,"header",5)(13,"h2"),vw(14),Rw(15,"transloco"),Kc()(),_i(16,"div",6)(17,"div",7)(18,"span"),vw(19),Rw(20,"transloco"),Kc(),_i(21,"nz-select",8),gh("ngModelChange",function(y){return n.setRunningWorkflowId(y)}),lh(22,"nz-option",9),Rw(23,"transloco"),ND(24,lt,1,2,"nz-option",10,st),Kc(),oE(),Kc()(),bD(26,at,3,3,"p",11)(27,dt,2,1,"p",12)(28,pt,3,3,"p",13)(29,ht,1,1,"app-job-status-table",14),Kc(),_i(30,"section",15)(31,"header",5)(32,"h2"),vw(33),Rw(34,"transloco"),Kc()(),_i(35,"div",6)(36,"div",7)(37,"span"),vw(38),Rw(39,"transloco"),Kc(),_i(40,"nz-select",16),gh("ngModelChange",function(y){return n.setHistoryStatusFilter(y)}),ND(41,gt,3,6,"nz-option",10,SD),Kc(),oE(),Kc(),_i(43,"div",7)(44,"span"),vw(45),Rw(46,"transloco"),Kc(),_i(47,"nz-select",17),gh("ngModelChange",function(y){return n.setHistoryWorkflowId(y)}),lh(48,"nz-option",9),Rw(49,"transloco"),ND(50,mt,1,2,"nz-option",10,st),Kc(),oE(),Kc()(),bD(52,ct,3,3,"p",18)(53,ut,2,1,"p",19)(54,ft,3,3,"p",20)(55,bt,2,2),Kc()()),s&2&&(gI(3),Ph(Ow(4,16,"jobs.list.title")),gI(3),nl(" ",Ow(7,18,"jobs.list.startButton")," "),gI(2),ch("ngModel",n.showChildJobs()),sE(),gI(),nl(" ",Ow(10,20,"jobs.list.showChildJobs")," "),gI(5),Ph(Ow(15,22,"jobs.list.running")),gI(5),Ph(Ow(20,24,"jobs.list.filterByWorkflow")),gI(2),ch("ngModel",n.runningWorkflowId()),sE(),gI(),ch("nzLabel",Ow(23,26,"jobs.list.filterAll")),gI(2),xD(n.workflows()),gI(2),_D(n.runningLoading()?26:n.runningError()?27:n.runningJobs().length===0?28:29),gI(7),Ph(Ow(34,28,"jobs.list.history")),gI(5),Ph(Ow(39,30,"jobs.list.filterByStatus")),gI(2),ch("ngModel",n.historyStatusFilter()),sE(),gI(),xD(n.historyStatusOptions),gI(4),Ph(Ow(46,32,"jobs.list.filterByWorkflow")),gI(2),ch("ngModel",n.historyWorkflowId()),sE(),gI(),ch("nzLabel",Ow(49,34,"jobs.list.filterAll")),gI(2),xD(n.workflows()),gI(2),_D(n.historyLoading()?52:n.historyError()?53:n.historyJobs().length===0?54:55));},dependencies:[Mi,n8,J6,k3,Ln,sd,zc,t7,Fe,oe,Si,sn,$b,V5,D5,vt,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0}.child-toggle[_ngcontent-%COMP%]{align-self:flex-start}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.section-history[_ngcontent-%COMP%]{padding-top:1.25rem;border-top:1px solid #e7e5e4}.section-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem 1.25rem;align-items:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:12rem;max-width:18rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.section-empty[_ngcontent-%COMP%]{margin:0;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return e})();export{_t as JOB_LIST_PAGE_SIZE,Ct as JOB_RUNNING_LIMIT,xt as JOB_RUNNING_POLL_MS,Vt as JobListComponent,rt as TERMINAL_JOB_STATUSES};
1
+ import {U as U$1}from'./chunk-BWr0M-hk.js';import {v as vt}from'./chunk-C-T2O6LE.js';import'./chunk-BmSmqIC7.js';import {S as Si,s as sn}from'./chunk-CYX8w88D.js';import {F as Fe,o as oe}from'./chunk-C3wpjxgW.js';import'./chunk-WzBVBHEz.js';import {C,U,a as ae,V as Ve,b as at$1,q as qo,H as Hw,u as ue,s,r,o,Q as QE,M as Mi,n as n8,J as J6,k as k3,L as Ln,c as sd,z as zc,d as t7,$ as $b,e as V5,D as D5,K as Kt,f as _i,v as vw,R as Rw,g as Kc,h as gh,j as oE,l as lh,N as ND,m as bD,S as SD,p as gI,P as Ph,O as Ow,w as nl,x as ch,y as sE,A as xD,B as _D,E as VD,F as LD,G as Pu,I as Lu}from'./main-BRWQ5RNE.js';var st=(e,d)=>d.id;function lt(e,d){if(e&1&&lh(0,"nz-option",10),e&2){let t=d.$implicit;ch("nzValue",t.id)("nzLabel",t.name+" ("+t.id+")");}}function at(e,d){e&1&&(_i(0,"p",11),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function dt(e,d){if(e&1&&(_i(0,"p",12),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.runningError());}}function pt(e,d){e&1&&(_i(0,"p",13),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),nl(" ",Ow(2,1,"jobs.list.runningEmpty")," "));}function ht(e,d){if(e&1&&lh(0,"app-job-status-table",14),e&2){let t=VD();ch("jobs",t.runningJobs());}}function gt(e,d){if(e&1&&(lh(0,"nz-option",10),Rw(1,"transloco"),Rw(2,"transloco")),e&2){let t=d.$implicit,s=VD();ch("nzValue",t)("nzLabel",t==="all"?Ow(1,2,"jobs.list.filterAll"):Ow(2,4,s.statusKey(t)));}}function mt(e,d){if(e&1&&lh(0,"nz-option",10),e&2){let t=d.$implicit;ch("nzValue",t.id)("nzLabel",t.name+" ("+t.id+")");}}function ct(e,d){e&1&&(_i(0,"p",18),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function ut(e,d){if(e&1&&(_i(0,"p",19),vw(1),Kc()),e&2){let t=VD();gI(),Ph(t.historyError());}}function ft(e,d){e&1&&(_i(0,"p",20),vw(1),Rw(2,"transloco"),Kc()),e&2&&(gI(),nl(" ",Ow(2,1,"jobs.list.historyEmpty")," "));}function yt(e,d){if(e&1){let t=LD();_i(0,"nz-pagination",22),gh("nzPageIndexChange",function(n){Pu(t);let c=VD(2);return Lu(c.setHistoryPage(n))}),Kc();}if(e&2){let t=VD(2);ch("nzPageIndex",t.historyPageIndex())("nzPageSize",t.pageSize)("nzTotal",t.historyTotal());}}function bt(e,d){if(e&1&&(lh(0,"app-job-status-table",14),bD(1,yt,1,3,"nz-pagination",21)),e&2){let t=VD();ch("jobs",t.historyJobs()),gI(),_D(t.historyTotal()>t.pageSize||t.historyPageIndex()>1?1:-1);}}var _t=20,Ct=50,xt=3e3,rt=["completed","failed","cancelled"],Vt=(()=>{class e{constructor(){this.jobsApi=C(U),this.workflowsApi=C(U$1),this.route=C(ae),this.transloco=C(Ve),this.destroyRef=C(at$1),this.pageSize=_t,this.historyStatusOptions=["all",...rt],this.runningJobs=qo([]),this.historyJobs=qo([]),this.workflows=qo([]),this.runningLoading=qo(true),this.historyLoading=qo(true),this.runningError=qo(null),this.historyError=qo(null),this.runningWorkflowId=qo(""),this.historyWorkflowId=qo(""),this.historyStatusFilter=qo("all"),this.showChildJobs=qo(false),this.historyPageIndex=qo(1),this.polling=qo(false),this.historyTotal=Hw(()=>{let t=(this.historyPageIndex()-1)*this.pageSize,s=this.historyJobs().length;return s<this.pageSize?t+s:t+s+1}),this.pollHandle=null,this.onVisibility=()=>{if(document.hidden){this.stopPolling();return}this.loadRunning({silent:true}),this.loadHistory({silent:true}),this.startPolling();},this.destroyRef.onDestroy(()=>{this.stopPolling(),document.removeEventListener("visibilitychange",this.onVisibility);}),this.loadWorkflows(),this.route.queryParamMap.pipe(ue(this.destroyRef)).subscribe(t=>{let s=t.get("status");s&&rt.includes(s)?this.historyStatusFilter.set(s):this.historyStatusFilter.set("all"),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}),document.addEventListener("visibilitychange",this.onVisibility),this.startPolling();}statusKey(t){return `jobs.status.${t}`}isPolling(){return this.polling()}setHistoryStatusFilter(t){this.historyStatusFilter.set(t),this.historyPageIndex.set(1),this.loadHistory();}setRunningWorkflowId(t){this.runningWorkflowId.set(t),this.loadRunning();}setHistoryWorkflowId(t){this.historyWorkflowId.set(t),this.historyPageIndex.set(1),this.loadHistory();}setShowChildJobs(t){this.showChildJobs.set(t),this.historyPageIndex.set(1),this.loadRunning(),this.loadHistory();}setHistoryPage(t){this.historyPageIndex.set(t),this.loadHistory();}loadWorkflows(){this.workflowsApi.list().pipe(ue(this.destroyRef)).subscribe({next:t=>{this.workflows.set(t);},error:()=>{this.workflows.set([]);}});}loadRunning(t={}){let s$1=this.runningWorkflowId();t.silent||(this.runningLoading.set(true),this.runningError.set(null)),this.jobsApi.list(s(r({terminal:false,topLevelOnly:!this.showChildJobs()},s$1?{workflowId:s$1}:{}),{limit:Ct,offset:0})).pipe(ue(this.destroyRef)).subscribe({next:n=>{this.runningJobs.set(n),this.runningLoading.set(false);},error:n=>{this.runningLoading.set(false),!t.silent&&this.runningError.set(this.errorMessage(n,this.transloco.translate("jobs.list.loadFailed")));}});}loadHistory(t={}){let s$1=this.historyStatusFilter(),n=this.historyWorkflowId();t.silent||(this.historyLoading.set(true),this.historyError.set(null)),this.jobsApi.list(s(r(r({terminal:true,topLevelOnly:!this.showChildJobs()},s$1==="all"?{}:{status:s$1}),n?{workflowId:n}:{}),{limit:this.pageSize,offset:(this.historyPageIndex()-1)*this.pageSize})).pipe(ue(this.destroyRef)).subscribe({next:c=>{this.historyJobs.set(c),this.historyLoading.set(false);},error:c=>{this.historyLoading.set(false),!t.silent&&this.historyError.set(this.errorMessage(c,this.transloco.translate("jobs.list.loadFailed")));}});}startPolling(){this.pollHandle!=null||document.hidden||(this.pollHandle=setInterval(()=>{this.loadRunning({silent:true}),this.loadHistory({silent:true});},xt),this.polling.set(true));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}errorMessage(t,s){return t instanceof o||t instanceof Error?t.message:s}static{this.\u0275fac=function(s){return new(s||e)};}static{this.\u0275cmp=QE({type:e,selectors:[["app-job-list"]],decls:56,vars:36,consts:[["data-testid","jobs-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/jobs/new","data-testid","start-job"],["nz-checkbox","","data-testid","show-child-jobs",1,"child-toggle",3,"ngModelChange","ngModel"],["data-testid","jobs-running",1,"section"],[1,"section-header"],[1,"filters"],[1,"field"],["data-testid","running-workflow-filter",3,"ngModelChange","ngModel"],["nzValue","",3,"nzLabel"],[3,"nzValue","nzLabel"],["data-testid","running-loading"],["data-testid","running-error",1,"error"],["data-testid","running-empty",1,"section-empty"],[3,"jobs"],["data-testid","jobs-history",1,"section","section-history"],["data-testid","history-status-filter",3,"ngModelChange","ngModel"],["data-testid","history-workflow-filter",3,"ngModelChange","ngModel"],["data-testid","history-loading"],["data-testid","history-error",1,"error"],["data-testid","history-empty",1,"section-empty"],["data-testid","jobs-pagination",3,"nzPageIndex","nzPageSize","nzTotal"],["data-testid","jobs-pagination",3,"nzPageIndexChange","nzPageIndex","nzPageSize","nzTotal"]],template:function(s,n){s&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"a",2),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"label",3),gh("ngModelChange",function(y){return n.setShowChildJobs(y)}),vw(9),Rw(10,"transloco"),Kc(),oE(),_i(11,"section",4)(12,"header",5)(13,"h2"),vw(14),Rw(15,"transloco"),Kc()(),_i(16,"div",6)(17,"div",7)(18,"span"),vw(19),Rw(20,"transloco"),Kc(),_i(21,"nz-select",8),gh("ngModelChange",function(y){return n.setRunningWorkflowId(y)}),lh(22,"nz-option",9),Rw(23,"transloco"),ND(24,lt,1,2,"nz-option",10,st),Kc(),oE(),Kc()(),bD(26,at,3,3,"p",11)(27,dt,2,1,"p",12)(28,pt,3,3,"p",13)(29,ht,1,1,"app-job-status-table",14),Kc(),_i(30,"section",15)(31,"header",5)(32,"h2"),vw(33),Rw(34,"transloco"),Kc()(),_i(35,"div",6)(36,"div",7)(37,"span"),vw(38),Rw(39,"transloco"),Kc(),_i(40,"nz-select",16),gh("ngModelChange",function(y){return n.setHistoryStatusFilter(y)}),ND(41,gt,3,6,"nz-option",10,SD),Kc(),oE(),Kc(),_i(43,"div",7)(44,"span"),vw(45),Rw(46,"transloco"),Kc(),_i(47,"nz-select",17),gh("ngModelChange",function(y){return n.setHistoryWorkflowId(y)}),lh(48,"nz-option",9),Rw(49,"transloco"),ND(50,mt,1,2,"nz-option",10,st),Kc(),oE(),Kc()(),bD(52,ct,3,3,"p",18)(53,ut,2,1,"p",19)(54,ft,3,3,"p",20)(55,bt,2,2),Kc()()),s&2&&(gI(3),Ph(Ow(4,16,"jobs.list.title")),gI(3),nl(" ",Ow(7,18,"jobs.list.startButton")," "),gI(2),ch("ngModel",n.showChildJobs()),sE(),gI(),nl(" ",Ow(10,20,"jobs.list.showChildJobs")," "),gI(5),Ph(Ow(15,22,"jobs.list.running")),gI(5),Ph(Ow(20,24,"jobs.list.filterByWorkflow")),gI(2),ch("ngModel",n.runningWorkflowId()),sE(),gI(),ch("nzLabel",Ow(23,26,"jobs.list.filterAll")),gI(2),xD(n.workflows()),gI(2),_D(n.runningLoading()?26:n.runningError()?27:n.runningJobs().length===0?28:29),gI(7),Ph(Ow(34,28,"jobs.list.history")),gI(5),Ph(Ow(39,30,"jobs.list.filterByStatus")),gI(2),ch("ngModel",n.historyStatusFilter()),sE(),gI(),xD(n.historyStatusOptions),gI(4),Ph(Ow(46,32,"jobs.list.filterByWorkflow")),gI(2),ch("ngModel",n.historyWorkflowId()),sE(),gI(),ch("nzLabel",Ow(49,34,"jobs.list.filterAll")),gI(2),xD(n.workflows()),gI(2),_D(n.historyLoading()?52:n.historyError()?53:n.historyJobs().length===0?54:55));},dependencies:[Mi,n8,J6,k3,Ln,sd,zc,t7,Fe,oe,Si,sn,$b,V5,D5,vt,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0}.child-toggle[_ngcontent-%COMP%]{align-self:flex-start}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.section-history[_ngcontent-%COMP%]{padding-top:1.25rem;border-top:1px solid #e7e5e4}.section-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.1rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem 1.25rem;align-items:flex-end}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:12rem;max-width:18rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.section-empty[_ngcontent-%COMP%]{margin:0;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return e})();export{_t as JOB_LIST_PAGE_SIZE,Ct as JOB_RUNNING_LIMIT,xt as JOB_RUNNING_POLL_MS,Vt as JobListComponent,rt as TERMINAL_JOB_STATUSES};
@@ -1 +1 @@
1
- import {ak as YE,al as uu,C,ap as oe$1,ao as _r,aq as z0,ar as a3,at as Le,b as at,cH as A,ba as ga,aO as Le$1,X as rd,u as ue$1,av as St,Q as QE,n as n8,cZ as w0,J as J6,k as k3,aC as Z0,aR as BD,f as _i,h as gh,g as Kc,j as oE,l as lh,aS as $D,a4 as Mh,p as gI,x as ch,a5 as ah,y as sE,aD as Sw,aE as h1,aF as wo,aG as Ih,aH as qD,aI as WD,a0 as $0,q as qo,bd as Uw,H as Hw,bi as Kf,Y as Bw,N as ND,E as VD,A as xD,v as vw,w as nl}from'./main-R7YQQZVK.js';var re=["inputElement"],te=["*"],ae=(t,s)=>s.value;function ce(t,s){if(t&1&&(_i(0,"label",0),vw(1),Kc()),t&2){let e=s.$implicit,i=VD(2);ch("nzValue",e.value)("nzName",i.nzName())("nzDisabled",e.disabled||i.finalDisabled()),gI(),nl(" ",e.label," ");}}function le(t,s){if(t&1&&ND(0,ce,2,4,"label",0,ae),t&2){let e=VD();xD(e.normalizedOptions());}}var ie=new A(""),oe=(()=>{class t{ngZone=C(oe$1);elementRef=C(_r);cdr=C(z0);focusMonitor=C(a3);dir=C(Le).valueSignal;destroyRef=C(at);checkboxGroupComponent=C(ie,{optional:true});nzFormStatusService=C(ga,{optional:true});isNzDisableFirstChange=true;onChange=()=>{};onTouched=()=>{};inputElement;nzCheckedChange=new Le$1;nzValue=null;nzAutoFocus=false;nzDisabled=false;nzIndeterminate=false;nzChecked=false;nzId=null;nzName=null;innerCheckedChange(e){!this.nzDisabled&&!this.checkboxGroupComponent?.finalDisabled()&&(this.setValue(e),this.checkboxGroupComponent?.onCheckedChange(this.nzValue,e));}writeValue(e){this.nzChecked=e,this.cdr.markForCheck();}registerOnChange(e){this.onChange=e;}registerOnTouched(e){this.onTouched=e;}setDisabledState(e){this.nzDisabled=this.isNzDisableFirstChange&&this.nzDisabled||e,this.isNzDisableFirstChange=false,this.cdr.markForCheck();}focus(){this.focusMonitor.focusVia(this.inputElement,"keyboard");}blur(){this.inputElement.nativeElement.blur();}constructor(){this.destroyRef.onDestroy(()=>{this.focusMonitor.stopMonitoring(this.elementRef);}),this.checkboxGroupComponent&&rd(()=>{let e=this.checkboxGroupComponent.value()||[];this.setValue(e.includes(this.nzValue)),this.cdr.markForCheck();});}ngOnInit(){this.focusMonitor.monitor(this.elementRef,true).pipe(ue$1(this.destroyRef)).subscribe(e=>{e||Promise.resolve().then(()=>this.onTouched());}),St(this.elementRef.nativeElement,"click").pipe(ue$1(this.destroyRef)).subscribe(e=>{e.preventDefault(),this.focus(),!this.nzDisabled&&this.ngZone.run(()=>{this.innerCheckedChange(!this.nzChecked),this.cdr.markForCheck();});}),St(this.inputElement.nativeElement,"click").pipe(ue$1(this.destroyRef)).subscribe(e=>e.stopPropagation());}ngAfterViewInit(){this.nzAutoFocus&&this.focus();}setValue(e){this.nzChecked=e,this.onChange(e),this.nzCheckedChange.emit(e);}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=QE({type:t,selectors:[["","nz-checkbox",""]],viewQuery:function(i,n){if(i&1&&Ih(re,7),i&2){let r;qD(r=WD())&&(n.inputElement=r.first);}},hostAttrs:[1,"ant-checkbox-wrapper"],hostVars:10,hostBindings:function(i,n){i&2&&Mh("ant-checkbox-group-item",!!n.checkboxGroupComponent)("ant-checkbox-wrapper-in-form-item",!!n.nzFormStatusService)("ant-checkbox-wrapper-checked",n.nzChecked)("ant-checkbox-wrapper-disabled",n.nzDisabled||n.checkboxGroupComponent?.finalDisabled())("ant-checkbox-rtl",n.dir()==="rtl");},inputs:{nzValue:"nzValue",nzAutoFocus:[2,"nzAutoFocus","nzAutoFocus",Z0],nzDisabled:[2,"nzDisabled","nzDisabled",Z0],nzIndeterminate:[2,"nzIndeterminate","nzIndeterminate",Z0],nzChecked:[2,"nzChecked","nzChecked",Z0],nzId:"nzId",nzName:"nzName"},outputs:{nzCheckedChange:"nzCheckedChange"},exportAs:["nzCheckbox"],features:[Sw([{provide:h1,useExisting:wo(()=>t),multi:true}])],ngContentSelectors:te,decls:6,vars:12,consts:[["inputElement",""],[1,"ant-checkbox"],["type","checkbox",1,"ant-checkbox-input",3,"ngModelChange","checked","ngModel","disabled"],[1,"ant-checkbox-inner"]],template:function(i,n){i&1&&(BD(),_i(0,"span",1)(1,"input",2,0),gh("ngModelChange",function(se){return n.innerCheckedChange(se)}),Kc(),oE(),lh(3,"span",3),Kc(),_i(4,"span"),$D(5),Kc()),i&2&&(Mh("ant-checkbox-checked",n.nzChecked&&!n.nzIndeterminate)("ant-checkbox-disabled",n.nzDisabled||n.checkboxGroupComponent?.finalDisabled())("ant-checkbox-indeterminate",n.nzIndeterminate),gI(),ch("checked",n.nzChecked)("ngModel",n.nzChecked)("disabled",n.nzDisabled||(n.checkboxGroupComponent?.finalDisabled()??false)),ah("autofocus",n.nzAutoFocus?"autofocus":null)("id",n.nzId)("name",n.nzName||n.checkboxGroupComponent?.nzName()),sE());},dependencies:[n8,w0,J6,k3],encapsulation:2})}return t})(),ue=(()=>{class t{onChange=()=>{};onTouched=()=>{};isDisabledFirstChange=true;dir=C(Le).valueSignal;nzName=$0(null);nzDisabled=$0(false,{transform:Z0});nzOptions=$0([]);value=qo(null);finalDisabled=Uw(()=>this.nzDisabled());normalizedOptions=Hw(()=>de(this.nzOptions()));constructor(){let e=C(_r),i=C(a3),n=C(at);Kf(()=>{i.monitor(e,true).pipe(ue$1(n)).subscribe(r=>{r||this.onTouched();}),n.onDestroy(()=>{i.stopMonitoring(e);});});}writeValue(e){Bw(()=>{this.value.set(e);});}registerOnChange(e){this.onChange=e;}registerOnTouched(e){this.onTouched=e;}setDisabledState(e){Bw(()=>{this.finalDisabled.set(this.isDisabledFirstChange&&this.nzDisabled()||e);}),this.isDisabledFirstChange=false;}onCheckedChange(e,i){this.finalDisabled()||(this.value.update(n=>i?n?.concat(e)||[e]:n?.filter(r=>r!==e)||[]),this.onChange(this.value()));}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=QE({type:t,selectors:[["nz-checkbox-group"]],hostAttrs:[1,"ant-checkbox-group"],hostVars:2,hostBindings:function(i,n){i&2&&Mh("ant-checkbox-group-rtl",n.dir()==="rtl");},inputs:{nzName:[1,"nzName"],nzDisabled:[1,"nzDisabled"],nzOptions:[1,"nzOptions"]},exportAs:["nzCheckboxGroup"],features:[Sw([{provide:h1,useExisting:wo(()=>t),multi:true},{provide:ie,useExisting:wo(()=>t)}])],ngContentSelectors:te,decls:2,vars:0,consts:[["nz-checkbox","",3,"nzValue","nzName","nzDisabled"]],template:function(i,n){i&1&&(BD(),$D(0,0,null,le,2,0));},dependencies:[oe],encapsulation:2})}return t})();function de(t){return t.map(s=>typeof s=="string"||typeof s=="number"?{label:`${s}`,value:s}:s)}var Fe=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=YE({type:t});static \u0275inj=uu({imports:[oe,ue]})}return t})();export{Fe as F,oe as o};
1
+ import {ak as YE,al as uu,C,ap as oe$1,ao as _r,aq as z0,ar as a3,at as Le,b as at,cH as A,ba as ga,aO as Le$1,X as rd,u as ue$1,av as St,Q as QE,n as n8,cZ as w0,J as J6,k as k3,aC as Z0,aR as BD,f as _i,h as gh,g as Kc,j as oE,l as lh,aS as $D,a4 as Mh,p as gI,x as ch,a5 as ah,y as sE,aD as Sw,aE as h1,aF as wo,aG as Ih,aH as qD,aI as WD,a0 as $0,q as qo,bd as Uw,H as Hw,bi as Kf,Y as Bw,N as ND,E as VD,A as xD,v as vw,w as nl}from'./main-BRWQ5RNE.js';var re=["inputElement"],te=["*"],ae=(t,s)=>s.value;function ce(t,s){if(t&1&&(_i(0,"label",0),vw(1),Kc()),t&2){let e=s.$implicit,i=VD(2);ch("nzValue",e.value)("nzName",i.nzName())("nzDisabled",e.disabled||i.finalDisabled()),gI(),nl(" ",e.label," ");}}function le(t,s){if(t&1&&ND(0,ce,2,4,"label",0,ae),t&2){let e=VD();xD(e.normalizedOptions());}}var ie=new A(""),oe=(()=>{class t{ngZone=C(oe$1);elementRef=C(_r);cdr=C(z0);focusMonitor=C(a3);dir=C(Le).valueSignal;destroyRef=C(at);checkboxGroupComponent=C(ie,{optional:true});nzFormStatusService=C(ga,{optional:true});isNzDisableFirstChange=true;onChange=()=>{};onTouched=()=>{};inputElement;nzCheckedChange=new Le$1;nzValue=null;nzAutoFocus=false;nzDisabled=false;nzIndeterminate=false;nzChecked=false;nzId=null;nzName=null;innerCheckedChange(e){!this.nzDisabled&&!this.checkboxGroupComponent?.finalDisabled()&&(this.setValue(e),this.checkboxGroupComponent?.onCheckedChange(this.nzValue,e));}writeValue(e){this.nzChecked=e,this.cdr.markForCheck();}registerOnChange(e){this.onChange=e;}registerOnTouched(e){this.onTouched=e;}setDisabledState(e){this.nzDisabled=this.isNzDisableFirstChange&&this.nzDisabled||e,this.isNzDisableFirstChange=false,this.cdr.markForCheck();}focus(){this.focusMonitor.focusVia(this.inputElement,"keyboard");}blur(){this.inputElement.nativeElement.blur();}constructor(){this.destroyRef.onDestroy(()=>{this.focusMonitor.stopMonitoring(this.elementRef);}),this.checkboxGroupComponent&&rd(()=>{let e=this.checkboxGroupComponent.value()||[];this.setValue(e.includes(this.nzValue)),this.cdr.markForCheck();});}ngOnInit(){this.focusMonitor.monitor(this.elementRef,true).pipe(ue$1(this.destroyRef)).subscribe(e=>{e||Promise.resolve().then(()=>this.onTouched());}),St(this.elementRef.nativeElement,"click").pipe(ue$1(this.destroyRef)).subscribe(e=>{e.preventDefault(),this.focus(),!this.nzDisabled&&this.ngZone.run(()=>{this.innerCheckedChange(!this.nzChecked),this.cdr.markForCheck();});}),St(this.inputElement.nativeElement,"click").pipe(ue$1(this.destroyRef)).subscribe(e=>e.stopPropagation());}ngAfterViewInit(){this.nzAutoFocus&&this.focus();}setValue(e){this.nzChecked=e,this.onChange(e),this.nzCheckedChange.emit(e);}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=QE({type:t,selectors:[["","nz-checkbox",""]],viewQuery:function(i,n){if(i&1&&Ih(re,7),i&2){let r;qD(r=WD())&&(n.inputElement=r.first);}},hostAttrs:[1,"ant-checkbox-wrapper"],hostVars:10,hostBindings:function(i,n){i&2&&Mh("ant-checkbox-group-item",!!n.checkboxGroupComponent)("ant-checkbox-wrapper-in-form-item",!!n.nzFormStatusService)("ant-checkbox-wrapper-checked",n.nzChecked)("ant-checkbox-wrapper-disabled",n.nzDisabled||n.checkboxGroupComponent?.finalDisabled())("ant-checkbox-rtl",n.dir()==="rtl");},inputs:{nzValue:"nzValue",nzAutoFocus:[2,"nzAutoFocus","nzAutoFocus",Z0],nzDisabled:[2,"nzDisabled","nzDisabled",Z0],nzIndeterminate:[2,"nzIndeterminate","nzIndeterminate",Z0],nzChecked:[2,"nzChecked","nzChecked",Z0],nzId:"nzId",nzName:"nzName"},outputs:{nzCheckedChange:"nzCheckedChange"},exportAs:["nzCheckbox"],features:[Sw([{provide:h1,useExisting:wo(()=>t),multi:true}])],ngContentSelectors:te,decls:6,vars:12,consts:[["inputElement",""],[1,"ant-checkbox"],["type","checkbox",1,"ant-checkbox-input",3,"ngModelChange","checked","ngModel","disabled"],[1,"ant-checkbox-inner"]],template:function(i,n){i&1&&(BD(),_i(0,"span",1)(1,"input",2,0),gh("ngModelChange",function(se){return n.innerCheckedChange(se)}),Kc(),oE(),lh(3,"span",3),Kc(),_i(4,"span"),$D(5),Kc()),i&2&&(Mh("ant-checkbox-checked",n.nzChecked&&!n.nzIndeterminate)("ant-checkbox-disabled",n.nzDisabled||n.checkboxGroupComponent?.finalDisabled())("ant-checkbox-indeterminate",n.nzIndeterminate),gI(),ch("checked",n.nzChecked)("ngModel",n.nzChecked)("disabled",n.nzDisabled||(n.checkboxGroupComponent?.finalDisabled()??false)),ah("autofocus",n.nzAutoFocus?"autofocus":null)("id",n.nzId)("name",n.nzName||n.checkboxGroupComponent?.nzName()),sE());},dependencies:[n8,w0,J6,k3],encapsulation:2})}return t})(),ue=(()=>{class t{onChange=()=>{};onTouched=()=>{};isDisabledFirstChange=true;dir=C(Le).valueSignal;nzName=$0(null);nzDisabled=$0(false,{transform:Z0});nzOptions=$0([]);value=qo(null);finalDisabled=Uw(()=>this.nzDisabled());normalizedOptions=Hw(()=>de(this.nzOptions()));constructor(){let e=C(_r),i=C(a3),n=C(at);Kf(()=>{i.monitor(e,true).pipe(ue$1(n)).subscribe(r=>{r||this.onTouched();}),n.onDestroy(()=>{i.stopMonitoring(e);});});}writeValue(e){Bw(()=>{this.value.set(e);});}registerOnChange(e){this.onChange=e;}registerOnTouched(e){this.onTouched=e;}setDisabledState(e){Bw(()=>{this.finalDisabled.set(this.isDisabledFirstChange&&this.nzDisabled()||e);}),this.isDisabledFirstChange=false;}onCheckedChange(e,i){this.finalDisabled()||(this.value.update(n=>i?n?.concat(e)||[e]:n?.filter(r=>r!==e)||[]),this.onChange(this.value()));}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=QE({type:t,selectors:[["nz-checkbox-group"]],hostAttrs:[1,"ant-checkbox-group"],hostVars:2,hostBindings:function(i,n){i&2&&Mh("ant-checkbox-group-rtl",n.dir()==="rtl");},inputs:{nzName:[1,"nzName"],nzDisabled:[1,"nzDisabled"],nzOptions:[1,"nzOptions"]},exportAs:["nzCheckboxGroup"],features:[Sw([{provide:h1,useExisting:wo(()=>t),multi:true},{provide:ie,useExisting:wo(()=>t)}])],ngContentSelectors:te,decls:2,vars:0,consts:[["nz-checkbox","",3,"nzValue","nzName","nzDisabled"]],template:function(i,n){i&1&&(BD(),$D(0,0,null,le,2,0));},dependencies:[oe],encapsulation:2})}return t})();function de(t){return t.map(s=>typeof s=="string"||typeof s=="number"?{label:`${s}`,value:s}:s)}var Fe=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=YE({type:t});static \u0275inj=uu({imports:[oe,ue]})}return t})();export{Fe as F,oe as o};
@@ -1 +1 @@
1
- import {C,bB as Zi,a8 as a,bD as u,bC as E,i as ie}from'./main-R7YQQZVK.js';var U=(()=>{class r{constructor(){this.http=C(Zi),this.baseUrl=`${a.apiBaseUrl}/batches`;}list(t){return this.http.get(this.baseUrl,{params:u(t)}).pipe(E())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(E())}jobs(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/jobs`).pipe(E())}launch(t){return this.http.post(this.baseUrl,t).pipe(E())}static{this.\u0275fac=function(a){return new(a||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{U};
1
+ import {C,bB as Zi,a8 as a,bD as u,bC as E,i as ie}from'./main-BRWQ5RNE.js';var U=(()=>{class r{constructor(){this.http=C(Zi),this.baseUrl=`${a.apiBaseUrl}/batches`;}list(t){return this.http.get(this.baseUrl,{params:u(t)}).pipe(E())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(E())}jobs(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/jobs`).pipe(E())}launch(t){return this.http.post(this.baseUrl,t).pipe(E())}static{this.\u0275fac=function(a){return new(a||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{U};
@@ -1 +1 @@
1
- import {_ as _n}from'./chunk-Cuaj1Fgz.js';import {w as we}from'./chunk-BYIP8zBR.js';import {C,af as u,U as U$1,T as Ie,V as Ve,b as at,q as qo,H as Hw,u as ue,a9 as Ng,o,Q as QE,M as Mi,L as Ln,c as sd,z as zc,d as t7,K as Kt,f as _i,v as vw,R as Rw,g as Kc,m as bD,p as gI,P as Ph,O as Ow,w as nl,B as _D,E as VD,F as LD,h as gh,x as ch,G as Pu,I as Lu}from'./main-R7YQQZVK.js';import {U}from'./chunk-MRIst_Tv.js';import'./chunk-g1iNEPSG.js';import'./chunk-Dc_LNQ-q.js';import'./chunk-Xv2Lx0k9.js';function q(i,b){i&1&&(_i(0,"p",3),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function G(i,b){if(i&1&&(_i(0,"p",4),vw(1),Kc()),i&2){let t=VD();gI(),Ph(t.loadError());}}function H(i,b){if(i&1&&(_i(0,"p",5),vw(1),Kc()),i&2){let t=VD(2);gI(),Ph(t.actionError());}}function K(i,b){i&1&&(_i(0,"section",6)(1,"p"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"a",8),vw(5),Rw(6,"transloco"),Kc()()),i&2&&(gI(2),Ph(Ow(3,2,"shortcuts.list.emptyState")),gI(3),nl(" ",Ow(6,4,"shortcuts.list.emptyCreateButton")," "));}function Q(i,b){if(i&1){let t=LD();_i(0,"app-runnable-items-table",9),gh("rowAction",function(e){Pu(t);let c=VD(2);return Lu(c.onRowAction(e))}),Kc();}if(i&2){let t=VD(2);ch("rows",t.rows())("selectable",false)("showRowAction",true);}}function X(i,b){if(i&1&&(bD(0,H,2,1,"p",5),bD(1,K,7,6,"section",6)(2,Q,1,3,"app-runnable-items-table",7)),i&2){let t=VD();_D(t.actionError()?0:-1),gI(),_D(t.shortcuts().length===0?1:2);}}var ht=(()=>{class i{constructor(){this.shortcutsApi=C(u),this.workflowsApi=C(U),this.jobsApi=C(U$1),this.router=C(Ie),this.transloco=C(Ve),this.destroyRef=C(at),this.shortcuts=qo([]),this.workflows=qo([]),this.jobsById=qo({}),this.loading=qo(true),this.loadError=qo(null),this.actionError=qo(null),this.rows=Hw(()=>{let t=this.jobsById(),o=this.workflows();return this.shortcuts().map(e=>({id:e.id,primaryLabel:e.name,subtitle:o.find(c=>c.id===e.workflowId)?.name,latestJob:e.lastJobId?t[e.lastJobId]??null:null}))}),this.load();}onRowAction(t){let o=this.shortcuts().find(e=>e.id===t);o&&(this.actionError.set(null),this.jobsApi.start({workflowId:o.workflowId,inputValues:o.inputValues}).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.shortcutsApi.update(o.id,{lastJobId:e.id}).pipe(ue(this.destroyRef)).subscribe({next:c=>{this.shortcuts.update(W=>W.map(C=>C.id===c.id?c:C)),this.router.navigate(["/jobs",e.id]);},error:()=>{this.router.navigate(["/jobs",e.id]);}});},error:e=>{this.actionError.set(this.errorMessage(e,this.transloco.translate("shortcuts.list.runFailed")));}}));}deleteShortcut(t){this.actionError.set(null),this.shortcutsApi.delete(t).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.shortcuts.update(o=>o.filter(e=>e.id!==t));},error:o=>{this.actionError.set(this.errorMessage(o,this.transloco.translate("shortcuts.list.deleteFailed")));}});}load(){this.loading.set(true),this.loadError.set(null),Ng({shortcuts:this.shortcutsApi.list(),workflows:this.workflowsApi.list()}).pipe(ue(this.destroyRef)).subscribe({next:({shortcuts:t,workflows:o})=>{this.shortcuts.set(t),this.workflows.set(o),this.loading.set(false),this.loadLatestJobs(t);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("shortcuts.list.loadFailed")));}});}loadLatestJobs(t){let o=t.map(e=>e.lastJobId).filter(e=>e!=null);if(o.length===0){this.jobsById.set({});return}Ng(Object.fromEntries(o.map(e=>[e,this.jobsApi.get(e)]))).pipe(ue(this.destroyRef)).subscribe({next:e=>this.jobsById.set(e),error:()=>this.jobsById.set({})});}errorMessage(t,o$1){return t instanceof o||t instanceof Error?t.message:o$1}static{this.\u0275fac=function(o){return new(o||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-shortcut-list"]],decls:11,vars:7,consts:[["data-testid","shortcuts-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/shortcuts/new","data-testid","create-shortcut"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","action-error",1,"error"],["data-testid","empty-state",1,"empty"],[3,"rows","selectable","showRowAction"],["nz-button","","nzType","primary","routerLink","/shortcuts/new","data-testid","empty-create"],[3,"rowAction","rows","selectable","showRowAction"]],template:function(o,e){o&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"a",2),vw(6),Rw(7,"transloco"),Kc()(),bD(8,q,3,3,"p",3)(9,G,2,1,"p",4)(10,X,3,2),Kc()),o&2&&(gI(3),Ph(Ow(4,3,"shortcuts.list.title")),gI(3),nl(" ",Ow(7,5,"shortcuts.list.createButton")," "),gI(2),_D(e.loading()?8:e.loadError()?9:10));},dependencies:[Mi,Ln,sd,zc,t7,_n,we,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{ht as ShortcutListComponent};
1
+ import {_ as _n}from'./chunk-DNtWpE65.js';import {w as we}from'./chunk-D32ZkSz4.js';import {C,af as u,U as U$1,T as Ie,V as Ve,b as at,q as qo,H as Hw,u as ue,a9 as Ng,o,Q as QE,M as Mi,L as Ln,c as sd,z as zc,d as t7,K as Kt,f as _i,v as vw,R as Rw,g as Kc,m as bD,p as gI,P as Ph,O as Ow,w as nl,B as _D,E as VD,F as LD,h as gh,x as ch,G as Pu,I as Lu}from'./main-BRWQ5RNE.js';import {U}from'./chunk-BWr0M-hk.js';import'./chunk-CYX8w88D.js';import'./chunk-C3wpjxgW.js';import'./chunk-WzBVBHEz.js';function q(i,b){i&1&&(_i(0,"p",3),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function G(i,b){if(i&1&&(_i(0,"p",4),vw(1),Kc()),i&2){let t=VD();gI(),Ph(t.loadError());}}function H(i,b){if(i&1&&(_i(0,"p",5),vw(1),Kc()),i&2){let t=VD(2);gI(),Ph(t.actionError());}}function K(i,b){i&1&&(_i(0,"section",6)(1,"p"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"a",8),vw(5),Rw(6,"transloco"),Kc()()),i&2&&(gI(2),Ph(Ow(3,2,"shortcuts.list.emptyState")),gI(3),nl(" ",Ow(6,4,"shortcuts.list.emptyCreateButton")," "));}function Q(i,b){if(i&1){let t=LD();_i(0,"app-runnable-items-table",9),gh("rowAction",function(e){Pu(t);let c=VD(2);return Lu(c.onRowAction(e))}),Kc();}if(i&2){let t=VD(2);ch("rows",t.rows())("selectable",false)("showRowAction",true);}}function X(i,b){if(i&1&&(bD(0,H,2,1,"p",5),bD(1,K,7,6,"section",6)(2,Q,1,3,"app-runnable-items-table",7)),i&2){let t=VD();_D(t.actionError()?0:-1),gI(),_D(t.shortcuts().length===0?1:2);}}var ht=(()=>{class i{constructor(){this.shortcutsApi=C(u),this.workflowsApi=C(U),this.jobsApi=C(U$1),this.router=C(Ie),this.transloco=C(Ve),this.destroyRef=C(at),this.shortcuts=qo([]),this.workflows=qo([]),this.jobsById=qo({}),this.loading=qo(true),this.loadError=qo(null),this.actionError=qo(null),this.rows=Hw(()=>{let t=this.jobsById(),o=this.workflows();return this.shortcuts().map(e=>({id:e.id,primaryLabel:e.name,subtitle:o.find(c=>c.id===e.workflowId)?.name,latestJob:e.lastJobId?t[e.lastJobId]??null:null}))}),this.load();}onRowAction(t){let o=this.shortcuts().find(e=>e.id===t);o&&(this.actionError.set(null),this.jobsApi.start({workflowId:o.workflowId,inputValues:o.inputValues}).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.shortcutsApi.update(o.id,{lastJobId:e.id}).pipe(ue(this.destroyRef)).subscribe({next:c=>{this.shortcuts.update(W=>W.map(C=>C.id===c.id?c:C)),this.router.navigate(["/jobs",e.id]);},error:()=>{this.router.navigate(["/jobs",e.id]);}});},error:e=>{this.actionError.set(this.errorMessage(e,this.transloco.translate("shortcuts.list.runFailed")));}}));}deleteShortcut(t){this.actionError.set(null),this.shortcutsApi.delete(t).pipe(ue(this.destroyRef)).subscribe({next:()=>{this.shortcuts.update(o=>o.filter(e=>e.id!==t));},error:o=>{this.actionError.set(this.errorMessage(o,this.transloco.translate("shortcuts.list.deleteFailed")));}});}load(){this.loading.set(true),this.loadError.set(null),Ng({shortcuts:this.shortcutsApi.list(),workflows:this.workflowsApi.list()}).pipe(ue(this.destroyRef)).subscribe({next:({shortcuts:t,workflows:o})=>{this.shortcuts.set(t),this.workflows.set(o),this.loading.set(false),this.loadLatestJobs(t);},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("shortcuts.list.loadFailed")));}});}loadLatestJobs(t){let o=t.map(e=>e.lastJobId).filter(e=>e!=null);if(o.length===0){this.jobsById.set({});return}Ng(Object.fromEntries(o.map(e=>[e,this.jobsApi.get(e)]))).pipe(ue(this.destroyRef)).subscribe({next:e=>this.jobsById.set(e),error:()=>this.jobsById.set({})});}errorMessage(t,o$1){return t instanceof o||t instanceof Error?t.message:o$1}static{this.\u0275fac=function(o){return new(o||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-shortcut-list"]],decls:11,vars:7,consts:[["data-testid","shortcuts-list",1,"list-page"],[1,"header"],["nz-button","","nzType","primary","routerLink","/shortcuts/new","data-testid","create-shortcut"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","action-error",1,"error"],["data-testid","empty-state",1,"empty"],[3,"rows","selectable","showRowAction"],["nz-button","","nzType","primary","routerLink","/shortcuts/new","data-testid","empty-create"],[3,"rowAction","rows","selectable","showRowAction"]],template:function(o,e){o&1&&(_i(0,"main",0)(1,"header",1)(2,"h1"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"a",2),vw(6),Rw(7,"transloco"),Kc()(),bD(8,q,3,3,"p",3)(9,G,2,1,"p",4)(10,X,3,2),Kc()),o&2&&(gI(3),Ph(Ow(4,3,"shortcuts.list.title")),gI(3),nl(" ",Ow(7,5,"shortcuts.list.createButton")," "),gI(2),_D(e.loading()?8:e.loadError()?9:10));},dependencies:[Mi,Ln,sd,zc,t7,_n,we,Kt],styles:[".list-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 1rem;color:#57534e}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{ht as ShortcutListComponent};
@@ -1 +1 @@
1
- import {U}from'./chunk-BiLgez1m.js';import {f}from'./chunk-CoKTfrti.js';import {v as vt}from'./chunk-BEvII7Hn.js';import {W,I}from'./chunk-DjiFAEo3.js';import'./chunk-g1iNEPSG.js';import'./chunk-Dc_LNQ-q.js';import'./chunk-Xv2Lx0k9.js';import {C,a as ae,U as U$1,V as Ve,b as at,q as qo,u as ue,X as rd,Y as Bw,o,Q as QE,M as Mi,L as Ln,K as Kt,f as _i,m as bD,g as Kc,p as gI,B as _D,v as vw,R as Rw,P as Ph,O as Ow,E as VD,l as lh,a2 as Pw,a3 as xw,x as ch}from'./main-R7YQQZVK.js';var z=i=>({count:i});function F(i,h){i&1&&(_i(0,"p",1),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function K(i,h){if(i&1&&(_i(0,"p",2),vw(1),Kc()),i&2){let t=VD();gI(),Ph(t.loadError());}}function L(i,h){if(i&1&&(_i(0,"header",3)(1,"div")(2,"a",4),vw(3),Rw(4,"transloco"),Kc(),_i(5,"h1",5),vw(6),Kc(),_i(7,"p",6)(8,"nz-tag",7),vw(9),Rw(10,"transloco"),Kc(),_i(11,"span",8),vw(12),Kc(),vw(13," \xB7 "),_i(14,"span",9),vw(15),Rw(16,"transloco"),Kc(),vw(17," \xB7 "),_i(18,"span",10),vw(19),Rw(20,"transloco"),Kc()()()(),_i(21,"section",11)(22,"h2"),vw(23),Rw(24,"transloco"),Kc(),lh(25,"app-job-status-table",12),Kc()),i&2){let t=h,e=VD();gI(3),Ph(Ow(4,8,"batches.detail.backHint")),gI(3),Ph(t.id),gI(3),Ph(Ow(10,10,e.statusKey(t.status))),gI(3),Ph(t.workflowId),gI(3),Ph(Pw(16,12,"batches.detail.subjectCount",xw(19,z,t.resolvedSubjects.length))),gI(4),Ph(Ow(20,15,e.triggeredByKey(t.triggeredBy))),gI(4),Ph(Ow(24,17,"batches.detail.membersHeading")),gI(2),ch("jobs",e.memberJobs());}}var $=3e3;function g(i){return i!=="running"}var rt=(()=>{class i{constructor(){this.route=C(ae),this.batchesApi=C(U),this.jobsApi=C(U$1),this.eventsService=C(f),this.transloco=C(Ve),this.destroyRef=C(at),this.batch=qo(null),this.memberJobs=qo([]),this.loading=qo(true),this.loadError=qo(null),this.polling=qo(false),this.eventStream=qo(null),this.pollHandle=null,this.batchId=null,this.destroyRef.onDestroy(()=>{this.stopPolling(),this.closeStream();}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(t=>{let e=t.get("id");if(!e){this.loading.set(false),this.loadError.set(this.transloco.translate("batches.detail.loadFailed"));return}this.load(e);}),rd(()=>{let t=this.eventStream();if(!t)return;let e=t.latest();!e||e.type!=="batch_completed"||e.batchId===this.batchId&&Bw(()=>{this.refreshBatch(),this.refreshMembers(),this.stopPolling(),this.closeStream();});});}statusKey(t){return `batches.status.${t}`}triggeredByKey(t){return `batches.triggeredBy.${t}`}isPolling(){return this.polling()}load(t){this.batchId=t,this.loading.set(true),this.loadError.set(null),this.stopPolling(),this.closeStream(),this.batchesApi.get(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.batch.set(e),this.loading.set(false),this.refreshMembers(),g(e.status)||(this.startPolling(),this.eventStream.set(this.eventsService.connect({batchId:t})));},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("batches.detail.loadFailed")));}});}refreshBatch(){let t=this.batchId;t&&this.batchesApi.get(t).subscribe({next:e=>{this.batch.set(e),g(e.status)&&this.stopPolling();},error:()=>{}});}refreshMembers(){let t=this.batchId;t&&this.jobsApi.list({batchId:t}).subscribe({next:e=>this.memberJobs.set(e),error:()=>{}});}startPolling(){this.pollHandle==null&&(this.polling.set(true),this.pollHandle=setInterval(()=>{let t=this.batch();if(!t||g(t.status)){this.stopPolling();return}this.refreshMembers();},$));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}closeStream(){let t=this.eventStream();t&&(t.close(),this.eventStream.set(null));}errorMessage(t,e){return t instanceof o||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-batch-detail"]],decls:4,vars:1,consts:[["data-testid","batch-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/views"],["data-testid","batch-id"],[1,"meta"],["data-testid","batch-status"],["data-testid","batch-workflow"],["data-testid","batch-subjects"],["data-testid","batch-triggered-by"],["data-testid","batch-members",1,"members"],[3,"jobs"]],template:function(e,p){if(e&1&&(_i(0,"main",0),bD(1,F,3,3,"p",1)(2,K,2,1,"p",2)(3,L,26,21),Kc()),e&2){let f;gI(),_D(p.loading()?1:p.loadError()?2:(f=p.batch())?3:-1,f);}},dependencies:[Mi,Ln,W,I,vt,Kt],styles:[".detail-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:1.35rem;word-break:break-all}.meta[_ngcontent-%COMP%]{margin:.35rem 0 0;color:#57534e;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.members[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{rt as BatchDetailComponent};
1
+ import {U}from'./chunk-C4yhGGeB.js';import {f}from'./chunk-BFYi_kYd.js';import {v as vt}from'./chunk-C-T2O6LE.js';import {W,I}from'./chunk-BmSmqIC7.js';import'./chunk-CYX8w88D.js';import'./chunk-C3wpjxgW.js';import'./chunk-WzBVBHEz.js';import {C,a as ae,U as U$1,V as Ve,b as at,q as qo,u as ue,X as rd,Y as Bw,o,Q as QE,M as Mi,L as Ln,K as Kt,f as _i,m as bD,g as Kc,p as gI,B as _D,v as vw,R as Rw,P as Ph,O as Ow,E as VD,l as lh,a2 as Pw,a3 as xw,x as ch}from'./main-BRWQ5RNE.js';var z=i=>({count:i});function F(i,h){i&1&&(_i(0,"p",1),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function K(i,h){if(i&1&&(_i(0,"p",2),vw(1),Kc()),i&2){let t=VD();gI(),Ph(t.loadError());}}function L(i,h){if(i&1&&(_i(0,"header",3)(1,"div")(2,"a",4),vw(3),Rw(4,"transloco"),Kc(),_i(5,"h1",5),vw(6),Kc(),_i(7,"p",6)(8,"nz-tag",7),vw(9),Rw(10,"transloco"),Kc(),_i(11,"span",8),vw(12),Kc(),vw(13," \xB7 "),_i(14,"span",9),vw(15),Rw(16,"transloco"),Kc(),vw(17," \xB7 "),_i(18,"span",10),vw(19),Rw(20,"transloco"),Kc()()()(),_i(21,"section",11)(22,"h2"),vw(23),Rw(24,"transloco"),Kc(),lh(25,"app-job-status-table",12),Kc()),i&2){let t=h,e=VD();gI(3),Ph(Ow(4,8,"batches.detail.backHint")),gI(3),Ph(t.id),gI(3),Ph(Ow(10,10,e.statusKey(t.status))),gI(3),Ph(t.workflowId),gI(3),Ph(Pw(16,12,"batches.detail.subjectCount",xw(19,z,t.resolvedSubjects.length))),gI(4),Ph(Ow(20,15,e.triggeredByKey(t.triggeredBy))),gI(4),Ph(Ow(24,17,"batches.detail.membersHeading")),gI(2),ch("jobs",e.memberJobs());}}var $=3e3;function g(i){return i!=="running"}var rt=(()=>{class i{constructor(){this.route=C(ae),this.batchesApi=C(U),this.jobsApi=C(U$1),this.eventsService=C(f),this.transloco=C(Ve),this.destroyRef=C(at),this.batch=qo(null),this.memberJobs=qo([]),this.loading=qo(true),this.loadError=qo(null),this.polling=qo(false),this.eventStream=qo(null),this.pollHandle=null,this.batchId=null,this.destroyRef.onDestroy(()=>{this.stopPolling(),this.closeStream();}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(t=>{let e=t.get("id");if(!e){this.loading.set(false),this.loadError.set(this.transloco.translate("batches.detail.loadFailed"));return}this.load(e);}),rd(()=>{let t=this.eventStream();if(!t)return;let e=t.latest();!e||e.type!=="batch_completed"||e.batchId===this.batchId&&Bw(()=>{this.refreshBatch(),this.refreshMembers(),this.stopPolling(),this.closeStream();});});}statusKey(t){return `batches.status.${t}`}triggeredByKey(t){return `batches.triggeredBy.${t}`}isPolling(){return this.polling()}load(t){this.batchId=t,this.loading.set(true),this.loadError.set(null),this.stopPolling(),this.closeStream(),this.batchesApi.get(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.batch.set(e),this.loading.set(false),this.refreshMembers(),g(e.status)||(this.startPolling(),this.eventStream.set(this.eventsService.connect({batchId:t})));},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("batches.detail.loadFailed")));}});}refreshBatch(){let t=this.batchId;t&&this.batchesApi.get(t).subscribe({next:e=>{this.batch.set(e),g(e.status)&&this.stopPolling();},error:()=>{}});}refreshMembers(){let t=this.batchId;t&&this.jobsApi.list({batchId:t}).subscribe({next:e=>this.memberJobs.set(e),error:()=>{}});}startPolling(){this.pollHandle==null&&(this.polling.set(true),this.pollHandle=setInterval(()=>{let t=this.batch();if(!t||g(t.status)){this.stopPolling();return}this.refreshMembers();},$));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}closeStream(){let t=this.eventStream();t&&(t.close(),this.eventStream.set(null));}errorMessage(t,e){return t instanceof o||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-batch-detail"]],decls:4,vars:1,consts:[["data-testid","batch-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/views"],["data-testid","batch-id"],[1,"meta"],["data-testid","batch-status"],["data-testid","batch-workflow"],["data-testid","batch-subjects"],["data-testid","batch-triggered-by"],["data-testid","batch-members",1,"members"],[3,"jobs"]],template:function(e,p){if(e&1&&(_i(0,"main",0),bD(1,F,3,3,"p",1)(2,K,2,1,"p",2)(3,L,26,21),Kc()),e&2){let f;gI(),_D(p.loading()?1:p.loadError()?2:(f=p.batch())?3:-1,f);}},dependencies:[Mi,Ln,W,I,vt,Kt],styles:[".detail-page[_ngcontent-%COMP%]{max-width:72rem;margin:0 auto;padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:1.35rem;word-break:break-all}.meta[_ngcontent-%COMP%]{margin:.35rem 0 0;color:#57534e;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.members[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{rt as BatchDetailComponent};