@parallelworks/tandem-web 0.183.0 → 0.185.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 +18 -0
- package/_virtual/_virtual_i18n/es/common.js +18 -0
- package/_virtual/_virtual_i18n/ja/common.js +18 -0
- package/_virtual/_virtual_i18n/ko/common.js +18 -0
- package/_virtual/_virtual_i18n/zh/common.js +18 -0
- package/components/DocProperties.js +137 -114
- package/components/DocStart.js +116 -92
- package/components/DocTable.js +102 -100
- package/components/FavoritesNav.js +125 -106
- package/components/NewProjectDialog.js +170 -163
- package/components/ParentProjectSelect.js +35 -0
- package/components/ProjectAccess.js +23 -20
- package/components/SubpageViews.js +477 -161
- package/components/icons.js +8 -8
- package/lib/cancelledLoads.js +7 -0
- package/lib/docProperties.js +6 -6
- package/lib/projects.js +9 -1
- package/lib/queryClient.js +7 -6
- package/lib/subpageViews.js +1 -0
- package/package.json +1 -1
- package/pages/projects.js +62 -57
- package/routes/_workspace/docs/space2._space.js +128 -128
- package/routes/_workspace/knowledge/_term2.js +83 -77
- package/routes/_workspace/projects/_projectId3.js +286 -287
- package/styles.css +1 -0
|
@@ -7,54 +7,56 @@ import { useNavigate as ie } from "../lib/router.js";
|
|
|
7
7
|
import { useTime as ae } from "../lib/time.js";
|
|
8
8
|
import { Editor as oe } from "./Editor.js";
|
|
9
9
|
import { EntityIcon as i } from "./EntityIcon.js";
|
|
10
|
-
import { IconUpload as
|
|
11
|
-
import { AddIcon as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
10
|
+
import { IconUpload as se } from "./IconUpload.js";
|
|
11
|
+
import { AddIcon as ce, CalendarIcon as le, ChevronRightIcon as ue, CloseIcon as a, PriorityIcon as o, ProjectIcon as de, UserIcon as fe, UsersIcon as s, usePriorityNames as pe } from "./icons.js";
|
|
12
|
+
import { ParentProjectSelect as me } from "./ParentProjectSelect.js";
|
|
13
|
+
import { ProjectStatusIcon as c } from "./Planning.js";
|
|
14
|
+
import { Avatar as l, Button as u, Card as he, Combobox as d, DatePicker as ge, ErrorText as _e, IconButton as f, Modal as ve, ModalTitle as ye, Select as p, buttonClasses as m } from "@parallelworks/ui";
|
|
15
|
+
import { useState as h } from "react";
|
|
16
|
+
import { useErrorMessage as be } from "@parallelworks/problem/react";
|
|
17
|
+
import { useTranslations as g } from "use-intl";
|
|
18
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
19
|
+
import { useQuery as b, useQueryClient as xe } from "@tanstack/react-query";
|
|
19
20
|
// src/components/NewProjectDialog.tsx
|
|
20
|
-
var
|
|
21
|
-
function
|
|
22
|
-
let
|
|
21
|
+
var x = m({ size: "sm" });
|
|
22
|
+
function S({ workspace: m, teamId: S, parentId: Se, onClose: C }) {
|
|
23
|
+
let w = g("planning"), T = g("common"), Ce = be(), we = ae(), E = pe(), Te = xe(), Ee = ie(), { members: D, person: O } = te(m), { data: k } = b(ee(m)), { data: De = [] } = b(n(m)), { data: Oe = [] } = b(r(m)), A = Oe.filter((e) => e.template), [j, ke] = h(""), [M, Ae] = h(""), [N, je] = h(""), [P, Me] = h(""), [F, Ne] = h(""), [I, Pe] = h("planned"), [L, Fe] = h(0), [R, Ie] = h(""), [z, Le] = h([]), [B, Re] = h(S ? [S] : []), [V, ze] = h(Se ?? ""), [H, Be] = h(""), [U, Ve] = h(""), [W, G] = h([]), [K, q] = h(null), [J, Y] = h(!1), [He, X] = h(null), Z = De.filter((e) => !e.archivedAt), Q = (e, t, n) => /* @__PURE__ */ v(ge, {
|
|
23
24
|
value: t,
|
|
24
25
|
onValueChange: n,
|
|
25
26
|
"aria-label": e,
|
|
26
|
-
trigger: /* @__PURE__ */
|
|
27
|
+
trigger: /* @__PURE__ */ y("button", {
|
|
27
28
|
type: "button",
|
|
28
|
-
className:
|
|
29
|
-
children: [/* @__PURE__ */
|
|
29
|
+
className: x,
|
|
30
|
+
children: [/* @__PURE__ */ v(le, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ v("span", {
|
|
30
31
|
className: t ? "" : "text-muted-foreground",
|
|
31
|
-
children: t ?
|
|
32
|
+
children: t ? we.day(t) : e
|
|
32
33
|
})]
|
|
33
34
|
})
|
|
34
|
-
}),
|
|
35
|
-
if (n.preventDefault(),
|
|
35
|
+
}), Ue = async (n) => {
|
|
36
|
+
if (n.preventDefault(), N.trim()) {
|
|
36
37
|
Y(!0), X(null);
|
|
37
38
|
try {
|
|
38
39
|
let n = t(await e.POST("/api/v1/workspaces/{workspace}/projects", {
|
|
39
|
-
params: { path: { workspace:
|
|
40
|
+
params: { path: { workspace: m } },
|
|
40
41
|
body: {
|
|
41
|
-
name:
|
|
42
|
-
status:
|
|
43
|
-
...
|
|
44
|
-
...
|
|
45
|
-
...
|
|
46
|
-
...
|
|
47
|
-
...
|
|
48
|
-
...
|
|
49
|
-
...
|
|
50
|
-
...
|
|
42
|
+
name: N.trim(),
|
|
43
|
+
status: I,
|
|
44
|
+
...j && { from: j },
|
|
45
|
+
...P.trim() && { summary: P.trim() },
|
|
46
|
+
...F && { description: F },
|
|
47
|
+
...L && { priority: L },
|
|
48
|
+
...M && { icon: M },
|
|
49
|
+
...R && { lead: R },
|
|
50
|
+
...z.length > 0 && { members: z },
|
|
51
|
+
...B.length > 0 && { teamIds: B },
|
|
51
52
|
...H && { startDate: H },
|
|
52
|
-
...U && { targetDate: U }
|
|
53
|
+
...U && { targetDate: U },
|
|
54
|
+
...V && { parentId: V }
|
|
53
55
|
}
|
|
54
56
|
}));
|
|
55
57
|
for (let r of W.filter((e) => e.name.trim())) t(await e.POST("/api/v1/workspaces/{workspace}/projects/{projectId}/milestones", {
|
|
56
58
|
params: { path: {
|
|
57
|
-
workspace:
|
|
59
|
+
workspace: m,
|
|
58
60
|
projectId: n.id
|
|
59
61
|
} },
|
|
60
62
|
body: {
|
|
@@ -62,105 +64,105 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
62
64
|
...r.targetDate && { targetDate: r.targetDate }
|
|
63
65
|
}
|
|
64
66
|
}));
|
|
65
|
-
|
|
67
|
+
Te.invalidateQueries({ queryKey: r(m).queryKey }), C(), Ee({
|
|
66
68
|
to: "/$workspace/projects/$projectId",
|
|
67
69
|
params: {
|
|
68
|
-
workspace:
|
|
70
|
+
workspace: m,
|
|
69
71
|
projectId: re(n)
|
|
70
72
|
}
|
|
71
73
|
});
|
|
72
74
|
} catch (e) {
|
|
73
|
-
X(
|
|
75
|
+
X(Ce(e));
|
|
74
76
|
} finally {
|
|
75
77
|
Y(!1);
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
|
-
}, $ =
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
+
}, $ = R ? O(R) : void 0;
|
|
81
|
+
return /* @__PURE__ */ v(ve, {
|
|
80
82
|
open: !0,
|
|
81
|
-
onClose:
|
|
83
|
+
onClose: C,
|
|
82
84
|
className: "flex max-h-[90vh] w-full max-w-3xl flex-col",
|
|
83
|
-
children: /* @__PURE__ */
|
|
84
|
-
onSubmit:
|
|
85
|
+
children: /* @__PURE__ */ y("form", {
|
|
86
|
+
onSubmit: Ue,
|
|
85
87
|
className: "flex min-h-0 flex-1 flex-col",
|
|
86
88
|
children: [
|
|
87
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ y("div", {
|
|
88
90
|
className: "flex items-center gap-2 px-5 pt-4 text-sm",
|
|
89
91
|
children: [
|
|
90
|
-
|
|
92
|
+
k && /* @__PURE__ */ y("span", {
|
|
91
93
|
className: "flex items-center gap-1.5 rounded-md border border-border px-2 py-0.5",
|
|
92
|
-
children: [/* @__PURE__ */
|
|
93
|
-
icon:
|
|
94
|
-
color:
|
|
95
|
-
name:
|
|
96
|
-
}),
|
|
94
|
+
children: [/* @__PURE__ */ v(i, {
|
|
95
|
+
icon: k.icon,
|
|
96
|
+
color: k.color,
|
|
97
|
+
name: k.name
|
|
98
|
+
}), k.name]
|
|
97
99
|
}),
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ v(ue, { className: "size-3.5 text-muted-foreground" }),
|
|
101
|
+
/* @__PURE__ */ v(ye, {
|
|
100
102
|
className: "text-sm",
|
|
101
|
-
children:
|
|
103
|
+
children: w("newProject")
|
|
102
104
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ v(f, {
|
|
104
106
|
variant: "ghost",
|
|
105
107
|
size: "sm",
|
|
106
|
-
icon: /* @__PURE__ */
|
|
107
|
-
label:
|
|
108
|
-
onClick:
|
|
108
|
+
icon: /* @__PURE__ */ v(a, {}),
|
|
109
|
+
label: T("close"),
|
|
110
|
+
onClick: C,
|
|
109
111
|
className: "ml-auto"
|
|
110
112
|
})
|
|
111
113
|
]
|
|
112
114
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ y("div", {
|
|
114
116
|
className: "min-h-0 flex-1 overflow-y-auto px-5 pt-4 pb-2",
|
|
115
117
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
workspace:
|
|
118
|
-
icon:
|
|
119
|
-
name:
|
|
120
|
-
onChange:
|
|
118
|
+
/* @__PURE__ */ v(se, {
|
|
119
|
+
workspace: m,
|
|
120
|
+
icon: M,
|
|
121
|
+
name: N || w("project"),
|
|
122
|
+
onChange: Ae,
|
|
121
123
|
size: 40
|
|
122
124
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
value:
|
|
125
|
-
onChange: (e) =>
|
|
125
|
+
/* @__PURE__ */ v("input", {
|
|
126
|
+
value: N,
|
|
127
|
+
onChange: (e) => je(e.target.value),
|
|
126
128
|
autoFocus: !0,
|
|
127
129
|
required: !0,
|
|
128
130
|
maxLength: 200,
|
|
129
|
-
"aria-label":
|
|
130
|
-
placeholder:
|
|
131
|
+
"aria-label": w("projectName"),
|
|
132
|
+
placeholder: w("projectName"),
|
|
131
133
|
className: "mt-3 w-full bg-transparent text-2xl font-semibold tracking-tight outline-none placeholder:text-muted-foreground/60"
|
|
132
134
|
}),
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
value:
|
|
135
|
-
onChange: (e) =>
|
|
135
|
+
/* @__PURE__ */ v("input", {
|
|
136
|
+
value: P,
|
|
137
|
+
onChange: (e) => Me(e.target.value),
|
|
136
138
|
maxLength: 200,
|
|
137
|
-
"aria-label":
|
|
138
|
-
placeholder:
|
|
139
|
+
"aria-label": w("summary"),
|
|
140
|
+
placeholder: w("summaryPlaceholder"),
|
|
139
141
|
className: "mt-1 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"
|
|
140
142
|
}),
|
|
141
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ v("div", {
|
|
142
144
|
className: "mt-4",
|
|
143
|
-
children: /* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ v(oe, {
|
|
144
146
|
value: "",
|
|
145
|
-
onChange:
|
|
146
|
-
placeholder:
|
|
147
|
-
label:
|
|
147
|
+
onChange: Ne,
|
|
148
|
+
placeholder: w("projectBrief"),
|
|
149
|
+
label: T("description"),
|
|
148
150
|
className: "min-h-32"
|
|
149
151
|
})
|
|
150
152
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ y(he, {
|
|
152
154
|
size: "fill",
|
|
153
155
|
padding: "none",
|
|
154
|
-
render: /* @__PURE__ */
|
|
156
|
+
render: /* @__PURE__ */ v("section", {}),
|
|
155
157
|
className: "mt-4",
|
|
156
|
-
children: [/* @__PURE__ */
|
|
158
|
+
children: [/* @__PURE__ */ y("div", {
|
|
157
159
|
className: "flex h-10 items-center px-3",
|
|
158
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ v("h2", {
|
|
159
161
|
className: "text-sm font-medium",
|
|
160
|
-
children:
|
|
161
|
-
}), /* @__PURE__ */
|
|
162
|
-
icon: /* @__PURE__ */
|
|
163
|
-
label:
|
|
162
|
+
children: w("milestones")
|
|
163
|
+
}), /* @__PURE__ */ v(f, {
|
|
164
|
+
icon: /* @__PURE__ */ v(ce, { className: "size-3.5" }),
|
|
165
|
+
label: w("addMilestone"),
|
|
164
166
|
size: "xs",
|
|
165
167
|
onClick: () => G((e) => [...e, {
|
|
166
168
|
key: Date.now(),
|
|
@@ -169,29 +171,29 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
169
171
|
}]),
|
|
170
172
|
className: "ml-auto"
|
|
171
173
|
})]
|
|
172
|
-
}), W.map((e) => /* @__PURE__ */
|
|
174
|
+
}), W.map((e) => /* @__PURE__ */ y("div", {
|
|
173
175
|
className: "flex items-center gap-2 border-t border-border px-3 py-1.5",
|
|
174
176
|
children: [
|
|
175
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ v("input", {
|
|
176
178
|
value: e.name,
|
|
177
179
|
autoFocus: !0,
|
|
178
180
|
onChange: (t) => G((n) => n.map((n) => n.key === e.key ? {
|
|
179
181
|
...n,
|
|
180
182
|
name: t.target.value
|
|
181
183
|
} : n)),
|
|
182
|
-
"aria-label":
|
|
183
|
-
placeholder:
|
|
184
|
+
"aria-label": w("milestoneName"),
|
|
185
|
+
placeholder: w("milestoneName"),
|
|
184
186
|
className: "h-7 min-w-0 flex-1 bg-transparent text-sm outline-none"
|
|
185
187
|
}),
|
|
186
|
-
Q(
|
|
188
|
+
Q(w("targetDate"), e.targetDate, (t) => G((n) => n.map((n) => n.key === e.key ? {
|
|
187
189
|
...n,
|
|
188
190
|
targetDate: t
|
|
189
191
|
} : n))),
|
|
190
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ v(f, {
|
|
191
193
|
variant: "ghost",
|
|
192
194
|
size: "sm",
|
|
193
|
-
icon: /* @__PURE__ */
|
|
194
|
-
label:
|
|
195
|
+
icon: /* @__PURE__ */ v(a, {}),
|
|
196
|
+
label: w("removeMilestone"),
|
|
195
197
|
onClick: () => G((t) => t.filter((t) => t.key !== e.key))
|
|
196
198
|
})
|
|
197
199
|
]
|
|
@@ -199,116 +201,116 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
199
201
|
})
|
|
200
202
|
]
|
|
201
203
|
}),
|
|
202
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ y("div", {
|
|
203
205
|
className: "flex flex-wrap items-center gap-1.5 border-t border-border px-5 pt-3",
|
|
204
206
|
children: [
|
|
205
|
-
|
|
206
|
-
"aria-label":
|
|
207
|
-
value:
|
|
208
|
-
onValueChange: (e) =>
|
|
207
|
+
A.length > 0 && /* @__PURE__ */ v(p, {
|
|
208
|
+
"aria-label": w("startFrom"),
|
|
209
|
+
value: j,
|
|
210
|
+
onValueChange: (e) => ke(e ?? ""),
|
|
209
211
|
items: [{
|
|
210
212
|
value: "",
|
|
211
|
-
label:
|
|
212
|
-
}, ...
|
|
213
|
+
label: w("blankProject")
|
|
214
|
+
}, ...A.map((e) => ({
|
|
213
215
|
value: e.id,
|
|
214
216
|
label: e.name
|
|
215
217
|
}))],
|
|
216
|
-
trigger: /* @__PURE__ */
|
|
218
|
+
trigger: /* @__PURE__ */ y("button", {
|
|
217
219
|
type: "button",
|
|
218
|
-
className:
|
|
219
|
-
children: [/* @__PURE__ */
|
|
220
|
+
className: x,
|
|
221
|
+
children: [/* @__PURE__ */ v(de, { className: "size-3.5 text-muted-foreground" }), j ? w("fromTemplate", { name: A.find((e) => e.id === j)?.name ?? "" }) : w("blankProject")]
|
|
220
222
|
})
|
|
221
223
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
"aria-label":
|
|
224
|
-
value:
|
|
225
|
-
onValueChange: (e) => e &&
|
|
224
|
+
/* @__PURE__ */ v(p, {
|
|
225
|
+
"aria-label": w("statusLabel"),
|
|
226
|
+
value: I,
|
|
227
|
+
onValueChange: (e) => e && Pe(e),
|
|
226
228
|
items: ne.map((e) => ({
|
|
227
229
|
value: e,
|
|
228
|
-
label:
|
|
229
|
-
icon: /* @__PURE__ */
|
|
230
|
+
label: w(`status.${e}`),
|
|
231
|
+
icon: /* @__PURE__ */ v(c, { status: e })
|
|
230
232
|
})),
|
|
231
|
-
trigger: /* @__PURE__ */
|
|
233
|
+
trigger: /* @__PURE__ */ y("button", {
|
|
232
234
|
type: "button",
|
|
233
|
-
className:
|
|
234
|
-
children: [/* @__PURE__ */
|
|
235
|
+
className: x,
|
|
236
|
+
children: [/* @__PURE__ */ v(c, { status: I }), w(`status.${I}`)]
|
|
235
237
|
})
|
|
236
238
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
-
"aria-label":
|
|
239
|
-
value: String(
|
|
240
|
-
onValueChange: (e) => e &&
|
|
241
|
-
items:
|
|
239
|
+
/* @__PURE__ */ v(p, {
|
|
240
|
+
"aria-label": w("priority"),
|
|
241
|
+
value: String(L),
|
|
242
|
+
onValueChange: (e) => e && Fe(Number(e)),
|
|
243
|
+
items: E.map((e, t) => ({
|
|
242
244
|
value: String(t),
|
|
243
245
|
label: e,
|
|
244
|
-
icon: /* @__PURE__ */
|
|
246
|
+
icon: /* @__PURE__ */ v(o, { priority: t })
|
|
245
247
|
})),
|
|
246
|
-
trigger: /* @__PURE__ */
|
|
248
|
+
trigger: /* @__PURE__ */ y("button", {
|
|
247
249
|
type: "button",
|
|
248
|
-
className:
|
|
249
|
-
children: [/* @__PURE__ */
|
|
250
|
+
className: x,
|
|
251
|
+
children: [/* @__PURE__ */ v(o, { priority: L }), L ? E[L] : w("noPriority")]
|
|
250
252
|
})
|
|
251
253
|
}),
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
"aria-label":
|
|
254
|
-
value:
|
|
255
|
-
onValueChange: (e) =>
|
|
254
|
+
/* @__PURE__ */ v(d, {
|
|
255
|
+
"aria-label": w("lead"),
|
|
256
|
+
value: R,
|
|
257
|
+
onValueChange: (e) => Ie(e ?? ""),
|
|
256
258
|
items: [{
|
|
257
259
|
value: "",
|
|
258
|
-
label:
|
|
259
|
-
}, ...
|
|
260
|
+
label: w("noLead")
|
|
261
|
+
}, ...D.map((e) => ({
|
|
260
262
|
value: e.user.username,
|
|
261
263
|
label: e.user.name,
|
|
262
|
-
icon: /* @__PURE__ */
|
|
264
|
+
icon: /* @__PURE__ */ v(l, {
|
|
263
265
|
name: e.user.name,
|
|
264
266
|
src: e.user.avatarUrl,
|
|
265
267
|
size: "xs",
|
|
266
268
|
decorative: !0
|
|
267
269
|
})
|
|
268
270
|
}))],
|
|
269
|
-
trigger: /* @__PURE__ */
|
|
271
|
+
trigger: /* @__PURE__ */ v("button", {
|
|
270
272
|
type: "button",
|
|
271
|
-
className:
|
|
272
|
-
children: $ ? /* @__PURE__ */
|
|
273
|
+
className: x,
|
|
274
|
+
children: $ ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(l, {
|
|
273
275
|
name: $.name,
|
|
274
276
|
src: $.avatarUrl,
|
|
275
277
|
size: "xs",
|
|
276
278
|
decorative: !0
|
|
277
|
-
}), $.name] }) : /* @__PURE__ */
|
|
279
|
+
}), $.name] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(fe, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ v("span", {
|
|
278
280
|
className: "text-muted-foreground",
|
|
279
|
-
children:
|
|
281
|
+
children: w("lead")
|
|
280
282
|
})] })
|
|
281
283
|
})
|
|
282
284
|
}),
|
|
283
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ v(d, {
|
|
284
286
|
open: K === "members",
|
|
285
287
|
onOpenChange: (e) => q(e ? "members" : null),
|
|
286
288
|
multiple: !0,
|
|
287
|
-
items:
|
|
289
|
+
items: D.map((e) => ({
|
|
288
290
|
value: e.user.username,
|
|
289
291
|
label: e.user.name,
|
|
290
|
-
icon: /* @__PURE__ */
|
|
292
|
+
icon: /* @__PURE__ */ v(l, {
|
|
291
293
|
name: e.user.name,
|
|
292
294
|
src: e.user.avatarUrl,
|
|
293
295
|
size: "xs",
|
|
294
296
|
decorative: !0
|
|
295
297
|
})
|
|
296
298
|
})),
|
|
297
|
-
value:
|
|
298
|
-
onValueChange:
|
|
299
|
-
placeholder:
|
|
300
|
-
trigger: /* @__PURE__ */
|
|
299
|
+
value: z,
|
|
300
|
+
onValueChange: Le,
|
|
301
|
+
placeholder: w("members"),
|
|
302
|
+
trigger: /* @__PURE__ */ y("button", {
|
|
301
303
|
type: "button",
|
|
302
|
-
className:
|
|
303
|
-
children: [/* @__PURE__ */
|
|
304
|
-
className:
|
|
305
|
-
children:
|
|
304
|
+
className: x,
|
|
305
|
+
children: [/* @__PURE__ */ v(s, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ v("span", {
|
|
306
|
+
className: z.length ? "" : "text-muted-foreground",
|
|
307
|
+
children: z.length ? w("memberCount", { count: z.length }) : w("members")
|
|
306
308
|
})]
|
|
307
309
|
})
|
|
308
310
|
}),
|
|
309
|
-
Q(
|
|
310
|
-
Q(
|
|
311
|
-
/* @__PURE__ */
|
|
311
|
+
Q(w("startDate"), H, Be),
|
|
312
|
+
Q(w("targetDate"), U, Ve),
|
|
313
|
+
/* @__PURE__ */ v(d, {
|
|
312
314
|
open: K === "teams",
|
|
313
315
|
onOpenChange: (e) => q(e ? "teams" : null),
|
|
314
316
|
multiple: !0,
|
|
@@ -316,45 +318,50 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
316
318
|
value: e.id,
|
|
317
319
|
label: e.name,
|
|
318
320
|
hint: e.key,
|
|
319
|
-
icon: /* @__PURE__ */
|
|
321
|
+
icon: /* @__PURE__ */ v(i, {
|
|
320
322
|
icon: e.icon,
|
|
321
323
|
color: e.color,
|
|
322
324
|
name: e.name
|
|
323
325
|
})
|
|
324
326
|
})),
|
|
325
|
-
value:
|
|
326
|
-
onValueChange:
|
|
327
|
-
placeholder:
|
|
328
|
-
trigger: /* @__PURE__ */
|
|
327
|
+
value: B,
|
|
328
|
+
onValueChange: Re,
|
|
329
|
+
placeholder: w("teams"),
|
|
330
|
+
trigger: /* @__PURE__ */ y("button", {
|
|
329
331
|
type: "button",
|
|
330
|
-
className:
|
|
331
|
-
children: [/* @__PURE__ */
|
|
332
|
-
className:
|
|
333
|
-
children:
|
|
332
|
+
className: x,
|
|
333
|
+
children: [/* @__PURE__ */ v(s, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ v("span", {
|
|
334
|
+
className: B.length ? "" : "text-muted-foreground",
|
|
335
|
+
children: B.length ? Z.filter((e) => B.includes(e.id)).map((e) => e.key).join(", ") : w("teams")
|
|
334
336
|
})]
|
|
335
337
|
})
|
|
338
|
+
}),
|
|
339
|
+
/* @__PURE__ */ v(me, {
|
|
340
|
+
workspace: m,
|
|
341
|
+
value: V,
|
|
342
|
+
onChange: ze
|
|
336
343
|
})
|
|
337
344
|
]
|
|
338
345
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ y("div", {
|
|
340
347
|
className: "flex items-center gap-2 px-5 py-3",
|
|
341
348
|
children: [
|
|
342
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ v(_e, {
|
|
343
350
|
size: "md",
|
|
344
351
|
className: "min-w-0 flex-1",
|
|
345
|
-
children:
|
|
352
|
+
children: He
|
|
346
353
|
}),
|
|
347
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ v(u, {
|
|
348
355
|
type: "button",
|
|
349
|
-
onClick:
|
|
356
|
+
onClick: C,
|
|
350
357
|
className: "ml-auto",
|
|
351
|
-
children:
|
|
358
|
+
children: T("cancel")
|
|
352
359
|
}),
|
|
353
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ v(u, {
|
|
354
361
|
type: "submit",
|
|
355
362
|
variant: "primary",
|
|
356
|
-
disabled: J || !
|
|
357
|
-
children:
|
|
363
|
+
disabled: J || !N.trim(),
|
|
364
|
+
children: w(J ? "creating" : "createProject")
|
|
358
365
|
})
|
|
359
366
|
]
|
|
360
367
|
})
|
|
@@ -362,4 +369,4 @@ function C({ workspace: h, teamId: C, onClose: w }) {
|
|
|
362
369
|
})
|
|
363
370
|
});
|
|
364
371
|
}
|
|
365
|
-
export {
|
|
372
|
+
export { S as NewProjectDialog };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { projectsQuery as e } from "../api/queries.js";
|
|
2
|
+
import { projectLevel as t, projectsUnder as n } from "../lib/projects.js";
|
|
3
|
+
import { ProjectIcon as r } from "./icons.js";
|
|
4
|
+
import { Combobox as i, buttonClasses as a } from "@parallelworks/ui";
|
|
5
|
+
import { useTranslations as o } from "use-intl";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import { useQuery as l } from "@tanstack/react-query";
|
|
8
|
+
// src/components/ParentProjectSelect.tsx
|
|
9
|
+
function u({ workspace: u, projectId: d, value: f, disabled: p, onChange: m }) {
|
|
10
|
+
let h = o("planning"), { data: g = [] } = l(e(u)), _ = new Set(d ? n(g, d).map((e) => e.id) : []), v = g.find((e) => e.id === f);
|
|
11
|
+
return /* @__PURE__ */ s(i, {
|
|
12
|
+
disabled: p,
|
|
13
|
+
items: [{
|
|
14
|
+
value: "",
|
|
15
|
+
label: h("noParentProject")
|
|
16
|
+
}, ...g.filter((e) => e.id !== d && !_.has(e.id) && !e.template && t(g, e.id) < 5).map((e) => ({
|
|
17
|
+
value: e.id,
|
|
18
|
+
label: e.name
|
|
19
|
+
}))],
|
|
20
|
+
value: f,
|
|
21
|
+
onValueChange: (e) => m(e ?? ""),
|
|
22
|
+
placeholder: h("parentProject"),
|
|
23
|
+
"aria-label": h("parentProject"),
|
|
24
|
+
trigger: /* @__PURE__ */ c("button", {
|
|
25
|
+
type: "button",
|
|
26
|
+
disabled: p,
|
|
27
|
+
className: a({ size: "sm" }),
|
|
28
|
+
children: [/* @__PURE__ */ s(r, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ s("span", {
|
|
29
|
+
className: v ? "" : "text-muted-foreground",
|
|
30
|
+
children: v ? h("underProject", { name: v.name }) : h("parentProject")
|
|
31
|
+
})]
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export { u as ParentProjectSelect };
|
|
@@ -2,34 +2,37 @@ import { api as e, unwrap as t } from "../api/client.js";
|
|
|
2
2
|
import { projectAccessQuery as n } from "../api/queries.js";
|
|
3
3
|
import { useCan as r } from "../lib/roles.js";
|
|
4
4
|
import { AccessGrants as i } from "./AccessGrants.js";
|
|
5
|
-
import { Button as a,
|
|
6
|
-
import { Suspense as
|
|
7
|
-
import { useTranslations as
|
|
8
|
-
import { jsx as
|
|
9
|
-
import { useQueryClient as
|
|
5
|
+
import { Button as a, Loader as o, Modal as s, ModalTitle as c } from "@parallelworks/ui";
|
|
6
|
+
import { Suspense as l } from "react";
|
|
7
|
+
import { useTranslations as u } from "use-intl";
|
|
8
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
|
+
import { useQueryClient as p, useSuspenseQuery as m } from "@tanstack/react-query";
|
|
10
10
|
// src/components/ProjectAccess.tsx
|
|
11
|
-
function
|
|
12
|
-
let r =
|
|
13
|
-
return /* @__PURE__ */
|
|
11
|
+
function h({ workspace: e, project: t, onClose: n }) {
|
|
12
|
+
let r = u("projectAccess"), i = u("common");
|
|
13
|
+
return /* @__PURE__ */ f(s, {
|
|
14
14
|
open: !0,
|
|
15
15
|
onClose: n,
|
|
16
16
|
className: "w-full max-w-2xl p-5",
|
|
17
17
|
children: [
|
|
18
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ d(c, {
|
|
19
19
|
className: "text-sm font-semibold",
|
|
20
20
|
children: r("title", { name: t.name })
|
|
21
21
|
}),
|
|
22
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ d("p", {
|
|
23
23
|
className: "mt-1 mb-4 text-sm text-muted-foreground",
|
|
24
24
|
children: r("description")
|
|
25
25
|
}),
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
/* @__PURE__ */ d(l, {
|
|
27
|
+
fallback: /* @__PURE__ */ d(o, { fill: "section" }),
|
|
28
|
+
children: /* @__PURE__ */ d(g, {
|
|
29
|
+
workspace: e,
|
|
30
|
+
project: t
|
|
31
|
+
})
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ d("div", {
|
|
31
34
|
className: "mt-5 flex justify-end",
|
|
32
|
-
children: /* @__PURE__ */
|
|
35
|
+
children: /* @__PURE__ */ d(a, {
|
|
33
36
|
type: "button",
|
|
34
37
|
onClick: n,
|
|
35
38
|
children: i("close")
|
|
@@ -38,9 +41,9 @@ function m({ workspace: e, project: t, onClose: n }) {
|
|
|
38
41
|
]
|
|
39
42
|
});
|
|
40
43
|
}
|
|
41
|
-
function
|
|
42
|
-
let s =
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
+
function g({ workspace: a, project: o }) {
|
|
45
|
+
let s = p(), { data: c } = m(n(a, o.id)), l = r(a, "manage_members", { project: o.id });
|
|
46
|
+
return /* @__PURE__ */ d(i, {
|
|
44
47
|
workspace: a,
|
|
45
48
|
resourceName: o.name,
|
|
46
49
|
access: c,
|
|
@@ -60,4 +63,4 @@ function h({ workspace: a, project: o }) {
|
|
|
60
63
|
}
|
|
61
64
|
});
|
|
62
65
|
}
|
|
63
|
-
export {
|
|
66
|
+
export { h as ProjectAccessDialog };
|