@parallelworks/tandem-web 0.159.0 → 0.160.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.
@@ -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 };