@burdenoff/microfe-planmagnet 2026.925.11 → 2026.925.13
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/planmagnet/export/ExportWorkItemsButton.d.ts +4 -0
- package/dist/planmagnet/export/ExportWorkItemsButton.d.ts.map +1 -0
- package/dist/planmagnet/export/ExportWorkItemsButton.js +117 -0
- package/dist/planmagnet/export/ExportWorkItemsButton.js.map +1 -0
- package/dist/planmagnet/export/workItemsCsv.d.ts +31 -0
- package/dist/planmagnet/export/workItemsCsv.d.ts.map +1 -0
- package/dist/planmagnet/export/workItemsCsv.js +32 -0
- package/dist/planmagnet/export/workItemsCsv.js.map +1 -0
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js +96 -95
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/TasksTasksPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/TasksTasksPagePage.js +108 -103
- package/dist/planmagnet/pages/TasksTasksPagePage.js.map +1 -1
- package/dist/planmagnet/releases/ReleaseNotesCard.d.ts +5 -0
- package/dist/planmagnet/releases/ReleaseNotesCard.d.ts.map +1 -0
- package/dist/planmagnet/releases/ReleaseNotesCard.js +101 -0
- package/dist/planmagnet/releases/ReleaseNotesCard.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportWorkItemsButton.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/export/ExportWorkItemsButton.tsx"],"names":[],"mappings":"AA2DA,wBAAgB,qBAAqB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAkF1E"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { usePlanMagnet as e } from "../providers/PlanMagnetProvider.js";
|
|
2
|
+
import { downloadCsv as t, workItemsCsv as n } from "./workItemsCsv.js";
|
|
3
|
+
import { useState as r } from "react";
|
|
4
|
+
import { Download as i } from "lucide-react";
|
|
5
|
+
import { gql as a } from "@apollo/client";
|
|
6
|
+
import { useApolloClient as o } from "@apollo/client/react";
|
|
7
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
import { Button as l } from "@burdenoff/fe-libs/ui";
|
|
9
|
+
//#region src/planmagnet/export/ExportWorkItemsButton.tsx
|
|
10
|
+
var u = a`
|
|
11
|
+
query ExportWorkItemsPage($workspaceId: ID!, $filter: PlanmagnetWorkItemFilter, $after: String) {
|
|
12
|
+
planmagnetWorkItems(
|
|
13
|
+
workspaceId: $workspaceId
|
|
14
|
+
filter: $filter
|
|
15
|
+
pagination: { first: 100, after: $after }
|
|
16
|
+
) {
|
|
17
|
+
totalCount
|
|
18
|
+
pageInfo {
|
|
19
|
+
hasNextPage
|
|
20
|
+
endCursor
|
|
21
|
+
}
|
|
22
|
+
items {
|
|
23
|
+
key
|
|
24
|
+
title
|
|
25
|
+
type
|
|
26
|
+
status
|
|
27
|
+
priority
|
|
28
|
+
storyPoints
|
|
29
|
+
assigneeId
|
|
30
|
+
projectId
|
|
31
|
+
sprintId
|
|
32
|
+
dueDate
|
|
33
|
+
createdAt
|
|
34
|
+
updatedAt
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`, d = a`
|
|
39
|
+
query ExportWorkItemsProjects($workspaceId: ID!) {
|
|
40
|
+
planmagnetProjects(workspaceId: $workspaceId, pagination: { first: 100 }) {
|
|
41
|
+
items {
|
|
42
|
+
id
|
|
43
|
+
name
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`, f = 200;
|
|
48
|
+
function p({ projectId: a }) {
|
|
49
|
+
let { workspaceId: p } = e(), m = o(), [h, g] = r({
|
|
50
|
+
busy: !1,
|
|
51
|
+
message: null,
|
|
52
|
+
error: !1
|
|
53
|
+
});
|
|
54
|
+
return /* @__PURE__ */ c("div", {
|
|
55
|
+
className: "flex items-center gap-2",
|
|
56
|
+
children: [/* @__PURE__ */ c(l, {
|
|
57
|
+
size: "sm",
|
|
58
|
+
variant: "outline",
|
|
59
|
+
onClick: async () => {
|
|
60
|
+
if (p) {
|
|
61
|
+
g({
|
|
62
|
+
busy: !0,
|
|
63
|
+
message: "Preparing export…",
|
|
64
|
+
error: !1
|
|
65
|
+
});
|
|
66
|
+
try {
|
|
67
|
+
let e = a ? { projectId: a } : void 0, r = [], i = null, o = 0;
|
|
68
|
+
for (let t = 0; t < f; t++) {
|
|
69
|
+
let t = await m.query({
|
|
70
|
+
query: u,
|
|
71
|
+
variables: {
|
|
72
|
+
workspaceId: p,
|
|
73
|
+
filter: e,
|
|
74
|
+
after: i
|
|
75
|
+
},
|
|
76
|
+
fetchPolicy: "network-only"
|
|
77
|
+
});
|
|
78
|
+
if (t.error) throw t.error;
|
|
79
|
+
let n = t.data?.planmagnetWorkItems;
|
|
80
|
+
if (!n) throw Error("The work items could not be read.");
|
|
81
|
+
if (o = n.totalCount, r.push(...n.items), !n.pageInfo.hasNextPage || !n.pageInfo.endCursor) break;
|
|
82
|
+
i = n.pageInfo.endCursor;
|
|
83
|
+
}
|
|
84
|
+
if (r.length < o) throw Error(`Only ${r.length} of ${o} work items could be read; nothing was exported.`);
|
|
85
|
+
let s = await m.query({
|
|
86
|
+
query: d,
|
|
87
|
+
variables: { workspaceId: p },
|
|
88
|
+
fetchPolicy: "network-only"
|
|
89
|
+
}), c = new Map((s.data?.planmagnetProjects.items ?? []).map((e) => [e.id, e.name]));
|
|
90
|
+
t(`planmagnet-work-items-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, n(r, c)), g({
|
|
91
|
+
busy: !1,
|
|
92
|
+
message: `Exported ${r.length} work items.`,
|
|
93
|
+
error: !1
|
|
94
|
+
});
|
|
95
|
+
} catch (e) {
|
|
96
|
+
g({
|
|
97
|
+
busy: !1,
|
|
98
|
+
message: e instanceof Error ? e.message : "The export failed.",
|
|
99
|
+
error: !0
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
disabled: h.busy,
|
|
105
|
+
"data-testid": "export-work-items",
|
|
106
|
+
children: [/* @__PURE__ */ s(i, { className: "mr-1 h-4 w-4" }), h.busy ? "Exporting…" : "Export CSV"]
|
|
107
|
+
}), h.message && /* @__PURE__ */ s("span", {
|
|
108
|
+
role: h.error ? "alert" : "status",
|
|
109
|
+
className: `text-xs ${h.error ? "text-destructive" : "text-muted-foreground"}`,
|
|
110
|
+
children: h.message
|
|
111
|
+
})]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
export { p as ExportWorkItemsButton };
|
|
116
|
+
|
|
117
|
+
//# sourceMappingURL=ExportWorkItemsButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportWorkItemsButton.js","names":[],"sources":["../../../src/planmagnet/export/ExportWorkItemsButton.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useApolloClient } from '@apollo/client/react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { Download } from 'lucide-react';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\nimport { downloadCsv, type ExportableWorkItem, workItemsCsv } from './workItemsCsv';\n\nconst PAGE = gql`\n query ExportWorkItemsPage($workspaceId: ID!, $filter: PlanmagnetWorkItemFilter, $after: String) {\n planmagnetWorkItems(\n workspaceId: $workspaceId\n filter: $filter\n pagination: { first: 100, after: $after }\n ) {\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n items {\n key\n title\n type\n status\n priority\n storyPoints\n assigneeId\n projectId\n sprintId\n dueDate\n createdAt\n updatedAt\n }\n }\n }\n`;\ninterface WorkItemsPage {\n planmagnetWorkItems: {\n totalCount: number;\n pageInfo: { hasNextPage: boolean; endCursor: string | null };\n items: ExportableWorkItem[];\n };\n}\n\nconst PROJECTS = gql`\n query ExportWorkItemsProjects($workspaceId: ID!) {\n planmagnetProjects(workspaceId: $workspaceId, pagination: { first: 100 }) {\n items {\n id\n name\n }\n }\n }\n`;\n\n/** Every page, not just the first 100 — an export that silently stops at a page is worse than none. */\nconst MAX_PAGES = 200;\n\nexport function ExportWorkItemsButton({ projectId }: { projectId?: string }) {\n const { workspaceId } = usePlanMagnet();\n const client = useApolloClient();\n const [state, setState] = useState<{ busy: boolean; message: string | null; error: boolean }>({\n busy: false,\n message: null,\n error: false,\n });\n\n const run = async () => {\n if (!workspaceId) return;\n setState({ busy: true, message: 'Preparing export…', error: false });\n try {\n const filter = projectId ? { projectId } : undefined;\n const items: ExportableWorkItem[] = [];\n let after: string | null = null;\n let total = 0;\n for (let page = 0; page < MAX_PAGES; page++) {\n const result: Awaited<ReturnType<typeof client.query<WorkItemsPage>>> =\n await client.query<WorkItemsPage>({\n query: PAGE,\n variables: { workspaceId, filter, after },\n fetchPolicy: 'network-only',\n });\n if (result.error) throw result.error;\n const list: WorkItemsPage['planmagnetWorkItems'] | undefined =\n result.data?.planmagnetWorkItems;\n if (!list) throw new Error('The work items could not be read.');\n total = list.totalCount;\n items.push(...list.items);\n if (!list.pageInfo.hasNextPage || !list.pageInfo.endCursor) break;\n after = list.pageInfo.endCursor;\n }\n if (items.length < total) {\n throw new Error(\n `Only ${items.length} of ${total} work items could be read; nothing was exported.`\n );\n }\n const projects = await client.query<{\n planmagnetProjects: { items: Array<{ id: string; name: string }> };\n }>({\n query: PROJECTS,\n variables: { workspaceId },\n fetchPolicy: 'network-only',\n });\n const names = new Map(\n (projects.data?.planmagnetProjects.items ?? []).map((p) => [p.id, p.name])\n );\n const stamp = new Date().toISOString().slice(0, 10);\n downloadCsv(`planmagnet-work-items-${stamp}.csv`, workItemsCsv(items, names));\n setState({ busy: false, message: `Exported ${items.length} work items.`, error: false });\n } catch (e) {\n setState({\n busy: false,\n message: e instanceof Error ? e.message : 'The export failed.',\n error: true,\n });\n }\n };\n\n return (\n <div className=\"flex items-center gap-2\">\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={run}\n disabled={state.busy}\n data-testid=\"export-work-items\"\n >\n <Download className=\"mr-1 h-4 w-4\" />\n {state.busy ? 'Exporting…' : 'Export CSV'}\n </Button>\n {state.message && (\n <span\n role={state.error ? 'alert' : 'status'}\n className={`text-xs ${state.error ? 'text-destructive' : 'text-muted-foreground'}`}\n >\n {state.message}\n </span>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAQA,IAAM,IAAO,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCV,IAAW,CAAG;;;;;;;;;GAYd,IAAY;AAElB,SAAgB,EAAsB,EAAE,gBAAqC;CAC3E,IAAM,EAAE,mBAAgB,GAAe,EACjC,IAAS,GAAiB,EAC1B,CAAC,GAAO,KAAY,EAAoE;EAC5F,MAAM;EACN,SAAS;EACT,OAAO;EACR,CAAC;AAqDF,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GACE,MAAK;GACL,SAAQ;GACR,SAxDM,YAAY;AACjB,WACL;OAAS;MAAE,MAAM;MAAM,SAAS;MAAqB,OAAO;MAAO,CAAC;AACpE,SAAI;MACF,IAAM,IAAS,IAAY,EAAE,cAAW,GAAG,KAAA,GACrC,IAA8B,EAAE,EAClC,IAAuB,MACvB,IAAQ;AACZ,WAAK,IAAI,IAAO,GAAG,IAAO,GAAW,KAAQ;OAC3C,IAAM,IACJ,MAAM,EAAO,MAAqB;QAChC,OAAO;QACP,WAAW;SAAE;SAAa;SAAQ;SAAO;QACzC,aAAa;QACd,CAAC;AACJ,WAAI,EAAO,MAAO,OAAM,EAAO;OAC/B,IAAM,IACJ,EAAO,MAAM;AACf,WAAI,CAAC,EAAM,OAAU,MAAM,oCAAoC;AAG/D,WAFA,IAAQ,EAAK,YACb,EAAM,KAAK,GAAG,EAAK,MAAM,EACrB,CAAC,EAAK,SAAS,eAAe,CAAC,EAAK,SAAS,UAAW;AAC5D,WAAQ,EAAK,SAAS;;AAExB,UAAI,EAAM,SAAS,EACjB,OAAU,MACR,QAAQ,EAAM,OAAO,MAAM,EAAM,kDAClC;MAEH,IAAM,IAAW,MAAM,EAAO,MAE3B;OACD,OAAO;OACP,WAAW,EAAE,gBAAa;OAC1B,aAAa;OACd,CAAC,EACI,IAAQ,IAAI,KACf,EAAS,MAAM,mBAAmB,SAAS,EAAE,EAAE,KAAK,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAC3E;AAGD,MADA,EAAY,0CADE,IAAI,MAAM,EAAC,aAAa,CAAC,MAAM,GAAG,GAAG,CACR,OAAO,EAAa,GAAO,EAAM,CAAC,EAC7E,EAAS;OAAE,MAAM;OAAO,SAAS,YAAY,EAAM,OAAO;OAAe,OAAO;OAAO,CAAC;cACjF,GAAG;AACV,QAAS;OACP,MAAM;OACN,SAAS,aAAa,QAAQ,EAAE,UAAU;OAC1C,OAAO;OACR,CAAC;;;;GAUA,UAAU,EAAM;GAChB,eAAY;aALd,CAOE,kBAAC,GAAD,EAAU,WAAU,gBAAiB,CAAA,EACpC,EAAM,OAAO,eAAe,aACtB;MACR,EAAM,WACL,kBAAC,QAAD;GACE,MAAM,EAAM,QAAQ,UAAU;GAC9B,WAAW,WAAW,EAAM,QAAQ,qBAAqB;aAExD,EAAM;GACF,CAAA,CAEL"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Work items as CSV (P1.4 "data cannot leave the product").
|
|
3
|
+
*
|
|
4
|
+
* Built in the browser from the same API the pages use, so it exports exactly
|
|
5
|
+
* what the caller may read. The platform's Takeout-style export
|
|
6
|
+
* (wspace-export-svc) would need a PlanMagnet entity config in that shared
|
|
7
|
+
* service — held — so this is the in-product path.
|
|
8
|
+
*/
|
|
9
|
+
export interface ExportableWorkItem {
|
|
10
|
+
key: string;
|
|
11
|
+
title: string;
|
|
12
|
+
type: string;
|
|
13
|
+
status: string;
|
|
14
|
+
priority: string;
|
|
15
|
+
storyPoints: number | null;
|
|
16
|
+
assigneeId: string | null;
|
|
17
|
+
projectId: string;
|
|
18
|
+
sprintId: string | null;
|
|
19
|
+
dueDate: string | null;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* One CSV field. Quotes when needed (comma, quote, CR/LF) and neutralises
|
|
25
|
+
* spreadsheet formulas: a cell starting with = + - @ TAB or CR is executed by
|
|
26
|
+
* Excel/Sheets ("CSV injection"), so it is prefixed with a single quote.
|
|
27
|
+
*/
|
|
28
|
+
export declare function csvField(value: unknown): string;
|
|
29
|
+
export declare function workItemsCsv(items: ExportableWorkItem[], projectNames: Map<string, string>): string;
|
|
30
|
+
export declare function downloadCsv(filename: string, csv: string): void;
|
|
31
|
+
//# sourceMappingURL=workItemsCsv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workItemsCsv.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/export/workItemsCsv.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAmBD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAK/C;AAKD,wBAAgB,YAAY,CAC1B,KAAK,EAAE,kBAAkB,EAAE,EAC3B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,MAAM,CASR;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAS/D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region src/planmagnet/export/workItemsCsv.ts
|
|
2
|
+
var e = [
|
|
3
|
+
["Key", (e) => e.key],
|
|
4
|
+
["Title", (e) => e.title],
|
|
5
|
+
["Type", (e) => e.type],
|
|
6
|
+
["Status", (e) => e.status],
|
|
7
|
+
["Priority", (e) => e.priority],
|
|
8
|
+
["Story points", (e) => e.storyPoints],
|
|
9
|
+
["Project", (e, t) => t],
|
|
10
|
+
["Assignee ID", (e) => e.assigneeId],
|
|
11
|
+
["Sprint ID", (e) => e.sprintId],
|
|
12
|
+
["Due date", (e) => e.dueDate],
|
|
13
|
+
["Created", (e) => e.createdAt],
|
|
14
|
+
["Updated", (e) => e.updatedAt]
|
|
15
|
+
];
|
|
16
|
+
function t(e) {
|
|
17
|
+
if (e == null) return "";
|
|
18
|
+
let t = String(e);
|
|
19
|
+
return /^[=+\-@\t\r]/.test(t) && (t = `'${t}`), /[",\r\n]/.test(t) ? `"${t.replace(/"/g, "\"\"")}"` : t;
|
|
20
|
+
}
|
|
21
|
+
var n = "";
|
|
22
|
+
function r(r, i) {
|
|
23
|
+
return `${n}${[e.map(([e]) => t(e)).join(","), ...r.map((n) => e.map(([, e]) => t(e(n, i.get(n.projectId) ?? n.projectId))).join(","))].join("\r\n")}\r\n`;
|
|
24
|
+
}
|
|
25
|
+
function i(e, t) {
|
|
26
|
+
let n = URL.createObjectURL(new Blob([t], { type: "text/csv;charset=utf-8" })), r = document.createElement("a");
|
|
27
|
+
r.href = n, r.download = e, document.body.appendChild(r), r.click(), r.remove(), URL.revokeObjectURL(n);
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { i as downloadCsv, r as workItemsCsv };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=workItemsCsv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workItemsCsv.js","names":[],"sources":["../../../src/planmagnet/export/workItemsCsv.ts"],"sourcesContent":["/**\n * Work items as CSV (P1.4 \"data cannot leave the product\").\n *\n * Built in the browser from the same API the pages use, so it exports exactly\n * what the caller may read. The platform's Takeout-style export\n * (wspace-export-svc) would need a PlanMagnet entity config in that shared\n * service — held — so this is the in-product path.\n */\n\nexport interface ExportableWorkItem {\n key: string;\n title: string;\n type: string;\n status: string;\n priority: string;\n storyPoints: number | null;\n assigneeId: string | null;\n projectId: string;\n sprintId: string | null;\n dueDate: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nconst COLUMNS: Array<\n [header: string, value: (item: ExportableWorkItem, project: string) => unknown]\n> = [\n ['Key', (i) => i.key],\n ['Title', (i) => i.title],\n ['Type', (i) => i.type],\n ['Status', (i) => i.status],\n ['Priority', (i) => i.priority],\n ['Story points', (i) => i.storyPoints],\n ['Project', (_, project) => project],\n ['Assignee ID', (i) => i.assigneeId],\n ['Sprint ID', (i) => i.sprintId],\n ['Due date', (i) => i.dueDate],\n ['Created', (i) => i.createdAt],\n ['Updated', (i) => i.updatedAt],\n];\n\n/**\n * One CSV field. Quotes when needed (comma, quote, CR/LF) and neutralises\n * spreadsheet formulas: a cell starting with = + - @ TAB or CR is executed by\n * Excel/Sheets (\"CSV injection\"), so it is prefixed with a single quote.\n */\nexport function csvField(value: unknown): string {\n if (value === null || value === undefined) return '';\n let text = String(value);\n if (/^[=+\\-@\\t\\r]/.test(text)) text = `'${text}`;\n return /[\",\\r\\n]/.test(text) ? `\"${text.replace(/\"/g, '\"\"')}\"` : text;\n}\n\n/** Makes Excel read the file as UTF-8. */\nconst UTF8_BOM = String.fromCharCode(0xfeff);\n\nexport function workItemsCsv(\n items: ExportableWorkItem[],\n projectNames: Map<string, string>\n): string {\n const header = COLUMNS.map(([name]) => csvField(name)).join(',');\n const rows = items.map((item) =>\n COLUMNS.map(([, value]) =>\n csvField(value(item, projectNames.get(item.projectId) ?? item.projectId))\n ).join(',')\n );\n // CRLF per RFC 4180; the BOM makes Excel read UTF-8 correctly.\n return `${UTF8_BOM}${[header, ...rows].join('\\r\\n')}\\r\\n`;\n}\n\nexport function downloadCsv(filename: string, csv: string): void {\n const url = URL.createObjectURL(new Blob([csv], { type: 'text/csv;charset=utf-8' }));\n const link = document.createElement('a');\n link.href = url;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n link.remove();\n URL.revokeObjectURL(url);\n}\n"],"mappings":";AAwBA,IAAM,IAEF;CACF,CAAC,QAAQ,MAAM,EAAE,IAAI;CACrB,CAAC,UAAU,MAAM,EAAE,MAAM;CACzB,CAAC,SAAS,MAAM,EAAE,KAAK;CACvB,CAAC,WAAW,MAAM,EAAE,OAAO;CAC3B,CAAC,aAAa,MAAM,EAAE,SAAS;CAC/B,CAAC,iBAAiB,MAAM,EAAE,YAAY;CACtC,CAAC,YAAY,GAAG,MAAY,EAAQ;CACpC,CAAC,gBAAgB,MAAM,EAAE,WAAW;CACpC,CAAC,cAAc,MAAM,EAAE,SAAS;CAChC,CAAC,aAAa,MAAM,EAAE,QAAQ;CAC9B,CAAC,YAAY,MAAM,EAAE,UAAU;CAC/B,CAAC,YAAY,MAAM,EAAE,UAAU;CAChC;AAOD,SAAgB,EAAS,GAAwB;AAC/C,KAAI,KAAU,KAA6B,QAAO;CAClD,IAAI,IAAO,OAAO,EAAM;AAExB,QADI,eAAe,KAAK,EAAK,KAAE,IAAO,IAAI,MACnC,WAAW,KAAK,EAAK,GAAG,IAAI,EAAK,QAAQ,MAAM,OAAK,CAAC,KAAK;;AAInE,IAAM,IAAW;AAEjB,SAAgB,EACd,GACA,GACQ;AAQR,QAAO,GAAG,IAAW,CAPN,EAAQ,KAAK,CAAC,OAAU,EAAS,EAAK,CAAC,CAAC,KAAK,IAAI,EAOlC,GANjB,EAAM,KAAK,MACtB,EAAQ,KAAK,GAAG,OACd,EAAS,EAAM,GAAM,EAAa,IAAI,EAAK,UAAU,IAAI,EAAK,UAAU,CAAC,CAC1E,CAAC,KAAK,IAAI,CACZ,CAEqC,CAAC,KAAK,OAAO,CAAC;;AAGtD,SAAgB,EAAY,GAAkB,GAAmB;CAC/D,IAAM,IAAM,IAAI,gBAAgB,IAAI,KAAK,CAAC,EAAI,EAAE,EAAE,MAAM,0BAA0B,CAAC,CAAC,EAC9E,IAAO,SAAS,cAAc,IAAI;AAMxC,CALA,EAAK,OAAO,GACZ,EAAK,WAAW,GAChB,SAAS,KAAK,YAAY,EAAK,EAC/B,EAAK,OAAO,EACZ,EAAK,QAAQ,EACb,IAAI,gBAAgB,EAAI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductsReleaseDetailPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/ProductsReleaseDetailPagePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProductsReleaseDetailPagePage.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/pages/ProductsReleaseDetailPagePage.tsx"],"names":[],"mappings":"AA2DA,wBAAgB,6BAA6B,4CAgM5C"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { usePlanMagnet as e } from "../providers/PlanMagnetProvider.js";
|
|
2
2
|
import { PersonName as t } from "../people/People.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
3
|
+
import { ReleaseNotesCard as n } from "../releases/ReleaseNotesCard.js";
|
|
4
|
+
import { Calendar as r, Clock as i, GitBranch as a, Loader2 as o } from "lucide-react";
|
|
5
|
+
import { useParams as s } from "react-router";
|
|
6
|
+
import { gql as c } from "@apollo/client";
|
|
7
|
+
import { useQuery as l } from "@apollo/client/react";
|
|
8
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
|
+
import { Badge as f, Card as p, CardContent as m, CardHeader as h, CardTitle as g } from "@burdenoff/fe-libs/ui";
|
|
10
|
+
import { Markdown as _ } from "@burdenoff/fe-libs/shared/components";
|
|
10
11
|
//#region src/planmagnet/pages/ProductsReleaseDetailPagePage.tsx
|
|
11
|
-
var
|
|
12
|
+
var v = c`
|
|
12
13
|
query GetRelease($id: ID!) {
|
|
13
14
|
planmagnetRelease(id: $id) {
|
|
14
15
|
id
|
|
@@ -35,7 +36,7 @@ var _ = s`
|
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
|
-
`,
|
|
39
|
+
`, y = {
|
|
39
40
|
DRAFT: "bg-gray-100 text-gray-800",
|
|
40
41
|
PLANNING: "bg-yellow-100 text-yellow-800",
|
|
41
42
|
IN_PROGRESS: "bg-blue-100 text-blue-800",
|
|
@@ -44,89 +45,89 @@ var _ = s`
|
|
|
44
45
|
CANCELLED: "bg-red-100 text-red-800",
|
|
45
46
|
ROLLED_BACK: "bg-red-100 text-red-800"
|
|
46
47
|
};
|
|
47
|
-
function
|
|
48
|
-
let { workspaceId:
|
|
49
|
-
variables: { id:
|
|
50
|
-
skip: !
|
|
48
|
+
function b() {
|
|
49
|
+
let { workspaceId: c } = e(), b = s().id ?? "", { data: x, loading: S, error: C } = l(v, {
|
|
50
|
+
variables: { id: b },
|
|
51
|
+
skip: !b
|
|
51
52
|
});
|
|
52
|
-
if (
|
|
53
|
+
if (S) return /* @__PURE__ */ u("div", {
|
|
53
54
|
className: "flex items-center justify-center p-12",
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ u(o, { className: "h-8 w-8 animate-spin text-muted-foreground" })
|
|
55
56
|
});
|
|
56
|
-
if (
|
|
57
|
+
if (C) return /* @__PURE__ */ d("div", {
|
|
57
58
|
className: "p-6 text-destructive",
|
|
58
|
-
children: ["Failed to load release: ",
|
|
59
|
+
children: ["Failed to load release: ", C.message]
|
|
59
60
|
});
|
|
60
|
-
let
|
|
61
|
-
if (!
|
|
61
|
+
let w = x?.planmagnetRelease;
|
|
62
|
+
if (!w) return /* @__PURE__ */ u("div", {
|
|
62
63
|
className: "p-6 text-muted-foreground",
|
|
63
64
|
children: "Release not found."
|
|
64
65
|
});
|
|
65
|
-
let
|
|
66
|
-
return /* @__PURE__ */
|
|
66
|
+
let T = w.workItems ?? [], E = T.filter((e) => e.type === "STORY" || e.type === "FEATURE"), D = T.filter((e) => e.type === "BUG");
|
|
67
|
+
return /* @__PURE__ */ d("div", {
|
|
67
68
|
className: "space-y-6 p-6",
|
|
68
|
-
children: [/* @__PURE__ */
|
|
69
|
+
children: [/* @__PURE__ */ d("div", {
|
|
69
70
|
className: "flex items-center justify-between",
|
|
70
|
-
children: [/* @__PURE__ */
|
|
71
|
+
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("div", {
|
|
71
72
|
className: "flex items-center gap-2",
|
|
72
73
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ u(a, { className: "h-5 w-5 text-primary" }),
|
|
75
|
+
/* @__PURE__ */ u("h1", {
|
|
75
76
|
className: "text-2xl font-semibold",
|
|
76
|
-
children:
|
|
77
|
+
children: w.version
|
|
77
78
|
}),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
className: `text-xs px-2 py-0.5 rounded-full capitalize ${
|
|
80
|
-
children:
|
|
79
|
+
/* @__PURE__ */ u("span", {
|
|
80
|
+
className: `text-xs px-2 py-0.5 rounded-full capitalize ${y[w.status] ?? "bg-gray-100"}`,
|
|
81
|
+
children: w.status.toLowerCase().replace("_", " ")
|
|
81
82
|
})
|
|
82
83
|
]
|
|
83
|
-
}), /* @__PURE__ */
|
|
84
|
+
}), /* @__PURE__ */ u("p", {
|
|
84
85
|
className: "text-sm text-muted-foreground mt-1",
|
|
85
|
-
children:
|
|
86
|
-
})] }), /* @__PURE__ */
|
|
86
|
+
children: w.name
|
|
87
|
+
})] }), /* @__PURE__ */ u(f, {
|
|
87
88
|
variant: "outline",
|
|
88
89
|
className: "capitalize",
|
|
89
|
-
children:
|
|
90
|
+
children: w.status.toLowerCase().replace("_", " ")
|
|
90
91
|
})]
|
|
91
|
-
}), /* @__PURE__ */
|
|
92
|
+
}), /* @__PURE__ */ d("div", {
|
|
92
93
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
93
|
-
children: [/* @__PURE__ */
|
|
94
|
+
children: [/* @__PURE__ */ d("div", {
|
|
94
95
|
className: "lg:col-span-2 space-y-6",
|
|
95
96
|
children: [
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ d(p, { children: [/* @__PURE__ */ u(h, { children: /* @__PURE__ */ u(g, { children: "Overview" }) }), /* @__PURE__ */ d(m, {
|
|
97
98
|
className: "space-y-4",
|
|
98
|
-
children: [/* @__PURE__ */
|
|
99
|
+
children: [/* @__PURE__ */ u("div", {
|
|
99
100
|
className: "text-sm prose prose-sm dark:prose-invert max-w-none",
|
|
100
|
-
children:
|
|
101
|
-
}), /* @__PURE__ */
|
|
101
|
+
children: w.description ? /* @__PURE__ */ u(_, { children: w.description }) : /* @__PURE__ */ u("p", { children: "No description provided." })
|
|
102
|
+
}), /* @__PURE__ */ d("div", {
|
|
102
103
|
className: "grid grid-cols-3 gap-4",
|
|
103
104
|
children: [
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ d("div", {
|
|
105
106
|
className: "text-center p-3 bg-muted rounded-md",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
107
|
+
children: [/* @__PURE__ */ u("p", {
|
|
107
108
|
className: "text-lg font-semibold mt-1",
|
|
108
|
-
children:
|
|
109
|
-
}), /* @__PURE__ */
|
|
109
|
+
children: E.length
|
|
110
|
+
}), /* @__PURE__ */ u("p", {
|
|
110
111
|
className: "text-xs text-muted-foreground",
|
|
111
112
|
children: "Features"
|
|
112
113
|
})]
|
|
113
114
|
}),
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ d("div", {
|
|
115
116
|
className: "text-center p-3 bg-muted rounded-md",
|
|
116
|
-
children: [/* @__PURE__ */
|
|
117
|
+
children: [/* @__PURE__ */ u("p", {
|
|
117
118
|
className: "text-lg font-semibold mt-1",
|
|
118
|
-
children:
|
|
119
|
-
}), /* @__PURE__ */
|
|
119
|
+
children: D.length
|
|
120
|
+
}), /* @__PURE__ */ u("p", {
|
|
120
121
|
className: "text-xs text-muted-foreground",
|
|
121
122
|
children: "Bug Fixes"
|
|
122
123
|
})]
|
|
123
124
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ d("div", {
|
|
125
126
|
className: "text-center p-3 bg-muted rounded-md",
|
|
126
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ u("p", {
|
|
127
128
|
className: "text-lg font-semibold mt-1",
|
|
128
|
-
children:
|
|
129
|
-
}), /* @__PURE__ */
|
|
129
|
+
children: T.length
|
|
130
|
+
}), /* @__PURE__ */ u("p", {
|
|
130
131
|
className: "text-xs text-muted-foreground",
|
|
131
132
|
children: "Total Items"
|
|
132
133
|
})]
|
|
@@ -134,22 +135,22 @@ function y() {
|
|
|
134
135
|
]
|
|
135
136
|
})]
|
|
136
137
|
})] }),
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
})
|
|
141
|
-
|
|
138
|
+
/* @__PURE__ */ u(n, {
|
|
139
|
+
releaseId: w.id,
|
|
140
|
+
notes: w.releaseNotes ?? null
|
|
141
|
+
}),
|
|
142
|
+
T.length > 0 && /* @__PURE__ */ d(p, { children: [/* @__PURE__ */ u(h, { children: /* @__PURE__ */ d(g, { children: [
|
|
142
143
|
"Work Items (",
|
|
143
|
-
|
|
144
|
+
T.length,
|
|
144
145
|
")"
|
|
145
|
-
] }) }), /* @__PURE__ */
|
|
146
|
+
] }) }), /* @__PURE__ */ u(m, {
|
|
146
147
|
className: "space-y-2",
|
|
147
|
-
children:
|
|
148
|
+
children: T.map((e) => /* @__PURE__ */ d("div", {
|
|
148
149
|
className: "flex items-center justify-between border rounded-md p-3",
|
|
149
|
-
children: [/* @__PURE__ */
|
|
150
|
+
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("p", {
|
|
150
151
|
className: "text-sm font-medium",
|
|
151
152
|
children: e.title
|
|
152
|
-
}), /* @__PURE__ */
|
|
153
|
+
}), /* @__PURE__ */ d("p", {
|
|
153
154
|
className: "text-xs text-muted-foreground capitalize",
|
|
154
155
|
children: [
|
|
155
156
|
e.type.toLowerCase(),
|
|
@@ -157,7 +158,7 @@ function y() {
|
|
|
157
158
|
e.priority.toLowerCase(),
|
|
158
159
|
" priority"
|
|
159
160
|
]
|
|
160
|
-
})] }), /* @__PURE__ */
|
|
161
|
+
})] }), /* @__PURE__ */ u(f, {
|
|
161
162
|
variant: "outline",
|
|
162
163
|
className: "text-xs capitalize",
|
|
163
164
|
children: e.status.toLowerCase().replace("_", " ")
|
|
@@ -165,89 +166,89 @@ function y() {
|
|
|
165
166
|
}, e.id))
|
|
166
167
|
})] })
|
|
167
168
|
]
|
|
168
|
-
}), /* @__PURE__ */
|
|
169
|
+
}), /* @__PURE__ */ d("div", {
|
|
169
170
|
className: "space-y-6",
|
|
170
171
|
children: [
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ d(p, { children: [/* @__PURE__ */ u(h, { children: /* @__PURE__ */ u(g, { children: "Timeline" }) }), /* @__PURE__ */ d(m, {
|
|
172
173
|
className: "space-y-3 text-sm",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ d("div", {
|
|
174
175
|
className: "flex items-center gap-2",
|
|
175
176
|
children: [
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ u(r, { className: "h-4 w-4 text-muted-foreground" }),
|
|
178
|
+
/* @__PURE__ */ u("span", {
|
|
178
179
|
className: "text-muted-foreground",
|
|
179
180
|
children: "Planned:"
|
|
180
181
|
}),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ u("span", {
|
|
182
183
|
className: "font-medium",
|
|
183
|
-
children:
|
|
184
|
+
children: w.plannedDate ? new Date(w.plannedDate).toLocaleDateString() : "Not set"
|
|
184
185
|
})
|
|
185
186
|
]
|
|
186
|
-
}),
|
|
187
|
+
}), w.releasedAt && /* @__PURE__ */ d("div", {
|
|
187
188
|
className: "flex items-center gap-2",
|
|
188
189
|
children: [
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ u(i, { className: "h-4 w-4 text-green-500" }),
|
|
191
|
+
/* @__PURE__ */ u("span", {
|
|
191
192
|
className: "text-muted-foreground",
|
|
192
193
|
children: "Released:"
|
|
193
194
|
}),
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ u("span", {
|
|
195
196
|
className: "font-medium",
|
|
196
|
-
children: new Date(
|
|
197
|
+
children: new Date(w.releasedAt).toLocaleDateString()
|
|
197
198
|
})
|
|
198
199
|
]
|
|
199
200
|
})]
|
|
200
201
|
})] }),
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ d(p, { children: [/* @__PURE__ */ u(h, { children: /* @__PURE__ */ u(g, { children: "Details" }) }), /* @__PURE__ */ d(m, {
|
|
202
203
|
className: "space-y-2 text-sm",
|
|
203
204
|
children: [
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ d("div", {
|
|
205
206
|
className: "flex justify-between",
|
|
206
|
-
children: [/* @__PURE__ */
|
|
207
|
+
children: [/* @__PURE__ */ u("span", {
|
|
207
208
|
className: "text-muted-foreground",
|
|
208
209
|
children: "Version"
|
|
209
|
-
}), /* @__PURE__ */
|
|
210
|
+
}), /* @__PURE__ */ u("span", {
|
|
210
211
|
className: "font-medium",
|
|
211
|
-
children:
|
|
212
|
+
children: w.version
|
|
212
213
|
})]
|
|
213
214
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ d("div", {
|
|
215
216
|
className: "flex justify-between",
|
|
216
|
-
children: [/* @__PURE__ */
|
|
217
|
+
children: [/* @__PURE__ */ u("span", {
|
|
217
218
|
className: "text-muted-foreground",
|
|
218
219
|
children: "Status"
|
|
219
|
-
}), /* @__PURE__ */
|
|
220
|
+
}), /* @__PURE__ */ u(f, {
|
|
220
221
|
variant: "outline",
|
|
221
222
|
className: "text-xs capitalize",
|
|
222
|
-
children:
|
|
223
|
+
children: w.status.toLowerCase().replace("_", " ")
|
|
223
224
|
})]
|
|
224
225
|
}),
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ d("div", {
|
|
226
227
|
className: "flex justify-between",
|
|
227
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ u("span", {
|
|
228
229
|
className: "text-muted-foreground",
|
|
229
230
|
children: "Owner"
|
|
230
|
-
}), /* @__PURE__ */
|
|
231
|
+
}), /* @__PURE__ */ u("span", { children: /* @__PURE__ */ u(t, { id: w.ownerId }) })]
|
|
231
232
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ d("div", {
|
|
233
234
|
className: "flex justify-between",
|
|
234
|
-
children: [/* @__PURE__ */
|
|
235
|
+
children: [/* @__PURE__ */ u("span", {
|
|
235
236
|
className: "text-muted-foreground",
|
|
236
237
|
children: "Created"
|
|
237
|
-
}), /* @__PURE__ */
|
|
238
|
+
}), /* @__PURE__ */ u("span", { children: new Date(w.createdAt).toLocaleDateString() })]
|
|
238
239
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ d("div", {
|
|
240
241
|
className: "flex justify-between",
|
|
241
|
-
children: [/* @__PURE__ */
|
|
242
|
+
children: [/* @__PURE__ */ u("span", {
|
|
242
243
|
className: "text-muted-foreground",
|
|
243
244
|
children: "Updated"
|
|
244
|
-
}), /* @__PURE__ */
|
|
245
|
+
}), /* @__PURE__ */ u("span", { children: new Date(w.updatedAt).toLocaleDateString() })]
|
|
245
246
|
})
|
|
246
247
|
]
|
|
247
248
|
})] }),
|
|
248
|
-
|
|
249
|
+
w.tags?.length > 0 && /* @__PURE__ */ d(p, { children: [/* @__PURE__ */ u(h, { children: /* @__PURE__ */ u(g, { children: "Tags" }) }), /* @__PURE__ */ u(m, {
|
|
249
250
|
className: "flex flex-wrap gap-1",
|
|
250
|
-
children:
|
|
251
|
+
children: w.tags.map((e) => /* @__PURE__ */ u(f, {
|
|
251
252
|
variant: "outline",
|
|
252
253
|
className: "text-xs",
|
|
253
254
|
children: e
|
|
@@ -259,6 +260,6 @@ function y() {
|
|
|
259
260
|
});
|
|
260
261
|
}
|
|
261
262
|
//#endregion
|
|
262
|
-
export {
|
|
263
|
+
export { b as ProductsReleaseDetailPagePage };
|
|
263
264
|
|
|
264
265
|
//# sourceMappingURL=ProductsReleaseDetailPagePage.js.map
|