@parallelworks/tandem-web 0.171.0 → 0.171.2
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/_virtual/_virtual_i18n/en/common.js +1 -0
- package/_virtual/_virtual_i18n/es/common.js +1 -0
- package/_virtual/_virtual_i18n/ja/common.js +1 -0
- package/_virtual/_virtual_i18n/ko/common.js +1 -0
- package/_virtual/_virtual_i18n/zh/common.js +1 -0
- package/components/AccessGrants.js +6 -6
- package/components/ActivityTimeline.js +57 -57
- package/components/ActorAvatar.js +4 -4
- package/components/AgentWork.js +494 -494
- package/components/AppLauncher.js +7 -7
- package/components/AreaLink.js +13 -13
- package/components/AreaTiles.js +13 -13
- package/components/AreaWork.js +22 -22
- package/components/Attachments.js +29 -29
- package/components/BlockHandle.js +3 -3
- package/components/BugRotation.js +8 -8
- package/components/CodeHostSettings.js +38 -38
- package/components/CollabEditor.js +13 -13
- package/components/CommandPalette.js +206 -206
- package/components/CustomFields.js +95 -95
- package/components/CustomerRequests.js +11 -11
- package/components/DashboardPanel.js +23 -23
- package/components/DateChip.js +21 -21
- package/components/DocHistory.js +14 -14
- package/components/DocIcon.js +4 -4
- package/components/DocIconPicker.js +4 -4
- package/components/DocLinkPicker.js +22 -22
- package/components/DocLook.js +16 -16
- package/components/DocProperties.js +81 -81
- package/components/DocTable.js +53 -53
- package/components/DocsTree.js +179 -179
- package/components/Editor.js +69 -69
- package/components/FavoritesNav.js +78 -78
- package/components/GitHub.js +87 -87
- package/components/Graph.js +14 -14
- package/components/HostActions.js +21 -21
- package/components/HostPanel.js +6 -6
- package/components/HoverCards.js +74 -74
- package/components/IssueBoard.js +13 -10
- package/components/IssueBreakdown.js +31 -31
- package/components/IssueCode.js +19 -19
- package/components/IssueEvent.js +12 -12
- package/components/IssueFilters.js +103 -99
- package/components/IssueGroup.js +16 -16
- package/components/IssueImport.js +13 -13
- package/components/IssueInsights.js +20 -20
- package/components/IssueListBlock.js +81 -81
- package/components/IssueRelations.js +34 -34
- package/components/IssueRow.js +31 -31
- package/components/IssueSentry.js +4 -4
- package/components/IssueTemplates.js +23 -23
- package/components/IssueTypes.js +40 -40
- package/components/MarkdownTransfer.js +10 -10
- package/components/MentionPicker.js +19 -19
- package/components/NewIssueDialog.js +53 -53
- package/components/NewProjectDialog.js +82 -82
- package/components/PersonActivity.js +13 -13
- package/components/PersonHoverCard.js +44 -44
- package/components/Planning.js +16 -16
- package/components/Reports.js +8 -8
- package/components/SettingsNav.js +15 -15
- package/components/ShareDialog.js +8 -8
- package/components/SharedViewer.js +23 -23
- package/components/SlashMenu.js +26 -26
- package/components/SubPages.js +10 -10
- package/components/TeamForm.js +9 -9
- package/components/TeamRepositories.js +21 -21
- package/components/TeamWorkflow.js +6 -6
- package/components/UnlinkedMentions.js +29 -29
- package/components/Updates.js +8 -8
- package/components/Widgets.js +4 -4
- package/components/WorkCounts.js +12 -12
- package/components/cycleCrumb.js +8 -8
- package/components/editorPlugins.js +101 -101
- package/components/settings.js +6 -6
- package/components/video.js +7 -7
- package/hostedApp.js +24 -24
- package/index.js +18 -18
- package/lib/assigneeOrder.js +6 -0
- package/lib/assignees.js +24 -20
- package/lib/attachments.js +12 -12
- package/lib/boardMove.js +27 -27
- package/lib/collab.js +1 -1
- package/lib/docs.js +115 -115
- package/lib/githubLink.js +7 -7
- package/lib/issueList.js +51 -51
- package/lib/issueMenu.js +117 -117
- package/lib/knowledge.js +134 -134
- package/lib/live.js +38 -38
- package/lib/notifications.js +47 -47
- package/lib/views.js +31 -31
- package/package.json +24 -24
- package/pages/area.js +64 -64
- package/pages/areas.js +199 -199
- package/pages/decisions.js +51 -51
- package/pages/issues.js +120 -120
- package/pages/projects.js +238 -238
- package/pages/triage.js +109 -109
- package/routes/_workspace/agents/_slug2.js +127 -127
- package/routes/_workspace/agents/index2.js +22 -22
- package/routes/_workspace/dashboards/_dashboardId2.js +84 -84
- package/routes/_workspace/dashboards/index2.js +34 -34
- package/routes/_workspace/docs/_doc2.js +267 -267
- package/routes/_workspace/docs/space2._space.js +31 -31
- package/routes/_workspace/docs2.js +4 -4
- package/routes/_workspace/graph2.js +11 -11
- package/routes/_workspace/graph3.js +11 -11
- package/routes/_workspace/issues/_identifier2.js +477 -477
- package/routes/_workspace/issues/index.js +13 -13
- package/routes/_workspace/knowledge/_term2.js +175 -175
- package/routes/_workspace/knowledge/_term3.js +4 -4
- package/routes/_workspace/knowledge/index.js +12 -12
- package/routes/_workspace/knowledge/index2.js +117 -117
- package/routes/_workspace/measures2.js +8 -8
- package/routes/_workspace/measures3.js +29 -29
- package/routes/_workspace/notifications2.js +263 -263
- package/routes/_workspace/people/_username.js +10 -10
- package/routes/_workspace/people/_username2.js +41 -41
- package/routes/_workspace/projects/_projectId3.js +303 -303
- package/routes/_workspace/projects/_projectId4.js +4 -4
- package/routes/_workspace/projects/_projectId_3.milestones._milestoneId.js +28 -28
- package/routes/_workspace/projects/_projectId_4.milestones._milestoneId.js +4 -4
- package/routes/_workspace/projects/index.js +8 -8
- package/routes/_workspace/settings/account2.js +8 -8
- package/routes/_workspace/settings/audit-log2.js +8 -8
- package/routes/_workspace/settings/audit-log3.js +155 -155
- package/routes/_workspace/settings/connections2.js +4 -4
- package/routes/_workspace/settings/fields2.js +5 -5
- package/routes/_workspace/settings/github2.js +11 -11
- package/routes/_workspace/settings/gitlab2.js +5 -5
- package/routes/_workspace/settings/groups2.js +52 -52
- package/routes/_workspace/settings/import2.js +39 -39
- package/routes/_workspace/settings/index2.js +5 -5
- package/routes/_workspace/settings/intercom2.js +11 -11
- package/routes/_workspace/settings/labels2.js +33 -33
- package/routes/_workspace/settings/members2.js +81 -81
- package/routes/_workspace/settings/notifications2.js +46 -46
- package/routes/_workspace/settings/parallelworks2.js +20 -20
- package/routes/_workspace/settings/roles2.js +41 -41
- package/routes/_workspace/settings/runners2.js +15 -15
- package/routes/_workspace/settings/sentry2.js +15 -15
- package/routes/_workspace/settings/sessions2.js +9 -9
- package/routes/_workspace/settings/sessions3.js +4 -4
- package/routes/_workspace/settings/slack2.js +12 -12
- package/routes/_workspace/settings/sso2.js +37 -37
- package/routes/_workspace/settings/sso3.js +7 -7
- package/routes/_workspace/settings/teams2.js +29 -29
- package/routes/_workspace/settings/tokens2.js +32 -32
- package/routes/_workspace/settings/tokens3.js +4 -4
- package/routes/_workspace/settings/webhooks2.js +41 -41
- package/routes/_workspace/settings/zendesk2.js +11 -11
- package/routes/_workspace/teams/_key/cycles/_number2.js +33 -33
- package/routes/_workspace/teams/_key/cycles/_number3.js +7 -7
- package/routes/_workspace/teams/_key/cycles/index2.js +37 -37
- package/routes/_workspace/teams/_key/issues.js +10 -10
- package/routes/_workspace/teams/_key/projects.js +6 -6
- package/routes/_workspace/teams/_key/settings2.js +396 -396
- package/routes/_workspace2.js +308 -308
- package/routes/_workspace3.js +8 -8
- package/routes/device2.js +4 -4
- package/routes/device3.js +4 -4
- package/routes/docs/_tag/_endpoint2.js +3 -3
- package/routes/docs/_tag/index2.js +3 -3
- package/routes/docs/route2.js +7 -7
- package/routes/index2.js +5 -5
- package/routes/login2.js +10 -10
- package/routes/new2.js +12 -12
- package/routes/new3.js +5 -5
- package/routes/request2._token.js +6 -6
- package/routes/share2._secret.js +4 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { invalidateIssueViews as e } from "../api/mutations.js";
|
|
2
|
+
import { issueQuery as t } from "../api/queries.js";
|
|
3
|
+
import { useConfirm as n } from "../lib/confirm.js";
|
|
4
|
+
import { customFieldsQuery as r, fieldKinds as i, fieldsFor as a, hasValue as o, setIssueFields as s, setProjectFields as c, useCustomFieldActions as l } from "../lib/customFields.js";
|
|
5
|
+
import { issueTypesQuery as u, typeShows as d } from "../lib/issueTypes.js";
|
|
6
|
+
import { PropertyField as f, usePropertyText as p } from "./DocProperties.js";
|
|
7
|
+
import { AddIcon as m } from "./icons.js";
|
|
8
8
|
import { Button as h, Checkbox as g, ErrorText as _, IconButton as v, Input as y, Select as b, SettingsCard as x, Textarea as S, menuDivider as C, useOpenMenu as w } from "@parallelworks/ui";
|
|
9
9
|
import { useId as T, useState as E } from "react";
|
|
10
10
|
import { useErrorMessage as D } from "@parallelworks/problem/react";
|
|
@@ -13,16 +13,16 @@ import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
|
13
13
|
import { useMutation as M, useQuery as N, useQueryClient as P } from "@tanstack/react-query";
|
|
14
14
|
// src/components/CustomFields.tsx
|
|
15
15
|
function F(e) {
|
|
16
|
-
let t =
|
|
16
|
+
let t = p(e);
|
|
17
17
|
return (e, n) => t(e, n);
|
|
18
18
|
}
|
|
19
19
|
function I({ workspace: n, issue: i, label: o }) {
|
|
20
|
-
let c = D(),
|
|
21
|
-
mutationFn: (e) =>
|
|
20
|
+
let c = D(), l = P(), { data: p } = N(r(n)), { data: m } = N(u(n)), h = m?.find((e) => e.id === i.type?.id), g = a(p, "issue", i.teamId).filter((e) => d(h, e.id)), v = t(n, i.identifier).queryKey, y = M({
|
|
21
|
+
mutationFn: (e) => s(n, i.identifier, e),
|
|
22
22
|
onMutate: async (e) => {
|
|
23
|
-
await
|
|
24
|
-
let t =
|
|
25
|
-
return t &&
|
|
23
|
+
await l.cancelQueries({ queryKey: v });
|
|
24
|
+
let t = l.getQueryData(v);
|
|
25
|
+
return t && l.setQueryData(v, {
|
|
26
26
|
...t,
|
|
27
27
|
fields: {
|
|
28
28
|
...t.fields,
|
|
@@ -31,14 +31,14 @@ function I({ workspace: n, issue: i, label: o }) {
|
|
|
31
31
|
}), { previous: t };
|
|
32
32
|
},
|
|
33
33
|
onError: (e, t, n) => {
|
|
34
|
-
n?.previous &&
|
|
34
|
+
n?.previous && l.setQueryData(v, n.previous);
|
|
35
35
|
},
|
|
36
|
-
onSuccess: (e) =>
|
|
37
|
-
onSettled: () =>
|
|
36
|
+
onSuccess: (e) => l.setQueryData(v, e),
|
|
37
|
+
onSettled: () => e(l, n, i.identifier)
|
|
38
38
|
});
|
|
39
39
|
return g.length === 0 ? null : /* @__PURE__ */ j(k, { children: [g.map((e) => o(e.name, /* @__PURE__ */ A("div", {
|
|
40
40
|
className: "px-2",
|
|
41
|
-
children: /* @__PURE__ */ A(
|
|
41
|
+
children: /* @__PURE__ */ A(f, {
|
|
42
42
|
workspace: n,
|
|
43
43
|
property: e,
|
|
44
44
|
value: i.fields[e.id],
|
|
@@ -51,41 +51,41 @@ function I({ workspace: n, issue: i, label: o }) {
|
|
|
51
51
|
})] });
|
|
52
52
|
}
|
|
53
53
|
function L({ workspace: e, project: t, editable: n, onChange: i }) {
|
|
54
|
-
let o = O("customFields"),
|
|
55
|
-
mutationFn: (n) =>
|
|
54
|
+
let o = O("customFields"), s = D(), { data: l } = N(r(e)), u = a(l, "project"), d = M({
|
|
55
|
+
mutationFn: (n) => c(e, t.id, n),
|
|
56
56
|
onSuccess: i
|
|
57
57
|
});
|
|
58
|
-
return
|
|
58
|
+
return u.length === 0 ? null : /* @__PURE__ */ j("section", {
|
|
59
59
|
"aria-label": o("title"),
|
|
60
60
|
className: "max-w-xl space-y-0.5 text-sm",
|
|
61
|
-
children: [
|
|
61
|
+
children: [u.map((r) => /* @__PURE__ */ j("div", {
|
|
62
62
|
className: "flex min-h-8 items-center gap-2",
|
|
63
63
|
children: [/* @__PURE__ */ A("span", {
|
|
64
64
|
className: "w-36 shrink-0 truncate text-muted-foreground",
|
|
65
|
-
children:
|
|
65
|
+
children: r.name
|
|
66
66
|
}), /* @__PURE__ */ A("div", {
|
|
67
67
|
className: "min-w-0 flex-1",
|
|
68
|
-
children: /* @__PURE__ */ A(
|
|
68
|
+
children: /* @__PURE__ */ A(f, {
|
|
69
69
|
workspace: e,
|
|
70
|
-
property:
|
|
71
|
-
value: t.fields[
|
|
70
|
+
property: r,
|
|
71
|
+
value: t.fields[r.id],
|
|
72
72
|
editable: n,
|
|
73
|
-
onChange: (e) =>
|
|
73
|
+
onChange: (e) => d.mutate({ [r.id]: e })
|
|
74
74
|
})
|
|
75
75
|
})]
|
|
76
|
-
},
|
|
76
|
+
}, r.id)), d.error && /* @__PURE__ */ A(_, { children: s(d.error) })]
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
function R({ workspace: e, teamId: t, typeId: n, values: i, onChange:
|
|
80
|
-
let
|
|
79
|
+
function R({ workspace: e, teamId: t, typeId: n, values: i, onChange: s }) {
|
|
80
|
+
let c = O("customFields"), { data: l } = N(r(e)), { data: p } = N(u(e)), m = p?.find((e) => e.id === n), h = a(l, "issue", t).filter((e) => d(m, e.id)).map((e) => m?.requiredFieldIds.includes(e.id) ? {
|
|
81
81
|
...e,
|
|
82
82
|
required: !0
|
|
83
|
-
} : e).filter((e) => e.required ||
|
|
83
|
+
} : e).filter((e) => e.required || o(i[e.id]));
|
|
84
84
|
return h.length === 0 ? null : /* @__PURE__ */ j("fieldset", {
|
|
85
85
|
className: "space-y-0.5 text-sm",
|
|
86
86
|
children: [/* @__PURE__ */ A("legend", {
|
|
87
87
|
className: "sr-only",
|
|
88
|
-
children:
|
|
88
|
+
children: c("title")
|
|
89
89
|
}), h.map((t) => /* @__PURE__ */ j("div", {
|
|
90
90
|
className: "flex min-h-8 items-center gap-2",
|
|
91
91
|
children: [/* @__PURE__ */ j("span", {
|
|
@@ -96,16 +96,16 @@ function R({ workspace: e, teamId: t, typeId: n, values: i, onChange: o }) {
|
|
|
96
96
|
children: [" ", "*"]
|
|
97
97
|
}), /* @__PURE__ */ A("span", {
|
|
98
98
|
className: "sr-only",
|
|
99
|
-
children:
|
|
99
|
+
children: c("required")
|
|
100
100
|
})] })]
|
|
101
101
|
}), /* @__PURE__ */ A("div", {
|
|
102
102
|
className: "min-w-0 flex-1",
|
|
103
|
-
children: /* @__PURE__ */ A(
|
|
103
|
+
children: /* @__PURE__ */ A(f, {
|
|
104
104
|
workspace: e,
|
|
105
105
|
property: t,
|
|
106
106
|
value: i[t.id],
|
|
107
107
|
editable: !0,
|
|
108
|
-
onChange: (e) =>
|
|
108
|
+
onChange: (e) => s({
|
|
109
109
|
...i,
|
|
110
110
|
[t.id]: e
|
|
111
111
|
})
|
|
@@ -114,84 +114,84 @@ function R({ workspace: e, teamId: t, typeId: n, values: i, onChange: o }) {
|
|
|
114
114
|
}, t.id))]
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
function z({ workspace: e, target: t, team:
|
|
118
|
-
let i = O("customFields"), { data:
|
|
117
|
+
function z({ workspace: e, target: t, team: n }) {
|
|
118
|
+
let i = O("customFields"), { data: a } = N(r(e)), o = (a ?? []).filter((e) => e.target === t && (n ? e.teamId === n.id : !e.teamId)).sort((e, t) => e.position - t.position), [s, c] = E(!1);
|
|
119
119
|
return /* @__PURE__ */ j(x, {
|
|
120
120
|
title: i(t === "issue" ? "issueFields" : "projectFields"),
|
|
121
|
-
description: i(
|
|
121
|
+
description: i(n ? "teamFieldsHelp" : t === "issue" ? "issueFieldsHelp" : "projectFieldsHelp"),
|
|
122
122
|
action: /* @__PURE__ */ A(h, {
|
|
123
123
|
size: "sm",
|
|
124
|
-
icon: /* @__PURE__ */ A(
|
|
125
|
-
onClick: () =>
|
|
124
|
+
icon: /* @__PURE__ */ A(m, {}),
|
|
125
|
+
onClick: () => c(!0),
|
|
126
126
|
children: i("add")
|
|
127
127
|
}),
|
|
128
|
-
children: [
|
|
128
|
+
children: [s && /* @__PURE__ */ A(V, {
|
|
129
129
|
workspace: e,
|
|
130
130
|
target: t,
|
|
131
|
-
team:
|
|
132
|
-
onDone: () =>
|
|
133
|
-
}),
|
|
131
|
+
team: n?.key,
|
|
132
|
+
onDone: () => c(!1)
|
|
133
|
+
}), o.length === 0 && !s ? /* @__PURE__ */ A("p", {
|
|
134
134
|
className: "px-3 py-3 text-sm text-muted-foreground",
|
|
135
135
|
children: i("none")
|
|
136
136
|
}) : /* @__PURE__ */ A("ul", {
|
|
137
137
|
className: "divide-y divide-border",
|
|
138
|
-
children:
|
|
138
|
+
children: o.map((t, n) => /* @__PURE__ */ A(B, {
|
|
139
139
|
workspace: e,
|
|
140
140
|
field: t,
|
|
141
|
-
before:
|
|
142
|
-
after:
|
|
141
|
+
before: o[n - 1],
|
|
142
|
+
after: o[n + 1]
|
|
143
143
|
}, t.id))
|
|
144
144
|
})]
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
function B({ workspace: e, field: t, before:
|
|
148
|
-
let
|
|
147
|
+
function B({ workspace: e, field: t, before: r, after: i }) {
|
|
148
|
+
let a = O("customFields"), o = l(e), s = w(), { confirm: c, dialog: u } = n(), [d, f] = E(!1), p = (e, n) => e && o.update.mutate({
|
|
149
149
|
id: t.id,
|
|
150
|
-
position: n ? (e.position + n.position) / 2 : e.position + (e ===
|
|
151
|
-
}), m = () =>
|
|
152
|
-
title:
|
|
153
|
-
description:
|
|
154
|
-
confirmLabel:
|
|
150
|
+
position: n ? (e.position + n.position) / 2 : e.position + (e === i ? 1 : -1)
|
|
151
|
+
}), m = () => c({
|
|
152
|
+
title: a("deleteTitle", { name: t.name }),
|
|
153
|
+
description: a("deleteDescription", { count: t.values }),
|
|
154
|
+
confirmLabel: a("delete"),
|
|
155
155
|
destructive: !0,
|
|
156
|
-
onConfirm: () =>
|
|
156
|
+
onConfirm: () => o.remove.mutateAsync(t.id)
|
|
157
157
|
}), h = () => [
|
|
158
158
|
{
|
|
159
|
-
label:
|
|
160
|
-
onClick: () =>
|
|
159
|
+
label: a("edit"),
|
|
160
|
+
onClick: () => f(!0)
|
|
161
161
|
},
|
|
162
|
-
...n ? [{
|
|
163
|
-
label: i("moveUp"),
|
|
164
|
-
onClick: () => p(n, void 0)
|
|
165
|
-
}] : [],
|
|
166
162
|
...r ? [{
|
|
167
|
-
label:
|
|
163
|
+
label: a("moveUp"),
|
|
168
164
|
onClick: () => p(r, void 0)
|
|
169
165
|
}] : [],
|
|
166
|
+
...i ? [{
|
|
167
|
+
label: a("moveDown"),
|
|
168
|
+
onClick: () => p(i, void 0)
|
|
169
|
+
}] : [],
|
|
170
170
|
{
|
|
171
|
-
label: t.archivedAt ?
|
|
172
|
-
onClick: () =>
|
|
171
|
+
label: t.archivedAt ? a("restore") : a("archive"),
|
|
172
|
+
onClick: () => o.update.mutate({
|
|
173
173
|
id: t.id,
|
|
174
174
|
archived: !t.archivedAt
|
|
175
175
|
})
|
|
176
176
|
},
|
|
177
177
|
C,
|
|
178
178
|
{
|
|
179
|
-
label:
|
|
179
|
+
label: a("delete"),
|
|
180
180
|
destructive: !0,
|
|
181
181
|
onClick: m
|
|
182
182
|
}
|
|
183
183
|
];
|
|
184
|
-
return
|
|
184
|
+
return d ? /* @__PURE__ */ A("li", {
|
|
185
185
|
className: "p-2",
|
|
186
186
|
children: /* @__PURE__ */ A(V, {
|
|
187
187
|
workspace: e,
|
|
188
188
|
target: t.target,
|
|
189
189
|
field: t,
|
|
190
|
-
onDone: () =>
|
|
190
|
+
onDone: () => f(!1)
|
|
191
191
|
})
|
|
192
192
|
}) : /* @__PURE__ */ j("li", {
|
|
193
193
|
className: "flex min-h-10 items-center gap-3 px-3 py-1.5",
|
|
194
|
-
onContextMenu: (e) =>
|
|
194
|
+
onContextMenu: (e) => s(e, h()),
|
|
195
195
|
children: [
|
|
196
196
|
/* @__PURE__ */ j("div", {
|
|
197
197
|
className: "min-w-0 flex-1",
|
|
@@ -199,7 +199,7 @@ function B({ workspace: e, field: t, before: n, after: r }) {
|
|
|
199
199
|
className: `truncate text-sm ${t.archivedAt ? "text-muted-foreground" : ""}`,
|
|
200
200
|
children: [t.name, t.required && /* @__PURE__ */ A("span", {
|
|
201
201
|
className: "ml-2 text-xs text-muted-foreground",
|
|
202
|
-
children:
|
|
202
|
+
children: a("required")
|
|
203
203
|
})]
|
|
204
204
|
}), t.description && /* @__PURE__ */ A("p", {
|
|
205
205
|
className: "truncate text-xs text-muted-foreground",
|
|
@@ -208,32 +208,32 @@ function B({ workspace: e, field: t, before: n, after: r }) {
|
|
|
208
208
|
}),
|
|
209
209
|
t.archivedAt && /* @__PURE__ */ A("span", {
|
|
210
210
|
className: "shrink-0 text-xs text-muted-foreground",
|
|
211
|
-
children:
|
|
211
|
+
children: a("archived")
|
|
212
212
|
}),
|
|
213
213
|
/* @__PURE__ */ A("span", {
|
|
214
214
|
className: "shrink-0 text-xs text-muted-foreground",
|
|
215
|
-
children:
|
|
215
|
+
children: a(`kinds.${t.kind}`)
|
|
216
216
|
}),
|
|
217
217
|
/* @__PURE__ */ A("span", {
|
|
218
218
|
className: "w-20 shrink-0 text-right text-xs tabular-nums text-muted-foreground",
|
|
219
|
-
children:
|
|
219
|
+
children: a("values", { count: t.values })
|
|
220
220
|
}),
|
|
221
221
|
/* @__PURE__ */ A(v, {
|
|
222
222
|
variant: "ghost",
|
|
223
223
|
size: "sm",
|
|
224
|
-
label:
|
|
224
|
+
label: a("actions", { name: t.name }),
|
|
225
225
|
icon: /* @__PURE__ */ A("span", {
|
|
226
226
|
"aria-hidden": !0,
|
|
227
227
|
children: "⋯"
|
|
228
228
|
}),
|
|
229
|
-
onClick: (e) =>
|
|
229
|
+
onClick: (e) => s(e, h())
|
|
230
230
|
}),
|
|
231
|
-
|
|
231
|
+
u
|
|
232
232
|
]
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
|
-
function V({ workspace: e, target: t, team: n, field: r, onDone:
|
|
236
|
-
let
|
|
235
|
+
function V({ workspace: e, target: t, team: n, field: r, onDone: a }) {
|
|
236
|
+
let o = O("customFields"), s = D(), c = l(e), [u, d] = E(r?.name ?? ""), [f, p] = E(r?.description ?? ""), [m, v] = E(r?.kind ?? "text"), [x, C] = E(r?.required ?? !1), w = T(), [k, M] = E((r?.options ?? []).map((e) => e.name).join("\n")), N = m === "select" || m === "multi_select", P = () => k.split("\n").map((e) => e.trim()).filter(Boolean).map((e) => {
|
|
237
237
|
let t = r?.options.find((t) => t.name === e)?.id;
|
|
238
238
|
return {
|
|
239
239
|
name: e,
|
|
@@ -244,19 +244,19 @@ function V({ workspace: e, target: t, team: n, field: r, onDone: i }) {
|
|
|
244
244
|
onSubmit: (e) => {
|
|
245
245
|
e.preventDefault(), r ? c.update.mutate({
|
|
246
246
|
id: r.id,
|
|
247
|
-
name:
|
|
247
|
+
name: u,
|
|
248
248
|
description: f,
|
|
249
249
|
...t === "issue" && { required: x },
|
|
250
250
|
...N && { options: P() }
|
|
251
|
-
}, { onSuccess:
|
|
251
|
+
}, { onSuccess: a }) : c.create.mutate({
|
|
252
252
|
target: t,
|
|
253
253
|
...n && { team: n },
|
|
254
|
-
name:
|
|
254
|
+
name: u,
|
|
255
255
|
description: f,
|
|
256
256
|
kind: m,
|
|
257
257
|
...t === "issue" && { required: x },
|
|
258
258
|
...N && { options: P() }
|
|
259
|
-
}, { onSuccess:
|
|
259
|
+
}, { onSuccess: a });
|
|
260
260
|
},
|
|
261
261
|
className: "space-y-3 rounded-md border border-border p-3 text-sm",
|
|
262
262
|
children: [
|
|
@@ -264,9 +264,9 @@ function V({ workspace: e, target: t, team: n, field: r, onDone: i }) {
|
|
|
264
264
|
className: "grid gap-3 sm:grid-cols-2",
|
|
265
265
|
children: [/* @__PURE__ */ j("label", {
|
|
266
266
|
className: "block text-xs font-medium text-muted-foreground",
|
|
267
|
-
children: [
|
|
268
|
-
value:
|
|
269
|
-
onChange: (e) =>
|
|
267
|
+
children: [o("name"), /* @__PURE__ */ A(y, {
|
|
268
|
+
value: u,
|
|
269
|
+
onChange: (e) => d(e.target.value),
|
|
270
270
|
required: !0,
|
|
271
271
|
maxLength: 60,
|
|
272
272
|
className: "mt-1",
|
|
@@ -274,16 +274,16 @@ function V({ workspace: e, target: t, team: n, field: r, onDone: i }) {
|
|
|
274
274
|
})]
|
|
275
275
|
}), /* @__PURE__ */ j("div", {
|
|
276
276
|
className: "text-xs font-medium text-muted-foreground",
|
|
277
|
-
children: [
|
|
277
|
+
children: [o("kind"), /* @__PURE__ */ A("div", {
|
|
278
278
|
className: "mt-1",
|
|
279
279
|
children: /* @__PURE__ */ A(b, {
|
|
280
280
|
value: m,
|
|
281
|
-
items:
|
|
281
|
+
items: i.map((e) => ({
|
|
282
282
|
value: e,
|
|
283
|
-
label:
|
|
283
|
+
label: o(`kinds.${e}`)
|
|
284
284
|
})),
|
|
285
285
|
onValueChange: v,
|
|
286
|
-
"aria-label":
|
|
286
|
+
"aria-label": o("kind"),
|
|
287
287
|
width: "fill",
|
|
288
288
|
disabled: !!r
|
|
289
289
|
})
|
|
@@ -292,7 +292,7 @@ function V({ workspace: e, target: t, team: n, field: r, onDone: i }) {
|
|
|
292
292
|
}),
|
|
293
293
|
/* @__PURE__ */ j("label", {
|
|
294
294
|
className: "block text-xs font-medium text-muted-foreground",
|
|
295
|
-
children: [
|
|
295
|
+
children: [o("description"), /* @__PURE__ */ A(y, {
|
|
296
296
|
value: f,
|
|
297
297
|
onChange: (e) => p(e.target.value),
|
|
298
298
|
maxLength: 500,
|
|
@@ -302,7 +302,7 @@ function V({ workspace: e, target: t, team: n, field: r, onDone: i }) {
|
|
|
302
302
|
N && /* @__PURE__ */ j("label", {
|
|
303
303
|
className: "block text-xs font-medium text-muted-foreground",
|
|
304
304
|
children: [
|
|
305
|
-
|
|
305
|
+
o("options"),
|
|
306
306
|
/* @__PURE__ */ A(S, {
|
|
307
307
|
value: k,
|
|
308
308
|
onChange: (e) => M(e.target.value),
|
|
@@ -311,7 +311,7 @@ function V({ workspace: e, target: t, team: n, field: r, onDone: i }) {
|
|
|
311
311
|
}),
|
|
312
312
|
/* @__PURE__ */ A("span", {
|
|
313
313
|
className: "mt-1 block font-normal",
|
|
314
|
-
children:
|
|
314
|
+
children: o("optionsHint")
|
|
315
315
|
})
|
|
316
316
|
]
|
|
317
317
|
}),
|
|
@@ -323,7 +323,7 @@ function V({ workspace: e, target: t, team: n, field: r, onDone: i }) {
|
|
|
323
323
|
onCheckedChange: (e) => C(e === !0)
|
|
324
324
|
}), /* @__PURE__ */ A("label", {
|
|
325
325
|
htmlFor: w,
|
|
326
|
-
children:
|
|
326
|
+
children: o("requiredLabel")
|
|
327
327
|
})]
|
|
328
328
|
}),
|
|
329
329
|
F.error && /* @__PURE__ */ A(_, { children: s(F.error) }),
|
|
@@ -332,15 +332,15 @@ function V({ workspace: e, target: t, team: n, field: r, onDone: i }) {
|
|
|
332
332
|
children: [/* @__PURE__ */ A(h, {
|
|
333
333
|
size: "sm",
|
|
334
334
|
variant: "ghost",
|
|
335
|
-
onClick:
|
|
336
|
-
children:
|
|
335
|
+
onClick: a,
|
|
336
|
+
children: o("cancel")
|
|
337
337
|
}), /* @__PURE__ */ A(h, {
|
|
338
338
|
type: "submit",
|
|
339
339
|
size: "sm",
|
|
340
340
|
variant: "primary",
|
|
341
341
|
loading: F.isPending,
|
|
342
|
-
disabled: !
|
|
343
|
-
children:
|
|
342
|
+
disabled: !u.trim(),
|
|
343
|
+
children: o(r ? "save" : "add")
|
|
344
344
|
})]
|
|
345
345
|
})
|
|
346
346
|
]
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { invalidateIssueLists as n } from "../api/mutations.js";
|
|
3
|
+
import { customerRequestsQuery as r, customersQuery as i } from "../api/queries.js";
|
|
4
|
+
import { useCan as a } from "../lib/roles.js";
|
|
5
|
+
import { AddIcon as o, CloseIcon as s, LinkIcon as c, UsersIcon as l } from "./icons.js";
|
|
6
6
|
import { Button as u, Card as d, ErrorText as f, IconButton as p, Input as m, Textarea as h } from "@parallelworks/ui";
|
|
7
7
|
import { useId as g, useState as _ } from "react";
|
|
8
8
|
import { useErrorMessage as v } from "@parallelworks/problem/react";
|
|
@@ -11,11 +11,11 @@ import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
|
11
11
|
import { useMutation as S, useQuery as C, useQueryClient as w } from "@tanstack/react-query";
|
|
12
12
|
// src/components/CustomerRequests.tsx
|
|
13
13
|
function T({ workspace: T, identifier: E, enabled: D }) {
|
|
14
|
-
let O = y("customerRequests"), k = v(), A = w(), j =
|
|
15
|
-
...
|
|
14
|
+
let O = y("customerRequests"), k = v(), A = w(), j = a(T, "manage_customers"), M = j && D, { data: N = [] } = C(r(T, E)), { data: P = [] } = C({
|
|
15
|
+
...i(T),
|
|
16
16
|
enabled: M
|
|
17
17
|
}), [F, I] = _(!1), [L, R] = _(""), [z, B] = _(""), [V, H] = _(""), U = g(), W = () => {
|
|
18
|
-
A.invalidateQueries({ queryKey:
|
|
18
|
+
A.invalidateQueries({ queryKey: r(T, E).queryKey }), A.invalidateQueries({ queryKey: i(T).queryKey }), n(A, T);
|
|
19
19
|
}, G = S({
|
|
20
20
|
mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/requests", {
|
|
21
21
|
params: { path: {
|
|
@@ -61,7 +61,7 @@ function T({ workspace: T, identifier: E, enabled: D }) {
|
|
|
61
61
|
children: N.map((e) => /* @__PURE__ */ x("li", {
|
|
62
62
|
className: "flex items-start gap-2 px-3 py-2 text-sm",
|
|
63
63
|
children: [
|
|
64
|
-
/* @__PURE__ */ b(
|
|
64
|
+
/* @__PURE__ */ b(l, { className: "mt-0.5 size-3.5 shrink-0 text-muted-foreground" }),
|
|
65
65
|
/* @__PURE__ */ x("div", {
|
|
66
66
|
className: "min-w-0 flex-1",
|
|
67
67
|
children: [/* @__PURE__ */ b("span", {
|
|
@@ -77,12 +77,12 @@ function T({ workspace: T, identifier: E, enabled: D }) {
|
|
|
77
77
|
target: "_blank",
|
|
78
78
|
rel: "noreferrer",
|
|
79
79
|
className: "inline-flex shrink-0 items-center gap-1 text-xs text-primary hover:underline",
|
|
80
|
-
children: [/* @__PURE__ */ b(
|
|
80
|
+
children: [/* @__PURE__ */ b(c, { className: "size-3" }), O("source")]
|
|
81
81
|
}),
|
|
82
82
|
j && /* @__PURE__ */ b(p, {
|
|
83
83
|
variant: "ghost",
|
|
84
84
|
size: "sm",
|
|
85
|
-
icon: /* @__PURE__ */ b(
|
|
85
|
+
icon: /* @__PURE__ */ b(s, {}),
|
|
86
86
|
label: O("remove", { name: e.customer.name }),
|
|
87
87
|
onClick: () => K.mutate(e.id),
|
|
88
88
|
className: "-my-1"
|
|
@@ -151,7 +151,7 @@ function T({ workspace: T, identifier: E, enabled: D }) {
|
|
|
151
151
|
type: "button",
|
|
152
152
|
onClick: () => I(!0),
|
|
153
153
|
className: "mt-1.5 flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",
|
|
154
|
-
children: [/* @__PURE__ */ b(
|
|
154
|
+
children: [/* @__PURE__ */ b(o, { className: "size-3.5" }), O("addRequest")]
|
|
155
155
|
}))
|
|
156
156
|
]
|
|
157
157
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { panelQuery as e } from "../api/queries.js";
|
|
2
|
+
import { Link as t } from "../lib/router.js";
|
|
3
3
|
import { DownloadIcon as n, EditIcon as r, TrashIcon as i } from "./icons.js";
|
|
4
4
|
import { Card as a, ChartLegendList as o, IconButton as s, OTHER_SERIES_KEY as c, foldSeries as l, seriesColors as u } from "@parallelworks/ui";
|
|
5
5
|
import { useFormatter as d, useTranslations as f } from "use-intl";
|
|
@@ -86,9 +86,9 @@ function b(e) {
|
|
|
86
86
|
team: e.slice(5)
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
function x({ workspace:
|
|
89
|
+
function x({ workspace: t, panel: o, onEdit: c, onDelete: l }) {
|
|
90
90
|
let u = f("dashboards"), { data: d, isPending: g, isError: _ } = h({
|
|
91
|
-
...t
|
|
91
|
+
...e(t, o.chart, o.spec),
|
|
92
92
|
refetchInterval: 6e4
|
|
93
93
|
});
|
|
94
94
|
return /* @__PURE__ */ m(a, {
|
|
@@ -133,7 +133,7 @@ function x({ workspace: e, panel: o, onEdit: c, onDelete: l }) {
|
|
|
133
133
|
className: "text-sm text-danger",
|
|
134
134
|
children: u("failed")
|
|
135
135
|
}) : /* @__PURE__ */ p(C, {
|
|
136
|
-
workspace:
|
|
136
|
+
workspace: t,
|
|
137
137
|
panel: o,
|
|
138
138
|
data: d
|
|
139
139
|
})
|
|
@@ -144,11 +144,11 @@ function S(e) {
|
|
|
144
144
|
let t = d(), n = f("dashboards");
|
|
145
145
|
return (r) => e === "days" ? n("daysValue", { days: t.number(r, { maximumFractionDigits: 1 }) }) : t.number(r, { maximumFractionDigits: +(e === "points") });
|
|
146
146
|
}
|
|
147
|
-
function C({ workspace:
|
|
147
|
+
function C({ workspace: e, panel: n, data: r }) {
|
|
148
148
|
let i = f("dashboards"), a = S(r.unit), o = r.series.length > 0 && r.weeks.length > 0, s = n.chart;
|
|
149
|
-
return s === "number" ? /* @__PURE__ */ m(
|
|
149
|
+
return s === "number" ? /* @__PURE__ */ m(t, {
|
|
150
150
|
to: "/$workspace/issues",
|
|
151
|
-
params: { workspace:
|
|
151
|
+
params: { workspace: e },
|
|
152
152
|
search: g(r.filter),
|
|
153
153
|
className: "flex h-full flex-col items-start justify-center gap-1 rounded-md hover:bg-muted",
|
|
154
154
|
children: [/* @__PURE__ */ p("span", {
|
|
@@ -160,10 +160,10 @@ function C({ workspace: t, panel: n, data: r }) {
|
|
|
160
160
|
})]
|
|
161
161
|
}) : s === "list" ? r.issues.length === 0 ? /* @__PURE__ */ p(w, {}) : /* @__PURE__ */ p("ul", {
|
|
162
162
|
className: "divide-y divide-border text-sm",
|
|
163
|
-
children: r.issues.map((n) => /* @__PURE__ */ p("li", { children: /* @__PURE__ */ m(
|
|
163
|
+
children: r.issues.map((n) => /* @__PURE__ */ p("li", { children: /* @__PURE__ */ m(t, {
|
|
164
164
|
to: "/$workspace/issues/$identifier",
|
|
165
165
|
params: {
|
|
166
|
-
workspace:
|
|
166
|
+
workspace: e,
|
|
167
167
|
identifier: n.identifier
|
|
168
168
|
},
|
|
169
169
|
className: "flex min-w-0 gap-2 py-1.5 hover:bg-muted",
|
|
@@ -197,9 +197,9 @@ function C({ workspace: t, panel: n, data: r }) {
|
|
|
197
197
|
className: "divide-y divide-border",
|
|
198
198
|
children: r.rows.map((r) => /* @__PURE__ */ m("tr", { children: [/* @__PURE__ */ p("td", {
|
|
199
199
|
className: "py-1.5",
|
|
200
|
-
children: /* @__PURE__ */ p(
|
|
200
|
+
children: /* @__PURE__ */ p(t, {
|
|
201
201
|
to: "/$workspace/issues",
|
|
202
|
-
params: { workspace:
|
|
202
|
+
params: { workspace: e },
|
|
203
203
|
search: g(r.filter),
|
|
204
204
|
className: "hover:underline",
|
|
205
205
|
children: T(r.name, n.spec.groupBy, i)
|
|
@@ -210,13 +210,13 @@ function C({ workspace: t, panel: n, data: r }) {
|
|
|
210
210
|
})] }, r.key || "-"))
|
|
211
211
|
})]
|
|
212
212
|
}) : o && (s === "line" || s === "stacked" || _.has(n.spec.measure)) ? /* @__PURE__ */ p(O, {
|
|
213
|
-
workspace:
|
|
213
|
+
workspace: e,
|
|
214
214
|
data: r,
|
|
215
215
|
stacked: s !== "line",
|
|
216
216
|
names: (e) => e.key === "created" || e.key === "completed" ? i(`series.${e.key}`) : T(e.name, n.spec.groupBy, i),
|
|
217
217
|
value: a
|
|
218
218
|
}) : r.rows.length === 0 || r.rows.every((e) => e.value === 0) ? /* @__PURE__ */ p(w, {}) : p(s === "pie" ? D : E, {
|
|
219
|
-
workspace:
|
|
219
|
+
workspace: e,
|
|
220
220
|
data: r,
|
|
221
221
|
groupBy: n.spec.groupBy,
|
|
222
222
|
value: a
|
|
@@ -232,13 +232,13 @@ function w() {
|
|
|
232
232
|
function T(e, t, n) {
|
|
233
233
|
return t === "priority" ? n(`priorities.${e}`) : t === "status" && e ? n(`categories.${e}`) : t ? e || n("none") : n("all");
|
|
234
234
|
}
|
|
235
|
-
function E({ workspace:
|
|
235
|
+
function E({ workspace: e, data: n, groupBy: r, value: i }) {
|
|
236
236
|
let a = f("dashboards"), o = Math.max(...n.rows.map((e) => e.value), 1);
|
|
237
237
|
return /* @__PURE__ */ p("ul", {
|
|
238
238
|
className: "space-y-1.5",
|
|
239
|
-
children: n.rows.slice(0, 12).map((n) => /* @__PURE__ */ p("li", { children: /* @__PURE__ */ m(
|
|
239
|
+
children: n.rows.slice(0, 12).map((n) => /* @__PURE__ */ p("li", { children: /* @__PURE__ */ m(t, {
|
|
240
240
|
to: "/$workspace/issues",
|
|
241
|
-
params: { workspace:
|
|
241
|
+
params: { workspace: e },
|
|
242
242
|
search: g(n.filter),
|
|
243
243
|
className: "group grid grid-cols-[minmax(0,9rem)_1fr_auto] items-center gap-2 text-sm",
|
|
244
244
|
children: [
|
|
@@ -261,7 +261,7 @@ function E({ workspace: t, data: n, groupBy: r, value: i }) {
|
|
|
261
261
|
}) }, n.key))
|
|
262
262
|
});
|
|
263
263
|
}
|
|
264
|
-
function D({ workspace:
|
|
264
|
+
function D({ workspace: e, data: n, groupBy: r, value: i }) {
|
|
265
265
|
let a = f("dashboards"), o = n.rows.filter((e) => e.value > 0), { keys: s, folded: d } = l(o.map((e) => e.key)), h = u(s), _ = s.map((e) => {
|
|
266
266
|
if (e === c) return {
|
|
267
267
|
key: e,
|
|
@@ -299,9 +299,9 @@ function D({ workspace: t, data: n, groupBy: r, value: i }) {
|
|
|
299
299
|
}, e.key))
|
|
300
300
|
}), /* @__PURE__ */ p("ul", {
|
|
301
301
|
className: "min-w-0 flex-1 space-y-1 text-sm",
|
|
302
|
-
children: b.map((n) => /* @__PURE__ */ p("li", { children: /* @__PURE__ */ m(
|
|
302
|
+
children: b.map((n) => /* @__PURE__ */ p("li", { children: /* @__PURE__ */ m(t, {
|
|
303
303
|
to: "/$workspace/issues",
|
|
304
|
-
params: { workspace:
|
|
304
|
+
params: { workspace: e },
|
|
305
305
|
search: g(n.filter),
|
|
306
306
|
className: "flex items-center gap-2 hover:underline",
|
|
307
307
|
children: [
|
|
@@ -322,7 +322,7 @@ function D({ workspace: t, data: n, groupBy: r, value: i }) {
|
|
|
322
322
|
})]
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
|
-
function O({ workspace:
|
|
325
|
+
function O({ workspace: e, data: n, stacked: r, names: i, value: a }) {
|
|
326
326
|
let s = f("dashboards"), h = d(), { keys: _, folded: v } = l(n.series.map((e) => e.key)), y = u(_), b = _.map((e) => {
|
|
327
327
|
if (e === c) {
|
|
328
328
|
let t = n.series.filter((e) => v.includes(e.key));
|
|
@@ -343,9 +343,9 @@ function O({ workspace: t, data: n, stacked: r, names: i, value: a }) {
|
|
|
343
343
|
day: "numeric",
|
|
344
344
|
timeZone: "UTC"
|
|
345
345
|
});
|
|
346
|
-
return /* @__PURE__ */ m(
|
|
346
|
+
return /* @__PURE__ */ m(t, {
|
|
347
347
|
to: "/$workspace/issues",
|
|
348
|
-
params: { workspace:
|
|
348
|
+
params: { workspace: e },
|
|
349
349
|
search: g(n.filter),
|
|
350
350
|
className: "block space-y-2",
|
|
351
351
|
children: [/* @__PURE__ */ m("svg", {
|