@parallelworks/tandem-web 0.167.0 → 0.168.0

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.
@@ -1,145 +1,142 @@
1
- import { usePageTitle as e } from "../../../lib/pageTitle.js";
2
- import { Link as t } from "../../../lib/router.js";
3
- import { membersQuery as n, projectsQuery as r, teamMembersQuery as i, teamsQuery as a } from "../../../api/queries.js";
4
- import { MailIcon as o, UserIcon as s } from "../../../components/icons.js";
1
+ import { NotFound as e } from "../../../components/status.js";
2
+ import { usePageTitle as t } from "../../../lib/pageTitle.js";
3
+ import { Link as n } from "../../../lib/router.js";
4
+ import { membersQuery as r, projectsQuery as i, teamMembersQuery as a, teamsQuery as o } from "../../../api/queries.js";
5
+ import { MailIcon as s } from "../../../components/icons.js";
5
6
  import { projectRef as c } from "../../../lib/projects.js";
6
7
  import { EntityIcon as l } from "../../../components/EntityIcon.js";
7
8
  import { useRoleName as u } from "../../../lib/roles.js";
8
9
  import { Route as d } from "./_username.js";
9
10
  import { IssueList as f } from "../../../pages/issues.js";
10
11
  import { PersonActivity as p } from "../../../components/PersonActivity.js";
11
- import { Avatar as m, EmptyState as h, StatusBadge as g, Tabs as _ } from "@parallelworks/ui";
12
- import { useTranslations as v } from "use-intl";
13
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
14
- import { useQueries as x, useQuery as S, useSuspenseQuery as C } from "@tanstack/react-query";
12
+ import { Avatar as m, StatusBadge as h, Tabs as g } from "@parallelworks/ui";
13
+ import { useTranslations as _ } from "use-intl";
14
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
15
+ import { useQueries as b, useQuery as x, useSuspenseQuery as S } from "@tanstack/react-query";
15
16
  // src/routes/$workspace/people/$username.tsx?tsr-split=component
