@parallelworks/tandem-web 0.158.0 → 0.160.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.
@@ -0,0 +1,6 @@
1
+ import { createFileRoute as e, lazyFn as t, lazyRouteComponent as n } from "@tanstack/react-router";
2
+ var r = e("/$workspace/projects/$projectId_/milestones/$milestoneId")({
3
+ loader: t(() => import("./_projectId_4.milestones._milestoneId.js"), "loader"),
4
+ component: n(() => import("./_projectId_3.milestones._milestoneId.js"), "component")
5
+ });
6
+ export { r as Route };
@@ -0,0 +1,7 @@
1
+ // src/routes/$workspace/projects/$projectId_.milestones.$milestoneId.tsx?tsr-shared=1
2
+ var e = (e) => ({
3
+ project: e,
4
+ archived: "include",
5
+ subProjects: !0
6
+ });
7
+ export { e as projectIssues };
@@ -0,0 +1,188 @@
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";
19
+ import { useTranslations as C } from "use-intl";
20
+ import { jsx as w, jsxs as T } from "react/jsx-runtime";
21
+ import { useMutation as E, useQueryClient as D, useSuspenseQuery as O } from "@tanstack/react-query";
22
+ import { MoreButton as k } from "@parallelworks/ui/list";
23
+ // src/routes/$workspace/projects/$projectId_.milestones.$milestoneId.tsx?tsr-split=component
24
+ 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 = {
28
+ workspace: A,
29
+ projectId: V.id,
30
+ milestoneId: M
31
+ }, Y = () => {
32
+ R.invalidateQueries({ queryKey: [
33
+ "workspace",
34
+ A,
35
+ "projects"
36
+ ] }), o(R, A);
37
+ }, X = E({
38
+ mutationFn: async (n) => t(await e.PATCH("/api/v1/workspaces/{workspace}/projects/{projectId}/milestones/{milestoneId}", {
39
+ params: { path: J },
40
+ body: n
41
+ })),
42
+ onSettled: Y
43
+ }), Z = E({
44
+ mutationFn: async () => t(await e.DELETE("/api/v1/workspaces/{workspace}/projects/{projectId}/milestones/{milestoneId}", { params: { path: J } })),
45
+ onSuccess: () => L({ href: q }),
46
+ onSettled: Y
47
+ });
48
+ if (!U) return /* @__PURE__ */ T("div", {
49
+ className: "flex h-full min-h-0 flex-col",
50
+ children: [/* @__PURE__ */ w(b, {
51
+ heading: !1,
52
+ breadcrumbs: [{
53
+ label: N("projects"),
54
+ href: `/${A}/projects`
55
+ }, {
56
+ label: V.name,
57
+ href: q
58
+ }]
59
+ }), /* @__PURE__ */ w(_, {
60
+ title: N("milestoneGone"),
61
+ className: "mt-10"
62
+ })]
63
+ });
64
+ let Q = H.issues.filter((e) => e.milestone?.id === U.id), re = W ? [
65
+ {
66
+ label: N("rename"),
67
+ onClick: () => K(!0)
68
+ },
69
+ x,
70
+ {
71
+ label: N("deleteMilestone"),
72
+ destructive: !0,
73
+ onClick: () => z({
74
+ title: N("deleteMilestoneTitle", { name: U.name }),
75
+ description: N("deleteMilestoneDescription"),
76
+ confirmLabel: N("deleteMilestone"),
77
+ onConfirm: () => Z.mutateAsync()
78
+ })
79
+ }
80
+ ] : [s(P("copyName"), U.name)], $ = X.error ?? Z.error;
81
+ return /* @__PURE__ */ T("div", {
82
+ className: "flex h-full min-h-0 flex-col",
83
+ children: [
84
+ /* @__PURE__ */ w(b, {
85
+ heading: !1,
86
+ breadcrumbs: [
87
+ {
88
+ label: N("projects"),
89
+ href: `/${A}/projects`
90
+ },
91
+ {
92
+ label: V.name,
93
+ href: q
94
+ },
95
+ { label: U.name }
96
+ ],
97
+ titleActions: /* @__PURE__ */ w(k, {
98
+ items: () => re,
99
+ label: P("moreActionsFor", { name: U.name }),
100
+ visible: !0
101
+ })
102
+ }),
103
+ /* @__PURE__ */ w("div", {
104
+ className: "min-h-0 flex-1 overflow-y-auto px-4 py-6 md:px-8 md:py-8",
105
+ children: /* @__PURE__ */ T("div", {
106
+ className: "mx-auto max-w-4xl",
107
+ children: [
108
+ G ? /* @__PURE__ */ w(y, {
109
+ autoFocus: !0,
110
+ defaultValue: U.name,
111
+ "aria-label": N("milestoneName"),
112
+ onBlur: (e) => {
113
+ let t = e.target.value.trim();
114
+ t && t !== U.name && X.mutate({ name: t }), K(!1);
115
+ },
116
+ onKeyDown: (e) => {
117
+ e.key === "Enter" && e.currentTarget.blur(), e.key === "Escape" && K(!1);
118
+ },
119
+ className: "text-xl font-semibold"
120
+ }) : /* @__PURE__ */ w("h1", {
121
+ className: "text-xl font-semibold tracking-tight",
122
+ children: U.name
123
+ }),
124
+ /* @__PURE__ */ T("div", {
125
+ className: "mt-3 flex flex-wrap items-center gap-x-6 gap-y-3",
126
+ children: [W ? /* @__PURE__ */ w(g, {
127
+ value: U.targetDate ?? "",
128
+ onValueChange: (e) => X.mutate({ targetDate: e }),
129
+ "aria-label": N("targetDate"),
130
+ placeholder: N("targetDate"),
131
+ className: "w-auto"
132
+ }) : /* @__PURE__ */ w("span", {
133
+ className: "text-sm text-muted-foreground",
134
+ children: U.targetDate ? I.day(U.targetDate) : N("noTargetDate")
135
+ }), /* @__PURE__ */ w("span", {
136
+ className: "w-56 max-w-full",
137
+ children: /* @__PURE__ */ w(l, { progress: U.progress })
138
+ })]
139
+ }),
140
+ $ && /* @__PURE__ */ w(v, {
141
+ size: "md",
142
+ className: "mt-2",
143
+ children: F($)
144
+ }),
145
+ /* @__PURE__ */ T("section", {
146
+ className: "mt-8",
147
+ children: [/* @__PURE__ */ w("h2", {
148
+ className: "text-base font-semibold",
149
+ children: P("description")
150
+ }), /* @__PURE__ */ w(h, {
151
+ size: "fill",
152
+ padding: "sm",
153
+ className: "mt-2 min-h-16",
154
+ children: /* @__PURE__ */ w(p, {
155
+ value: U.description,
156
+ editable: W,
157
+ placeholder: N("addDescription"),
158
+ label: P("description"),
159
+ onBlur: (e) => e !== U.description && X.mutate({ description: e }),
160
+ className: "min-h-12"
161
+ }, U.description)
162
+ })]
163
+ }),
164
+ /* @__PURE__ */ T("section", {
165
+ className: "mt-8",
166
+ "aria-label": N("issues"),
167
+ children: [/* @__PURE__ */ w("h2", {
168
+ className: "text-base font-semibold",
169
+ children: N("issues")
170
+ }), /* @__PURE__ */ w("div", {
171
+ className: "mt-2",
172
+ children: Q.length === 0 ? /* @__PURE__ */ w(_, {
173
+ variant: "bare",
174
+ title: N("noIssuesInMilestone")
175
+ }) : /* @__PURE__ */ w(ee, {
176
+ workspace: A,
177
+ issues: Q
178
+ })
179
+ })]
180
+ })
181
+ ]
182
+ })
183
+ }),
184
+ B
185
+ ]
186
+ });
187
+ }
188
+ export { A as component };
@@ -0,0 +1,8 @@
1
+ import { issuesQuery as e, projectQuery as t } from "../../../api/queries.js";
2
+ import { projectIssues as n } from "./_projectId_2.milestones._milestoneId.js";
3
+ // src/routes/$workspace/projects/$projectId_.milestones.$milestoneId.tsx?tsr-split=loader
4
+ var r = async ({ context: { queryClient: r }, params: { workspace: i, projectId: a } }) => {
5
+ let o = await r.ensureQueryData(t(i, a));
6
+ await r.ensureQueryData(e(i, n(o.id)));
7
+ };
8
+ export { r as loader };
@@ -6,130 +6,142 @@ import { useTime as a } from "../../../lib/time.js";
6
6
  import { useConfirm as o } from "../../../lib/confirm.js";
