@parallelworks/tandem-web 0.142.0 → 0.144.0

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.
Files changed (58) hide show
  1. package/_virtual/_virtual_i18n/en/common.js +156 -6
  2. package/_virtual/_virtual_i18n/es/common.js +156 -6
  3. package/_virtual/_virtual_i18n/ja/common.js +156 -6
  4. package/_virtual/_virtual_i18n/ko/common.js +156 -6
  5. package/_virtual/_virtual_i18n/zh/common.js +156 -6
  6. package/api/queries.js +85 -74
  7. package/components/AccessGrants.js +6 -6
  8. package/components/ActivityTimeline.js +2 -0
  9. package/components/CodeHostSettings.js +25 -25
  10. package/components/CustomFields.js +349 -0
  11. package/components/DocProperties.js +8 -2
  12. package/components/GitHub.js +22 -22
  13. package/components/IssueBoard.js +48 -43
  14. package/components/IssueEvent.js +2 -0
  15. package/components/IssueFilters.js +210 -122
  16. package/components/IssueImport.js +1 -1
  17. package/components/IssueRow.js +96 -79
  18. package/components/IssueTemplates.js +216 -156
  19. package/components/IssueTypes.js +318 -0
  20. package/components/NewIssueDialog.js +254 -216
  21. package/components/SettingsNav.js +45 -35
  22. package/components/TeamForm.js +49 -35
  23. package/components/TeamRepositories.js +51 -51
  24. package/components/TeamWorkflow.js +8 -8
  25. package/components/Updates.js +8 -8
  26. package/components/icons.js +8 -8
  27. package/lib/boardMove.js +69 -47
  28. package/lib/customFields.js +113 -0
  29. package/lib/issueDisplay.js +27 -12
  30. package/lib/issueList.js +166 -62
  31. package/lib/issueTypes.js +50 -0
  32. package/lib/teamTree.js +24 -0
  33. package/lib/views.js +13 -11
  34. package/package.json +1 -1
  35. package/pages/issues.js +331 -291
  36. package/routeTree.gen.js +186 -174
  37. package/routes/_workspace/agents/index2.js +9 -9
  38. package/routes/_workspace/issues/_identifier2.js +433 -370
  39. package/routes/_workspace/projects/_projectId3.js +213 -201
  40. package/routes/_workspace/settings/audit-log3.js +2 -0
  41. package/routes/_workspace/settings/fields.js +6 -0
  42. package/routes/_workspace/settings/fields2.js +30 -0
  43. package/routes/_workspace/settings/fields3.js +5 -0
  44. package/routes/_workspace/settings/groups2.js +74 -74
  45. package/routes/_workspace/settings/import.js +6 -0
  46. package/routes/_workspace/settings/import2.js +330 -0
  47. package/routes/_workspace/settings/import3.js +4 -0
  48. package/routes/_workspace/settings/labels2.js +33 -33
  49. package/routes/_workspace/settings/members2.js +35 -35
  50. package/routes/_workspace/settings/roles2.js +24 -24
  51. package/routes/_workspace/settings/runners2.js +18 -18
  52. package/routes/_workspace/settings/sessions2.js +9 -9
  53. package/routes/_workspace/settings/slack2.js +8 -8
  54. package/routes/_workspace/settings/sso2.js +50 -50
  55. package/routes/_workspace/settings/tokens2.js +15 -15
  56. package/routes/_workspace/settings/webhooks2.js +42 -42
  57. package/routes/_workspace/teams/_key/settings2.js +138 -76
  58. package/routes/_workspace2.js +320 -318
@@ -1,7 +1,7 @@
1
1
  import { meQuery as e } from "../api/queries.js";
2
- import { HealthIcon as t } from "./Planning.js";
3
- import { usePeople as n } from "../lib/people.js";
4
- import { useConfirm as r } from "../lib/confirm.js";
2
+ import { useConfirm as t } from "../lib/confirm.js";
3
+ import { HealthIcon as n } from "./Planning.js";
4
+ import { usePeople as r } from "../lib/people.js";
5
5
  import { ActionMenu as i, Avatar as a, Button as o, Card as s, ErrorText as c, RelativeTime as l, Select as u, Textarea as d, buttonClasses as f, cx as p, fieldBox as m } from "@parallelworks/ui";
