@meridianjs/admin-dashboard 0.1.41 → 0.1.42
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/assets/ProjectTimelinePage-t37bNlU4.js +3 -0
- package/dist/assets/{WorkspaceReportingPage-JQfr6bSh.js → WorkspaceReportingPage-C5UxrMV5.js} +1 -1
- package/dist/assets/exceljs.min-BhVFTGw4.js +57 -0
- package/dist/assets/index-DZZadRww.css +1 -0
- package/dist/assets/index-DtZ73_T2.js +629 -0
- package/dist/index.html +2 -2
- package/package.json +2 -1
- package/dist/assets/ProjectTimelinePage-CpMsZyRM.js +0 -1
- package/dist/assets/index-CpG8Mt5c.css +0 -1
- package/dist/assets/index-PJTvPCLS.js +0 -619
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/exceljs.min-BhVFTGw4.js","assets/vendor-react-Lycsri1F.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as Dt,b as vt,j as a}from"./vendor-query-CaIGp3JB.js";import{u as Ct,r as P,h as Mt}from"./vendor-react-Lycsri1F.js";import{_ as Ft,s as wt,a as nt,f as I,c as jt,i as St,u as It,b as zt,d as kt,e as Et,g as Gt,h as Nt,j as Rt,k as $t,W as ht,B as xt,D as Bt,P as Tt,G as Pt,l as At,m as rt,n as lt,o as Ut,p as Wt,q as Lt,r as it,t as yt,v as Ot,w as qt,I as Yt,C as Ht,x as dt,y as Kt,z as Qt}from"./index-DtZ73_T2.js";import"./vendor-radix-CeigSZIw.js";import"./vendor-dnd-B31T8w2X.js";import"./vendor-editor-BoEtjgAn.js";const g=9;function bt(l){return"FF"+l.replace("#","")}async function Zt(l){var ct;const z=await Ft(()=>import("./exceljs.min-BhVFTGw4.js").then(e=>e.e),__vite__mapDeps([0,1])),{project:h,issues:R,statuses:k,sprints:Y,userMap:H,workingDays:$,holidays:K}=l,Q=new Map(k.map(e=>[e.key,e])),A=R.filter(e=>e.due_date),v=R.filter(e=>!e.due_date),m={},w=[];for(const e of A)e.sprint_id?(m[e.sprint_id]||(m[e.sprint_id]=[]),m[e.sprint_id].push(e)):w.push(e);let C=null,x=null;for(const e of A){const o=e.start_date?new Date(e.start_date):new Date(e.due_date),d=new Date(e.due_date);(!C||o<C)&&(C=o),(!x||d>x)&&(x=d)}const y=C!==null&&x!==null,U=y?wt(C,7):null,Z=y?nt(x,7):null,f=[];if(U&&Z){let e=new Date(U);for(;e<=Z;)f.push(new Date(e)),e=nt(e,1)}const W=new z.Workbook,s=W.addWorksheet("Gantt Chart"),j=g+f.length,M={type:"pattern",pattern:"solid",fgColor:{argb:"FF27272a"}},st={type:"pattern",pattern:"solid",fgColor:{argb:"FFf5f5f5"}},E={type:"pattern",pattern:"solid",fgColor:{argb:"FFfafafa"}},F={type:"pattern",pattern:"solid",fgColor:{argb:"FFe0e7ff"}},b={style:"thin",color:{argb:"FFe4e4e7"}},_={top:b,bottom:b,left:b,right:b};s.mergeCells(1,1,1,Math.max(g,j));const G=s.getCell(1,1);G.value=`${h.identifier} — ${h.name}`,G.font={bold:!0,size:14,color:{argb:"FFffffff"}},G.fill=M,G.alignment={vertical:"middle"},s.getRow(1).height=30,s.mergeCells(2,1,2,Math.max(g,j));const S=s.getCell(2,1);if(S.value=`Exported on ${I(new Date,"MMM d, yyyy")}`,S.font={size:10,color:{argb:"FF71717a"}},S.fill=M,S.alignment={vertical:"middle"},h.description){s.mergeCells(3,1,3,Math.max(g,j));const e=s.getCell(3,1);e.value=h.description,e.font={size:10,italic:!0,color:{argb:"FFa1a1aa"}},e.fill=M,e.alignment={vertical:"middle"}}const t=5,i=["ID","Title","Status","Priority","Assignee(s)","Sprint","Start Date","Due Date","Duration"],n=[12,35,15,10,22,18,12,12,10];for(let e=0;e<i.length;e++){const o=s.getColumn(e+1);o.width=n[e];const d=s.getCell(t,e+1);d.value=i[e],d.font={bold:!0,size:10,color:{argb:"FFffffff"}},d.fill=M,d.alignment={horizontal:"center",vertical:"middle"},d.border=_}for(let e=0;e<f.length;e++){const o=g+e+1,d=s.getColumn(o);d.width=4;const u=s.getCell(t,o);u.value=`${I(f[e],"d")}
|
|
3
|
+
${I(f[e],"MMM")}`,u.font={bold:!0,size:7,color:{argb:"FFffffff"}},u.fill=M,u.alignment={horizontal:"center",vertical:"middle",wrapText:!0},u.border=_}s.getRow(t).height=28;let p=t+1,J=0;function N(e){s.mergeCells(p,1,p,g);const o=s.getCell(p,1);o.value=e,o.font={bold:!0,size:10,color:{argb:"FF312e81"}},o.fill=F,o.alignment={vertical:"middle"},o.border=_;for(let d=0;d<f.length;d++){const u=s.getCell(p,g+d+1);u.fill=F,u.border=_}p++}function L(e,o){var gt;const d=J%2===0,u=Q.get(e.status),_t=(gt=e.assignee_ids)!=null&>.length?e.assignee_ids.map(r=>{var c;return((c=H.get(r))==null?void 0:c.name)??"Unknown"}).join(", "):"Unassigned",q=e.start_date?new Date(e.start_date):null,T=e.due_date?new Date(e.due_date):null;let ut="—";q&&T&&$&&(ut=`${jt(q,T,$,K)}d`);const ft=[e.identifier,e.title,(u==null?void 0:u.name)??e.status,e.priority.charAt(0).toUpperCase()+e.priority.slice(1),_t,o,q?I(q,"MMM d, yyyy"):"—",T?I(T,"MMM d, yyyy"):"—",ut];for(let r=0;r<ft.length;r++){const c=s.getCell(p,r+1);c.value=ft[r],c.font={size:9},c.alignment={vertical:"middle"},c.border=_,d&&(c.fill=E),r===2&&u&&(c.fill={type:"pattern",pattern:"solid",fgColor:{argb:bt(u.color)}},c.font={size:9,color:{argb:"FFffffff"},bold:!0},c.alignment={horizontal:"center",vertical:"middle"})}const pt=q??T,mt=T;let D=-1,et=-1;if(pt&&mt)for(let r=0;r<f.length;r++){const c=f[r];c>=pt&&c<=mt&&(D===-1&&(D=g+r+1),et=g+r+1)}if(D!==-1&&et>D&&s.mergeCells(p,D,p,et),D!==-1&&u){const r=s.getCell(p,D);r.fill={type:"pattern",pattern:"solid",fgColor:{argb:bt(u.color)}},r.border=_}for(let r=0;r<f.length;r++){const c=g+r+1;if(D!==-1&&c>=D&&c<=et)continue;const ot=s.getCell(p,c);ot.border=_,St(f[r],$,K)?d&&(ot.fill=E):ot.fill=st}p++,J++}const V=new Map(Y.map(e=>[e.id,e]));for(const e of Y){const o=m[e.id];if(o!=null&&o.length){N(e.name);for(const d of o)L(d,e.name)}}if(w.length>0){N("No Sprint");for(const e of w)L(e,"—")}if(v.length>0){N("Unscheduled");for(const e of v){const o=e.sprint_id?((ct=V.get(e.sprint_id))==null?void 0:ct.name)??"—":"—";L(e,o)}}s.views=[{state:"frozen",xSplit:g,ySplit:t}];const B=await W.xlsx.writeBuffer(),X=new Blob([B],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),tt=URL.createObjectURL(X),O=document.createElement("a");O.href=tt,O.download=`${h.identifier}-gantt-${I(new Date,"yyyy-MM-dd")}.xlsx`,document.body.appendChild(O),O.click(),document.body.removeChild(O),URL.revokeObjectURL(tt)}function at(l,z){const h=l.start_date?new Date(l.start_date):new Date(l.due_date),R=l.due_date?nt(new Date(l.due_date),1):nt(h,1);return{id:l.id,name:`${l.identifier} ${l.title}`,startAt:h,endAt:R,status:{id:l.status,name:l.status,color:z}}}function se(){const{projectKey:l,workspace:z}=Ct(),h=Dt(),R=It(),[k,Y]=P.useState("monthly"),[H,$]=P.useState(null),[K,Q]=P.useState(!1),A=P.useRef(null);P.useEffect(()=>{const t=requestAnimationFrame(()=>{var V;const i=(V=A.current)==null?void 0:V.querySelector(".gantt");if(!i)return;const n=new Date,p=n.getFullYear()-1,J=300;let N;if(k==="daily"){const B=new Date(p,0,1);N=Math.floor((n.getTime()-B.getTime())/864e5)*50}else{const B=k==="monthly"?150:100,X=(n.getFullYear()-p)*12+n.getMonth(),tt=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();N=X*B+(n.getDate()-1)/tt*B}const L=i.clientWidth-J;i.scrollLeft=Math.max(0,N-L/2)});return()=>cancelAnimationFrame(t)},[k]);const{data:v}=zt(l??""),m=(v==null?void 0:v.id)??"",{data:w=[]}=kt(m||void 0),{data:C=[]}=Et(m||void 0),{data:x=[]}=Gt(m||void 0),{data:y}=Nt(),{data:U=[]}=Rt(new Date().getFullYear()),{data:Z=new Map}=$t(),[f,W]=P.useState(!1),s=vt({mutationFn:({id:t,start_date:i,due_date:n})=>Qt.put(`/admin/issues/${t}`,{start_date:i,due_date:n}),onSuccess:()=>{h.invalidateQueries({queryKey:Kt.byProject(m)})},onError:()=>dt.error("Failed to update issue dates")}),j=Object.fromEntries(C.map(t=>[t.key,t.color])),M=t=>{if(!t.start_date||!t.due_date||!(y!=null&&y.working_days))return;const i=jt(new Date(t.start_date),new Date(t.due_date),y.working_days,U);return`${i} business day${i!==1?"s":""}`},st=w.filter(t=>t.due_date),E=w.filter(t=>!t.due_date),F={},b=[];for(const t of st)t.sprint_id?(F[t.sprint_id]||(F[t.sprint_id]=[]),F[t.sprint_id].push(t)):b.push(t);const _=async()=>{if(!(!v||f)){W(!0);try{await Zt({project:v,issues:w,statuses:C,sprints:x,userMap:Z,workingDays:(y==null?void 0:y.working_days)??{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1},holidays:U}),dt.success("Gantt chart exported")}catch(t){dt.error("Failed to export Gantt chart"),console.error(t)}finally{W(!1)}}},G=(t,i,n)=>{s.mutate({id:t,start_date:I(i,"yyyy-MM-dd"),due_date:n?I(wt(n,1),"yyyy-MM-dd"):null})},S=t=>{const i=w.find(n=>n.id===t)??null;$(i)};return R&&l&&z?a.jsx(Mt,{to:`/${z}/projects/${l}/issues`,replace:!0}):l?a.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[a.jsx(ht,{zone:"project.timeline.before",props:{projectId:m}}),a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border shrink-0 bg-white dark:bg-zinc-950",children:[a.jsx("div",{className:"flex items-center gap-1 bg-muted rounded-md p-0.5",children:["daily","monthly","quarterly"].map(t=>a.jsx("button",{onClick:()=>Y(t),className:`px-3 py-1 rounded text-xs font-medium transition-colors capitalize ${k===t?"bg-white dark:bg-zinc-900 text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:t},t))}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(xt,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:_,disabled:f||w.length===0,children:[a.jsx(Bt,{className:"h-3.5 w-3.5"}),f?"Exporting...":"Export"]}),a.jsxs(xt,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:()=>Q(!0),children:[a.jsx(Tt,{className:"h-3.5 w-3.5"}),"Issue"]})]})]}),a.jsx("div",{ref:A,className:"flex-1 min-h-0 overflow-hidden",children:a.jsxs(Pt,{range:k,zoom:100,className:"h-full bg-white dark:bg-zinc-950",children:[a.jsxs(At,{children:[x.map(t=>{const i=F[t.id]??[];return a.jsx(rt,{name:t.name,children:i.map(n=>a.jsx(lt,{feature:at(n,j[n.status]??"#94a3b8"),duration:M(n),onSelectItem:S},n.id))},t.id)}),b.length>0&&a.jsx(rt,{name:"No Sprint",children:b.map(t=>a.jsx(lt,{feature:at(t,j[t.status]??"#94a3b8"),duration:M(t),onSelectItem:S},t.id))}),E.length>0&&a.jsx(rt,{name:"Unscheduled",children:E.map(t=>a.jsx(lt,{feature:{id:t.id,name:`${t.identifier} ${t.title}`,startAt:new Date,endAt:new Date,status:{id:t.status,name:t.status,color:j[t.status]??"#94a3b8"}},onSelectItem:S},t.id))})]}),a.jsxs(Ut,{children:[a.jsx(Wt,{}),a.jsxs(Lt,{children:[x.map(t=>{const i=F[t.id]??[];return a.jsx(it,{children:i.map(n=>a.jsx("div",{className:"flex",children:a.jsx(yt,{onMove:G,...at(n,j[n.status]??"#94a3b8")})},n.id))},t.id)}),b.length>0&&a.jsx(it,{children:b.map(t=>a.jsx("div",{className:"flex",children:a.jsx(yt,{onMove:G,...at(t,j[t.status]??"#94a3b8")})},t.id))}),E.length>0&&a.jsx(it,{children:E.map(t=>a.jsx("div",{style:{height:"var(--gantt-row-height)"}},t.id))})]}),x.filter(t=>t.end_date).map(t=>a.jsx(Ot,{id:t.id,date:new Date(t.end_date),label:`${t.name} end`},t.id)),a.jsx(qt,{})]})]})}),a.jsx(ht,{zone:"project.timeline.after",props:{projectId:m}}),a.jsx(Yt,{issue:H,projectId:m,open:!!H,onClose:()=>$(null)}),a.jsx(Ht,{open:K,onClose:()=>Q(!1),projectId:m})]}):null}export{se as ProjectTimelinePage};
|
package/dist/assets/{WorkspaceReportingPage-JQfr6bSh.js → WorkspaceReportingPage-C5UxrMV5.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./vendor-query-CaIGp3JB.js";import{
|
|
1
|
+
import{j as r}from"./vendor-query-CaIGp3JB.js";import{A as t,R as i}from"./index-DtZ73_T2.js";import"./vendor-react-Lycsri1F.js";import"./vendor-radix-CeigSZIw.js";import"./vendor-dnd-B31T8w2X.js";import"./vendor-editor-BoEtjgAn.js";function u(){const{workspace:o}=t();return r.jsx(i,{workspaceId:o==null?void 0:o.id})}export{u as WorkspaceReportingPage};
|