@meridianjs/admin-dashboard 0.1.40 → 0.1.41

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.
@@ -1 +1 @@
1
- import{a as Q,b as U,j as t}from"./vendor-query-CaIGp3JB.js";import{u as Z,r as c,h as J}from"./vendor-react-Lycsri1F.js";import{u as V,a as X,b as ee,c as te,d as ae,e as se,f as ne,W as C,B as re,P as oe,G as de,g as ie,h as I,i as v,j as le,k as ce,l as ue,m as _,n as E,o as me,p as he,I as pe,C as fe,q as xe,r as T,s as W,t as je,v as ge,w as ye,x as be}from"./index-B66YRSpH.js";import"./vendor-radix-CeigSZIw.js";import"./vendor-dnd-B31T8w2X.js";import"./vendor-editor-BoEtjgAn.js";function x(n,u){const m=n.start_date?new Date(n.start_date):new Date(n.due_date),j=n.due_date?T(new Date(n.due_date),1):T(m,1);return{id:n.id,name:`${n.identifier} ${n.title}`,startAt:m,endAt:j,status:{id:n.status,name:n.status,color:u}}}function Se(){const{projectKey:n,workspace:u}=Z(),m=Q(),j=V(),[o,q]=c.useState("monthly"),[M,S]=c.useState(null),[A,G]=c.useState(!1),F=c.useRef(null);c.useEffect(()=>{const e=requestAnimationFrame(()=>{var P;const s=(P=F.current)==null?void 0:P.querySelector(".gantt");if(!s)return;const a=new Date,$=a.getFullYear()-1,O=300;let w;if(o==="daily"){const f=new Date($,0,1);w=Math.floor((a.getTime()-f.getTime())/864e5)*50}else{const f=o==="monthly"?150:100,z=(a.getFullYear()-$)*12+a.getMonth(),L=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();w=z*f+(a.getDate()-1)/L*f}const H=s.clientWidth-O;s.scrollLeft=Math.max(0,w-H/2)});return()=>cancelAnimationFrame(e)},[o]);const{data:g}=X(n??""),r=(g==null?void 0:g.id)??"",{data:y=[]}=ee(r||void 0),{data:B=[]}=te(r||void 0),{data:b=[]}=ae(r||void 0),{data:h}=se(),{data:R=[]}=ne(new Date().getFullYear()),Y=U({mutationFn:({id:e,start_date:s,due_date:a})=>be.put(`/admin/issues/${e}`,{start_date:s,due_date:a}),onSuccess:()=>{m.invalidateQueries({queryKey:ye.byProject(r)})},onError:()=>ge.error("Failed to update issue dates")}),d=Object.fromEntries(B.map(e=>[e.key,e.color])),k=e=>{if(!e.start_date||!e.due_date||!(h!=null&&h.working_days))return;const s=xe(new Date(e.start_date),new Date(e.due_date),h.working_days,R);return`${s} business day${s!==1?"s":""}`},K=y.filter(e=>e.due_date),p=y.filter(e=>!e.due_date),i={},l=[];for(const e of K)e.sprint_id?(i[e.sprint_id]||(i[e.sprint_id]=[]),i[e.sprint_id].push(e)):l.push(e);const N=(e,s,a)=>{Y.mutate({id:e,start_date:W(s,"yyyy-MM-dd"),due_date:a?W(je(a),"yyyy-MM-dd"):null})},D=e=>{const s=y.find(a=>a.id===e)??null;S(s)};return j&&n&&u?t.jsx(J,{to:`/${u}/projects/${n}/issues`,replace:!0}):n?t.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[t.jsx(C,{zone:"project.timeline.before",props:{projectId:r}}),t.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:[t.jsx("div",{className:"flex items-center gap-1 bg-muted rounded-md p-0.5",children:["daily","monthly","quarterly"].map(e=>t.jsx("button",{onClick:()=>q(e),className:`px-3 py-1 rounded text-xs font-medium transition-colors capitalize ${o===e?"bg-white dark:bg-zinc-900 text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:e},e))}),t.jsxs(re,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:()=>G(!0),children:[t.jsx(oe,{className:"h-3.5 w-3.5"}),"Issue"]})]}),t.jsx("div",{ref:F,className:"flex-1 min-h-0 overflow-hidden",children:t.jsxs(de,{range:o,zoom:100,className:"h-full bg-white dark:bg-zinc-950",children:[t.jsxs(ie,{children:[b.map(e=>{const s=i[e.id]??[];return t.jsx(I,{name:e.name,children:s.map(a=>t.jsx(v,{feature:x(a,d[a.status]??"#94a3b8"),duration:k(a),onSelectItem:D},a.id))},e.id)}),l.length>0&&t.jsx(I,{name:"No Sprint",children:l.map(e=>t.jsx(v,{feature:x(e,d[e.status]??"#94a3b8"),duration:k(e),onSelectItem:D},e.id))}),p.length>0&&t.jsx(I,{name:"Unscheduled",children:p.map(e=>t.jsx(v,{feature:{id:e.id,name:`${e.identifier} ${e.title}`,startAt:new Date,endAt:new Date,status:{id:e.status,name:e.status,color:d[e.status]??"#94a3b8"}},onSelectItem:D},e.id))})]}),t.jsxs(le,{children:[t.jsx(ce,{}),t.jsxs(ue,{children:[b.map(e=>{const s=i[e.id]??[];return t.jsx(_,{children:s.map(a=>t.jsx("div",{className:"flex",children:t.jsx(E,{onMove:N,...x(a,d[a.status]??"#94a3b8")})},a.id))},e.id)}),l.length>0&&t.jsx(_,{children:l.map(e=>t.jsx("div",{className:"flex",children:t.jsx(E,{onMove:N,...x(e,d[e.status]??"#94a3b8")})},e.id))}),p.length>0&&t.jsx(_,{children:p.map(e=>t.jsx("div",{style:{height:"var(--gantt-row-height)"}},e.id))})]}),b.filter(e=>e.end_date).map(e=>t.jsx(me,{id:e.id,date:new Date(e.end_date),label:`${e.name} end`},e.id)),t.jsx(he,{})]})]})}),t.jsx(C,{zone:"project.timeline.after",props:{projectId:r}}),t.jsx(pe,{issue:M,projectId:r,open:!!M,onClose:()=>S(null)}),t.jsx(fe,{open:A,onClose:()=>G(!1),projectId:r})]}):null}export{Se as ProjectTimelinePage};
1
+ import{a as Q,b as U,j as t}from"./vendor-query-CaIGp3JB.js";import{u as Z,r as c,h as J}from"./vendor-react-Lycsri1F.js";import{u as V,a as X,b as ee,c as te,d as ae,e as se,f as ne,W as C,B as re,P as oe,G as de,g as ie,h as I,i as v,j as le,k as ce,l as ue,m as _,n as E,o as me,p as he,I as pe,C as fe,q as xe,r as T,s as W,t as je,v as ge,w as ye,x as be}from"./index-PJTvPCLS.js";import"./vendor-radix-CeigSZIw.js";import"./vendor-dnd-B31T8w2X.js";import"./vendor-editor-BoEtjgAn.js";function x(n,u){const m=n.start_date?new Date(n.start_date):new Date(n.due_date),j=n.due_date?T(new Date(n.due_date),1):T(m,1);return{id:n.id,name:`${n.identifier} ${n.title}`,startAt:m,endAt:j,status:{id:n.status,name:n.status,color:u}}}function Se(){const{projectKey:n,workspace:u}=Z(),m=Q(),j=V(),[o,q]=c.useState("monthly"),[M,S]=c.useState(null),[A,G]=c.useState(!1),F=c.useRef(null);c.useEffect(()=>{const e=requestAnimationFrame(()=>{var P;const s=(P=F.current)==null?void 0:P.querySelector(".gantt");if(!s)return;const a=new Date,$=a.getFullYear()-1,O=300;let w;if(o==="daily"){const f=new Date($,0,1);w=Math.floor((a.getTime()-f.getTime())/864e5)*50}else{const f=o==="monthly"?150:100,z=(a.getFullYear()-$)*12+a.getMonth(),L=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();w=z*f+(a.getDate()-1)/L*f}const H=s.clientWidth-O;s.scrollLeft=Math.max(0,w-H/2)});return()=>cancelAnimationFrame(e)},[o]);const{data:g}=X(n??""),r=(g==null?void 0:g.id)??"",{data:y=[]}=ee(r||void 0),{data:B=[]}=te(r||void 0),{data:b=[]}=ae(r||void 0),{data:h}=se(),{data:R=[]}=ne(new Date().getFullYear()),Y=U({mutationFn:({id:e,start_date:s,due_date:a})=>be.put(`/admin/issues/${e}`,{start_date:s,due_date:a}),onSuccess:()=>{m.invalidateQueries({queryKey:ye.byProject(r)})},onError:()=>ge.error("Failed to update issue dates")}),d=Object.fromEntries(B.map(e=>[e.key,e.color])),k=e=>{if(!e.start_date||!e.due_date||!(h!=null&&h.working_days))return;const s=xe(new Date(e.start_date),new Date(e.due_date),h.working_days,R);return`${s} business day${s!==1?"s":""}`},K=y.filter(e=>e.due_date),p=y.filter(e=>!e.due_date),i={},l=[];for(const e of K)e.sprint_id?(i[e.sprint_id]||(i[e.sprint_id]=[]),i[e.sprint_id].push(e)):l.push(e);const N=(e,s,a)=>{Y.mutate({id:e,start_date:W(s,"yyyy-MM-dd"),due_date:a?W(je(a),"yyyy-MM-dd"):null})},D=e=>{const s=y.find(a=>a.id===e)??null;S(s)};return j&&n&&u?t.jsx(J,{to:`/${u}/projects/${n}/issues`,replace:!0}):n?t.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[t.jsx(C,{zone:"project.timeline.before",props:{projectId:r}}),t.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:[t.jsx("div",{className:"flex items-center gap-1 bg-muted rounded-md p-0.5",children:["daily","monthly","quarterly"].map(e=>t.jsx("button",{onClick:()=>q(e),className:`px-3 py-1 rounded text-xs font-medium transition-colors capitalize ${o===e?"bg-white dark:bg-zinc-900 text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:e},e))}),t.jsxs(re,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:()=>G(!0),children:[t.jsx(oe,{className:"h-3.5 w-3.5"}),"Issue"]})]}),t.jsx("div",{ref:F,className:"flex-1 min-h-0 overflow-hidden",children:t.jsxs(de,{range:o,zoom:100,className:"h-full bg-white dark:bg-zinc-950",children:[t.jsxs(ie,{children:[b.map(e=>{const s=i[e.id]??[];return t.jsx(I,{name:e.name,children:s.map(a=>t.jsx(v,{feature:x(a,d[a.status]??"#94a3b8"),duration:k(a),onSelectItem:D},a.id))},e.id)}),l.length>0&&t.jsx(I,{name:"No Sprint",children:l.map(e=>t.jsx(v,{feature:x(e,d[e.status]??"#94a3b8"),duration:k(e),onSelectItem:D},e.id))}),p.length>0&&t.jsx(I,{name:"Unscheduled",children:p.map(e=>t.jsx(v,{feature:{id:e.id,name:`${e.identifier} ${e.title}`,startAt:new Date,endAt:new Date,status:{id:e.status,name:e.status,color:d[e.status]??"#94a3b8"}},onSelectItem:D},e.id))})]}),t.jsxs(le,{children:[t.jsx(ce,{}),t.jsxs(ue,{children:[b.map(e=>{const s=i[e.id]??[];return t.jsx(_,{children:s.map(a=>t.jsx("div",{className:"flex",children:t.jsx(E,{onMove:N,...x(a,d[a.status]??"#94a3b8")})},a.id))},e.id)}),l.length>0&&t.jsx(_,{children:l.map(e=>t.jsx("div",{className:"flex",children:t.jsx(E,{onMove:N,...x(e,d[e.status]??"#94a3b8")})},e.id))}),p.length>0&&t.jsx(_,{children:p.map(e=>t.jsx("div",{style:{height:"var(--gantt-row-height)"}},e.id))})]}),b.filter(e=>e.end_date).map(e=>t.jsx(me,{id:e.id,date:new Date(e.end_date),label:`${e.name} end`},e.id)),t.jsx(he,{})]})]})}),t.jsx(C,{zone:"project.timeline.after",props:{projectId:r}}),t.jsx(pe,{issue:M,projectId:r,open:!!M,onClose:()=>S(null)}),t.jsx(fe,{open:A,onClose:()=>G(!1),projectId:r})]}):null}export{Se as ProjectTimelinePage};
@@ -1 +1 @@
1
- import{j as r}from"./vendor-query-CaIGp3JB.js";import{y as t,R as i}from"./index-B66YRSpH.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};
1
+ import{j as r}from"./vendor-query-CaIGp3JB.js";import{y as t,R as i}from"./index-PJTvPCLS.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};