PageSourceSearch

https://cbtkd.org.br/assets/AcompanhamentoTarefasPage-dab9f806.js

js cbtkd.org.br collected 2026-10-10 00:49:01 UTC 14,765 bytes, 2 lines download raw bytes

1import{j as e,C as A,S as ee,A as O,B as E,R as I,a as w,I as _,F as $,c as W,d as te}from"./vendor-ui-bootstrap-613dad89.js";import{u as se,r as p}from"./vendor-react-4c7f50f2.js";import{u as ae}from"./main-722823a7.js";import{R as U,B as V,X as J,Y as K,T as H,a as q,C as X}from"./vendor-charts-6c028842.js";import"./vendor-ui-material-b69ee68f.js";import"./vendor-firebase-7ea6fd91.js";import"./vendor-utils-de6b936e.js";const G={Publicado:{bg:"success",label:"Publicado"},"Em fase de testes":{bg:"warning",label:"Em fase de testes"},"Em desenvolvimento":{bg:"info",label:"Em desenvolvimento"},"Aguardando revisão":{bg:"secondary",label:"Aguardando revisão"},Planejado:{bg:"light",label:"Planejado"}},ie=["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"];function Y(t){const n=Object.keys(t??{}).sort();if(n.length===0)return[];const[o,m]=n[0].split("-").map(Number),[s,c]=n[n.length-1].split("-").map(Number),r=[];let l=o,h=m;for(;l<s||l===s&&h<=c;){const x=`${l}-${String(h).padStart(2,"0")}`;r.push({mes:`${ie[h-1]}/${String(l).slice(2)}`,commits:t[x]??0,chave:x}),h++,h>12&&(h=1,l++)}return r}function le({commitsPorMes:t,dataPrimeiroCommit:n,dataUltimoCommit:o,cor:m}){const s=Y(t);if(s.length===0)return null;const c=Math.max(...s.map(l=>l.commits)),r=m||"#1a3a5c";return e.jsxs("div",{className:"mt-3",children:[e.jsxs("div",{className:"d-flex justify-content-between align-items-baseline mb-1",children:[e.jsx("small",{className:"text-muted fw-semibold",children:"Atividade por mês"}),n&&o&&e.jsx("small",{className:"text-muted",children:n===o?n:`${n} → ${o}`})]}),e.jsx(U,{width:"100%",height:90,children:e.jsxs(V,{data:s,margin:{top:2,right:4,left:-28,bottom:0},children:[e.jsx(J,{dataKey:"mes",tick:{fontSize:9,fill:"#6c757d"},interval:Math.max(0,Math.floor(s.length/12)-1),tickLine:!1,axisLine:!1}),e.jsx(K,{allowDecimals:!1,tick:{fontSize:9,fill:"#6c757d"},tickLine:!1,axisLine:!1,width:36,domain:[0,c+1]}),e.jsx(H,{formatter:l=>[`${l} commits`,"Commits"],labelFormatter:l=>l,contentStyle:{fontSize:"0.75rem",padding:"4px 8px"}}),e.jsx(q,{dataKey:"commits",radius:[2,2,0,0],children:s.map(l=>e.jsx(X,{fill:l.commits===0?"#dee2e6":r,opacity:l.commits===0?.4:.85},l.chave))})]})})]})}function ne({projeto:t,geradoEm:n,totalCommits:o,totalCommitsMain:m,totalBranches:s,repositorios:c}){const r=n?new Date(n).toLocaleString("pt-BR"):"—";return e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"p-3 text-white mb-3",style:{background:"#1a3a5c"},children:e.jsx("h3",{className:"fw-bold mb-0 text-uppercase tracking-wide",children:"Tarefas do Projeto do SIE"})}),e.jsx(W,{bordered:!0,size:"sm",className:"mb-3",style:{maxWidth:700},children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"fw-semibold text-muted",style:{width:200},children:"Título do Projeto"}),e.jsx("td",{children:t==null?void 0:t.titulo})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"fw-semibold text-muted",children:"Nome da Empresa"}),e.jsx("td",{children:t==null?void 0:t.empresa})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"fw-semibold text-muted",children:"Desenvolvedor"}),e.jsx("td",{children:t==null?void 0:t.desenvolvedor})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"fw-semibold text-muted",children:"Gerente do Projeto"}),e.jsx("td",{children:t==null?void 0:t.gerenteProjeto})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"fw-semibold text-muted",children:"Dados gerados em"}),e.jsxs("td",{children:[e.jsx("span",{children:r})," ",e.jsxs("small",{className:"text-muted",children:["(",o==null?void 0:o.toLocaleString("pt-BR")," commits em"," ",(c??[]).length," repositórios ·"," ",s==null?void 0:s.toLocaleString("pt-BR")," branches analisados ·"," ",m==null?void 0:m.toLocaleString("pt-BR")," commits na main)"]})]})]})]})})]})}const re=3183,oe=3186;function ce({fase:t,index:n,expandido:o,onToggle:m,podeVerBranches:s}){var f,b;const c=G[t.status]||G.Planejado,r=t.cor||"#1a3a5c",l=t.statusGit&&t.statusGit!==t.status,x=(i=>{const j=i.replace("#",""),S=parseInt(j.substring(0,2),16),y=parseInt(j.substring(2,4),16),g=parseInt(j.substring(4,6),16);return .2126*S+.7152*y+.0722*g})(r)>128?"#212529":"#fff";return e.jsxs("tr",{style:{cursor:"pointer",verticalAlign:"top"},onClick:m,children:[e.jsx("td",{className:"text-center fw-bold fs-5 align-middle",style:{background:r,color:x,width:48,minWidth:48},children:t.numero}),e.jsxs("td",{style:{minWidth:220},children:[e.jsx("div",{className:"fw-bold",style:{color:r},children:t.titulo}),t.tipo&&e.jsx("small",{className:"text-muted fst-italic",children:t.tipo}),o&&e.jsxs("div",{className:"mt-2",children:[e.jsxs("small",{className:"text-muted",children:[t.totalCommits," commits",((f=t.branches)==null?void 0:f.length)>0&&e.jsxs(e.Fragment,{children:[" · ",t.branches.length," branches"]})]}),s&&t.commitsPorRepo&&Object.keys(t.commitsPorRepo).length>0&&e.jsx("div",{className:"mt-1",children:Object.entries(t.commitsPorRepo).map(([i,j])=>e.jsxs("small",{className:"me-2 text-muted",children:[e.jsx("em",{children:i}),": ",j," commits"]},i))}),s&&((b=t.branches)==null?void 0:b.length)>0&&e.jsxs("div",{className:"mt-1",children:[t.branches.slice(0,6).map(i=>e.jsx("small",{className:"me-1 text-muted",style:{fontFamily:"monospace",fontSize:"0.7rem"},children:i},i)),t.branches.length>6&&e.jsxs("small",{className:"text-muted",children:["+",t.branches.length-6," mais"]})]}),l&&e.jsx("div",{className:"mt-1",children:e.jsxs("small",{className:"text-muted",children:["Status no git: ",e.jsx("em",{children:t.statusGit})," ","(ajuste gerencial aplicado)"]})}),e.jsx(le,{commitsPorMes:t.commitsPorMes,dataPrimeiroCommit:t.dataPrimeiroCommit,dataUltimoCommit:t.dataUltimoCommit,cor:r})]})]}),e.jsx("td",{children:e.jsx("ul",{className:"mb-0 ps-3",children:t.tarefas.map((i,j)=>e.jsx("li",{style:{fontSize:"0.85rem"},children:i},j))})}),e.jsxs("td",{className:"text-center align-middle",style:{minWidth:160},children:[e.jsx(te,{bg:c.bg,text:c.bg==="light"||c.bg==="warning"?"dark":void 0,className:"py-2 px-3",style:{fontSize:"0.8rem",whiteSpace:"normal"},children:c.label}),l&&e.jsx("div",{children:e.jsx("small",{className:"text-muted",title:`Git: ${t.statusGit}`,children:"⚡ ajuste"})})]}),e.jsx("td",{className:"text-center align-middle",style:{minWidth:110,fontSize:"0.85rem"},children:t.dataUltimoCommit?e.jsxs(e.Fragment,{children:[e.jsx("div",{children:t.dataUltimoCommit}),t.dataPrimeiroCommit&&t.dataPrimeiroCommit!==t.dataUltimoCommit&&e.jsxs("small",{className:"text-muted",children:["desde ",t.dataPrimeiroCommit]})]}):e.jsx("span",{className:"text-muted",children:"—"})})]})}function de({fases:t,totalCommitsAnalisados:n,deploys:o}){const m=t.length,s=t.filter(i=>i.status==="Publicado").length,c=t.filter(i=>i.status==="Em fase de testes").length,r=t.filter(i=>i.status==="Em desenvolvimento").length,l=t.filter(i=>i.status==="Aguardando revisão").length,h=t.filter(i=>i.status==="Planejado").length,x=o==null?void 0:o.frontend,f=o==null?void 0:o.backend,b=[{label:"Módulos totais",valor:m,bg:"#1a3a5c",cor:"#fff"},{label:"Publicados",valor:s,bg:"#198754",cor:"#fff"},{label:"Em testes",valor:c,bg:"#ffc107",cor:"#212529"},{label:"Em desenvolvimento",valor:r,bg:"#0dcaf0",cor:"#212529"},{label:"Aguardando revisão",valor:l,bg:"#6c757d",cor:"#fff"},{label:"Planejados",valor:h,bg:"#dee2e6",cor:"#212529"}
1,{label:"Commits analisados",valor:(n??0).toLocaleString("pt-BR"),bg:"#343a40",cor:"#fff"},...x?[{label:`Deploys frontend · ${x.ultimaVersao??""}`,valor:x.total.toLocaleString("pt-BR"),bg:"#0d6efd",cor:"#fff"}]:[],...f?[{label:`Deploys backend · ${f.ultimaVersao??""}`,valor:f.total.toLocaleString("pt-BR"),bg:"#6610f2",cor:"#fff"}]:[]];return e.jsx(I,{className:"g-2 mb-4",children:b.map(i=>e.jsx(w,{xs:6,sm:4,md:"auto",children:e.jsxs("div",{className:"rounded p-2 text-center",style:{background:i.bg,color:i.cor,minWidth:120},children:[e.jsx("div",{className:"fw-bold fs-4",children:i.valor}),e.jsx("div",{style:{fontSize:"0.75rem"},children:i.label})]})},i.label))})}function me({commitsPorMes:t}){var s,c;const n=Y(t??{});if(n.length===0)return null;const o=Math.max(...n.map(r=>r.commits)),m=({active:r,payload:l,label:h})=>!r||!(l!=null&&l.length)?null:e.jsxs("div",{style:{background:"#fff",border:"1px solid #dee2e6",borderRadius:4,padding:"4px 10px",fontSize:"0.75rem"},children:[e.jsx("div",{className:"fw-semibold",children:h}),e.jsxs("div",{children:[l[0].value," commits"]})]});return e.jsxs("div",{className:"mb-4 p-3 border rounded",style:{background:"#f8f9fa"},children:[e.jsxs("div",{className:"d-flex justify-content-between align-items-baseline mb-2",children:[e.jsx("span",{className:"fw-semibold text-muted",style:{fontSize:"0.85rem"},children:"Atividade globalThis — commits por mês"}),e.jsxs("small",{className:"text-muted",children:[(s=n[0])==null?void 0:s.mes," → ",(c=n[n.length-1])==null?void 0:c.mes," · ",n.length," meses"]})]}),e.jsx(U,{width:"100%",height:110,children:e.jsxs(V,{data:n,margin:{top:2,right:4,left:-28,bottom:0},children:[e.jsx(J,{dataKey:"mes",tick:{fontSize:9,fill:"#6c757d"},interval:Math.max(0,Math.floor(n.length/18)-1),tickLine:!1,axisLine:!1}),e.jsx(K,{allowDecimals:!1,tick:{fontSize:9,fill:"#6c757d"},tickLine:!1,axisLine:!1,width:36,domain:[0,o+1]}),e.jsx(H,{content:e.jsx(m,{})}),e.jsx(q,{dataKey:"commits",radius:[2,2,0,0],children:n.map(r=>e.jsx(X,{fill:r.commits===0?"#dee2e6":"#1a3a5c",opacity:r.commits===0?.4:.8},r.chave))})]})})]})}function be(){var z,R,D,B;const{currentUser:t}=ae(),n=se(),o=((z=t==null?void 0:t.rulesOwned)==null?void 0:z.includes(re))??!1,m=((R=t==null?void 0:t.rulesOwned)==null?void 0:R.includes(oe))??!1,[s,c]=p.useState(null),[r,l]=p.useState(!0),[h,x]=p.useState(null),[f,b]=p.useState(new Set),[i,j]=p.useState(""),[S,y]=p.useState(""),[g,L]=p.useState({coluna:"numero",dir:"asc"}),P=a=>{L(d=>d.coluna===a?{coluna:a,dir:d.dir==="asc"?"desc":"asc"}:{coluna:a,dir:"asc"})},C=p.useCallback(async()=>{l(!0),x(null);try{const a=`/data/project-phases.json?t=${Date.now()}`,d=await fetch(a);if(!d.ok)throw new Error(`HTTP ${d.status}`);const u=await d.json();c(u)}catch{x("Não foi possível carregar os dados. Execute o script relatorios-git/generate_project_phases.py para gerar o arquivo client/public/data/project-phases.json.")}finally{l(!1)}},[]);p.useEffect(()=>{C()},[C]);const Q=a=>{b(d=>{const u=new Set(d);return u.has(a)?u.delete(a):u.add(a),u})},T=(((D=s==null?void 0:s.fases)==null?void 0:D.filter(a=>{const d=!i||a.titulo.toLowerCase().includes(i.toLowerCase())||a.tarefas.some(k=>k.toLowerCase().includes(i.toLowerCase())),u=!S||a.status===S;return d&&u}))??[]).slice().sort((a,d)=>{const{coluna:u,dir:k}=g;let v,N;if(u==="numero")v=a.numero,N=d.numero;else if(u==="titulo")v=a.titulo.toLowerCase(),N=d.titulo.toLowerCase();else if(u==="data"){v=a.dataUltimoCommit??"",N=d.dataUltimoCommit??"";const F=M=>M?M.split("/").reverse().join("-"):"";v=F(v),N=F(N)}return v<N?k==="asc"?-1:1:v>N?k==="asc"?1:-1:0});if(r)return e.jsxs(A,{className:"py-5 text-center",children:[e.jsx(ee,{animation:"border",variant:"primary"}),e.jsx("p",{className:"mt-3 text-muted",children:"Carregando dados do projeto..."})]});if(h)return e.jsxs(A,{className:"py-4",children:[e.jsxs(O,{variant:"warning",children:[e.jsx(O.Heading,{children:"Dados não encontrados"}),e.jsx("p",{children:h}),e.jsx("hr",{}),e.jsx("pre",{className:"mb-0",style:{fontSize:"0.85rem"},children:"python3 relatorios-git/generate_project_phases.py"})]}),e.jsx(E,{variant:"outline-primary",onClick:C,children:"Tentar novamente"})]});const Z=[...new Set(((B=s==null?void 0:s.fases)==null?void 0:B.map(a=>a.status))??[])].sort();return e.jsxs(A,{fluid:!0,className:"py-4 px-3 px-md-4",children:[e.jsx(ne,{projeto:s.projeto,geradoEm:s.geradoEm,totalCommits:s.totalCommitsAnalisados,totalCommitsMain:s.totalCommitsMain,totalBranches:s.totalBranchesAnalisados,repositorios:s.repositorios}),e.jsx(de,{fases:s.fases??[],totalCommitsAnalisados:s.totalCommitsAnalisados,deploys:s.deploys}),e.jsx(me,{commitsPorMes:s.commitsPorMes}
1),e.jsxs(I,{className:"g-2 mb-3 align-items-end",children:[e.jsx(w,{xs:12,md:5,children:e.jsxs(_,{size:"sm",children:[e.jsx(_.Text,{children:"Buscar"}),e.jsx($.Control,{placeholder:"Módulo ou tarefa...",value:i,onChange:a=>j(a.target.value)})]})}),e.jsx(w,{xs:12,md:4,children:e.jsxs($.Select,{size:"sm",value:S,onChange:a=>y(a.target.value),children:[e.jsx("option",{value:"",children:"Todos os status"}),Z.map(a=>e.jsx("option",{value:a,children:a},a))]})}),e.jsx(w,{xs:"auto",children:e.jsx(E,{size:"sm",variant:"outline-secondary",onClick:()=>{j(""),y(""),b(new Set),L({coluna:"numero",dir:"asc"})},children:"Limpar"})}),e.jsx(w,{xs:"auto",children:e.jsx(E,{size:"sm",variant:"outline-primary",onClick:C,title:"Recarregar dados do JSON",children:"↻ Atualizar"})})]}),e.jsx("div",{className:"table-responsive",children:e.jsxs(W,{bordered:!0,hover:!0,className:"align-top mb-0",children:[e.jsx("thead",{className:"table-dark text-center",style:{fontSize:"0.85rem"},children:e.jsxs("tr",{children:[e.jsxs("th",{style:{width:48,cursor:"pointer",userSelect:"none"},onClick:()=>P("numero"),title:"Ordenar por número da fase",children:["Fase",g.coluna==="numero"?g.dir==="asc"?" ▲":" ▼":" ⇅"]}),e.jsxs("th",{style:{minWidth:220,cursor:"pointer",userSelect:"none"},onClick:()=>P("titulo"),title:"Ordenar por nome do módulo",children:["Módulo",g.coluna==="titulo"?g.dir==="asc"?" ▲":" ▼":" ⇅"]}),e.jsx("th",{children:"Descrição / Tarefas"}),e.jsx("th",{style:{width:160},children:"Status"}),e.jsxs("th",{style:{width:110,cursor:"pointer",userSelect:"none"},onClick:()=>P("data"),title:"Ordenar por data do último commit",children:["Data",g.coluna==="data"?g.dir==="asc"?" ▲":" ▼":" ⇅"]})]})}),e.jsx("tbody",{children:T.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"text-center py-4 text-muted",children:"Nenhum módulo encontrado com os filtros aplicados."})}):T.map((a,d)=>e.jsx(ce,{fase:a,index:d,expandido:f.has(a.numero),onToggle:()=>Q(a.numero),podeVerBranches:o},a.numero))})]})}),e.jsxs("div",{className:"mt-3 text-muted",style:{fontSize:"0.75rem"},children:["Clique em uma linha para ver detalhes de branches e commits por repositório. ⚡ indica ajuste gerencial sobre o status inferido pelo git."," ","Para atualizar os dados:"," ",e.jsx("code",{children:"python3 relatorios-git/generate_project_phases.py"})]}),m&&e.jsxs(e.Fragment,{children:[e.jsx("hr",{className:"my-4"}),e.jsx("div",{className:"d-flex align-items-center gap-2",children:e.jsx(E,{variant:"outline-secondary",size:"sm",onClick:()=>n("/sie/estrutura-tecnica"),children:"Ver estrutura técnica e gastos com ferramentas"})})]})]})}export{be as default};
2//# sourceMappingURL=AcompanhamentoTarefasPage-dab9f806.js.map

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.