7
7
  import { SettingsPage as s } from "../../../components/settings.js";
8
8
  import { Route as c } from "./runners.js";
9
- import { Table as l, menuDivider as u, useOpenMenu as d } from "@parallelworks/ui";
10
- import { useMemo as f } from "react";
11
- import { useFormatter as p, useTranslations as m } from "use-intl";
12
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
13
- import { useMutation as _, useQueryClient as v, useSuspenseQuery as y } from "@tanstack/react-query";
14
- import { ListCellText as b, ListColumns as x, ListPage as S, ListRow as C, ListToolbar as w, NameCell as T, listTableProps as E, useListNavigate as D, useListSearch as O, useListView as k } from "@parallelworks/ui/list";
9
+ import { ComputeTargets as l } from "../../../components/ComputeTargets.js";
10
+ import { StatusDot as u, Table as d, menuDivider as f, useOpenMenu as p } from "@parallelworks/ui";
11
+ import { useMemo as m } from "react";
12
+ import { useFormatter as h, useTranslations as g } from "use-intl";
13
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
14
+ import { useMutation as y, useQueryClient as b, useSuspenseQuery as x } from "@tanstack/react-query";
15
+ import { ListCellText as S, ListColumns as C, ListPage as w, ListRow as T, ListToolbar as E, NameCell as D, listTableProps as O, useListNavigate as k, useListSearch as A, useListView as j } from "@parallelworks/ui/list";
15
16
  // src/routes/$workspace/settings/runners.tsx?tsr-split=component
