@burdenoff/microfe-planmagnet 2026.930.6 → 2026.930.8
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/PlanMagnetRoot.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoot.js +132 -108
- package/dist/planmagnet/PlanMagnetRoot.js.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.js +24 -12
- package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
- package/dist/planmagnet/board/BoardViewBar.d.ts +27 -0
- package/dist/planmagnet/board/BoardViewBar.d.ts.map +1 -0
- package/dist/planmagnet/board/BoardViewBar.js +684 -0
- package/dist/planmagnet/board/BoardViewBar.js.map +1 -0
- package/dist/planmagnet/board/ProjectBoard.d.ts.map +1 -1
- package/dist/planmagnet/board/ProjectBoard.js +440 -345
- package/dist/planmagnet/board/ProjectBoard.js.map +1 -1
- package/dist/planmagnet/board/boardViewConfig.d.ts +144 -0
- package/dist/planmagnet/board/boardViewConfig.d.ts.map +1 -0
- package/dist/planmagnet/board/boardViewConfig.js +265 -0
- package/dist/planmagnet/board/boardViewConfig.js.map +1 -0
- package/dist/planmagnet/controls/ConfirmButton.d.ts +3 -1
- package/dist/planmagnet/controls/ConfirmButton.d.ts.map +1 -1
- package/dist/planmagnet/controls/ConfirmButton.js +2 -1
- package/dist/planmagnet/controls/ConfirmButton.js.map +1 -1
- package/dist/planmagnet/controls/FeatureControls.js +25 -25
- package/dist/planmagnet/controls/Pickers.d.ts +2 -1
- package/dist/planmagnet/controls/Pickers.d.ts.map +1 -1
- package/dist/planmagnet/controls/Pickers.js +133 -102
- package/dist/planmagnet/controls/Pickers.js.map +1 -1
- package/dist/planmagnet/controls/QualityGateControls.d.ts +64 -0
- package/dist/planmagnet/controls/QualityGateControls.d.ts.map +1 -0
- package/dist/planmagnet/controls/QualityGateControls.js +390 -0
- package/dist/planmagnet/controls/QualityGateControls.js.map +1 -0
- package/dist/planmagnet/create/CreateDialogs.d.ts +8 -0
- package/dist/planmagnet/create/CreateDialogs.d.ts.map +1 -1
- package/dist/planmagnet/create/CreateDialogs.js +344 -206
- package/dist/planmagnet/create/CreateDialogs.js.map +1 -1
- package/dist/planmagnet/milestones/MilestoneControls.js +1 -1
- package/dist/planmagnet/pages/AiActivityPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/AiActivityPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/AiActivityPagePage.js +249 -0
- package/dist/planmagnet/pages/AiActivityPagePage.js.map +1 -0
- package/dist/planmagnet/pages/AiPlanPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/AiPlanPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/AiPlanPagePage.js +381 -0
- package/dist/planmagnet/pages/AiPlanPagePage.js.map +1 -0
- package/dist/planmagnet/pages/AutomationAutomationRuleDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/ProductsEditProductPagePage.js +5 -5
- package/dist/planmagnet/pages/ProductsEditRoadmapPagePage.js +4 -4
- package/dist/planmagnet/pages/ProductsProductDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/ProgramsEditProgramPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsBudgetDetailPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsCriticalPathPagePage.js +4 -4
- package/dist/planmagnet/pages/ProjectsEditProjectPagePage.js +11 -11
- package/dist/planmagnet/pages/ProjectsPlanningEditPagePage.js +6 -6
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js +209 -199
- package/dist/planmagnet/pages/ProjectsProjectDetailPagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.js +236 -0
- package/dist/planmagnet/pages/ProjectsQualityGatesPagePage.js.map +1 -0
- package/dist/planmagnet/pages/RisksRiskDetailPagePage.js +5 -5
- package/dist/planmagnet/pages/TasksTimesheetDetailPagePage.js +6 -6
- package/dist/planmagnet/pages/TeamCreateTeamPagePage.js +4 -4
- package/dist/planmagnet/pages/TeamTeamEditPagePage.js +8 -8
- package/dist/planmagnet/pages/TemplatesEditTemplatePagePage.js +7 -7
- package/dist/planmagnet/releases/useReleaseOptions.d.ts +21 -0
- package/dist/planmagnet/releases/useReleaseOptions.d.ts.map +1 -0
- package/dist/planmagnet/releases/useReleaseOptions.js +75 -0
- package/dist/planmagnet/releases/useReleaseOptions.js.map +1 -0
- package/dist/planmagnet/roadmaps/RoadmapControls.js +13 -13
- package/dist/planmagnet/utils/qualityGateCriteria.d.ts +33 -0
- package/dist/planmagnet/utils/qualityGateCriteria.d.ts.map +1 -0
- package/dist/planmagnet/utils/qualityGateCriteria.js +58 -0
- package/dist/planmagnet/utils/qualityGateCriteria.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import "../providers/PlanMagnetProvider.js";
|
|
2
|
+
import { gql as e } from "@apollo/client";
|
|
3
|
+
import { useQuery as t } from "@apollo/client/react";
|
|
4
|
+
//#region src/planmagnet/board/boardViewConfig.ts
|
|
5
|
+
var n = [
|
|
6
|
+
"BUG",
|
|
7
|
+
"EPIC",
|
|
8
|
+
"STORY",
|
|
9
|
+
"SUB_TASK",
|
|
10
|
+
"TASK"
|
|
11
|
+
], r = [
|
|
12
|
+
{
|
|
13
|
+
value: "NONE",
|
|
14
|
+
label: "None"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
value: "ASSIGNEE",
|
|
18
|
+
label: "Assignee"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
value: "PRIORITY",
|
|
22
|
+
label: "Priority"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: "TYPE",
|
|
26
|
+
label: "Type"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
value: "EPIC",
|
|
30
|
+
label: "Epic"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
value: "SPRINT",
|
|
34
|
+
label: "Sprint"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
value: "MILESTONE",
|
|
38
|
+
label: "Milestone"
|
|
39
|
+
}
|
|
40
|
+
], i = [
|
|
41
|
+
{
|
|
42
|
+
value: "RANK",
|
|
43
|
+
label: "Board order"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
value: "PRIORITY",
|
|
47
|
+
label: "Priority"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: "DUE_DATE",
|
|
51
|
+
label: "Due date"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
value: "STORY_POINTS",
|
|
55
|
+
label: "Story points"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
value: "CREATED_AT",
|
|
59
|
+
label: "Created"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: "UPDATED_AT",
|
|
63
|
+
label: "Updated"
|
|
64
|
+
}
|
|
65
|
+
], a = [
|
|
66
|
+
{
|
|
67
|
+
value: "KEY",
|
|
68
|
+
label: "Key"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
value: "TYPE",
|
|
72
|
+
label: "Type"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
value: "PRIORITY",
|
|
76
|
+
label: "Priority"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
value: "ASSIGNEE",
|
|
80
|
+
label: "Assignee"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
value: "STORY_POINTS",
|
|
84
|
+
label: "Story points"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
value: "DUE_DATE",
|
|
88
|
+
label: "Due date"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
value: "LABELS",
|
|
92
|
+
label: "Labels"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
value: "SPRINT",
|
|
96
|
+
label: "Sprint"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
value: "MILESTONE",
|
|
100
|
+
label: "Milestone"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
value: "EPIC",
|
|
104
|
+
label: "Epic"
|
|
105
|
+
}
|
|
106
|
+
], o = [
|
|
107
|
+
"KEY",
|
|
108
|
+
"ASSIGNEE",
|
|
109
|
+
"STORY_POINTS"
|
|
110
|
+
];
|
|
111
|
+
function s() {
|
|
112
|
+
return {
|
|
113
|
+
assigneeIds: [],
|
|
114
|
+
unassigned: !1,
|
|
115
|
+
types: [],
|
|
116
|
+
priorities: [],
|
|
117
|
+
labels: [],
|
|
118
|
+
search: "",
|
|
119
|
+
sprintId: "",
|
|
120
|
+
milestoneId: "",
|
|
121
|
+
dueFrom: "",
|
|
122
|
+
dueTo: ""
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function c() {
|
|
126
|
+
return {
|
|
127
|
+
field: "RANK",
|
|
128
|
+
direction: "ASC"
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function l() {
|
|
132
|
+
return {
|
|
133
|
+
filter: s(),
|
|
134
|
+
sort: c(),
|
|
135
|
+
groupBy: "NONE",
|
|
136
|
+
visibleFields: []
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function u(e) {
|
|
140
|
+
let t = {};
|
|
141
|
+
return e.assigneeIds.length > 0 && (t.assigneeIds = e.assigneeIds), e.unassigned && (t.unassigned = !0), e.types.length > 0 && (t.types = e.types), e.priorities.length > 0 && (t.priorities = e.priorities), e.labels.length > 0 && (t.labels = e.labels), e.search.trim() && (t.search = e.search.trim()), e.sprintId && (t.sprintId = e.sprintId), e.milestoneId && (t.milestoneId = e.milestoneId), e.dueFrom && (t.dueFrom = `${e.dueFrom}T00:00:00.000Z`), e.dueTo && (t.dueTo = `${e.dueTo}T00:00:00.000Z`), Object.keys(t).length > 0 ? t : void 0;
|
|
142
|
+
}
|
|
143
|
+
function d(e) {
|
|
144
|
+
return u(e) !== void 0;
|
|
145
|
+
}
|
|
146
|
+
function f(e) {
|
|
147
|
+
return {
|
|
148
|
+
filter: u(e.filter) ?? null,
|
|
149
|
+
groupBy: e.groupBy,
|
|
150
|
+
sort: {
|
|
151
|
+
field: e.sort.field,
|
|
152
|
+
direction: e.sort.direction
|
|
153
|
+
},
|
|
154
|
+
visibleFields: e.visibleFields
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function p(e) {
|
|
158
|
+
return {
|
|
159
|
+
filter: {
|
|
160
|
+
assigneeIds: e.filter.assigneeIds,
|
|
161
|
+
unassigned: e.filter.unassigned,
|
|
162
|
+
types: e.filter.types,
|
|
163
|
+
priorities: e.filter.priorities,
|
|
164
|
+
labels: e.filter.labels,
|
|
165
|
+
search: e.filter.search ?? "",
|
|
166
|
+
sprintId: e.filter.sprintId ?? "",
|
|
167
|
+
milestoneId: e.filter.milestoneId ?? "",
|
|
168
|
+
dueFrom: e.filter.dueFrom ? e.filter.dueFrom.slice(0, 10) : "",
|
|
169
|
+
dueTo: e.filter.dueTo ? e.filter.dueTo.slice(0, 10) : ""
|
|
170
|
+
},
|
|
171
|
+
sort: {
|
|
172
|
+
field: e.sort.field,
|
|
173
|
+
direction: e.sort.direction
|
|
174
|
+
},
|
|
175
|
+
groupBy: e.groupBy,
|
|
176
|
+
visibleFields: e.visibleFields
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
var m = (e) => [...e].sort().join("\0");
|
|
180
|
+
function h(e, t) {
|
|
181
|
+
return m(e.filter.assigneeIds) === m(t.filter.assigneeIds) && e.filter.unassigned === t.filter.unassigned && m(e.filter.types) === m(t.filter.types) && m(e.filter.priorities) === m(t.filter.priorities) && m(e.filter.labels) === m(t.filter.labels) && e.filter.search.trim() === t.filter.search.trim() && e.filter.sprintId === t.filter.sprintId && e.filter.milestoneId === t.filter.milestoneId && e.filter.dueFrom === t.filter.dueFrom && e.filter.dueTo === t.filter.dueTo && e.sort.field === t.sort.field && e.sort.direction === t.sort.direction && e.groupBy === t.groupBy && m(e.visibleFields) === m(t.visibleFields);
|
|
182
|
+
}
|
|
183
|
+
function g() {
|
|
184
|
+
return typeof window > "u" ? null : new URLSearchParams(window.location.search).get("view") || null;
|
|
185
|
+
}
|
|
186
|
+
function _(e) {
|
|
187
|
+
if (typeof window > "u") return;
|
|
188
|
+
let t = new URL(window.location.href);
|
|
189
|
+
e ? t.searchParams.set("view", e) : t.searchParams.delete("view"), window.history.replaceState(window.history.state, "", t);
|
|
190
|
+
}
|
|
191
|
+
var v = "\n id\n name\n description\n projectId\n boardId\n board {\n id\n name\n }\n ownerId\n visibility\n isMine\n filter {\n assigneeIds\n unassigned\n types\n priorities\n labels\n search\n sprintId\n milestoneId\n dueFrom\n dueTo\n }\n groupBy\n sort {\n field\n direction\n }\n visibleFields\n createdAt\n updatedAt\n", y = e`
|
|
192
|
+
query ProjectBoardViews($workspaceId: ID!, $filter: PlanmagnetBoardViewFilter, $pagination: PlanmagnetPaginationInput) {
|
|
193
|
+
planmagnetBoardViews(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {
|
|
194
|
+
items {
|
|
195
|
+
${v}
|
|
196
|
+
}
|
|
197
|
+
totalCount
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
`, b = e`
|
|
201
|
+
mutation ProjectBoardViewCreate($input: PlanmagnetCreateBoardViewInput!) {
|
|
202
|
+
planmagnetCreateBoardView(input: $input) {
|
|
203
|
+
${v}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
`, x = e`
|
|
207
|
+
mutation ProjectBoardViewUpdate($id: ID!, $input: PlanmagnetUpdateBoardViewInput!) {
|
|
208
|
+
planmagnetUpdateBoardView(id: $id, input: $input) {
|
|
209
|
+
${v}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
`, S = e`
|
|
213
|
+
mutation ProjectBoardViewDelete($id: ID!) {
|
|
214
|
+
planmagnetDeleteBoardView(id: $id)
|
|
215
|
+
}
|
|
216
|
+
`, C = ["ProjectBoardViews"];
|
|
217
|
+
function w(e, n) {
|
|
218
|
+
let { data: r, loading: i, error: a, refetch: o } = t(y, {
|
|
219
|
+
variables: {
|
|
220
|
+
workspaceId: e ?? "",
|
|
221
|
+
filter: { projectId: n },
|
|
222
|
+
pagination: { first: 100 }
|
|
223
|
+
},
|
|
224
|
+
skip: !e
|
|
225
|
+
});
|
|
226
|
+
return {
|
|
227
|
+
views: r?.planmagnetBoardViews.items ?? [],
|
|
228
|
+
loading: i && !r,
|
|
229
|
+
error: a ? a.message : null,
|
|
230
|
+
refetch: o
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
var T = e`
|
|
234
|
+
query BoardViewProjectSprints($workspaceId: ID!, $projectId: String) {
|
|
235
|
+
planmagnetSprints(
|
|
236
|
+
workspaceId: $workspaceId
|
|
237
|
+
filter: { projectId: $projectId }
|
|
238
|
+
pagination: { first: 100 }
|
|
239
|
+
) {
|
|
240
|
+
items {
|
|
241
|
+
id
|
|
242
|
+
name
|
|
243
|
+
status
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
`;
|
|
248
|
+
function E(e, n) {
|
|
249
|
+
let { data: r, loading: i, error: a } = t(T, {
|
|
250
|
+
variables: {
|
|
251
|
+
workspaceId: e ?? "",
|
|
252
|
+
projectId: n
|
|
253
|
+
},
|
|
254
|
+
skip: !e || !n
|
|
255
|
+
});
|
|
256
|
+
return {
|
|
257
|
+
options: r?.planmagnetSprints?.items ?? [],
|
|
258
|
+
loading: i && !r,
|
|
259
|
+
error: a ? a.message : null
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
//#endregion
|
|
263
|
+
export { b as CREATE_BOARD_VIEW, o as DEFAULT_VISIBLE_FIELDS, S as DELETE_BOARD_VIEW, r as GROUP_BY_OPTIONS, i as SORT_FIELD_OPTIONS, x as UPDATE_BOARD_VIEW, C as VIEW_REFETCH, a as VISIBLE_FIELD_OPTIONS, n as WORK_ITEM_TYPES, p as configFromView, f as configToInput, h as configsEqual, l as defaultConfig, s as emptyFilter, u as filterToGraphQLInput, d as isFilterActive, g as readViewIdFromUrl, w as useBoardViews, E as useProjectSprintOptions, _ as writeViewIdToUrl };
|
|
264
|
+
|
|
265
|
+
//# sourceMappingURL=boardViewConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boardViewConfig.js","names":[],"sources":["../../../src/planmagnet/board/boardViewConfig.ts"],"sourcesContent":["import { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { usePlanMagnet } from '../providers/PlanMagnetProvider';\n\n/**\n * Board views (PDM-N04): a saved, named presentation over a project's board — filter, group-by, sort, visible\n * fields, owner, sharing. A view holds no items and never creates a board (owner decision, 2026-09-29). Shapes,\n * conversions and the shared queries/mutations live here; `BoardViewBar.tsx` is the UI that uses them.\n */\n\nexport type BoardGroupBy =\n | 'NONE'\n | 'ASSIGNEE'\n | 'PRIORITY'\n | 'TYPE'\n | 'EPIC'\n | 'SPRINT'\n | 'MILESTONE';\nexport type BoardSortField =\n | 'RANK'\n | 'PRIORITY'\n | 'DUE_DATE'\n | 'STORY_POINTS'\n | 'CREATED_AT'\n | 'UPDATED_AT';\nexport type SortDirection = 'ASC' | 'DESC';\nexport type BoardCardField =\n | 'KEY'\n | 'TYPE'\n | 'PRIORITY'\n | 'ASSIGNEE'\n | 'STORY_POINTS'\n | 'DUE_DATE'\n | 'LABELS'\n | 'SPRINT'\n | 'MILESTONE'\n | 'EPIC';\nexport type BoardViewVisibility = 'PRIVATE' | 'SHARED';\n\n/** The project's work item types (WorkItemType), for the type filter. */\nexport const WORK_ITEM_TYPES = ['BUG', 'EPIC', 'STORY', 'SUB_TASK', 'TASK'] as const;\n\nexport const GROUP_BY_OPTIONS: ReadonlyArray<{ value: BoardGroupBy; label: string }> = [\n { value: 'NONE', label: 'None' },\n { value: 'ASSIGNEE', label: 'Assignee' },\n { value: 'PRIORITY', label: 'Priority' },\n { value: 'TYPE', label: 'Type' },\n { value: 'EPIC', label: 'Epic' },\n { value: 'SPRINT', label: 'Sprint' },\n { value: 'MILESTONE', label: 'Milestone' },\n];\n\nexport const SORT_FIELD_OPTIONS: ReadonlyArray<{ value: BoardSortField; label: string }> = [\n { value: 'RANK', label: 'Board order' },\n { value: 'PRIORITY', label: 'Priority' },\n { value: 'DUE_DATE', label: 'Due date' },\n { value: 'STORY_POINTS', label: 'Story points' },\n { value: 'CREATED_AT', label: 'Created' },\n { value: 'UPDATED_AT', label: 'Updated' },\n];\n\nexport const VISIBLE_FIELD_OPTIONS: ReadonlyArray<{ value: BoardCardField; label: string }> = [\n { value: 'KEY', label: 'Key' },\n { value: 'TYPE', label: 'Type' },\n { value: 'PRIORITY', label: 'Priority' },\n { value: 'ASSIGNEE', label: 'Assignee' },\n { value: 'STORY_POINTS', label: 'Story points' },\n { value: 'DUE_DATE', label: 'Due date' },\n { value: 'LABELS', label: 'Labels' },\n { value: 'SPRINT', label: 'Sprint' },\n { value: 'MILESTONE', label: 'Milestone' },\n { value: 'EPIC', label: 'Epic' },\n];\n\n/** The board's own card before any view narrows what shows — matches what the board rendered before PDM-N04. */\nexport const DEFAULT_VISIBLE_FIELDS: BoardCardField[] = ['KEY', 'ASSIGNEE', 'STORY_POINTS'];\n\n/** Fields shown on a card: the view's own choice, or the board's default card when it named none. */\nexport function effectiveVisibleFields(\n fields: readonly BoardCardField[]\n): readonly BoardCardField[] {\n return fields.length > 0 ? fields : DEFAULT_VISIBLE_FIELDS;\n}\n\nexport interface BoardFilterState {\n assigneeIds: string[];\n unassigned: boolean;\n types: string[];\n priorities: string[];\n labels: string[];\n search: string;\n sprintId: string;\n milestoneId: string;\n /** yyyy-mm-dd, or '' for no bound. */\n dueFrom: string;\n dueTo: string;\n}\n\nexport interface BoardSortState {\n field: BoardSortField;\n direction: SortDirection;\n}\n\nexport interface BoardViewConfigState {\n filter: BoardFilterState;\n sort: BoardSortState;\n groupBy: BoardGroupBy;\n visibleFields: BoardCardField[];\n}\n\nexport function emptyFilter(): BoardFilterState {\n return {\n assigneeIds: [],\n unassigned: false,\n types: [],\n priorities: [],\n labels: [],\n search: '',\n sprintId: '',\n milestoneId: '',\n dueFrom: '',\n dueTo: '',\n };\n}\n\nexport function defaultSort(): BoardSortState {\n return { field: 'RANK', direction: 'ASC' };\n}\n\n/** \"All cards\": no view applied. */\nexport function defaultConfig(): BoardViewConfigState {\n return { filter: emptyFilter(), sort: defaultSort(), groupBy: 'NONE', visibleFields: [] };\n}\n\n/** The server's `PlanmagnetBoardCardFilter` input — `undefined` (omit the variable) when nothing is set. */\nexport function filterToGraphQLInput(\n filter: BoardFilterState\n): Record<string, unknown> | undefined {\n const input: Record<string, unknown> = {};\n if (filter.assigneeIds.length > 0) input.assigneeIds = filter.assigneeIds;\n if (filter.unassigned) input.unassigned = true;\n if (filter.types.length > 0) input.types = filter.types;\n if (filter.priorities.length > 0) input.priorities = filter.priorities;\n if (filter.labels.length > 0) input.labels = filter.labels;\n if (filter.search.trim()) input.search = filter.search.trim();\n if (filter.sprintId) input.sprintId = filter.sprintId;\n if (filter.milestoneId) input.milestoneId = filter.milestoneId;\n if (filter.dueFrom) input.dueFrom = `${filter.dueFrom}T00:00:00.000Z`;\n if (filter.dueTo) input.dueTo = `${filter.dueTo}T00:00:00.000Z`;\n return Object.keys(input).length > 0 ? input : undefined;\n}\n\n/** Whether any filter is actually narrowing the board (for the \"showing N\" hint and the Clear button). */\nexport function isFilterActive(filter: BoardFilterState): boolean {\n return filterToGraphQLInput(filter) !== undefined;\n}\n\n/** The server's `PlanmagnetBoardViewConfigInput` — a full replacement of a view's stored configuration. */\nexport function configToInput(config: BoardViewConfigState): {\n filter: Record<string, unknown> | null;\n groupBy: BoardGroupBy;\n sort: { field: BoardSortField; direction: SortDirection };\n visibleFields: BoardCardField[];\n} {\n return {\n filter: filterToGraphQLInput(config.filter) ?? null,\n groupBy: config.groupBy,\n sort: { field: config.sort.field, direction: config.sort.direction },\n visibleFields: config.visibleFields,\n };\n}\n\nexport interface BoardViewFilterValue {\n assigneeIds: string[];\n unassigned: boolean;\n types: string[];\n priorities: string[];\n labels: string[];\n search: string | null;\n sprintId: string | null;\n milestoneId: string | null;\n dueFrom: string | null;\n dueTo: string | null;\n}\n\nexport interface BoardView {\n id: string;\n name: string;\n description: string | null;\n projectId: string;\n boardId: string | null;\n ownerId: string;\n visibility: BoardViewVisibility;\n isMine: boolean;\n filter: BoardViewFilterValue;\n groupBy: BoardGroupBy;\n sort: { field: BoardSortField; direction: SortDirection };\n visibleFields: BoardCardField[];\n createdAt: string;\n updatedAt: string;\n}\n\n/** A saved view's stored configuration, converted into the same shape the editable controls use. */\nexport function configFromView(view: BoardView): BoardViewConfigState {\n return {\n filter: {\n assigneeIds: view.filter.assigneeIds,\n unassigned: view.filter.unassigned,\n types: view.filter.types,\n priorities: view.filter.priorities,\n labels: view.filter.labels,\n search: view.filter.search ?? '',\n sprintId: view.filter.sprintId ?? '',\n milestoneId: view.filter.milestoneId ?? '',\n dueFrom: view.filter.dueFrom ? view.filter.dueFrom.slice(0, 10) : '',\n dueTo: view.filter.dueTo ? view.filter.dueTo.slice(0, 10) : '',\n },\n sort: { field: view.sort.field, direction: view.sort.direction },\n groupBy: view.groupBy,\n visibleFields: view.visibleFields,\n };\n}\n\nconst norm = (a: readonly string[]) => [...a].sort().join('\\u0000');\n\n/** Whether two configurations would save as the same thing — drives the \"unsaved changes\" hint. */\nexport function configsEqual(a: BoardViewConfigState, b: BoardViewConfigState): boolean {\n return (\n norm(a.filter.assigneeIds) === norm(b.filter.assigneeIds) &&\n a.filter.unassigned === b.filter.unassigned &&\n norm(a.filter.types) === norm(b.filter.types) &&\n norm(a.filter.priorities) === norm(b.filter.priorities) &&\n norm(a.filter.labels) === norm(b.filter.labels) &&\n a.filter.search.trim() === b.filter.search.trim() &&\n a.filter.sprintId === b.filter.sprintId &&\n a.filter.milestoneId === b.filter.milestoneId &&\n a.filter.dueFrom === b.filter.dueFrom &&\n a.filter.dueTo === b.filter.dueTo &&\n a.sort.field === b.sort.field &&\n a.sort.direction === b.sort.direction &&\n a.groupBy === b.groupBy &&\n norm(a.visibleFields) === norm(b.visibleFields)\n );\n}\n\n/** The `?view=` URL parameter that keeps an applied view linkable — read via `window.location.search`, the same\n * convention this codebase already uses for `?taskId=` and `?objectiveId=`. */\nexport function readViewIdFromUrl(): string | null {\n if (typeof window === 'undefined') return null;\n return new URLSearchParams(window.location.search).get('view') || null;\n}\n\n/** Keeps the applied view linkable without adding a history entry or touching the host shell's own router. */\nexport function writeViewIdToUrl(viewId: string | null): void {\n if (typeof window === 'undefined') return;\n const url = new URL(window.location.href);\n if (viewId) url.searchParams.set('view', viewId);\n else url.searchParams.delete('view');\n window.history.replaceState(window.history.state, '', url);\n}\n\n// ─── Queries & mutations ────────────────────────────────────────────────────\n\nconst BOARD_VIEW_FIELDS = `\n id\n name\n description\n projectId\n boardId\n board {\n id\n name\n }\n ownerId\n visibility\n isMine\n filter {\n assigneeIds\n unassigned\n types\n priorities\n labels\n search\n sprintId\n milestoneId\n dueFrom\n dueTo\n }\n groupBy\n sort {\n field\n direction\n }\n visibleFields\n createdAt\n updatedAt\n`;\n\n/** Own views plus every SHARED one of the project (server rule — `mine` is left unset on purpose). */\nexport const BOARD_VIEWS = gql`\n query ProjectBoardViews($workspaceId: ID!, $filter: PlanmagnetBoardViewFilter, $pagination: PlanmagnetPaginationInput) {\n planmagnetBoardViews(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {\n items {\n ${BOARD_VIEW_FIELDS}\n }\n totalCount\n }\n }\n`;\n\nexport const CREATE_BOARD_VIEW = gql`\n mutation ProjectBoardViewCreate($input: PlanmagnetCreateBoardViewInput!) {\n planmagnetCreateBoardView(input: $input) {\n ${BOARD_VIEW_FIELDS}\n }\n }\n`;\n\nexport const UPDATE_BOARD_VIEW = gql`\n mutation ProjectBoardViewUpdate($id: ID!, $input: PlanmagnetUpdateBoardViewInput!) {\n planmagnetUpdateBoardView(id: $id, input: $input) {\n ${BOARD_VIEW_FIELDS}\n }\n }\n`;\n\nexport const DELETE_BOARD_VIEW = gql`\n mutation ProjectBoardViewDelete($id: ID!) {\n planmagnetDeleteBoardView(id: $id)\n }\n`;\n\n/** The only query a board-view write can move: the bar's own list. Board data reacts to `filter`/`sort`/`groupBy`\n * changing on ProjectBoard's own state, which re-runs its query on its own — no refetch entry needed for it. */\nexport const VIEW_REFETCH = ['ProjectBoardViews'];\n\nexport function useBoardViews(workspaceId: string | undefined, projectId: string) {\n const { data, loading, error, refetch } = useQuery<{\n planmagnetBoardViews: { items: BoardView[]; totalCount: number };\n }>(BOARD_VIEWS, {\n variables: {\n workspaceId: workspaceId ?? '',\n filter: { projectId },\n pagination: { first: 100 },\n },\n skip: !workspaceId,\n });\n return {\n views: data?.planmagnetBoardViews.items ?? [],\n loading: loading && !data,\n error: error ? error.message : null,\n refetch,\n };\n}\n\nexport interface SprintOption {\n id: string;\n name: string;\n status: string;\n}\n\nconst PROJECT_SPRINT_OPTIONS = gql`\n query BoardViewProjectSprints($workspaceId: ID!, $projectId: String) {\n planmagnetSprints(\n workspaceId: $workspaceId\n filter: { projectId: $projectId }\n pagination: { first: 100 }\n ) {\n items {\n id\n name\n status\n }\n }\n }\n`;\n\n/** A project's sprints, for the sprint filter and for naming SPRINT swimlanes. */\nexport function useProjectSprintOptions(\n workspaceId: string | undefined,\n projectId: string | null | undefined\n) {\n const { data, loading, error } = useQuery<{\n planmagnetSprints?: { items: SprintOption[] };\n }>(PROJECT_SPRINT_OPTIONS, {\n variables: { workspaceId: workspaceId ?? '', projectId },\n skip: !workspaceId || !projectId,\n });\n return {\n options: data?.planmagnetSprints?.items ?? [],\n loading: loading && !data,\n error: error ? error.message : null,\n };\n}\n\n/** Convenience re-export so `BoardView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;CACnC,IAAM,IAAM,IAAI,IAAI,OAAO,SAAS,KAAK;AAGzC,CAFI,IAAQ,EAAI,aAAa,IAAI,QAAQ,EAAO,GAC3C,EAAI,aAAa,OAAO,OAAO,EACpC,OAAO,QAAQ,aAAa,OAAO,QAAQ,OAAO,IAAI,EAAI;;AAK5D,IAAM,IAAoB,2XAoCb,IAAc,CAAG;;;;UAIpB,EAAkB;;;;;GAOf,IAAoB,CAAG;;;QAG5B,EAAkB;;;GAKb,IAAoB,CAAG;;;QAG5B,EAAkB;;;GAKb,IAAoB,CAAG;;;;GAQvB,IAAe,CAAC,oBAAoB;AAEjD,SAAgB,EAAc,GAAiC,GAAmB;CAChF,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,EAEvC,GAAa;EACd,WAAW;GACT,aAAa,KAAe;GAC5B,QAAQ,EAAE,cAAW;GACrB,YAAY,EAAE,OAAO,KAAK;GAC3B;EACD,MAAM,CAAC;EACR,CAAC;AACF,QAAO;EACL,OAAO,GAAM,qBAAqB,SAAS,EAAE;EAC7C,SAAS,KAAW,CAAC;EACrB,OAAO,IAAQ,EAAM,UAAU;EAC/B;EACD;;AASH,IAAM,IAAyB,CAAG;;;;;;;;;;;;;;;AAiBlC,SAAgB,EACd,GACA,GACA;CACA,IAAM,EAAE,SAAM,YAAS,aAAU,EAE9B,GAAwB;EACzB,WAAW;GAAE,aAAa,KAAe;GAAI;GAAW;EACxD,MAAM,CAAC,KAAe,CAAC;EACxB,CAAC;AACF,QAAO;EACL,SAAS,GAAM,mBAAmB,SAAS,EAAE;EAC7C,SAAS,KAAW,CAAC;EACrB,OAAO,IAAQ,EAAM,UAAU;EAChC"}
|
|
@@ -4,7 +4,7 @@ import { ReactNode } from 'react';
|
|
|
4
4
|
* A button that asks before it acts. Used for anything that cannot be undone from the UI (complete or cancel a
|
|
5
5
|
* sprint, delete a task, a project or a roadmap).
|
|
6
6
|
*/
|
|
7
|
-
export declare function ConfirmButton({ label, icon, title, description, confirmLabel, onConfirm, disabled, destructive, variant, cancelLabel, ariaLabel, }: {
|
|
7
|
+
export declare function ConfirmButton({ label, icon, title, description, confirmLabel, onConfirm, disabled, destructive, variant, cancelLabel, ariaLabel, testId, }: {
|
|
8
8
|
label: string;
|
|
9
9
|
icon: ReactNode;
|
|
10
10
|
title: string;
|
|
@@ -17,6 +17,8 @@ export declare function ConfirmButton({ label, icon, title, description, confirm
|
|
|
17
17
|
cancelLabel?: string;
|
|
18
18
|
/** Required when `label` is empty (an icon-only button): icons are aria-hidden. */
|
|
19
19
|
ariaLabel?: string;
|
|
20
|
+
/** `data-testid` on the trigger button, for callers that need one addressable from a test. */
|
|
21
|
+
testId?: string;
|
|
20
22
|
}): import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
/** An inline refusal reason, announced to screen readers. */
|
|
22
24
|
export declare function ErrorLine({ message }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmButton.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/controls/ConfirmButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAcvC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,IAAI,EACJ,KAAK,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,WAAmB,EACnB,OAAmB,EACnB,WAAuB,EACvB,SAAS,
|
|
1
|
+
{"version":3,"file":"ConfirmButton.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/controls/ConfirmButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAcvC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,IAAI,EACJ,KAAK,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,WAAmB,EACnB,OAAmB,EACnB,WAAuB,EACvB,SAAS,EACT,MAAM,GACP,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,2CAoCA;AAED,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,2CAMzD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
2
|
import { AlertDialog as n, AlertDialogAction as r, AlertDialogCancel as i, AlertDialogContent as a, AlertDialogDescription as o, AlertDialogFooter as s, AlertDialogHeader as c, AlertDialogTitle as l, AlertDialogTrigger as u, Button as d } from "@burdenoff/fe-libs/ui";
|
|
3
3
|
//#region src/planmagnet/controls/ConfirmButton.tsx
|
|
4
|
-
function f({ label: f, icon: p, title: m, description: h, confirmLabel: g, onConfirm: _, disabled: v, destructive: y = !1, variant: b = "default", cancelLabel: x = "Keep it", ariaLabel: S }) {
|
|
4
|
+
function f({ label: f, icon: p, title: m, description: h, confirmLabel: g, onConfirm: _, disabled: v, destructive: y = !1, variant: b = "default", cancelLabel: x = "Keep it", ariaLabel: S, testId: C }) {
|
|
5
5
|
return /* @__PURE__ */ t(n, { children: [/* @__PURE__ */ e(u, {
|
|
6
6
|
asChild: !0,
|
|
7
7
|
children: /* @__PURE__ */ t(d, {
|
|
@@ -9,6 +9,7 @@ function f({ label: f, icon: p, title: m, description: h, confirmLabel: g, onCon
|
|
|
9
9
|
variant: b,
|
|
10
10
|
disabled: v,
|
|
11
11
|
"aria-label": S,
|
|
12
|
+
"data-testid": C,
|
|
12
13
|
children: [p, f]
|
|
13
14
|
})
|
|
14
15
|
}), /* @__PURE__ */ t(a, { children: [/* @__PURE__ */ t(c, { children: [/* @__PURE__ */ e(l, { children: m }), /* @__PURE__ */ e(o, { children: h })] }), /* @__PURE__ */ t(s, { children: [/* @__PURE__ */ e(i, { children: x }), /* @__PURE__ */ e(r, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmButton.js","names":[],"sources":["../../../src/planmagnet/controls/ConfirmButton.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n Button,\n} from '@burdenoff/fe-libs/ui';\n\n/**\n * A button that asks before it acts. Used for anything that cannot be undone from the UI (complete or cancel a\n * sprint, delete a task, a project or a roadmap).\n */\nexport function ConfirmButton({\n label,\n icon,\n title,\n description,\n confirmLabel,\n onConfirm,\n disabled,\n destructive = false,\n variant = 'default',\n cancelLabel = 'Keep it',\n ariaLabel,\n}: {\n label: string;\n icon: ReactNode;\n title: string;\n description: string;\n confirmLabel: string;\n onConfirm: () => void;\n disabled: boolean;\n destructive?: boolean;\n variant?: 'default' | 'outline';\n cancelLabel?: string;\n /** Required when `label` is empty (an icon-only button): icons are aria-hidden. */\n ariaLabel?: string;\n}) {\n return (\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button
|
|
1
|
+
{"version":3,"file":"ConfirmButton.js","names":[],"sources":["../../../src/planmagnet/controls/ConfirmButton.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n Button,\n} from '@burdenoff/fe-libs/ui';\n\n/**\n * A button that asks before it acts. Used for anything that cannot be undone from the UI (complete or cancel a\n * sprint, delete a task, a project or a roadmap).\n */\nexport function ConfirmButton({\n label,\n icon,\n title,\n description,\n confirmLabel,\n onConfirm,\n disabled,\n destructive = false,\n variant = 'default',\n cancelLabel = 'Keep it',\n ariaLabel,\n testId,\n}: {\n label: string;\n icon: ReactNode;\n title: string;\n description: string;\n confirmLabel: string;\n onConfirm: () => void;\n disabled: boolean;\n destructive?: boolean;\n variant?: 'default' | 'outline';\n cancelLabel?: string;\n /** Required when `label` is empty (an icon-only button): icons are aria-hidden. */\n ariaLabel?: string;\n /** `data-testid` on the trigger button, for callers that need one addressable from a test. */\n testId?: string;\n}) {\n return (\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button\n size=\"sm\"\n variant={variant}\n disabled={disabled}\n aria-label={ariaLabel}\n data-testid={testId}\n >\n {icon}\n {label}\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>{title}</AlertDialogTitle>\n <AlertDialogDescription>{description}</AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>{cancelLabel}</AlertDialogCancel>\n <AlertDialogAction\n onClick={onConfirm}\n className={\n destructive\n ? 'bg-destructive text-destructive-foreground hover:bg-destructive/90'\n : ''\n }\n >\n {confirmLabel}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n}\n\n/** An inline refusal reason, announced to screen readers. */\nexport function ErrorLine({ message }: { message: string }) {\n return (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {message}\n </p>\n );\n}\n"],"mappings":";;;AAkBA,SAAgB,EAAc,EAC5B,UACA,SACA,UACA,gBACA,iBACA,cACA,aACA,iBAAc,IACd,aAAU,WACV,iBAAc,WACd,cACA,aAgBC;AACD,QACE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;EAAoB,SAAA;YAClB,kBAAC,GAAD;GACE,MAAK;GACI;GACC;GACV,cAAY;GACZ,eAAa;aALf,CAOG,GACA,EACM;;EACU,CAAA,EACrB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAmB,GAAyB,CAAA,EAC5C,kBAAC,GAAD,EAAA,UAAyB,GAAqC,CAAA,CAC5C,EAAA,CAAA,EACpB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAoB,GAAgC,CAAA,EACpD,kBAAC,GAAD;EACE,SAAS;EACT,WACE,IACI,uEACA;YAGL;EACiB,CAAA,CACF,EAAA,CAAA,CACD,EAAA,CAAA,CACT,EAAA,CAAA;;AAKlB,SAAgB,EAAU,EAAE,cAAgC;AAC1D,QACE,kBAAC,KAAD;EAAG,MAAK;EAAQ,WAAU;YACvB;EACC,CAAA"}
|
|
@@ -3,8 +3,8 @@ import { LEAVES_PAGE_CONTEXT as t, throwOnError as n } from "../utils/mutationRe
|
|
|
3
3
|
import { ConfirmButton as r, ErrorLine as i } from "./ConfirmButton.js";
|
|
4
4
|
import { ProjectSelect as a, WorkItemSearchSelect as o } from "./Pickers.js";
|
|
5
5
|
import { enumLabel as s } from "./WorkItemControls.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { parseIntField as c } from "../utils/formValidation.js";
|
|
7
|
+
import { detailPath as l } from "../utils/rowNavigation.js";
|
|
8
8
|
import { useState as u } from "react";
|
|
9
9
|
import { BarChart3 as d, Pencil as f, ThumbsUp as p, Trash2 as m } from "lucide-react";
|
|
10
10
|
import { gql as h } from "@apollo/client";
|
|
@@ -82,13 +82,13 @@ function F({ featureId: e, voted: t }) {
|
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
function I({ feature: a }) {
|
|
85
|
-
let o = e(), [
|
|
85
|
+
let o = e(), [c, f] = g(M, P), [p, h] = g(N, {
|
|
86
86
|
refetchQueries: k.filter((e) => e !== "GetFeatureRequest"),
|
|
87
87
|
context: t
|
|
88
88
|
}), [b, x] = u(null), S = f.loading || h.loading, C = O.includes(a.status) ? O : [a.status, ...O], w = async (e) => {
|
|
89
89
|
x(null);
|
|
90
90
|
try {
|
|
91
|
-
await n(
|
|
91
|
+
await n(c({ variables: {
|
|
92
92
|
id: a.id,
|
|
93
93
|
input: { status: e }
|
|
94
94
|
} }));
|
|
@@ -127,7 +127,7 @@ function I({ feature: a }) {
|
|
|
127
127
|
size: "sm",
|
|
128
128
|
variant: "outline",
|
|
129
129
|
"data-testid": "feature-analytics",
|
|
130
|
-
onClick: () => o(
|
|
130
|
+
onClick: () => o(l("/products/feature-analytics-page", a.id)),
|
|
131
131
|
children: [/* @__PURE__ */ _(d, { className: "mr-1 h-4 w-4" }), "Analytics"]
|
|
132
132
|
}),
|
|
133
133
|
/* @__PURE__ */ _(r, {
|
|
@@ -153,18 +153,18 @@ function L({ feature: e }) {
|
|
|
153
153
|
effortEstimate: e.effortEstimate ?? "",
|
|
154
154
|
projectId: e.projectId ?? "",
|
|
155
155
|
workItemId: e.workItemId ?? ""
|
|
156
|
-
}, [r, s] = u(!1), [
|
|
156
|
+
}, [r, s] = u(!1), [l, d] = u(t), [p, m] = u(null), [h, O] = g(M, P), k = c(l.businessValue, {
|
|
157
157
|
min: 0,
|
|
158
158
|
max: 100
|
|
159
|
-
}), A =
|
|
159
|
+
}), A = l.title.trim() !== "" && !k.invalid && !O.loading, j = async () => {
|
|
160
160
|
m(null);
|
|
161
161
|
let r = (e) => e.trim() ? e.trim() : null, i = {
|
|
162
|
-
title:
|
|
163
|
-
description: r(
|
|
162
|
+
title: l.title.trim(),
|
|
163
|
+
description: r(l.description),
|
|
164
164
|
businessValue: k.value ?? null,
|
|
165
|
-
effortEstimate: r(
|
|
166
|
-
projectId:
|
|
167
|
-
workItemId:
|
|
165
|
+
effortEstimate: r(l.effortEstimate),
|
|
166
|
+
projectId: l.projectId || null,
|
|
167
|
+
workItemId: l.workItemId || null
|
|
168
168
|
}, a = {
|
|
169
169
|
title: t.title,
|
|
170
170
|
description: r(t.description),
|
|
@@ -213,9 +213,9 @@ function L({ feature: e }) {
|
|
|
213
213
|
}), /* @__PURE__ */ _(b, {
|
|
214
214
|
id: "feature-edit-title",
|
|
215
215
|
className: "mt-1",
|
|
216
|
-
value:
|
|
216
|
+
value: l.title,
|
|
217
217
|
onChange: (e) => d({
|
|
218
|
-
...
|
|
218
|
+
...l,
|
|
219
219
|
title: e.target.value
|
|
220
220
|
})
|
|
221
221
|
})] }),
|
|
@@ -226,9 +226,9 @@ function L({ feature: e }) {
|
|
|
226
226
|
}), /* @__PURE__ */ _("textarea", {
|
|
227
227
|
id: "feature-edit-description",
|
|
228
228
|
className: "mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm min-h-[72px]",
|
|
229
|
-
value:
|
|
229
|
+
value: l.description,
|
|
230
230
|
onChange: (e) => d({
|
|
231
|
-
...
|
|
231
|
+
...l,
|
|
232
232
|
description: e.target.value
|
|
233
233
|
})
|
|
234
234
|
})] }),
|
|
@@ -244,10 +244,10 @@ function L({ feature: e }) {
|
|
|
244
244
|
min: 0,
|
|
245
245
|
max: 100,
|
|
246
246
|
className: "mt-1",
|
|
247
|
-
value:
|
|
247
|
+
value: l.businessValue,
|
|
248
248
|
"aria-invalid": k.invalid,
|
|
249
249
|
onChange: (e) => d({
|
|
250
|
-
...
|
|
250
|
+
...l,
|
|
251
251
|
businessValue: e.target.value
|
|
252
252
|
})
|
|
253
253
|
})] }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
|
|
@@ -258,9 +258,9 @@ function L({ feature: e }) {
|
|
|
258
258
|
id: "feature-edit-effort",
|
|
259
259
|
className: "mt-1",
|
|
260
260
|
placeholder: "e.g. M",
|
|
261
|
-
value:
|
|
261
|
+
value: l.effortEstimate,
|
|
262
262
|
onChange: (e) => d({
|
|
263
|
-
...
|
|
263
|
+
...l,
|
|
264
264
|
effortEstimate: e.target.value
|
|
265
265
|
})
|
|
266
266
|
})] })]
|
|
@@ -274,10 +274,10 @@ function L({ feature: e }) {
|
|
|
274
274
|
className: "mt-1",
|
|
275
275
|
children: /* @__PURE__ */ _(a, {
|
|
276
276
|
id: "feature-edit-project",
|
|
277
|
-
value:
|
|
277
|
+
value: l.projectId,
|
|
278
278
|
noneLabel: "No project",
|
|
279
279
|
onChange: (e) => d({
|
|
280
|
-
...
|
|
280
|
+
...l,
|
|
281
281
|
projectId: e,
|
|
282
282
|
workItemId: ""
|
|
283
283
|
})
|
|
@@ -291,10 +291,10 @@ function L({ feature: e }) {
|
|
|
291
291
|
className: "mt-1",
|
|
292
292
|
children: /* @__PURE__ */ _(o, {
|
|
293
293
|
id: "feature-edit-workitem",
|
|
294
|
-
projectId:
|
|
295
|
-
value:
|
|
294
|
+
projectId: l.projectId || void 0,
|
|
295
|
+
value: l.workItemId,
|
|
296
296
|
onChange: (e) => d({
|
|
297
|
-
...
|
|
297
|
+
...l,
|
|
298
298
|
workItemId: e
|
|
299
299
|
})
|
|
300
300
|
})
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/** A project select. '' means "no project" when `noneLabel` is given. `exclude` hides ids already spoken for. */
|
|
2
|
-
export declare function ProjectSelect({ id, value, onChange, noneLabel, exclude, }: {
|
|
2
|
+
export declare function ProjectSelect({ id, value, onChange, noneLabel, exclude, disabled, }: {
|
|
3
3
|
id?: string;
|
|
4
4
|
value: string;
|
|
5
5
|
onChange: (projectId: string) => void;
|
|
6
6
|
noneLabel?: string;
|
|
7
7
|
exclude?: string[];
|
|
8
|
+
disabled?: boolean;
|
|
8
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
/** A team select (BOFF-8044). '' means "no team" when `noneLabel` is given. */
|
|
10
11
|
export declare function TeamSelect({ id, value, onChange, noneLabel, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pickers.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/controls/Pickers.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Pickers.d.ts","sourceRoot":"","sources":["../../../src/planmagnet/controls/Pickers.tsx"],"names":[],"mappings":"AAkCA,iHAAiH;AACjH,wBAAgB,aAAa,CAAC,EAC5B,EAAE,EACF,KAAK,EACL,QAAQ,EACR,SAAS,EACT,OAAY,EACZ,QAAgB,GACjB,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,2CA6DA;AAcD,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,EACzB,EAAE,EACF,KAAK,EACL,QAAQ,EACR,SAAS,GACV,EAAE;IACD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CA+BA;AAeD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,EAAE,EACF,SAAS,EACT,KAAK,EACL,QAAQ,EACR,OAAY,GACb,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,2CAqDA;AAcD,iCAAiC;AACjC,wBAAgB,eAAe,CAAC,EAC9B,EAAE,EACF,KAAK,EACL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