@parallelworks/tandem-web 0.186.0 → 0.186.1

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.
@@ -3367,7 +3367,7 @@ var e = {
3367
3367
  statusRules: {
3368
3368
  title: "Status rules",
3369
3369
  description: "Who may move issues between statuses, and what an issue needs before entering one. With none, anyone who can edit moves anything. Moves GitHub or Tandem make on their own, such as closing an issue when its pull request merges, aren't held to them.",
3370
- moves: "Moves",
3370
+ movesTitle: "Who can move issues",
3371
3371
  movesHelp: "Choose whose moves to set.",
3372
3372
  role: "Role",
3373
3373
  roles: {
@@ -3379,13 +3379,21 @@ var e = {
3379
3379
  limitHelp: "Off, they move any issue anywhere. On, they make only the moves ticked below.",
3380
3380
  fromTo: "From \\ To",
3381
3381
  move: "From {from} to {to}",
3382
- needs: "Before {status}",
3383
- needsHelp: "What an issue needs before it moves here, or is made here.",
3382
+ status: "Status",
3383
+ needsTitle: "What an issue needs",
3384
+ needsIntro: "What an issue needs before it moves to, or is created in, a status.",
3385
+ need: "{field} before {status}",
3384
3386
  fields: {
3385
3387
  assignee: "Assignee",
3386
3388
  estimate: "Estimate",
3387
3389
  pullRequest: "Pull request",
3388
3390
  comment: "Comment"
3391
+ },
3392
+ fieldHelp: {
3393
+ assignee: "Someone is assigned to it.",
3394
+ estimate: "It has an estimate above zero.",
3395
+ pullRequest: "A pull request is linked to it.",
3396
+ comment: "It has at least one comment."
3389
3397
  }
3390
3398
  },
3391
3399
  customerRequests: {
@@ -3367,7 +3367,7 @@ var e = {
3367
3367
  statusRules: {
3368
3368
  title: "Reglas de estado",
3369
3369
  description: "Quién puede mover incidencias entre estados y qué necesita una incidencia antes de entrar en uno. Sin reglas, cualquiera que pueda editar mueve cualquier cosa. Los movimientos que GitHub o Tandem hacen por su cuenta, como cerrar una incidencia cuando se fusiona su pull request, no se rigen por ellas.",
3370
- moves: "Movimientos",
3370
+ movesTitle: "Quién puede mover incidencias",
3371
3371
  movesHelp: "Elige de quién son los movimientos a configurar.",
3372
3372
  role: "Rol",
3373
3373
  roles: {
@@ -3379,13 +3379,21 @@ var e = {
3379
3379
  limitHelp: "Desactivado, mueven cualquier incidencia a cualquier estado. Activado, solo hacen los movimientos marcados abajo.",
3380
3380
  fromTo: "De \\ A",
3381
3381
  move: "De {from} a {to}",
3382
- needs: "Antes de {status}",
3383
- needsHelp: "Lo que necesita una incidencia antes de moverse aquí o crearse aquí.",
3382
+ status: "Estado",
3383
+ needsTitle: "Lo que necesita una incidencia",
3384
+ needsIntro: "Lo que necesita una incidencia antes de pasar a un estado o de crearse en él.",
3385
+ need: "{field} antes de {status}",
3384
3386
  fields: {
3385
3387
  assignee: "Responsable",
3386
3388
  estimate: "Estimación",
3387
3389
  pullRequest: "Pull request",
3388
3390
  comment: "Comentario"
3391
+ },
3392
+ fieldHelp: {
3393
+ assignee: "Tiene a alguien asignado.",
3394
+ estimate: "Tiene una estimación mayor que cero.",
3395
+ pullRequest: "Tiene una pull request vinculada.",
3396
+ comment: "Tiene al menos un comentario."
3389
3397
  }
3390
3398
  },
3391
3399
  customerRequests: {
@@ -3367,7 +3367,7 @@ var e = {
3367
3367
  statusRules: {
3368
3368
  title: "ステータスのルール",
3369
3369
  description: "課題をステータス間で移動できる人と、ステータスに入る前に課題に必要なものを決めます。ルールがなければ、編集できる人は誰でも何でも移動できます。プルリクエストのマージで課題を閉じるなど、GitHub や Tandem が自動で行う移動には適用されません。",
3370
- moves: "移動",
3370
+ movesTitle: "課題を移動できる人",
3371
3371
  movesHelp: "設定する対象を選びます。",
3372
3372
  role: "役割",
3373
3373
  roles: {
@@ -3379,13 +3379,21 @@ var e = {
3379
3379
  limitHelp: "オフでは、どの課題もどこにでも移動できます。オンでは、下でチェックした移動だけができます。",
3380
3380
  fromTo: "移動元 \\ 移動先",
3381
3381
  move: "{from} から {to} へ",
3382
- needs: "{status} の前に",
3383
- needsHelp: "課題がここに移動する前、またはここで作成される前に必要なもの。",
3382
+ status: "ステータス",
3383
+ needsTitle: "課題に必要なもの",
3384
+ needsIntro: "課題がステータスに移る前、またはそのステータスで作成される前に必要なもの。",
3385
+ need: "{status} の前に {field}",
3384
3386
  fields: {
3385
3387
  assignee: "担当者",
3386
3388
  estimate: "見積もり",
3387
3389
  pullRequest: "プルリクエスト",
3388
3390
  comment: "コメント"
3391
+ },
3392
+ fieldHelp: {
3393
+ assignee: "担当者が割り当てられている。",
3394
+ estimate: "0 より大きい見積もりがある。",
3395
+ pullRequest: "プルリクエストがリンクされている。",
3396
+ comment: "コメントが 1 件以上ある。"
3389
3397
  }
3390
3398
  },
3391
3399
  customerRequests: {
@@ -3367,7 +3367,7 @@ var e = {
3367
3367
  statusRules: {
3368
3368
  title: "상태 규칙",
3369
3369
  description: "누가 이슈를 상태 사이에서 옮길 수 있는지, 그리고 이슈가 어떤 상태에 들어가기 전에 무엇이 필요한지 정합니다. 규칙이 없으면 편집할 수 있는 사람은 누구나 무엇이든 옮깁니다. 풀 리퀘스트가 병합될 때 이슈를 닫는 것처럼 GitHub이나 Tandem이 스스로 하는 이동에는 적용되지 않습니다.",
3370
- moves: "이동",
3370
+ movesTitle: "이슈를 옮길 수 있는 사람",
3371
3371
  movesHelp: "설정할 대상을 고르세요.",
3372
3372
  role: "역할",
3373
3373
  roles: {
@@ -3379,13 +3379,21 @@ var e = {
3379
3379
  limitHelp: "끄면 어떤 이슈든 어디로든 옮깁니다. 켜면 아래에서 선택한 이동만 할 수 있습니다.",
3380
3380
  fromTo: "출발 \\ 도착",
3381
3381
  move: "{from}에서 {to}(으)로",
3382
- needs: "{status} 전에",
3383
- needsHelp: "이슈가 여기로 옮겨지거나 여기서 만들어지기 전에 필요한 것.",
3382
+ status: "상태",
3383
+ needsTitle: "이슈에 필요한 것",
3384
+ needsIntro: "이슈가 상태로 옮겨지거나 그 상태로 만들어지기 전에 필요한 것.",
3385
+ need: "{status} 전에 {field}",
3384
3386
  fields: {
3385
3387
  assignee: "담당자",
3386
3388
  estimate: "추정치",
3387
3389
  pullRequest: "풀 리퀘스트",
3388
3390
  comment: "댓글"
3391
+ },
3392
+ fieldHelp: {
3393
+ assignee: "담당자가 지정되어 있습니다.",
3394
+ estimate: "0보다 큰 추정치가 있습니다.",
3395
+ pullRequest: "풀 리퀘스트가 연결되어 있습니다.",
3396
+ comment: "댓글이 하나 이상 있습니다."
3389
3397
  }
3390
3398
  },
3391
3399
  customerRequests: {
@@ -3367,7 +3367,7 @@ var e = {
3367
3367
  statusRules: {
3368
3368
  title: "状态规则",
3369
3369
  description: "谁可以在状态之间移动问题,以及问题进入某个状态前需要什么。没有规则时,能编辑的人可以随意移动。GitHub 或 Tandem 自动进行的移动(例如拉取请求合并时关闭问题)不受这些规则约束。",
3370
- moves: "移动",
3370
+ movesTitle: "谁可以移动议题",
3371
3371
  movesHelp: "选择要设置谁的移动。",
3372
3372
  role: "角色",
3373
3373
  roles: {
@@ -3379,13 +3379,21 @@ var e = {
3379
3379
  limitHelp: "关闭时,可以把任何问题移到任何状态。开启时,只能进行下面勾选的移动。",
3380
3380
  fromTo: "从 \\ 到",
3381
3381
  move: "从 {from} 到 {to}",
3382
- needs: "进入 {status} 之前",
3383
- needsHelp: "问题移到这里或在这里创建之前需要的内容。",
3382
+ status: "状态",
3383
+ needsTitle: "议题需要什么",
3384
+ needsIntro: "议题在移入某个状态或在该状态中创建之前需要什么。",
3385
+ need: "{status} 之前需要{field}",
3384
3386
  fields: {
3385
3387
  assignee: "负责人",
3386
3388
  estimate: "估算",
3387
3389
  pullRequest: "拉取请求",
3388
3390
  comment: "评论"
3391
+ },
3392
+ fieldHelp: {
3393
+ assignee: "已指派给某人。",
3394
+ estimate: "有大于零的估算。",
3395
+ pullRequest: "已关联拉取请求。",
3396
+ comment: "至少有一条评论。"
3389
3397
  }
3390
3398
  },
3391
3399
  customerRequests: {
@@ -1,134 +1,168 @@
1
1
  import { api as e, unwrap as t } from "../api/client.js";
2
2
  import { statusesQuery as n, teamsQuery as r } from "../api/queries.js";
3
- import { Checkbox as i, ErrorText as a, SegmentedControl as o, SettingRow as s, SettingsCard as c, Switch as l } from "@parallelworks/ui";
4
- import { useState as u } from "react";
5
- import { useErrorMessage as d } from "@parallelworks/problem/react";
6
- import { useTranslations as f } from "use-intl";
7
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
8
- import { useMutation as h, useQueryClient as g, useSuspenseQuery as _ } from "@tanstack/react-query";
3
+ import { StatusIcon as i } from "./icons.js";
4
+ import { Checkbox as a, ErrorText as o, InfoTip as s, SegmentedControl as c, SettingRow as l, SettingsCard as u, Switch as d, Table as f } from "@parallelworks/ui";
5
+ import { useState as p } from "react";
6
+ import { useErrorMessage as m } from "@parallelworks/problem/react";
7
+ import { useTranslations as h } from "use-intl";
8
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
9
+ import { useMutation as v, useQueryClient as y, useSuspenseQuery as b } from "@tanstack/react-query";
9
10
  // src/components/StatusRules.tsx
10
- var v = [
11
+ var x = [
11
12
  "member",
12
13
  "agent",
13
14
  "admin"
14
- ], y = [
15
+ ], S = [
15
16
  "assignee",
16
17
  "estimate",
17
18
  "pullRequest",
18
19
  "comment"
19
20
  ];
20
- function b({ workspace: b, team: x, isAdmin: S }) {
21
- let C = f("statusRules"), w = d(), T = g(), { data: E } = _(n(b, x.key)), [D, O] = u("member"), k = x.statusRules, A = h({
21
+ function C({ status: e }) {
22
+ return /* @__PURE__ */ _("span", {
23
+ className: "inline-flex items-center gap-1.5 whitespace-nowrap",
24
+ children: [/* @__PURE__ */ g(i, {
25
+ category: e.category,
26
+ review: e.review,
27
+ step: e.step
28
+ }), e.name]
29
+ });
30
+ }
31
+ function w({ workspace: i, team: w, isAdmin: T }) {
32
+ let E = h("statusRules"), D = m(), O = y(), { data: k } = b(n(i, w.key)), [A, j] = p("member"), M = w.statusRules, N = v({
22
33
  mutationFn: async (n) => t(await e.PATCH("/api/v1/workspaces/{workspace}/teams/{key}", {
23
34
  params: { path: {
24
- workspace: b,
25
- key: x.key
35
+ workspace: i,
36
+ key: w.key
26
37
  } },
27
38
  body: { statusRules: n }
28
39
  })),
29
- onMutate: (e) => T.setQueryData(r(b).queryKey, (t) => t?.map((t) => t.id === x.id ? {
40
+ onMutate: (e) => O.setQueryData(r(i).queryKey, (t) => t?.map((t) => t.id === w.id ? {
30
41
  ...t,
31
42
  statusRules: e
32
43
  } : t)),
33
- onSettled: () => T.invalidateQueries({ queryKey: r(b).queryKey })
34
- }), j = k.moves.find((e) => e.role === D), M = (e) => A.mutate({
35
- ...k,
36
- moves: [...k.moves.filter((e) => e.role !== D), ...e ? [{
37
- role: D,
44
+ onSettled: () => O.invalidateQueries({ queryKey: r(i).queryKey })
45
+ }), P = M.moves.find((e) => e.role === A), F = (e) => N.mutate({
46
+ ...M,
47
+ moves: [...M.moves.filter((e) => e.role !== A), ...e ? [{
48
+ role: A,
38
49
  moves: e
39
50
  }] : []]
40
- }), N = (e, t) => !j || j.moves.some((n) => n.from === e && n.to === t), P = (e, t, n) => M(n ? [...j?.moves ?? [], {
51
+ }), I = (e, t) => !P || P.moves.some((n) => n.from === e && n.to === t), L = (e, t, n) => F(n ? [...P?.moves ?? [], {
41
52
  from: e,
42
53
  to: t
43
- }] : (j?.moves ?? []).filter((n) => n.from !== e || n.to !== t)), F = (e) => k.requires.find((t) => t.statusId === e)?.fields ?? [], I = (e, t, n) => {
44
- let r = n ? [...F(e), t] : F(e).filter((e) => e !== t);
45
- A.mutate({
46
- ...k,
47
- requires: [...k.requires.filter((t) => t.statusId !== e), ...r.length > 0 ? [{
54
+ }] : (P?.moves ?? []).filter((n) => n.from !== e || n.to !== t)), R = (e) => M.requires.find((t) => t.statusId === e)?.fields ?? [], z = (e, t, n) => {
55
+ let r = n ? [...R(e), t] : R(e).filter((e) => e !== t);
56
+ N.mutate({
57
+ ...M,
58
+ requires: [...M.requires.filter((t) => t.statusId !== e), ...r.length > 0 ? [{
48
59
  statusId: e,
49
60
  fields: r
50
61
  }] : []]
51
62
  });
52
- }, L = !S;
53
- return /* @__PURE__ */ m(c, {
54
- title: C("title"),
55
- description: C("description"),
63
+ }, B = !T;
64
+ return /* @__PURE__ */ _(u, {
65
+ title: E("title"),
66
+ description: E("description"),
56
67
  children: [
57
- /* @__PURE__ */ p(s, {
58
- label: C("moves"),
59
- helpText: C("movesHelp"),
60
- children: /* @__PURE__ */ p(o, {
61
- label: C("role"),
68
+ /* @__PURE__ */ _("section", {
69
+ "aria-labelledby": "status-needs",
70
+ className: "space-y-2 px-4 py-3",
71
+ children: [
72
+ /* @__PURE__ */ g("h3", {
73
+ id: "status-needs",
74
+ className: "text-sm font-medium",
75
+ children: E("needsTitle")
76
+ }),
77
+ /* @__PURE__ */ g("p", {
78
+ className: "text-xs text-muted-foreground",
79
+ children: E("needsIntro")
80
+ }),
81
+ /* @__PURE__ */ _(f, {
82
+ rounded: !0,
83
+ caps: !1,
84
+ density: "compact",
85
+ children: [
86
+ /* @__PURE__ */ g(f.Header, { children: E("status") }),
87
+ S.map((e) => /* @__PURE__ */ g(f.Header, {
88
+ className: "text-center",
89
+ children: /* @__PURE__ */ _("span", {
90
+ className: "inline-flex items-center justify-center gap-1 whitespace-nowrap",
91
+ children: [E(`fields.${e}`), /* @__PURE__ */ g(s, { text: E(`fieldHelp.${e}`) })]
92
+ })
93
+ }, e)),
94
+ k.map((e) => /* @__PURE__ */ _("tr", { children: [/* @__PURE__ */ g(f.Item, { children: /* @__PURE__ */ g(C, { status: e }) }), S.map((t) => /* @__PURE__ */ g(f.Item, { children: /* @__PURE__ */ g(a, {
95
+ className: "mx-auto",
96
+ "aria-label": E("need", {
97
+ field: E(`fields.${t}`),
98
+ status: e.name
99
+ }),
100
+ checked: R(e.id).includes(t),
101
+ disabled: B,
102
+ onCheckedChange: (n) => z(e.id, t, n)
103
+ }) }, t))] }, e.id))
104
+ ]
105
+ })
106
+ ]
107
+ }),
108
+ /* @__PURE__ */ g(l, {
109
+ label: E("movesTitle"),
110
+ helpText: E("movesHelp"),
111
+ children: /* @__PURE__ */ g(c, {
112
+ label: E("role"),
62
113
  size: "sm",
63
- value: D,
64
- onValueChange: O,
65
- options: v.map((e) => ({
114
+ value: A,
115
+ onValueChange: j,
116
+ options: x.map((e) => ({
66
117
  value: e,
67
- label: C(`roles.${e}`)
118
+ label: E(`roles.${e}`)
68
119
  }))
69
120
  })
70
121
  }),
71
- /* @__PURE__ */ p(s, {
72
- label: C("limit", { role: C(`roles.${D}`) }),
73
- helpText: C("limitHelp"),
74
- children: /* @__PURE__ */ p(l, {
75
- "aria-label": C("limit", { role: C(`roles.${D}`) }),
76
- checked: !!j,
77
- disabled: L,
78
- onCheckedChange: (e) => M(e ? E.flatMap((e) => E.filter((t) => t.id !== e.id).map((t) => ({
122
+ /* @__PURE__ */ g(l, {
123
+ label: E("limit", { role: E(`roles.${A}`) }),
124
+ helpText: E("limitHelp"),
125
+ children: /* @__PURE__ */ g(d, {
126
+ "aria-label": E("limit", { role: E(`roles.${A}`) }),
127
+ checked: !!P,
128
+ disabled: B,
129
+ onCheckedChange: (e) => F(e ? k.flatMap((e) => k.filter((t) => t.id !== e.id).map((t) => ({
79
130
  from: e.id,
80
131
  to: t.id
81
132
  }))) : null)
82
133
  })
83
134
  }),
84
- j && /* @__PURE__ */ p("div", {
85
- className: "overflow-x-auto px-4 py-3",
86
- children: /* @__PURE__ */ m("table", {
87
- className: "text-xs",
88
- children: [/* @__PURE__ */ p("thead", { children: /* @__PURE__ */ m("tr", { children: [/* @__PURE__ */ p("th", {
89
- className: "pr-3 pb-2 text-left font-medium text-muted-foreground",
90
- children: C("fromTo")
91
- }), E.map((e) => /* @__PURE__ */ p("th", {
92
- className: "px-2 pb-2 font-medium whitespace-nowrap",
93
- children: e.name
94
- }, e.id))] }) }), /* @__PURE__ */ p("tbody", { children: E.map((e) => /* @__PURE__ */ m("tr", { children: [/* @__PURE__ */ p("th", {
95
- className: "pr-3 py-1 text-left font-medium whitespace-nowrap",
96
- children: e.name
97
- }), E.map((t) => /* @__PURE__ */ p("td", {
98
- className: "px-2 py-1 text-center",
99
- children: e.id !== t.id && /* @__PURE__ */ p(i, {
100
- "aria-label": C("move", {
135
+ P && /* @__PURE__ */ g("div", {
136
+ className: "px-4 py-3",
137
+ children: /* @__PURE__ */ _(f, {
138
+ rounded: !0,
139
+ caps: !1,
140
+ density: "compact",
141
+ children: [
142
+ /* @__PURE__ */ g(f.Header, { children: E("fromTo") }),
143
+ k.map((e) => /* @__PURE__ */ g(f.Header, {
144
+ className: "text-center",
145
+ children: /* @__PURE__ */ g(C, { status: e })
146
+ }, e.id)),
147
+ k.map((e) => /* @__PURE__ */ _("tr", { children: [/* @__PURE__ */ g(f.Item, { children: /* @__PURE__ */ g(C, { status: e }) }), k.map((t) => /* @__PURE__ */ g(f.Item, { children: e.id !== t.id && /* @__PURE__ */ g(a, {
148
+ className: "mx-auto",
149
+ "aria-label": E("move", {
101
150
  from: e.name,
102
151
  to: t.name
103
152
  }),
104
- checked: N(e.id, t.id),
105
- disabled: L,
106
- onCheckedChange: (n) => P(e.id, t.id, n)
107
- })
108
- }, t.id))] }, e.id)) })]
153
+ checked: I(e.id, t.id),
154
+ disabled: B,
155
+ onCheckedChange: (n) => L(e.id, t.id, n)
156
+ }) }, t.id))] }, e.id))
157
+ ]
109
158
  })
110
159
  }),
111
- E.map((e) => /* @__PURE__ */ p(s, {
112
- label: C("needs", { status: e.name }),
113
- helpText: C("needsHelp"),
114
- children: /* @__PURE__ */ p("div", {
115
- className: "flex flex-wrap justify-end gap-x-4 gap-y-2",
116
- children: y.map((t) => /* @__PURE__ */ m("label", {
117
- className: "flex items-center gap-1.5 text-sm",
118
- children: [/* @__PURE__ */ p(i, {
119
- checked: F(e.id).includes(t),
120
- disabled: L,
121
- onCheckedChange: (n) => I(e.id, t, n)
122
- }), C(`fields.${t}`)]
123
- }, t))
124
- })
125
- }, e.id)),
126
- A.isError && /* @__PURE__ */ p(a, {
160
+ N.isError && /* @__PURE__ */ g(o, {
127
161
  size: "md",
128
162
  className: "px-4 pb-3",
129
- children: w(A.error)
163
+ children: D(N.error)
130
164
  })
131
165
  ]
132
166
  });
133
167
  }
134
- export { b as StatusRules };
168
+ export { w as StatusRules };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.186.0",
3
+ "version": "0.186.1",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",