16
- var A = {
17
+ var M = {
17
18
  default: "runnerModeDefault",
18
19
  "accept-edits": "runnerModeAcceptEdits",
19
20
  auto: "runnerModeAuto",
20
21
  bypass: "runnerModeBypass"
21
22
  };
22
- function j() {
23
+ function N() {
23
24
  let { workspace: e } = c.useParams();
24
- return /* @__PURE__ */ h(M, { workspace: e });
25
+ return /* @__PURE__ */ _(P, { workspace: e });
25
26
  }
26
- function M({ workspace: c }) {
27
- let { data: j } = y(n(c)), M = m("account"), N = p(), P = m("common"), F = a(), I = v(), L = O(), R = D(), z = d(), B = _({
27
+ function P({ workspace: c }) {
28
+ let { data: N } = x(n(c)), P = g("account"), F = h(), I = g("common"), L = a(), R = b(), z = A(), B = k(), V = p(), H = y({
28
29
  mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/runners/{runnerId}", { params: { path: {
29
30
  workspace: c,
30
31
  runnerId: n
31
32
  } } })),
32
- onSettled: () => I.invalidateQueries({ queryKey: n(c).queryKey })
33
- }), { confirm: V, dialog: H } = o(), U = (e) => V({
34
- title: M("revokeRunnerTitle"),
35
- description: M("revokeRunnerDescription", { name: e.name }),
36
- confirmLabel: M("revoke"),
37
- onConfirm: () => B.mutateAsync(e.id)
38
- }), W = f(() => [{
33
+ onSettled: () => R.invalidateQueries({ queryKey: n(c).queryKey })
34
+ }), { confirm: U, dialog: W } = o(), G = (e) => U({
35
+ title: P("revokeRunnerTitle"),
36
+ description: P("revokeRunnerDescription", { name: e.name }),
37
+ confirmLabel: P("revoke"),
38
+ onConfirm: () => H.mutateAsync(e.id)
39
+ }), K = m(() => [{
39
40
  key: "name",
40
- label: P("name"),
41
+ label: I("name"),
41
42
  headerClassName: "py-2",
42
43
  alwaysVisible: !0
43
44
  }, {
44
45
  key: "seen",
45
- label: M("runnerColSeen"),
46
+ label: P("runnerColSeen"),
46
47
  headerClassName: "py-2 w-40",
47
48
  align: "end"
48
- }], [M, P]), G = f(() => [{
49
+ }], [P, I]), q = m(() => [{
49
50
  value: "name",
50
- label: P("name"),
51
+ label: I("name"),
51
52
  compare: (e, t) => e.name.localeCompare(t.name)
52
53
  }, {
53
54
  value: "seen",
54
- label: M("runnerColSeen"),
55
+ label: P("runnerColSeen"),
55
56
  compare: (e, t) => (t.lastSeenAt ?? "").localeCompare(e.lastSeenAt ?? "")
56
- }], [M, P]), K = k({
57
+ }], [P, I]), J = j({
57
58
  storageKey: `tandem-runners-${c}`,
58
59
  defaultShowColumnHeaders: !1,
59
- columns: W,
60
- orderBys: G,
60
+ columns: K,
61
+ orderBys: q,
61
62
  defaultOrderBy: "name",
62
63
  facets: []
63
- }), q = L.filter.trim().toLowerCase(), J = j.filter((e) => !q || [
64
+ }), Y = z.filter.trim().toLowerCase(), X = N.filter((e) => !Y || [
64
65
  e.name,
65
66
  e.group ?? "",
66
67
  ...e.harnesses,
67
68
  ...e.labels
68
- ].some((e) => e.toLowerCase().includes(q)));
69
- return /* @__PURE__ */ g(s, {
69
+ ].some((e) => e.toLowerCase().includes(Y)));
70
+ return /* @__PURE__ */ v(s, {
70
71
  wide: !0,
71
- title: M("runners"),
72
- description: M.rich("runnersDescription", { code: (e) => /* @__PURE__ */ h("code", {
72
+ title: P("runners"),
73
+ description: P.rich("runnersDescription", { code: (e) => /* @__PURE__ */ _("code", {
73
74
  className: "rounded bg-muted px-1 py-0.5 text-xs",
74
75
  children: e
75
76
  }) }),
76
- toolbar: j.length > 0 && /* @__PURE__ */ h(w, {
77
- view: K,
78
- search: L,
79
- searchLabel: M("runnerSearch"),
80
- searchPlaceholder: M("runnerSearch")
77
+ toolbar: N.length > 0 && /* @__PURE__ */ _(E, {
78
+ view: J,
79
+ search: z,
80
+ searchLabel: P("runnerSearch"),
81
+ searchPlaceholder: P("runnerSearch")
81
82
  }),
82
- children: [/* @__PURE__ */ h("div", {
83
- className: "border-t border-border",
84
- children: /* @__PURE__ */ h(S, {
85
- view: K,
86
- total: j.length,
87
- matches: J.length,
88
- count: {
89
- filterActive: L.filter.trim() !== "",
90
- noun: M("runnerNoun"),
91
- nounPlural: M("runnerNounPlural")
92
- },
93
- empty: {
94
- icon: /* @__PURE__ */ h(i, {}),
95
- title: M("noRunners")
96
- },
97
- noMatches: M("runnerNoMatches"),
98
- children: /* @__PURE__ */ g(l, {
99
- ...E,
100
- children: [/* @__PURE__ */ h(x, { view: K }), K.applyOrder(J).map((e) => /* @__PURE__ */ g(C, {
101
- href: null,
102
- goTo: R,
103
- openMenu: z,
104
- items: [
105
- r(M("copyRunnerId"), e.id),
106
- r(P("copyName"), e.name),
107
- u,
108
- {
109
- label: M("revoke"),
110
- destructive: !0,
111
- onClick: () => U(e)
112
- }
113
- ],
114
- children: [/* @__PURE__ */ h(T, {
115
- icon: /* @__PURE__ */ h(i, {}),
116
- iconTile: !0,
117
- name: e.name,
118
- subtitle: N.list([
119
- ...e.group ? [M("runnerSharedWith", { group: e.group })] : [],
120
- ...e.permissionMode ? [M(A[e.permissionMode])] : [],
121
- ...e.harnesses,
122
- ...e.labels
123
- ], { type: "unit" }),
124
- href: null
125
- }), K.isVisible("seen") && /* @__PURE__ */ h(l.Item, {
126
- className: "py-2.5",
127
- children: /* @__PURE__ */ h(b, { children: e.lastSeenAt ? M("runnerSeen", { seen: F.relative(e.lastSeenAt) }) : M("runnerNeverConnected") })
128
- })]
129
- }, e.id))]
83
+ children: [
84
+ /* @__PURE__ */ _("div", {
85
+ className: "border-t border-border",
86
+ children: /* @__PURE__ */ _(w, {
87
+ view: J,
88
+ total: N.length,
89
+ matches: X.length,
90
+ count: {
91
+ filterActive: z.filter.trim() !== "",
92
+ noun: P("runnerNoun"),
93
+ nounPlural: P("runnerNounPlural")
94
+ },
95
+ empty: {
96
+ icon: /* @__PURE__ */ _(i, {}),
97
+ title: P("noRunners")
98
+ },
99
+ noMatches: P("runnerNoMatches"),
100
+ children: /* @__PURE__ */ v(d, {
101
+ ...O,
102
+ children: [/* @__PURE__ */ _(C, { view: J }), J.applyOrder(X).map((e) => /* @__PURE__ */ v(T, {
103
+ href: null,
104
+ goTo: B,
105
+ openMenu: V,
106
+ items: [
107
+ r(P("copyRunnerId"), e.id),
108
+ r(I("copyName"), e.name),
109
+ f,
110
+ {
111
+ label: P("revoke"),
112
+ destructive: !0,
113
+ onClick: () => G(e)
114
+ }
115
+ ],
116
+ children: [/* @__PURE__ */ _(D, {
117
+ icon: /* @__PURE__ */ _(i, {}),
118
+ iconTile: !0,
119
+ name: e.name,
120
+ subtitle: F.list([
121
+ ...e.group ? [P("runnerSharedWith", { group: e.group })] : [],
122
+ ...e.permissionMode ? [P(M[e.permissionMode])] : [],
123
+ ...e.harnesses,
124
+ ...e.labels
125
+ ], { type: "unit" }),
126
+ href: null
127
+ }), J.isVisible("seen") && /* @__PURE__ */ v(d.Item, {
128
+ className: "py-2.5",
129
+ children: [/* @__PURE__ */ _(S, { children: e.lastSeenAt ? P("runnerSeen", { seen: L.relative(e.lastSeenAt) }) : P("runnerNeverConnected") }), e.isolation && /* @__PURE__ */ v("span", {
130
+ className: "flex items-center justify-end gap-1.5 text-xs text-muted-foreground",
131
+ title: e.isolation.failures.join("\n") || void 0,
132
+ children: [/* @__PURE__ */ _(u, {
133
+ variant: e.isolation.passed ? "success" : "error",
134
+ size: 8
135
+ }), e.isolation.passed ? P("runnerIsolated") : P("runnerNotIsolated", { count: e.isolation.failures.length })]
136
+ })]
137
+ })]
138
+ }, e.id))]
139
+ })
130
140
  })
131
- })
132
- }), H]
141
+ }),
142
+ /* @__PURE__ */ _(l, { workspace: c }),
143
+ W
144
+ ]
133
145
  });
134
146
  }
135
- export { j as component };
147
+ export { N as component };