6
6
  import { useState as h } from "react";
7
7
  import { useErrorMessage as g } from "@parallelworks/problem/react";
@@ -16,13 +16,13 @@ var S = [
16
16
  "off_track"
17
17
  ];
18
18
  function C({ workspace: C, state: w, health: T, updates: E, canWrite: D, placeholder: O, post: k, remove: A }) {
19
- let j = _("planning"), M = _("common"), { data: N } = b(e), { confirm: P, dialog: F } = r(), I = g(), { actorName: L, avatarOf: R } = n(C), [z, B] = h(T ?? "on_track"), [V, H] = h("");
19
+ let j = _("planning"), M = _("common"), { data: N } = b(e), { confirm: P, dialog: F } = t(), I = g(), { actorName: L, avatarOf: R } = r(C), [z, B] = h(T ?? "on_track"), [V, H] = h("");
20
20
  return /* @__PURE__ */ y("section", { children: [
21
21
  /* @__PURE__ */ y("h2", {
22
22
  className: "flex items-center gap-2 text-base font-semibold",
23
23
  children: [j("updates"), /* @__PURE__ */ y("span", {
24
24
  className: "flex items-center gap-1 text-xs font-normal text-muted-foreground",
25
- children: [/* @__PURE__ */ v(t, { state: w }), j(`health.${w}`)]
25
+ children: [/* @__PURE__ */ v(n, { state: w }), j(`health.${w}`)]
26
26
  })]
27
27
  }),
28
28
  D && /* @__PURE__ */ y("form", {
@@ -54,12 +54,12 @@ function C({ workspace: C, state: w, health: T, updates: E, canWrite: D, placeho
54
54
  items: S.map((e) => ({
55
55
  value: e,
56
56
  label: j(`health.${e}`),
57
- icon: /* @__PURE__ */ v(t, { state: e })
57
+ icon: /* @__PURE__ */ v(n, { state: e })
58
58
  })),
59
59
  trigger: /* @__PURE__ */ y("button", {
60
60
  type: "button",
61
61
  className: f({ size: "sm" }),
62
- children: [/* @__PURE__ */ v(t, { state: z }), j(`health.${z}`)]
62
+ children: [/* @__PURE__ */ v(n, { state: z }), j(`health.${z}`)]
63
63
  })
64
64
  }),
65
65
  k.isError && /* @__PURE__ */ v(c, {
@@ -90,7 +90,7 @@ function C({ workspace: C, state: w, health: T, updates: E, canWrite: D, placeho
90
90
  children: [/* @__PURE__ */ y("div", {
91
91
  className: "flex items-center gap-2 text-xs",
92
92
  children: [
93
- /* @__PURE__ */ v(t, { state: e.health }),
93
+ /* @__PURE__ */ v(n, { state: e.health }),
94
94
  /* @__PURE__ */ v("span", {
95
95
  className: "font-medium",
96
96
  children: j(`health.${e.health}`)
@@ -200,12 +200,12 @@ function l(e) {
200
200
  });
201
201
  };
202
202
  }
203
- var u = l(r.AddIcon), d = l(r.ColumnsIcon), f = l(r.AttachmentIcon), p = l(r.BranchIcon), m = l(r.CalendarIcon), h = l(r.ClockIcon), g = l(r.CheckIcon), _ = l(r.ChevronDownIcon), v = l(r.ChevronRightIcon), y = l(r.CloseIcon), b = l(r.CommentIcon), x = l(r.DownloadIcon), S = l(r.UploadIcon), C = l(r.ExpandIcon), w = l(r.FileTextIcon), T = l(r.FolderIcon), E = l(r.ChartIcon), D = l(r.GridIcon), O = l(r.HistoryIcon), k = l(r.InboxIcon), A = l(r.KeyIcon), j = l(r.MinimizeIcon), M = l(r.LibraryIcon), N = l(r.ListViewIcon), P = l(r.MailIcon);
203
+ var u = l(r.AddIcon), d = l(r.ColumnsIcon), f = l(r.AttachmentIcon), p = l(r.BranchIcon), m = l(r.CalendarIcon), h = l(r.ClockIcon), g = l(r.CheckIcon), _ = l(r.ChevronDownIcon), v = l(r.ChevronRightIcon), y = l(r.CloseIcon), b = l(r.CommentIcon), x = l(r.DownloadIcon), S = l(r.UploadIcon), C = l(r.ExpandIcon), w = l(r.FileTextIcon), T = l(r.FolderIcon), E = l(r.ChartIcon), D = l(r.GridIcon), O = l(r.HistoryIcon), k = l(r.InboxIcon), A = l(r.KeyIcon), j = l(r.MinimizeIcon), M = l(r.LibraryIcon), N = l(r.ListViewIcon), P = l(r.MailIcon), F = l(r.MigrationIcon);
204
204
  r.NavigationIcon;
205
- var F = l(r.NotificationIcon), te = l(r.QueueIcon), I = l(r.ProjectIcon), L = l(r.PullRequestIcon), R = l(r.RepositoryIcon), z = l(r.SearchIcon), B = l(r.SettingsIcon), V = l(r.ShieldIcon), H = l(r.ShrinkIcon);
205
+ var te = l(r.NotificationIcon), I = l(r.QueueIcon), L = l(r.ProjectIcon), R = l(r.PullRequestIcon), z = l(r.RepositoryIcon), B = l(r.SearchIcon), V = l(r.SettingsIcon), H = l(r.ShieldIcon), U = l(r.ShrinkIcon);
206
206
  r.SignOutIcon;
207
- var U = l(r.TagIcon), W = l(r.UserIcon), G = l(r.UsersIcon), K = l(r.WebhookIcon), q = l(r.WorkerIcon), J = c("M1.75 9a6.25 4.25 0 1 0 12.5 0 6.25 4.25 0 1 0-12.5 0ZM6.75 3 9 4.75 6.75 6.5"), Y = c("M2.5 3.5h11v9h-11ZM10 3.5v9"), X = c("M2.5 2.5v11M4.5 4.5h5M6.5 8h7M5.5 11.5h4.5"), Z = c("M3 13 13 3M3 9.5 9.5 3M6.5 13 13 6.5"), Q = c("M3.5 2.5h9a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1ZM5.5 5h2a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-2a.5.5 0 0 1 .5-.5Z");
208
- function ne({ className: e = "size-4" }) {
207
+ var W = l(r.TagIcon), G = l(r.UserIcon), K = l(r.UsersIcon), q = l(r.WebhookIcon), J = l(r.WorkerIcon), Y = c("M1.75 9a6.25 4.25 0 1 0 12.5 0 6.25 4.25 0 1 0-12.5 0ZM6.75 3 9 4.75 6.75 6.5"), X = c("M2.5 3.5h11v9h-11ZM10 3.5v9"), Z = c("M2.5 2.5v11M4.5 4.5h5M6.5 8h7M5.5 11.5h4.5"), Q = c("M3 13 13 3M3 9.5 9.5 3M6.5 13 13 6.5"), ne = c("M3.5 2.5h9a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1h-9a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1ZM5.5 5h2a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1-.5-.5v-2a.5.5 0 0 1 .5-.5Z");
208
+ function re({ className: e = "size-4" }) {
209
209
  return /* @__PURE__ */ t("svg", {
210
210
  viewBox: "0 0 16 16",
211
211
  className: `shrink-0 ${e}`,
@@ -214,10 +214,10 @@ function ne({ className: e = "size-4" }) {
214
214
  children: /* @__PURE__ */ t("path", { d: "M8 0a8 8 0 0 0-2.53 15.59c.4.07.55-.17.55-.38v-1.33c-2.23.48-2.7-1.07-2.7-1.07-.36-.92-.89-1.17-.89-1.17-.73-.5.06-.49.06-.49.8.06 1.23.83 1.23.83.72 1.22 1.87.87 2.33.66.07-.52.28-.87.5-1.07-1.78-.2-3.65-.89-3.65-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.6 7.6 0 0 1 4 0c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.28.82 2.15 0 3.07-1.87 3.75-3.66 3.95.29.25.54.73.54 1.48v2.2c0 .21.15.46.55.38A8 8 0 0 0 8 0Z" })
215
215
  });
216
216
  }
217
- var re = l(r.AddUserIcon), ie = l(r.RemoveUserIcon), ae = l(r.ArchiveIcon), oe = l(r.RestoreIcon), $ = l(r.EditIcon), se = l(r.RenameIcon), ce = l(r.LinkIcon), le = l(r.UnlinkIcon);
217
+ var ie = l(r.AddUserIcon), ae = l(r.RemoveUserIcon), oe = l(r.ArchiveIcon), se = l(r.RestoreIcon), ce = l(r.EditIcon), le = l(r.RenameIcon), ue = l(r.LinkIcon), de = l(r.UnlinkIcon);
218
218
  r.CommitIcon;
219
- var ue = l(r.ReleaseIcon), de = l(r.MegaphoneIcon), fe = l(r.SwapIcon), pe = l(r.TrashIcon);
219
+ var fe = l(r.ReleaseIcon), pe = l(r.MegaphoneIcon), $ = l(r.SwapIcon), me = l(r.TrashIcon);
220
220
  r.EyeIcon;
221
- var me = l(r.SuccessIcon), he = l(r.CancelIcon), ge = l(r.AgentIcon);
221
+ var he = l(r.SuccessIcon), ge = l(r.CancelIcon), _e = l(r.AgentIcon);
222
222
  r.ArrowRightIcon;
223
- export { u as AddIcon, re as AddUserIcon, ge as AgentIcon, ae as ArchiveIcon, Q as AreaIcon, f as AttachmentIcon, d as BoardIcon, p as BranchIcon, m as CalendarIcon, he as CancelIcon, E as ChartIcon, g as CheckIcon, _ as ChevronDownIcon, v as ChevronRightIcon, h as ClockIcon, y as CloseIcon, ne as CodeHostIcon, b as CommentIcon, J as CycleIcon, x as DownloadIcon, $ as EditIcon, Z as EstimateIcon, C as ExpandIcon, w as FileTextIcon, T as FolderIcon, D as GridIcon, O as HistoryIcon, k as InboxIcon, A as KeyIcon, M as LibraryIcon, ce as LinkIcon, N as ListViewIcon, P as MailIcon, de as MegaphoneIcon, j as MinimizeIcon, F as NotificationIcon, ee as PriorityIcon, I as ProjectIcon, L as PullRequestIcon, ue as ReleaseIcon, ie as RemoveUserIcon, se as RenameIcon, R as RepositoryIcon, oe as RestoreIcon, z as SearchIcon, B as SettingsIcon, V as ShieldIcon, H as ShrinkIcon, Y as SidePanelIcon, a as StatusIcon, me as SuccessIcon, fe as SwapIcon, U as TagIcon, X as TimelineIcon, pe as TrashIcon, te as TriageIcon, le as UnlinkIcon, S as UploadIcon, W as UserIcon, G as UsersIcon, K as WebhookIcon, q as WorkerIcon, s as usePriorityNames };
223
+ export { u as AddIcon, ie as AddUserIcon, _e as AgentIcon, oe as ArchiveIcon, ne as AreaIcon, f as AttachmentIcon, d as BoardIcon, p as BranchIcon, m as CalendarIcon, ge as CancelIcon, E as ChartIcon, g as CheckIcon, _ as ChevronDownIcon, v as ChevronRightIcon, h as ClockIcon, y as CloseIcon, re as CodeHostIcon, b as CommentIcon, Y as CycleIcon, x as DownloadIcon, ce as EditIcon, Q as EstimateIcon, C as ExpandIcon, w as FileTextIcon, T as FolderIcon, D as GridIcon, O as HistoryIcon, k as InboxIcon, A as KeyIcon, M as LibraryIcon, ue as LinkIcon, N as ListViewIcon, P as MailIcon, pe as MegaphoneIcon, F as MigrationIcon, j as MinimizeIcon, te as NotificationIcon, ee as PriorityIcon, L as ProjectIcon, R as PullRequestIcon, fe as ReleaseIcon, ae as RemoveUserIcon, le as RenameIcon, z as RepositoryIcon, se as RestoreIcon, B as SearchIcon, V as SettingsIcon, H as ShieldIcon, U as ShrinkIcon, X as SidePanelIcon, a as StatusIcon, he as SuccessIcon, $ as SwapIcon, W as TagIcon, Z as TimelineIcon, me as TrashIcon, I as TriageIcon, de as UnlinkIcon, S as UploadIcon, G as UserIcon, K as UsersIcon, q as WebhookIcon, J as WorkerIcon, s as usePriorityNames };
package/lib/boardMove.js CHANGED
@@ -1,100 +1,122 @@
1
1
  import { api as e, unwrap as t } from "../api/client.js";
2
2
  import { issueQuery as n, statusesQuery as r } from "../api/queries.js";
3
- import { invalidateIssueViews as i } from "../api/mutations.js";
4
- import { toast as a } from "@parallelworks/ui";
5
- import { useCallback as o } from "react";
6
- import { useErrorMessage as s } from "@parallelworks/problem/react";
7
- import { useQueries as c, useQueryClient as l } from "@tanstack/react-query";
3
+ import { setIssueFields as i } from "./customFields.js";
4
+ import { invalidateIssueViews as a } from "../api/mutations.js";
5
+ import { toast as o } from "@parallelworks/ui";
6
+ import { useCallback as s } from "react";
7
+ import { useErrorMessage as c } from "@parallelworks/problem/react";
8
+ import { useQueries as l, useQueryClient as u } from "@tanstack/react-query";
8
9
  // src/lib/boardMove.ts
9
- function u(u, d) {
10
- let f = l(), p = s(), m = c({ queries: d.map((e) => r(u, e.key)) });
11
- return o(async (r, o, s, c, l) => {
12
- let h, g;
13
- if (o === "status") {
14
- let e = (m[d.findIndex((e) => e.id === r.teamId)]?.data ?? []).filter((e) => e.category === c).sort((e, t) => e.position - t.position)[0];
10
+ function d(d, f) {
11
+ let p = u(), m = c(), h = l({ queries: f.map((e) => r(d, e.key)) });
12
+ return s(async (r, s, c, l, u, g) => {
13
+ let _, v, y;
14
+ if (g) {
15
+ let e = l === "none" ? null : l;
16
+ if (g.kind === "checkbox" && (e = l === "true"), g.kind === "multi_select") {
17
+ let t = r.fields[g.id] ?? [];
18
+ e = l === "none" ? [] : [...t.filter((e) => e !== c && e !== l), l];
19
+ }
20
+ v = { [g.id]: e }, y = {
21
+ ...r,
22
+ fields: {
23
+ ...r.fields,
24
+ [g.id]: e
25
+ }
26
+ };
27
+ } else if (s === "type") {
28
+ let e = l === "none" ? void 0 : u?.type;
29
+ _ = { typeId: l === "none" ? "" : l };
30
+ let { type: t, ...n } = r;
31
+ y = e ? {
32
+ ...n,
33
+ type: e
34
+ } : n;
35
+ } else if (s === "status") {
36
+ let e = (h[f.findIndex((e) => e.id === r.teamId)]?.data ?? []).filter((e) => e.category === l).sort((e, t) => e.position - t.position)[0];
15
37
  if (!e) return;
16
- h = { statusId: e.id }, g = {
38
+ _ = { statusId: e.id }, y = {
17
39
  ...r,
18
40
  status: e
19
41
  };
20
- } else if (o === "priority") h = { priority: Number(c) }, g = {
42
+ } else if (s === "priority") _ = { priority: Number(l) }, y = {
21
43
  ...r,
22
- priority: Number(c)
44
+ priority: Number(l)
23
45
  };
24
- else if (o === "project") {
25
- let e = c === "none" ? void 0 : l?.project;
26
- if (c !== "none" && !e) return;
27
- h = { projectId: e?.id ?? "" };
46
+ else if (s === "project") {
47
+ let e = l === "none" ? void 0 : u?.project;
48
+ if (l !== "none" && !e) return;
49
+ _ = { projectId: e?.id ?? "" };
28
50
  let { project: t, ...n } = r;
29
- g = e ? {
51
+ y = e ? {
30
52
  ...n,
31
53
  project: e
32
54
  } : n;
33
- } else if (o === "assignee") {
34
- let e = (e) => `${e.kind}:${e.handle}`, t = c === "none" ? void 0 : l?.assignees.find((t) => e(t) === c);
35
- if (c !== "none" && !t) return;
36
- let n = r.assignees.find((t) => e(t) === s);
55
+ } else if (s === "assignee") {
56
+ let e = (e) => `${e.kind}:${e.handle}`, t = l === "none" ? void 0 : u?.assignees.find((t) => e(t) === l);
57
+ if (l !== "none" && !t) return;
58
+ let n = r.assignees.find((t) => e(t) === c);
37
59
  if (t) {
38
60
  let e = r.assignees.filter((e) => e !== n);
39
- h = {
61
+ _ = {
40
62
  addAssignees: [t],
41
63
  ...n && { removeAssignees: [n] }
42
- }, g = {
64
+ }, y = {
43
65
  ...r,
44
66
  assignees: [...e, t]
45
67
  };
46
- } else h = { removeAssignees: r.assignees }, g = {
68
+ } else _ = { removeAssignees: r.assignees }, y = {
47
69
  ...r,
48
70
  assignees: []
49
71
  };
50
72
  } else {
51
- let e = c === "none" ? void 0 : l?.labels.find((e) => e.id === c);
52
- if (c !== "none" && !e) return;
53
- let t = r.labels.find((e) => e.id === s);
73
+ let e = l === "none" ? void 0 : u?.labels.find((e) => e.id === l);
74
+ if (l !== "none" && !e) return;
75
+ let t = r.labels.find((e) => e.id === c);
54
76
  if (e) {
55
77
  let n = r.labels.filter((e) => e !== t);
56
- h = {
78
+ _ = {
57
79
  addLabels: [e.id],
58
80
  ...t && { removeLabels: [t.id] }
59
- }, g = {
81
+ }, y = {
60
82
  ...r,
61
83
  labels: [...n, e]
62
84
  };
63
- } else h = { removeLabels: r.labels.map((e) => e.id) }, g = {
85
+ } else _ = { removeLabels: r.labels.map((e) => e.id) }, y = {
64
86
  ...r,
65
87
  labels: []
66
88
  };
67
89
  }
68
- let _ = { queryKey: [
90
+ let b = { queryKey: [
69
91
  "workspace",
70
- u,
92
+ d,
71
93
  "issues",
72
94
  "list"
73
95
  ] };
74
- f.setQueriesData(_, (e) => e && {
96
+ p.setQueriesData(b, (e) => e && {
75
97
  ...e,
76
- issues: e.issues.map((e) => e.id === r.id ? g : e)
98
+ issues: e.issues.map((e) => e.id === r.id ? y : e)
77
99
  });
78
100
  try {
79
- let i = t(await e.PATCH("/api/v1/workspaces/{workspace}/issues/{identifier}", {
101
+ let a = v ? await i(d, r.identifier, v) : t(await e.PATCH("/api/v1/workspaces/{workspace}/issues/{identifier}", {
80
102
  params: { path: {
81
- workspace: u,
103
+ workspace: d,
82
104
  identifier: r.identifier
83
105
  } },
84
- body: h
106
+ body: _ ?? {}
85
107
  }));
86
- f.setQueryData(n(u, r.identifier).queryKey, i);
108
+ p.setQueryData(n(d, r.identifier).queryKey, a);
87
109
  } catch (e) {
88
- a.error(p(e));
110
+ o.error(m(e));
89
111
  } finally {
90
- i(f, u, r.identifier);
112
+ a(p, d, r.identifier);
91
113
  }
92
114
  }, [
93
- f,
94
- u,
115
+ p,
95
116
  d,
96
- m,
97
- p
117
+ f,
118
+ h,
119
+ m
98
120
  ]);
99
121
  }
100
- export { u as useBoardMove };
122
+ export { d as useBoardMove };
@@ -0,0 +1,113 @@
1
+ import { api as e, unwrap as t } from "../api/client.js";
2
+ import { queryOptions as n, useMutation as r, useQueryClient as i } from "@tanstack/react-query";
3
+ // src/lib/customFields.ts
4
+ var a = [
5
+ "text",
6
+ "number",
7
+ "select",
8
+ "multi_select",
9
+ "person",
10
+ "date",
11
+ "checkbox",
12
+ "url"
13
+ ], o = [
14
+ "select",
15
+ "multi_select",
16
+ "person",
17
+ "checkbox"
18
+ ], s = [
19
+ "number",
20
+ "date",
21
+ "select",
22
+ "text"
23
+ ], c = [
24
+ "select",
25
+ "multi_select",
26
+ "person",
27
+ "checkbox"
28
+ ], l = (r) => n({
29
+ queryKey: [
30
+ "workspace",
31
+ r,
32
+ "fields"
33
+ ],
34
+ queryFn: async ({ signal: n }) => t(await e.GET("/api/v1/workspaces/{workspace}/fields", {
35
+ params: { path: { workspace: r } },
36
+ signal: n
37
+ })).fields
38
+ });
39
+ function u(e, t, n, r = !1) {
40
+ return (e ?? []).filter((e) => e.target === t && (r || !e.archivedAt) && (!e.teamId || n !== void 0 && e.teamId === n)).sort((e, t) => Number(!!e.teamId) - Number(!!t.teamId) || e.position - t.position);
41
+ }
42
+ function d(e, t) {
43
+ return (e ?? []).filter((e) => e.target === "issue" && !e.archivedAt && (!e.teamId || t.includes(e.teamId)));
44
+ }
45
+ var f = (e) => e != null && e !== "" && e !== !1 && !(Array.isArray(e) && e.length === 0);
46
+ function p(e) {
47
+ return (e ?? "").split(",").map((e) => {
48
+ let t = e.indexOf(":");
49
+ return {
50
+ field: e.slice(0, t),
51
+ value: e.slice(t + 1)
52
+ };
53
+ }).filter((e) => e.field && e.value);
54
+ }
55
+ var m = (e) => e.map((e) => `${e.field}:${e.value}`).join(","), h = (e) => e?.startsWith("field:") ? e.slice(6) : void 0;
56
+ function g(n) {
57
+ let a = i(), o = () => a.invalidateQueries({ queryKey: [
58
+ "workspace",
59
+ n,
60
+ "fields"
61
+ ] });
62
+ return {
63
+ create: r({
64
+ mutationFn: async (r) => t(await e.POST("/api/v1/workspaces/{workspace}/fields", {
65
+ params: { path: { workspace: n } },
66
+ body: r
67
+ })),
68
+ onSettled: o
69
+ }),
70
+ update: r({
71
+ mutationFn: async ({ id: r, ...i }) => t(await e.PATCH("/api/v1/workspaces/{workspace}/fields/{field}", {
72
+ params: { path: {
73
+ workspace: n,
74
+ field: r
75
+ } },
76
+ body: i
77
+ })),
78
+ onSettled: () => {
79
+ o(), a.invalidateQueries({ queryKey: [
80
+ "workspace",
81
+ n,
82
+ "issues"
83
+ ] });
84
+ }
85
+ }),
86
+ remove: r({
87
+ mutationFn: async (r) => t(await e.DELETE("/api/v1/workspaces/{workspace}/fields/{field}", { params: { path: {
88
+ workspace: n,
89
+ field: r
90
+ } } })),
91
+ onSettled: o
92
+ })
93
+ };
94
+ }
95
+ async function _(n, r, i) {
96
+ return t(await e.PATCH("/api/v1/workspaces/{workspace}/issues/{identifier}/fields", {
97
+ params: { path: {
98
+ workspace: n,
99
+ identifier: r
100
+ } },
101
+ body: { values: i }
102
+ }));
103
+ }
104
+ async function v(n, r, i) {
105
+ return t(await e.PATCH("/api/v1/workspaces/{workspace}/projects/{projectId}/fields", {
106
+ params: { path: {
107
+ workspace: n,
108
+ projectId: r
109
+ } },
110
+ body: { values: i }
111
+ }));
112
+ }
113
+ export { l as customFieldsQuery, a as fieldKinds, h as fieldRef, u as fieldsFor, d as fieldsForTeams, c as filterableKinds, m as formatFieldFilters, o as groupableKinds, f as hasValue, p as parseFieldFilters, _ as setIssueFields, v as setProjectFields, s as sortableKinds, g as useCustomFieldActions };
@@ -1,33 +1,48 @@
1
- import { groupings as e, orders as t } from "./issueList.js";
1
+ import { fieldRef as e } from "./customFields.js";
2
+ import { groupings as t, orders as n } from "./issueList.js";
2
3
  // src/lib/issueDisplay.ts
3
- var n = "tandem-issues-panel", r = "tandem-issues-insights", i = "tandem-issues-display", a = [
4
+ var r = "tandem-issues-panel", i = "tandem-issues-insights", a = "tandem-issues-display", o = [
4
5
  "assignees",
5
6
  "labels",
6
7
  "priority",
7
8
  "projects"
8
9
  ];
9
- function o() {
10
+ function s() {
10
11
  try {
11
- let n = JSON.parse(localStorage.getItem(i) ?? "{}");
12
+ let r = JSON.parse(localStorage.getItem(a) ?? "{}");
12
13
  return {
13
- ...t.includes(n.order) && { order: n.order },
14
- ...e.includes(n.group) && { group: n.group },
15
- ...(n.layout === "list" || n.layout === "board") && { layout: n.layout }
14
+ ...(n.includes(r.order) || e(r.order)) && { order: r.order },
15
+ ...(t.includes(r.group) || e(r.group)) && { group: r.group },
16
+ ...(r.layout === "list" || r.layout === "board") && { layout: r.layout }
16
17
  };
17
18
  } catch {
18
19
  return {};
19
20
  }
20
21
  }
21
- function s(e) {
22
+ function c(e) {
22
23
  try {
23
- localStorage.setItem(i, JSON.stringify({
24
- ...o(),
24
+ localStorage.setItem(a, JSON.stringify({
25
+ ...s(),
25
26
  ...e
26
27
  }));
27
28
  } catch {}
28
29
  }
29
- function c(e, t, n) {
30
+ function l(e, t, n) {
30
31
  let r = { ...e };
31
32
  return n === void 0 || n === "" ? delete r[t] : r[t] = n, r;
32
33
  }
33
- export { r as insightsKey, a as listTabs, n as panelKey, s as storeDisplay, o as storedDisplay, c as withParam };
34
+ var u = (e) => `tandem-issues-fields:${e}`;
35
+ function d(e) {
36
+ try {
37
+ let t = JSON.parse(localStorage.getItem(u(e)) ?? "[]");
38
+ return Array.isArray(t) ? t.filter((e) => typeof e == "string") : [];
39
+ } catch {
40
+ return [];
41
+ }
42
+ }
43
+ function f(e, t) {
44
+ try {
45
+ localStorage.setItem(u(e), JSON.stringify(t));
46
+ } catch {}
47
+ }
48
+ export { i as insightsKey, o as listTabs, r as panelKey, d as shownFields, c as storeDisplay, f as storeShownFields, s as storedDisplay, l as withParam };