@parallelworks/tandem-web 0.184.0 → 0.186.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.
- package/_virtual/_virtual_i18n/en/common.js +10 -1
- package/_virtual/_virtual_i18n/es/common.js +10 -1
- package/_virtual/_virtual_i18n/ja/common.js +10 -1
- package/_virtual/_virtual_i18n/ko/common.js +10 -1
- package/_virtual/_virtual_i18n/zh/common.js +10 -1
- package/components/DocsTree.js +149 -139
- package/components/FavoriteStar.js +13 -1
- package/components/FavoritesNav.js +168 -112
- package/components/NewProjectDialog.js +170 -163
- package/components/ParentProjectSelect.js +35 -0
- package/lib/projects.js +9 -1
- package/package.json +1 -1
- package/pages/areas.js +183 -173
- package/pages/decisions.js +61 -57
- package/pages/projects.js +43 -34
- package/pages/triage.js +197 -184
- package/routes/_workspace/agents/index2.js +95 -87
- package/routes/_workspace/dashboards/index2.js +61 -53
- package/routes/_workspace/docs/space2._space.js +105 -94
- package/routes/_workspace/graph3.js +69 -60
- package/routes/_workspace/measures3.js +82 -74
- package/routes/_workspace/notifications2.js +236 -230
- package/routes/_workspace/projects/_projectId3.js +286 -287
- package/routes/_workspace/teams/_key/cycles/index2.js +98 -88
- package/routes/_workspace2.js +3 -2
|
@@ -1,158 +1,214 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { projectsQuery as e } from "../api/queries.js";
|
|
2
|
+
import { docRef as t } from "../lib/docs.js";
|
|
3
|
+
import { useFavorites as n } from "../lib/favorites.js";
|
|
4
|
+
import { projectLevel as r } from "../lib/projects.js";
|
|
5
|
+
import { useCan as i } from "../lib/roles.js";
|
|
6
|
+
import { useNavigate as a } from "../lib/router.js";
|
|
7
|
+
import { teamPath as o } from "../lib/teamPaths.js";
|
|
8
|
+
import { DocIcon as s } from "./DocIcon.js";
|
|
9
|
+
import { EntityIcon as c } from "./EntityIcon.js";
|
|
10
|
+
import { AreaIcon as l, ChartIcon as u, CycleIcon as d, FileTextIcon as f, InboxIcon as p, LibraryIcon as m, ListViewIcon as h, NotificationIcon as g, ProjectIcon as _, StatusIcon as v, TriageIcon as y, UserIcon as b } from "./icons.js";
|
|
11
|
+
import { NewProjectDialog as x } from "./NewProjectDialog.js";
|
|
12
|
+
import { menuDivider as S, useOpenMenu as C } from "@parallelworks/ui";
|
|
13
|
+
import { useState as w } from "react";
|
|
14
|
+
import { useTranslations as T } from "use-intl";
|
|
15
|
+
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
16
|
+
import { useQuery as O } from "@tanstack/react-query";
|
|
17
|
+
import { MoreButton as k } from "@parallelworks/ui/list";
|
|
18
|
+
import { AppFrameNavGroup as A, AppFrameNavItem as j } from "@parallelworks/ui/app-frame";
|
|
14
19
|
// src/components/FavoritesNav.tsx
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
switch (
|
|
20
|
+
var M = (...e) => e.filter(Boolean).join(" ");
|
|
21
|
+
function N(e, n, r, i) {
|
|
22
|
+
switch (e.kind) {
|
|
18
23
|
case "issue": return {
|
|
19
|
-
href: `/${n}/issues/${
|
|
20
|
-
label:
|
|
21
|
-
icon:
|
|
22
|
-
category:
|
|
23
|
-
review:
|
|
24
|
-
step:
|
|
24
|
+
href: `/${n}/issues/${e.issue?.identifier ?? ""}`,
|
|
25
|
+
label: e.issue ? `${e.issue.identifier} ${e.issue.title}` : i("issue"),
|
|
26
|
+
icon: e.issue ? /* @__PURE__ */ E(v, {
|
|
27
|
+
category: e.issue.status.category,
|
|
28
|
+
review: e.issue.status.review,
|
|
29
|
+
step: e.issue.status.step
|
|
25
30
|
}) : null
|
|
26
31
|
};
|
|
27
32
|
case "team": return {
|
|
28
|
-
href:
|
|
29
|
-
label:
|
|
30
|
-
icon:
|
|
31
|
-
icon:
|
|
32
|
-
color:
|
|
33
|
-
name:
|
|
33
|
+
href: o(n, e.team?.key ?? "", "issues"),
|
|
34
|
+
label: e.team?.name ?? i("team"),
|
|
35
|
+
icon: e.team ? /* @__PURE__ */ E(c, {
|
|
36
|
+
icon: e.team.icon,
|
|
37
|
+
color: e.team.color,
|
|
38
|
+
name: e.team.name
|
|
34
39
|
}) : null
|
|
35
40
|
};
|
|
36
41
|
case "doc": return {
|
|
37
|
-
href: `/${n}/docs/${
|
|
38
|
-
label:
|
|
39
|
-
icon: /* @__PURE__ */
|
|
40
|
-
icon:
|
|
42
|
+
href: `/${n}/docs/${e.doc ? t(e.doc) : ""}`,
|
|
43
|
+
label: e.doc?.title ?? i("doc"),
|
|
44
|
+
icon: /* @__PURE__ */ E(s, {
|
|
45
|
+
icon: e.doc?.icon,
|
|
41
46
|
className: "size-4"
|
|
42
47
|
})
|
|
43
48
|
};
|
|
44
49
|
case "project": return {
|
|
45
|
-
href: `/${n}/projects/${
|
|
46
|
-
label:
|
|
47
|
-
icon:
|
|
48
|
-
icon:
|
|
49
|
-
color:
|
|
50
|
-
name:
|
|
51
|
-
}) : /* @__PURE__ */
|
|
50
|
+
href: `/${n}/projects/${e.plan?.ref ?? e.target}`,
|
|
51
|
+
label: e.plan?.name ?? i("project"),
|
|
52
|
+
icon: e.plan?.icon || e.plan?.color ? /* @__PURE__ */ E(c, {
|
|
53
|
+
icon: e.plan.icon ?? "",
|
|
54
|
+
color: e.plan.color ?? "",
|
|
55
|
+
name: e.plan.name
|
|
56
|
+
}) : /* @__PURE__ */ E(_, { className: "size-4" })
|
|
52
57
|
};
|
|
53
58
|
case "cycle": return {
|
|
54
|
-
href: `${
|
|
55
|
-
label:
|
|
56
|
-
team:
|
|
57
|
-
number:
|
|
58
|
-
}) :
|
|
59
|
-
icon: /* @__PURE__ */
|
|
59
|
+
href: `${o(n, e.team?.key ?? "", "cycles")}/${e.plan?.ref ?? ""}`,
|
|
60
|
+
label: e.plan ? e.plan.name || i("cycleOf", {
|
|
61
|
+
team: e.team?.key ?? "",
|
|
62
|
+
number: e.plan.ref
|
|
63
|
+
}) : i("cycle"),
|
|
64
|
+
icon: /* @__PURE__ */ E(d, { className: "size-4" })
|
|
60
65
|
};
|
|
61
66
|
case "view": return {
|
|
62
|
-
href:
|
|
63
|
-
label:
|
|
64
|
-
icon: /* @__PURE__ */
|
|
67
|
+
href: e.target,
|
|
68
|
+
label: e.label || i("view"),
|
|
69
|
+
icon: /* @__PURE__ */ E(h, { className: "size-4" })
|
|
65
70
|
};
|
|
66
|
-
case "page": return
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
71
|
+
case "page": return {
|
|
72
|
+
decisions: {
|
|
73
|
+
href: `/${n}/decisions`,
|
|
74
|
+
label: i("decisions"),
|
|
75
|
+
icon: /* @__PURE__ */ E(p, { className: "size-4" })
|
|
76
|
+
},
|
|
77
|
+
agents: {
|
|
78
|
+
href: `/${n}/agents`,
|
|
79
|
+
label: i("agents"),
|
|
80
|
+
icon: /* @__PURE__ */ E(b, { className: "size-4" })
|
|
81
|
+
},
|
|
82
|
+
projects: {
|
|
83
|
+
href: `/${n}/projects`,
|
|
84
|
+
label: i("projects"),
|
|
85
|
+
icon: /* @__PURE__ */ E(_, { className: "size-4" })
|
|
86
|
+
},
|
|
87
|
+
knowledge: {
|
|
88
|
+
href: `/${n}/knowledge`,
|
|
89
|
+
label: i("knowledge"),
|
|
90
|
+
icon: /* @__PURE__ */ E(m, { className: "size-4" })
|
|
91
|
+
},
|
|
92
|
+
docs: {
|
|
93
|
+
href: `/${n}/docs`,
|
|
94
|
+
label: i("docs"),
|
|
95
|
+
icon: /* @__PURE__ */ E(f, { className: "size-4" })
|
|
96
|
+
},
|
|
97
|
+
"my-issues": {
|
|
98
|
+
href: `/${n}/issues?assignee=${r}`,
|
|
99
|
+
label: i("myIssues"),
|
|
100
|
+
icon: /* @__PURE__ */ E(b, { className: "size-4" })
|
|
101
|
+
},
|
|
102
|
+
notifications: {
|
|
103
|
+
href: `/${n}/notifications`,
|
|
104
|
+
label: i("notifications"),
|
|
105
|
+
icon: /* @__PURE__ */ E(g, { className: "size-4" })
|
|
106
|
+
},
|
|
107
|
+
dashboards: {
|
|
108
|
+
href: `/${n}/dashboards`,
|
|
109
|
+
label: i("dashboards"),
|
|
110
|
+
icon: /* @__PURE__ */ E(u, { className: "size-4" })
|
|
111
|
+
},
|
|
112
|
+
areas: {
|
|
113
|
+
href: `/${n}/areas`,
|
|
114
|
+
label: i("areas"),
|
|
115
|
+
icon: /* @__PURE__ */ E(l, { className: "size-4" })
|
|
116
|
+
},
|
|
117
|
+
triage: {
|
|
118
|
+
href: `/${n}/triage`,
|
|
119
|
+
label: i("triage"),
|
|
120
|
+
icon: /* @__PURE__ */ E(y, { className: "size-4" })
|
|
121
|
+
},
|
|
122
|
+
graph: {
|
|
123
|
+
href: `/${n}/graph`,
|
|
124
|
+
label: i("graph"),
|
|
125
|
+
icon: /* @__PURE__ */ E(m, { className: "size-4" })
|
|
126
|
+
},
|
|
127
|
+
measures: {
|
|
128
|
+
href: `/${n}/measures`,
|
|
129
|
+
label: i("measures"),
|
|
130
|
+
icon: /* @__PURE__ */ E(h, { className: "size-4" })
|
|
131
|
+
}
|
|
132
|
+
}[e.target] ?? {
|
|
91
133
|
href: `/${n}/issues`,
|
|
92
|
-
label:
|
|
93
|
-
icon: /* @__PURE__ */
|
|
134
|
+
label: i("issues"),
|
|
135
|
+
icon: /* @__PURE__ */ E(h, { className: "size-4" })
|
|
94
136
|
};
|
|
95
137
|
}
|
|
96
138
|
}
|
|
97
|
-
function
|
|
98
|
-
let { favorites:
|
|
99
|
-
|
|
100
|
-
|
|
139
|
+
function P({ workspace: t, myUsername: o, currentHref: s }) {
|
|
140
|
+
let { favorites: c, remove: l, move: u } = n(t), d = C(), f = T("favorites"), p = T("common"), m = T("planning"), h = a(), [g, _] = w(null), [v, y] = w(null), [b, P] = w(null), F = i(t, "manage_projects"), { data: I = [] } = O({
|
|
141
|
+
...e(t),
|
|
142
|
+
enabled: F && c.some((e) => e.kind === "project")
|
|
143
|
+
});
|
|
144
|
+
if (c.length === 0) return null;
|
|
145
|
+
let L = (e) => e.kind === "project" ? I.find((t) => t.id === e.target) : void 0, R = (e) => {
|
|
146
|
+
let t = L(e);
|
|
147
|
+
return F && !!t && !t.template && r(I, t.id) < 5;
|
|
148
|
+
}, z = (e, t) => [
|
|
101
149
|
{
|
|
102
|
-
label:
|
|
103
|
-
onClick: () =>
|
|
150
|
+
label: p("open"),
|
|
151
|
+
onClick: () => h({ href: t })
|
|
104
152
|
},
|
|
153
|
+
...R(e) ? [{
|
|
154
|
+
label: m("newSubProject"),
|
|
155
|
+
onClick: () => P(e.target)
|
|
156
|
+
}] : [],
|
|
105
157
|
{
|
|
106
|
-
label:
|
|
158
|
+
label: p("openInNewTab"),
|
|
107
159
|
href: t,
|
|
108
160
|
target: "_blank"
|
|
109
161
|
},
|
|
110
|
-
|
|
162
|
+
S,
|
|
111
163
|
{
|
|
112
|
-
label:
|
|
113
|
-
onClick: () =>
|
|
164
|
+
label: f("remove"),
|
|
165
|
+
onClick: () => l(e.id)
|
|
114
166
|
}
|
|
115
|
-
],
|
|
116
|
-
if (!
|
|
117
|
-
let t =
|
|
118
|
-
|
|
119
|
-
id:
|
|
167
|
+
], B = (e) => {
|
|
168
|
+
if (!g || g === e) return;
|
|
169
|
+
let t = c.filter((e) => e.id !== g), n = t.findIndex((t) => t.id === e), [r, i] = c.findIndex((e) => e.id === g) < c.findIndex((t) => t.id === e) ? [t[n], t[n + 1]] : [t[n - 1], t[n]];
|
|
170
|
+
u({
|
|
171
|
+
id: g,
|
|
120
172
|
...r && { after: r.id },
|
|
121
173
|
...i && { before: i.id }
|
|
122
174
|
});
|
|
123
175
|
};
|
|
124
|
-
return /* @__PURE__ */
|
|
125
|
-
label:
|
|
176
|
+
return /* @__PURE__ */ D(A, {
|
|
177
|
+
label: f("title"),
|
|
126
178
|
collapsible: !1,
|
|
127
|
-
children:
|
|
128
|
-
let n =
|
|
129
|
-
return /* @__PURE__ */
|
|
179
|
+
children: [c.map((e) => {
|
|
180
|
+
let n = N(e, t, o, f);
|
|
181
|
+
return /* @__PURE__ */ E(j, {
|
|
130
182
|
label: n.label,
|
|
131
183
|
icon: n.icon,
|
|
132
184
|
href: n.href,
|
|
133
|
-
selected: n.href ===
|
|
185
|
+
selected: n.href === s,
|
|
134
186
|
draggable: !0,
|
|
135
|
-
onDragStart: (
|
|
136
|
-
|
|
187
|
+
onDragStart: (t) => {
|
|
188
|
+
_(e.id), t.dataTransfer.effectAllowed = "move";
|
|
137
189
|
},
|
|
138
|
-
onDragOver: (
|
|
139
|
-
|
|
190
|
+
onDragOver: (t) => {
|
|
191
|
+
t.preventDefault(), y(e.id);
|
|
140
192
|
},
|
|
141
|
-
onDragLeave: () =>
|
|
142
|
-
onDrop: (
|
|
143
|
-
|
|
193
|
+
onDragLeave: () => y((t) => t === e.id ? null : t),
|
|
194
|
+
onDrop: (t) => {
|
|
195
|
+
t.preventDefault(), B(e.id), _(null), y(null);
|
|
144
196
|
},
|
|
145
197
|
onDragEnd: () => {
|
|
146
|
-
|
|
198
|
+
_(null), y(null);
|
|
147
199
|
},
|
|
148
|
-
onContextMenu: (
|
|
149
|
-
className:
|
|
150
|
-
action: /* @__PURE__ */
|
|
151
|
-
items: () =>
|
|
152
|
-
label:
|
|
200
|
+
onContextMenu: (t) => d(t, z(e, n.href)),
|
|
201
|
+
className: M(g === e.id && "opacity-40", v === e.id && g !== e.id && "ring-1 ring-primary/60"),
|
|
202
|
+
action: /* @__PURE__ */ E(k, {
|
|
203
|
+
items: () => z(e, n.href),
|
|
204
|
+
label: p("moreActionsFor", { name: n.label })
|
|
153
205
|
})
|
|
154
|
-
},
|
|
155
|
-
})
|
|
206
|
+
}, e.id);
|
|
207
|
+
}), b && /* @__PURE__ */ E(x, {
|
|
208
|
+
workspace: t,
|
|
209
|
+
parentId: b,
|
|
210
|
+
onClose: () => P(null)
|
|
211
|
+
})]
|
|
156
212
|
});
|
|
157
213
|
}
|
|
158
|
-
export {
|
|
214
|
+
export { P as FavoritesNav };
|