@parallelworks/tandem-web 0.189.5 → 0.189.7
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 +11 -5
- package/_virtual/_virtual_i18n/es/common.js +11 -5
- package/_virtual/_virtual_i18n/ja/common.js +11 -5
- package/_virtual/_virtual_i18n/ko/common.js +11 -5
- package/_virtual/_virtual_i18n/zh/common.js +11 -5
- package/components/GitHub.js +62 -38
- package/components/IssueView.js +1473 -0
- package/components/TriageBanner.js +207 -0
- package/package.json +21 -21
- package/pages/triage.js +181 -302
- package/routes/_workspace/issues/_identifier2.js +12 -1436
- package/routes/_workspace/issues/_identifier3.js +3 -17
|
@@ -734,9 +734,7 @@ var e = {
|
|
|
734
734
|
decline: "Decline",
|
|
735
735
|
acceptHelp: "Take it in where it is",
|
|
736
736
|
declineHelp: "Move it to Canceled",
|
|
737
|
-
from: "From {name}",
|
|
738
737
|
waiting: "Waiting in triage. Accept it to take it in, or decline it.",
|
|
739
|
-
duplicateHint: "Duplicate of another issue? Add a duplicate relation, then decline it.",
|
|
740
738
|
selectAll: "Select all",
|
|
741
739
|
selected: "{count} selected",
|
|
742
740
|
acceptCount: "Accept {count}",
|
|
@@ -747,7 +745,13 @@ var e = {
|
|
|
747
745
|
shortcuts: "J and K move between issues, X picks one, Shift picks a run of them, Enter opens one.",
|
|
748
746
|
back: "Back to triage",
|
|
749
747
|
openIssue: "Open issue",
|
|
750
|
-
noDescription: "No description."
|
|
748
|
+
noDescription: "No description.",
|
|
749
|
+
markDuplicate: "Mark as duplicate",
|
|
750
|
+
findIssue: "Find the issue it duplicates…",
|
|
751
|
+
declineReason: "Why decline it? (optional, posted as a comment)",
|
|
752
|
+
acceptInto: "Status",
|
|
753
|
+
acceptWhereItIs: "Where it is now",
|
|
754
|
+
assignToMe: "Assign to me"
|
|
751
755
|
},
|
|
752
756
|
subscription: {
|
|
753
757
|
subscribe: "Subscribe to updates on this issue",
|
|
@@ -965,7 +969,8 @@ var e = {
|
|
|
965
969
|
created: "Created",
|
|
966
970
|
syncedWith: "Synced with",
|
|
967
971
|
timeInStatus: "Time in status",
|
|
968
|
-
currentStatus: "{name}, now"
|
|
972
|
+
currentStatus: "{name}, now",
|
|
973
|
+
team: "Team"
|
|
969
974
|
},
|
|
970
975
|
events: {
|
|
971
976
|
created: "<actor>{name}</actor> created the issue",
|
|
@@ -1755,7 +1760,8 @@ var e = {
|
|
|
1755
1760
|
showImages: "Show Tandem images on GitHub",
|
|
1756
1761
|
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.",
|
|
1757
1762
|
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.",
|
|
1758
|
-
showImagesFor: "Show Tandem images on GitHub for {account}"
|
|
1763
|
+
showImagesFor: "Show Tandem images on GitHub for {account}",
|
|
1764
|
+
syncedIssue: "Issue synced with {name}"
|
|
1759
1765
|
},
|
|
1760
1766
|
personCard: {
|
|
1761
1767
|
emailCopied: "Email copied",
|
|
@@ -734,9 +734,7 @@ var e = {
|
|
|
734
734
|
decline: "Rechazar",
|
|
735
735
|
acceptHelp: "Aceptarla donde está",
|
|
736
736
|
declineHelp: "Moverla a Cancelada",
|
|
737
|
-
from: "De {name}",
|
|
738
737
|
waiting: "Pendiente de clasificar. Acéptala para incorporarla o recházala.",
|
|
739
|
-
duplicateHint: "¿Duplica otra incidencia? Añade una relación de duplicado y luego recházala.",
|
|
740
738
|
selectAll: "Seleccionar todo",
|
|
741
739
|
selected: "{count, plural, one {# seleccionada} other {# seleccionadas}}",
|
|
742
740
|
acceptCount: "Aceptar {count}",
|
|
@@ -747,7 +745,13 @@ var e = {
|
|
|
747
745
|
shortcuts: "J y K se mueven entre incidencias, X elige una, Mayús elige varias seguidas, Intro abre una.",
|
|
748
746
|
back: "Volver a Clasificación",
|
|
749
747
|
openIssue: "Abrir incidencia",
|
|
750
|
-
noDescription: "Sin descripción."
|
|
748
|
+
noDescription: "Sin descripción.",
|
|
749
|
+
markDuplicate: "Marcar como duplicado",
|
|
750
|
+
findIssue: "Busca la incidencia que duplica…",
|
|
751
|
+
declineReason: "¿Por qué rechazarla? (opcional, se publica como comentario)",
|
|
752
|
+
acceptInto: "Estado",
|
|
753
|
+
acceptWhereItIs: "Donde está ahora",
|
|
754
|
+
assignToMe: "Asignármela"
|
|
751
755
|
},
|
|
752
756
|
subscription: {
|
|
753
757
|
subscribe: "Suscribirse a las novedades de esta incidencia",
|
|
@@ -965,7 +969,8 @@ var e = {
|
|
|
965
969
|
created: "Creada",
|
|
966
970
|
syncedWith: "Sincronizada con",
|
|
967
971
|
timeInStatus: "Tiempo en el estado",
|
|
968
|
-
currentStatus: "{name}, ahora"
|
|
972
|
+
currentStatus: "{name}, ahora",
|
|
973
|
+
team: "Equipo"
|
|
969
974
|
},
|
|
970
975
|
events: {
|
|
971
976
|
created: "<actor>{name}</actor> creó la incidencia",
|
|
@@ -1755,7 +1760,8 @@ var e = {
|
|
|
1755
1760
|
showImages: "Mostrar imágenes de Tandem en GitHub",
|
|
1756
1761
|
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.",
|
|
1757
1762
|
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.",
|
|
1758
|
-
showImagesFor: "Mostrar imágenes de Tandem en GitHub para {account}"
|
|
1763
|
+
showImagesFor: "Mostrar imágenes de Tandem en GitHub para {account}",
|
|
1764
|
+
syncedIssue: "Incidencia sincronizada con {name}"
|
|
1759
1765
|
},
|
|
1760
1766
|
personCard: {
|
|
1761
1767
|
emailCopied: "Correo copiado",
|
|
@@ -734,9 +734,7 @@ var e = {
|
|
|
734
734
|
decline: "却下",
|
|
735
735
|
acceptHelp: "現在のチームで受け入れます",
|
|
736
736
|
declineHelp: "キャンセル済みに移動します",
|
|
737
|
-
from: "{name} から",
|
|
738
737
|
waiting: "トリアージ待ちです。受け入れるか、却下してください。",
|
|
739
|
-
duplicateHint: "別の課題と重複していますか?重複の関連を追加してから却下してください。",
|
|
740
738
|
selectAll: "すべて選択",
|
|
741
739
|
selected: "{count} 件選択",
|
|
742
740
|
acceptCount: "{count} 件を受け入れる",
|
|
@@ -747,7 +745,13 @@ var e = {
|
|
|
747
745
|
shortcuts: "J と K で課題を移動、X で選択、Shift で連続して選択、Enter で開きます。",
|
|
748
746
|
back: "トリアージに戻る",
|
|
749
747
|
openIssue: "課題を開く",
|
|
750
|
-
noDescription: "説明はありません。"
|
|
748
|
+
noDescription: "説明はありません。",
|
|
749
|
+
markDuplicate: "重複としてマーク",
|
|
750
|
+
findIssue: "重複先のイシューを検索…",
|
|
751
|
+
declineReason: "却下する理由(任意、コメントとして投稿)",
|
|
752
|
+
acceptInto: "ステータス",
|
|
753
|
+
acceptWhereItIs: "現在のまま",
|
|
754
|
+
assignToMe: "自分に割り当てる"
|
|
751
755
|
},
|
|
752
756
|
subscription: {
|
|
753
757
|
subscribe: "この課題の更新を購読",
|
|
@@ -965,7 +969,8 @@ var e = {
|
|
|
965
969
|
created: "作成日",
|
|
966
970
|
syncedWith: "同期先",
|
|
967
971
|
timeInStatus: "ステータスの経過時間",
|
|
968
|
-
currentStatus: "{name}(現在)"
|
|
972
|
+
currentStatus: "{name}(現在)",
|
|
973
|
+
team: "チーム"
|
|
969
974
|
},
|
|
970
975
|
events: {
|
|
971
976
|
created: "<actor>{name}</actor> が課題を作成しました",
|
|
@@ -1755,7 +1760,8 @@ var e = {
|
|
|
1755
1760
|
showImages: "Tandem の画像を GitHub に表示",
|
|
1756
1761
|
showImagesHint: "Tandem で添付した画像を、このアカウントで同期する GitHub の Issue に表示します。画像のリンクを知っている人は、Tandem にサインインせずにその画像を見られます。オフの場合、画像は Tandem へのリンクとして GitHub に届きます。",
|
|
1757
1762
|
showImagesUnavailable: "サーバーの認証情報キー (TANDEM_CREDENTIALS_KEY) と公開 URL (TANDEM_PUBLIC_URL) が必要です。それまでは、画像は Tandem へのリンクとして GitHub に届きます。",
|
|
1758
|
-
showImagesFor: "{account} で Tandem の画像を GitHub に表示"
|
|
1763
|
+
showImagesFor: "{account} で Tandem の画像を GitHub に表示",
|
|
1764
|
+
syncedIssue: "{name} と同期しているイシュー"
|
|
1759
1765
|
},
|
|
1760
1766
|
personCard: {
|
|
1761
1767
|
emailCopied: "メールアドレスをコピーしました",
|
|
@@ -734,9 +734,7 @@ var e = {
|
|
|
734
734
|
decline: "거절",
|
|
735
735
|
acceptHelp: "현재 위치에서 받기",
|
|
736
736
|
declineHelp: "취소됨으로 이동",
|
|
737
|
-
from: "{name}에서",
|
|
738
737
|
waiting: "분류 대기 중입니다. 받으려면 수락하고, 그렇지 않으면 거절하세요.",
|
|
739
|
-
duplicateHint: "다른 이슈와 중복인가요? 중복 관계를 추가한 다음 거절하세요.",
|
|
740
738
|
selectAll: "모두 선택",
|
|
741
739
|
selected: "{count}개 선택됨",
|
|
742
740
|
acceptCount: "{count}개 수락",
|
|
@@ -747,7 +745,13 @@ var e = {
|
|
|
747
745
|
shortcuts: "J와 K로 이슈 사이를 이동하고, X로 하나를 선택하고, Shift로 연속해서 선택하고, Enter로 엽니다.",
|
|
748
746
|
back: "분류로 돌아가기",
|
|
749
747
|
openIssue: "이슈 열기",
|
|
750
|
-
noDescription: "설명이 없습니다."
|
|
748
|
+
noDescription: "설명이 없습니다.",
|
|
749
|
+
markDuplicate: "중복으로 표시",
|
|
750
|
+
findIssue: "중복된 이슈 찾기…",
|
|
751
|
+
declineReason: "거절하는 이유 (선택, 댓글로 게시됨)",
|
|
752
|
+
acceptInto: "상태",
|
|
753
|
+
acceptWhereItIs: "현재 상태 그대로",
|
|
754
|
+
assignToMe: "나에게 할당"
|
|
751
755
|
},
|
|
752
756
|
subscription: {
|
|
753
757
|
subscribe: "이 이슈의 업데이트 구독",
|
|
@@ -965,7 +969,8 @@ var e = {
|
|
|
965
969
|
created: "생성일",
|
|
966
970
|
syncedWith: "동기화 대상",
|
|
967
971
|
timeInStatus: "상태별 소요 시간",
|
|
968
|
-
currentStatus: "{name}, 현재"
|
|
972
|
+
currentStatus: "{name}, 현재",
|
|
973
|
+
team: "팀"
|
|
969
974
|
},
|
|
970
975
|
events: {
|
|
971
976
|
created: "<actor>{name}</actor>이(가) 이슈를 생성함",
|
|
@@ -1755,7 +1760,8 @@ var e = {
|
|
|
1755
1760
|
showImages: "GitHub에 Tandem 이미지 표시",
|
|
1756
1761
|
showImagesHint: "Tandem에 첨부한 이미지가 이 계정으로 동기화되는 GitHub 이슈에 표시됩니다. 이미지 링크가 있는 사람은 Tandem에 로그인하지 않고도 그 이미지를 볼 수 있습니다. 끄면 이미지는 Tandem 링크로 GitHub에 전달됩니다.",
|
|
1757
1762
|
showImagesUnavailable: "서버의 자격 증명 키(TANDEM_CREDENTIALS_KEY)와 공개 URL(TANDEM_PUBLIC_URL)이 필요합니다. 그 전까지 이미지는 Tandem 링크로 GitHub에 전달됩니다.",
|
|
1758
|
-
showImagesFor: "{account}에 대해 GitHub에 Tandem 이미지 표시"
|
|
1763
|
+
showImagesFor: "{account}에 대해 GitHub에 Tandem 이미지 표시",
|
|
1764
|
+
syncedIssue: "{name}와 동기화된 이슈"
|
|
1759
1765
|
},
|
|
1760
1766
|
personCard: {
|
|
1761
1767
|
emailCopied: "이메일을 복사했습니다",
|
|
@@ -734,9 +734,7 @@ var e = {
|
|
|
734
734
|
decline: "拒绝",
|
|
735
735
|
acceptHelp: "保留在当前位置并接收",
|
|
736
736
|
declineHelp: "移到“已取消”",
|
|
737
|
-
from: "来自 {name}",
|
|
738
737
|
waiting: "正在分拣中等待。接受即可接收,也可以拒绝。",
|
|
739
|
-
duplicateHint: "与其他议题重复?请添加重复关系,然后拒绝。",
|
|
740
738
|
selectAll: "全选",
|
|
741
739
|
selected: "已选 {count} 个",
|
|
742
740
|
acceptCount: "接受 {count} 个",
|
|
@@ -747,7 +745,13 @@ var e = {
|
|
|
747
745
|
shortcuts: "J 和 K 在议题间移动,X 选择一个,Shift 连续选择,Enter 打开。",
|
|
748
746
|
back: "返回分拣",
|
|
749
747
|
openIssue: "打开议题",
|
|
750
|
-
noDescription: "没有描述。"
|
|
748
|
+
noDescription: "没有描述。",
|
|
749
|
+
markDuplicate: "标记为重复",
|
|
750
|
+
findIssue: "查找它重复的问题…",
|
|
751
|
+
declineReason: "拒绝原因(可选,作为评论发布)",
|
|
752
|
+
acceptInto: "状态",
|
|
753
|
+
acceptWhereItIs: "保持当前状态",
|
|
754
|
+
assignToMe: "分配给我"
|
|
751
755
|
},
|
|
752
756
|
subscription: {
|
|
753
757
|
subscribe: "订阅此议题的更新",
|
|
@@ -965,7 +969,8 @@ var e = {
|
|
|
965
969
|
created: "创建时间",
|
|
966
970
|
syncedWith: "同步自",
|
|
967
971
|
timeInStatus: "处于各状态的时间",
|
|
968
|
-
currentStatus: "{name},当前"
|
|
972
|
+
currentStatus: "{name},当前",
|
|
973
|
+
team: "团队"
|
|
969
974
|
},
|
|
970
975
|
events: {
|
|
971
976
|
created: "<actor>{name}</actor> 创建了此议题",
|
|
@@ -1755,7 +1760,8 @@ var e = {
|
|
|
1755
1760
|
showImages: "在 GitHub 上显示 Tandem 图片",
|
|
1756
1761
|
showImagesHint: "在 Tandem 中附加的图片会显示在通过此账号同步的 GitHub 议题中。任何拿到图片链接的人都无需登录 Tandem 即可查看该图片。关闭时,图片以指向 Tandem 的链接发送到 GitHub。",
|
|
1757
1762
|
showImagesUnavailable: "需要服务器的凭据密钥 (TANDEM_CREDENTIALS_KEY) 和公开 URL (TANDEM_PUBLIC_URL)。在此之前,图片以指向 Tandem 的链接发送到 GitHub。",
|
|
1758
|
-
showImagesFor: "为 {account} 在 GitHub 上显示 Tandem 图片"
|
|
1763
|
+
showImagesFor: "为 {account} 在 GitHub 上显示 Tandem 图片",
|
|
1764
|
+
syncedIssue: "已与 {name} 同步的问题"
|
|
1759
1765
|
},
|
|
1760
1766
|
personCard: {
|
|
1761
1767
|
emailCopied: "已复制电子邮件",
|
package/components/GitHub.js
CHANGED
|
@@ -11,18 +11,19 @@ import { useEffect as x, useState as S } from "react";
|
|
|
11
11
|
import { useFormatter as C, useLocale as w, useTranslations as T } from "use-intl";
|
|
12
12
|
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
13
13
|
import { useMutation as k, useQuery as A, useQueryClient as j, useSuspenseQuery as M } from "@tanstack/react-query";
|
|
14
|
+
import { ExternalLinkIcon as N } from "@parallelworks/ui/icons";
|
|
14
15
|
// src/components/GitHub.tsx
|
|
15
|
-
var
|
|
16
|
+
var P = [
|
|
16
17
|
"linked",
|
|
17
18
|
"denied",
|
|
18
19
|
"expired",
|
|
19
20
|
"account_taken",
|
|
20
21
|
"failed"
|
|
21
22
|
];
|
|
22
|
-
function
|
|
23
|
+
function F() {
|
|
23
24
|
let [e] = S(() => {
|
|
24
25
|
let e = new URLSearchParams(window.location.search).get("github");
|
|
25
|
-
return
|
|
26
|
+
return P.find((t) => t === e) ?? null;
|
|
26
27
|
});
|
|
27
28
|
return x(() => {
|
|
28
29
|
if (!e) return;
|
|
@@ -30,7 +31,7 @@ function P() {
|
|
|
30
31
|
t.searchParams.delete("github"), window.history.replaceState(window.history.state, "", t);
|
|
31
32
|
}, [e]), e;
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
+
function I({ outcome: e }) {
|
|
34
35
|
let t = T("github.outcomes");
|
|
35
36
|
return e ? /* @__PURE__ */ D("p", {
|
|
36
37
|
role: "status",
|
|
@@ -38,14 +39,14 @@ function F({ outcome: e }) {
|
|
|
38
39
|
children: t(e)
|
|
39
40
|
}) : null;
|
|
40
41
|
}
|
|
41
|
-
async function
|
|
42
|
+
async function L(e) {
|
|
42
43
|
let { url: t } = await e();
|
|
43
44
|
window.location.assign(t);
|
|
44
45
|
}
|
|
45
|
-
var
|
|
46
|
-
function
|
|
47
|
-
let { data: r } = M(n), i = T("github"), a = j(), c = d(), u =
|
|
48
|
-
mutationFn: () =>
|
|
46
|
+
var R = () => window.location.pathname.slice(a.length) || "/";
|
|
47
|
+
function z() {
|
|
48
|
+
let { data: r } = M(n), i = T("github"), a = j(), c = d(), u = F(), f = k({
|
|
49
|
+
mutationFn: () => L(async () => t(await e.POST("/api/v1/me/github", { body: { returnTo: R() } }))),
|
|
49
50
|
onMutate: c.clear,
|
|
50
51
|
onError: c.set
|
|
51
52
|
}), m = k({
|
|
@@ -54,7 +55,7 @@ function R() {
|
|
|
54
55
|
onSettled: () => a.invalidateQueries({ queryKey: n.queryKey })
|
|
55
56
|
}), { confirm: h, dialog: g } = o();
|
|
56
57
|
if (!r.enabled) return null;
|
|
57
|
-
let _ = r.keepsTokens ? i("accountDescriptionBothWays") : i("accountDescription"), y = r.login ? /* @__PURE__ */ D(
|
|
58
|
+
let _ = r.keepsTokens ? i("accountDescriptionBothWays") : i("accountDescription"), y = r.login ? /* @__PURE__ */ D(B, {
|
|
58
59
|
login: r.login,
|
|
59
60
|
url: r.url
|
|
60
61
|
}) : _, x = !r.login && /* @__PURE__ */ D(v, {
|
|
@@ -101,7 +102,7 @@ function R() {
|
|
|
101
102
|
onClick: () => f.mutate(),
|
|
102
103
|
children: i("link")
|
|
103
104
|
})] }),
|
|
104
|
-
children: (u || S) && /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(
|
|
105
|
+
children: (u || S) && /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(I, { outcome: u }), S && /* @__PURE__ */ O("div", {
|
|
105
106
|
className: "flex items-center gap-3 rounded-lg border border-border px-4 py-3 text-sm",
|
|
106
107
|
children: [/* @__PURE__ */ D("p", {
|
|
107
108
|
className: "min-w-0 flex-1",
|
|
@@ -116,7 +117,7 @@ function R() {
|
|
|
116
117
|
})] })
|
|
117
118
|
}), g] });
|
|
118
119
|
}
|
|
119
|
-
function
|
|
120
|
+
function B({ login: e, url: t }) {
|
|
120
121
|
return T("github").rich("linkedAs", {
|
|
121
122
|
login: e,
|
|
122
123
|
link: (e) => /* @__PURE__ */ D("a", {
|
|
@@ -128,7 +129,7 @@ function z({ login: e, url: t }) {
|
|
|
128
129
|
})
|
|
129
130
|
});
|
|
130
131
|
}
|
|
131
|
-
function
|
|
132
|
+
function V({ workspace: e }) {
|
|
132
133
|
let { data: t } = M(r(e)), { data: n = [] } = A(i(e)), a = T("github");
|
|
133
134
|
return t.enabled ? /* @__PURE__ */ D(_, {
|
|
134
135
|
title: a("settingsTitle"),
|
|
@@ -139,7 +140,7 @@ function B({ workspace: e }) {
|
|
|
139
140
|
let r = n.find((e) => e.key === t.team)?.name ?? t.team;
|
|
140
141
|
return /* @__PURE__ */ D("li", {
|
|
141
142
|
className: "px-3 py-2 text-sm",
|
|
142
|
-
children: /* @__PURE__ */ D(
|
|
143
|
+
children: /* @__PURE__ */ D(W, {
|
|
143
144
|
workspace: e,
|
|
144
145
|
repository: t,
|
|
145
146
|
teamName: r,
|
|
@@ -166,22 +167,22 @@ function B({ workspace: e }) {
|
|
|
166
167
|
})
|
|
167
168
|
}) : null;
|
|
168
169
|
}
|
|
169
|
-
var
|
|
170
|
-
function
|
|
170
|
+
var H = "", U = 2e3;
|
|
171
|
+
function W({ workspace: n, repository: a, teamName: s, children: l }) {
|
|
171
172
|
let u = T("github"), h = j(), _ = d(), { confirm: v, dialog: y } = o(), { data: b } = A(r(n)), { data: C = [] } = A(i(n)), w = (e) => C.find((t) => t.key === e) ?? {
|
|
172
173
|
icon: "",
|
|
173
174
|
name: e
|
|
174
175
|
}, M = (e) => w(e).name, N = (e) => () => /* @__PURE__ */ D(f, { team: w(e) }), P = (b?.repositories ?? []).filter((e) => e.id === a.id && e.team !== a.team), F = P.find((e) => e.syncMode), [I, L] = S(!1);
|
|
175
176
|
x(() => {
|
|
176
177
|
if (!I) return;
|
|
177
|
-
let e = setTimeout(() => L(!1),
|
|
178
|
+
let e = setTimeout(() => L(!1), U);
|
|
178
179
|
return () => clearTimeout(e);
|
|
179
180
|
}, [I]);
|
|
180
181
|
let R = {
|
|
181
182
|
workspace: n,
|
|
182
183
|
repositoryId: a.id
|
|
183
184
|
}, z = () => h.invalidateQueries({ queryKey: r(n).queryKey }), B = k({
|
|
184
|
-
mutationFn: async ({ syncMode: n, takeOver: r = !1 }) => t(n ===
|
|
185
|
+
mutationFn: async ({ syncMode: n, takeOver: r = !1 }) => t(n === H ? await e.DELETE("/api/v1/workspaces/{workspace}/github/repositories/{repositoryId}", { params: { path: R } }) : await e.PUT("/api/v1/workspaces/{workspace}/github/repositories/{repositoryId}", {
|
|
185
186
|
params: { path: R },
|
|
186
187
|
body: {
|
|
187
188
|
team: a.team,
|
|
@@ -195,12 +196,12 @@ function U({ workspace: n, repository: a, teamName: s, children: l }) {
|
|
|
195
196
|
onSuccess: () => L(!0),
|
|
196
197
|
onSettled: z,
|
|
197
198
|
onError: _.set
|
|
198
|
-
}),
|
|
199
|
+
}), V = k({
|
|
199
200
|
mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/github/repositories/{repositoryId}/import", { params: { path: R } })),
|
|
200
201
|
onMutate: _.clear,
|
|
201
202
|
onSettled: z,
|
|
202
203
|
onError: _.set
|
|
203
|
-
}),
|
|
204
|
+
}), W = k({
|
|
204
205
|
mutationFn: async (n) => {
|
|
205
206
|
let r = { params: { path: R } }, i = "/api/v1/workspaces/{workspace}/github/repositories/{repositoryId}/import";
|
|
206
207
|
switch (n) {
|
|
@@ -212,8 +213,8 @@ function U({ workspace: n, repository: a, teamName: s, children: l }) {
|
|
|
212
213
|
onMutate: _.clear,
|
|
213
214
|
onSettled: z,
|
|
214
215
|
onError: _.set
|
|
215
|
-
}), K = (B.isPending ? B.variables.syncMode : a.syncMode) ??
|
|
216
|
-
if (!F || e ===
|
|
216
|
+
}), K = (B.isPending ? B.variables.syncMode : a.syncMode) ?? H, q = (e) => {
|
|
217
|
+
if (!F || e === H) {
|
|
217
218
|
B.mutate({ syncMode: e });
|
|
218
219
|
return;
|
|
219
220
|
}
|
|
@@ -244,7 +245,7 @@ function U({ workspace: n, repository: a, teamName: s, children: l }) {
|
|
|
244
245
|
takeOver: !0
|
|
245
246
|
})
|
|
246
247
|
});
|
|
247
|
-
}, J = a.import, Y = J?.status, X =
|
|
248
|
+
}, J = a.import, Y = J?.status, X = V.isPending || W.isPending, Z = (e, t) => /* @__PURE__ */ D(p, {
|
|
248
249
|
size: "sm",
|
|
249
250
|
type: "button",
|
|
250
251
|
disabled: X,
|
|
@@ -274,7 +275,7 @@ function U({ workspace: n, repository: a, teamName: s, children: l }) {
|
|
|
274
275
|
disabled: B.isPending,
|
|
275
276
|
items: [
|
|
276
277
|
{
|
|
277
|
-
value:
|
|
278
|
+
value: H,
|
|
278
279
|
label: u("notSynced")
|
|
279
280
|
},
|
|
280
281
|
{
|
|
@@ -291,10 +292,10 @@ function U({ workspace: n, repository: a, teamName: s, children: l }) {
|
|
|
291
292
|
onValueChange: q,
|
|
292
293
|
width: "content"
|
|
293
294
|
}),
|
|
294
|
-
a.syncMode && (Y === "running" ? [Z(u("pauseImport"), () =>
|
|
295
|
+
a.syncMode && (Y === "running" ? [Z(u("pauseImport"), () => W.mutate("pause")), Z(u("cancelImport"), () => W.mutate("cancel"))] : Y === "paused" ? [Z(u("resumeImport"), () => W.mutate("resume")), Z(u("cancelImport"), () => W.mutate("cancel"))] : [Y === "failed" && Z(u("resumeImport"), () => W.mutate("resume")), Z(u(J ? "importAgain" : "import"), () => V.mutate())])
|
|
295
296
|
]
|
|
296
297
|
}),
|
|
297
|
-
a.syncMode && J && /* @__PURE__ */ D(
|
|
298
|
+
a.syncMode && J && /* @__PURE__ */ D(G, { progress: J }),
|
|
298
299
|
a.syncMode && !J && /* @__PURE__ */ D("p", {
|
|
299
300
|
className: "mt-1 text-xs text-muted-foreground",
|
|
300
301
|
children: u("importHint")
|
|
@@ -321,7 +322,7 @@ function U({ workspace: n, repository: a, teamName: s, children: l }) {
|
|
|
321
322
|
y
|
|
322
323
|
] });
|
|
323
324
|
}
|
|
324
|
-
function
|
|
325
|
+
function G({ progress: e }) {
|
|
325
326
|
let t = T("github.importStatus"), n = C(), r = w(), { status: i, processed: a, skipped: o, total: s, retrying: c } = e;
|
|
326
327
|
if (i === "running" || i === "paused") return /* @__PURE__ */ O("div", {
|
|
327
328
|
role: "status",
|
|
@@ -367,7 +368,7 @@ function W({ progress: e }) {
|
|
|
367
368
|
children: t(i === "failed" ? "failed" : i === "canceled" ? "canceled" : "done", l)
|
|
368
369
|
});
|
|
369
370
|
}
|
|
370
|
-
function
|
|
371
|
+
function K({ source: e, link: t }) {
|
|
371
372
|
let n = T("issue.comments");
|
|
372
373
|
return /* @__PURE__ */ O("header", {
|
|
373
374
|
className: "flex flex-wrap items-center gap-x-3 gap-y-0.5 rounded-t-lg border-b border-primary/20 bg-primary/5 px-3 py-2 text-xs",
|
|
@@ -375,7 +376,7 @@ function G({ source: e, link: t }) {
|
|
|
375
376
|
className: "font-medium",
|
|
376
377
|
children: t ? n.rich("sharedThread", {
|
|
377
378
|
source: e,
|
|
378
|
-
name:
|
|
379
|
+
name: Z(t.url),
|
|
379
380
|
link: (e) => /* @__PURE__ */ D("a", {
|
|
380
381
|
href: t.url,
|
|
381
382
|
target: "_blank",
|
|
@@ -390,7 +391,7 @@ function G({ source: e, link: t }) {
|
|
|
390
391
|
})]
|
|
391
392
|
});
|
|
392
393
|
}
|
|
393
|
-
function
|
|
394
|
+
function q({ links: e }) {
|
|
394
395
|
return /* @__PURE__ */ D("ul", {
|
|
395
396
|
className: "space-y-1 px-2 text-sm",
|
|
396
397
|
children: e.map((e) => /* @__PURE__ */ D("li", { children: /* @__PURE__ */ O("a", {
|
|
@@ -398,20 +399,20 @@ function K({ links: e }) {
|
|
|
398
399
|
target: "_blank",
|
|
399
400
|
rel: "noreferrer",
|
|
400
401
|
className: "flex min-w-0 items-center gap-1.5 text-muted-foreground hover:text-foreground hover:underline",
|
|
401
|
-
children: [
|
|
402
|
+
children: [J.has(e.connector) && /* @__PURE__ */ D(l, {
|
|
402
403
|
provider: e.connector,
|
|
403
404
|
className: "size-3.5"
|
|
404
405
|
}), /* @__PURE__ */ D("span", {
|
|
405
406
|
className: "truncate",
|
|
406
|
-
children:
|
|
407
|
+
children: Z(e.url)
|
|
407
408
|
})]
|
|
408
409
|
}) }, `${e.connector}:${e.externalId}`))
|
|
409
410
|
});
|
|
410
411
|
}
|
|
411
|
-
var
|
|
412
|
-
function
|
|
412
|
+
var J = /* @__PURE__ */ new Set(["github", "gitlab"]);
|
|
413
|
+
function Y({ links: e }) {
|
|
413
414
|
let t = T("code");
|
|
414
|
-
return e.filter((e) =>
|
|
415
|
+
return e.filter((e) => J.has(e.connector)).map((e) => /* @__PURE__ */ D(y, {
|
|
415
416
|
content: t("openOnHost"),
|
|
416
417
|
children: /* @__PURE__ */ O("a", {
|
|
417
418
|
href: e.url,
|
|
@@ -423,12 +424,35 @@ function J({ links: e }) {
|
|
|
423
424
|
className: "size-3.5"
|
|
424
425
|
}), /* @__PURE__ */ D("span", {
|
|
425
426
|
className: "truncate",
|
|
426
|
-
children:
|
|
427
|
+
children: Z(e.url)
|
|
427
428
|
})]
|
|
428
429
|
})
|
|
429
430
|
}, e.externalId));
|
|
430
431
|
}
|
|
431
|
-
function
|
|
432
|
+
function X({ links: e }) {
|
|
433
|
+
let t = T("code"), n = e.filter((e) => J.has(e.connector));
|
|
434
|
+
return n.length === 0 ? null : /* @__PURE__ */ D("div", {
|
|
435
|
+
className: "mb-4 space-y-2",
|
|
436
|
+
children: n.map((e) => /* @__PURE__ */ O("a", {
|
|
437
|
+
href: e.url,
|
|
438
|
+
target: "_blank",
|
|
439
|
+
rel: "noreferrer",
|
|
440
|
+
className: "flex items-center gap-2 rounded-lg border border-border px-3 py-2 text-sm hover:bg-muted",
|
|
441
|
+
children: [
|
|
442
|
+
/* @__PURE__ */ D(l, {
|
|
443
|
+
provider: e.connector,
|
|
444
|
+
className: "size-4 shrink-0"
|
|
445
|
+
}),
|
|
446
|
+
/* @__PURE__ */ D("span", {
|
|
447
|
+
className: "min-w-0 flex-1 truncate",
|
|
448
|
+
children: t("syncedIssue", { name: Z(e.url) })
|
|
449
|
+
}),
|
|
450
|
+
/* @__PURE__ */ D(N, { className: "size-3.5 shrink-0 text-muted-foreground" })
|
|
451
|
+
]
|
|
452
|
+
}, e.externalId))
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
function Z(e) {
|
|
432
456
|
try {
|
|
433
457
|
let t = new URL(e), n = t.pathname.match(/^\/(.+?)\/-\/(issues|merge_requests)\/(\d+)/);
|
|
434
458
|
if (n) return `${n[1]}${n[2] === "issues" ? "#" : "!"}${n[3]}`;
|
|
@@ -438,4 +462,4 @@ function Y(e) {
|
|
|
438
462
|
return e;
|
|
439
463
|
}
|
|
440
464
|
}
|
|
441
|
-
export {
|
|
465
|
+
export { z as GitHubAccount, V as GitHubSettings, Y as IssueLinkChips, q as IssueLinks, X as IssueSyncCards, W as RepositoryIssueSync, K as SharedThreadHeader, Z as linkName };
|