@parallelworks/tandem-web 0.171.2 → 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/ActivityTimeline.js +56 -56
- package/components/ActorLink.js +34 -0
- package/components/Attachments.js +67 -63
- package/components/CodeHostSettings.js +94 -60
- package/components/DashboardPanel.js +189 -152
- package/components/IssueEvent.js +91 -86
- package/components/IssueSentry.js +34 -32
- package/components/Widgets.js +96 -94
- package/lib/triageSeen.js +2 -2
- package/package.json +1 -1
- package/pages/triage.js +153 -163
- package/routes/_workspace/issues/_identifier2.js +273 -276
- package/routes/_workspace/knowledge/_term2.js +94 -92
- package/routes/_workspace/knowledge/index2.js +101 -99
|
@@ -700,7 +700,6 @@ var e = {
|
|
|
700
700
|
schedule: "{repeat}, next on {next}"
|
|
701
701
|
},
|
|
702
702
|
triage: {
|
|
703
|
-
unseen: "Not seen yet",
|
|
704
703
|
title: "Triage",
|
|
705
704
|
empty: "Nothing to triage",
|
|
706
705
|
emptyDescription: "New issues from outside your teams show up here.",
|
|
@@ -1721,7 +1720,11 @@ var e = {
|
|
|
1721
1720
|
connections: "Linked organizations",
|
|
1722
1721
|
pageDescription: "Link GitHub to the workspace, then choose how each repository’s issues sync with its team.",
|
|
1723
1722
|
branchName: "branch name",
|
|
1724
|
-
linkByBranch: "Work on this branch and its commits and pull request show here."
|
|
1723
|
+
linkByBranch: "Work on this branch and its commits and pull request show here.",
|
|
1724
|
+
showImages: "Show Tandem images on GitHub",
|
|
1725
|
+
showImagesHint: "Images attached in Tandem show in the GitHub issues synced through this account. Anyone with an image's link can view that image, without signing in to Tandem. Off, they reach GitHub as links to Tandem.",
|
|
1726
|
+
showImagesUnavailable: "Needs the server's credentials key (TANDEM_CREDENTIALS_KEY) and public URL (TANDEM_PUBLIC_URL). Until then, images reach GitHub as links to Tandem.",
|
|
1727
|
+
showImagesFor: "Show Tandem images on GitHub for {account}"
|
|
1725
1728
|
},
|
|
1726
1729
|
personCard: {
|
|
1727
1730
|
emailCopied: "Email copied",
|
|
@@ -700,7 +700,6 @@ var e = {
|
|
|
700
700
|
schedule: "{repeat}, la próxima el {next}"
|
|
701
701
|
},
|
|
702
702
|
triage: {
|
|
703
|
-
unseen: "Aún sin ver",
|
|
704
703
|
title: "Clasificación",
|
|
705
704
|
empty: "Nada que clasificar",
|
|
706
705
|
emptyDescription: "Las nuevas incidencias de fuera de tus equipos aparecen aquí.",
|
|
@@ -1721,7 +1720,11 @@ var e = {
|
|
|
1721
1720
|
connections: "Organizaciones vinculadas",
|
|
1722
1721
|
pageDescription: "Vincula GitHub al espacio de trabajo y elige cómo se sincronizan las incidencias de cada repositorio con su equipo.",
|
|
1723
1722
|
branchName: "nombre de la rama",
|
|
1724
|
-
linkByBranch: "Trabaja en esta rama y sus commits y su pull request aparecerán aquí."
|
|
1723
|
+
linkByBranch: "Trabaja en esta rama y sus commits y su pull request aparecerán aquí.",
|
|
1724
|
+
showImages: "Mostrar imágenes de Tandem en GitHub",
|
|
1725
|
+
showImagesHint: "Las imágenes adjuntas en Tandem se ven en las incidencias de GitHub sincronizadas con esta cuenta. Cualquiera con el enlace de una imagen puede verla sin iniciar sesión en Tandem. Desactivado, llegan a GitHub como enlaces a Tandem.",
|
|
1726
|
+
showImagesUnavailable: "Requiere la clave de credenciales del servidor (TANDEM_CREDENTIALS_KEY) y su URL pública (TANDEM_PUBLIC_URL). Mientras tanto, las imágenes llegan a GitHub como enlaces a Tandem.",
|
|
1727
|
+
showImagesFor: "Mostrar imágenes de Tandem en GitHub para {account}"
|
|
1725
1728
|
},
|
|
1726
1729
|
personCard: {
|
|
1727
1730
|
emailCopied: "Correo copiado",
|
|
@@ -700,7 +700,6 @@ var e = {
|
|
|
700
700
|
schedule: "{repeat}、次回は {next}"
|
|
701
701
|
},
|
|
702
702
|
triage: {
|
|
703
|
-
unseen: "未確認",
|
|
704
703
|
title: "トリアージ",
|
|
705
704
|
empty: "トリアージするものはありません",
|
|
706
705
|
emptyDescription: "チーム外からの新しい課題がここに表示されます。",
|
|
@@ -1721,7 +1720,11 @@ var e = {
|
|
|
1721
1720
|
connections: "リンク済みの組織",
|
|
1722
1721
|
pageDescription: "GitHub をワークスペースにリンクし、各リポジトリの課題をチームとどう同期するかを選びます。",
|
|
1723
1722
|
branchName: "ブランチ名",
|
|
1724
|
-
linkByBranch: "このブランチで作業すると、そのコミットとプルリクエストがここに表示されます。"
|
|
1723
|
+
linkByBranch: "このブランチで作業すると、そのコミットとプルリクエストがここに表示されます。",
|
|
1724
|
+
showImages: "Tandem の画像を GitHub に表示",
|
|
1725
|
+
showImagesHint: "Tandem で添付した画像を、このアカウントで同期する GitHub の Issue に表示します。画像のリンクを知っている人は、Tandem にサインインせずにその画像を見られます。オフの場合、画像は Tandem へのリンクとして GitHub に届きます。",
|
|
1726
|
+
showImagesUnavailable: "サーバーの認証情報キー (TANDEM_CREDENTIALS_KEY) と公開 URL (TANDEM_PUBLIC_URL) が必要です。それまでは、画像は Tandem へのリンクとして GitHub に届きます。",
|
|
1727
|
+
showImagesFor: "{account} で Tandem の画像を GitHub に表示"
|
|
1725
1728
|
},
|
|
1726
1729
|
personCard: {
|
|
1727
1730
|
emailCopied: "メールアドレスをコピーしました",
|
|
@@ -700,7 +700,6 @@ var e = {
|
|
|
700
700
|
schedule: "{repeat}, 다음은 {next}"
|
|
701
701
|
},
|
|
702
702
|
triage: {
|
|
703
|
-
unseen: "아직 보지 않음",
|
|
704
703
|
title: "분류",
|
|
705
704
|
empty: "분류할 항목이 없습니다",
|
|
706
705
|
emptyDescription: "팀 외부에서 들어온 새 이슈가 여기에 표시됩니다.",
|
|
@@ -1721,7 +1720,11 @@ var e = {
|
|
|
1721
1720
|
connections: "연결된 조직",
|
|
1722
1721
|
pageDescription: "워크스페이스에 GitHub를 연결한 뒤, 각 저장소의 이슈를 팀과 어떻게 동기화할지 고르세요.",
|
|
1723
1722
|
branchName: "브랜치 이름",
|
|
1724
|
-
linkByBranch: "이 브랜치에서 작업하면 커밋과 풀 리퀘스트가 여기에 표시됩니다."
|
|
1723
|
+
linkByBranch: "이 브랜치에서 작업하면 커밋과 풀 리퀘스트가 여기에 표시됩니다.",
|
|
1724
|
+
showImages: "GitHub에 Tandem 이미지 표시",
|
|
1725
|
+
showImagesHint: "Tandem에 첨부한 이미지가 이 계정으로 동기화되는 GitHub 이슈에 표시됩니다. 이미지 링크가 있는 사람은 Tandem에 로그인하지 않고도 그 이미지를 볼 수 있습니다. 끄면 이미지는 Tandem 링크로 GitHub에 전달됩니다.",
|
|
1726
|
+
showImagesUnavailable: "서버의 자격 증명 키(TANDEM_CREDENTIALS_KEY)와 공개 URL(TANDEM_PUBLIC_URL)이 필요합니다. 그 전까지 이미지는 Tandem 링크로 GitHub에 전달됩니다.",
|
|
1727
|
+
showImagesFor: "{account}에 대해 GitHub에 Tandem 이미지 표시"
|
|
1725
1728
|
},
|
|
1726
1729
|
personCard: {
|
|
1727
1730
|
emailCopied: "이메일을 복사했습니다",
|
|
@@ -700,7 +700,6 @@ var e = {
|
|
|
700
700
|
schedule: "{repeat},下次在 {next}"
|
|
701
701
|
},
|
|
702
702
|
triage: {
|
|
703
|
-
unseen: "尚未查看",
|
|
704
703
|
title: "分拣",
|
|
705
704
|
empty: "没有需要分拣的议题",
|
|
706
705
|
emptyDescription: "来自团队外部的新议题会显示在这里。",
|
|
@@ -1721,7 +1720,11 @@ var e = {
|
|
|
1721
1720
|
connections: "已关联的组织",
|
|
1722
1721
|
pageDescription: "将 GitHub 关联到工作区,然后选择每个代码仓库的问题如何与其团队同步。",
|
|
1723
1722
|
branchName: "分支名称",
|
|
1724
|
-
linkByBranch: "在此分支上工作,其提交和拉取请求就会显示在这里。"
|
|
1723
|
+
linkByBranch: "在此分支上工作,其提交和拉取请求就会显示在这里。",
|
|
1724
|
+
showImages: "在 GitHub 上显示 Tandem 图片",
|
|
1725
|
+
showImagesHint: "在 Tandem 中附加的图片会显示在通过此账号同步的 GitHub 议题中。任何拿到图片链接的人都无需登录 Tandem 即可查看该图片。关闭时,图片以指向 Tandem 的链接发送到 GitHub。",
|
|
1726
|
+
showImagesUnavailable: "需要服务器的凭据密钥 (TANDEM_CREDENTIALS_KEY) 和公开 URL (TANDEM_PUBLIC_URL)。在此之前,图片以指向 Tandem 的链接发送到 GitHub。",
|
|
1727
|
+
showImagesFor: "为 {account} 在 GitHub 上显示 Tandem 图片"
|
|
1725
1728
|
},
|
|
1726
1729
|
personCard: {
|
|
1727
1730
|
emailCopied: "已复制电子邮件",
|
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
import { actorAvatar as e } from "../lib/avatar.js";
|
|
2
2
|
import { usePeople as t } from "../lib/people.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ActorLink as n } from "./ActorLink.js";
|
|
4
|
+
import { AddIcon as r, AddUserIcon as i, AgentIcon as a, ArchiveIcon as o, AreaIcon as s, AttachmentIcon as c, BranchIcon as l, CalendarIcon as u, CancelIcon as d, CommentIcon as f, CycleIcon as p, EditIcon as m, EstimateIcon as h, FileTextIcon as g, HistoryIcon as _, LibraryIcon as v, LinkIcon as y, MegaphoneIcon as b, PriorityIcon as x, ProjectIcon as S, PullRequestIcon as C, ReleaseIcon as w, RemoveUserIcon as T, RenameIcon as E, RestoreIcon as D, SettingsIcon as O, StatusIcon as k, SuccessIcon as A, SwapIcon as j, TagIcon as M, TrashIcon as N, TriageIcon as P, UnlinkIcon as F, UsersIcon as I, WorkerIcon as L } from "./icons.js";
|
|
5
5
|
import { Avatar as R, RelativeTime as z } from "@parallelworks/ui";
|
|
6
6
|
import { jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
7
7
|
// src/components/ActivityTimeline.tsx
|
|
8
8
|
function H(e, t) {
|
|
9
|
-
let
|
|
9
|
+
let n = t ?? {};
|
|
10
10
|
switch (e) {
|
|
11
11
|
case "issue.status_changed": {
|
|
12
|
-
let e =
|
|
13
|
-
return e?.category ? /* @__PURE__ */ B(
|
|
12
|
+
let e = n.to;
|
|
13
|
+
return e?.category ? /* @__PURE__ */ B(k, {
|
|
14
14
|
category: e.category,
|
|
15
15
|
step: Number(e.step) || 0
|
|
16
|
-
}) : /* @__PURE__ */ B(
|
|
16
|
+
}) : /* @__PURE__ */ B(_, {});
|
|
17
17
|
}
|
|
18
|
-
case "issue.priority_changed": return /* @__PURE__ */ B(
|
|
18
|
+
case "issue.priority_changed": return /* @__PURE__ */ B(x, { priority: typeof n.to == "number" ? n.to : 0 });
|
|
19
19
|
case "issue.created":
|
|
20
20
|
case "doc.created":
|
|
21
21
|
case "area.created":
|
|
22
22
|
case "label.created":
|
|
23
23
|
case "team.status_created":
|
|
24
24
|
case "project.milestone_created":
|
|
25
|
-
case "cycle.created": return /* @__PURE__ */ B(
|
|
25
|
+
case "cycle.created": return /* @__PURE__ */ B(r, {});
|
|
26
26
|
case "issue.assignee_added":
|
|
27
|
-
case "team.member_added": return /* @__PURE__ */ B(
|
|
27
|
+
case "team.member_added": return /* @__PURE__ */ B(i, {});
|
|
28
28
|
case "issue.assignee_removed":
|
|
29
|
-
case "team.member_removed": return /* @__PURE__ */ B(
|
|
29
|
+
case "team.member_removed": return /* @__PURE__ */ B(T, {});
|
|
30
30
|
case "issue.title_changed":
|
|
31
|
-
case "doc.title_changed": return /* @__PURE__ */ B(
|
|
31
|
+
case "doc.title_changed": return /* @__PURE__ */ B(E, {});
|
|
32
32
|
case "issue.label_added":
|
|
33
33
|
case "issue.label_removed":
|
|
34
|
-
case "label.updated": return /* @__PURE__ */ B(
|
|
34
|
+
case "label.updated": return /* @__PURE__ */ B(M, {});
|
|
35
35
|
case "issue.archived":
|
|
36
36
|
case "doc.archived":
|
|
37
37
|
case "area.archived":
|
|
38
|
-
case "knowledge.archived": return /* @__PURE__ */ B(
|
|
38
|
+
case "knowledge.archived": return /* @__PURE__ */ B(o, {});
|
|
39
39
|
case "issue.restored":
|
|
40
40
|
case "doc.restored":
|
|
41
41
|
case "area.restored":
|
|
42
42
|
case "knowledge.restored":
|
|
43
|
-
case "doc.thread_reopened": return /* @__PURE__ */ B(
|
|
43
|
+
case "doc.thread_reopened": return /* @__PURE__ */ B(D, {});
|
|
44
44
|
case "issue.deleted":
|
|
45
45
|
case "label.deleted":
|
|
46
46
|
case "team.deleted":
|
|
@@ -49,65 +49,65 @@ function H(e, t) {
|
|
|
49
49
|
case "project.milestone_deleted":
|
|
50
50
|
case "project.update_deleted":
|
|
51
51
|
case "comment.deleted":
|
|
52
|
-
case "doc.comment_deleted": return /* @__PURE__ */ B(
|
|
52
|
+
case "doc.comment_deleted": return /* @__PURE__ */ B(N, {});
|
|
53
53
|
case "comment.created":
|
|
54
54
|
case "comment.edited":
|
|
55
55
|
case "doc.comment_created":
|
|
56
56
|
case "doc.comment_edited":
|
|
57
57
|
case "decision.requested":
|
|
58
|
-
case "decision.answered": return /* @__PURE__ */ B(
|
|
58
|
+
case "decision.answered": return /* @__PURE__ */ B(f, {});
|
|
59
59
|
case "doc.thread_resolved":
|
|
60
60
|
case "issue.triage_accepted":
|
|
61
|
-
case "area.accepted": return /* @__PURE__ */ B(
|
|
62
|
-
case "issue.triage_declined": return /* @__PURE__ */ B(
|
|
61
|
+
case "area.accepted": return /* @__PURE__ */ B(A, {});
|
|
62
|
+
case "issue.triage_declined": return /* @__PURE__ */ B(d, {});
|
|
63
63
|
case "issue.relation_added":
|
|
64
64
|
case "issue.parent_changed":
|
|
65
65
|
case "issue.team_changed":
|
|
66
|
-
case "team.repository_linked": return /* @__PURE__ */ B(
|
|
66
|
+
case "team.repository_linked": return /* @__PURE__ */ B(y, {});
|
|
67
67
|
case "issue.relation_removed":
|
|
68
68
|
case "issue.pull_request_unlinked":
|
|
69
|
-
case "team.repository_unlinked": return /* @__PURE__ */ B(
|
|
70
|
-
case "issue.pull_request_changed": return /* @__PURE__ */ B(
|
|
71
|
-
case "issue.branch_changed": return /* @__PURE__ */ B(
|
|
72
|
-
case "issue.released": return /* @__PURE__ */ B(
|
|
73
|
-
case "issue.attachment_added": return /* @__PURE__ */ B(
|
|
69
|
+
case "team.repository_unlinked": return /* @__PURE__ */ B(F, {});
|
|
70
|
+
case "issue.pull_request_changed": return /* @__PURE__ */ B(C, {});
|
|
71
|
+
case "issue.branch_changed": return /* @__PURE__ */ B(l, {});
|
|
72
|
+
case "issue.released": return /* @__PURE__ */ B(w, {});
|
|
73
|
+
case "issue.attachment_added": return /* @__PURE__ */ B(c, {});
|
|
74
74
|
case "issue.project_changed":
|
|
75
75
|
case "project.created":
|
|
76
76
|
case "project.updated":
|
|
77
77
|
case "project.milestone_updated":
|
|
78
|
-
case "issue.milestone_changed": return /* @__PURE__ */ B(
|
|
79
|
-
case "project.update_posted": return /* @__PURE__ */ B(
|
|
78
|
+
case "issue.milestone_changed": return /* @__PURE__ */ B(S, {});
|
|
79
|
+
case "project.update_posted": return /* @__PURE__ */ B(b, {});
|
|
80
80
|
case "issue.cycle_changed":
|
|
81
|
-
case "cycle.updated": return /* @__PURE__ */ B(
|
|
82
|
-
case "issue.estimate_changed": return /* @__PURE__ */ B(
|
|
83
|
-
case "issue.due_date_changed": return /* @__PURE__ */ B(
|
|
81
|
+
case "cycle.updated": return /* @__PURE__ */ B(p, {});
|
|
82
|
+
case "issue.estimate_changed": return /* @__PURE__ */ B(h, {});
|
|
83
|
+
case "issue.due_date_changed": return /* @__PURE__ */ B(u, {});
|
|
84
84
|
case "issue.fields_changed":
|
|
85
|
-
case "issue.type_changed": return /* @__PURE__ */ B(
|
|
85
|
+
case "issue.type_changed": return /* @__PURE__ */ B(m, {});
|
|
86
86
|
case "issue.area_changed":
|
|
87
87
|
case "doc.area_changed":
|
|
88
88
|
case "area.updated":
|
|
89
|
-
case "area.merged": return /* @__PURE__ */ B(
|
|
90
|
-
case "issue.stage_changed": return /* @__PURE__ */ B(
|
|
89
|
+
case "area.merged": return /* @__PURE__ */ B(s, {});
|
|
90
|
+
case "issue.stage_changed": return /* @__PURE__ */ B(P, {});
|
|
91
91
|
case "run.created":
|
|
92
|
-
case "run.state_changed": return /* @__PURE__ */ B(
|
|
92
|
+
case "run.state_changed": return /* @__PURE__ */ B(L, {});
|
|
93
93
|
case "agent.created":
|
|
94
|
-
case "agent.updated": return /* @__PURE__ */ B(
|
|
94
|
+
case "agent.updated": return /* @__PURE__ */ B(a, {});
|
|
95
95
|
case "knowledge.created":
|
|
96
|
-
case "knowledge.updated": return /* @__PURE__ */ B(
|
|
96
|
+
case "knowledge.updated": return /* @__PURE__ */ B(v, {});
|
|
97
97
|
case "knowledge.superseded":
|
|
98
|
-
case "team.rotation_handed_off": return /* @__PURE__ */ B(
|
|
98
|
+
case "team.rotation_handed_off": return /* @__PURE__ */ B(j, {});
|
|
99
99
|
case "team.created":
|
|
100
100
|
case "team.updated":
|
|
101
|
-
case "team.rotation_changed": return /* @__PURE__ */ B(
|
|
101
|
+
case "team.rotation_changed": return /* @__PURE__ */ B(I, {});
|
|
102
102
|
case "workspace.created":
|
|
103
103
|
case "workspace.updated":
|
|
104
|
-
case "team.status_updated": return /* @__PURE__ */ B(
|
|
104
|
+
case "team.status_updated": return /* @__PURE__ */ B(O, {});
|
|
105
105
|
case "issue.body_changed":
|
|
106
106
|
case "doc.body_changed":
|
|
107
107
|
case "doc.template_changed":
|
|
108
|
-
case "doc.appearance_changed": return /* @__PURE__ */ B(
|
|
109
|
-
case "doc.moved": return /* @__PURE__ */ B(
|
|
110
|
-
default: return /* @__PURE__ */ B(
|
|
108
|
+
case "doc.appearance_changed": return /* @__PURE__ */ B(m, {});
|
|
109
|
+
case "doc.moved": return /* @__PURE__ */ B(g, {});
|
|
110
|
+
default: return /* @__PURE__ */ B(_, {});
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
function U({ label: e, className: t = "", children: n }) {
|
|
@@ -120,41 +120,41 @@ function U({ label: e, className: t = "", children: n }) {
|
|
|
120
120
|
}), n]
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
-
function W({ workspace:
|
|
124
|
-
let { actorName:
|
|
123
|
+
function W({ workspace: r, icon: i, actor: a, at: o, detail: s, children: c }) {
|
|
124
|
+
let { actorName: l, avatarOf: u } = t(r);
|
|
125
125
|
return /* @__PURE__ */ V("li", {
|
|
126
126
|
className: "relative flex gap-3 py-1",
|
|
127
127
|
children: [/* @__PURE__ */ B("span", {
|
|
128
128
|
className: "z-10 flex size-8 shrink-0 items-center justify-center rounded-full border border-border bg-muted text-muted-foreground",
|
|
129
|
-
children:
|
|
129
|
+
children: i
|
|
130
130
|
}), /* @__PURE__ */ V("div", {
|
|
131
131
|
className: "min-w-0 flex-1 py-1.5 text-sm text-muted-foreground wrap-anywhere",
|
|
132
132
|
children: [/* @__PURE__ */ V("p", {
|
|
133
133
|
className: "flex flex-wrap items-center gap-x-1.5 gap-y-0.5",
|
|
134
134
|
children: [/* @__PURE__ */ V("span", {
|
|
135
135
|
className: "min-w-0",
|
|
136
|
-
children: [
|
|
136
|
+
children: [a && /* @__PURE__ */ B("span", {
|
|
137
137
|
className: "mr-1.5 inline-flex align-middle",
|
|
138
|
-
children: /* @__PURE__ */ B(
|
|
139
|
-
workspace:
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
children: /* @__PURE__ */ B(n, {
|
|
139
|
+
workspace: r,
|
|
140
|
+
actor: a,
|
|
141
|
+
className: "inline-flex",
|
|
142
142
|
children: /* @__PURE__ */ B(R, {
|
|
143
|
-
...e(
|
|
144
|
-
name:
|
|
145
|
-
src:
|
|
143
|
+
...e(a.kind),
|
|
144
|
+
name: l(a),
|
|
145
|
+
src: u(a.kind, a.handle),
|
|
146
146
|
size: "xs"
|
|
147
147
|
})
|
|
148
148
|
})
|
|
149
|
-
}),
|
|
149
|
+
}), c]
|
|
150
150
|
}), /* @__PURE__ */ B(z, {
|
|
151
|
-
value:
|
|
151
|
+
value: o,
|
|
152
152
|
exact: "medium",
|
|
153
153
|
className: "text-xs tabular-nums"
|
|
154
154
|
})]
|
|
155
|
-
}),
|
|
155
|
+
}), s && /* @__PURE__ */ B("div", {
|
|
156
156
|
className: "mt-0.5 truncate text-xs",
|
|
157
|
-
children:
|
|
157
|
+
children: s
|
|
158
158
|
})]
|
|
159
159
|
})]
|
|
160
160
|
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { usePeople as e } from "../lib/people.js";
|
|
2
|
+
import { Link as t } from "../lib/router.js";
|
|
3
|
+
import { PersonHoverCard as n } from "./PersonHoverCard.js";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
// src/components/ActorLink.tsx
|
|
6
|
+
function i({ workspace: i, actor: a, className: o, children: s }) {
|
|
7
|
+
let { person: c, agents: l } = e(i), u = o ?? "hover:underline";
|
|
8
|
+
return a.kind === "user" && c(a.handle).role ? /* @__PURE__ */ r(n, {
|
|
9
|
+
workspace: i,
|
|
10
|
+
handle: a.handle,
|
|
11
|
+
className: "inline-flex",
|
|
12
|
+
children: /* @__PURE__ */ r(t, {
|
|
13
|
+
to: "/$workspace/people/$username",
|
|
14
|
+
params: {
|
|
15
|
+
workspace: i,
|
|
16
|
+
username: a.handle
|
|
17
|
+
},
|
|
18
|
+
className: u,
|
|
19
|
+
children: s
|
|
20
|
+
})
|
|
21
|
+
}) : a.kind === "agent" && l.some((e) => e.slug === a.handle) ? /* @__PURE__ */ r(t, {
|
|
22
|
+
to: "/$workspace/agents/$slug",
|
|
23
|
+
params: {
|
|
24
|
+
workspace: i,
|
|
25
|
+
slug: a.handle
|
|
26
|
+
},
|
|
27
|
+
className: u,
|
|
28
|
+
children: s
|
|
29
|
+
}) : o ? /* @__PURE__ */ r("span", {
|
|
30
|
+
className: o,
|
|
31
|
+
children: s
|
|
32
|
+
}) : s;
|
|
33
|
+
}
|
|
34
|
+
export { i as ActorLink };
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import { attachmentsQuery as e, meQuery as t } from "../api/queries.js";
|
|
2
|
-
import { attachmentSizes as
|
|
3
|
-
import { openImageEvent as
|
|
4
|
-
import { AttachmentIcon as
|
|
5
|
-
import { ErrorText as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { attachmentsQuery as e, meQuery as t, workspaceQuery as n } from "../api/queries.js";
|
|
2
|
+
import { attachmentSizes as r, attachmentURL as i, insertAttachments as a, uploadAttachment as o } from "../lib/attachments.js";
|
|
3
|
+
import { openImageEvent as s } from "./editorPlugins.js";
|
|
4
|
+
import { AttachmentIcon as c, CloseIcon as l, DownloadIcon as u } from "./icons.js";
|
|
5
|
+
import { ErrorText as d, IconButton as f, Modal as p, ModalTitle as m, buttonClasses as h } from "@parallelworks/ui";
|
|
6
|
+
import { useParams as g } from "@tanstack/react-router";
|
|
7
|
+
import { useEffect as _, useRef as v, useState as y } from "react";
|
|
8
|
+
import { useErrorMessage as b } from "@parallelworks/problem/react";
|
|
9
|
+
import { useFormatter as x, useTranslations as S } from "use-intl";
|
|
10
|
+
import { ApiError as C } from "@parallelworks/problem";
|
|
11
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
12
|
+
import { useQuery as D, useQueryClient as O } from "@tanstack/react-query";
|
|
12
13
|
// src/components/Attachments.tsx
|
|
13
|
-
function
|
|
14
|
-
let {
|
|
15
|
-
|
|
14
|
+
function k() {
|
|
15
|
+
let { workspace: e = "" } = g({ strict: !1 }), { data: r } = D(t), { data: i } = D({
|
|
16
|
+
...n(e),
|
|
17
|
+
enabled: e !== ""
|
|
18
|
+
});
|
|
19
|
+
return r?.attachments !== !1 && i?.attachments !== !1;
|
|
16
20
|
}
|
|
17
|
-
function
|
|
18
|
-
let r =
|
|
19
|
-
return
|
|
21
|
+
function A(t, n) {
|
|
22
|
+
let r = O();
|
|
23
|
+
return j((e) => o(t, n, e), () => r.invalidateQueries({ queryKey: e(t, n).queryKey }));
|
|
20
24
|
}
|
|
21
|
-
function
|
|
22
|
-
let n =
|
|
25
|
+
function j(e, t) {
|
|
26
|
+
let n = S("issue.attachments"), r = b(), [i, o] = y(0), [s, c] = y(null), l = k();
|
|
23
27
|
return {
|
|
24
|
-
upload: async (
|
|
25
|
-
if (!
|
|
28
|
+
upload: async (i, s, u) => {
|
|
29
|
+
if (!i || s.length === 0) return;
|
|
26
30
|
if (!l) {
|
|
27
31
|
c(n("off", { name: s[0]?.name ?? "" }));
|
|
28
32
|
return;
|
|
@@ -32,7 +36,7 @@ function k(e, t) {
|
|
|
32
36
|
for (let t of s) try {
|
|
33
37
|
d.push(await e(t));
|
|
34
38
|
} catch (e) {
|
|
35
|
-
let i = e instanceof
|
|
39
|
+
let i = e instanceof C ? e.status : 0;
|
|
36
40
|
c(i === 413 ? n("tooLarge", { name: t.name }) : n("failed", {
|
|
37
41
|
name: t.name,
|
|
38
42
|
reason: r(e)
|
|
@@ -40,21 +44,21 @@ function k(e, t) {
|
|
|
40
44
|
} finally {
|
|
41
45
|
o((e) => e - 1);
|
|
42
46
|
}
|
|
43
|
-
d.length > 0 && !
|
|
47
|
+
d.length > 0 && !i.isDestroyed && a(i, d, u), t?.();
|
|
44
48
|
},
|
|
45
|
-
pending:
|
|
49
|
+
pending: i,
|
|
46
50
|
error: s
|
|
47
51
|
};
|
|
48
52
|
}
|
|
49
|
-
function
|
|
50
|
-
let t =
|
|
51
|
-
return
|
|
52
|
-
icon: /* @__PURE__ */
|
|
53
|
+
function M({ onFiles: e }) {
|
|
54
|
+
let t = S("issue.attachments"), n = v(null);
|
|
55
|
+
return k() ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(f, {
|
|
56
|
+
icon: /* @__PURE__ */ T(c, {}),
|
|
53
57
|
label: t("attach"),
|
|
54
58
|
variant: "ghost",
|
|
55
59
|
size: "sm",
|
|
56
60
|
onClick: () => n.current?.click()
|
|
57
|
-
}), /* @__PURE__ */
|
|
61
|
+
}), /* @__PURE__ */ T("input", {
|
|
58
62
|
ref: n,
|
|
59
63
|
type: "file",
|
|
60
64
|
multiple: !0,
|
|
@@ -64,19 +68,19 @@ function A({ onFiles: e }) {
|
|
|
64
68
|
}
|
|
65
69
|
})] }) : null;
|
|
66
70
|
}
|
|
67
|
-
function
|
|
68
|
-
let n =
|
|
69
|
-
return e > 0 ? /* @__PURE__ */
|
|
71
|
+
function N({ pending: e, error: t }) {
|
|
72
|
+
let n = S("issue.attachments");
|
|
73
|
+
return e > 0 ? /* @__PURE__ */ T("span", {
|
|
70
74
|
className: "text-xs text-muted-foreground",
|
|
71
75
|
role: "status",
|
|
72
76
|
children: n("uploading", { count: e })
|
|
73
|
-
}) : /* @__PURE__ */
|
|
77
|
+
}) : /* @__PURE__ */ T(d, {
|
|
74
78
|
inline: !0,
|
|
75
79
|
children: t
|
|
76
80
|
});
|
|
77
81
|
}
|
|
78
|
-
function
|
|
79
|
-
let e =
|
|
82
|
+
function P() {
|
|
83
|
+
let e = x();
|
|
80
84
|
return (t) => t < 1 << 20 ? e.number(Math.max(1, Math.round(t / 1024)), {
|
|
81
85
|
style: "unit",
|
|
82
86
|
unit: "kilobyte",
|
|
@@ -88,49 +92,49 @@ function M() {
|
|
|
88
92
|
maximumFractionDigits: 1
|
|
89
93
|
});
|
|
90
94
|
}
|
|
91
|
-
function
|
|
92
|
-
let a =
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}, [
|
|
96
|
-
let e = (e) =>
|
|
97
|
-
return document.addEventListener(
|
|
95
|
+
function F({ workspace: t, identifier: n }) {
|
|
96
|
+
let a = S("issue.attachments"), o = S("common"), c = P(), { data: d } = D(e(t, n)), [g, v] = y(null);
|
|
97
|
+
_(() => {
|
|
98
|
+
r.set(new Map((d ?? []).map((e) => [e.id, c(e.size)])), new Set((d ?? []).filter((e) => e.video).map((e) => e.id)));
|
|
99
|
+
}, [d]), _(() => () => r.set(/* @__PURE__ */ new Map()), []), _(() => {
|
|
100
|
+
let e = (e) => v(e.detail);
|
|
101
|
+
return document.addEventListener(s, e), () => document.removeEventListener(s, e);
|
|
98
102
|
}, []);
|
|
99
|
-
let
|
|
100
|
-
return /* @__PURE__ */
|
|
101
|
-
open:
|
|
102
|
-
onClose: () =>
|
|
103
|
+
let b = g ? i(g.src) : "";
|
|
104
|
+
return /* @__PURE__ */ E(p, {
|
|
105
|
+
open: g !== null,
|
|
106
|
+
onClose: () => v(null),
|
|
103
107
|
align: "center",
|
|
104
108
|
className: "flex max-h-[90vh] w-[min(92vw,1200px)] flex-col overflow-hidden",
|
|
105
|
-
children: [/* @__PURE__ */
|
|
109
|
+
children: [/* @__PURE__ */ E("div", {
|
|
106
110
|
className: "flex h-12 shrink-0 items-center gap-2 border-b border-border px-4",
|
|
107
111
|
children: [
|
|
108
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ T(m, {
|
|
109
113
|
className: "min-w-0 flex-1 truncate text-sm font-medium",
|
|
110
|
-
children:
|
|
114
|
+
children: g?.name || a("image")
|
|
111
115
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
href:
|
|
114
|
-
download:
|
|
115
|
-
className:
|
|
116
|
-
children: [/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ E("a", {
|
|
117
|
+
href: b,
|
|
118
|
+
download: g?.name ?? "",
|
|
119
|
+
className: h({ size: "sm" }),
|
|
120
|
+
children: [/* @__PURE__ */ T(u, { className: "size-3.5" }), a("download")]
|
|
117
121
|
}),
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
icon: /* @__PURE__ */
|
|
120
|
-
label:
|
|
122
|
+
/* @__PURE__ */ T(f, {
|
|
123
|
+
icon: /* @__PURE__ */ T(l, {}),
|
|
124
|
+
label: o("close"),
|
|
121
125
|
variant: "ghost",
|
|
122
126
|
size: "sm",
|
|
123
|
-
onClick: () =>
|
|
127
|
+
onClick: () => v(null)
|
|
124
128
|
})
|
|
125
129
|
]
|
|
126
|
-
}), /* @__PURE__ */
|
|
130
|
+
}), /* @__PURE__ */ T("div", {
|
|
127
131
|
className: "flex min-h-0 flex-1 items-center justify-center overflow-auto bg-muted p-4",
|
|
128
|
-
children:
|
|
129
|
-
src:
|
|
130
|
-
alt:
|
|
132
|
+
children: g && /* @__PURE__ */ T("img", {
|
|
133
|
+
src: b,
|
|
134
|
+
alt: g.name || a("image"),
|
|
131
135
|
className: "max-h-[calc(90vh-5rem)] max-w-full object-contain"
|
|
132
136
|
})
|
|
133
137
|
})]
|
|
134
138
|
});
|
|
135
139
|
}
|
|
136
|
-
export {
|
|
140
|
+
export { M as AttachButton, F as IssueAttachments, N as UploadStatus, A as useAttachmentUpload, k as useAttachmentsOn, j as useFileUpload };
|