@burdenoff/microfe-planmagnet 2026.1123.2 → 2026.1126.1

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.
@@ -914,6 +914,7 @@ export type Mutation = {
914
914
  planmagnetCreateProject: PlanmagnetProject;
915
915
  /** Create a new project template */
916
916
  planmagnetCreateProjectTemplate: ProjectTemplate;
917
+ planmagnetCreateProjectTemplateRecord: PlanmagnetProjectTemplate;
917
918
  /** Create a new quality gate */
918
919
  planmagnetCreateQualityGate: QualityGate;
919
920
  /** Create a new release */
@@ -938,6 +939,7 @@ export type Mutation = {
938
939
  planmagnetCreateTeam: Team;
939
940
  /** Create a template from an existing project */
940
941
  planmagnetCreateTemplateFromProject: ProjectTemplate;
942
+ planmagnetCreateTemplateRecordFromProject: PlanmagnetProjectTemplate;
941
943
  /** Create a new time entry */
942
944
  planmagnetCreateTimeEntry: PlanmagnetTimeEntry;
943
945
  /** Create a new timesheet */
@@ -1557,6 +1559,7 @@ export type Mutation = {
1557
1559
  planmagnetUpdateProject: PlanmagnetProject;
1558
1560
  /** Update an existing project template */
1559
1561
  planmagnetUpdateProjectTemplate: ProjectTemplate;
1562
+ planmagnetUpdateProjectTemplateRecord: PlanmagnetProjectTemplate;
1560
1563
  /** Change a project's workflow */
1561
1564
  planmagnetUpdateProjectWorkflow: PlanmagnetProjectWorkflow;
1562
1565
  /** Update an existing quality gate */
@@ -1803,6 +1806,9 @@ export type MutationPlanmagnetCreateProjectArgs = {
1803
1806
  export type MutationPlanmagnetCreateProjectTemplateArgs = {
1804
1807
  input: PlanmagnetCreateProjectTemplateInput;
1805
1808
  };
1809
+ export type MutationPlanmagnetCreateProjectTemplateRecordArgs = {
1810
+ input: PlanmagnetCreateProjectTemplateInput;
1811
+ };
1806
1812
  export type MutationPlanmagnetCreateQualityGateArgs = {
1807
1813
  input: PlanmagnetCreateQualityGateInput;
1808
1814
  };
@@ -1841,6 +1847,11 @@ export type MutationPlanmagnetCreateTemplateFromProjectArgs = {
1841
1847
  name: Scalars['String']['input'];
1842
1848
  projectId: Scalars['ID']['input'];
1843
1849
  };
1850
+ export type MutationPlanmagnetCreateTemplateRecordFromProjectArgs = {
1851
+ description?: InputMaybe<Scalars['String']['input']>;
1852
+ name: Scalars['String']['input'];
1853
+ projectId: Scalars['ID']['input'];
1854
+ };
1844
1855
  export type MutationPlanmagnetCreateTimeEntryArgs = {
1845
1856
  input: PlanmagnetCreateTimeEntryInput;
1846
1857
  };
@@ -2482,6 +2493,10 @@ export type MutationPlanmagnetUpdateProjectTemplateArgs = {
2482
2493
  id: Scalars['ID']['input'];
2483
2494
  input: PlanmagnetUpdateProjectTemplateInput;
2484
2495
  };
2496
+ export type MutationPlanmagnetUpdateProjectTemplateRecordArgs = {
2497
+ id: Scalars['ID']['input'];
2498
+ input: PlanmagnetUpdateProjectTemplateInput;
2499
+ };
2485
2500
  export type MutationPlanmagnetUpdateProjectWorkflowArgs = {
2486
2501
  input: PlanmagnetUpdateProjectWorkflowInput;
2487
2502
  projectId: Scalars['ID']['input'];
@@ -6506,6 +6521,52 @@ export declare enum PlanmagnetProjectStatus {
6506
6521
  OnHold = "ON_HOLD",
6507
6522
  Planning = "PLANNING"
6508
6523
  }
6524
+ /** Project template types for consumers migrating to prefixed federation entities. */
6525
+ export type PlanmagnetProjectTemplate = {
6526
+ __typename?: 'PlanmagnetProjectTemplate';
6527
+ /** Board layout configuration */
6528
+ boardConfig?: Maybe<Scalars['JSON']['output']>;
6529
+ /** Template category */
6530
+ category?: Maybe<Scalars['String']['output']>;
6531
+ /** Template configuration (JSON - project settings, work item types, etc.) */
6532
+ configuration: Scalars['JSON']['output'];
6533
+ /** Context information */
6534
+ context?: Maybe<Scalars['JSON']['output']>;
6535
+ /** Creation timestamp */
6536
+ createdAt: Scalars['DateTime']['output'];
6537
+ /** Actor who created this template */
6538
+ createdBy: Scalars['String']['output'];
6539
+ /** Custom field definitions to create */
6540
+ customFieldsConfig?: Maybe<Scalars['JSON']['output']>;
6541
+ /** Soft-delete timestamp */
6542
+ deletedAt?: Maybe<Scalars['DateTime']['output']>;
6543
+ /** Template description */
6544
+ description?: Maybe<Scalars['String']['output']>;
6545
+ /** Unique identifier */
6546
+ id: Scalars['ID']['output'];
6547
+ /** Whether this is a built-in system template */
6548
+ isBuiltIn: Scalars['Boolean']['output'];
6549
+ /** Whether this template is published and available */
6550
+ isPublished: Scalars['Boolean']['output'];
6551
+ /** Arbitrary metadata */
6552
+ metadata?: Maybe<Scalars['JSON']['output']>;
6553
+ /** Template name */
6554
+ name: Scalars['String']['output'];
6555
+ /** Actor on whose behalf this was created */
6556
+ onBehalfOf?: Maybe<Scalars['String']['output']>;
6557
+ /** Default sprint configuration */
6558
+ sprintConfig?: Maybe<Scalars['JSON']['output']>;
6559
+ /** Tags for categorization */
6560
+ tags: Array<Scalars['String']['output']>;
6561
+ /** Last update timestamp */
6562
+ updatedAt: Scalars['DateTime']['output'];
6563
+ /** Actor who last updated this template */
6564
+ updatedBy?: Maybe<Scalars['String']['output']>;
6565
+ /** Number of times this template has been applied */
6566
+ usageCount: Scalars['Int']['output'];
6567
+ /** Associated workspace ID */
6568
+ workspaceId: Scalars['String']['output'];
6569
+ };
6509
6570
  export type PlanmagnetProjectTemplateFilter = {
6510
6571
  category?: InputMaybe<Scalars['String']['input']>;
6511
6572
  isBuiltIn?: InputMaybe<Scalars['Boolean']['input']>;
@@ -6518,6 +6579,12 @@ export type PlanmagnetProjectTemplateList = {
6518
6579
  pageInfo: PlanmagnetPageInfo;
6519
6580
  totalCount: Scalars['Int']['output'];
6520
6581
  };
6582
+ export type PlanmagnetProjectTemplateRecordList = {
6583
+ __typename?: 'PlanmagnetProjectTemplateRecordList';
6584
+ items: Array<PlanmagnetProjectTemplate>;
6585
+ pageInfo: PlanmagnetPageInfo;
6586
+ totalCount: Scalars['Int']['output'];
6587
+ };
6521
6588
  /**
6522
6589
  * One project's slice of the work breakdown. `open`/`done` above are totals across EVERY live work item in the
6523
6590
  * project (every type, epics themselves included) — the epic rollups below are a further breakdown of that same
@@ -7089,6 +7156,36 @@ export type PlanmagnetReviewQualityGateInput = {
7089
7156
  reviewNotes?: InputMaybe<Scalars['String']['input']>;
7090
7157
  status: QualityGateStatus;
7091
7158
  };
7159
+ /** The PlanMagnet-owned risk entity for clients adopting prefixed type names. */
7160
+ export type PlanmagnetRisk = {
7161
+ __typename?: 'PlanmagnetRisk';
7162
+ category?: Maybe<Scalars['String']['output']>;
7163
+ context?: Maybe<Scalars['JSON']['output']>;
7164
+ contingencyPlan?: Maybe<Scalars['String']['output']>;
7165
+ createdAt: Scalars['DateTime']['output'];
7166
+ createdBy: Scalars['String']['output'];
7167
+ deletedAt?: Maybe<Scalars['DateTime']['output']>;
7168
+ description?: Maybe<Scalars['String']['output']>;
7169
+ dueDate?: Maybe<Scalars['DateTime']['output']>;
7170
+ id: Scalars['ID']['output'];
7171
+ impact: Scalars['Int']['output'];
7172
+ likelihood: Scalars['Int']['output'];
7173
+ metadata?: Maybe<Scalars['JSON']['output']>;
7174
+ mitigationPlan?: Maybe<Scalars['String']['output']>;
7175
+ onBehalfOf?: Maybe<Scalars['String']['output']>;
7176
+ ownerId?: Maybe<Scalars['String']['output']>;
7177
+ project?: Maybe<PlanmagnetProject>;
7178
+ projectId: Scalars['String']['output'];
7179
+ resolvedAt?: Maybe<Scalars['DateTime']['output']>;
7180
+ riskScore: Scalars['Int']['output'];
7181
+ severity: RiskSeverity;
7182
+ status: RiskStatus;
7183
+ tags: Array<Scalars['String']['output']>;
7184
+ title: Scalars['String']['output'];
7185
+ updatedAt: Scalars['DateTime']['output'];
7186
+ updatedBy?: Maybe<Scalars['String']['output']>;
7187
+ workspaceId: Scalars['String']['output'];
7188
+ };
7092
7189
  /**
7093
7190
  * Sum of likelihood x impact over the project's OPEN risks (status not RESOLVED/CLOSED), with the top 3
7094
7191
  * by exposure.
@@ -7189,6 +7286,12 @@ export type PlanmagnetRiskMatrix = {
7189
7286
  /** Total number of risks */
7190
7287
  totalRisks: Scalars['Int']['output'];
7191
7288
  };
7289
+ export type PlanmagnetRiskRecordList = {
7290
+ __typename?: 'PlanmagnetRiskRecordList';
7291
+ items: Array<PlanmagnetRisk>;
7292
+ pageInfo: PlanmagnetPageInfo;
7293
+ totalCount: Scalars['Int']['output'];
7294
+ };
7192
7295
  /**
7193
7296
  * A comment on a roadmap, or on one specific item of it (PRM-11). Visible to
7194
7297
  * everyone who can read the roadmap; only its author can edit or delete it —
@@ -10117,6 +10220,8 @@ export type Query = {
10117
10220
  planmagnetProjectRiskSummary: PlanmagnetProjectRiskSummary;
10118
10221
  /** Get a single project template by ID */
10119
10222
  planmagnetProjectTemplate?: Maybe<ProjectTemplate>;
10223
+ planmagnetProjectTemplateRecord?: Maybe<PlanmagnetProjectTemplate>;
10224
+ planmagnetProjectTemplateRecords: PlanmagnetProjectTemplateRecordList;
10120
10225
  /** List project templates in a workspace */
10121
10226
  planmagnetProjectTemplates: PlanmagnetProjectTemplateList;
10122
10227
  /** A project's workflow */
@@ -10173,6 +10278,10 @@ export type Query = {
10173
10278
  planmagnetRisk?: Maybe<Risk>;
10174
10279
  /** Get the risk matrix for a project */
10175
10280
  planmagnetRiskMatrix: PlanmagnetRiskMatrix;
10281
+ /** Read one risk using the prefixed entity. */
10282
+ planmagnetRiskRecord?: Maybe<PlanmagnetRisk>;
10283
+ /** List workspace risks using the prefixed entity. */
10284
+ planmagnetRiskRecords: PlanmagnetRiskRecordList;
10176
10285
  /** List risks in a workspace */
10177
10286
  planmagnetRisks: PlanmagnetRiskList;
10178
10287
  /** Get a single roadmap by ID */
@@ -10699,6 +10808,14 @@ export type QueryPlanmagnetProjectRiskSummaryArgs = {
10699
10808
  export type QueryPlanmagnetProjectTemplateArgs = {
10700
10809
  id: Scalars['ID']['input'];
10701
10810
  };
10811
+ export type QueryPlanmagnetProjectTemplateRecordArgs = {
10812
+ id: Scalars['ID']['input'];
10813
+ };
10814
+ export type QueryPlanmagnetProjectTemplateRecordsArgs = {
10815
+ filter?: InputMaybe<PlanmagnetProjectTemplateFilter>;
10816
+ pagination?: InputMaybe<PlanmagnetPaginationInput>;
10817
+ workspaceId: Scalars['ID']['input'];
10818
+ };
10702
10819
  export type QueryPlanmagnetProjectTemplatesArgs = {
10703
10820
  filter?: InputMaybe<PlanmagnetProjectTemplateFilter>;
10704
10821
  pagination?: InputMaybe<PlanmagnetPaginationInput>;
@@ -10770,6 +10887,14 @@ export type QueryPlanmagnetRiskArgs = {
10770
10887
  export type QueryPlanmagnetRiskMatrixArgs = {
10771
10888
  projectId: Scalars['ID']['input'];
10772
10889
  };
10890
+ export type QueryPlanmagnetRiskRecordArgs = {
10891
+ id: Scalars['ID']['input'];
10892
+ };
10893
+ export type QueryPlanmagnetRiskRecordsArgs = {
10894
+ filter?: InputMaybe<PlanmagnetRiskFilter>;
10895
+ pagination?: InputMaybe<PlanmagnetPaginationInput>;
10896
+ workspaceId: Scalars['ID']['input'];
10897
+ };
10773
10898
  export type QueryPlanmagnetRisksArgs = {
10774
10899
  filter?: InputMaybe<PlanmagnetRiskFilter>;
10775
10900
  pagination?: InputMaybe<PlanmagnetPaginationInput>;
@@ -1,3 +1,22 @@
1
+ /** Rows per request. Well under the engine's cap of 100 so every request is one bounded page. */
2
+ export declare const WORKFLOW_PAGE_SIZE = 50;
3
+ /** How long the search box waits after the last keystroke before it asks the server. */
4
+ export declare const WORKFLOW_SEARCH_DEBOUNCE_MS = 300;
5
+ export interface WorkflowOption {
6
+ id: string;
7
+ name: string;
8
+ workflowKey: string;
9
+ version: string;
10
+ }
11
+ /** The variables for one page of active workflows. A blank search is no search. */
12
+ export declare function workflowPageInput(search: string, offset: number): {
13
+ search?: string | undefined;
14
+ status: string;
15
+ limit: number;
16
+ offset: number;
17
+ };
18
+ /** Appends a page to the rows already shown, dropping any row a shifted offset returns twice. */
19
+ export declare function appendWorkflowPage(shown: readonly WorkflowOption[], page: readonly WorkflowOption[]): WorkflowOption[];
1
20
  export declare function WorkflowSelect({ value, onChange, }: {
2
21
  value: string;
3
22
  onChange: (workflowDefinitionId: string) => void;
@@ -1,8 +1,9 @@
1
- import { gql as e } from "@apollo/client";
2
- import { useQuery as t } from "@apollo/client/react";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
1
+ import { useEffect as e, useState as t } from "react";
2
+ import { gql as n } from "@apollo/client";
3
+ import { useApolloClient as r, useQuery as i } from "@apollo/client/react";
4
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
4
5
  // src/planmagnet/automation/WorkflowSelect.tsx
5
- var i = e`
6
+ var s = n`
6
7
  query AutomationRunnableWorkflows($input: ListWorkflowDefinitionsInput!) {
7
8
  workflowDefinitions(input: $input) {
8
9
  items {
@@ -11,63 +12,136 @@ var i = e`
11
12
  workflowKey
12
13
  version
13
14
  }
14
- total
15
15
  hasMore
16
16
  }
17
17
  }
18
- `, a = 100, o = "w-full rounded-md border border-input bg-background px-3 py-2 text-sm disabled:opacity-60";
19
- function s({ value: e, onChange: s }) {
20
- let { data: c, loading: l, error: u } = t(i, {
21
- variables: { input: {
22
- status: "ACTIVE",
23
- limit: a,
24
- offset: 0
25
- } },
18
+ `, c = n`
19
+ query AutomationSelectedWorkflow($id: ID!) {
20
+ workflowDefinition(id: $id) {
21
+ id
22
+ name
23
+ workflowKey
24
+ version
25
+ status
26
+ }
27
+ }
28
+ `;
29
+ function l(e, t) {
30
+ let n = e.trim();
31
+ return {
32
+ status: "ACTIVE",
33
+ limit: 50,
34
+ offset: t,
35
+ ...n ? { search: n } : {}
36
+ };
37
+ }
38
+ function u(e, t) {
39
+ let n = new Set(e.map((e) => e.id));
40
+ return [...e, ...t.filter((e) => !n.has(e.id))];
41
+ }
42
+ var d = "w-full rounded-md border border-input bg-background px-3 py-2 text-sm disabled:opacity-60", f = "w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground", p = "rounded-md border border-input bg-background px-2 py-1 text-xs hover:bg-muted disabled:opacity-60";
43
+ function m(n, r) {
44
+ let [i, a] = t(n);
45
+ return e(() => {
46
+ let e = setTimeout(() => a(n), r);
47
+ return () => clearTimeout(e);
48
+ }, [n, r]), i;
49
+ }
50
+ function h({ value: e, onChange: n }) {
51
+ let h = r(), [g, _] = t(""), v = m(g, 300).trim(), [y, b] = t(null), [x, S] = t(!1), [C, w] = t(null), { data: T, loading: E, error: D } = i(s, {
52
+ variables: { input: l(v, 0) },
26
53
  fetchPolicy: "cache-and-network"
27
- }), d = c?.workflowDefinitions.items ?? [], f = e === "" || d.some((t) => t.id === e);
28
- return /* @__PURE__ */ r("div", {
54
+ }), O = y && y.search === v ? y : null, k = T?.workflowDefinitions, A = u(k?.items ?? [], O?.items ?? []), j = O ? O.hasMore : k?.hasMore ?? !1, M = O ? O.nextOffset : k?.items.length ?? 0, N = e === "" || A.some((t) => t.id === e), { data: P, error: F } = i(c, {
55
+ variables: { id: e },
56
+ skip: N || !T,
57
+ fetchPolicy: "cache-first"
58
+ }), I = N ? null : P?.workflowDefinition, L = I?.status === "ACTIVE", R = !N && (!!F || P !== void 0 && !L);
59
+ async function z() {
60
+ S(!0), w(null);
61
+ try {
62
+ let e = (await h.query({
63
+ query: s,
64
+ variables: { input: l(v, M) },
65
+ fetchPolicy: "network-only"
66
+ })).data?.workflowDefinitions;
67
+ if (!e) throw Error("The next page of workflows was empty.");
68
+ b({
69
+ search: v,
70
+ items: u(O?.items ?? [], e.items),
71
+ hasMore: e.hasMore,
72
+ nextOffset: M + e.items.length
73
+ });
74
+ } catch (e) {
75
+ w(e instanceof Error ? e.message : String(e));
76
+ } finally {
77
+ S(!1);
78
+ }
79
+ }
80
+ let B = E && !T ? "Loading workflows…" : D ? "Workflows could not be loaded" : A.length === 0 ? v ? "No active workflows match this search" : "No active workflows yet" : "Choose a workflow";
81
+ return /* @__PURE__ */ o("div", {
29
82
  className: "space-y-1",
30
- children: [/* @__PURE__ */ r("select", {
31
- "aria-label": "Workflow",
32
- "data-testid": "automation-workflow-select",
33
- className: o,
34
- value: e,
35
- onChange: (e) => s(e.target.value),
36
- children: [
37
- /* @__PURE__ */ n("option", {
38
- value: "",
39
- children: l && !c ? "Loading workflows…" : u ? "Workflows could not be loaded" : d.length === 0 ? "No active workflows yet" : "Choose a workflow"
40
- }),
41
- !f && c && /* @__PURE__ */ n("option", {
42
- value: e,
43
- children: "Unavailable workflow (no longer active)"
44
- }),
45
- d.map((e) => /* @__PURE__ */ n("option", {
46
- value: e.id,
47
- children: `${e.name} (v${e.version})`
48
- }, e.id)),
49
- c?.workflowDefinitions.hasMore && /* @__PURE__ */ n("option", {
50
- value: "",
51
- disabled: !0,
52
- children: `Only the first ${a} active workflows are listed`
53
- })
54
- ]
55
- }), u ? /* @__PURE__ */ r("p", {
56
- role: "alert",
57
- className: "text-xs text-destructive",
58
- children: ["The workflow list could not be loaded: ", u.message]
59
- }) : /* @__PURE__ */ r("p", {
60
- className: "text-xs text-muted-foreground",
61
- children: [
62
- "Starts a run of this workflow with the PlanMagnet event as its trigger data. The workflow needs a \"Trigger manually\" or \"When called by another workflow\" start node.",
63
- " ",
64
- /* @__PURE__ */ n("a", {
65
- href: "/workflows",
66
- className: "text-primary underline underline-offset-2",
67
- children: "Build and activate workflows"
68
- })
69
- ]
70
- })]
83
+ children: [
84
+ /* @__PURE__ */ a("input", {
85
+ type: "search",
86
+ "aria-label": "Search workflows",
87
+ "data-testid": "automation-workflow-search",
88
+ className: f,
89
+ placeholder: "Search active workflows by name",
90
+ value: g,
91
+ onChange: (e) => _(e.target.value)
92
+ }),
93
+ /* @__PURE__ */ o("select", {
94
+ "aria-label": "Workflow",
95
+ "data-testid": "automation-workflow-select",
96
+ className: d,
97
+ value: e,
98
+ onChange: (e) => n(e.target.value),
99
+ children: [
100
+ /* @__PURE__ */ a("option", {
101
+ value: "",
102
+ children: B
103
+ }),
104
+ !N && /* @__PURE__ */ a("option", {
105
+ value: e,
106
+ children: I && L ? `${I.name} (v${I.version})` : R ? "Unavailable workflow (no longer active)" : "Saved workflow"
107
+ }),
108
+ A.map((e) => /* @__PURE__ */ a("option", {
109
+ value: e.id,
110
+ children: `${e.name} (v${e.version})`
111
+ }, e.id))
112
+ ]
113
+ }),
114
+ j && /* @__PURE__ */ o("div", {
115
+ className: "flex items-center gap-2",
116
+ children: [/* @__PURE__ */ a("button", {
117
+ type: "button",
118
+ "data-testid": "automation-workflow-load-more",
119
+ className: p,
120
+ disabled: x,
121
+ onClick: () => void z(),
122
+ children: x ? "Loading…" : "Load more workflows"
123
+ }), /* @__PURE__ */ a("span", {
124
+ className: "text-xs text-muted-foreground",
125
+ children: `${A.length} shown. Search to find a workflow faster.`
126
+ })]
127
+ }),
128
+ D || C ? /* @__PURE__ */ o("p", {
129
+ role: "alert",
130
+ className: "text-xs text-destructive",
131
+ children: ["The workflow list could not be loaded: ", D?.message ?? C]
132
+ }) : /* @__PURE__ */ o("p", {
133
+ className: "text-xs text-muted-foreground",
134
+ children: [
135
+ "Starts a run of this workflow with the PlanMagnet event as its trigger data. The workflow needs a \"Trigger manually\" or \"When called by another workflow\" start node.",
136
+ " ",
137
+ /* @__PURE__ */ a("a", {
138
+ href: "/workflows",
139
+ className: "text-primary underline underline-offset-2",
140
+ children: "Build and activate workflows"
141
+ })
142
+ ]
143
+ })
144
+ ]
71
145
  });
72
146
  }
73
- export { s as WorkflowSelect };
147
+ export { h as WorkflowSelect, u as appendWorkflowPage, l as workflowPageInput };
@@ -309,7 +309,7 @@ function L({ onCreated: e }) {
309
309
  }
310
310
  var R = d`
311
311
  mutation CreateDialogTemplateFromProject($projectId: ID!, $name: String!, $description: String) {
312
- planmagnetCreateTemplateFromProject(
312
+ planmagnetCreateTemplateFromProject: planmagnetCreateTemplateRecordFromProject(
313
313
  projectId: $projectId
314
314
  name: $name
315
315
  description: $description
@@ -8,7 +8,7 @@ import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell/I18nProv
8
8
  // src/planmagnet/dashboards/cards/RiskSeverityCard.tsx
9
9
  var c = n`
10
10
  query DashboardProjectRisks($workspaceId: ID!, $projectId: String!) {
11
- planmagnetRisks(
11
+ planmagnetRisks: planmagnetRiskRecords(
12
12
  workspaceId: $workspaceId
13
13
  filter: { projectId: $projectId }
14
14
  pagination: { first: 100 }
@@ -12,7 +12,7 @@ import { Badge as h, Card as g, CardContent as _, CardHeader as v, CardTitle as
12
12
  // src/planmagnet/pages/RisksRiskDetailPagePage.tsx
13
13
  var b = d`
14
14
  query GetRiskDetail($id: ID!) {
15
- planmagnetRisk(id: $id) {
15
+ planmagnetRisk: planmagnetRiskRecord(id: $id) {
16
16
  id
17
17
  projectId
18
18
  project {
@@ -21,7 +21,11 @@ var S = m`
21
21
  }
22
22
  `, C = m`
23
23
  query GetRisks($workspaceId: ID!, $filter: PlanmagnetRiskFilter) {
24
- planmagnetRisks(workspaceId: $workspaceId, filter: $filter, pagination: { first: 100 }) {
24
+ planmagnetRisks: planmagnetRiskRecords(
25
+ workspaceId: $workspaceId
26
+ filter: $filter
27
+ pagination: { first: 100 }
28
+ ) {
25
29
  items {
26
30
  id
27
31
  title
@@ -1,17 +1,17 @@
1
1
  import { useEntityId as e } from "../hooks/useEntityId.js";
2
2
  import { throwOnError as t } from "../utils/mutationResult.js";
3
3
  import { ErrorLine as n } from "../controls/ConfirmButton.js";
4
- import { TEMPLATE_QUERIES as r, TemplateDeleteButton as i } from "../controls/TemplateControls.js";
5
- import { useState as a } from "react";
6
- import { LayoutTemplate as o, Save as s } from "lucide-react";
7
- import { gql as c } from "@apollo/client";
8
- import { useMutation as l, useQuery as u } from "@apollo/client/react";
9
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
10
- import { Badge as p, Button as m, Card as h, CardContent as g, CardHeader as _, CardTitle as v, Input as y, Switch as b } from "@burdenoff/fe-libs/ui";
4
+ import { TemplateDeleteButton as r } from "../controls/TemplateControls.js";
5
+ import { useState as i } from "react";
6
+ import { LayoutTemplate as a, Save as o } from "lucide-react";
7
+ import { gql as s } from "@apollo/client";
8
+ import { useMutation as c, useQuery as l } from "@apollo/client/react";
9
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
10
+ import { Badge as f, Button as p, Card as m, CardContent as h, CardHeader as g, CardTitle as _, Input as v, Switch as y } from "@burdenoff/fe-libs/ui";
11
11
  // src/planmagnet/pages/TemplatesEditTemplatePagePage.tsx
12
- var x = c`
12
+ var b = s`
13
13
  query GetTemplate($id: ID!) {
14
- planmagnetProjectTemplate(id: $id) {
14
+ planmagnetProjectTemplate: planmagnetProjectTemplateRecord(id: $id) {
15
15
  id
16
16
  name
17
17
  description
@@ -26,9 +26,9 @@ var x = c`
26
26
  customFieldsConfig
27
27
  }
28
28
  }
29
- `, S = c`
29
+ `, x = s`
30
30
  mutation UpdateProjectTemplate($id: ID!, $input: PlanmagnetUpdateProjectTemplateInput!) {
31
- planmagnetUpdateProjectTemplate(id: $id, input: $input) {
31
+ planmagnetUpdateProjectTemplate: planmagnetUpdateProjectTemplateRecord(id: $id, input: $input) {
32
32
  id
33
33
  name
34
34
  description
@@ -41,8 +41,8 @@ var x = c`
41
41
  customFieldsConfig
42
42
  }
43
43
  }
44
- `, C = (e) => e == null ? "" : JSON.stringify(e, null, 2);
45
- function w(e) {
44
+ `, S = (e) => e == null ? "" : JSON.stringify(e, null, 2);
45
+ function C(e) {
46
46
  if (e.trim() === "") return {
47
47
  ok: !0,
48
48
  value: null
@@ -59,18 +59,18 @@ function w(e) {
59
59
  };
60
60
  }
61
61
  }
62
- function T({ id: e, label: t, hint: r, value: i, onChange: a, error: o }) {
63
- return /* @__PURE__ */ f("div", { children: [
64
- /* @__PURE__ */ d("label", {
62
+ function w({ id: e, label: t, hint: r, value: i, onChange: a, error: o }) {
63
+ return /* @__PURE__ */ d("div", { children: [
64
+ /* @__PURE__ */ u("label", {
65
65
  htmlFor: e,
66
66
  className: "text-sm font-medium",
67
67
  children: t
68
68
  }),
69
- /* @__PURE__ */ d("p", {
69
+ /* @__PURE__ */ u("p", {
70
70
  className: "text-xs text-muted-foreground",
71
71
  children: r
72
72
  }),
73
- /* @__PURE__ */ d("textarea", {
73
+ /* @__PURE__ */ u("textarea", {
74
74
  id: e,
75
75
  spellCheck: !1,
76
76
  className: "mt-1 w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-xs min-h-[100px] disabled:opacity-60",
@@ -78,166 +78,166 @@ function T({ id: e, label: t, hint: r, value: i, onChange: a, error: o }) {
78
78
  onChange: (e) => a(e.target.value),
79
79
  "aria-invalid": !!o
80
80
  }),
81
- o && /* @__PURE__ */ d(n, { message: o })
81
+ o && /* @__PURE__ */ u(n, { message: o })
82
82
  ] });
83
83
  }
84
- function E() {
85
- let c = e(), { data: E, loading: D, error: O } = u(x, {
86
- variables: { id: c ?? "" },
87
- skip: !c,
84
+ function T() {
85
+ let s = e(), { data: T, loading: E, error: D } = l(b, {
86
+ variables: { id: s ?? "" },
87
+ skip: !s,
88
88
  fetchPolicy: "cache-and-network"
89
- }), [k, { loading: A }] = l(S, { refetchQueries: r }), j = E?.planmagnetProjectTemplate ?? null, [M, N] = a(null), [P, F] = a(null), [I, L] = a(!1), [R, z] = a(null);
90
- if (j && R !== j.id && (z(j.id), N({
91
- name: j.name,
92
- description: j.description ?? "",
93
- category: j.category ?? "",
94
- tags: j.tags.join(", "),
95
- isPublished: j.isPublished,
96
- configuration: C(j.configuration),
97
- boardConfig: C(j.boardConfig),
98
- sprintConfig: C(j.sprintConfig),
99
- customFieldsConfig: C(j.customFieldsConfig)
100
- })), !c) return /* @__PURE__ */ d("div", {
89
+ }), [O, { loading: k }] = c(x, { refetchQueries: [b] }), A = T?.planmagnetProjectTemplate ?? null, [j, M] = i(null), [N, P] = i(null), [F, I] = i(!1), [L, R] = i(null);
90
+ if (A && L !== A.id && (R(A.id), M({
91
+ name: A.name,
92
+ description: A.description ?? "",
93
+ category: A.category ?? "",
94
+ tags: A.tags.join(", "),
95
+ isPublished: A.isPublished,
96
+ configuration: S(A.configuration),
97
+ boardConfig: S(A.boardConfig),
98
+ sprintConfig: S(A.sprintConfig),
99
+ customFieldsConfig: S(A.customFieldsConfig)
100
+ })), !s) return /* @__PURE__ */ u("div", {
101
101
  className: "p-6 text-muted-foreground",
102
102
  children: "No template selected. Open one from the list."
103
103
  });
104
- if (D && !E) return /* @__PURE__ */ d("div", {
104
+ if (E && !T) return /* @__PURE__ */ u("div", {
105
105
  className: "flex items-center justify-center p-12",
106
- children: /* @__PURE__ */ d("div", { className: "animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full" })
106
+ children: /* @__PURE__ */ u("div", { className: "animate-spin h-8 w-8 border-2 border-primary border-t-transparent rounded-full" })
107
107
  });
108
- if (O) return /* @__PURE__ */ f("div", {
108
+ if (D) return /* @__PURE__ */ d("div", {
109
109
  className: "p-6 text-destructive",
110
- children: ["Template could not be loaded: ", O.message]
110
+ children: ["Template could not be loaded: ", D.message]
111
111
  });
112
- if (!j || !M) return /* @__PURE__ */ d("div", {
112
+ if (!A || !j) return /* @__PURE__ */ u("div", {
113
113
  className: "p-6 text-muted-foreground",
114
114
  children: "Template not found."
115
115
  });
116
- let B = w(M.configuration), V = w(M.boardConfig), H = w(M.sprintConfig), U = w(M.customFieldsConfig), W = [
116
+ let z = C(j.configuration), B = C(j.boardConfig), V = C(j.sprintConfig), H = C(j.customFieldsConfig), U = [
117
+ z,
117
118
  B,
118
119
  V,
119
- H,
120
- U
121
- ].filter((e) => !e.ok).length, G = async () => {
122
- if (F(null), L(!1), W > 0 || !B.ok || !V.ok || !H.ok || !U.ok) return;
120
+ H
121
+ ].filter((e) => !e.ok).length, W = async () => {
122
+ if (P(null), I(!1), U > 0 || !z.ok || !B.ok || !V.ok || !H.ok) return;
123
123
  let e = {};
124
- M.name.trim() !== j.name && (e.name = M.name.trim()), M.description.trim() !== (j.description ?? "") && (e.description = M.description.trim() || null), M.category.trim() !== (j.category ?? "") && (e.category = M.category.trim() || null), M.isPublished !== j.isPublished && (e.isPublished = M.isPublished);
125
- let n = M.tags.split(",").map((e) => e.trim()).filter(Boolean);
126
- if (JSON.stringify(n) !== JSON.stringify(j.tags) && (e.tags = n), M.configuration !== C(j.configuration) && (e.configuration = B.value), M.boardConfig !== C(j.boardConfig) && (e.boardConfig = V.value), M.sprintConfig !== C(j.sprintConfig) && (e.sprintConfig = H.value), M.customFieldsConfig !== C(j.customFieldsConfig) && (e.customFieldsConfig = U.value), Object.keys(e).length === 0) L(!0);
124
+ j.name.trim() !== A.name && (e.name = j.name.trim()), j.description.trim() !== (A.description ?? "") && (e.description = j.description.trim() || null), j.category.trim() !== (A.category ?? "") && (e.category = j.category.trim() || null), j.isPublished !== A.isPublished && (e.isPublished = j.isPublished);
125
+ let n = j.tags.split(",").map((e) => e.trim()).filter(Boolean);
126
+ if (JSON.stringify(n) !== JSON.stringify(A.tags) && (e.tags = n), j.configuration !== S(A.configuration) && (e.configuration = z.value), j.boardConfig !== S(A.boardConfig) && (e.boardConfig = B.value), j.sprintConfig !== S(A.sprintConfig) && (e.sprintConfig = V.value), j.customFieldsConfig !== S(A.customFieldsConfig) && (e.customFieldsConfig = H.value), Object.keys(e).length === 0) I(!0);
127
127
  else try {
128
- await t(k({ variables: {
129
- id: j.id,
128
+ await t(O({ variables: {
129
+ id: A.id,
130
130
  input: e
131
- } })), L(!0);
131
+ } })), I(!0);
132
132
  } catch (e) {
133
- F(e instanceof Error ? e.message : "The template could not be saved.");
133
+ P(e instanceof Error ? e.message : "The template could not be saved.");
134
134
  }
135
135
  };
136
- return /* @__PURE__ */ f("div", {
136
+ return /* @__PURE__ */ d("div", {
137
137
  className: "space-y-6 p-6 max-w-3xl",
138
138
  children: [
139
- /* @__PURE__ */ f("div", {
139
+ /* @__PURE__ */ d("div", {
140
140
  className: "flex flex-wrap items-start justify-between gap-3",
141
- children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("div", {
141
+ children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("div", {
142
142
  className: "flex items-center gap-2",
143
- children: [/* @__PURE__ */ d("h1", {
143
+ children: [/* @__PURE__ */ u("h1", {
144
144
  className: "text-2xl font-semibold",
145
- children: j.name
146
- }), j.isBuiltIn && /* @__PURE__ */ d(p, {
145
+ children: A.name
146
+ }), A.isBuiltIn && /* @__PURE__ */ u(f, {
147
147
  variant: "secondary",
148
148
  children: "Built-in"
149
149
  })]
150
- }), /* @__PURE__ */ f("p", {
150
+ }), /* @__PURE__ */ d("p", {
151
151
  className: "text-sm text-muted-foreground",
152
152
  children: [
153
153
  "Used ",
154
- j.usageCount,
154
+ A.usageCount,
155
155
  " time",
156
- j.usageCount === 1 ? "" : "s"
156
+ A.usageCount === 1 ? "" : "s"
157
157
  ]
158
- })] }), /* @__PURE__ */ d(i, {
159
- templateId: j.id,
160
- name: j.name,
161
- isBuiltIn: j.isBuiltIn
158
+ })] }), /* @__PURE__ */ u(r, {
159
+ templateId: A.id,
160
+ name: A.name,
161
+ isBuiltIn: A.isBuiltIn
162
162
  })]
163
163
  }),
164
- P && /* @__PURE__ */ d(n, { message: P }),
165
- I && !P && /* @__PURE__ */ d("p", {
164
+ N && /* @__PURE__ */ u(n, { message: N }),
165
+ F && !N && /* @__PURE__ */ u("p", {
166
166
  className: "text-sm text-muted-foreground",
167
167
  children: "Saved."
168
168
  }),
169
- /* @__PURE__ */ f(h, { children: [/* @__PURE__ */ d(_, { children: /* @__PURE__ */ f(v, {
169
+ /* @__PURE__ */ d(m, { children: [/* @__PURE__ */ u(g, { children: /* @__PURE__ */ d(_, {
170
170
  className: "flex items-center gap-2",
171
- children: [/* @__PURE__ */ d(o, { className: "h-4 w-4" }), "Template details"]
172
- }) }), /* @__PURE__ */ f(g, {
171
+ children: [/* @__PURE__ */ u(a, { className: "h-4 w-4" }), "Template details"]
172
+ }) }), /* @__PURE__ */ d(h, {
173
173
  className: "space-y-4",
174
174
  children: [
175
- /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
175
+ /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
176
176
  htmlFor: "template-name",
177
177
  className: "text-sm font-medium",
178
178
  children: "Name"
179
- }), /* @__PURE__ */ d(y, {
179
+ }), /* @__PURE__ */ u(v, {
180
180
  id: "template-name",
181
181
  className: "mt-1",
182
- value: M.name,
183
- onChange: (e) => N({
184
- ...M,
182
+ value: j.name,
183
+ onChange: (e) => M({
184
+ ...j,
185
185
  name: e.target.value
186
186
  })
187
187
  })] }),
188
- /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
188
+ /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
189
189
  htmlFor: "template-description",
190
190
  className: "text-sm font-medium",
191
191
  children: "Description"
192
- }), /* @__PURE__ */ d("textarea", {
192
+ }), /* @__PURE__ */ u("textarea", {
193
193
  id: "template-description",
194
194
  className: "mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm min-h-[72px]",
195
- value: M.description,
196
- onChange: (e) => N({
197
- ...M,
195
+ value: j.description,
196
+ onChange: (e) => M({
197
+ ...j,
198
198
  description: e.target.value
199
199
  })
200
200
  })] }),
201
- /* @__PURE__ */ f("div", {
201
+ /* @__PURE__ */ d("div", {
202
202
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
203
- children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
203
+ children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
204
204
  htmlFor: "template-category",
205
205
  className: "text-sm font-medium",
206
206
  children: "Category"
207
- }), /* @__PURE__ */ d(y, {
207
+ }), /* @__PURE__ */ u(v, {
208
208
  id: "template-category",
209
209
  className: "mt-1",
210
- value: M.category,
211
- onChange: (e) => N({
212
- ...M,
210
+ value: j.category,
211
+ onChange: (e) => M({
212
+ ...j,
213
213
  category: e.target.value
214
214
  }),
215
215
  placeholder: "e.g. Engineering"
216
- })] }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
216
+ })] }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
217
217
  htmlFor: "template-tags",
218
218
  className: "text-sm font-medium",
219
219
  children: "Tags (comma-separated)"
220
- }), /* @__PURE__ */ d(y, {
220
+ }), /* @__PURE__ */ u(v, {
221
221
  id: "template-tags",
222
222
  className: "mt-1",
223
- value: M.tags,
224
- onChange: (e) => N({
225
- ...M,
223
+ value: j.tags,
224
+ onChange: (e) => M({
225
+ ...j,
226
226
  tags: e.target.value
227
227
  }),
228
228
  placeholder: "agile, web"
229
229
  })] })]
230
230
  }),
231
- /* @__PURE__ */ f("div", {
231
+ /* @__PURE__ */ d("div", {
232
232
  className: "flex items-center gap-2",
233
- children: [/* @__PURE__ */ d(b, {
233
+ children: [/* @__PURE__ */ u(y, {
234
234
  id: "template-published",
235
- checked: M.isPublished,
236
- onCheckedChange: (e) => N({
237
- ...M,
235
+ checked: j.isPublished,
236
+ onCheckedChange: (e) => M({
237
+ ...j,
238
238
  isPublished: e
239
239
  })
240
- }), /* @__PURE__ */ d("label", {
240
+ }), /* @__PURE__ */ u("label", {
241
241
  htmlFor: "template-published",
242
242
  className: "text-sm",
243
243
  children: "Published — available to start new projects from"
@@ -245,66 +245,66 @@ function E() {
245
245
  })
246
246
  ]
247
247
  })] }),
248
- /* @__PURE__ */ f(h, { children: [/* @__PURE__ */ d(_, { children: /* @__PURE__ */ d(v, { children: "Advanced configuration" }) }), /* @__PURE__ */ f(g, {
248
+ /* @__PURE__ */ d(m, { children: [/* @__PURE__ */ u(g, { children: /* @__PURE__ */ u(_, { children: "Advanced configuration" }) }), /* @__PURE__ */ d(h, {
249
249
  className: "space-y-4",
250
250
  children: [
251
- /* @__PURE__ */ d(T, {
251
+ /* @__PURE__ */ u(w, {
252
252
  id: "template-configuration",
253
253
  label: "Configuration",
254
254
  hint: "Project settings and work item types applied when this template is used.",
255
- value: M.configuration,
256
- onChange: (e) => N({
257
- ...M,
255
+ value: j.configuration,
256
+ onChange: (e) => M({
257
+ ...j,
258
258
  configuration: e
259
259
  }),
260
- error: B.ok ? null : B.error
260
+ error: z.ok ? null : z.error
261
261
  }),
262
- /* @__PURE__ */ d(T, {
262
+ /* @__PURE__ */ u(w, {
263
263
  id: "template-board-config",
264
264
  label: "Board layout",
265
265
  hint: "Optional. Leave empty to clear.",
266
- value: M.boardConfig,
267
- onChange: (e) => N({
268
- ...M,
266
+ value: j.boardConfig,
267
+ onChange: (e) => M({
268
+ ...j,
269
269
  boardConfig: e
270
270
  }),
271
- error: V.ok ? null : V.error
271
+ error: B.ok ? null : B.error
272
272
  }),
273
- /* @__PURE__ */ d(T, {
273
+ /* @__PURE__ */ u(w, {
274
274
  id: "template-sprint-config",
275
275
  label: "Default sprint configuration",
276
276
  hint: "Optional. Leave empty to clear.",
277
- value: M.sprintConfig,
278
- onChange: (e) => N({
279
- ...M,
277
+ value: j.sprintConfig,
278
+ onChange: (e) => M({
279
+ ...j,
280
280
  sprintConfig: e
281
281
  }),
282
- error: H.ok ? null : H.error
282
+ error: V.ok ? null : V.error
283
283
  }),
284
- /* @__PURE__ */ d(T, {
284
+ /* @__PURE__ */ u(w, {
285
285
  id: "template-custom-fields-config",
286
286
  label: "Custom field definitions",
287
287
  hint: "Optional. Leave empty to clear.",
288
- value: M.customFieldsConfig,
289
- onChange: (e) => N({
290
- ...M,
288
+ value: j.customFieldsConfig,
289
+ onChange: (e) => M({
290
+ ...j,
291
291
  customFieldsConfig: e
292
292
  }),
293
- error: U.ok ? null : U.error
293
+ error: H.ok ? null : H.error
294
294
  })
295
295
  ]
296
296
  })] }),
297
- /* @__PURE__ */ d("div", {
297
+ /* @__PURE__ */ u("div", {
298
298
  className: "flex justify-end",
299
- children: /* @__PURE__ */ f(m, {
299
+ children: /* @__PURE__ */ d(p, {
300
300
  size: "sm",
301
- onClick: () => void G(),
302
- disabled: A || W > 0,
301
+ onClick: () => void W(),
302
+ disabled: k || U > 0,
303
303
  "data-testid": "template-save",
304
- children: [/* @__PURE__ */ d(s, { className: "mr-1 h-4 w-4" }), A ? "Saving…" : "Save changes"]
304
+ children: [/* @__PURE__ */ u(o, { className: "mr-1 h-4 w-4" }), k ? "Saving…" : "Save changes"]
305
305
  })
306
306
  })
307
307
  ]
308
308
  });
309
309
  }
310
- export { E as TemplatesEditTemplatePagePage };
310
+ export { T as TemplatesEditTemplatePagePage };
@@ -15,7 +15,7 @@ var x = p`
15
15
  $filter: PlanmagnetProjectTemplateFilter
16
16
  $pagination: PlanmagnetPaginationInput
17
17
  ) {
18
- planmagnetProjectTemplates(
18
+ planmagnetProjectTemplates: planmagnetProjectTemplateRecords(
19
19
  workspaceId: $workspaceId
20
20
  filter: $filter
21
21
  pagination: $pagination
@@ -55,7 +55,7 @@ var S = p`
55
55
  }
56
56
  `, w = p`
57
57
  query ReleaseRisks($workspaceId: ID!, $projectId: String!) {
58
- planmagnetRisks(
58
+ planmagnetRisks: planmagnetRiskRecords(
59
59
  workspaceId: $workspaceId
60
60
  filter: { projectId: $projectId }
61
61
  pagination: { first: 100 }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-planmagnet",
3
- "version": "2026.1123.2",
3
+ "version": "2026.1126.1",
4
4
  "description": "Burdenoff PlanMagnet Microfrontend",
5
5
  "type": "module",
6
6
  "files": [