@knoflows/engine 0.1.0-alpha.12 → 0.1.0-alpha.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine.js +81 -13
- package/dist/migrations/20260919073531_tense_grey_gargoyle/migration.sql +1 -0
- package/dist/migrations/20260919073531_tense_grey_gargoyle/snapshot.json +1348 -0
- package/dist/migrations/20260919081637_fearless_warlock/migration.sql +1 -0
- package/dist/migrations/20260919081637_fearless_warlock/snapshot.json +1358 -0
- package/package.json +3 -3
- package/static/apple-touch-icon.png +0 -0
- package/static/assets/i18n/en.json +50 -9
- package/static/assets/i18n/es.json +50 -9
- package/static/chunk-1Oqdt_Gp.js +1 -0
- package/static/{chunk-C3Ej8Ue9.js → chunk-1eeePIP1.js} +1 -1
- package/static/chunk-37yFTUcY.js +1 -0
- package/static/chunk-7MZQgksi.js +1 -0
- package/static/chunk-7VyHTRp_.js +1 -0
- package/static/chunk-B0V1VBvY.js +1 -0
- package/static/chunk-BH5zvE8A.js +1 -0
- package/static/chunk-BZxs3wP7.js +1 -0
- package/static/chunk-B_L2A3hm.js +1 -0
- package/static/chunk-BbIC5sO2.js +1 -0
- package/static/chunk-BeWWb9rm.js +1 -0
- package/static/chunk-BnD2l9n3.js +1 -0
- package/static/chunk-Bp8u1CCw.js +1 -0
- package/static/chunk-BpOumnMU.js +1 -0
- package/static/chunk-BuPc66MS.js +1 -0
- package/static/{chunk-CK-2DsDH.js → chunk-C4Ee3umI.js} +1 -1
- package/static/chunk-C5n_oTWP.js +1 -0
- package/static/chunk-CF4gc4Im.js +1 -0
- package/static/chunk-CM8oLO7n.js +1 -0
- package/static/chunk-CXGgR5M1.js +1 -0
- package/static/chunk-CiJRU6lo.js +1 -0
- package/static/chunk-Cn95hfnf.js +1 -0
- package/static/chunk-Cq09TrKP.js +1 -0
- package/static/chunk-Cx2n09Ng.js +1 -0
- package/static/chunk-DFoFQkTa.js +1 -0
- package/static/chunk-DMAf3Qir.js +66 -0
- package/static/chunk-DYARU-G0.js +1 -0
- package/static/chunk-DZhQ2iEt.js +1 -0
- package/static/chunk-D_DUAV49.js +1 -0
- package/static/chunk-DgEO14wO.js +1 -0
- package/static/{chunk-hEYSTlD1.js → chunk-DphMF2VB.js} +1 -1
- package/static/chunk-DxZsQqxS.js +1 -0
- package/static/chunk-GQe0l3Uh.js +1 -0
- package/static/chunk-J9qS04nF.js +1 -0
- package/static/chunk-dOUa0Vhs.js +1 -0
- package/static/chunk-nx1xncBD.js +1 -0
- package/static/chunk-q9oVn_qj.js +5 -0
- package/static/{chunk-BquoV7tV.js → chunk-vYeIWxg4.js} +1 -1
- package/static/chunk-yxqIQom4.js +1 -0
- package/static/favicon-16x16.png +0 -0
- package/static/favicon-32x32.png +0 -0
- package/static/favicon.ico +0 -0
- package/static/favicon.svg +12 -0
- package/static/icon-192.png +0 -0
- package/static/icon-512.png +0 -0
- package/static/index.html +30 -5
- package/static/main-2ZW45HAE.js +248 -0
- package/static/media/inter-latin-400-normal-55WT6UWF.woff2 +0 -0
- package/static/media/inter-latin-400-normal-FR5HOXA4.woff +0 -0
- package/static/media/inter-latin-500-normal-W62DVTXI.woff2 +0 -0
- package/static/media/inter-latin-500-normal-ZNGIZ2YB.woff +0 -0
- package/static/media/inter-latin-600-normal-R6Y2SZCR.woff2 +0 -0
- package/static/media/inter-latin-600-normal-ZYHV6QZT.woff +0 -0
- package/static/media/jetbrains-mono-latin-500-normal-ETEQEOVZ.woff +0 -0
- package/static/media/jetbrains-mono-latin-500-normal-V4XIP5OW.woff2 +0 -0
- package/static/media/space-grotesk-latin-500-normal-GESQWJQV.woff2 +0 -0
- package/static/media/space-grotesk-latin-500-normal-HV4TE4RA.woff +0 -0
- package/static/media/space-grotesk-latin-700-normal-6Z7GHSI6.woff +0 -0
- package/static/media/space-grotesk-latin-700-normal-I3MXRIUZ.woff2 +0 -0
- package/static/nz-theme-dark.css +1 -0
- package/static/nz-theme.css +1 -0
- package/static/styles-JGCTKGGH.css +1 -0
- package/static/chunk--F2Y9kLC.js +0 -1
- package/static/chunk-A3t8CipM.js +0 -1
- package/static/chunk-BAgwFLbm.js +0 -1
- package/static/chunk-BLSuZA6j.js +0 -1
- package/static/chunk-Bc9kVhav.js +0 -1
- package/static/chunk-BdrifDCS.js +0 -66
- package/static/chunk-BkJuaRUH.js +0 -1
- package/static/chunk-BmP-Xct3.js +0 -1
- package/static/chunk-BqB1I-vg.js +0 -1
- package/static/chunk-C5T1qa5G.js +0 -1
- package/static/chunk-CKFZoQzp.js +0 -1
- package/static/chunk-CLNhyiRm.js +0 -1
- package/static/chunk-CN5_Adst.js +0 -1
- package/static/chunk-COSsVdG3.js +0 -1
- package/static/chunk-Cj-KtAk-.js +0 -1
- package/static/chunk-CrD5w72_.js +0 -1
- package/static/chunk-CxBYhrEj.js +0 -1
- package/static/chunk-D5Bqg3D5.js +0 -7
- package/static/chunk-DAfnL0eP.js +0 -1
- package/static/chunk-Dc3mv2RT.js +0 -1
- package/static/chunk-Dc7Nho4-.js +0 -1
- package/static/chunk-Df_jRm7U.js +0 -1
- package/static/chunk-Dl9xoaKd.js +0 -1
- package/static/chunk-DqECIHE5.js +0 -1
- package/static/chunk-Dtfc5XNc.js +0 -1
- package/static/chunk-DxtF2GQ1.js +0 -1
- package/static/chunk-KhdCYqqN.js +0 -1
- package/static/chunk-TkjFi8lV.js +0 -1
- package/static/chunk-UArWmYDU.js +0 -1
- package/static/chunk-WGWZEfc0.js +0 -1
- package/static/chunk-jg6TAN9F.js +0 -1
- package/static/chunk-mb666CWY.js +0 -1
- package/static/chunk-nXCKNQUo.js +0 -1
- package/static/chunk-ndsN8K7Q.js +0 -5
- package/static/chunk-tnTBlRRN.js +0 -1
- package/static/main-RRKPLQCF.js +0 -249
- package/static/styles-6MW3GE4V.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {G as Gn,u as un}from'./chunk-vYeIWxg4.js';import {f}from'./chunk-DgEO14wO.js';import {R as Rt$1}from'./chunk-Cx2n09Ng.js';import {w,q,$ as $$1,g,I,h,_,C as C$1,O,k,E,H,T,b,v}from'./chunk-D_DUAV49.js';import {T as T_,i as iy,o as oy,E as E_}from'./chunk-DMAf3Qir.js';import {W,I as I$1}from'./chunk-C4Ee3umI.js';import'./chunk-yxqIQom4.js';import'./chunk-DphMF2VB.js';import {C,a as C1,T as J1,$,V as Ve$1,b as at$1,U as p,q as qo,H as Hw,u as ue,W as rd,X as Bw,c as bi,Q as QE,d as $8,Y as M5,v as v3,Z as pf,a0 as bd,a1 as sp,a2 as fp,a3 as Th,a4 as xh,K as Kt,j as _i,n as bD,l as Kc,w as gI,B as _D,a5 as $0,a6 as B0,s,r as r$1,k as vw,R as Rw,P as Ph,O as Ow,E as VD,L as LD,m as gh,p as lh,G as ah,x as ch,J as Pu,M as Lu,z as nl,a7 as Pw,I as xw,N as ND,D as xD,a8 as Mh,a9 as Lh,aa as Nw}from'./main-2ZW45HAE.js';var We=i=>({index:i}),Pe=()=>[],$e=(i,c)=>c.definition.id,Le=(i,c)=>c.index,oe=(i,c)=>c.id;function Qe(i,c){if(i&1){let e=LD();_i(0,"div",1)(1,"button",2),gh("click",function(){Pu(e);let n=VD();return Lu(n.closeIteration())}),vw(2),Rw(3,"transloco"),Kc(),_i(4,"p",3),vw(5),Rw(6,"transloco"),Kc(),_i(7,"app-job-step-workspace",4),gh("selectExecution",function(n){Pu(e);let d=VD();return Lu(d.onNestedSelect(n))})("resumeSubmit",function(n){Pu(e);let d=VD();return Lu(d.resumeSubmit.emit(n))})("extractResume",function(n){Pu(e);let d=VD();return Lu(d.extractResume.emit(n))})("retryStep",function(n){Pu(e);let d=VD();return Lu(d.retryStep.emit(n))}),Kc()();}if(i&2){let e=c,t=VD();gI(2),nl(" ",Ow(3,12,"jobs.detail.loopBack")," "),gI(3),nl(" ",Pw(6,14,"jobs.detail.loopIteration",xw(17,We,e.index+1))," "),gI(2),ch("definitions",t.nestedLoopDefinition().steps)("executions",e.stepExecutions)("job",t.job())("selectedExecutionId",t.nestedSelectedId())("currentExecutionId",t.currentExecutionId())("waitingEvent",t.waitingEvent())("resuming",t.resuming())("canResume",t.canResume())("canRetryStep",t.canRetryStep())("retryingStep",t.retryingStep());}}function Ke(i,c){if(i&1&&(_i(0,"nz-tag",13),vw(1),Rw(2,"transloco"),Kc()),i&2){let e=c,t=VD().$implicit,n=VD(2);ch("ngClass",n.stepStatusTagClass(e.status,n.theme.theme())),ah("data-testid","step-status-"+t.definition.id),gI(),Ph(Ow(2,3,n.stepStatusKey(e.status)));}}function He(i,c){if(i&1){let e=LD();_i(0,"li")(1,"button",9),gh("click",function(){let n=Pu(e).$implicit,d=VD(2);return Lu(d.onStepClick(n))}),_i(2,"span",10),vw(3),Kc(),_i(4,"span",11)(5,"span",12),vw(6),Rw(7,"transloco"),Kc(),bD(8,Ke,3,5,"nz-tag",13),Kc()()();}if(i&2){let e,t=c.$implicit,n=VD(2);gI(),Mh("selected",n.isSelected(t))("current",n.isCurrent(t))("unreached",!t.reached),ch("disabled",!t.reached),ah("data-testid","step-"+t.definition.id),gI(2),Ph(t.definition.name),gI(3),Ph(Ow(7,11,n.stepTypeKey(t.definition.type))),gI(2),_D((e=t.execution)?8:-1,e);}}function Ue(i,c){i&1&&(_i(0,"p",8),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.noStepSelected")," "));}function Ge(i,c){i&1&&(_i(0,"p",18),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"jobs.detail.inProgress.loop")));}function Xe(i,c){if(i&1){let e=LD();_i(0,"li")(1,"button",21),gh("click",function(){let n=Pu(e).$implicit,d=VD(4);return Lu(d.openIteration(d.selectedDefinition(),n))}),vw(2),Rw(3,"transloco"),Kc()();}if(i&2){let e=c.$implicit;gI(),ah("data-testid","loop-iteration-"+e.index),gI(),nl(" ",Pw(3,2,"jobs.detail.loopIteration",xw(5,We,e.index+1))," ");}}function Ye(i,c){i&1&&(_i(0,"li",12),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"jobs.detail.noIterations")));}function Ze(i,c){if(i&1&&(_i(0,"p",20),vw(1),Kc()),i&2){let e=VD(4);gI(),Ph(e.selectedExecution().error);}}function et(i,c){if(i&1&&(_i(0,"div",14)(1,"h3"),vw(2),Kc(),bD(3,Ge,3,3,"p",18),_i(4,"ul",19),ND(5,Xe,4,7,"li",null,Le,false,Ye,3,3,"li",12),Kc(),bD(8,Ze,2,1,"p",20),Kc()),i&2){let e=VD(3);gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.isRunning(e.selectedExecution())?3:-1),gI(2),xD(e.selectedExecution().iterations??Nw(4,Pe)),gI(3),_D(e.selectedExecution().error?8:-1);}}function tt(i,c){i&1&&(_i(0,"p",18),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.inProgress.sub_workflow")," "));}function it(i,c){if(i&1&&(_i(0,"p",20),vw(1),Kc()),i&2){let e=VD(4);gI(),Ph(e.selectedExecution().error);}}function nt(i,c){if(i&1&&(_i(0,"div",15)(1,"h3"),vw(2),Kc(),bD(3,tt,3,3,"p",18),lh(4,"app-job-status-table",22),bD(5,it,2,1,"p",20),Kc()),i&2){let e=VD(3);gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.isRunning(e.selectedExecution())?3:-1),gI(),ch("jobIds",e.selectedExecution().childJobIds??Nw(4,Pe)),gI(),_D(e.selectedExecution().error?5:-1);}}function ot(i,c){if(i&1&&(_i(0,"p",28),vw(1),Kc()),i&2){let e=VD(6);gI(),Ph(e.confirmationPrompt());}}function at(i,c){if(i&1){let e=LD();_i(0,"div",25),bD(1,ot,2,1,"p",28),_i(2,"label",29),vw(3),Rw(4,"transloco"),_i(5,"textarea",30),gh("input",function(n){Pu(e);let d=VD(5);return Lu(d.setConfirmationComment(n))}),Kc()(),_i(6,"div",31)(7,"button",32),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.submitConfirmation(true))}),vw(8),Rw(9,"transloco"),Kc(),_i(10,"button",33),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.submitConfirmation(false))}),vw(11),Rw(12,"transloco"),Kc()()();}if(i&2){let e=VD(5);gI(),_D(e.confirmationPrompt()?1:-1),gI(2),nl(" ",Ow(4,7,"jobs.resume.comment")," "),gI(2),ch("value",e.confirmationComment()),gI(2),ch("disabled",e.resuming()),gI(),nl(" ",Ow(9,9,e.resuming()?"jobs.resume.submitting":"jobs.resume.approve")," "),gI(2),ch("disabled",e.resuming()),gI(),nl(" ",Ow(12,11,e.resuming()?"jobs.resume.submitting":"jobs.resume.reject")," ");}}function rt(i,c){if(i&1){let e=LD();_i(0,"div",38)(1,"label",41)(2,"input",42),gh("change",function(n){let d=Pu(e).$implicit,C=VD(6);return Lu(C.setCommentReviewIncluded(d.id,n))}),Kc(),_i(3,"span"),vw(4),Rw(5,"transloco"),Kc()(),_i(6,"div",43)(7,"code",44),vw(8),Kc(),_i(9,"textarea",45),gh("input",function(n){let d=Pu(e).$implicit,C=VD(6);return Lu(C.setCommentReviewBody(d.id,n))}),Kc()()();}if(i&2){let e=c.$implicit;ah("data-testid","comment-review-row-"+e.id),gI(2),ch("checked",e.included),ah("data-testid","comment-review-include-"+e.id),gI(2),Ph(Ow(5,9,"jobs.resume.commentReview.include")),gI(3),ah("data-testid","comment-review-location-"+e.id),gI(),Lh("",e.file,":",e.line),gI(),ch("value",e.body),ah("data-testid","comment-review-body-"+e.id);}}function st(i,c){i&1&&(_i(0,"p",39),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),nl(" ",Ow(2,1,"jobs.resume.commentReview.empty")," "));}function lt(i,c){if(i&1){let e=LD();_i(0,"div",26)(1,"div",34)(2,"button",35),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.setCommentReviewAllIncluded(true))}),vw(3),Rw(4,"transloco"),Kc(),_i(5,"button",36),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.setCommentReviewAllIncluded(false))}),vw(6),Rw(7,"transloco"),Kc()(),_i(8,"div",37),ND(9,rt,10,11,"div",38,oe,false,st,3,3,"p",39),Kc(),_i(12,"button",40),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.submitCommentReview())}),vw(13),Rw(14,"transloco"),Kc()();}if(i&2){let e=VD(5);gI(2),ch("disabled",e.resuming()||e.commentReviewDrafts().length===0),gI(),nl(" ",Ow(4,7,"jobs.resume.commentReview.selectAll")," "),gI(2),ch("disabled",e.resuming()||e.commentReviewDrafts().length===0),gI(),nl(" ",Ow(7,9,"jobs.resume.commentReview.selectNone")," "),gI(3),xD(e.commentReviewDrafts()),gI(3),ch("disabled",e.resuming()),gI(),nl(" ",Ow(14,11,e.resuming()?"jobs.resume.submitting":"jobs.resume.button")," ");}}function ct(i,c){if(i&1){let e=LD();_i(0,"label",47)(1,"span"),vw(2),Kc(),_i(3,"textarea",45),gh("input",function(n){let d=Pu(e).$implicit,C=VD(6);return Lu(C.setQuestionnaireAnswer(d.id,n))}),Kc()();}if(i&2){let e=c.$implicit,t=VD(6);ah("data-testid","resume-question-"+e.id),gI(2),Ph(e.prompt),gI(),ch("value",t.questionnaireAnswers()[e.id]),ah("data-testid","resume-answer-"+e.id);}}function dt(i,c){i&1&&(_i(0,"p",12),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"jobs.resume.noQuestions")));}function pt(i,c){if(i&1){let e=LD();_i(0,"div",27)(1,"div",46),ND(2,ct,4,4,"label",47,oe,false,dt,3,3,"p",12),Kc(),_i(5,"label",29),vw(6),Rw(7,"transloco"),_i(8,"textarea",48),gh("input",function(n){Pu(e);let d=VD(5);return Lu(d.setAdditionalComments(n))}),Kc()(),_i(9,"button",40),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.submitQuestionnaire())}),vw(10),Rw(11,"transloco"),Kc()();}if(i&2){let e=VD(5);gI(2),xD(e.questionnaireItems()),gI(4),nl(" ",Ow(7,5,"jobs.resume.additionalComments")," "),gI(2),ch("value",e.additionalComments()),gI(),ch("disabled",e.resuming()||!e.questionnaireReady()),gI(),nl(" ",Ow(11,7,e.resuming()?"jobs.resume.submitting":"jobs.resume.button")," ");}}function ut(i,c){if(i&1&&(_i(0,"section",23)(1,"h4"),vw(2),Rw(3,"transloco"),Kc(),bD(4,at,13,13,"div",25)(5,lt,15,13,"div",26)(6,pt,12,9,"div",27),Kc()),i&2){let e=VD(4);gI(2),Ph(Ow(3,2,"jobs.resume.heading")),gI(2),_D(e.interactionKind()==="confirmation"?4:e.interactionKind()==="comment_review"?5:6);}}function mt(i,c){if(i&1&&(_i(0,"pre",24),vw(1),Kc()),i&2){let e=VD(4);gI(),Ph(e.formatOutput(e.selectedExecution()));}}function _t(i,c){if(i&1&&(_i(0,"div",16)(1,"h3"),vw(2),Kc(),bD(3,ut,7,4,"section",23)(4,mt,2,1,"pre",24),Kc()),i&2){let e=VD(3);gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.showResume()?3:4);}}function xt(i,c){i&1&&(_i(0,"p",18),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.inProgress.extract")," "));}function Ct(i,c){i&1&&(_i(0,"p",12),vw(1),Rw(2,"transloco"),_i(3,"code",57),vw(4),Kc()()),i&2&&(gI(),nl(" ",Ow(2,2,"jobs.extract.pattern")," "),gI(3),Ph(c));}function bt(i,c){if(i&1){let e=LD();_i(0,"section",49)(1,"h4"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"p",12),vw(5),Rw(6,"transloco"),Kc(),_i(7,"pre",51),vw(8),Kc(),bD(9,Ct,5,4,"p",12),_i(10,"label"),vw(11),Rw(12,"transloco"),_i(13,"input",52),gh("input",function(n){Pu(e);let d=VD(4);return Lu(d.onExtractValueInput(n))}),Kc()(),_i(14,"div",53)(15,"button",54),gh("click",function(){Pu(e);let n=VD(4);return Lu(n.provideExtractValue())}),vw(16),Rw(17,"transloco"),Kc(),_i(18,"button",55),gh("click",function(){Pu(e);let n=VD(4);return Lu(n.continueExtract())}),vw(19),Rw(20,"transloco"),Kc(),_i(21,"button",56),gh("click",function(){Pu(e);let n=VD(4);return Lu(n.cancelExtract())}),vw(22),Rw(23,"transloco"),Kc()()();}if(i&2){let e,t=VD(4);gI(2),Ph(Ow(3,12,"jobs.extract.heading")),gI(3),Ph(Ow(6,14,"jobs.extract.sourceValue")),gI(3),Ph(t.extractSourceDisplay()),gI(),_D((e=t.extractPauseData()?.pattern)?9:-1,e),gI(2),nl(" ",Ow(12,16,"jobs.extract.valueLabel")," "),gI(2),ch("value",t.extractValue()),gI(2),ch("disabled",t.resuming()),gI(),nl(" ",Ow(17,18,"jobs.extract.provideValue")," "),gI(2),ch("disabled",t.resuming()),gI(),nl(" ",Ow(20,20,"jobs.extract.continue")," "),gI(2),ch("disabled",t.resuming()),gI(),nl(" ",Ow(23,22,"jobs.extract.cancel")," ");}}function ft(i,c){if(i&1&&(_i(0,"p",50),vw(1),Kc()),i&2){let e=VD(4);gI(),Ph(e.selectedExecution().error);}}function gt(i,c){if(i&1&&(_i(0,"pre",24),vw(1),Kc()),i&2){let e=VD(4);gI(),Ph(e.formatOutput(e.selectedExecution()));}}function vt(i,c){if(i&1&&(_i(0,"div",17)(1,"h3"),vw(2),Kc(),bD(3,xt,3,3,"p",18)(4,bt,24,24,"section",49)(5,ft,2,1,"p",50)(6,gt,2,1,"pre",24),Kc()),i&2){let e=VD(3);gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.isRunning(e.selectedExecution())?3:e.showExtractResume()?4:e.selectedExecution().error||e.selectedExecution().status==="failed"?5:6);}}function ht(i,c){i&1&&(_i(0,"p",58),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.waitingForAgentSlot")," "));}function wt(i,c){if(i&1&&(_i(0,"p",18),vw(1),Rw(2,"transloco"),Kc()),i&2){let e=VD(4);gI(),nl(" ",Ow(2,1,"jobs.detail.inProgress."+e.selectedExecution().type)," ");}}function yt(i,c){if(i&1&&(_i(0,"p",20),vw(1),Kc()),i&2){let e=VD().$implicit;ah("data-testid","review-and-retry-error-"+e.id),gI(),Ph(e.error);}}function St(i,c){if(i&1){let e=LD();_i(0,"div",38)(1,"label",41)(2,"input",42),gh("change",function(n){let d=Pu(e).$implicit,C=VD(6);return Lu(C.setReviewRetryIncluded(d.id,n))}),Kc(),_i(3,"span"),vw(4),Rw(5,"transloco"),Kc()(),_i(6,"div",43)(7,"code",44),vw(8),Kc(),bD(9,yt,2,2,"p",20),_i(10,"textarea",45),gh("input",function(n){let d=Pu(e).$implicit,C=VD(6);return Lu(C.setReviewRetryBody(d.id,n))}),Kc()()();}if(i&2){let e=c.$implicit;ah("data-testid","review-and-retry-row-"+e.id),gI(2),ch("checked",e.included),ah("data-testid","review-and-retry-include-"+e.id),gI(2),Ph(Ow(5,10,"jobs.resume.commentReview.include")),gI(3),ah("data-testid","review-and-retry-location-"+e.id),gI(),Lh("",e.file,":",e.line),gI(),_D(e.error?9:-1),gI(),ch("value",e.body),ah("data-testid","review-and-retry-body-"+e.id);}}function Et(i,c){if(i&1){let e=LD();_i(0,"section",59)(1,"p",61),vw(2),Rw(3,"transloco"),Kc(),_i(4,"div",34)(5,"button",62),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.setReviewRetryAllIncluded(true))}),vw(6),Rw(7,"transloco"),Kc(),_i(8,"button",63),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.setReviewRetryAllIncluded(false))}),vw(9),Rw(10,"transloco"),Kc()(),_i(11,"div",64),ND(12,St,11,12,"div",38,oe),Kc(),_i(14,"button",65),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.submitReviewAndRetry())}),vw(15),Rw(16,"transloco"),Kc()();}if(i&2){let e=VD(5);gI(2),nl(" ",Ow(3,7,"jobs.detail.reviewAndRetryHint")," "),gI(3),ch("disabled",e.retryingStep()||e.reviewRetryDrafts().length===0),gI(),nl(" ",Ow(7,9,"jobs.resume.commentReview.selectAll")," "),gI(2),ch("disabled",e.retryingStep()||e.reviewRetryDrafts().length===0),gI(),nl(" ",Ow(10,11,"jobs.resume.commentReview.selectNone")," "),gI(3),xD(e.reviewRetryDrafts()),gI(2),ch("disabled",e.retryingStep()),gI(),nl(" ",Ow(16,13,e.retryingStep()?"jobs.detail.retrying":"jobs.detail.reviewAndRetry")," ");}}function kt(i,c){if(i&1){let e=LD();_i(0,"button",66),gh("click",function(){Pu(e);let n=VD(5);return Lu(n.retryStep.emit(void 0))}),vw(1),Rw(2,"transloco"),Kc();}if(i&2){let e=VD(5);ch("disabled",e.retryingStep()),gI(),nl(" ",Ow(2,2,e.retryingStep()?"jobs.detail.retrying":"jobs.detail.retryStep")," ");}}function It(i,c){if(i&1&&(_i(0,"p",50),vw(1),Kc(),bD(2,Et,17,15,"section",59)(3,kt,3,4,"button",60)),i&2){let e=VD(4);gI(),Ph(e.selectedExecution().error),gI(),_D(e.showReviewAndRetry()?2:e.showRetryStep()?3:-1);}}function jt(i,c){if(i&1&&(_i(0,"pre",24),vw(1),Kc()),i&2){let e=VD(4);gI(),Ph(e.formatOutput(e.selectedExecution()));}}function Dt(i,c){if(i&1&&(_i(0,"div")(1,"h3"),vw(2),Kc(),bD(3,ht,3,3,"p",58)(4,wt,3,3,"p",18)(5,It,4,2)(6,jt,2,1,"pre",24),Kc()),i&2){let e=VD(3);ah("data-testid",e.selectedExecution().type+"-view"),gI(2),Ph(e.selectedDefinition()?.name),gI(),_D(e.isQueued(e.selectedExecution())?3:e.isRunning(e.selectedExecution())?4:e.selectedExecution().error||e.selectedExecution().status==="failed"?5:6);}}function Tt(i,c){if(i&1&&bD(0,et,9,5,"div",14)(1,nt,6,5,"div",15)(2,_t,5,2,"div",16)(3,vt,7,2,"div",17)(4,Dt,7,3,"div"),i&2){let e,t=VD(2);_D((e=t.selectedExecution().type)==="loop"?0:e==="sub_workflow"?1:e==="interaction"?2:e==="extract"?3:4);}}function Rt(i,c){if(i&1&&(_i(0,"aside",5)(1,"h3"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul",6),ND(5,He,9,13,"li",null,$e),Kc()(),_i(7,"section",7),bD(8,Ue,3,3,"p",8)(9,Tt,5,1),Kc()),i&2){let e=VD();gI(2),Ph(Ow(3,2,"jobs.detail.stepsHeading")),gI(3),xD(e.rows()),gI(3),_D(e.selectedExecution()?9:8);}}var Ne=(()=>{class i{constructor(){this.theme=C(p),this.stepStatusTagClass=h,this.definitions=$0.required(),this.executions=$0.required(),this.job=$0.required(),this.selectedExecutionId=$0(null),this.currentExecutionId=$0(null),this.waitingEvent=$0(null),this.resuming=$0(false),this.canResume=$0(false),this.canRetryStep=$0(false),this.retryingStep=$0(false),this.selectExecution=B0(),this.resumeSubmit=B0(),this.extractResume=B0(),this.retryStep=B0(),this.nestedIteration=qo(null),this.nestedLoopDefinition=qo(null),this.nestedSelectedId=qo(null),this.extractValue=qo(""),this.questionnaireAnswers=qo({}),this.additionalComments=qo(""),this.confirmationComment=qo(""),this.commentReviewDrafts=qo([]),this.reviewRetryDrafts=qo([]),this.rows=Hw(()=>_(this.definitions(),this.executions())),this.selectedExecution=Hw(()=>{let e=this.selectedExecutionId();return e?this.executions().find(t=>t.id===e)??null:null}),this.selectedDefinition=Hw(()=>{let e=this.selectedExecution();return e?this.definitions().find(t=>t.id===e.stepDefinitionId)??null:null}),this.interactionKind=Hw(()=>{let e=this.selectedDefinition();return e?.type==="interaction"?e.interaction:null}),this.interactionData=Hw(()=>{let e=this.selectedDefinition();return C$1({waitingEvent:this.waitingEvent(),priorOutput:e?O(this.definitions(),this.executions(),e.id,this.job()):void 0,selectedOutput:this.selectedExecution()?.output})}),this.waitingPrompts=Hw(()=>{let e=this.selectedDefinition();return e?.type!=="interaction"?[]:k({interaction:e.interaction,waitingEvent:this.waitingEvent(),priorOutput:O(this.definitions(),this.executions(),e.id,this.job()),selectedOutput:this.selectedExecution()?.output})}),this.questionnaireItems=Hw(()=>E(this.interactionData())),this.questionnaireReady=Hw(()=>H(this.questionnaireItems(),this.questionnaireAnswers())),this.confirmationPrompt=Hw(()=>this.waitingPrompts()[0]??""),this.commentReviewItems=Hw(()=>T_(this.interactionData())??[]),this.showResume=Hw(()=>{if(!this.canResume())return false;let e=this.selectedExecution(),t=this.currentExecutionId();return e!=null&&e.id===t&&e.type==="interaction"&&this.job().status==="waiting_for_human"}),this.showExtractResume=Hw(()=>{if(!this.canResume())return false;let e=this.selectedExecution(),t=this.currentExecutionId();return e!=null&&e.id===t&&e.type==="extract"&&this.job().status==="waiting_for_human"}),this.extractPauseData=Hw(()=>{let e=this.waitingEvent();if(e&&Ve(e.data))return e.data;let t=this.selectedExecution()?.output;return Ve(t)?t:null}),this.showRetryStep=Hw(()=>{if(!this.canRetryStep())return false;let e=this.selectedExecution();return !e||e.status!=="failed"||e.id!==this.currentExecutionId()||iy(this.selectedDefinition(),e)?false:T(e.type)}),this.showReviewAndRetry=Hw(()=>{if(!this.canRetryStep())return false;let e=this.selectedExecution();return !e||e.status!=="failed"||e.id!==this.currentExecutionId()?false:iy(this.selectedDefinition(),e)}),rd(()=>{let e=this.questionnaireItems(),t=e.map(n=>n.id).slice().sort().join("\0");Bw(()=>{let n=this.questionnaireAnswers();if(Object.keys(n).slice().sort().join("\0")===t)return;let C={};for(let S of e)C[S.id]=n[S.id]??"";this.questionnaireAnswers.set(C),this.additionalComments.set(""),this.confirmationComment.set("");});}),rd(()=>{let e=this.commentReviewItems(),t=e.map(n=>n.id).slice().sort().join("\0");Bw(()=>{let n=this.commentReviewDrafts();if(n.map(S=>S.id).slice().sort().join("\0")===t)return;let C=new Map(n.map(S=>[S.id,S]));this.commentReviewDrafts.set(e.map(S=>{let N=C.get(S.id);return s(r$1({},S),{body:N?.body??S.body,included:N?.included??true})}));});}),rd(()=>{let e=oy(this.selectedDefinition(),this.selectedExecution()),t=e.map(n=>n.id).slice().sort().join("\0");Bw(()=>{let n=this.reviewRetryDrafts();if(n.map(S=>S.id).slice().sort().join("\0")===t)return;let C=new Map(n.map(S=>[S.id,S]));this.reviewRetryDrafts.set(e.map(S=>{let N=C.get(S.id);return s(r$1({},S),{body:N?.body??S.body,included:N?.included??S.included})}));});});}stepStatusKey(e){return `jobs.stepStatus.${e}`}stepTypeKey(e){return `step-list.stepType.${e}`}onStepClick(e){!e.reached||!e.execution||(this.nestedIteration.set(null),this.nestedLoopDefinition.set(null),this.selectExecution.emit(e.execution.id));}openIteration(e,t){this.nestedLoopDefinition.set(e),this.nestedIteration.set(t);let n=t.stepExecutions.find(C=>C.id===this.currentExecutionId()),d=t.stepExecutions[0];this.nestedSelectedId.set(n?.id??d?.id??null);}closeIteration(){this.nestedIteration.set(null),this.nestedLoopDefinition.set(null),this.nestedSelectedId.set(null);}onNestedSelect(e){this.nestedSelectedId.set(e);}setQuestionnaireAnswer(e,t){let n=t.target.value;this.questionnaireAnswers.update(d=>s(r$1({},d),{[e]:n}));}setAdditionalComments(e){this.additionalComments.set(e.target.value);}setConfirmationComment(e){this.confirmationComment.set(e.target.value);}submitQuestionnaire(){!this.questionnaireReady()||this.resuming()||this.resumeSubmit.emit(b(this.questionnaireItems(),this.questionnaireAnswers(),this.additionalComments()));}submitConfirmation(e){this.resuming()||this.resumeSubmit.emit(v(e,this.confirmationComment()));}setCommentReviewIncluded(e,t){let n=t.target.checked;this.commentReviewDrafts.update(d=>d.map(C=>C.id===e?s(r$1({},C),{included:n}):C));}setCommentReviewBody(e,t){let n=t.target.value;this.commentReviewDrafts.update(d=>d.map(C=>C.id===e?s(r$1({},C),{body:n}):C));}setCommentReviewAllIncluded(e){this.commentReviewDrafts.update(t=>t.map(n=>s(r$1({},n),{included:e})));}submitCommentReview(){this.resuming()||this.resumeSubmit.emit(E_(this.commentReviewDrafts()));}setReviewRetryIncluded(e,t){let n=t.target.checked;this.reviewRetryDrafts.update(d=>d.map(C=>C.id===e?s(r$1({},C),{included:n}):C));}setReviewRetryBody(e,t){let n=t.target.value;this.reviewRetryDrafts.update(d=>d.map(C=>C.id===e?s(r$1({},C),{body:n}):C));}setReviewRetryAllIncluded(e){this.reviewRetryDrafts.update(t=>t.map(n=>s(r$1({},n),{included:e})));}submitReviewAndRetry(){if(this.retryingStep())return;let e=this.reviewRetryDrafts().filter(t=>t.included).map(({file:t,line:n,body:d})=>({file:t,line:n,body:d}));this.retryStep.emit({comments:e});}onExtractValueInput(e){this.extractValue.set(e.target.value);}extractSourceDisplay(){let e=this.extractPauseData();return e?Mt(e.sourceValue):""}provideExtractValue(){this.extractResume.emit({action:"provide_value",value:this.extractValue()});}continueExtract(){this.extractResume.emit({action:"continue"});}cancelExtract(){this.extractResume.emit({action:"cancel"});}formatOutput(e){return e.error?e.error:e.output===void 0?"":typeof e.output=="string"?e.output:JSON.stringify(e.output,null,2)}isRunning(e){return e?.status==="running"}isQueued(e){return e?.status==="queued"}isSelected(e){return e.execution!=null&&e.execution.id===this.selectedExecutionId()}isCurrent(e){return e.execution!=null&&e.execution.id===this.currentExecutionId()}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-job-step-workspace"]],inputs:{definitions:[1,"definitions"],executions:[1,"executions"],job:[1,"job"],selectedExecutionId:[1,"selectedExecutionId"],currentExecutionId:[1,"currentExecutionId"],waitingEvent:[1,"waitingEvent"],resuming:[1,"resuming"],canResume:[1,"canResume"],canRetryStep:[1,"canRetryStep"],retryingStep:[1,"retryingStep"]},outputs:{selectExecution:"selectExecution",resumeSubmit:"resumeSubmit",extractResume:"extractResume",retryStep:"retryStep"},decls:3,vars:1,consts:[["data-testid","job-step-workspace",1,"workspace"],["data-testid","loop-drill-in",1,"nested"],["nz-button","","nzType","link","type","button","data-testid","loop-back",3,"click"],[1,"nested-label"],[3,"selectExecution","resumeSubmit","extractResume","retryStep","definitions","executions","job","selectedExecutionId","currentExecutionId","waitingEvent","resuming","canResume","canRetryStep","retryingStep"],["data-testid","step-side-panel",1,"side-panel"],[1,"step-list"],["data-testid","step-main-area",1,"main-area"],["data-testid","no-step-selected",1,"muted"],["type","button",1,"step-button",3,"click","disabled"],[1,"step-name"],[1,"step-meta"],[1,"muted"],[3,"ngClass"],["data-testid","loop-view"],["data-testid","sub-workflow-view"],["data-testid","interaction-view"],["data-testid","extract-view"],["data-testid","step-in-progress"],["data-testid","loop-iterations",1,"iteration-list"],[1,"error"],["nz-button","","nzType","link","type","button",3,"click"],[3,"jobIds"],["data-testid","resume-form",1,"resume"],["data-testid","step-output"],["data-testid","confirmation-resume"],["data-testid","comment-review-resume"],["data-testid","questionnaire-resume"],["data-testid","confirmation-prompt"],[1,"resume-field"],["data-testid","confirmation-comment","rows","2",3,"input","value"],[1,"confirmation-actions"],["nz-button","","nzType","primary","type","button","data-testid","confirmation-approve",3,"click","disabled"],["nz-button","","nzDanger","","type","button","data-testid","confirmation-reject",3,"click","disabled"],[1,"comment-review-toolbar"],["nz-button","","type","button","data-testid","comment-review-select-all",3,"click","disabled"],["nz-button","","type","button","data-testid","comment-review-select-none",3,"click","disabled"],["data-testid","comment-review-suggestions"],[1,"comment-review-row"],["data-testid","comment-review-empty",1,"muted"],["nz-button","","nzType","primary","type","button","data-testid","resume-button",3,"click","disabled"],[1,"comment-review-include"],["type","checkbox",3,"change","checked"],[1,"comment-review-fields"],[1,"comment-review-location"],["rows","2",3,"input","value"],["data-testid","waiting-questions"],[1,"resume-question"],["data-testid","resume-additional-comments","rows","2",3,"input","value"],["data-testid","extract-resume-form",1,"resume"],["data-testid","step-error",1,"error"],["data-testid","extract-source-value"],["data-testid","extract-value",3,"input","value"],[1,"extract-actions"],["nz-button","","nzType","primary","type","button","data-testid","extract-provide",3,"click","disabled"],["nz-button","","type","button","data-testid","extract-continue",3,"click","disabled"],["nz-button","","nzDanger","","type","button","data-testid","extract-cancel",3,"click","disabled"],["data-testid","extract-pattern"],["data-testid","step-queued"],["data-testid","review-and-retry",1,"resume"],["nz-button","","nzType","primary","type","button","data-testid","retry-step",3,"disabled"],["data-testid","review-and-retry-hint",1,"muted"],["nz-button","","type","button","data-testid","review-and-retry-select-all",3,"click","disabled"],["nz-button","","type","button","data-testid","review-and-retry-select-none",3,"click","disabled"],["data-testid","review-and-retry-comments"],["nz-button","","nzType","primary","type","button","data-testid","review-and-retry-submit",3,"click","disabled"],["nz-button","","nzType","primary","type","button","data-testid","retry-step",3,"click","disabled"]],template:function(t,n){if(t&1&&(_i(0,"div",0),bD(1,Qe,8,19,"div",1)(2,Rt,10,4),Kc()),t&2){let d;gI(),_D((d=n.nestedIteration())?1:2,d);}},dependencies:[i,$8,M5,pf,bd,sp,fp,W,I$1,Rt$1,Kt],styles:["[_nghost-%COMP%]{display:block;min-width:0;max-width:100%}.workspace[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(14rem,18rem) minmax(0,1fr);gap:1rem;align-items:start;min-height:20rem;min-width:0;max-width:100%}.nested[_ngcontent-%COMP%]{grid-column:1 / -1;min-width:0}.nested-label[_ngcontent-%COMP%]{margin:0 0 .75rem;color:#57534e}.side-panel[_ngcontent-%COMP%]{min-width:0;border:1px solid #d6d3d1;background:#ffffffbf;padding:.75rem}.side-panel[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem}.step-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.35rem}.step-button[_ngcontent-%COMP%]{width:100%;text-align:left;font:inherit;padding:.45rem .55rem;border:1px solid transparent;background:transparent;cursor:pointer;display:flex;flex-direction:column;gap:.2rem}.step-button[_ngcontent-%COMP%]:hover:not(:disabled){background:#f5f5f4}.step-button.selected[_ngcontent-%COMP%]{border-color:#a8a29e;background:#fafaf9}.step-button.current[_ngcontent-%COMP%]{box-shadow:inset 3px 0 #0c0a09}.step-button[_ngcontent-%COMP%]:disabled, .step-button.unreached[_ngcontent-%COMP%]{opacity:.55;cursor:not-allowed}.step-name[_ngcontent-%COMP%]{font-weight:600;overflow-wrap:anywhere}.step-meta[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center;font-size:.8rem}.main-area[_ngcontent-%COMP%]{min-width:0;overflow-x:auto;overflow-wrap:anywhere;word-break:break-word;border:1px solid #d6d3d1;background:#ffffffd9;padding:1rem;min-height:16rem}.main-area[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-top:0}.muted[_ngcontent-%COMP%]{color:#78716c}.error[_ngcontent-%COMP%]{color:#9f1239}[data-testid=retry-step][_ngcontent-%COMP%], [data-testid=review-and-retry][_ngcontent-%COMP%]{margin-top:.5rem}pre[_ngcontent-%COMP%]{max-width:100%;overflow:auto;padding:.75rem;background:#f5f5f4;border:1px solid #d6d3d1;font-size:.85rem}.iteration-list[_ngcontent-%COMP%]{padding-left:1.1rem}.resume-question[_ngcontent-%COMP%], .resume-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:0 0 .75rem}.resume-question[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-weight:500}.resume[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%], .resume[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{box-sizing:border-box;width:100%;max-width:100%;font:inherit;padding:.4rem .5rem;border:1px solid #a8a29e}.resume[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{resize:vertical}.confirmation-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.comment-review-toolbar[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;margin:0 0 .75rem}.comment-review-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.5rem .75rem;align-items:start;margin:0 0 .75rem}.comment-review-include[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.35rem;padding-top:.25rem;font-size:.85rem}.comment-review-fields[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:0}.comment-review-location[_ngcontent-%COMP%]{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.8rem}.extract-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}@media(max-width:48rem){.workspace[_ngcontent-%COMP%]{grid-template-columns:minmax(0,1fr)}}"]});}}return i})();function Ve(i){return i!=null&&typeof i=="object"&&!Array.isArray(i)&&"sourceValue"in i}function Mt(i){return i==null?"":typeof i=="string"?i:JSON.stringify(i,null,2)}function Jt(i,c){i&1&&(_i(0,"p",1),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function Vt(i,c){if(i&1&&(_i(0,"p",2),vw(1),Kc()),i&2){let e=VD();gI(),Ph(e.loadError());}}function Wt(i,c){if(i&1&&(vw(0),Rw(1,"transloco")),i&2){let e=VD(2);Lh(" ",Ow(1,2,"jobs.detail.worktreeDeleted")," ",e.worktreeDeletedAt," ");}}function Pt(i,c){if(i&1&&vw(0),i&2){let e=VD(3);nl(" (",e.branch,") ");}}function Nt(i,c){if(i&1&&(vw(0),Rw(1,"transloco"),bD(2,Pt,1,1)),i&2){let e=VD(2);Lh(" ",Ow(1,3,"jobs.detail.worktree")," ",e.worktreePath," "),gI(2),_D(e.branch?2:-1);}}function zt(i,c){if(i&1&&(_i(0,"p",14),bD(1,Wt,2,4)(2,Nt,3,5),Kc()),i&2){let e=VD();gI(),_D(e.worktreeDeletedAt?1:2);}}function Ot(i,c){if(i&1){let e=LD();_i(0,"button",23),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.cancelJob())}),vw(1),Rw(2,"transloco"),Kc();}if(i&2){let e=VD(2);ch("disabled",e.cancelling()),gI(),nl(" ",Ow(2,2,e.cancelling()?"jobs.detail.cancelling":"jobs.detail.cancel")," ");}}function Bt(i,c){if(i&1){let e=LD();_i(0,"button",24),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.retryWorkflow())}),vw(1),Rw(2,"transloco"),Kc();}if(i&2){let e=VD(2);ch("disabled",e.retryingWorkflow()),gI(),nl(" ",Ow(2,2,e.retryingWorkflow()?"jobs.detail.retrying":"jobs.detail.retryWorkflow")," ");}}function At(i,c){if(i&1){let e=LD();_i(0,"button",25),gh("click",function(){Pu(e);let n=VD(2);return Lu(n.jumpToCurrent())}),vw(1),Rw(2,"transloco"),Kc();}i&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.jumpToCurrent")," "));}function Ft(i,c){if(i&1&&(_i(0,"p",19),vw(1),Kc()),i&2){let e=VD(2);gI(),Ph(e.actionError());}}function qt(i,c){i&1&&(lh(0,"nz-alert",20),Rw(1,"transloco")),i&2&&ch("nzMessage",Ow(1,1,"jobs.detail.queued"));}function $t(i,c){if(i&1){let e=LD();_i(0,"app-job-step-workspace",26),gh("selectExecution",function(n){Pu(e);let d=VD(2);return Lu(d.onSelectExecution(n))})("resumeSubmit",function(n){Pu(e);let d=VD(2);return Lu(d.submitResume(n))})("extractResume",function(n){Pu(e);let d=VD(2);return Lu(d.submitExtractResume(n))})("retryStep",function(n){Pu(e);let d=VD(2);return Lu(d.retryThisStep(n))}),Kc();}if(i&2){let e=VD(),t=VD();ch("definitions",c.steps)("executions",e.stepHistory)("job",e)("selectedExecutionId",t.viewedExecutionId())("currentExecutionId",t.blockingExecutionId()??t.currentStep()?.id??null)("waitingEvent",t.waitingEvent())("resuming",t.resuming())("canResume",true)("canRetryStep",e.status==="failed")("retryingStep",t.retryingStep());}}function Lt(i,c){i&1&&(_i(0,"p",22),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),nl(" ",Ow(2,1,"jobs.detail.workflowMissing")," "));}function Qt(i,c){if(i&1){let e=LD();_i(0,"header",3)(1,"div")(2,"a",4),vw(3),Rw(4,"transloco"),Kc(),_i(5,"h1",5),vw(6),Kc(),_i(7,"div",6)(8,"span",7),vw(9),Kc(),_i(10,"button",8),Rw(11,"transloco"),gh("click",function(){let n=Pu(e),d=VD();return Lu(d.copyJobId(n.id))}),lh(12,"span",9),Kc()(),_i(13,"p",10)(14,"span",11),vw(15),Kc(),vw(16," \xB7 "),_i(17,"nz-tag",12),vw(18),Rw(19,"transloco"),Kc(),vw(20," \xB7 "),_i(21,"span",13),vw(22),Kc()(),bD(23,zt,3,1,"p",14),Kc(),_i(24,"div",15),bD(25,Ot,3,4,"button",16),bD(26,Bt,3,4,"button",17),bD(27,At,3,3,"button",18),Kc()(),bD(28,Ft,2,1,"p",19),bD(29,qt,2,3,"nz-alert",20)(30,$t,1,10,"app-job-step-workspace",21)(31,Lt,3,3,"p",22);}if(i&2){let e,t=c,n=VD();gI(3),Ph(Ow(4,14,"jobs.detail.backToStart")),gI(3),Ph(n.composeJobTitle(t)),gI(3),Ph(t.id),gI(),ah("aria-label",Ow(11,16,"jobs.detail.copyId")),gI(5),Ph(t.workflowId),gI(2),ch("ngClass",n.jobStatusTagClass(t.status,n.theme.theme())),gI(),Ph(Ow(19,18,n.statusKey(t.status))),gI(4),Ph(n.subjectText()),gI(),_D(t.worktreePath?23:-1),gI(2),_D(n.isTerminalStatus(t.status)?-1:25),gI(),_D(t.status==="failed"?26:-1),gI(),_D(n.showJumpToCurrent()?27:-1),gI(),_D(n.actionError()?28:-1),gI(),_D(n.showQueued()?29:(e=n.workflow())?30:31,e);}}var Ei=(()=>{class i{constructor(){this.route=C(C1),this.router=C(J1),this.jobsApi=C($),this.eventsService=C(f),this.transloco=C(Ve$1),this.destroyRef=C(at$1),this.theme=C(p),this.jobStatusTagClass=w,this.composeJobTitle=q,this.job=qo(null),this.workflow=qo(null),this.loading=qo(true),this.loadError=qo(null),this.actionError=qo(null),this.eventStream=qo(null),this.eventsSnapshot=qo([]),this.autoFollow=qo(true),this.viewedExecutionId=qo(null),this.resuming=qo(false),this.retryingWorkflow=qo(false),this.retryingStep=qo(false),this.cancelling=qo(false),this.currentStep=Hw(()=>{let e=this.job();return e?$$1(e):null}),this.showQueued=Hw(()=>{let e=this.job();return e!=null&&$$1(e)==null}),this.showJumpToCurrent=Hw(()=>{let e=this.currentStep();return e?this.viewedExecutionId()!==e.id:false}),this.eventLog=Hw(()=>this.eventStream()?.events()??this.eventsSnapshot()),this.waitingEvent=Hw(()=>{let e=this.eventLog();for(let t=e.length-1;t>=0;t-=1){let n=e[t];if(n?.type==="waiting_for_human")return n}return null}),this.blockingExecutionId=Hw(()=>this.job()?.currentStepExecutionId??null),this.destroyRef.onDestroy(()=>this.closeStream()),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(e=>{let t=e.get("id");if(!t){this.loading.set(false),this.loadError.set(this.transloco.translate("jobs.detail.loadFailed"));return}this.load(t);}),rd(()=>{let e=this.eventStream();if(!e)return;let t=e.latest();t&&Bw(()=>{(t.type==="step_started"||t.type==="step_completed"||t.type==="step_failed"||t.type==="waiting_for_human"||t.type==="waiting_for_children"||t.type==="human_answered"||t.type==="job_completed"||t.type==="job_failed"||t.type==="job_cancelled")&&this.refreshJob(t.jobId),(t.type==="job_completed"||t.type==="job_failed"||t.type==="job_cancelled")&&this.closeStream();});}),rd(()=>{let e=this.currentStep();this.autoFollow()&&Bw(()=>{this.viewedExecutionId.set(e?.id??null);});});}statusKey(e){return `jobs.status.${e}`}isTerminalStatus(e){return g(e)}subjectText(){return I(this.job()?.subjectContext)??"\u2014"}copyJobId(e){let t=globalThis.navigator?.clipboard;t?.writeText&&t.writeText(e);}onSelectExecution(e){this.autoFollow.set(false),this.viewedExecutionId.set(e);}jumpToCurrent(){this.autoFollow.set(true),this.viewedExecutionId.set(this.currentStep()?.id??null);}submitResume(e){let t=this.job();t&&(this.actionError.set(null),this.resuming.set(true),this.jobsApi.resume(t.id,e).subscribe({next:n=>{this.resuming.set(false),this.applyJob(n),g(n.status)&&this.closeStream();},error:n=>{this.resuming.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.resumeFailed")));}}));}submitExtractResume(e){let t=this.job();t&&(this.actionError.set(null),this.resuming.set(true),this.jobsApi.resume(t.id,e).subscribe({next:n=>{this.resuming.set(false),this.applyJob(n),g(n.status)&&this.closeStream();},error:n=>{this.resuming.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.resumeFailed")));}}));}retryWorkflow(){let e=this.job();!e||e.status!=="failed"||this.retryingWorkflow()||(this.actionError.set(null),this.retryingWorkflow.set(true),this.jobsApi.retry(e.id).subscribe({next:t=>{this.retryingWorkflow.set(false),this.router.navigate(["/jobs",t.id]);},error:t=>{this.retryingWorkflow.set(false),this.actionError.set(this.errorMessage(t,this.transloco.translate("jobs.errors.retryFailed")));}}));}retryThisStep(e){let t=this.job();!t||t.status!=="failed"||this.retryingStep()||(this.actionError.set(null),this.retryingStep.set(true),this.jobsApi.retryStep(t.id,e).subscribe({next:n=>{this.retryingStep.set(false),this.applyJob(n),g(n.status)?this.closeStream():(this.closeStream(),this.eventStream.set(this.eventsService.connect({jobId:n.id})));},error:n=>{this.retryingStep.set(false),this.actionError.set(this.errorMessage(n,this.transloco.translate("jobs.errors.retryStepFailed")));}}));}cancelJob(){let e=this.job();!e||g(e.status)||this.cancelling()||(this.actionError.set(null),this.cancelling.set(true),this.jobsApi.cancel(e.id).subscribe({next:t=>{this.cancelling.set(false),this.applyJob(t),g(t.status)&&this.closeStream();},error:t=>{this.cancelling.set(false),this.actionError.set(this.errorMessage(t,this.transloco.translate("jobs.errors.cancelFailed")));}}));}load(e){this.loading.set(true),this.loadError.set(null),this.actionError.set(null),this.autoFollow.set(true),this.viewedExecutionId.set(null),this.retryingWorkflow.set(false),this.retryingStep.set(false),this.cancelling.set(false),this.closeStream(),this.eventsSnapshot.set([]),this.jobsApi.get(e).pipe(ue(this.destroyRef)).subscribe({next:t=>{this.applyJob(t),this.loading.set(false),g(t.status)||this.eventStream.set(this.eventsService.connect({jobId:t.id}));},error:t=>{this.loading.set(false),this.loadError.set(this.errorMessage(t,this.transloco.translate("jobs.detail.loadFailed")));}});}applyJob(e){this.job.set(e),this.workflow.set(e.workflowSnapshot??null),this.autoFollow()&&this.viewedExecutionId.set($$1(e)?.id??null);}refreshJob(e){this.jobsApi.get(e).subscribe({next:t=>this.applyJob(t),error:t=>{this.actionError.set(this.errorMessage(t,this.transloco.translate("jobs.errors.refreshFailed")));}});}closeStream(){let e=this.eventStream();e&&(this.eventsSnapshot.set(e.events()),e.close(),this.eventStream.set(null));}errorMessage(e,t){return e instanceof bi||e instanceof Error?e.message:t}static{this.\u0275fac=function(t){return new(t||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-job-detail"]],decls:4,vars:1,consts:[["data-testid","job-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/jobs"],["data-testid","job-title"],[1,"job-id-line"],["data-testid","job-id",1,"job-id","mono"],["type","button","nz-button","","nzType","text","nzSize","small","data-testid","copy-job-id",1,"copy-job-id",3,"click"],["nz-icon","","nzType","copy","nzTheme","outline"],[1,"meta"],["data-testid","job-workflow"],["data-testid","job-status",3,"ngClass"],["data-testid","job-subject"],["data-testid","job-worktree",1,"meta"],[1,"header-actions"],["nz-button","","nzDanger","","type","button","data-testid","cancel-job",3,"disabled"],["nz-button","","nzType","primary","type","button","data-testid","retry-workflow",3,"disabled"],["nz-button","","type","button","data-testid","jump-to-current"],["data-testid","action-error",1,"error"],["data-testid","queued-message","nzType","info",3,"nzMessage"],[3,"definitions","executions","job","selectedExecutionId","currentExecutionId","waitingEvent","resuming","canResume","canRetryStep","retryingStep"],["data-testid","missing-workflow",1,"muted"],["nz-button","","nzDanger","","type","button","data-testid","cancel-job",3,"click","disabled"],["nz-button","","nzType","primary","type","button","data-testid","retry-workflow",3,"click","disabled"],["nz-button","","type","button","data-testid","jump-to-current",3,"click"],[3,"selectExecution","resumeSubmit","extractResume","retryStep","definitions","executions","job","selectedExecutionId","currentExecutionId","waitingEvent","resuming","canResume","canRetryStep","retryingStep"]],template:function(t,n){if(t&1&&(_i(0,"main",0),bD(1,Jt,3,3,"p",1)(2,Vt,2,1,"p",2)(3,Qt,32,20),Kc()),t&2){let d;gI(),_D(n.loading()?1:n.loadError()?2:(d=n.job())?3:-1,d);}},dependencies:[$8,M5,v3,Gn,un,pf,bd,sp,fp,Th,xh,W,I$1,Ne,Kt],styles:["[_nghost-%COMP%]{display:block;min-width:0;max-width:100%}.detail-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem;min-width:0;max-width:100%}.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;align-items:center}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:1.35rem}.job-id-line[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.15rem;margin-top:.2rem}.job-id[_ngcontent-%COMP%]{font-size:.8rem;color:var(--knoflows-text-secondary, #6b6558)}.copy-job-id[_ngcontent-%COMP%]{color:var(--knoflows-text-secondary, #6b6558)}.meta[_ngcontent-%COMP%]{margin:.35rem 0 0;color:#57534e;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.error[_ngcontent-%COMP%]{color:#9f1239}.muted[_ngcontent-%COMP%]{color:#78716c}"]});}}return i})();export{Ei as JobDetailComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {f}from'./chunk-J9qS04nF.js';import {C,b as at,a5 as $0,a6 as B0,q as qo,u as ue,s,r as r$1,Q as QE,d as $8,K as Kt,a$ as Jc,N as ND,b0 as Xc,w as gI,D as xD,k as vw,n as bD,z as nl,B as _D,L as LD,bu as mh,J as Pu,E as VD,M as Lu,cU as ph,G as ah,S as SD,aa as Nw,R as Rw,P as Ph,O as Ow}from'./main-2ZW45HAE.js';var q=()=>[],A=(t,o)=>o.name,B=(t,o)=>o.id;function j(t,o){t&1&&(Jc(0,"span",1),vw(1,"*"),Xc());}function z(t,o){if(t&1){let e=LD();Jc(0,"input",6),mh("change",function(r){Pu(e);let a=VD().$implicit,c=VD();return Lu(c.setValue(a,r))}),Xc();}if(t&2){let e=VD().$implicit,n=VD();ph("checked",n.checked(e)),ah("data-testid","input-"+e.name);}}function U(t,o){if(t&1){let e=LD();Jc(0,"input",7),mh("input",function(r){Pu(e);let a=VD().$implicit,c=VD();return Lu(c.setValue(a,r))}),Xc();}if(t&2){let e=VD().$implicit,n=VD();ph("value",n.displayValue(e)),ah("data-testid","input-"+e.name);}}function G(t,o){if(t&1&&(Jc(0,"option",4),vw(1),Xc()),t&2){let e=o.$implicit;ph("value",e),gI(),Ph(e);}}function H(t,o){if(t&1){let e=LD();Jc(0,"select",8),mh("change",function(r){Pu(e);let a=VD().$implicit,c=VD();return Lu(c.setValue(a,r))}),ND(1,G,2,2,"option",4,SD),Xc();}if(t&2){let e=VD().$implicit,n=VD();ph("value",n.displayValue(e)),ah("data-testid","input-"+e.name),gI(),xD(e.options??Nw(2,q));}}function J(t,o){if(t&1&&(Jc(0,"option",4),vw(1),Xc()),t&2){let e=o.$implicit;ph("value",e.id),gI(),Ph(e.name);}}function K(t,o){if(t&1){let e=LD();Jc(0,"select",8),mh("change",function(r){Pu(e);let a=VD().$implicit,c=VD();return Lu(c.setValue(a,r))}),Jc(1,"option",9),vw(2),Rw(3,"transloco"),Xc(),ND(4,J,2,2,"option",4,B),Xc();}if(t&2){let e=VD().$implicit,n=VD();ph("value",n.displayValue(e)),ah("data-testid","input-"+e.name),gI(2),Ph(Ow(3,3,"workflow-input.localRepositoryPlaceholder")),gI(2),xD(n.localRepositories());}}function Q(t,o){if(t&1){let e=LD();Jc(0,"input",10),mh("input",function(r){Pu(e);let a=VD().$implicit,c=VD();return Lu(c.setValue(a,r))}),Xc();}if(t&2){let e=VD().$implicit,n=VD();ph("value",n.displayValue(e)),ah("data-testid","input-"+e.name);}}function X(t,o){if(t&1&&(Jc(0,"label"),vw(1),bD(2,j,2,0,"span",1),bD(3,z,1,2,"input",2)(4,U,1,2,"input",3)(5,H,3,3,"select",4)(6,K,6,5,"select",4)(7,Q,1,2,"input",5),Xc()),t&2){let e,n=o.$implicit;gI(),nl(" ",n.label," "),gI(),_D(n.required?2:-1),gI(),_D((e=n.type)==="boolean"?3:e==="number"?4:e==="select"?5:e==="localRepository"?6:7);}}function Y(t){if(t.defaultValue!==void 0)return t.defaultValue;switch(t.type){case "boolean":return false;case "number":return "";case "select":return t.options?.[0]??"";default:return ""}}function ae(t){let o={};for(let e of t)o[e.name]=Y(e);return o}var le=(()=>{class t{constructor(){this.reposApi=C(f),this.destroyRef=C(at),this.fields=$0([]),this.values=$0({}),this.valuesChange=B0(),this.localRepositories=qo([]),this.reposApi.list().pipe(ue(this.destroyRef)).subscribe({next:e=>this.localRepositories.set(e),error:()=>this.localRepositories.set([])});}displayValue(e){let n=this.values()[e.name];return n==null?"":String(n)}checked(e){return !!this.values()[e.name]}setValue(e,n){let r=n.target,a=r.value;e.type==="boolean"?a=r.checked:e.type==="number"&&(a=r.value===""?"":Number(r.value)),this.valuesChange.emit(s(r$1({},this.values()),{[e.name]:a}));}static{this.\u0275fac=function(n){return new(n||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-workflow-input-form"]],inputs:{fields:[1,"fields"],values:[1,"values"]},outputs:{valuesChange:"valuesChange"},decls:3,vars:0,consts:[["data-testid","workflow-input-form",1,"input-form"],[1,"required"],["type","checkbox",3,"checked"],["type","number",3,"value"],[3,"value"],["type","text",3,"value"],["type","checkbox",3,"change","checked"],["type","number",3,"input","value"],[3,"change","value"],["value",""],["type","text",3,"input","value"]],template:function(n,r){n&1&&(Jc(0,"div",0),ND(1,X,8,3,"label",null,A),Xc()),n&2&&(gI(),xD(r.fields()));},dependencies:[$8,Kt],styles:["label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.75rem 0;font-size:.95rem}input[type=text][_ngcontent-%COMP%], input[type=number][_ngcontent-%COMP%], select[_ngcontent-%COMP%]{font:inherit;padding:.4rem .5rem;border:1px solid #a8a29e;background:#fff}input[type=checkbox][_ngcontent-%COMP%]{width:1.1rem;height:1.1rem}.required[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{ae as a,le as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {x as xy}from'./chunk-DMAf3Qir.js';function l(t){switch(t){case "completed":return "success";case "failed":return "error";case "cancelled":case "waiting_for_human":return "warning";default:return null}}function p(t){switch(t){case "completed":return "success";case "failed":return "error";case "completed_with_issues":case "cancelled":return "warning";default:return null}}function d(t){switch(t){case "completed":return "success";case "failed":return "error";default:return null}}function a(t,e){return e==="dark"&&t?`knoflows-tag-${t}`:""}function w(t,e){return a(l(t),e)}function x(t,e){return a(p(t),e)}function h(t,e){return a(d(t),e)}var m=new Set(["completed","failed","cancelled"]);function T(t){return t==="agent"||t==="shell"||t==="git"||t==="provider_action"}function g(t){return m.has(t)}function $(t){let e=t.stepHistory.find(r=>r.status==="running");if(e)return e;let n=t.stepHistory.find(r=>r.status==="queued");if(n)return n;if((t.status==="waiting_for_human"||t.status==="waiting_for_children")&&t.currentStepExecutionId){let r=t.stepHistory.find(i=>i.id===t.currentStepExecutionId);if(r)return r}return g(t.status)&&t.stepHistory.length>0?t.stepHistory[t.stepHistory.length-1]??null:null}function _(t,e){let n=new Map;for(let r of e)n.set(r.stepDefinitionId,r);return t.map(r=>{let i=n.get(r.id)??null;return {definition:r,execution:i,reached:i!=null}})}function I(t){if(!t)return null;if(t.mode==="single"){let n=t.subject;return `${n.id} \xB7 ${n.title}`}let e=t.subjects.length;if(e===0)return null;if(e===1){let n=t.subjects[0];return `${n.id} \xB7 ${n.title}`}return `${e} subjects`}function q(t){let e=t.workflowSnapshot?.name??t.workflowId;return t.subjectContext?t.subjectContext.mode==="single"?`${e} \u2014 ${t.subjectContext.subject.title}`:`${e} \u2014 ${t.subjectContext.subjects.length} items`:e}function O(t,e,n,r){let i=t.findIndex(u=>u.id===n);if(!(i<0))for(let u=i-1;u>=0;u-=1){let s=t[u];if(s.type!=="agent")continue;let c=e.find(o=>o.stepDefinitionId===s.id);if(c?.output!==void 0)return c.output;if(Object.prototype.hasOwnProperty.call(r.context,s.id))return r.context[s.id]}}function k(t){let e=t.waitingEvent;if(e&&e.questions.length>0)return e.questions;let n=e?.data??t.selectedOutput??t.priorOutput,r=xy(t.interaction,n);return r.length>0?r:e?.data!=null?[JSON.stringify(e.data,null,2)]:[]}function C(t){return t.waitingEvent?.data??t.selectedOutput??t.priorOutput}function E(t){if(!t||typeof t!="object")return [];let e=t.questions;if(!Array.isArray(e))return [];let n=new Set,r=[];return e.forEach((i,u)=>{let s="",c="";if(typeof i=="string")c=i.trim();else if(i&&typeof i=="object"){let o=i;typeof o.prompt=="string"&&(c=o.prompt.trim()),typeof o.id=="string"&&(s=o.id.trim());}if(c){if(!s){let o=`q${u+1}`;for(;n.has(o);)o=`${o}_${u}`;s=o;}n.add(s),r.push({id:s,prompt:c});}}),r}function H(t,e){return t.every(n=>(e[n.id]??"").trim()!=="")}function b(t,e,n){let r={};for(let u of t)r[u.id]=(e[u.id]??"").trim();let i=n.trim();return i&&(r.additionalComments=i),r}function v(t,e){let n=e.trim();return n?{approved:t,comment:n}:{approved:t}}export{$,C,E,H,I,O,T,_,b,g,h,k,q,v,w,x};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {q as qo,H as Hw,ab as ix,i as ie}from'./main-2ZW45HAE.js';var f=(()=>{class e{connect(t){let n=new URLSearchParams;t?.jobId&&n.set("jobId",t.jobId),t?.batchId&&n.set("batchId",t.batchId);let r=n.toString(),p=`${ix.apiBaseUrl}/events${r?`?${r}`:""}`,a=qo([]),b=Hw(()=>{let o=a();return o.length>0?o[o.length-1]:void 0}),s=new EventSource(p);return s.onmessage=o=>{let c;try{c=JSON.parse(o.data);}catch(d){return}a.update(d=>[...d,c]);},{events:a.asReadonly(),latest:b,close:()=>{s.onmessage=null,s.close();}}}static{this.\u0275fac=function(n){return new(n||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"});}}return e})();export{f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {C,
|
|
1
|
+
import {C,dr as yh,u as ue,cy as Gl,aw as Se,cf as Kg,i as ie,aF as oe,b as at,bV as re,ds as Dr,c_ as Qg,b_ as ql}from'./main-2ZW45HAE.js';var u=()=>{},R=(()=>{class e{ngZone=C(oe);destroyRef=C(at);resizeSource$=new re;listeners=0;renderer=C(Dr).createRenderer(null,null);disposeHandle=u;handler=()=>{this.ngZone.run(()=>{this.resizeSource$.next();});};constructor(){this.destroyRef.onDestroy(()=>{this.handler=u;});}connect(){return this.registerListener(),this.resizeSource$.pipe(Qg(16),ql(()=>this.unregisterListener()))}disconnet(){this.unregisterListener();}registerListener(){this.listeners===0&&this.ngZone.runOutsideAngular(()=>{this.disposeHandle=this.renderer.listen("window","resize",this.handler);}),this.listeners+=1;}unregisterListener(){this.listeners-=1,this.listeners===0&&(this.disposeHandle(),this.disposeHandle=u);}static \u0275fac=function(n){return new(n||e)};static \u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),$=(()=>{class e{get singletonRegistry(){return this._singletonRegistry}_singletonRegistry=new Map;registerSingletonWithKey(t,n){let i=this.singletonRegistry.has(t),r=i?this.singletonRegistry.get(t):this.withNewTarget(n);i||this.singletonRegistry.set(t,r);}unregisterSingletonWithKey(t){this.singletonRegistry.has(t)&&this.singletonRegistry.delete(t);}getSingletonWithKey(t){return this.singletonRegistry.has(t)?this.singletonRegistry.get(t).target:null}withNewTarget(t){return {target:t}}static \u0275fac=function(n){return new(n||e)};static \u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var M=(function(e){return e.xxxl="xxxl",e.xxl="xxl",e.xl="xl",e.lg="lg",e.md="md",e.sm="sm",e.xs="xs",e})(M||{});var b={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)",xxxl:"(min-width: 1920px)"};var z=(()=>{class e{resizeService=C(R);mediaMatcher=C(yh);constructor(){this.resizeService.connect().pipe(ue()).subscribe();}subscribe(t,n){return n?this.resizeService.connect().pipe(Gl(void 0),Se(()=>this.matchMedia(t,true)),Kg((i,r)=>i[0]===r[0]),Se(i=>i[1])):this.resizeService.connect().pipe(Gl(void 0),Se(()=>this.matchMedia(t)),Kg())}matchMedia(t,n){let i=M.md,r={};return Object.keys(t).map(S=>{let d=S,g=this.mediaMatcher.matchMedia(b[d]).matches;r[d]=g,g&&(i=d);}),n?[i,r]:i}static \u0275fac=function(n){return new(n||e)};static \u0275prov=ie({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{$,M,R,b,z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {w as we}from'./chunk-7MZQgksi.js';import {A as At}from'./chunk-BnD2l9n3.js';import {a as ae,l as le}from'./chunk-DZhQ2iEt.js';import'./chunk-BuPc66MS.js';import'./chunk-B_L2A3hm.js';import'./chunk-J9qS04nF.js';import {C,a as C1,as as U,$,V as Ve,b as at$1,q as qo,H as Hw,u as ue,r as r$1,ac as Ng,ae as Dg,c as bi,Q as QE,d as $8,v as v3,Z as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,n as bD,l as Kc,w as gI,B as _D,k as vw,R as Rw,P as Ph,O as Ow,E as VD,L as LD,m as gh,x as ch,z as nl,J as Pu,M as Lu,p as lh,I as xw}from'./main-2ZW45HAE.js';import {b}from'./chunk-CM8oLO7n.js';import {G as Gn,u as un}from'./chunk-vYeIWxg4.js';import {U as U$1}from'./chunk-nx1xncBD.js';import'./chunk-yxqIQom4.js';import'./chunk-DphMF2VB.js';var et=i=>["/batches",i];function it(i,r){i&1&&(_i(0,"p",1),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function nt(i,r){if(i&1&&(_i(0,"p",2),vw(1),Kc()),i&2){let t=VD();gI(),Ph(t.loadError());}}function ot(i,r){i&1&&(_i(0,"a",10),vw(1),Rw(2,"transloco"),Kc()),i&2&&(ch("routerLink",xw(4,et,r)),gI(),nl(" ",Ow(2,2,"views.detail.openBatch")," "));}function at(i,r){if(i&1&&(lh(0,"nz-alert",9),bD(1,ot,3,6,"a",10)),i&2){let t,e=VD(2);ch("nzMessage",e.confirmation()),gI(),_D((t=e.confirmationBatchId())?1:-1,t);}}function lt(i,r){i&1&&(_i(0,"p",11),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),nl(" ",Ow(2,1,"views.detail.noBulkWorkflows")," "));}function rt(i,r){if(i&1&&(_i(0,"p",14),vw(1),Kc()),i&2){let t=VD(4);gI(),Ph(t.launchError());}}function st(i,r){if(i&1){let t=LD();_i(0,"p",12),vw(1),Kc(),_i(2,"app-workflow-input-form",13),gh("valuesChange",function(n){Pu(t);let s=VD(3);return Lu(s.setInputValues(n))}),Kc(),bD(3,rt,2,1,"p",14),_i(4,"div",15)(5,"button",16),gh("click",function(){Pu(t);let n=VD(3);return Lu(n.launch())}),vw(6),Rw(7,"transloco"),Kc(),_i(8,"button",17),gh("click",function(){Pu(t);let n=VD(3);return Lu(n.cancelLaunch())}),vw(9),Rw(10,"transloco"),Kc()();}if(i&2){let t=r,e=VD(3);gI(),Ph(t.name),gI(),ch("fields",t.inputSchema)("values",e.inputValues()),gI(),_D(e.launchError()?3:-1),gI(2),ch("nzLoading",e.launching())("disabled",e.launching()),gI(),nl(" ",Ow(7,8,e.launching()?"views.detail.launching":"views.detail.launch")," "),gI(3),nl(" ",Ow(10,10,"views.detail.cancelLaunch")," ");}}function ct(i,r){if(i&1&&(_i(0,"section",6)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),bD(4,lt,3,3,"p",11)(5,st,11,12),Kc()),i&2){let t,e=VD(2);gI(2),nl(" ",Ow(3,2,r==="view"?"views.detail.launchViewTitle":"views.detail.launchSelectedTitle")," "),gI(2),_D(e.canBulkLaunch()?(t=e.boundWorkflow())?5:-1:4,t);}}function dt(i,r){i&1&&(_i(0,"p",7),vw(1),Rw(2,"transloco"),Kc()),i&2&&(gI(),Ph(Ow(2,1,"views.detail.emptySubjects")));}function ut(i,r){if(i&1){let t=LD();_i(0,"app-runnable-items-table",18),gh("rowAction",function(n){Pu(t);let s=VD(2);return Lu(s.onRowAction(n))})("bulkAction",function(n){Pu(t);let s=VD(2);return Lu(s.onBulkAction(n))}),Kc();}if(i&2){let t=VD(2);ch("rows",t.rows())("selectable",true)("showRowAction",t.showRowAction());}}function pt(i,r){if(i&1){let t=LD();_i(0,"header",3)(1,"h1",4),vw(2),Kc(),_i(3,"button",5),gh("click",function(){Pu(t);let n=VD();return Lu(n.beginLaunch("view"))}),vw(4),Rw(5,"transloco"),Kc()(),bD(6,at,2,2),bD(7,ct,6,4,"section",6),bD(8,dt,3,3,"p",7)(9,ut,1,3,"app-runnable-items-table",8);}if(i&2){let t,e=VD();gI(2),Ph(r.name),gI(),ch("disabled",!e.canBulkLaunch()),gI(),nl(" ",Ow(5,6,"views.detail.runOnAll")," "),gI(2),_D(e.confirmation()?6:-1),gI(),_D((t=e.launchMode())?7:-1,t),gI(),_D(e.subjects().length===0?8:9);}}var zt=(()=>{class i{constructor(){this.route=C(C1),this.viewsApi=C(U),this.workflowsApi=C(b),this.batchesApi=C(U$1),this.jobsApi=C($),this.startJob=C(At),this.transloco=C(Ve),this.destroyRef=C(at$1),this.view=qo(null),this.subjects=qo([]),this.workflows=qo([]),this.latestBySubject=qo({}),this.loading=qo(true),this.loadError=qo(null),this.selectedIds=qo([]),this.launchMode=qo(null),this.inputValues=qo({}),this.launching=qo(false),this.launchError=qo(null),this.confirmation=qo(null),this.confirmationBatchId=qo(null),this.boundWorkflow=Hw(()=>{let t=this.view();return t?this.workflows().find(e=>e.id===t.workflowId)??null:null}),this.canBulkLaunch=Hw(()=>this.boundWorkflow()!=null),this.showRowAction=Hw(()=>this.boundWorkflow()?.subjectHandling==="per-subject"),this.rows=Hw(()=>{let t=this.latestBySubject();return this.subjects().map(e=>({id:e.id,primaryLabel:e.title,subtitle:this.subjectDetails(e),latestJob:t[e.id]??null}))}),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("views.detail.loadFailed"));return}this.load(e);});}subjectDetails(t){if(t.subjectType==="ticket")return [t.status,t.assignee].filter(Boolean).join(" \xB7 ");if(t.subjectType==="pull_request"){let e=`${t.sourceBranch} \u2192 ${t.targetBranch}`;return t.author?`${t.author} \xB7 ${e}`:e}return t.url??""}onBulkAction(t){this.selectedIds.set(t),this.beginLaunch("manual");}onRowAction(t){let e=this.view();e&&this.startJob.start({workflowId:e.workflowId,subjectId:t});}beginLaunch(t){t==="manual"&&this.selectedIds().length===0||(this.launchError.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),this.launchMode.set(t),this.inputValues.set(ae(this.boundWorkflow()?.inputSchema??[])));}cancelLaunch(){this.launchMode.set(null),this.launchError.set(null);}setInputValues(t){this.inputValues.set(t);}launch(){let t=this.view(),e=this.boundWorkflow(),n=this.launchMode();if(!t||!e||!n)return;let s=n==="view"?{mode:"view",viewId:t.id}:{mode:"manual",subjectType:t.subjectType,subjectIds:[...this.selectedIds()]};this.launching.set(true),this.launchError.set(null),this.batchesApi.launch({workflowId:e.id,selection:s,triggeredBy:n==="view"?"view_bulk":"multiselect",inputValues:r$1({},this.inputValues())}).pipe(ue(this.destroyRef)).subscribe({next:w=>{this.launching.set(false),this.confirmation.set(this.confirmationMessage(w)),this.confirmationBatchId.set(w.kind==="batch"?w.batch.id:null),this.launchMode.set(null),this.refreshLatest(t.workflowId,this.subjects().map(tt=>tt.id));},error:w=>{this.launching.set(false),this.launchError.set(this.errorMessage(w,this.transloco.translate("views.detail.launchFailed")));}});}confirmationMessage(t){return t.kind==="batch"?this.transloco.translate("views.detail.confirmation.batch",{id:t.batch.id,count:t.batch.jobIds.length}):this.transloco.translate("views.detail.confirmation.job",{id:t.job.id})}load(t){this.loading.set(true),this.loadError.set(null),this.selectedIds.set([]),this.launchMode.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),Ng({view:this.viewsApi.get(t),subjects:this.viewsApi.getSubjects(t),workflows:this.workflowsApi.list()}).pipe(ue(this.destroyRef)).subscribe({next:({view:e,subjects:n,workflows:s})=>{this.view.set(e),this.subjects.set(n),this.workflows.set(s),this.loading.set(false),this.refreshLatest(e.workflowId,n.map(w=>w.id));},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("views.detail.loadFailed")));}});}refreshLatest(t,e){(e.length===0?Dg({}):this.jobsApi.latestBySubject(t,e)).pipe(ue(this.destroyRef)).subscribe({next:s=>this.latestBySubject.set(s),error:()=>this.latestBySubject.set({})});}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=QE({type:i,selectors:[["app-view-detail"]],decls:4,vars:1,consts:[["data-testid","view-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["data-testid","view-name"],["nz-button","","nzType","primary","type","button","data-testid","run-on-all",3,"click","disabled"],["data-testid","launch-panel",1,"launch-panel"],["data-testid","empty-subjects",1,"muted"],[3,"rows","selectable","showRowAction"],["data-testid","launch-confirmation","nzType","success",3,"nzMessage"],["nz-button","","nzType","link","data-testid","open-batch",3,"routerLink"],["data-testid","no-bulk-workflows",1,"muted"],["data-testid","launch-workflow",1,"muted"],[3,"valuesChange","fields","values"],["data-testid","launch-error",1,"error"],[1,"launch-actions"],["nz-button","","nzType","primary","type","button","data-testid","launch-submit",3,"click","nzLoading","disabled"],["nz-button","","type","button","data-testid","launch-cancel",3,"click"],[3,"rowAction","bulkAction","rows","selectable","showRowAction"]],template:function(e,n){if(e&1&&(_i(0,"main",0),bD(1,it,3,3,"p",1)(2,nt,2,1,"p",2)(3,pt,10,8),Kc()),e&2){let s;gI(),_D(n.loading()?1:n.loadError()?2:(s=n.view())?3:-1,s);}},dependencies:[$8,v3,Gn,un,pf,bd,sp,fp,le,we,Kt],styles:[".detail-page[_ngcontent-%COMP%]{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:center}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:14rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.launch-panel[_ngcontent-%COMP%]{padding:1rem;border:1px solid #d6d3d1;background:#ffffffb3}.launch-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.launch-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;margin-top:.5rem}.muted[_ngcontent-%COMP%]{color:#78716c}.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 i})();export{zt as ViewDetailComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {_ as _n,C as Cn}from'./chunk-37yFTUcY.js';import {C,as as U,at as u,V as Ve,b as at,q as qo,u as ue,ac as Ng,c as bi,Q as QE,d as $8,v as v3,Z as pf,a0 as bd,a1 as sp,K as Kt,j as _i,k as vw,R as Rw,l as Kc,n as bD,w as gI,P as Ph,O as Ow,z as nl,B as _D,E as VD,N as ND,x as ch,D as xD,L as LD,m as gh,G as ah,J as Pu,M as Lu}from'./main-2ZW45HAE.js';import {b}from'./chunk-CM8oLO7n.js';import {W,I}from'./chunk-C4Ee3umI.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-yxqIQom4.js';import'./chunk-DphMF2VB.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(b),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 bi||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:[$8,v3,pf,bd,sp,_n,Cn,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt],styles:[".list-page[_ngcontent-%COMP%]{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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {C,ao as N2,ab as ix,ap as cx,i as ie}from'./main-2ZW45HAE.js';var f=(()=>{class r{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/local-repositories`;}list(){return this.http.get(this.baseUrl).pipe(cx())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}create(t){return this.http.post(this.baseUrl,t).pipe(cx())}update(t,i){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(t)}`,i).pipe(cx())}delete(t){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}static{this.\u0275fac=function(i){return new(i||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {T}from'./chunk-Cn95hfnf.js';import {a as ae,l as le}from'./chunk-DZhQ2iEt.js';import {H as He$1}from'./chunk-BuPc66MS.js';import {a as ai,z}from'./chunk-B_L2A3hm.js';import'./chunk-J9qS04nF.js';import {C,a as C1,T as J1,at as u,b as at,V as Ve,b1 as O,b2 as de,aw as Se,q as qo,H as Hw,u as ue$1,r as r$1,c as bi,Q as QE,d as $8,e as al,ax as er,f as rl,g as $i,v as v3,Z as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt,j as _i,k as vw,l as Kc,R as Rw,m as gh,n as bD,w as gI,P as Ph,O as Ow,x as ch,z as nl,B as _D,E as VD,L as LD,o as oE,N as ND,y as sE,D as xD,S as SD,p as lh,J as Pu,M as Lu}from'./main-2ZW45HAE.js';import {b}from'./chunk-CM8oLO7n.js';import {j as o_}from'./chunk-DMAf3Qir.js';import'./chunk-DphMF2VB.js';var me=(t,s)=>s.id;function ue(t,s){t&1&&(_i(0,"p",6),vw(1),Rw(2,"transloco"),Kc()),t&2&&(gI(),Ph(Ow(2,1,"common.loading")));}function he(t,s){if(t&1&&(_i(0,"p",7),vw(1),Kc()),t&2){let e=VD();gI(),Ph(e.loadError());}}function fe(t,s){if(t&1&&(_i(0,"li"),vw(1),Kc()),t&2){let e=s.$implicit;gI(),Ph(e);}}function ge(t,s){if(t&1&&(_i(0,"section",8)(1,"h2"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"ul"),ND(5,fe,2,1,"li",null,SD),Kc()()),t&2){let e=VD(2);gI(2),Ph(Ow(3,1,"shortcuts.editor.validation")),gI(3),xD(e.validationErrors());}}function _e(t,s){if(t&1&&lh(0,"nz-option",12),t&2){let e=s.$implicit;ch("nzValue",e.id)("nzLabel",e.name);}}function we(t,s){if(t&1){let e=LD();_i(0,"app-workflow-input-form",14),gh("valuesChange",function(i){Pu(e);let u=VD(2);return Lu(u.setInputValues(i))}),Kc();}if(t&2){let e=VD(2);ch("fields",s.inputSchema)("values",e.inputValues());}}function ve(t,s){if(t&1){let e=LD();bD(0,ge,7,3,"section",8),_i(1,"label",9)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"input",10),gh("ngModelChange",function(i){Pu(e);let u=VD();return Lu(u.name.set(i))}),Kc(),oE(),Kc(),_i(6,"div",9)(7,"span"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"nz-select",11),gh("ngModelChange",function(i){Pu(e);let u=VD();return Lu(u.onWorkflowChange(i))}),ND(11,_e,1,2,"nz-option",12,me),Kc(),oE(),Kc(),bD(13,we,1,2,"app-workflow-input-form",13);}if(t&2){let e,o=VD();_D(o.validationErrors().length>0?0:-1),gI(3),Ph(Ow(4,6,"shortcuts.editor.name")),gI(2),ch("ngModel",o.name()),sE(),gI(3),Ph(Ow(9,8,"shortcuts.editor.workflow")),gI(2),ch("ngModel",o.workflowId()),sE(),gI(),xD(o.eligibleWorkflows()),gI(2),_D((e=o.selectedWorkflow())?13:-1,e);}}function Ce(t){let s=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),e=crypto.randomUUID().slice(0,8);return s.length>0?`sc-${s}-${e}`:`sc-${e}`}var He=(()=>{class t{constructor(){this.route=C(C1),this.router=C(J1),this.shortcutsApi=C(u),this.workflowsApi=C(b),this.message=C(He$1),this.destroyRef=C(at),this.transloco=C(Ve),this.language=C(O),this.routeId=de(this.route.paramMap.pipe(Se(e=>e.get("id"))),{initialValue:this.route.snapshot.paramMap.get("id")}),this.name=qo(""),this.workflowId=qo(""),this.workflows=qo([]),this.inputValues=qo({}),this.lastJobId=qo(void 0),this.loadError=qo(null),this.validationErrors=qo([]),this.saving=qo(false),this.loading=qo(true),this.isNew=Hw(()=>!this.routeId()),this.pageTitle=Hw(()=>(this.language.currentLang(),this.isNew()?this.transloco.translate("shortcuts.editor.titleNew"):this.transloco.translate("shortcuts.editor.titleEdit",{name:this.name().trim()}))),this.eligibleWorkflows=Hw(()=>this.workflows().filter(e=>e.appliesTo==="none"&&e.subjectHandling==="per-subject")),this.selectedWorkflow=Hw(()=>this.eligibleWorkflows().find(e=>e.id===this.workflowId())??null),this.workflowsApi.list().pipe(ue$1(this.destroyRef)).subscribe({next:e=>this.workflows.set(e),error:e=>{this.workflows.set([]),this.message.error(this.errorMessage(e,this.transloco.translate("shortcuts.editor.loadFailed")));}}),this.route.paramMap.pipe(ue$1(this.destroyRef)).subscribe(e=>{let o=e.get("id");if(this.validationErrors.set([]),this.loadError.set(null),!o){this.name.set(""),this.workflowId.set(""),this.inputValues.set({}),this.lastJobId.set(void 0),this.loading.set(false);return}this.loading.set(true),this.shortcutsApi.get(o).subscribe({next:i=>{this.name.set(i.name),this.workflowId.set(i.workflowId),this.inputValues.set(i.inputValues),this.lastJobId.set(i.lastJobId),this.loading.set(false);},error:i=>{this.loading.set(false),this.loadError.set(this.errorMessage(i,this.transloco.translate("shortcuts.editor.loadFailed")));}});});}onWorkflowChange(e){this.workflowId.set(e);let o=this.eligibleWorkflows().find(i=>i.id===e);this.inputValues.set(ae(o?.inputSchema??[]));}setInputValues(e){this.inputValues.set(e);}save(){let e=this.routeId(),o=r$1({id:e??Ce(this.name()),name:this.name().trim(),workflowId:this.workflowId(),inputValues:this.inputValues()},this.lastJobId()?{lastJobId:this.lastJobId()}:{}),i=o_.safeParse(o);if(!i.success){this.validationErrors.set(T(i.error));return}this.validationErrors.set([]),this.saving.set(true),(this.isNew()||!e?this.shortcutsApi.create(i.data):this.shortcutsApi.update(e,i.data)).subscribe({next:M=>{this.saving.set(false),this.message.success(this.transloco.translate(this.isNew()?"shortcuts.editor.created":"shortcuts.editor.saved")),this.isNew()&&this.router.navigate(["/shortcuts",M.id,"edit"]);},error:M=>{this.saving.set(false),this.message.error(this.errorMessage(M,this.transloco.translate("shortcuts.editor.saveFailed")));}});}errorMessage(e,o){return e instanceof bi||e instanceof Error?e.message:o}static{this.\u0275fac=function(o){return new(o||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-shortcut-editor"]],decls:15,vars:10,consts:[["data-testid","shortcut-editor",1,"editor"],[1,"header"],["data-testid","page-title"],[1,"header-actions"],["routerLink","/shortcuts"],["nz-button","","nzType","primary","type","button","data-testid","save-button",3,"click","nzLoading","disabled"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","validation-errors",1,"errors"],[1,"field"],["nz-input","","data-testid","shortcut-name",3,"ngModelChange","ngModel"],["data-testid","shortcut-workflow",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[3,"fields","values"],[3,"valuesChange","fields","values"]],template:function(o,i){o&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1",2),vw(4),Kc()(),_i(5,"div",3)(6,"a",4),vw(7),Rw(8,"transloco"),Kc(),_i(9,"button",5),gh("click",function(){return i.save()}),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,ue,3,3,"p",6)(13,he,2,1,"p",7)(14,ve,14,10),Kc()),o&2&&(gI(4),Ph(i.pageTitle()),gI(3),Ph(Ow(8,6,"shortcuts.editor.backToList")),gI(2),ch("nzLoading",i.saving())("disabled",i.loading()||!!i.loadError()),gI(),nl(" ",Ow(11,8,"common.save")," "),gI(2),_D(i.loading()?12:i.loadError()?13:14));},dependencies:[$8,al,er,rl,$i,v3,pf,bd,sp,fp,ai,z,ex,Fm,Am,le,Kt],styles:[".editor[_ngcontent-%COMP%]{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;gap:.75rem;align-items:center}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return t})();export{He as ShortcutEditorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {C,ao as N2,ab as ix,bP as u,ap as cx,i as ie}from'./main-2ZW45HAE.js';var U=(()=>{class r{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/batches`;}list(t){return this.http.get(this.baseUrl,{params:u(t)}).pipe(cx())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}jobs(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/jobs`).pipe(cx())}launch(t){return this.http.post(this.baseUrl,t).pipe(cx())}cancel(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/cancel`,{}).pipe(cx())}static{this.\u0275fac=function(a){return new(a||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{U};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import {T}from'./chunk-Cn95hfnf.js';import {$ as $$1,B}from'./chunk-DFoFQkTa.js';import {H as He$1}from'./chunk-BuPc66MS.js';import {a as ai,z}from'./chunk-B_L2A3hm.js';import {C,a as C1,T as J1,as as U,au as $,b as at,V as Ve$1,b1 as O$1,b2 as de,aw as Se$1,q as qo,H as Hw,u as ue,s,r as r$1,c as bi,Q as QE,d as $8,e as al,ax as er,f as rl,g as $i,v as v3,Z as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt,j as _i,k as vw,l as Kc,R as Rw,m as gh,n as bD,w as gI,P as Ph,O as Ow,x as ch,z as nl,B as _D,E as VD,L as LD,o as oE,N as ND,y as sE,D as xD,S as SD,p as lh,J as Pu$1,M as Lu,a8 as Mh,G as ah,aa as Nw}from'./main-2ZW45HAE.js';import {b}from'./chunk-CM8oLO7n.js';import {d as Pu,$ as $_,f as __,M as M$}from'./chunk-DMAf3Qir.js';import'./chunk-DphMF2VB.js';var be=()=>[],O=(t,a)=>a.id,Me=(t,a)=>a.name;function Ie(t,a){t&1&&(_i(0,"p",6),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",7),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",8)(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",12),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.name);}}function Pe(t,a){t&1&&(_i(0,"p",14),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",17),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",12),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",16),bD(1,Se,3,3,"p",17),_i(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"nz-select",18),Rw(6,"transloco"),gh("ngModelChange",function(n){Pu$1(e);let s=VD(3);return Lu(s.onInstanceChange(n))}),ND(7,Ne,1,2,"nz-option",12,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",14)(1,qe,9,10,"div",15),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",13)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"div",19)(5,"button",20),gh("click",function(){Pu$1(e);let n=VD(2);return Lu(n.setQueryMode("template"))}),vw(6),Rw(7,"transloco"),Kc(),_i(8,"button",21),gh("click",function(){Pu$1(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",12),t&2){let e=a.$implicit;ch("nzValue",e.id)("nzLabel",e.label);}}function je(t,a){t&1&&(_i(0,"span",23),vw(1,"*"),Kc());}function Oe(t,a){if(t&1&&lh(0,"nz-option",12),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",26),gh("ngModelChange",function(n){Pu$1(e);let s=VD().$implicit,g=VD(4);return Lu(g.setTemplateParam(s.name,n))}),ND(1,Oe,1,2,"nz-option",12,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",27),gh("ngModelChange",function(n){Pu$1(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",9)(1,"span"),vw(2),bD(3,je,2,0,"span",23),Kc(),bD(4,Be,3,3,"nz-select",24)(5,$e,1,2,"input",25),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",9,Me),t&2&&xD(a.params);}function Re(t,a){if(t&1){let e=LD();_i(0,"div",9)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"nz-select",22),gh("ngModelChange",function(n){Pu$1(e);let s=VD(2);return Lu(s.selectTemplate(n))}),ND(5,Fe,1,2,"nz-option",12,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",9)(1,"span"),vw(2),Rw(3,"transloco"),Kc(),_i(4,"textarea",28),gh("ngModelChange",function(n){Pu$1(e);let s=VD(2);return Lu(s.queryText.set(n))}),Kc(),oE(),_i(5,"span",29),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",8),_i(1,"label",9)(2,"span"),vw(3),Rw(4,"transloco"),Kc(),_i(5,"input",10),gh("ngModelChange",function(n){Pu$1(e);let s=VD();return Lu(s.name.set(n))}),Kc(),oE(),Kc(),_i(6,"div",9)(7,"span"),vw(8),Rw(9,"transloco"),Kc(),_i(10,"nz-select",11),gh("ngModelChange",function(n){Pu$1(e);let s=VD();return Lu(s.onWorkflowChange(n))}),ND(11,ke,1,2,"nz-option",12,O),Kc(),oE(),Kc(),bD(13,De,2,1),bD(14,Ae,11,11,"div",13),bD(15,Re,8,5)(16,Je,8,7,"label",9);}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(C1),this.router=C(J1),this.viewsApi=C(U),this.workflowsApi=C(b),this.settingsApi=C($),this.providersApi=C($$1),this.message=C(He$1),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
|
+
|
|
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(()=>Pu(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",{name:this.name().trim()}))),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($_),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
|
+
|
|
5
|
+
}`),this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),this.loading.set(false),this.refreshTemplates();return}this.loading.set(true),this.viewsApi.get(i).subscribe({next:n=>{this.name.set(n.name),this.workflowId.set(n.workflowId),this.providerInstanceId.set(He(n.providerInstanceId)),this.subjectType.set(n.subjectType),this.queryText.set(JSON.stringify(n.query,null,2)),this.pendingProvenance=n.queryTemplate,this.queryMode.set(n.queryTemplate?"template":"raw"),this.loading.set(false),this.refreshTemplates();},error:n=>{this.loading.set(false),this.loadError.set(this.errorMessage(n,this.transloco.translate("views.editor.loadFailed")));}});});}subjectTypeKey(e){return `workflow-editor.subjectType.${e}`}onWorkflowChange(e){this.workflowId.set(e);let i=Pu(this.bindableWorkflows().find(s=>s.id===e)?.appliesTo??"none");this.pendingProvenance=void 0,this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({});let n=B(this.settings(),i);if(n.length===1)this.applyInstance(n[0]);else {let s=this.providerInstanceId(),g=n.find(S=>S.id===s);g?this.applyInstance(g):(this.providerInstanceId.set(null),this.subjectType.set(null));}this.refreshTemplates();}onInstanceChange(e){let i=this.eligibleInstances().find(n=>n.id===e);this.pendingProvenance=void 0,this.queryMode.set("template"),this.selectedTemplateId.set(null),this.templateParams.set({}),i&&this.applyInstance(i),this.refreshTemplates();}applyInstance(e){this.providerInstanceId.set(e.id),__(e)&&this.subjectType.set(e.subjectType);}setQueryMode(e){this.queryMode.set(e),e==="template"&&!this.selectedTemplateId()&&this.templates()[0]&&this.selectTemplate(this.templates()[0].id);}selectTemplate(e){let i=this.templates().find(n=>n.id===e);this.selectedTemplateId.set(e),this.templateParams.set(i?Te(i):{});}templateParamValue(e){let i=this.templateParams()[e];return i==null?"":String(i)}setTemplateParam(e,i){this.templateParams.set(s(r$1({},this.templateParams()),{[e]:i}));}save(){if(!this.selectedInstance()){this.validationErrors.set([this.transloco.translate("views.editor.pickInstance")]);return}if(this.queryMode()==="template"&&this.hasTemplates()){this.saveFromTemplate();return}this.saveFromRawJson();}saveFromTemplate(){let e=this.selectedTemplate(),i=this.providerInstanceId();if(!e||!i){this.validationErrors.set([this.transloco.translate("views.editor.pickTemplate")]);return}let n=e.params.filter(s=>{if(!s.required)return false;let g=this.templateParams()[s.name];return g==null||String(g).trim()===""});if(n.length>0){this.validationErrors.set(n.map(s=>this.transloco.translate("views.editor.missingParam",{label:s.label})));return}this.validationErrors.set([]),this.saving.set(true),this.providersApi.resolveQueryTemplate(i,e.id,this.templateParams()).subscribe({next:s=>{this.persist({query:s.query,queryTemplate:{templateId:e.id,params:this.templateParams()}});},error:s=>{this.saving.set(false),this.message.error(this.errorMessage(s,this.transloco.translate("views.editor.resolveFailed")));}});}saveFromRawJson(){let e;try{e=JSON.parse(this.queryText());}catch(i){this.validationErrors.set([this.transloco.translate("views.editor.invalidJson")]);return}if(e===null||typeof e!="object"||Array.isArray(e)){this.validationErrors.set([this.transloco.translate("views.editor.invalidJson")]);return}this.persist({query:e});}persist(e){let i=this.routeId(),n=this.subjectType(),s=r$1({id:i??Ue(this.name()),name:this.name().trim(),subjectType:n??"",providerInstanceId:this.providerInstanceId()??"",workflowId:this.workflowId(),query:e.query},e.queryTemplate?{queryTemplate:e.queryTemplate}:{}),g=M$.safeParse(s);if(!g.success){this.saving.set(false),this.validationErrors.set(T(g.error));return}this.validationErrors.set([]),this.saving.set(true);let S=g.data;(this.isNew()||!i?this.viewsApi.create(S):this.viewsApi.update(i,S)).subscribe({next:q=>{this.saving.set(false),this.message.success(this.transloco.translate(this.isNew()?"views.editor.created":"views.editor.saved")),this.isNew()&&this.router.navigate(["/views",q.id,"edit"]);},error:q=>{this.saving.set(false),this.message.error(this.errorMessage(q,this.transloco.translate("views.editor.saveFailed")));}});}refreshTemplates(){let e=this.providerInstanceId();if(!e){this.templates.set([]),this.applyLoadedTemplates([]);return}this.providersApi.listQueryTemplates(e).subscribe({next:i=>{this.templates.set(i),this.applyLoadedTemplates(i);},error:()=>{this.templates.set([]),this.applyLoadedTemplates([]);}});}applyLoadedTemplates(e){let i=this.pendingProvenance;if(i){let n=e.find(s=>s.id===i.templateId);n?(this.queryMode.set("template"),this.selectedTemplateId.set(n.id),this.templateParams.set(r$1(r$1({},Te(n)),i.params))):(this.queryMode.set("raw"),this.selectedTemplateId.set(null)),this.pendingProvenance=void 0;return}if(this.queryMode()!=="raw"){if(e.length===0){this.queryMode.set("raw"),this.selectedTemplateId.set(null),this.templateParams.set({});return}e.some(n=>n.id===this.selectedTemplateId())||this.selectTemplate(e[0].id);}}errorMessage(e,i){return e instanceof bi||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=QE({type:t,selectors:[["app-view-editor"]],decls:15,vars:10,consts:[["data-testid","view-editor",1,"editor"],[1,"header"],["data-testid","page-title"],[1,"header-actions"],["routerLink","/views"],["nz-button","","nzType","primary","type","button","data-testid","save-button",3,"click","nzLoading","disabled"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","validation-errors",1,"errors"],[1,"field"],["nz-input","","data-testid","view-name",3,"ngModelChange","ngModel"],["data-testid","view-workflow",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["data-testid","query-mode-toggle",1,"field"],["data-testid","view-instance-empty",1,"error"],["data-testid","view-instance-field",1,"field",3,"field-attention"],["data-testid","view-instance-field",1,"field"],["data-testid","view-instance-needed",1,"attention"],["data-testid","view-instance",3,"ngModelChange","nzPlaceHolder","ngModel"],[1,"mode-toggle"],["nz-button","","type","button","data-testid","query-mode-template",3,"click","nzType"],["nz-button","","type","button","data-testid","query-mode-raw",3,"click","nzType"],["data-testid","view-template",3,"ngModelChange","ngModel"],[1,"required"],[3,"ngModel"],["nz-input","",3,"ngModel"],[3,"ngModelChange","ngModel"],["nz-input","",3,"ngModelChange","ngModel"],["nz-input","","rows","8","data-testid","view-query",3,"ngModelChange","ngModel"],[1,"hint"]],template:function(i,n){i&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1",2),vw(4),Kc()(),_i(5,"div",3)(6,"a",4),vw(7),Rw(8,"transloco"),Kc(),_i(9,"button",5),gh("click",function(){return n.save()}),vw(10),Rw(11,"transloco"),Kc()()(),bD(12,Ie,3,3,"p",6)(13,Ee,2,1,"p",7)(14,Qe,17,12),Kc()),i&2&&(gI(4),Ph(n.pageTitle()),gI(3),Ph(Ow(8,6,"views.editor.backToList")),gI(2),ch("nzLoading",n.saving())("disabled",n.loading()||!!n.loadError()),gI(),nl(" ",Ow(11,8,"common.save")," "),gI(2),_D(n.loading()?12:n.loadError()?13:14));},dependencies:[$8,al,er,rl,$i,v3,pf,bd,sp,fp,ai,z,ex,Fm,Am,Kt],styles:[".editor[_ngcontent-%COMP%]{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;gap:.75rem;align-items:center}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{font-size:.8rem;color:#78716c}.field-attention[_ngcontent-%COMP%]{border:1px solid #f59e0b;background:#fffbeb;padding:.75rem 1rem;border-radius:.35rem}.attention[_ngcontent-%COMP%]{margin:0;color:#b45309;font-size:.85rem}.mode-toggle[_ngcontent-%COMP%]{display:flex;gap:.5rem}.required[_ngcontent-%COMP%]{color:#9f1239}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}textarea[_ngcontent-%COMP%]{font-family:ui-monospace,Consolas,monospace}"]});}}return t})();export{bt as ViewEditorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {aA as YE,aB as uu,aC as pT,C,aG as z0,bQ as Gm,aJ as Oe,aI as hT,bK as Le$1,bA as zt,Q as QE,a3 as Th,a4 as xh,aN as st,aO as Ee,bR as Mn,aP as ly,aQ as Z0,n as bD,B as _D,aX as Yl,L as LD,j as _i,bS as ec,l as Kc,E as VD,a8 as Mh,x as ch,w as gI,aY as nh,m as gh,p as lh,aZ as el,k as vw,a_ as tl,P as Ph,J as Pu,M as Lu,bT as fh}from'./main-2ZW45HAE.js';function X(n,i){n&1&&fh(0);}function $(n,i){if(n&1&&nh(0,X,1,0,"ng-container",7),n&2){let e=VD(3);ch("nzStringTemplateOutlet",e.nzIcon);}}function nn(n,i){if(n&1&&lh(0,"nz-icon",6),n&2){let e=VD(3);ch("nzType",e.nzIconType||e.inferredIconType)("nzTheme",e.iconTheme);}}function en(n,i){if(n&1&&(_i(0,"div",2),bD(1,$,1,1,"ng-container")(2,nn,1,2,"nz-icon",6),Kc()),n&2){let e=VD(2);gI(),_D(e.nzIcon?1:2);}}function tn(n,i){if(n&1&&(el(0),vw(1),tl()),n&2){let e=VD(4);gI(),Ph(e.nzMessage);}}function on(n,i){if(n&1&&(_i(0,"span",8),nh(1,tn,2,1,"ng-container",7),Kc()),n&2){let e=VD(3);gI(),ch("nzStringTemplateOutlet",e.nzMessage);}}function an(n,i){if(n&1&&(el(0),vw(1),tl()),n&2){let e=VD(4);gI(),Ph(e.nzDescription);}}function rn(n,i){if(n&1&&(_i(0,"span",9),nh(1,an,2,1,"ng-container",7),Kc()),n&2){let e=VD(3);gI(),ch("nzStringTemplateOutlet",e.nzDescription);}}function ln(n,i){if(n&1&&(_i(0,"div",3),bD(1,on,2,1,"span",8),bD(2,rn,2,1,"span",9),Kc()),n&2){let e=VD(2);gI(),_D(e.nzMessage?1:-1),gI(),_D(e.nzDescription?2:-1);}}function cn(n,i){if(n&1&&(el(0),vw(1),tl()),n&2){let e=VD(3);gI(),Ph(e.nzAction);}}function sn(n,i){if(n&1&&(_i(0,"div",4),nh(1,cn,2,1,"ng-container",7),Kc()),n&2){let e=VD(2);gI(),ch("nzStringTemplateOutlet",e.nzAction);}}function dn(n,i){if(n&1&&(el(0),_i(1,"span",12),vw(2),Kc(),tl()),n&2){let e=VD(4);gI(2),Ph(e.nzCloseText);}}function mn(n,i){if(n&1&&nh(0,dn,3,1,"ng-container",7),n&2){let e=VD(3);ch("nzStringTemplateOutlet",e.nzCloseText);}}function pn(n,i){n&1&&lh(0,"nz-icon",11);}function _n(n,i){if(n&1){let e=LD();_i(0,"button",10),gh("click",function(){Pu(e);let z=VD(2);return Lu(z.closeAlert())}),bD(1,mn,1,1,"ng-container")(2,pn,1,0,"nz-icon",11),Kc();}if(n&2){let e=VD(2);gI(),_D(e.nzCloseText?1:2);}}function zn(n,i){if(n&1){let e=LD();_i(0,"div",1),ec(function(z){Pu(e);let T=VD();return Lu(T.onLeaveAnimationDone(z))}),bD(1,en,3,1,"div",2),bD(2,ln,3,2,"div",3),bD(3,sn,2,1,"div",4),bD(4,_n,3,1,"button",5),Kc();}if(n&2){let e=VD();Mh("ant-alert-rtl",e.dir()==="rtl")("ant-alert-success",e.nzType==="success")("ant-alert-info",e.nzType==="info")("ant-alert-warning",e.nzType==="warning")("ant-alert-error",e.nzType==="error")("ant-alert-no-icon",!e.nzShowIcon)("ant-alert-banner",e.nzBanner)("ant-alert-closable",e.nzCloseable)("ant-alert-with-description",!!e.nzDescription),ch("nzNoAnimation",e.nzNoAnimation),gI(),_D(e.nzShowIcon?1:-1),gI(),_D(e.nzMessage||e.nzDescription?2:-1),gI(),_D(e.nzAction?3:-1),gI(),_D(e.nzCloseable||e.nzCloseText?4:-1);}}var Z="alert",un=(()=>{let n,i=[],e=[],_,z=[],T=[];return class D{static{let r=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[Yl()],_=[Yl()],pT(null,null,n,{kind:"field",name:"nzCloseable",static:false,private:false,access:{has:t=>"nzCloseable"in t,get:t=>t.nzCloseable,set:(t,l)=>{t.nzCloseable=l;}},metadata:r},i,e),pT(null,null,_,{kind:"field",name:"nzShowIcon",static:false,private:false,access:{has:t=>"nzShowIcon"in t,get:t=>t.nzShowIcon,set:(t,l)=>{t.nzShowIcon=l;}},metadata:r},z,T),r&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:r});}cdr=C(z0);animationType=C(Gm,{optional:true});dir=C(Oe).valueSignal;_nzModuleName=Z;nzAction=null;nzCloseText=null;nzIconType=null;nzMessage=null;nzDescription=null;nzType="info";nzCloseable=hT(this,i,false);nzShowIcon=(hT(this,e),hT(this,z,false));nzBanner=(hT(this,T),false);nzNoAnimation=false;nzIcon=null;nzOnClose=new Le$1;closed=false;iconTheme="fill";inferredIconType="info-circle";isTypeSet=false;isShowIconSet=false;constructor(){zt(Z,()=>this.cdr.markForCheck());}closeAlert(){this.closed=true,(this.nzNoAnimation||this.animationType==="NoopAnimations")&&this.nzOnClose.emit(true);}onLeaveAnimationDone(r){let t=r.target;if(this.nzNoAnimation||this.animationType==="NoopAnimations"){r.animationComplete();return}t.classList.add("ant-alert-motion-leave","ant-alert-motion-leave-active");let l=()=>{t.removeEventListener("transitionend",l),this.nzOnClose.emit(true),r.animationComplete();};t.addEventListener("transitionend",l);}ngOnChanges(r){let{nzShowIcon:t,nzDescription:l,nzType:J,nzBanner:K}=r;if(t&&(this.isShowIconSet=true),J)switch(this.isTypeSet=true,this.nzType){case "error":this.inferredIconType="close-circle";break;case "success":this.inferredIconType="check-circle";break;case "info":this.inferredIconType="info-circle";break;case "warning":this.inferredIconType="exclamation-circle";break}l&&(this.iconTheme=this.nzDescription?"outline":"fill"),K&&(this.isTypeSet||(this.nzType="warning"),this.isShowIconSet||(this.nzShowIcon=true));}static \u0275fac=function(t){return new(t||D)};static \u0275cmp=QE({type:D,selectors:[["nz-alert"]],inputs:{nzAction:"nzAction",nzCloseText:"nzCloseText",nzIconType:"nzIconType",nzMessage:"nzMessage",nzDescription:"nzDescription",nzType:"nzType",nzCloseable:[2,"nzCloseable","nzCloseable",Z0],nzShowIcon:[2,"nzShowIcon","nzShowIcon",Z0],nzBanner:[2,"nzBanner","nzBanner",Z0],nzNoAnimation:[2,"nzNoAnimation","nzNoAnimation",Z0],nzIcon:"nzIcon"},outputs:{nzOnClose:"nzOnClose"},exportAs:["nzAlert"],features:[ly],decls:1,vars:1,consts:[[1,"ant-alert",3,"nzNoAnimation","ant-alert-rtl","ant-alert-success","ant-alert-info","ant-alert-warning","ant-alert-error","ant-alert-no-icon","ant-alert-banner","ant-alert-closable","ant-alert-with-description"],[1,"ant-alert",3,"nzNoAnimation"],[1,"ant-alert-icon"],[1,"ant-alert-content"],[1,"ant-alert-action"],["type","button","tabindex","0",1,"ant-alert-close-icon"],[3,"nzType","nzTheme"],[4,"nzStringTemplateOutlet"],[1,"ant-alert-message"],[1,"ant-alert-description"],["type","button","tabindex","0",1,"ant-alert-close-icon",3,"click"],["nzType","close"],[1,"ant-alert-close-text"]],template:function(t,l){t&1&&bD(0,zn,5,23,"div",0),t&2&&_D(l.closed?-1:0);},dependencies:[Th,xh,st,Ee,Mn],encapsulation:2})}})(),Gn=(()=>{class n{static \u0275fac=function(_){return new(_||n)};static \u0275mod=YE({type:n});static \u0275inj=uu({imports:[un]})}return n})();export{Gn as G,un as u};
|