PageSourceSearch

https://extremegroup.ai/assets/EsmWorkflowPanel-Kl_SLPxJ.js

js extremegroup.ai collected 2026-10-05 14:58:47 UTC 5,565 bytes, 1 lines download raw bytes

1import{j as e}from"./editor-D81ingK4.js";import{r as b}from"./charts-D2ZB5Iwm.js";import{u as y,c as j,d as _,f as V,$ as C,T as E,t as T,g as P,b as S,dF as $,a8 as q,a as B,aP as L,fM as M,a1 as A,lQ as F,aR as W,aO as R}from"./index-Dz6bAh96.js";import{B as n}from"./badge-XG2PEcZP.js";import{e as D,f as H,g as z}from"./useEsmWorkflow-DBQPlpgz.js";function G({status:c}){switch(c){case"done":return e.jsx(R,{className:"h-4 w-4 text-emerald-500"});case"failed":return e.jsx(W,{className:"h-4 w-4 text-destructive"});case"skipped":return e.jsx(F,{className:"h-4 w-4 text-muted-foreground"});default:return e.jsx(A,{className:"h-4 w-4 text-primary animate-spin"})}}function J({ticketId:c,workflowStatus:m,canComment:N}){const{t:a}=y(),{data:l,isLoading:x}=D(c),{data:u}=H(c),h=z(),[d,p]=b.useState("");if(!x&&(!l||l.length===0)&&(!m||m==="none"))return null;const i=(l==null?void 0:l.length)??0,f=(l||[]).filter(s=>s.status==="done"||s.status==="skipped").length,g=m==="halted",o=new Map;(l||[]).forEach(s=>{const r=o.get(s.step_order)||[];r.push(s),o.set(s.step_order,r)});const w=Array.from(o.keys()).sort((s,r)=>s-r),v=()=>{d.trim()&&h.mutate({parentId:c,content:d.trim()},{onSuccess:()=>p("")})};return e.jsxs("div",{className:j(_,"p-6 relative"),children:[e.jsx(V,{}),e.jsxs("div",{className:"relative space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{className:"h-4 w-4 text-primary"}),e.jsx("h3",{className:"text-base font-semibold",children:a("esm.workflow.panelTitle",{defaultValue:"Fluxo de etapas"})}),e.jsx(n,{variant:"outline",className:"text-[10px] uppercase tracking-wide border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400",children:a("esm.common.beta",{defaultValue:"Beta"})}),i>0&&e.jsx(n,{variant:"secondary",className:"ml-auto text-xs",children:a("esm.workflow.progress",{defaultValue:"{{done}} de {{total}} concluídas",done:f,total:i})})]}),i>0&&e.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary transition-all duration-300",style:{width:`${Math.round(f/i*100)}%`}})}),g&&e.jsxs("div",{className:"flex items-start gap-2 rounded-lg p-3 bg-destructive/10 border border-destructive/20",children:[e.jsx(E,{className:"h-4 w-4 text-destructive mt-0.5 shrink-0"}),e.jsx("p",{className:"text-sm text-destructive",children:a("esm.workflow.haltedBanner",{defaultValue:"Fluxo interrompido: uma etapa foi cancelada/rejeitada. Requer atenção."})})]}),x?e.jsx(T,{className:"h-24 w-full"}):e.jsx("div",{className:"space-y-3",children:w.map(s=>{const r=o.get(s),k=r.length>1;return e.jsxs("div",{className:j(P,"p-3"),children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(n,{variant:"outline",className:"text-xs",children:a("esm.workflow.stepN",{defaultValue:"Etapa {{n}}",n:s})}),k&&e.jsx("span",{className:"text-[11px] text-muted-foreground",children:a("esm.workflow.parallel",{defaultValue:"Paralelo"})})]}),e.jsx("div",{className:"space-y-1.5",children:r.map(t=>e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(G,{status:t.status}),e.jsx("span",{className:"text-sm font-medium truncate",children:t.step_name}),t.child_ticket_number?e.jsx(S,{to:`/tickets/${t.child_ticket_id}`,className:"text-xs text-primary hover:underline shrink-0",children:t.child_ticket_number}):e.jsx(n,{variant:"outline",className:"text-[10px]",children:a("esm.workflow.skipped",{defaultValue:"ignorada"})}),t.child_status&&e.jsx(n,{variant:"secondary",className:"ml-auto text-[10px]",children:a(`esm.tickets.status.${t.child_status}`,{defaultValue:t.child_status})})]}),t.child_requester_name&&e.jsxs("p",{className:"text-[11px] text-muted-foreground pl-6 truncate",children:[a("esm.workflow.requester",{defaultValue:"Solicitante"}),": ",t.child_requester_name]})]},t.id))})]},s)})}),N&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-xs font-medium text-muted-foreground flex items-center gap-1",children:[e.jsx($,{className:"h-3 w-3"}),a("esm.workflow.commentLabel",{defaultValue:"Comentar (envia também ao subt
1icket ativo)"})]}),e.jsx(q,{value:d,onChange:s=>p(s.target.value),rows:2,placeholder:a("esm.workflow.commentPlaceholder",{defaultValue:"Escreva um comentário..."})}),e.jsxs(B,{size:"sm",onClick:v,disabled:!d.trim()||h.isPending,children:[e.jsx(L,{className:"h-4 w-4 mr-1"}),a("esm.workflow.send",{defaultValue:"Enviar"})]})]}),u&&u.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:a("esm.workflow.activityTitle",{defaultValue:"Atividade do fluxo"})}),e.jsx("div",{className:"space-y-2 max-h-80 overflow-y-auto pr-1",children:u.map(s=>e.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[e.jsx(M,{className:"h-3.5 w-3.5 text-muted-foreground mt-1 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[!s.is_parent&&e.jsx(n,{variant:"outline",className:"text-[10px]",children:s.source_ticket_number}),e.jsx("span",{className:"text-xs text-muted-foreground",children:s.author_name||"—"}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:new Date(s.created_at).toLocaleString()})]}),e.jsx("p",{className:"text-sm break-words",children:s.kind==="note"?s.content:a(`esm.history.action.${s.action}`,{defaultValue:s.action||""})})]})]},`${s.kind}-${s.id}`))})]})]})]})}export{J as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.