16
- function w() {
17
- let { workspace: t, username: r } = d.useParams(), { tab: i } = d.useSearch(), a = v("person"), c = u(t), { data: l } = C(n(t)), x = l.find((e) => e.user.username === r);
18
- if (e(x?.user.name ?? r), !x) return /* @__PURE__ */ y("div", {
19
- className: "flex h-full items-center justify-center p-6",
20
- children: /* @__PURE__ */ y(h, {
21
- icon: /* @__PURE__ */ y(s, {}),
22
- title: a("notFound"),
23
- description: a("notFoundDetail")
24
- })
17
+ function C() {
18
+ let { workspace: n, username: i } = d.useParams(), { tab: a } = d.useSearch(), o = _("person"), c = u(n), { data: l } = S(r(n)), b = l.find((e) => e.user.username === i);
19
+ if (t(b?.user.name ?? i), !b) return /* @__PURE__ */ v(e, {
20
+ title: o("notFound"),
21
+ description: o("notFoundDetail")
25
22
  });
26
- let { user: S } = x;
27
- return /* @__PURE__ */ b("div", {
23
+ let { user: x } = b;
24
+ return /* @__PURE__ */ y("div", {
28
25
  className: "flex h-full min-h-0 flex-col",
29
- children: [/* @__PURE__ */ b("section", {
30
- "aria-label": a("profile"),
26
+ children: [/* @__PURE__ */ y("section", {
27
+ "aria-label": o("profile"),
31
28
  className: "flex shrink-0 flex-wrap items-start gap-4 border-b border-border px-4 py-5 md:px-6",
32
- children: [/* @__PURE__ */ y(m, {
33
- name: S.name,
34
- src: S.avatarUrl,
29
+ children: [/* @__PURE__ */ v(m, {
30
+ name: x.name,
31
+ src: x.avatarUrl,
35
32
  size: "xl"
36
- }), /* @__PURE__ */ b("div", {
33
+ }), /* @__PURE__ */ y("div", {
37
34
  className: "min-w-0 flex-1 space-y-2",
38
35
  children: [
39
- /* @__PURE__ */ b("div", {
36
+ /* @__PURE__ */ y("div", {
40
37
  className: "flex flex-wrap items-center gap-2",
41
- children: [/* @__PURE__ */ y("h1", {
38
+ children: [/* @__PURE__ */ v("h1", {
42
39
  className: "truncate text-lg font-semibold tracking-tight",
43
- children: S.name
44
- }), /* @__PURE__ */ y(g, {
40
+ children: x.name
41
+ }), /* @__PURE__ */ v(h, {
45
42
  emphasis: "outline",
46
- children: c(x.role)
43
+ children: c(b.role)
47
44
  })]
48
45
  }),
49
- /* @__PURE__ */ b("p", {
46
+ /* @__PURE__ */ y("p", {
50
47
  className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-muted-foreground",
51
- children: [/* @__PURE__ */ y("span", { children: `@${S.username}` }), S.email && /* @__PURE__ */ b("a", {
52
- href: `mailto:${S.email}`,
48
+ children: [/* @__PURE__ */ v("span", { children: `@${x.username}` }), x.email && /* @__PURE__ */ y("a", {
49
+ href: `mailto:${x.email}`,
53
50
  className: "inline-flex items-center gap-1.5 hover:text-foreground",
54
- children: [/* @__PURE__ */ y(o, { className: "size-3.5" }), S.email]
51
+ children: [/* @__PURE__ */ v(s, { className: "size-3.5" }), x.email]
55
52
  })]
56
53
  }),
57
- /* @__PURE__ */ y(T, {
58
- workspace: t,
59
- username: r
54
+ /* @__PURE__ */ v(w, {
55
+ workspace: n,
56
+ username: i
60
57
  }),
61
- /* @__PURE__ */ y(_, {
58
+ /* @__PURE__ */ v(g, {
62
59
  variant: "segmented",
63
60
  size: "sm",
64
- label: a("sections"),
61
+ label: o("sections"),
65
62
  items: ["issues", "activity"].map((e) => ({
66
63
  value: e,
67
- label: a(`section.${e}`),
68
- href: `/${t}/people/${encodeURIComponent(r)}${e === "activity" ? "?tab=activity" : ""}`
64
+ label: o(`section.${e}`),
65
+ href: `/${n}/people/${encodeURIComponent(i)}${e === "activity" ? "?tab=activity" : ""}`
69
66
  })),
70
- value: i === "activity" ? "activity" : "issues"
67
+ value: a === "activity" ? "activity" : "issues"
71
68
  })
72
69
  ]
73
70
  })]
74
- }), /* @__PURE__ */ y("div", {
71
+ }), /* @__PURE__ */ v("div", {
75
72
  className: "min-h-0 flex-1 overflow-y-auto",
76
- children: i === "activity" ? /* @__PURE__ */ y(p, {
77
- workspace: t,
78
- username: r
79
- }) : /* @__PURE__ */ y(f, { person: r })
73
+ children: a === "activity" ? /* @__PURE__ */ v(p, {
74
+ workspace: n,
75
+ username: i
76
+ }) : /* @__PURE__ */ v(f, { person: i })
80
77
  })]
81
78
  });
82
79
  }
83
- function T({ workspace: e, username: n }) {
84
- let o = v("person"), { data: s = [] } = S(a(e)), { data: u = [] } = S(r(e)), d = s.filter((e) => !e.archivedAt), f = x({ queries: d.map((t) => i(e, t.key)) }), p = d.filter((e, t) => f[t]?.data?.includes(n)), m = (e) => e !== "completed" && e !== "canceled", h = u.filter((e) => m(e.status) && (e.lead === n || e.members.includes(n))), g = "inline-flex max-w-56 items-center gap-1.5 rounded-md border border-border px-2 py-0.5 text-xs hover:bg-muted";
85
- return /* @__PURE__ */ b("dl", {
80
+ function w({ workspace: e, username: t }) {
81
+ let r = _("person"), { data: s = [] } = x(o(e)), { data: u = [] } = x(i(e)), d = s.filter((e) => !e.archivedAt), f = b({ queries: d.map((t) => a(e, t.key)) }), p = d.filter((e, n) => f[n]?.data?.includes(t)), m = (e) => e !== "completed" && e !== "canceled", h = u.filter((e) => m(e.status) && (e.lead === t || e.members.includes(t))), g = "inline-flex max-w-56 items-center gap-1.5 rounded-md border border-border px-2 py-0.5 text-xs hover:bg-muted";
82
+ return /* @__PURE__ */ y("dl", {
86
83
  className: "space-y-1.5 text-xs",
87
- children: [p.length > 0 && /* @__PURE__ */ y(E, {
88
- label: o("teams"),
89
- children: p.map((n) => /* @__PURE__ */ b(t, {
84
+ children: [p.length > 0 && /* @__PURE__ */ v(T, {
85
+ label: r("teams"),
86
+ children: p.map((t) => /* @__PURE__ */ y(n, {
90
87
  to: "/$workspace/teams/$key/issues",
91
88
  params: {
92
89
  workspace: e,
93
- key: n.key
90
+ key: t.key
94
91
  },
95
92
  className: g,
96
- children: [/* @__PURE__ */ y(l, {
97
- icon: n.icon ?? "",
98
- name: n.name,
93
+ children: [/* @__PURE__ */ v(l, {
94
+ icon: t.icon ?? "",
95
+ name: t.name,
99
96
  className: "size-3.5"
100
- }), /* @__PURE__ */ y("span", {
97
+ }), /* @__PURE__ */ v("span", {
101
98
  className: "truncate",
102
- children: n.name
99
+ children: t.name
103
100
  })]
104
- }, n.id))
105
- }), h.length > 0 && /* @__PURE__ */ y(E, {
106
- label: o("projects"),
107
- children: h.map((r) => /* @__PURE__ */ b(t, {
101
+ }, t.id))
102
+ }), h.length > 0 && /* @__PURE__ */ v(T, {
103
+ label: r("projects"),
104
+ children: h.map((i) => /* @__PURE__ */ y(n, {
108
105
  to: "/$workspace/projects/$projectId",
109
106
  params: {
110
107
  workspace: e,
111
- projectId: c(r)
108
+ projectId: c(i)
112
109
  },
113
110
  className: g,
114
111
  children: [
115
- /* @__PURE__ */ y(l, {
116
- icon: r.icon ?? "",
117
- name: r.name,
112
+ /* @__PURE__ */ v(l, {
113
+ icon: i.icon ?? "",
114
+ name: i.name,
118
115
  className: "size-3.5"
119
116
  }),
120
- /* @__PURE__ */ y("span", {
117
+ /* @__PURE__ */ v("span", {
121
118
  className: "truncate",
122
- children: r.name
119
+ children: i.name
123
120
  }),
124
- r.lead === n && /* @__PURE__ */ y("span", {
121
+ i.lead === t && /* @__PURE__ */ v("span", {
125
122
  className: "text-muted-foreground",
126
- children: o("lead")
123
+ children: r("lead")
127
124
  })
128
125
  ]
129
- }, r.id))
126
+ }, i.id))
130
127
  })]
131
128
  });
132
129
  }
133
- function E({ label: e, children: t }) {
134
- return /* @__PURE__ */ b("div", {
130
+ function T({ label: e, children: t }) {
131
+ return /* @__PURE__ */ y("div", {
135
132
  className: "flex flex-wrap items-center gap-1.5",
136
- children: [/* @__PURE__ */ y("dt", {
133
+ children: [/* @__PURE__ */ v("dt", {
137
134
  className: "w-20 shrink-0 text-muted-foreground",
138
135
  children: e
139
- }), /* @__PURE__ */ y("dd", {
136
+ }), /* @__PURE__ */ v("dd", {
140
137
  className: "flex min-w-0 flex-1 flex-wrap gap-1.5",
141
138
  children: t
142
139
  })]
143
140
  });
144
141
  }
145
- export { w as component };
142
+ export { C as component };
@@ -1,30 +1,31 @@
1
1
  import { api as e, unwrap as t } from "../../../api/client.js";
2
- import { usePageTitle as n } from "../../../lib/pageTitle.js";
3
- import { useNavigate as r } from "../../../lib/router.js";
4
- import { issuesQuery as i, projectQuery as a } from "../../../api/queries.js";
5
- import { invalidateIssueViews as o } from "../../../api/mutations.js";
6
- import { copyItem as s } from "../../../lib/menus.js";
7
- import { useTime as c } from "../../../lib/time.js";
8
- import { ProgressBar as l } from "../../../components/Planning.js";
9
- import { projectRef as u } from "../../../lib/projects.js";
10
- import { useCan as d } from "../../../lib/roles.js";
11
- import { useConfirm as f } from "../../../lib/confirm.js";
12
- import { Editor as p } from "../../../components/Editor.js";
13
- import { Route as m } from "./_projectId_.milestones._milestoneId.js";
14
- import { StatusGroups as ee } from "../../../components/IssueGroup.js";
15
- import { projectIssues as te } from "./_projectId_2.milestones._milestoneId.js";
16
- import { Card as h, DatePicker as g, EmptyState as _, ErrorText as v, Input as y, PageHeader as b, menuDivider as x } from "@parallelworks/ui";
17
- import { useState as S } from "react";
18
- import { useErrorMessage as ne } from "@parallelworks/problem/react";
2
+ import { NotFound as n } from "../../../components/status.js";
3
+ import { usePageTitle as r } from "../../../lib/pageTitle.js";
4
+ import { useNavigate as i } from "../../../lib/router.js";
5
+ import { issuesQuery as a, projectQuery as o } from "../../../api/queries.js";
6
+ import { invalidateIssueViews as s } from "../../../api/mutations.js";
7
+ import { copyItem as c } from "../../../lib/menus.js";
8
+ import { useTime as l } from "../../../lib/time.js";
9
+ import { ProgressBar as u } from "../../../components/Planning.js";
10
+ import { projectRef as d } from "../../../lib/projects.js";
11
+ import { useCan as f } from "../../../lib/roles.js";
12
+ import { useConfirm as p } from "../../../lib/confirm.js";
13
+ import { Editor as m } from "../../../components/Editor.js";
14
+ import { Route as h } from "./_projectId_.milestones._milestoneId.js";
15
+ import { StatusGroups as g } from "../../../components/IssueGroup.js";
16
+ import { projectIssues as _ } from "./_projectId_2.milestones._milestoneId.js";
17
+ import { Card as v, DatePicker as y, EmptyState as b, ErrorText as ee, Input as x, PageHeader as S, menuDivider as te } from "@parallelworks/ui";
18
+ import { useState as ne } from "react";
19
+ import { useErrorMessage as re } from "@parallelworks/problem/react";
19
20
  import { useTranslations as C } from "use-intl";
20
21
  import { jsx as w, jsxs as T } from "react/jsx-runtime";
21
22
  import { useMutation as E, useQueryClient as D, useSuspenseQuery as O } from "@tanstack/react-query";
22
23
  import { MoreButton as k } from "@parallelworks/ui/list";
23
24
  // src/routes/$workspace/projects/$projectId_.milestones.$milestoneId.tsx?tsr-split=component
24
25
  function A() {
25
- let { workspace: A, projectId: j, milestoneId: M } = m.useParams(), N = C("planning"), P = C("common"), F = ne(), I = c(), L = r(), R = D(), { confirm: z, dialog: B } = f(), { data: V } = O(a(A, j)), { data: H } = O(i(A, te(V.id))), U = V.milestones.find((e) => e.id === M);
26
- n(U?.name, V.name);
27
- let W = d(A, "manage_projects", { project: V.id }), [G, K] = S(!1), q = `/${A}/projects/${u(V)}`, J = {
26
+ let { workspace: A, projectId: j, milestoneId: M } = h.useParams(), N = C("planning"), P = C("common"), F = re(), I = l(), L = i(), R = D(), { confirm: z, dialog: B } = p(), { data: V } = O(o(A, j)), { data: H } = O(a(A, _(V.id))), U = V.milestones.find((e) => e.id === M);
27
+ r(U?.name, V.name);
28
+ let W = f(A, "manage_projects", { project: V.id }), [G, K] = ne(!1), q = `/${A}/projects/${d(V)}`, J = {
28
29
  workspace: A,
29
30
  projectId: V.id,
30
31
  milestoneId: M
@@ -33,7 +34,7 @@ function A() {
33
34
  "workspace",
34
35
  A,
35
36
  "projects"
36
- ] }), o(R, A);
37
+ ] }), s(R, A);
37
38
  }, X = E({
38
39
  mutationFn: async (n) => t(await e.PATCH("/api/v1/workspaces/{workspace}/projects/{projectId}/milestones/{milestoneId}", {
39
40
  params: { path: J },
@@ -47,7 +48,7 @@ function A() {
47
48
  });
48
49
  if (!U) return /* @__PURE__ */ T("div", {
49
50
  className: "flex h-full min-h-0 flex-col",
50
- children: [/* @__PURE__ */ w(b, {
51
+ children: [/* @__PURE__ */ w(S, {
51
52
  heading: !1,
52
53
  breadcrumbs: [{
53
54
  label: N("projects"),
@@ -56,17 +57,17 @@ function A() {
56
57
  label: V.name,
57
58
  href: q
58
59
  }]
59
- }), /* @__PURE__ */ w(_, {
60
- title: N("milestoneGone"),
61
- className: "mt-10"
60
+ }), /* @__PURE__ */ w(n, {
61
+ title: N("noSuchMilestone"),
62
+ description: N("milestoneGone")
62
63
  })]
63
64
  });
64
- let Q = H.issues.filter((e) => e.milestone?.id === U.id), re = W ? [
65
+ let Q = H.issues.filter((e) => e.milestone?.id === U.id), ie = W ? [
65
66
  {
66
67
  label: N("rename"),
67
68
  onClick: () => K(!0)
68
69
  },
69
- x,
70
+ te,
70
71
  {
71
72
  label: N("deleteMilestone"),
72
73
  destructive: !0,
@@ -77,11 +78,11 @@ function A() {
77
78
  onConfirm: () => Z.mutateAsync()
78
79
  })
79
80
  }
80
- ] : [s(P("copyName"), U.name)], $ = X.error ?? Z.error;
81
+ ] : [c(P("copyName"), U.name)], $ = X.error ?? Z.error;
81
82
  return /* @__PURE__ */ T("div", {
82
83
  className: "flex h-full min-h-0 flex-col",
83
84
  children: [
84
- /* @__PURE__ */ w(b, {
85
+ /* @__PURE__ */ w(S, {
85
86
  heading: !1,
86
87
  breadcrumbs: [
87
88
  {
@@ -95,7 +96,7 @@ function A() {
95
96
  { label: U.name }
96
97
  ],
97
98
  titleActions: /* @__PURE__ */ w(k, {
98
- items: () => re,
99
+ items: () => ie,
99
100
  label: P("moreActionsFor", { name: U.name }),
100
101
  visible: !0
101
102
  })
@@ -105,7 +106,7 @@ function A() {
105
106
  children: /* @__PURE__ */ T("div", {
106
107
  className: "mx-auto max-w-4xl",
107
108
  children: [
108
- G ? /* @__PURE__ */ w(y, {
109
+ G ? /* @__PURE__ */ w(x, {
109
110
  autoFocus: !0,
110
111
  defaultValue: U.name,
111
112
  "aria-label": N("milestoneName"),
@@ -123,7 +124,7 @@ function A() {
123
124
  }),
124
125
  /* @__PURE__ */ T("div", {
125
126
  className: "mt-3 flex flex-wrap items-center gap-x-6 gap-y-3",
126
- children: [W ? /* @__PURE__ */ w(g, {
127
+ children: [W ? /* @__PURE__ */ w(y, {
127
128
  value: U.targetDate ?? "",
128
129
  onValueChange: (e) => X.mutate({ targetDate: e }),
129
130
  "aria-label": N("targetDate"),
@@ -134,10 +135,10 @@ function A() {
134
135
  children: U.targetDate ? I.day(U.targetDate) : N("noTargetDate")
135
136
  }), /* @__PURE__ */ w("span", {
136
137
  className: "w-56 max-w-full",
137
- children: /* @__PURE__ */ w(l, { progress: U.progress })
138
+ children: /* @__PURE__ */ w(u, { progress: U.progress })
138
139
  })]
139
140
  }),
140
- $ && /* @__PURE__ */ w(v, {
141
+ $ && /* @__PURE__ */ w(ee, {
141
142
  size: "md",
142
143
  className: "mt-2",
143
144
  children: F($)
@@ -147,11 +148,11 @@ function A() {
147
148
  children: [/* @__PURE__ */ w("h2", {
148
149
  className: "text-base font-semibold",
149
150
  children: P("description")
150
- }), /* @__PURE__ */ w(h, {
151
+ }), /* @__PURE__ */ w(v, {
151
152
  size: "fill",
152
153
  padding: "sm",
153
154
  className: "mt-2 min-h-16",
154
- children: /* @__PURE__ */ w(p, {
155
+ children: /* @__PURE__ */ w(m, {
155
156
  value: U.description,
156
157
  editable: W,
157
158
  placeholder: N("addDescription"),
@@ -169,10 +170,10 @@ function A() {
169
170
  children: N("issues")
170
171
  }), /* @__PURE__ */ w("div", {
171
172
  className: "mt-2",
172
- children: Q.length === 0 ? /* @__PURE__ */ w(_, {
173
+ children: Q.length === 0 ? /* @__PURE__ */ w(b, {
173
174
  variant: "bare",
174
175
  title: N("noIssuesInMilestone")
175
- }) : /* @__PURE__ */ w(ee, {
176
+ }) : /* @__PURE__ */ w(g, {
176
177
  workspace: A,
177
178
  issues: Q
178
179
  })