@parallelworks/tandem-web 0.171.1 → 0.171.3
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 +5 -2
- package/_virtual/_virtual_i18n/es/common.js +5 -2
- package/_virtual/_virtual_i18n/ja/common.js +5 -2
- package/_virtual/_virtual_i18n/ko/common.js +5 -2
- package/_virtual/_virtual_i18n/zh/common.js +5 -2
- package/components/AccessGrants.js +6 -6
- package/components/ActivityTimeline.js +60 -60
- package/components/ActorAvatar.js +4 -4
- package/components/ActorLink.js +34 -0
- 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 +73 -69
- package/components/BlockHandle.js +3 -3
- package/components/BugRotation.js +8 -8
- package/components/CodeHostSettings.js +121 -87
- 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 +201 -164
- 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 +97 -92
- package/components/IssueFilters.js +39 -39
- 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 +36 -34
- 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 +99 -97
- 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/assignees.js +3 -3
- 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/triageSeen.js +2 -2
- 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 +202 -212
- 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 +519 -522
- package/routes/_workspace/issues/index.js +13 -13
- package/routes/_workspace/knowledge/_term2.js +148 -146
- package/routes/_workspace/knowledge/_term3.js +4 -4
- package/routes/_workspace/knowledge/index.js +12 -12
- package/routes/_workspace/knowledge/index2.js +117 -115
- 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,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { usePeople as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { docPropertiesQuery as e, propertyKinds as t, spaceScope as n, useDocPropertyActions as r } from "../lib/docProperties.js";
|
|
2
|
+
import { usePeople as i } from "../lib/people.js";
|
|
3
|
+
import { useCan as a } from "../lib/roles.js";
|
|
4
|
+
import { AddIcon as o } from "./icons.js";
|
|
5
5
|
import { Button as s, Checkbox as c, ErrorText as l, IconButton as u, Input as d, Popover as f, Select as p, Textarea as m, menuDivider as h, useOpenMenu as g } from "@parallelworks/ui";
|
|
6
6
|
import { Link as _ } from "@tanstack/react-router";
|
|
7
7
|
import { useEffect as v, useState as y } from "react";
|
|
@@ -11,57 +11,57 @@ import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
|
11
11
|
import { useQuery as w } from "@tanstack/react-query";
|
|
12
12
|
// src/components/DocProperties.tsx
|
|
13
13
|
function T(e) {
|
|
14
|
-
let { nameOf:
|
|
15
|
-
return (e,
|
|
16
|
-
if (
|
|
14
|
+
let { nameOf: t } = i(e), n = x("docProperties");
|
|
15
|
+
return (e, r) => {
|
|
16
|
+
if (r == null) return "";
|
|
17
17
|
let i = (t) => e.options.find((e) => e.id === t)?.name ?? String(t);
|
|
18
18
|
switch (e.kind) {
|
|
19
|
-
case "select": return i(
|
|
20
|
-
case "multi_select": return Array.isArray(
|
|
21
|
-
case "person": return
|
|
22
|
-
case "checkbox": return
|
|
23
|
-
default: return String(
|
|
19
|
+
case "select": return i(r);
|
|
20
|
+
case "multi_select": return Array.isArray(r) ? r.map(i).join(", ") : "";
|
|
21
|
+
case "person": return t("user", String(r));
|
|
22
|
+
case "checkbox": return r === !0 ? n("yes") : "";
|
|
23
|
+
default: return String(r);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
function E({ workspace:
|
|
28
|
-
let c = x("docProperties"), u = b(), { data: d = [] } = w(
|
|
27
|
+
function E({ workspace: t, doc: i, space: o, editable: s }) {
|
|
28
|
+
let c = x("docProperties"), u = b(), { data: d = [] } = w(e(t, o)), f = a(t, "manage_labels", n(o)), p = r(t), m = i.properties ?? {};
|
|
29
29
|
if (d.length === 0 && !(s && f)) return null;
|
|
30
|
-
let h = (e,
|
|
31
|
-
doc:
|
|
32
|
-
values: { [e]:
|
|
30
|
+
let h = (e, t) => p.setValues.mutate({
|
|
31
|
+
doc: i.key,
|
|
32
|
+
values: { [e]: t }
|
|
33
33
|
});
|
|
34
34
|
return /* @__PURE__ */ C("section", {
|
|
35
35
|
"aria-label": c("title"),
|
|
36
36
|
className: "mt-3 space-y-0.5 text-sm",
|
|
37
37
|
children: [
|
|
38
|
-
d.map((
|
|
38
|
+
d.map((e) => /* @__PURE__ */ C("div", {
|
|
39
39
|
className: "flex min-h-8 items-center gap-2",
|
|
40
40
|
children: [/* @__PURE__ */ S(D, {
|
|
41
|
-
workspace:
|
|
42
|
-
property:
|
|
41
|
+
workspace: t,
|
|
42
|
+
property: e,
|
|
43
43
|
admin: s && f
|
|
44
44
|
}), /* @__PURE__ */ S("div", {
|
|
45
45
|
className: "min-w-0 flex-1",
|
|
46
46
|
children: /* @__PURE__ */ S(O, {
|
|
47
|
-
workspace:
|
|
48
|
-
property:
|
|
49
|
-
value: m[
|
|
47
|
+
workspace: t,
|
|
48
|
+
property: e,
|
|
49
|
+
value: m[e.id],
|
|
50
50
|
editable: s,
|
|
51
|
-
onChange: (
|
|
51
|
+
onChange: (t) => h(e.id, t)
|
|
52
52
|
})
|
|
53
53
|
})]
|
|
54
|
-
},
|
|
54
|
+
}, e.id)),
|
|
55
55
|
s && f && /* @__PURE__ */ S(A, {
|
|
56
|
-
workspace:
|
|
57
|
-
space:
|
|
56
|
+
workspace: t,
|
|
57
|
+
space: o
|
|
58
58
|
}),
|
|
59
59
|
p.setValues.error && /* @__PURE__ */ S(l, { children: u(p.setValues.error) })
|
|
60
60
|
]
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
function D({ workspace: e, property: t, admin: n }) {
|
|
64
|
-
let
|
|
64
|
+
let i = x("docProperties"), a = g(), o = r(e), [s, c] = y(!1), l = /* @__PURE__ */ S("span", {
|
|
65
65
|
className: "truncate",
|
|
66
66
|
children: t.name
|
|
67
67
|
});
|
|
@@ -71,12 +71,12 @@ function D({ workspace: e, property: t, admin: n }) {
|
|
|
71
71
|
});
|
|
72
72
|
let u = () => [
|
|
73
73
|
{
|
|
74
|
-
label:
|
|
74
|
+
label: i("edit"),
|
|
75
75
|
onClick: () => c(!0)
|
|
76
76
|
},
|
|
77
77
|
h,
|
|
78
78
|
{
|
|
79
|
-
label:
|
|
79
|
+
label: i("remove"),
|
|
80
80
|
destructive: !0,
|
|
81
81
|
onClick: () => o.remove.mutate(t.id)
|
|
82
82
|
}
|
|
@@ -86,14 +86,14 @@ function D({ workspace: e, property: t, admin: n }) {
|
|
|
86
86
|
onOpenChange: c,
|
|
87
87
|
trigger: /* @__PURE__ */ S("button", {
|
|
88
88
|
type: "button",
|
|
89
|
-
onContextMenu: (e) =>
|
|
89
|
+
onContextMenu: (e) => a(e, u()),
|
|
90
90
|
className: "flex h-7 w-36 shrink-0 items-center rounded-md px-1.5 text-left text-muted-foreground hover:bg-muted",
|
|
91
91
|
children: l
|
|
92
92
|
}),
|
|
93
93
|
align: "start",
|
|
94
94
|
className: "w-72",
|
|
95
95
|
initialFocus: "first-control",
|
|
96
|
-
"aria-label":
|
|
96
|
+
"aria-label": i("edit"),
|
|
97
97
|
children: /* @__PURE__ */ S(j, {
|
|
98
98
|
workspace: e,
|
|
99
99
|
property: t,
|
|
@@ -104,59 +104,59 @@ function D({ workspace: e, property: t, admin: n }) {
|
|
|
104
104
|
})
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
function O({ workspace: e, property:
|
|
108
|
-
let o = x("docProperties"), { members: s } =
|
|
109
|
-
if (!
|
|
110
|
-
let
|
|
111
|
-
return
|
|
107
|
+
function O({ workspace: e, property: t, value: n, editable: r, onChange: a }) {
|
|
108
|
+
let o = x("docProperties"), { members: s } = i(e), l = T(e), u = o("empty");
|
|
109
|
+
if (!r) {
|
|
110
|
+
let r = l(t, n);
|
|
111
|
+
return t.kind === "issue" && r ? /* @__PURE__ */ S(_, {
|
|
112
112
|
to: "/$workspace/issues/$identifier",
|
|
113
113
|
params: {
|
|
114
114
|
workspace: e,
|
|
115
|
-
identifier:
|
|
115
|
+
identifier: r
|
|
116
116
|
},
|
|
117
117
|
className: "text-primary hover:underline",
|
|
118
|
-
children:
|
|
119
|
-
}) :
|
|
120
|
-
href:
|
|
118
|
+
children: r
|
|
119
|
+
}) : t.kind === "url" && r ? /* @__PURE__ */ S("a", {
|
|
120
|
+
href: r,
|
|
121
121
|
target: "_blank",
|
|
122
122
|
rel: "noopener noreferrer",
|
|
123
123
|
className: "truncate text-primary hover:underline",
|
|
124
|
-
children:
|
|
124
|
+
children: r
|
|
125
125
|
}) : /* @__PURE__ */ S("span", {
|
|
126
|
-
className:
|
|
127
|
-
children:
|
|
126
|
+
className: r ? "" : "text-muted-foreground",
|
|
127
|
+
children: r || u
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
switch (
|
|
130
|
+
switch (t.kind) {
|
|
131
131
|
case "select": return /* @__PURE__ */ S(p, {
|
|
132
|
-
value: typeof
|
|
132
|
+
value: typeof n == "string" ? n : "",
|
|
133
133
|
items: [{
|
|
134
134
|
value: "",
|
|
135
135
|
label: u
|
|
136
|
-
}, ...
|
|
136
|
+
}, ...t.options.map((e) => ({
|
|
137
137
|
value: e.id ?? "",
|
|
138
138
|
label: e.name
|
|
139
139
|
}))],
|
|
140
140
|
onValueChange: (e) => a(e || null),
|
|
141
|
-
"aria-label":
|
|
141
|
+
"aria-label": t.name,
|
|
142
142
|
size: "sm",
|
|
143
143
|
width: "content"
|
|
144
144
|
});
|
|
145
145
|
case "multi_select": return /* @__PURE__ */ S(p, {
|
|
146
146
|
multiple: !0,
|
|
147
|
-
value: Array.isArray(
|
|
148
|
-
items:
|
|
147
|
+
value: Array.isArray(n) ? n : [],
|
|
148
|
+
items: t.options.map((e) => ({
|
|
149
149
|
value: e.id ?? "",
|
|
150
150
|
label: e.name
|
|
151
151
|
})),
|
|
152
152
|
onValueChange: (e) => a(e),
|
|
153
153
|
placeholder: u,
|
|
154
|
-
"aria-label":
|
|
154
|
+
"aria-label": t.name,
|
|
155
155
|
size: "sm",
|
|
156
156
|
width: "content"
|
|
157
157
|
});
|
|
158
158
|
case "person": return /* @__PURE__ */ S(p, {
|
|
159
|
-
value: typeof
|
|
159
|
+
value: typeof n == "string" ? n : "",
|
|
160
160
|
items: [{
|
|
161
161
|
value: "",
|
|
162
162
|
label: u
|
|
@@ -165,25 +165,25 @@ function O({ workspace: e, property: n, value: r, editable: i, onChange: a }) {
|
|
|
165
165
|
label: e.user.name
|
|
166
166
|
}))],
|
|
167
167
|
onValueChange: (e) => a(e || null),
|
|
168
|
-
"aria-label":
|
|
168
|
+
"aria-label": t.name,
|
|
169
169
|
size: "sm",
|
|
170
170
|
width: "content"
|
|
171
171
|
});
|
|
172
172
|
case "checkbox": return /* @__PURE__ */ S(c, {
|
|
173
|
-
checked:
|
|
173
|
+
checked: n === !0,
|
|
174
174
|
onCheckedChange: (e) => a(e === !0),
|
|
175
|
-
"aria-label":
|
|
175
|
+
"aria-label": t.name
|
|
176
176
|
});
|
|
177
177
|
case "date": return /* @__PURE__ */ S(d, {
|
|
178
178
|
type: "date",
|
|
179
|
-
value: typeof
|
|
179
|
+
value: typeof n == "string" ? n : "",
|
|
180
180
|
onChange: (e) => a(e.target.value || null),
|
|
181
|
-
"aria-label":
|
|
181
|
+
"aria-label": t.name,
|
|
182
182
|
className: "h-7 px-1.5 w-40"
|
|
183
183
|
});
|
|
184
184
|
default: return /* @__PURE__ */ S(k, {
|
|
185
|
-
property:
|
|
186
|
-
value:
|
|
185
|
+
property: t,
|
|
186
|
+
value: n,
|
|
187
187
|
onChange: a
|
|
188
188
|
});
|
|
189
189
|
}
|
|
@@ -205,49 +205,49 @@ function k({ property: e, value: t, onChange: n }) {
|
|
|
205
205
|
className: "h-7 border-transparent px-1.5 shadow-none hover:border-border"
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
function A({ workspace:
|
|
209
|
-
let
|
|
208
|
+
function A({ workspace: e, space: t }) {
|
|
209
|
+
let n = x("docProperties"), [r, i] = y(!1);
|
|
210
210
|
return /* @__PURE__ */ S(f, {
|
|
211
|
-
open:
|
|
212
|
-
onOpenChange:
|
|
211
|
+
open: r,
|
|
212
|
+
onOpenChange: i,
|
|
213
213
|
trigger: /* @__PURE__ */ S(s, {
|
|
214
214
|
size: "xs",
|
|
215
215
|
variant: "ghost",
|
|
216
|
-
icon: /* @__PURE__ */ S(
|
|
216
|
+
icon: /* @__PURE__ */ S(o, {}),
|
|
217
217
|
className: "mt-1 text-muted-foreground",
|
|
218
|
-
children:
|
|
218
|
+
children: n("add")
|
|
219
219
|
}),
|
|
220
220
|
align: "start",
|
|
221
221
|
className: "w-72",
|
|
222
222
|
initialFocus: "first-control",
|
|
223
|
-
"aria-label":
|
|
223
|
+
"aria-label": n("add"),
|
|
224
224
|
children: /* @__PURE__ */ S(j, {
|
|
225
|
-
workspace:
|
|
226
|
-
space:
|
|
227
|
-
onDone: () =>
|
|
225
|
+
workspace: e,
|
|
226
|
+
space: t,
|
|
227
|
+
onDone: () => i(!1)
|
|
228
228
|
})
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
|
-
function j({ workspace: e, space:
|
|
232
|
-
let c = x("docProperties"), f = b(), h =
|
|
233
|
-
let t =
|
|
231
|
+
function j({ workspace: e, space: n, property: i, onDone: a, onRemove: o }) {
|
|
232
|
+
let c = x("docProperties"), f = b(), h = r(e), [g, _] = y(i?.name ?? ""), [v, w] = y(i?.kind ?? "text"), [T, E] = y((i?.options ?? []).map((e) => e.name).join("\n")), D = v === "select" || v === "multi_select", O = () => T.split("\n").map((e) => e.trim()).filter(Boolean).map((e) => {
|
|
233
|
+
let t = i?.options.find((t) => t.name === e)?.id;
|
|
234
234
|
return {
|
|
235
235
|
name: e,
|
|
236
236
|
...t && { id: t }
|
|
237
237
|
};
|
|
238
|
-
}), k =
|
|
238
|
+
}), k = i ? h.update : h.create;
|
|
239
239
|
return /* @__PURE__ */ C("form", {
|
|
240
240
|
onSubmit: (e) => {
|
|
241
|
-
e.preventDefault(),
|
|
242
|
-
id:
|
|
241
|
+
e.preventDefault(), i ? h.update.mutate({
|
|
242
|
+
id: i.id,
|
|
243
243
|
name: g,
|
|
244
244
|
...D && { options: O() }
|
|
245
|
-
}, { onSuccess:
|
|
246
|
-
...
|
|
245
|
+
}, { onSuccess: a }) : h.create.mutate({
|
|
246
|
+
...n && { space: n },
|
|
247
247
|
name: g,
|
|
248
248
|
kind: v,
|
|
249
249
|
...D && { options: O() }
|
|
250
|
-
}, { onSuccess:
|
|
250
|
+
}, { onSuccess: a });
|
|
251
251
|
},
|
|
252
252
|
className: "space-y-3 text-sm",
|
|
253
253
|
children: [
|
|
@@ -261,13 +261,13 @@ function j({ workspace: e, space: t, property: n, onDone: i, onRemove: o }) {
|
|
|
261
261
|
className: "mt-1"
|
|
262
262
|
})]
|
|
263
263
|
}),
|
|
264
|
-
!
|
|
264
|
+
!i && /* @__PURE__ */ C("div", {
|
|
265
265
|
className: "text-xs font-medium text-muted-foreground",
|
|
266
266
|
children: [c("kind"), /* @__PURE__ */ S("div", {
|
|
267
267
|
className: "mt-1",
|
|
268
268
|
children: /* @__PURE__ */ S(p, {
|
|
269
269
|
value: v,
|
|
270
|
-
items:
|
|
270
|
+
items: t.map((e) => ({
|
|
271
271
|
value: e,
|
|
272
272
|
label: c(`kinds.${e}`)
|
|
273
273
|
})),
|
|
@@ -311,7 +311,7 @@ function j({ workspace: e, space: t, property: n, onDone: i, onRemove: o }) {
|
|
|
311
311
|
variant: "primary",
|
|
312
312
|
loading: k.isPending,
|
|
313
313
|
disabled: !g.trim(),
|
|
314
|
-
children: c(
|
|
314
|
+
children: c(i ? "save" : "add")
|
|
315
315
|
})]
|
|
316
316
|
})
|
|
317
317
|
]
|
package/components/DocTable.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { docsQuery as e } from "../api/queries.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { docPropertiesQuery as t, spaceScope as n, useDocPropertyActions as r } from "../lib/docProperties.js";
|
|
3
|
+
import { docRef as i } from "../lib/docs.js";
|
|
4
|
+
import { usePeople as a } from "../lib/people.js";
|
|
5
|
+
import { useCan as o } from "../lib/roles.js";
|
|
6
|
+
import { DocIcon as s } from "./DocIcon.js";
|
|
7
7
|
import { usePropertyText as c } from "./DocProperties.js";
|
|
8
8
|
import { cx as l } from "@parallelworks/ui";
|
|
9
9
|
import { Link as u } from "@tanstack/react-router";
|
|
@@ -13,14 +13,14 @@ import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
|
13
13
|
import { keepPreviousData as g, useQuery as _ } from "@tanstack/react-query";
|
|
14
14
|
// src/components/DocTable.tsx
|
|
15
15
|
var v = (e) => e.kind === "select" || e.kind === "person";
|
|
16
|
-
function y(
|
|
17
|
-
let a = Object.entries(
|
|
18
|
-
...e(
|
|
19
|
-
...
|
|
16
|
+
function y(n, r, i) {
|
|
17
|
+
let a = Object.entries(i.filters ?? {}).map(([e, t]) => `${e}=${t}`), { data: o = [], isPending: s } = _({
|
|
18
|
+
...e(n, {
|
|
19
|
+
...r === "workspace" ? { workspace: !0 } : { team: r },
|
|
20
20
|
...a.length > 0 && { property: a }
|
|
21
21
|
}),
|
|
22
22
|
placeholderData: g
|
|
23
|
-
}), { data: l = [] } = _(
|
|
23
|
+
}), { data: l = [] } = _(t(n, r)), u = c(n), d = i.sort ?? "title", f = l.find((e) => e.id === d), p = (e) => {
|
|
24
24
|
if (d === "updated") return e.updatedAt;
|
|
25
25
|
if (!f) return e.title.toLowerCase();
|
|
26
26
|
let t = e.properties?.[f.id];
|
|
@@ -28,36 +28,36 @@ function y(t, n, r) {
|
|
|
28
28
|
};
|
|
29
29
|
return {
|
|
30
30
|
docs: o.filter((e) => !e.template).sort((e, t) => {
|
|
31
|
-
let n = p(e),
|
|
32
|
-
return
|
|
31
|
+
let n = p(e), r = p(t), a = n < r ? -1 : +(n > r);
|
|
32
|
+
return i.desc ? -a : a;
|
|
33
33
|
}),
|
|
34
34
|
props: l,
|
|
35
35
|
isPending: s
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
function b({ workspace: e, space:
|
|
39
|
-
let
|
|
38
|
+
function b({ workspace: e, space: t, layout: n, config: r }) {
|
|
39
|
+
let a = p("docViews"), o = f(), { docs: l, props: d, isPending: g } = y(e, t, r), _ = c(e), b = (e, t) => e.properties?.[t.id];
|
|
40
40
|
if (g) return /* @__PURE__ */ m("p", {
|
|
41
41
|
className: "p-4 text-sm text-muted-foreground",
|
|
42
|
-
children:
|
|
42
|
+
children: a("loading")
|
|
43
43
|
});
|
|
44
|
-
if (
|
|
45
|
-
let
|
|
46
|
-
return
|
|
44
|
+
if (n === "board") {
|
|
45
|
+
let n = d.find((e) => e.id === r.groupBy && v(e));
|
|
46
|
+
return n ? /* @__PURE__ */ m(x, {
|
|
47
47
|
workspace: e,
|
|
48
|
-
space:
|
|
48
|
+
space: t,
|
|
49
49
|
docs: l,
|
|
50
50
|
props: d,
|
|
51
|
-
by:
|
|
51
|
+
by: n
|
|
52
52
|
}) : /* @__PURE__ */ m("p", {
|
|
53
53
|
className: "p-4 text-sm text-muted-foreground",
|
|
54
|
-
children:
|
|
54
|
+
children: a("pickGroup")
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
let S =
|
|
57
|
+
let S = r.columns ? r.columns.flatMap((e) => d.filter((t) => t.id === e)) : d;
|
|
58
58
|
return l.length === 0 ? /* @__PURE__ */ m("p", {
|
|
59
59
|
className: "p-4 text-sm text-muted-foreground",
|
|
60
|
-
children:
|
|
60
|
+
children: a("none")
|
|
61
61
|
}) : /* @__PURE__ */ m("div", {
|
|
62
62
|
className: "overflow-x-auto",
|
|
63
63
|
children: /* @__PURE__ */ h("table", {
|
|
@@ -65,7 +65,7 @@ function b({ workspace: e, space: n, layout: i, config: a }) {
|
|
|
65
65
|
children: [/* @__PURE__ */ m("thead", { children: /* @__PURE__ */ h("tr", { children: [
|
|
66
66
|
/* @__PURE__ */ m("th", {
|
|
67
67
|
scope: "col",
|
|
68
|
-
children:
|
|
68
|
+
children: a("docTitle")
|
|
69
69
|
}),
|
|
70
70
|
S.map((e) => /* @__PURE__ */ m("th", {
|
|
71
71
|
scope: "col",
|
|
@@ -73,32 +73,32 @@ function b({ workspace: e, space: n, layout: i, config: a }) {
|
|
|
73
73
|
}, e.id)),
|
|
74
74
|
/* @__PURE__ */ m("th", {
|
|
75
75
|
scope: "col",
|
|
76
|
-
children:
|
|
76
|
+
children: a("updated")
|
|
77
77
|
})
|
|
78
|
-
] }) }), /* @__PURE__ */ m("tbody", { children: l.map((
|
|
78
|
+
] }) }), /* @__PURE__ */ m("tbody", { children: l.map((t) => /* @__PURE__ */ h("tr", { children: [
|
|
79
79
|
/* @__PURE__ */ m("td", { children: /* @__PURE__ */ h(u, {
|
|
80
80
|
to: "/$workspace/docs/$doc",
|
|
81
81
|
params: {
|
|
82
82
|
workspace: e,
|
|
83
|
-
doc: t
|
|
83
|
+
doc: i(t)
|
|
84
84
|
},
|
|
85
85
|
className: "flex items-center gap-2 font-medium hover:underline",
|
|
86
|
-
children: [/* @__PURE__ */ m(
|
|
86
|
+
children: [/* @__PURE__ */ m(s, { icon: t.icon }), /* @__PURE__ */ m("span", {
|
|
87
87
|
className: "truncate",
|
|
88
|
-
children:
|
|
88
|
+
children: t.title
|
|
89
89
|
})]
|
|
90
90
|
}) }),
|
|
91
|
-
S.map((e) => /* @__PURE__ */ m("td", { children: _(e, b(
|
|
91
|
+
S.map((e) => /* @__PURE__ */ m("td", { children: _(e, b(t, e)) }, e.id)),
|
|
92
92
|
/* @__PURE__ */ m("td", {
|
|
93
93
|
className: "text-muted-foreground",
|
|
94
|
-
children:
|
|
94
|
+
children: o.dateTime(new Date(t.updatedAt), { dateStyle: "medium" })
|
|
95
95
|
})
|
|
96
|
-
] },
|
|
96
|
+
] }, t.id)) })]
|
|
97
97
|
})
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
|
-
function x({ workspace: e, space:
|
|
101
|
-
let v = p("docViews"), { members: y } =
|
|
100
|
+
function x({ workspace: e, space: t, docs: f, props: g, by: _ }) {
|
|
101
|
+
let v = p("docViews"), { members: y } = a(e), b = c(e), x = o(e, "edit_docs", n(t)), S = r(e), [C, w] = d(null), [T, E] = d(null), D = [..._.kind === "select" ? _.options.map((e) => ({
|
|
102
102
|
key: e.id ?? "",
|
|
103
103
|
label: e.name
|
|
104
104
|
})) : y.map((e) => ({
|
|
@@ -114,62 +114,62 @@ function x({ workspace: e, space: i, docs: f, props: g, by: _ }) {
|
|
|
114
114
|
return /* @__PURE__ */ m("ul", {
|
|
115
115
|
className: "flex gap-3 overflow-x-auto p-3",
|
|
116
116
|
"aria-label": v("board"),
|
|
117
|
-
children: k.map((
|
|
118
|
-
let
|
|
117
|
+
children: k.map((t) => {
|
|
118
|
+
let n = f.filter((e) => O(e) === t.key);
|
|
119
119
|
return /* @__PURE__ */ h("li", {
|
|
120
|
-
"aria-label":
|
|
120
|
+
"aria-label": t.label,
|
|
121
121
|
onDragOver: (e) => {
|
|
122
|
-
C && (e.preventDefault(), E(
|
|
122
|
+
C && (e.preventDefault(), E(t.key));
|
|
123
123
|
},
|
|
124
|
-
onDragLeave: () => E((e) => e ===
|
|
124
|
+
onDragLeave: () => E((e) => e === t.key ? null : e),
|
|
125
125
|
onDrop: (e) => {
|
|
126
126
|
e.preventDefault(), C && S.setValues.mutate({
|
|
127
127
|
doc: C,
|
|
128
|
-
values: { [_.id]:
|
|
128
|
+
values: { [_.id]: t.key || null }
|
|
129
129
|
}), w(null), E(null);
|
|
130
130
|
},
|
|
131
|
-
className: l("flex w-64 shrink-0 flex-col rounded-lg border bg-muted/30", T ===
|
|
131
|
+
className: l("flex w-64 shrink-0 flex-col rounded-lg border bg-muted/30", T === t.key ? "border-primary" : "border-border"),
|
|
132
132
|
children: [/* @__PURE__ */ h("p", {
|
|
133
133
|
className: "flex items-center gap-2 px-3 py-2 text-xs font-medium",
|
|
134
134
|
children: [/* @__PURE__ */ m("span", {
|
|
135
135
|
className: "truncate",
|
|
136
|
-
children:
|
|
136
|
+
children: t.label
|
|
137
137
|
}), /* @__PURE__ */ m("span", {
|
|
138
138
|
className: "text-muted-foreground tabular-nums",
|
|
139
|
-
children:
|
|
139
|
+
children: n.length
|
|
140
140
|
})]
|
|
141
141
|
}), /* @__PURE__ */ m("ul", {
|
|
142
142
|
className: "flex flex-col gap-2 px-2 pb-2",
|
|
143
|
-
children:
|
|
143
|
+
children: n.map((t) => /* @__PURE__ */ h("li", {
|
|
144
144
|
draggable: x,
|
|
145
|
-
onDragStart: () => w(
|
|
145
|
+
onDragStart: () => w(t.key),
|
|
146
146
|
onDragEnd: () => w(null),
|
|
147
147
|
className: "rounded-md border border-border bg-card p-2.5 text-sm shadow-xs",
|
|
148
148
|
children: [/* @__PURE__ */ h(u, {
|
|
149
149
|
to: "/$workspace/docs/$doc",
|
|
150
150
|
params: {
|
|
151
151
|
workspace: e,
|
|
152
|
-
doc: t
|
|
152
|
+
doc: i(t)
|
|
153
153
|
},
|
|
154
154
|
className: "flex items-center gap-2 font-medium hover:underline",
|
|
155
|
-
children: [/* @__PURE__ */ m(
|
|
155
|
+
children: [/* @__PURE__ */ m(s, { icon: t.icon }), /* @__PURE__ */ m("span", {
|
|
156
156
|
className: "truncate",
|
|
157
|
-
children:
|
|
157
|
+
children: t.title
|
|
158
158
|
})]
|
|
159
159
|
}), A.map((e) => {
|
|
160
|
-
let
|
|
161
|
-
return
|
|
160
|
+
let n = b(e, t.properties?.[e.id]);
|
|
161
|
+
return n ? /* @__PURE__ */ h("p", {
|
|
162
162
|
className: "mt-1 truncate text-xs text-muted-foreground",
|
|
163
163
|
children: [
|
|
164
164
|
e.name,
|
|
165
165
|
": ",
|
|
166
|
-
|
|
166
|
+
n
|
|
167
167
|
]
|
|
168
168
|
}, e.id) : null;
|
|
169
169
|
})]
|
|
170
|
-
},
|
|
170
|
+
}, t.id))
|
|
171
171
|
})]
|
|
172
|
-
},
|
|
172
|
+
}, t.key || "none");
|
|
173
173
|
})
|
|
174
174
|
});
|
|
175
175
|
}
|