@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
package/lib/docs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
|
+
import { docTemplatesQuery as n, docsQuery as r, meQuery as i, teamsQuery as a } from "../api/queries.js";
|
|
3
|
+
import { appURL as o, basePath as s } from "./base.js";
|
|
4
|
+
import { useFavorites as c } from "./favorites.js";
|
|
5
|
+
import { copyItem as l, useLinkItems as u } from "./menus.js";
|
|
6
|
+
import { useNavigate as d } from "./router.js";
|
|
7
7
|
import { openShare as f } from "./share.js";
|
|
8
8
|
import { menuDivider as p } from "@parallelworks/ui";
|
|
9
9
|
import { useCallback as m } from "react";
|
|
@@ -18,7 +18,7 @@ function x(e) {
|
|
|
18
18
|
return /^[a-z2-7]{10}$/.test(t) ? t : e.toLowerCase();
|
|
19
19
|
}
|
|
20
20
|
function S() {
|
|
21
|
-
let e = h(), { data: t } = v(
|
|
21
|
+
let e = h(), { data: t } = v(i);
|
|
22
22
|
return m(() => {
|
|
23
23
|
let n = /* @__PURE__ */ new Date();
|
|
24
24
|
return {
|
|
@@ -31,77 +31,77 @@ function S() {
|
|
|
31
31
|
function C(e, t) {
|
|
32
32
|
return `/${e}/docs/${b(t)}`;
|
|
33
33
|
}
|
|
34
|
-
function w(
|
|
35
|
-
let
|
|
34
|
+
function w(r) {
|
|
35
|
+
let i = y(), o = d(), s = g("docs"), c = () => i.invalidateQueries({ queryKey: [
|
|
36
36
|
"workspace",
|
|
37
|
-
|
|
37
|
+
r,
|
|
38
38
|
"docs"
|
|
39
|
-
] }),
|
|
40
|
-
workspace:
|
|
41
|
-
doc:
|
|
42
|
-
} }),
|
|
43
|
-
mutationFn: async ({ team:
|
|
44
|
-
let o = a ?? await C(
|
|
45
|
-
return
|
|
46
|
-
params: { path: { workspace:
|
|
39
|
+
] }), l = (e) => ({ path: {
|
|
40
|
+
workspace: r,
|
|
41
|
+
doc: e
|
|
42
|
+
} }), u = S(), f = _({
|
|
43
|
+
mutationFn: async ({ team: n, parent: i, template: a }) => {
|
|
44
|
+
let o = a ?? await C(n, i);
|
|
45
|
+
return t(await e.POST("/api/v1/workspaces/{workspace}/docs", {
|
|
46
|
+
params: { path: { workspace: r } },
|
|
47
47
|
body: {
|
|
48
48
|
...o ? {
|
|
49
49
|
template: o,
|
|
50
|
-
variables:
|
|
50
|
+
variables: u()
|
|
51
51
|
} : { title: s("untitled") },
|
|
52
|
-
...
|
|
52
|
+
...n && { team: n },
|
|
53
53
|
...i && { parent: i.key }
|
|
54
54
|
}
|
|
55
55
|
}));
|
|
56
56
|
},
|
|
57
|
-
onSuccess: (
|
|
58
|
-
|
|
57
|
+
onSuccess: (e) => {
|
|
58
|
+
c(), o({
|
|
59
59
|
to: "/$workspace/docs/$doc",
|
|
60
60
|
params: {
|
|
61
|
-
workspace:
|
|
62
|
-
doc: b(
|
|
61
|
+
workspace: r,
|
|
62
|
+
doc: b(e)
|
|
63
63
|
},
|
|
64
64
|
search: { rename: !0 }
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
}), p = _({
|
|
68
|
-
mutationFn: async ({ doc:
|
|
69
|
-
params:
|
|
70
|
-
body: { title:
|
|
68
|
+
mutationFn: async ({ doc: n, title: r }) => t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
69
|
+
params: l(n.key),
|
|
70
|
+
body: { title: r }
|
|
71
71
|
})),
|
|
72
|
-
onSettled:
|
|
72
|
+
onSettled: c
|
|
73
73
|
}), m = _({
|
|
74
|
-
mutationFn: async ({ doc:
|
|
75
|
-
params:
|
|
76
|
-
body: { area:
|
|
74
|
+
mutationFn: async ({ doc: n, area: r }) => t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
75
|
+
params: l(n.key),
|
|
76
|
+
body: { area: r }
|
|
77
77
|
})),
|
|
78
|
-
onSettled:
|
|
78
|
+
onSettled: c
|
|
79
79
|
}), h = _({
|
|
80
|
-
mutationFn: async ({ doc:
|
|
81
|
-
params:
|
|
80
|
+
mutationFn: async ({ doc: n, space: r, parent: i, after: a, before: o }) => t(await e.POST("/api/v1/workspaces/{workspace}/docs/{doc}/move", {
|
|
81
|
+
params: l(n.key),
|
|
82
82
|
body: {
|
|
83
|
-
...
|
|
83
|
+
...r && { space: r },
|
|
84
84
|
...i && { parent: i.key },
|
|
85
85
|
...a && { after: a.key },
|
|
86
86
|
...o && { before: o.key }
|
|
87
87
|
}
|
|
88
88
|
})),
|
|
89
|
-
onSettled:
|
|
89
|
+
onSettled: c
|
|
90
90
|
}), v = _({
|
|
91
|
-
mutationFn: async (
|
|
92
|
-
onSettled:
|
|
91
|
+
mutationFn: async (n) => t(await e.POST("/api/v1/workspaces/{workspace}/docs/{doc}/archive", { params: l(n.key) })),
|
|
92
|
+
onSettled: c
|
|
93
93
|
}), x = _({
|
|
94
|
-
mutationFn: async (
|
|
95
|
-
onSettled:
|
|
96
|
-
}), C = async (
|
|
97
|
-
let [
|
|
98
|
-
return
|
|
94
|
+
mutationFn: async (n) => t(await e.POST("/api/v1/workspaces/{workspace}/docs/{doc}/restore", { params: l(n.key) })),
|
|
95
|
+
onSettled: c
|
|
96
|
+
}), C = async (e, t) => {
|
|
97
|
+
let [o, s] = await Promise.all([i.fetchQuery(n(r)), i.fetchQuery(a(r))]), c = t ? t.teamId ?? "" : s.find((t) => t.key === e)?.id ?? "";
|
|
98
|
+
return o.find((e) => e.spaceDefault && (e.teamId ?? "") === c)?.id;
|
|
99
99
|
}, w = _({
|
|
100
|
-
mutationFn: async ({ doc:
|
|
101
|
-
params:
|
|
102
|
-
body: { spaceDefault:
|
|
100
|
+
mutationFn: async ({ doc: n, spaceDefault: r }) => t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
101
|
+
params: l(n.key),
|
|
102
|
+
body: { spaceDefault: r }
|
|
103
103
|
})),
|
|
104
|
-
onSettled:
|
|
104
|
+
onSettled: c
|
|
105
105
|
});
|
|
106
106
|
return {
|
|
107
107
|
create: f,
|
|
@@ -111,34 +111,34 @@ function w(e) {
|
|
|
111
111
|
archive: v,
|
|
112
112
|
restore: x,
|
|
113
113
|
setTemplate: _({
|
|
114
|
-
mutationFn: async ({ doc:
|
|
115
|
-
params:
|
|
116
|
-
body: { template:
|
|
114
|
+
mutationFn: async ({ doc: n, template: r }) => t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
115
|
+
params: l(n.key),
|
|
116
|
+
body: { template: r }
|
|
117
117
|
})),
|
|
118
|
-
onSettled:
|
|
118
|
+
onSettled: c
|
|
119
119
|
}),
|
|
120
120
|
setSpaceDefault: w,
|
|
121
121
|
setLook: _({
|
|
122
|
-
mutationFn: async ({ doc:
|
|
123
|
-
params:
|
|
124
|
-
body:
|
|
122
|
+
mutationFn: async ({ doc: n, ...r }) => t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
123
|
+
params: l(n.key),
|
|
124
|
+
body: r
|
|
125
125
|
})),
|
|
126
|
-
onMutate: ({ doc:
|
|
127
|
-
|
|
126
|
+
onMutate: ({ doc: e, ...t }) => {
|
|
127
|
+
i.setQueriesData({ queryKey: [
|
|
128
128
|
"workspace",
|
|
129
|
-
|
|
129
|
+
r,
|
|
130
130
|
"docs"
|
|
131
|
-
] }, (
|
|
132
|
-
...
|
|
133
|
-
...
|
|
134
|
-
} :
|
|
131
|
+
] }, (n) => n && typeof n == "object" && "id" in n && n.id === e.id ? {
|
|
132
|
+
...n,
|
|
133
|
+
...t
|
|
134
|
+
} : n);
|
|
135
135
|
},
|
|
136
|
-
onSettled:
|
|
136
|
+
onSettled: c
|
|
137
137
|
}),
|
|
138
138
|
duplicate: _({
|
|
139
|
-
mutationFn: async ({ doc:
|
|
140
|
-
let a =
|
|
141
|
-
params: { path: { workspace:
|
|
139
|
+
mutationFn: async ({ doc: n, team: i }) => {
|
|
140
|
+
let a = t(await e.GET("/api/v1/workspaces/{workspace}/docs/{doc}", { params: l(n.key) })), o = a.ancestors?.at(-1)?.key, c = t(await e.POST("/api/v1/workspaces/{workspace}/docs", {
|
|
141
|
+
params: { path: { workspace: r } },
|
|
142
142
|
body: {
|
|
143
143
|
title: s("copyOf", { title: a.title }),
|
|
144
144
|
body: a.body ?? "",
|
|
@@ -146,17 +146,17 @@ function w(e) {
|
|
|
146
146
|
...o && { parent: o }
|
|
147
147
|
}
|
|
148
148
|
}));
|
|
149
|
-
return a.icon ?
|
|
150
|
-
params:
|
|
149
|
+
return a.icon ? t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
150
|
+
params: l(c.key),
|
|
151
151
|
body: { icon: a.icon }
|
|
152
152
|
})) : c;
|
|
153
153
|
},
|
|
154
|
-
onSuccess: (
|
|
155
|
-
|
|
154
|
+
onSuccess: (e) => {
|
|
155
|
+
c(), o({
|
|
156
156
|
to: "/$workspace/docs/$doc",
|
|
157
157
|
params: {
|
|
158
|
-
workspace:
|
|
159
|
-
doc: b(
|
|
158
|
+
workspace: r,
|
|
159
|
+
doc: b(e)
|
|
160
160
|
},
|
|
161
161
|
search: { rename: !0 }
|
|
162
162
|
});
|
|
@@ -165,28 +165,28 @@ function w(e) {
|
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
167
|
function T(e) {
|
|
168
|
-
let t =
|
|
169
|
-
return m((
|
|
170
|
-
let c = y.find((e) => e.id ===
|
|
171
|
-
label:
|
|
168
|
+
let t = d(), n = g("docs"), i = g("common"), o = g("favorites"), s = u(), h = c(e), _ = w(e), { data: y = [] } = v(a(e)), { data: x = [] } = v(r(e, { top: !0 }));
|
|
169
|
+
return m((r, { onRename: a } = {}) => {
|
|
170
|
+
let c = y.find((e) => e.id === r.teamId), u = c?.key ?? "workspace", d = {
|
|
171
|
+
label: i("open"),
|
|
172
172
|
onClick: () => t({
|
|
173
173
|
to: "/$workspace/docs/$doc",
|
|
174
174
|
params: {
|
|
175
175
|
workspace: e,
|
|
176
|
-
doc: b(
|
|
176
|
+
doc: b(r)
|
|
177
177
|
}
|
|
178
178
|
})
|
|
179
|
-
}, m = [...s(C(e,
|
|
180
|
-
if (
|
|
179
|
+
}, m = [...s(C(e, r)), l(n("copyKey"), r.key)];
|
|
180
|
+
if (r.archivedAt) return [
|
|
181
181
|
d,
|
|
182
182
|
{
|
|
183
183
|
label: n("restore"),
|
|
184
|
-
onClick: () => _.restore.mutate(
|
|
184
|
+
onClick: () => _.restore.mutate(r)
|
|
185
185
|
},
|
|
186
186
|
p,
|
|
187
187
|
...m
|
|
188
188
|
];
|
|
189
|
-
let g = x.filter((e) => e.id !==
|
|
189
|
+
let g = x.filter((e) => e.id !== r.id), v = [{
|
|
190
190
|
key: "workspace",
|
|
191
191
|
name: n("workspaceSpace")
|
|
192
192
|
}, ...y.filter((e) => !e.archivedAt).map((e) => ({
|
|
@@ -197,30 +197,30 @@ function T(e) {
|
|
|
197
197
|
d,
|
|
198
198
|
{
|
|
199
199
|
label: n("newInside"),
|
|
200
|
-
onClick: () => _.create.mutate({ parent:
|
|
200
|
+
onClick: () => _.create.mutate({ parent: r })
|
|
201
201
|
},
|
|
202
202
|
{
|
|
203
203
|
label: n("duplicate"),
|
|
204
204
|
onClick: () => _.duplicate.mutate({
|
|
205
|
-
doc:
|
|
205
|
+
doc: r,
|
|
206
206
|
team: c?.key
|
|
207
207
|
})
|
|
208
208
|
},
|
|
209
|
-
...
|
|
209
|
+
...a ? [{
|
|
210
210
|
label: n("rename"),
|
|
211
|
-
onClick:
|
|
211
|
+
onClick: a
|
|
212
212
|
}] : [],
|
|
213
213
|
{
|
|
214
214
|
label: n("moveTo"),
|
|
215
215
|
items: [
|
|
216
216
|
...v.map((e) => {
|
|
217
|
-
let t = !
|
|
217
|
+
let t = !r.parentId && e.key === u;
|
|
218
218
|
return {
|
|
219
219
|
label: n("topOf", { space: e.name }),
|
|
220
220
|
checked: t,
|
|
221
221
|
disabled: t,
|
|
222
222
|
onClick: () => _.move.mutate({
|
|
223
|
-
doc:
|
|
223
|
+
doc: r,
|
|
224
224
|
space: e.key
|
|
225
225
|
})
|
|
226
226
|
};
|
|
@@ -228,10 +228,10 @@ function T(e) {
|
|
|
228
228
|
...g.length > 0 ? [p] : [],
|
|
229
229
|
...g.map((e) => ({
|
|
230
230
|
label: e.title,
|
|
231
|
-
checked: e.id ===
|
|
232
|
-
disabled: e.id ===
|
|
231
|
+
checked: e.id === r.parentId,
|
|
232
|
+
disabled: e.id === r.parentId,
|
|
233
233
|
onClick: () => _.move.mutate({
|
|
234
|
-
doc:
|
|
234
|
+
doc: r,
|
|
235
235
|
parent: e
|
|
236
236
|
})
|
|
237
237
|
}))
|
|
@@ -240,40 +240,40 @@ function T(e) {
|
|
|
240
240
|
{
|
|
241
241
|
label: n("share"),
|
|
242
242
|
onClick: () => f({
|
|
243
|
-
doc:
|
|
244
|
-
title:
|
|
243
|
+
doc: r.key,
|
|
244
|
+
title: r.title
|
|
245
245
|
})
|
|
246
246
|
},
|
|
247
247
|
{
|
|
248
|
-
label: h.find("doc",
|
|
249
|
-
onClick: () => h.toggle("doc",
|
|
248
|
+
label: h.find("doc", r.id) ? o("remove") : o("add"),
|
|
249
|
+
onClick: () => h.toggle("doc", r.id)
|
|
250
250
|
},
|
|
251
251
|
{
|
|
252
252
|
label: n("look.fullWidth"),
|
|
253
|
-
checked: !!
|
|
253
|
+
checked: !!r.fullWidth,
|
|
254
254
|
onClick: () => _.setLook.mutate({
|
|
255
|
-
doc:
|
|
256
|
-
fullWidth: !
|
|
255
|
+
doc: r,
|
|
256
|
+
fullWidth: !r.fullWidth
|
|
257
257
|
})
|
|
258
258
|
},
|
|
259
259
|
{
|
|
260
|
-
label:
|
|
260
|
+
label: r.template ? n("stopTemplate") : n("useAsTemplate"),
|
|
261
261
|
onClick: () => _.setTemplate.mutate({
|
|
262
|
-
doc:
|
|
263
|
-
template: !
|
|
262
|
+
doc: r,
|
|
263
|
+
template: !r.template
|
|
264
264
|
})
|
|
265
265
|
},
|
|
266
|
-
...
|
|
266
|
+
...r.template ? [{
|
|
267
267
|
label: n("spaceDefault"),
|
|
268
|
-
checked: !!
|
|
268
|
+
checked: !!r.spaceDefault,
|
|
269
269
|
onClick: () => _.setSpaceDefault.mutate({
|
|
270
|
-
doc:
|
|
271
|
-
spaceDefault: !
|
|
270
|
+
doc: r,
|
|
271
|
+
spaceDefault: !r.spaceDefault
|
|
272
272
|
})
|
|
273
273
|
}] : [],
|
|
274
274
|
{
|
|
275
275
|
label: n("exportMarkdown"),
|
|
276
|
-
onClick: () => D(e, { doc:
|
|
276
|
+
onClick: () => D(e, { doc: r.key })
|
|
277
277
|
},
|
|
278
278
|
p,
|
|
279
279
|
...m,
|
|
@@ -281,7 +281,7 @@ function T(e) {
|
|
|
281
281
|
{
|
|
282
282
|
label: n("archive"),
|
|
283
283
|
destructive: !0,
|
|
284
|
-
onClick: () => _.archive.mutate(
|
|
284
|
+
onClick: () => _.archive.mutate(r)
|
|
285
285
|
}
|
|
286
286
|
];
|
|
287
287
|
}, [
|
|
@@ -293,18 +293,18 @@ function T(e) {
|
|
|
293
293
|
h,
|
|
294
294
|
_,
|
|
295
295
|
n,
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
i,
|
|
297
|
+
o
|
|
298
298
|
]);
|
|
299
299
|
}
|
|
300
|
-
function E(
|
|
301
|
-
return
|
|
300
|
+
function E(e, t) {
|
|
301
|
+
return o(C(e, t));
|
|
302
302
|
}
|
|
303
|
-
function D(e,
|
|
304
|
-
let
|
|
305
|
-
...
|
|
306
|
-
...
|
|
307
|
-
}),
|
|
308
|
-
|
|
303
|
+
function D(e, t) {
|
|
304
|
+
let n = new URLSearchParams({
|
|
305
|
+
...t,
|
|
306
|
+
...t.space && { knowledge: "true" }
|
|
307
|
+
}), r = document.createElement("a");
|
|
308
|
+
r.href = `${s}/api/v1/workspaces/${encodeURIComponent(e)}/docs/export?${n}`, r.download = "", r.click();
|
|
309
309
|
}
|
|
310
310
|
export { x as docKey, C as docPath, b as docRef, E as docURL, D as downloadMarkdown, w as useDocActions, T as useDocMenu, S as useTemplateValues };
|
package/lib/githubLink.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { api as e } from "../api/client.js";
|
|
2
|
+
import { basePath as t } from "./base.js";
|
|
3
3
|
// src/lib/githubLink.ts
|
|
4
4
|
var n;
|
|
5
5
|
function r() {
|
|
6
|
-
return n ??=
|
|
7
|
-
if (!
|
|
8
|
-
if (
|
|
9
|
-
let n = window.location.pathname.slice(
|
|
10
|
-
return n ? `${
|
|
6
|
+
return n ??= e.GET("/api/v1/me/github").then(({ data: e }) => {
|
|
7
|
+
if (!e?.enabled || !e.keepsTokens || e.actsAsYou) return null;
|
|
8
|
+
if (e.linkedByHost) return e.linkURL ?? null;
|
|
9
|
+
let n = window.location.pathname.slice(t.length).split("/")[1];
|
|
10
|
+
return n ? `${t}/${n}/settings/connections` : null;
|
|
11
11
|
}).catch(() => null), n;
|
|
12
12
|
}
|
|
13
13
|
export { r as githubLinkPage };
|
package/lib/issueList.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { TypeIcon as e } from "../components/IssueTypes.js";
|
|
2
|
+
import { PriorityIcon as t, StatusIcon as n } from "../components/icons.js";
|
|
3
|
+
import { fieldRef as r, groupableKinds as i, parseFieldFilters as a, sortableKinds as o } from "./customFields.js";
|
|
4
4
|
import { statusRef as s } from "./refs.js";
|
|
5
5
|
import { Avatar as c } from "@parallelworks/ui";
|
|
6
6
|
import { jsx as l } from "react/jsx-runtime";
|
|
@@ -24,10 +24,10 @@ var u = {
|
|
|
24
24
|
"label",
|
|
25
25
|
"type",
|
|
26
26
|
"none"
|
|
27
|
-
], p = (e, t) => d.includes(e) || t.some((t) =>
|
|
27
|
+
], p = (e, t) => d.includes(e) || t.some((t) => r(e) === t.id && o.includes(t.kind)), m = (e, t) => f.includes(e) || t.some((t) => r(e) === t.id && i.includes(t.kind)), h = (e) => typeof e == "number" ? String(e) : typeof e == "string" && e !== "" ? e : void 0;
|
|
28
28
|
function g(e) {
|
|
29
|
-
let t = {},
|
|
30
|
-
|
|
29
|
+
let t = {}, n = h(e.view);
|
|
30
|
+
n && n in u && (t.view = n);
|
|
31
31
|
for (let n of [
|
|
32
32
|
"team",
|
|
33
33
|
"assignee",
|
|
@@ -48,9 +48,9 @@ function g(e) {
|
|
|
48
48
|
}
|
|
49
49
|
t.assignee && e.assigneeKind === "agent" && (t.assigneeKind = "agent"), t.assignee || e.unassigned !== "true" && e.unassigned !== !0 || (t.unassigned = "true"), (e.overdue === "true" || e.overdue === !0) && (t.overdue = "true");
|
|
50
50
|
let i = h(e.order);
|
|
51
|
-
i && i !== "updated" && (d.includes(i) ||
|
|
51
|
+
i && i !== "updated" && (d.includes(i) || r(i)) && (t.order = i), e.layout === "board" && (t.layout = "board"), e.scope === "workspace" && (t.scope = "workspace");
|
|
52
52
|
let a = h(e.group);
|
|
53
|
-
return a && a !== "status" && (f.includes(a) ||
|
|
53
|
+
return a && a !== "status" && (f.includes(a) || r(a)) && (t.group = a), t;
|
|
54
54
|
}
|
|
55
55
|
var _ = [
|
|
56
56
|
"started",
|
|
@@ -60,8 +60,8 @@ var _ = [
|
|
|
60
60
|
"completed",
|
|
61
61
|
"canceled"
|
|
62
62
|
], v = (e) => e === 0 ? 5 : e;
|
|
63
|
-
function y(e, t,
|
|
64
|
-
let i =
|
|
63
|
+
function y(e, t, n = []) {
|
|
64
|
+
let i = n.find((e) => e.id === r(t));
|
|
65
65
|
if (i) return [...e].sort(b(i));
|
|
66
66
|
let a = {
|
|
67
67
|
updated: () => 0,
|
|
@@ -82,63 +82,63 @@ function b(e) {
|
|
|
82
82
|
return r === void 0 || i === void 0 ? Number(r === void 0) - Number(i === void 0) : typeof r == "number" && typeof i == "number" ? r - i : String(r).localeCompare(String(i));
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
function x(
|
|
86
|
-
let f = u.find((e) => e.id ===
|
|
87
|
-
if (f) return S(
|
|
88
|
-
if (
|
|
89
|
-
let
|
|
85
|
+
function x(i, a, o, s = !1, u = [], d = []) {
|
|
86
|
+
let f = u.find((e) => e.id === r(a));
|
|
87
|
+
if (f) return S(i, f, o, s);
|
|
88
|
+
if (a === "type") {
|
|
89
|
+
let t = {
|
|
90
90
|
key: "none",
|
|
91
|
-
label:
|
|
91
|
+
label: o.noType ?? o.none.all,
|
|
92
92
|
issues: []
|
|
93
|
-
},
|
|
94
|
-
key:
|
|
95
|
-
label:
|
|
96
|
-
icon: /* @__PURE__ */ l(
|
|
97
|
-
type:
|
|
93
|
+
}, n = d.map((t) => ({
|
|
94
|
+
key: t.id,
|
|
95
|
+
label: t.name,
|
|
96
|
+
icon: /* @__PURE__ */ l(e, {
|
|
97
|
+
type: t,
|
|
98
98
|
className: "size-3.5"
|
|
99
99
|
}),
|
|
100
100
|
issues: []
|
|
101
101
|
}));
|
|
102
|
-
for (let
|
|
103
|
-
if (!
|
|
104
|
-
|
|
102
|
+
for (let r of i) {
|
|
103
|
+
if (!r.type) {
|
|
104
|
+
t.issues.push(r);
|
|
105
105
|
continue;
|
|
106
106
|
}
|
|
107
|
-
let
|
|
108
|
-
|
|
109
|
-
key:
|
|
110
|
-
label:
|
|
111
|
-
icon: /* @__PURE__ */ l(
|
|
112
|
-
type:
|
|
107
|
+
let i = n.find((e) => e.key === r.type?.id);
|
|
108
|
+
i || (i = {
|
|
109
|
+
key: r.type.id,
|
|
110
|
+
label: r.type.name,
|
|
111
|
+
icon: /* @__PURE__ */ l(e, {
|
|
112
|
+
type: r.type,
|
|
113
113
|
className: "size-3.5"
|
|
114
114
|
}),
|
|
115
115
|
issues: []
|
|
116
|
-
},
|
|
116
|
+
}, n.push(i)), i.issues.push(r);
|
|
117
117
|
}
|
|
118
|
-
return
|
|
118
|
+
return n.push(t), n.filter((e) => s || e.issues.length > 0);
|
|
119
119
|
}
|
|
120
|
-
if (
|
|
120
|
+
if (a === "none") return i.length > 0 ? [{
|
|
121
121
|
key: "all",
|
|
122
|
-
label:
|
|
123
|
-
issues:
|
|
122
|
+
label: o.none.all,
|
|
123
|
+
issues: i
|
|
124
124
|
}] : [];
|
|
125
|
-
if (
|
|
125
|
+
if (a === "status") return _.map((e) => ({
|
|
126
126
|
key: e,
|
|
127
|
-
label:
|
|
128
|
-
icon: /* @__PURE__ */ l(
|
|
129
|
-
issues:
|
|
127
|
+
label: o.status(e),
|
|
128
|
+
icon: /* @__PURE__ */ l(n, { category: e }),
|
|
129
|
+
issues: i.filter((t) => t.status.category === e)
|
|
130
130
|
})).filter((e) => s || e.issues.length > 0);
|
|
131
|
-
if (
|
|
131
|
+
if (a === "priority") return [
|
|
132
132
|
1,
|
|
133
133
|
2,
|
|
134
134
|
3,
|
|
135
135
|
4,
|
|
136
136
|
0
|
|
137
|
-
].map((
|
|
138
|
-
key: String(
|
|
139
|
-
label:
|
|
140
|
-
icon: /* @__PURE__ */ l(
|
|
141
|
-
issues:
|
|
137
|
+
].map((e) => ({
|
|
138
|
+
key: String(e),
|
|
139
|
+
label: o.priority(e),
|
|
140
|
+
icon: /* @__PURE__ */ l(t, { priority: e }),
|
|
141
|
+
issues: i.filter((t) => t.priority === e)
|
|
142
142
|
})).filter((e) => s || e.issues.length > 0);
|
|
143
143
|
let p = /* @__PURE__ */ new Map(), m = {
|
|
144
144
|
key: "",
|
|
@@ -153,18 +153,18 @@ function x(r, i, a, s = !1, u = [], d = []) {
|
|
|
153
153
|
};
|
|
154
154
|
i.issues.push(e), p.set(t, i);
|
|
155
155
|
};
|
|
156
|
-
for (let e of
|
|
156
|
+
for (let e of i) if (a === "assignee") {
|
|
157
157
|
for (let t of s ? e.assignees : e.assignees.slice(0, 1)) {
|
|
158
|
-
let n =
|
|
158
|
+
let n = o.person(t.kind, t.handle);
|
|
159
159
|
h(e, `${t.kind}:${t.handle}`, n, /* @__PURE__ */ l(c, {
|
|
160
160
|
name: n,
|
|
161
|
-
src:
|
|
161
|
+
src: o.avatar(t.kind, t.handle),
|
|
162
162
|
size: "xs",
|
|
163
163
|
decorative: !0
|
|
164
164
|
}));
|
|
165
165
|
}
|
|
166
166
|
e.assignees.length === 0 && m.issues.push(e);
|
|
167
|
-
} else if (
|
|
167
|
+
} else if (a === "project") e.project ? h(e, e.project.id, e.project.name) : m.issues.push(e);
|
|
168
168
|
else {
|
|
169
169
|
for (let t of s ? e.labels : e.labels.slice(0, 1)) h(e, t.id, t.name, /* @__PURE__ */ l("span", {
|
|
170
170
|
className: "size-2 rounded-full",
|
|
@@ -176,7 +176,7 @@ function x(r, i, a, s = !1, u = [], d = []) {
|
|
|
176
176
|
return (s || m.issues.length > 0) && g.push({
|
|
177
177
|
...m,
|
|
178
178
|
key: "none",
|
|
179
|
-
label:
|
|
179
|
+
label: o.none[a]
|
|
180
180
|
}), g;
|
|
181
181
|
}
|
|
182
182
|
function S(e, t, n, r) {
|
|
@@ -248,7 +248,7 @@ function C(e, t) {
|
|
|
248
248
|
...e.customer && { customer: e.customer },
|
|
249
249
|
...e.cycle && { cycle: e.cycle },
|
|
250
250
|
...e.type && { type: e.type.split(",") },
|
|
251
|
-
...e.fields && { field:
|
|
251
|
+
...e.fields && { field: a(e.fields).map((e) => `${e.field}:${e.value}`) },
|
|
252
252
|
...e.overdue && { overdue: !0 },
|
|
253
253
|
...e.q && { q: e.q },
|
|
254
254
|
...u[n].categories.length > 0 && { category: u[n].categories },
|