@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.
@@ -0,0 +1,101 @@
1
+ import { throwOnError as e } from "../utils/mutationResult.js";
2
+ import { useState as t } from "react";
3
+ import { FileText as n } from "lucide-react";
4
+ import { gql as r } from "@apollo/client";
5
+ import { useMutation as i } from "@apollo/client/react";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
+ import { AlertDialog as s, AlertDialogAction as c, AlertDialogCancel as l, AlertDialogContent as u, AlertDialogDescription as d, AlertDialogFooter as f, AlertDialogHeader as p, AlertDialogTitle as m, AlertDialogTrigger as h, Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b } from "@burdenoff/fe-libs/ui";
8
+ import { Markdown as x } from "@burdenoff/fe-libs/shared/components";
9
+ //#region src/planmagnet/releases/ReleaseNotesCard.tsx
10
+ var S = r`
11
+ mutation ReleaseNotesGenerate($id: ID!) {
12
+ planmagnetGenerateReleaseNotes(id: $id, persist: true) {
13
+ markdown
14
+ counts {
15
+ total
16
+ features
17
+ bugFixes
18
+ improvements
19
+ other
20
+ }
21
+ }
22
+ }
23
+ `;
24
+ function C({ releaseId: r, notes: C }) {
25
+ let [w, T] = t(null), [E, D] = t(null), [O, { loading: k }] = i(S, {
26
+ refetchQueries: ["GetRelease"],
27
+ awaitRefetchQueries: !0
28
+ }), A = async () => {
29
+ T(null);
30
+ try {
31
+ D((await e(O({ variables: { id: r } }))).data?.planmagnetGenerateReleaseNotes.counts ?? null);
32
+ } catch (e) {
33
+ T(e instanceof Error ? e.message : "The release notes could not be generated.");
34
+ }
35
+ };
36
+ return /* @__PURE__ */ o(_, {
37
+ "data-testid": "release-notes",
38
+ children: [/* @__PURE__ */ o(y, {
39
+ className: "flex flex-row items-center justify-between space-y-0",
40
+ children: [/* @__PURE__ */ a(b, { children: "Release Notes" }), C ? /* @__PURE__ */ o(s, { children: [/* @__PURE__ */ a(h, {
41
+ asChild: !0,
42
+ children: /* @__PURE__ */ a(g, {
43
+ size: "sm",
44
+ variant: "outline",
45
+ disabled: k,
46
+ children: k ? "Generating…" : "Regenerate"
47
+ })
48
+ }), /* @__PURE__ */ o(u, { children: [/* @__PURE__ */ o(p, { children: [/* @__PURE__ */ a(m, { children: "Replace the release notes?" }), /* @__PURE__ */ a(d, { children: "The current notes are replaced by notes generated from the release's completed work items. Hand edits are lost." })] }), /* @__PURE__ */ o(f, { children: [/* @__PURE__ */ a(l, { children: "Keep them" }), /* @__PURE__ */ a(c, {
49
+ onClick: A,
50
+ children: "Regenerate"
51
+ })] })] })] }) : /* @__PURE__ */ o(g, {
52
+ size: "sm",
53
+ onClick: A,
54
+ disabled: k,
55
+ "data-testid": "release-notes-generate",
56
+ children: [/* @__PURE__ */ a(n, { className: "mr-1 h-4 w-4" }), k ? "Generating…" : "Generate release notes"]
57
+ })]
58
+ }), /* @__PURE__ */ o(v, {
59
+ className: "space-y-3",
60
+ children: [
61
+ w && /* @__PURE__ */ a("p", {
62
+ role: "alert",
63
+ className: "text-sm text-destructive",
64
+ children: w
65
+ }),
66
+ E && /* @__PURE__ */ o("p", {
67
+ className: "text-xs text-muted-foreground",
68
+ "data-testid": "release-notes-counts",
69
+ children: [
70
+ "Generated from ",
71
+ E.total,
72
+ " completed work item",
73
+ E.total === 1 ? "" : "s",
74
+ ":",
75
+ " ",
76
+ E.features,
77
+ " features, ",
78
+ E.bugFixes,
79
+ " bug fixes, ",
80
+ E.improvements,
81
+ " ",
82
+ "improvements, ",
83
+ E.other,
84
+ " other."
85
+ ]
86
+ }),
87
+ C ? /* @__PURE__ */ a("div", {
88
+ className: "text-sm prose prose-sm dark:prose-invert max-w-none",
89
+ children: /* @__PURE__ */ a(x, { children: C })
90
+ }) : /* @__PURE__ */ a("p", {
91
+ className: "text-sm text-muted-foreground",
92
+ children: "No release notes yet. Generate them from this release's completed work items."
93
+ })
94
+ ]
95
+ })]
96
+ });
97
+ }
98
+ //#endregion
99
+ export { C as ReleaseNotesCard };
100
+
101
+ //# sourceMappingURL=ReleaseNotesCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReleaseNotesCard.js","names":[],"sources":["../../../src/planmagnet/releases/ReleaseNotesCard.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation } from '@apollo/client/react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n Button,\n Card,\n CardContent,\n CardHeader,\n CardTitle,\n} from '@burdenoff/fe-libs/ui';\nimport { Markdown } from '@burdenoff/fe-libs/shared/components';\nimport { FileText } from 'lucide-react';\nimport { throwOnError } from '../utils/mutationResult';\n\n/**\n * Release notes (P1.4). planmagnetGenerateReleaseNotes was verified to be real\n * generation (the release's closed work items, grouped) but no UI invoked it,\n * and this card only appeared once notes already existed, so there was nothing\n * to click on a new release.\n */\n\nconst GENERATE = gql`\n mutation ReleaseNotesGenerate($id: ID!) {\n planmagnetGenerateReleaseNotes(id: $id, persist: true) {\n markdown\n counts {\n total\n features\n bugFixes\n improvements\n other\n }\n }\n }\n`;\n\ninterface Counts {\n total: number;\n features: number;\n bugFixes: number;\n improvements: number;\n other: number;\n}\n\nexport function ReleaseNotesCard({\n releaseId,\n notes,\n}: {\n releaseId: string;\n notes: string | null;\n}) {\n const [error, setError] = useState<string | null>(null);\n const [counts, setCounts] = useState<Counts | null>(null);\n const [generate, { loading }] = useMutation<{\n planmagnetGenerateReleaseNotes: { markdown: string; counts: Counts };\n }>(GENERATE, { refetchQueries: ['GetRelease'], awaitRefetchQueries: true });\n\n const run = async () => {\n setError(null);\n try {\n const result = await throwOnError(generate({ variables: { id: releaseId } }));\n setCounts(result.data?.planmagnetGenerateReleaseNotes.counts ?? null);\n } catch (e) {\n setError(e instanceof Error ? e.message : 'The release notes could not be generated.');\n }\n };\n\n const action = notes ? (\n // Regenerating replaces the saved notes, including any hand edits.\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button size=\"sm\" variant=\"outline\" disabled={loading}>\n {loading ? 'Generating…' : 'Regenerate'}\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Replace the release notes?</AlertDialogTitle>\n <AlertDialogDescription>\n The current notes are replaced by notes generated from the release&apos;s completed work\n items. Hand edits are lost.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Keep them</AlertDialogCancel>\n <AlertDialogAction onClick={run}>Regenerate</AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n ) : (\n <Button size=\"sm\" onClick={run} disabled={loading} data-testid=\"release-notes-generate\">\n <FileText className=\"mr-1 h-4 w-4\" />\n {loading ? 'Generating…' : 'Generate release notes'}\n </Button>\n );\n\n return (\n <Card data-testid=\"release-notes\">\n <CardHeader className=\"flex flex-row items-center justify-between space-y-0\">\n <CardTitle>Release Notes</CardTitle>\n {action}\n </CardHeader>\n <CardContent className=\"space-y-3\">\n {error && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {error}\n </p>\n )}\n {counts && (\n <p className=\"text-xs text-muted-foreground\" data-testid=\"release-notes-counts\">\n Generated from {counts.total} completed work item{counts.total === 1 ? '' : 's'}:{' '}\n {counts.features} features, {counts.bugFixes} bug fixes, {counts.improvements}{' '}\n improvements, {counts.other} other.\n </p>\n )}\n {notes ? (\n <div className=\"text-sm prose prose-sm dark:prose-invert max-w-none\">\n <Markdown>{notes}</Markdown>\n </div>\n ) : (\n <p className=\"text-sm text-muted-foreground\">\n No release notes yet. Generate them from this release&apos;s completed work items.\n </p>\n )}\n </CardContent>\n </Card>\n );\n}\n"],"mappings":";;;;;;;;;AA8BA,IAAM,IAAW,CAAG;;;;;;;;;;;;;;AAuBpB,SAAgB,EAAiB,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GAAD;GAAa,WAAU;aAAvB;IACG,KACC,kBAAC,KAAD;KAAG,MAAK;KAAQ,WAAU;eACvB;KACC,CAAA;IAEL,KACC,kBAAC,KAAD;KAAG,WAAU;KAAgC,eAAY;eAAzD;MAAgF;MAC9D,EAAO;MAAM;MAAqB,EAAO,UAAU,IAAI,KAAK;MAAI;MAAE;MACjF,EAAO;MAAS;MAAY,EAAO;MAAS;MAAa,EAAO;MAAc;MAAI;MACpE,EAAO;MAAM;MAC1B;;IAEL,IACC,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD,EAAA,UAAW,GAAiB,CAAA;KACxB,CAAA,GAEN,kBAAC,KAAD;KAAG,WAAU;eAAgC;KAEzC,CAAA;IAEM;KACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-planmagnet",
3
- "version": "2026.925.11",
3
+ "version": "2026.925.13",
4
4
  "description": "Burdenoff PlanMagnet Microfrontend",
5
5
  "type": "module",
6
6
  "files": [