@bud.sh/app 0.3.0 → 0.4.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.
- package/dist/client/assets/bud/design.js +1 -1
- package/dist/client/assets/canvas-DIKX_HCJ.js +1 -0
- package/dist/client/assets/difference-worker-CwQNxTJL.js +8 -0
- package/dist/client/assets/files-BQ9O3Z8-.js +1 -0
- package/dist/client/assets/i18n-CL0jBP7Y.js +1 -0
- package/dist/client/assets/index-COvyj5zV.js +2 -0
- package/dist/client/assets/pages-BGl2Yuza.js +1 -0
- package/dist/client/assets/project-branches-DwKjCwZv.js +1 -0
- package/dist/client/assets/project-comments-Cdip2Y10.js +1 -0
- package/dist/client/assets/project-thread-links-BGIkGQeU.js +1 -0
- package/dist/client/assets/{project-threads-DezXiVK6.js → project-threads-DeKXNqeP.js} +104 -104
- package/dist/client/assets/{project-work-CB1JHqGW.js → project-work-B7PGQtV9.js} +1 -1
- package/dist/client/assets/task-design-DJp5yho1.js +23 -0
- package/dist/client/assets/tasks-BHXj727C.js +1 -0
- package/dist/client/assets/tasks-request-CsUB5__X.js +1 -0
- package/dist/client/assets/workspace-CbO7RsI2.js +2 -0
- package/dist/client/index.html +2 -1
- package/dist/hosted/assets/{canvas-C69-96GR.js → canvas-gWj_ocKK.js} +69 -41
- package/dist/hosted/assets/{comment-data-CiDuvXi2.js → comment-data-C-rNCB1n.js} +7323 -1068
- package/dist/hosted/assets/{files-DQL5hzs3.js → files-CAPvbavY.js} +92 -89
- package/dist/hosted/assets/{pages-DFs7jB6M.js → pages-DJiOvT-l.js} +31 -22
- package/dist/hosted/assets/{project-branches-CffV4IS1.js → project-branches-BgrfdvtL.js} +5 -5
- package/dist/hosted/assets/{project-thread-links-B1Y2bDUx.js → project-thread-links-B7uzThL9.js} +12 -12
- package/dist/hosted/assets/{screen-BroBb1Z_.js → screen-D4D9nh4V.js} +18 -18
- package/dist/hosted/assets/{tasks-mzmNhe2d.js → tasks-C7aGLzBw.js} +29 -29
- package/dist/hosted/assets/{tasks-request-Dcrpd2_8.js → tasks-request-CikFdCgP.js} +7 -7
- package/dist/hosted/hosted.js +58 -31
- package/dist/node/design.js +6355 -139
- package/dist/node/index.js +4 -2
- package/dist/node-host/assets/{canvas-BZhzizzt.js → canvas-kXzp80a5.js} +70 -42
- package/dist/node-host/assets/{comment-data-nUlI0szN.js → comment-data-CeuJbJKJ.js} +7349 -1094
- package/dist/node-host/assets/{files-CTzcWGjb.js → files-0YIuvKzb.js} +92 -89
- package/dist/node-host/assets/{pages-0aWH7z1j.js → pages-DOF22SyG.js} +31 -22
- package/dist/node-host/assets/{project-branches-1zs_0J_y.js → project-branches-BeEwMBIw.js} +5 -5
- package/dist/node-host/assets/{project-thread-links-LpUAGcDr.js → project-thread-links-Bs_MtfBC.js} +12 -12
- package/dist/node-host/assets/{screen-DQoTOWYR.js → screen-DRTAKkn3.js} +18 -18
- package/dist/node-host/assets/{tasks-C0WqnM7Q.js → tasks-BA_hcbj5.js} +30 -30
- package/dist/node-host/assets/{tasks-request-Bwky5ORf.js → tasks-request-Doc9y_20.js} +7 -7
- package/dist/node-host/node-host.js +58 -31
- package/dist/server/assets/{branch-previews-BryeA_kA.js → branch-previews-ClkoJ0lM.js} +4 -2
- package/dist/server/assets/{canvas-D6tIkONI.js → canvas-CiN6jNIZ.js} +70 -42
- package/dist/server/assets/{comment-data-BuArfgcc.js → comment-data-9SqALQjT.js} +7347 -1092
- package/dist/server/assets/{files-DkrEB48U.js → files-DBVqeLdL.js} +92 -89
- package/dist/server/assets/{listener-oKd5ETMj.js → listener-DGWKUc2o.js} +53 -31
- package/dist/server/assets/{pages-iEdmK_o2.js → pages-DJMLr6j9.js} +31 -22
- package/dist/server/assets/{project-branches-B7rtrvMl.js → project-branches-DbKEmiQT.js} +5 -5
- package/dist/server/assets/{project-thread-links-ue_ad9IX.js → project-thread-links-C0kV_Pcl.js} +12 -12
- package/dist/server/assets/{project-work-6aOyja4v.js → project-work-C0FN3w5Y.js} +2 -2
- package/dist/server/assets/{screen-DMUB9a-K.js → screen-BtvzEiIa.js} +18 -18
- package/dist/server/assets/{server-DN5uwE4k.js → server-CYvuOSBA.js} +1 -1
- package/dist/server/assets/{services-Ber8opFE.js → services-DK4fqrlF.js} +2 -2
- package/dist/server/assets/{tasks-C2oa2wSC.js → tasks-DX71x8f9.js} +31 -31
- package/dist/server/assets/{tasks-request-Bk5EoY_p.js → tasks-request-C3jk9Jyu.js} +7 -6
- package/dist/server/capture.js +1 -1
- package/dist/server/migration.js +3 -3
- package/dist/server/runtime.js +4 -4
- package/dist/server/server.js +3 -3
- package/dist/types/assets/{config-Cuauq8xY.d.ts → config-DIC2cf_S.d.ts} +3 -0
- package/dist/types/assets/{contract-BsCQbbxD.d.ts → contract-CAT-XFNq.d.ts} +3 -1
- package/dist/types/companion.d.ts +1 -1
- package/dist/types/hosted.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/node-host.d.ts +2 -2
- package/dist/types/screen.d.ts +1 -1
- package/package.json +1 -1
- package/dist/client/assets/canvas-DxaIItAs.js +0 -1
- package/dist/client/assets/difference-worker-BpqPBs5g.js +0 -8
- package/dist/client/assets/files-C-7xoSt4.js +0 -1
- package/dist/client/assets/index-GPPa1XPO.js +0 -2
- package/dist/client/assets/pages-BVrTX_Eq.js +0 -1
- package/dist/client/assets/project-branches-DpxQx-T4.js +0 -1
- package/dist/client/assets/project-comments-D897aU5O.js +0 -1
- package/dist/client/assets/project-thread-links-Bp_TseD0.js +0 -1
- package/dist/client/assets/task-design-bktfn_Ok.js +0 -23
- package/dist/client/assets/tasks-Cqfj4fQN.js +0 -1
- package/dist/client/assets/tasks-request-mWMk9pBo.js +0 -1
- package/dist/client/assets/workspace-CznMN7F6.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as createProjectComments, t as defineScreen } from "./screen-
|
|
1
|
+
import { Bi as array, Ji as object, Kt as pageRoutes, Pn as Fragment, Qi as string, Qt as Spinner, Rn as jsx, Yi as optional, Zi as parseSafe, Zt as Loader, _t as PagesWorkspace, gn as Text, in as IconButton, l as projectStore, li as MAX_CANVAS_Y, ln as readPreference, mn as t, qi as number, rn as Select, un as writePreference, vn as ref, xn as on } from "./comment-data-C-rNCB1n.js";
|
|
2
|
+
import { n as createProjectComments, t as defineScreen } from "./screen-D4D9nh4V.js";
|
|
3
3
|
import { n as workspaceTab, t as followWorkspaceTab } from "../hosted.js";
|
|
4
|
-
import { n as createProjectPreviews, r as locatePreview, t as createProjectBranches } from "./project-branches-
|
|
4
|
+
import { n as createProjectPreviews, r as locatePreview, t as createProjectBranches } from "./project-branches-BgrfdvtL.js";
|
|
5
5
|
//#region app/client/page-picture.tsx
|
|
6
6
|
/**
|
|
7
7
|
* A page as its latest captured picture, for Pages where there is no running site: its slices
|
|
@@ -40,7 +40,10 @@ function PagePicture(handle) {
|
|
|
40
40
|
return /* @__PURE__ */ jsx("div", {
|
|
41
41
|
class: inline ? "relative w-full" : "absolute inset-0 overflow-auto bg-board",
|
|
42
42
|
role: "img",
|
|
43
|
-
"aria-label":
|
|
43
|
+
"aria-label": t("app.client.pagePicture.pictureAt", {
|
|
44
|
+
title: route.title,
|
|
45
|
+
width: size.width
|
|
46
|
+
}),
|
|
44
47
|
children: current ? /* @__PURE__ */ jsx("div", {
|
|
45
48
|
class: `relative mx-auto ${picking ? "cursor-crosshair" : ""}`,
|
|
46
49
|
style: { width: `min(100%, ${current.capture.width}px)` },
|
|
@@ -76,7 +79,7 @@ function PagePicture(handle) {
|
|
|
76
79
|
variant: "ui",
|
|
77
80
|
tone: "muted",
|
|
78
81
|
class: "max-w-md text-center",
|
|
79
|
-
children: "
|
|
82
|
+
children: t("app.client.pagePicture.noPictureYet")
|
|
80
83
|
}) : /* @__PURE__ */ jsx(Spinner, {
|
|
81
84
|
size: 18,
|
|
82
85
|
class: "text-muted"
|
|
@@ -188,9 +191,12 @@ function ProjectPages(handle) {
|
|
|
188
191
|
}] : []);
|
|
189
192
|
return pictureMode ? pictured : [{
|
|
190
193
|
name: workingTree,
|
|
191
|
-
caption: "live"
|
|
194
|
+
caption: t("app.client.projectPages.live")
|
|
192
195
|
}, ...pictured];
|
|
193
196
|
}
|
|
197
|
+
function branchLabel(name) {
|
|
198
|
+
return name === workingTree ? t("app.client.projectPages.workingTree") : name;
|
|
199
|
+
}
|
|
194
200
|
let comparing = null;
|
|
195
201
|
let pickedFrom;
|
|
196
202
|
let viewport = project.previews.viewports[0];
|
|
@@ -325,26 +331,26 @@ function ProjectPages(handle) {
|
|
|
325
331
|
if (!pictureMode && options.length < 2 && !project.routes.some((route) => route.flow)) return void 0;
|
|
326
332
|
let compared = comparing;
|
|
327
333
|
return {
|
|
328
|
-
source: compared ?
|
|
334
|
+
source: compared ? t("app.client.projectPages.comparing", { branches: compared.join(", ") }) : t("app.client.projectPages.picturesOf", { branch: branchLabel(activeTab().branch ?? home) }),
|
|
329
335
|
shows: (tab) => pictureMode || Boolean(tab.branch) || Boolean(compared) || Boolean(pageRoute(project.routes, tab.path)?.flow),
|
|
330
336
|
actions: /* @__PURE__ */ jsx(Fragment, { children: [/* @__PURE__ */ jsx(IconButton, {
|
|
331
337
|
tooltip: true,
|
|
332
338
|
icon: "compare",
|
|
333
|
-
label: compared ? "
|
|
339
|
+
label: compared ? t("app.client.projectPages.stopComparing") : t("app.client.projectPages.compareBranches"),
|
|
334
340
|
active: Boolean(compared),
|
|
335
341
|
disabled: !compared && options.length < 2,
|
|
336
342
|
mix: on("click", toggleComparing)
|
|
337
343
|
}), compared ? /* @__PURE__ */ jsx("div", {
|
|
338
344
|
role: "group",
|
|
339
|
-
"aria-label": "
|
|
345
|
+
"aria-label": t("app.client.projectPages.branchesCompared"),
|
|
340
346
|
class: "flex min-w-0 items-center gap-1.5",
|
|
341
347
|
children: compared.map((name, index) => /* @__PURE__ */ jsx(Select, {
|
|
342
|
-
label:
|
|
348
|
+
label: t("app.client.projectPages.comparedBranch", { number: index + 1 }),
|
|
343
349
|
value: name,
|
|
344
350
|
class: "max-w-52",
|
|
345
351
|
options: options.map((option) => ({
|
|
346
352
|
value: option.name,
|
|
347
|
-
label: option.name,
|
|
353
|
+
label: branchLabel(option.name),
|
|
348
354
|
description: option.caption
|
|
349
355
|
})),
|
|
350
356
|
onChange: (value) => {
|
|
@@ -360,7 +366,10 @@ function ProjectPages(handle) {
|
|
|
360
366
|
children: viewports.length > 1 ? viewports.map((option) => /* @__PURE__ */ jsx(IconButton, {
|
|
361
367
|
tooltip: true,
|
|
362
368
|
icon: option.mobile ? "mobile" : "desktop",
|
|
363
|
-
label:
|
|
369
|
+
label: t("app.client.projectPages.showViewport", {
|
|
370
|
+
name: option.name,
|
|
371
|
+
width: option.width
|
|
372
|
+
}),
|
|
364
373
|
active: option.id === viewport.id,
|
|
365
374
|
mix: on("click", () => {
|
|
366
375
|
viewport = option;
|
|
@@ -378,7 +387,7 @@ function ProjectPages(handle) {
|
|
|
378
387
|
variant: "ui",
|
|
379
388
|
tone: "muted",
|
|
380
389
|
class: "max-w-md text-center",
|
|
381
|
-
children: "
|
|
390
|
+
children: t("app.client.projectPages.routePicturesOnly")
|
|
382
391
|
})
|
|
383
392
|
});
|
|
384
393
|
if (compared) return /* @__PURE__ */ jsx("div", {
|
|
@@ -386,14 +395,14 @@ function ProjectPages(handle) {
|
|
|
386
395
|
children: /* @__PURE__ */ jsx("div", {
|
|
387
396
|
class: "flex w-full items-start justify-center gap-4 p-4",
|
|
388
397
|
children: compared.map((branch) => /* @__PURE__ */ jsx("section", {
|
|
389
|
-
"aria-label":
|
|
398
|
+
"aria-label": t("app.client.projectPages.branchPicture", { branch: branchLabel(branch) }),
|
|
390
399
|
class: "flex min-w-0 flex-1 flex-col gap-2",
|
|
391
400
|
style: { maxWidth: `${viewport.width}px` },
|
|
392
401
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
393
402
|
variant: "ui-caption",
|
|
394
403
|
tone: "muted",
|
|
395
404
|
class: "truncate",
|
|
396
|
-
children: branch
|
|
405
|
+
children: branchLabel(branch)
|
|
397
406
|
}), /* @__PURE__ */ jsx(PagePicture, {
|
|
398
407
|
previews: previewsOf(branch),
|
|
399
408
|
route,
|
|
@@ -447,9 +456,9 @@ function ProjectPages(handle) {
|
|
|
447
456
|
handle.update();
|
|
448
457
|
}
|
|
449
458
|
function unavailable(path) {
|
|
450
|
-
if (!comments.loaded) return "
|
|
451
|
-
if (!comments.snapshot.capabilities.create) return "
|
|
452
|
-
if (!pageRoute(project.routes, path)) return "
|
|
459
|
+
if (!comments.loaded) return t("app.client.projectPages.loadingComments");
|
|
460
|
+
if (!comments.snapshot.capabilities.create) return t("app.client.projectPages.commentsReadOnly");
|
|
461
|
+
if (!pageRoute(project.routes, path)) return t("app.client.projectPages.routeCommentsOnly");
|
|
453
462
|
return null;
|
|
454
463
|
}
|
|
455
464
|
tabId = workspaceTab();
|
|
@@ -477,7 +486,7 @@ function ProjectPages(handle) {
|
|
|
477
486
|
if (!branches.loaded && !branches.error) return /* @__PURE__ */ jsx("div", {
|
|
478
487
|
class: "h-full min-h-0",
|
|
479
488
|
mix: mount,
|
|
480
|
-
children: /* @__PURE__ */ jsx(Loader, { label: "
|
|
489
|
+
children: /* @__PURE__ */ jsx(Loader, { label: t("app.client.projectPages.loadingBranches") })
|
|
481
490
|
});
|
|
482
491
|
let current = activeTab();
|
|
483
492
|
if (!pictureMode && typeof window !== "undefined" && new URL(origin).origin === window.location.origin) return /* @__PURE__ */ jsx("div", {
|
|
@@ -488,7 +497,7 @@ function ProjectPages(handle) {
|
|
|
488
497
|
variant: "ui",
|
|
489
498
|
tone: "muted",
|
|
490
499
|
class: "max-w-md text-center",
|
|
491
|
-
children: "
|
|
500
|
+
children: t("app.client.projectPages.siteOnBudOrigin")
|
|
492
501
|
})
|
|
493
502
|
});
|
|
494
503
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -525,7 +534,7 @@ function ProjectPages(handle) {
|
|
|
525
534
|
unavailable: unavailable(current.path),
|
|
526
535
|
draft: draft ? {
|
|
527
536
|
path: draft.pick.path,
|
|
528
|
-
label: draft.pick.element?.label ?? "
|
|
537
|
+
label: draft.pick.element?.label ?? t("app.client.projectPages.spotOnPage"),
|
|
529
538
|
source: draft.pick.element?.source ?? null
|
|
530
539
|
} : null,
|
|
531
540
|
busy: comments.busy,
|
|
@@ -544,7 +553,7 @@ function ProjectPages(handle) {
|
|
|
544
553
|
design: project.designs.pages,
|
|
545
554
|
sections: pictureMode || captured().length > 1 ? captured().map((branch) => ({
|
|
546
555
|
id: branch.name,
|
|
547
|
-
label: branch.name,
|
|
556
|
+
label: branchLabel(branch.name),
|
|
548
557
|
caption: branch.caption
|
|
549
558
|
})) : void 0,
|
|
550
559
|
section: current.branch ?? home,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bi as array, Ji as object, Jn as parsePreviewBranch, Ki as nullable, Qi as string, Qn as parsePreviewPins, S as writeRows, Vi as boolean, Wi as enum_, Zi as parseSafe, b as plainRow, c as previewKey, l as projectStore, mn as t, qi as number, qn as parsePreview, ui as parseElementAnchor, v as projectLive, y as routes } from "./comment-data-C-rNCB1n.js";
|
|
2
2
|
//#region app/client/project-previews.ts
|
|
3
3
|
/**
|
|
4
4
|
* A preview's capture in a theme at a viewport. Captures from before viewports existed name
|
|
@@ -162,12 +162,12 @@ async function request(url, token, signal, method = "GET") {
|
|
|
162
162
|
});
|
|
163
163
|
if (!response.ok) {
|
|
164
164
|
let body = await response.json().catch(() => null);
|
|
165
|
-
throw new Error(typeof body?.error === "string" ? body.error :
|
|
165
|
+
throw new Error(typeof body?.error === "string" ? body.error : t("app.client.projectPreviews.requestFailed", { status: response.status }));
|
|
166
166
|
}
|
|
167
167
|
return response;
|
|
168
168
|
}
|
|
169
169
|
function message(cause) {
|
|
170
|
-
return cause instanceof Error ? cause.message : "
|
|
170
|
+
return cause instanceof Error ? cause.message : t("app.client.projectPreviews.loadFailed");
|
|
171
171
|
}
|
|
172
172
|
/**
|
|
173
173
|
* Shows server-captured route screenshots for one canvas from the project's local store,
|
|
@@ -501,7 +501,7 @@ var BranchListSchema = object({
|
|
|
501
501
|
*/
|
|
502
502
|
function parseBranchList(value) {
|
|
503
503
|
let result = parseSafe(BranchListSchema, value);
|
|
504
|
-
if (!result.success) throw new TypeError("
|
|
504
|
+
if (!result.success) throw new TypeError(t("app.client.projectBranches.invalidBranchList"));
|
|
505
505
|
return result.value;
|
|
506
506
|
}
|
|
507
507
|
/**
|
|
@@ -532,7 +532,7 @@ function createProjectBranches(options) {
|
|
|
532
532
|
signal
|
|
533
533
|
});
|
|
534
534
|
let body = await response.json().catch(() => null);
|
|
535
|
-
if (!response.ok) throw new Error(typeof body?.error === "string" ? body.error : "
|
|
535
|
+
if (!response.ok) throw new Error(typeof body?.error === "string" ? body.error : t("app.client.projectBranches.loadError"));
|
|
536
536
|
return parseBranchList(body);
|
|
537
537
|
}
|
|
538
538
|
async function load() {
|
package/dist/hosted/assets/{project-thread-links-B1Y2bDUx.js → project-thread-links-B7uzThL9.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ThreadTaskLinks, Dt as taskHref,
|
|
2
|
-
import { n as requestTasks } from "./tasks-request-
|
|
1
|
+
import { C as ThreadTaskLinks, Di as valueByRole, Dt as taskHref, Pn as Fragment, Rn as jsx, _ as requestComments, ar as parseThread, di as parseWorkWorkspace, in as IconButton, mn as t, ur as parseThreadLinkInput, vn as ref, w as ThreadTaskPicker, xn as on, y as routes, yi as parseWorkItemRef } from "./comment-data-C-rNCB1n.js";
|
|
2
|
+
import { n as requestTasks } from "./tasks-request-CikFdCgP.js";
|
|
3
3
|
//#region app/client/project-task-picker.tsx
|
|
4
4
|
/**
|
|
5
5
|
* Loads searchable task choices only while the picker is mounted.
|
|
@@ -34,7 +34,7 @@ function ProjectTaskPicker(handle) {
|
|
|
34
34
|
});
|
|
35
35
|
let { schema, snapshot } = await requestTasks(routes.tasksApi.workspace.href() + "?" + search, token, signal, parseWorkWorkspace);
|
|
36
36
|
signal.throwIfAborted();
|
|
37
|
-
if (snapshot.connection.state !== "ready") throw new Error(snapshot.connection.message ?? "
|
|
37
|
+
if (snapshot.connection.state !== "ready") throw new Error(snapshot.connection.message ?? t("app.client.projectTaskPicker.adapterUnavailable"));
|
|
38
38
|
items = snapshot.items.map((item) => {
|
|
39
39
|
let title = valueByRole(item, schema, "title");
|
|
40
40
|
return {
|
|
@@ -49,7 +49,7 @@ function ProjectTaskPicker(handle) {
|
|
|
49
49
|
}
|
|
50
50
|
truncated = snapshot.truncated;
|
|
51
51
|
} catch (cause) {
|
|
52
|
-
if (!signal.aborted) error = cause instanceof Error ? cause.message : "
|
|
52
|
+
if (!signal.aborted) error = cause instanceof Error ? cause.message : t("app.client.projectTaskPicker.loadFailed");
|
|
53
53
|
} finally {
|
|
54
54
|
if (request === controller) {
|
|
55
55
|
loading = false;
|
|
@@ -104,9 +104,9 @@ function ProjectTaskPicker(handle) {
|
|
|
104
104
|
* @returns Bounded mutations, each applied against the previous acknowledged revision.
|
|
105
105
|
*/
|
|
106
106
|
function planThreadLinks(thread, selected) {
|
|
107
|
-
if (selected.length > 100 || new Set(selected).size !== selected.length) throw new Error(
|
|
107
|
+
if (selected.length > 100 || new Set(selected).size !== selected.length) throw new Error(t("app.client.threadLinks.selectUpToTasks", { count: 100 }));
|
|
108
108
|
for (let id of selected) parseWorkItemRef({ id });
|
|
109
|
-
if (!thread.anchor && !selected.length) throw new Error("
|
|
109
|
+
if (!thread.anchor && !selected.length) throw new Error(t("app.client.threadLinks.taskDiscussionNeedsLinkedTask"));
|
|
110
110
|
let current = new Set(thread.itemIds);
|
|
111
111
|
let desired = new Set(selected);
|
|
112
112
|
let changes = [];
|
|
@@ -127,7 +127,7 @@ function planThreadLinks(thread, selected) {
|
|
|
127
127
|
});
|
|
128
128
|
for (let id of added) current.add(id);
|
|
129
129
|
}
|
|
130
|
-
if (!removed.length && !added.length) throw new Error("
|
|
130
|
+
if (!removed.length && !added.length) throw new Error(t("app.client.threadLinks.couldNotPrepareTaskLinks"));
|
|
131
131
|
}
|
|
132
132
|
return changes;
|
|
133
133
|
}
|
|
@@ -144,7 +144,7 @@ async function saveThreadLinks(thread, selected, mutate, signal) {
|
|
|
144
144
|
let current = thread;
|
|
145
145
|
for (let change of changes) {
|
|
146
146
|
signal.throwIfAborted();
|
|
147
|
-
if (!current.revision) throw new Error("
|
|
147
|
+
if (!current.revision) throw new Error(t("app.client.threadLinks.reviewLatestDiscussionBeforeChangingLinks"));
|
|
148
148
|
let input = parseThreadLinkInput({
|
|
149
149
|
itemIds: change.itemIds,
|
|
150
150
|
expectedRevision: current.revision
|
|
@@ -154,7 +154,7 @@ async function saveThreadLinks(thread, selected, mutate, signal) {
|
|
|
154
154
|
let expected = new Set(current.itemIds);
|
|
155
155
|
for (let id of change.itemIds) if (change.action === "link") expected.add(id);
|
|
156
156
|
else expected.delete(id);
|
|
157
|
-
if (next.id !== current.id || !next.revision || next.itemIds.length !== expected.size || next.itemIds.some((id) => !expected.has(id)) || JSON.stringify(next.anchor) !== JSON.stringify(current.anchor)) throw new Error("
|
|
157
|
+
if (next.id !== current.id || !next.revision || next.itemIds.length !== expected.size || next.itemIds.some((id) => !expected.has(id)) || JSON.stringify(next.anchor) !== JSON.stringify(current.anchor)) throw new Error(t("app.client.threadLinks.taskLinkChangeNotConfirmed"));
|
|
158
158
|
current = next;
|
|
159
159
|
}
|
|
160
160
|
return current;
|
|
@@ -177,7 +177,7 @@ function ProjectThreadLinks(handle) {
|
|
|
177
177
|
async function review() {
|
|
178
178
|
if (!editing) return;
|
|
179
179
|
let next = await requestComments(routes.comments.get.href({ id: editing.id }), handle.props.project.token, handle.signal, parseThread);
|
|
180
|
-
if (next.id !== editing.id) throw new Error("
|
|
180
|
+
if (next.id !== editing.id) throw new Error(t("app.client.projectThreadLinks.anotherDiscussion"));
|
|
181
181
|
editing = next;
|
|
182
182
|
needsReview = false;
|
|
183
183
|
reviewed = true;
|
|
@@ -200,7 +200,7 @@ function ProjectThreadLinks(handle) {
|
|
|
200
200
|
}
|
|
201
201
|
return () => /* @__PURE__ */ jsx(Fragment, { children: [handle.props.part === "action" ? handle.props.canLink ? /* @__PURE__ */ jsx(IconButton, {
|
|
202
202
|
icon: "tasks",
|
|
203
|
-
label: "
|
|
203
|
+
label: t("app.client.projectThreadLinks.linkTasks"),
|
|
204
204
|
size: "small",
|
|
205
205
|
tooltip: true,
|
|
206
206
|
disabled: handle.props.busy,
|
|
@@ -218,7 +218,7 @@ function ProjectThreadLinks(handle) {
|
|
|
218
218
|
onClose: close,
|
|
219
219
|
onReview: needsReview ? review : void 0,
|
|
220
220
|
onSave: async (selected) => {
|
|
221
|
-
if (!editing || needsReview) throw new Error("
|
|
221
|
+
if (!editing || needsReview) throw new Error(t("app.client.projectThreadLinks.reviewLinksBeforeSaving"));
|
|
222
222
|
try {
|
|
223
223
|
let initial = editing;
|
|
224
224
|
editing = await saveThreadLinks(initial, selected, (action, input) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as requestComments, a as saveThreads, b as plainRow, cn as toast,
|
|
1
|
+
import { _ as requestComments, a as saveThreads, ar as parseThread, b as plainRow, cn as toast, cr as parseThreadId, fr as parseThreadSnapshot, g as CommentsRequestError, i as saveThread, l as projectStore, mn as t, n as unavailableComments, o as threadMatches, sr as parseThreadFilter, x as writeOptimistically, y as routes } from "./comment-data-C-rNCB1n.js";
|
|
2
2
|
//#region ../work/src/lib/predict.ts
|
|
3
3
|
/**
|
|
4
4
|
* How a new task shows until its adapter confirms it: the requested values, and the creation
|
|
@@ -161,7 +161,7 @@ async function loadItemComments(token, itemId, signal, conversationId) {
|
|
|
161
161
|
signal.throwIfAborted();
|
|
162
162
|
return {
|
|
163
163
|
snapshot: null,
|
|
164
|
-
error: cause instanceof Error ? cause.message : "
|
|
164
|
+
error: cause instanceof Error ? cause.message : t("app.client.projectComments.couldNotLoadDiscussion")
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
167
|
}
|
|
@@ -220,7 +220,7 @@ async function loadComments(project, signal, fetcher = fetch) {
|
|
|
220
220
|
signal.throwIfAborted();
|
|
221
221
|
return {
|
|
222
222
|
snapshot: null,
|
|
223
|
-
error: cause instanceof Error ? cause.message : "
|
|
223
|
+
error: cause instanceof Error ? cause.message : t("app.client.projectComments.couldNotLoadComments")
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
226
|
}
|
|
@@ -307,7 +307,7 @@ function createProjectComments(options) {
|
|
|
307
307
|
error = "";
|
|
308
308
|
}
|
|
309
309
|
} catch (cause) {
|
|
310
|
-
if (!signal.aborted && turn === generation) error = cause instanceof Error ? cause.message : "
|
|
310
|
+
if (!signal.aborted && turn === generation) error = cause instanceof Error ? cause.message : t("app.client.projectComments.couldNotLoadComments");
|
|
311
311
|
} finally {
|
|
312
312
|
if (turn === generation) {
|
|
313
313
|
loading = false;
|
|
@@ -327,16 +327,16 @@ function createProjectComments(options) {
|
|
|
327
327
|
changed();
|
|
328
328
|
try {
|
|
329
329
|
let thread = await request(routes.comments.get.href({ id }), signal, parseThread);
|
|
330
|
-
if (thread.id !== id) throw new CommentsRequestError("
|
|
330
|
+
if (thread.id !== id) throw new CommentsRequestError(t("app.client.projectComments.serviceReturnedAnotherDiscussion"));
|
|
331
331
|
if (!signal.aborted && turn === generation) {
|
|
332
332
|
await merge(thread);
|
|
333
|
-
if (!includes(thread)) throw new CommentsRequestError("
|
|
333
|
+
if (!includes(thread)) throw new CommentsRequestError(t("app.client.projectComments.discussionNoLongerInView"));
|
|
334
334
|
if (!detailFailures.size) error = "";
|
|
335
335
|
}
|
|
336
336
|
} catch (cause) {
|
|
337
337
|
if (!signal.aborted && turn === generation) {
|
|
338
338
|
detailFailures.add(id);
|
|
339
|
-
error = cause instanceof Error ? cause.message : "
|
|
339
|
+
error = cause instanceof Error ? cause.message : t("app.client.projectComments.couldNotLoadDiscussion");
|
|
340
340
|
}
|
|
341
341
|
} finally {
|
|
342
342
|
if (details.get(id) === controller) {
|
|
@@ -346,10 +346,10 @@ function createProjectComments(options) {
|
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
function requireCapability(capability) {
|
|
349
|
-
if (busy) throw new Error("
|
|
350
|
-
if (!loaded) throw new Error("
|
|
351
|
-
if (snapshot.connection.state !== "ready") throw new Error(snapshot.connection.message ?? "
|
|
352
|
-
if (!snapshot.capabilities[capability]) throw new Error("
|
|
349
|
+
if (busy) throw new Error(t("app.client.projectComments.waitForCurrentOperation"));
|
|
350
|
+
if (!loaded) throw new Error(t("app.client.projectComments.loadCommentsBeforeSaving"));
|
|
351
|
+
if (snapshot.connection.state !== "ready") throw new Error(snapshot.connection.message ?? t("app.client.projectComments.adapterUnavailable"));
|
|
352
|
+
if (!snapshot.capabilities[capability]) throw new Error(t("app.client.projectComments.adapterDoesNotSupportOperation"));
|
|
353
353
|
}
|
|
354
354
|
async function operate(url, body, parse, apply, success, threadId, predict) {
|
|
355
355
|
cancelReads();
|
|
@@ -371,13 +371,13 @@ function createProjectComments(options) {
|
|
|
371
371
|
return snapshot;
|
|
372
372
|
} catch (cause) {
|
|
373
373
|
if (!options.signal.aborted) {
|
|
374
|
-
error = cause instanceof Error ? cause.message : "
|
|
375
|
-
if (predict) toast.error("
|
|
374
|
+
error = cause instanceof Error ? cause.message : t("app.client.projectComments.commentWriteNotConfirmed");
|
|
375
|
+
if (predict) toast.error(t("app.client.projectComments.budUndidCommentChange"), { description: error });
|
|
376
376
|
if (cause instanceof CommentsRequestError && cause.code === "conflict") try {
|
|
377
377
|
await adopt(await request(listHref(filter), options.signal, parseThreadSnapshot));
|
|
378
378
|
if (threadId) {
|
|
379
379
|
let detail = await request(routes.comments.get.href({ id: threadId }), options.signal, parseThread);
|
|
380
|
-
if (detail.id !== threadId) throw new CommentsRequestError("
|
|
380
|
+
if (detail.id !== threadId) throw new CommentsRequestError(t("app.client.projectComments.serviceReturnedAnotherDiscussion"));
|
|
381
381
|
await merge(detail);
|
|
382
382
|
}
|
|
383
383
|
} catch {}
|
|
@@ -422,7 +422,7 @@ function createProjectComments(options) {
|
|
|
422
422
|
let pending = `pending-${crypto.randomUUID()}`;
|
|
423
423
|
if (change.id) {
|
|
424
424
|
let id = parseThreadId(change.id), thread = snapshot.threads.find((item) => item.id === id);
|
|
425
|
-
if (!thread?.revision) throw new Error("
|
|
425
|
+
if (!thread?.revision) throw new Error(t("app.client.projectComments.reloadDiscussionBeforeSaving"));
|
|
426
426
|
let next;
|
|
427
427
|
if (change.status !== void 0) {
|
|
428
428
|
url = routes.comments.status.href({ id });
|
|
@@ -467,16 +467,16 @@ function createProjectComments(options) {
|
|
|
467
467
|
let saved;
|
|
468
468
|
return {
|
|
469
469
|
...await operate(url, body, parseThread, (thread) => {
|
|
470
|
-
if (change.id && thread.id !== change.id) throw new CommentsRequestError("
|
|
470
|
+
if (change.id && thread.id !== change.id) throw new CommentsRequestError(t("app.client.projectComments.refreshBeforeTryingAgain"), 409, "uncertain");
|
|
471
471
|
saved = thread;
|
|
472
472
|
return merge(thread);
|
|
473
|
-
}, "
|
|
473
|
+
}, t("app.client.projectComments.commentSaved"), change.id, predict),
|
|
474
474
|
thread: saved
|
|
475
475
|
};
|
|
476
476
|
},
|
|
477
477
|
async sync() {
|
|
478
478
|
requireCapability("sync");
|
|
479
|
-
return operate(routes.comments.sync.href(), { direction: "both" }, parseThreadSnapshot, adopt, "
|
|
479
|
+
return operate(routes.comments.sync.href(), { direction: "both" }, parseThreadSnapshot, adopt, t("app.client.projectComments.commentsSynced"));
|
|
480
480
|
}
|
|
481
481
|
};
|
|
482
482
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $t as Button, B as TaskWorkspace, C as ThreadTaskLinks, Dt as taskHref, Et as selectedTask, Jt as CommentThreadDetail,
|
|
2
|
-
import { a as predictWorkAction, i as loadItemComments, n as createProjectComments, o as predictWorkCreate, s as predictWorkUpdate, t as defineScreen } from "./screen-
|
|
3
|
-
import { n as requestTasks, t as TaskRequestError } from "./tasks-request-
|
|
1
|
+
import { $t as Button, B as TaskWorkspace, C as ThreadTaskLinks, Dt as taskHref, Et as selectedTask, Jt as CommentThreadDetail, Ot as taskRole, Pn as Fragment, Rn as jsx, S as writeRows, T as ItemDiscussion, Tt as readConversationLocation, Xt as CommentComposer, Yt as CommentThreadItem, _i as parseWorkDetail, b as plainRow, bi as parseWorkMutationResult, cn as toast, fi as parseSectionData, gn as Text, h as storedWorkspace, l as projectStore, mn as t, nt as CommentThreadHeading, qt as taskRoutes, vn as ref, wi as parseWorkSyncResult, x as writeOptimistically, xn as on, xt as conversationLabel, y as routes } from "./comment-data-C-rNCB1n.js";
|
|
2
|
+
import { a as predictWorkAction, i as loadItemComments, n as createProjectComments, o as predictWorkCreate, s as predictWorkUpdate, t as defineScreen } from "./screen-D4D9nh4V.js";
|
|
3
|
+
import { n as requestTasks, t as TaskRequestError } from "./tasks-request-CikFdCgP.js";
|
|
4
4
|
import { r as projectWork } from "../hosted.js";
|
|
5
|
-
import { n as ProjectTaskPicker, t as ProjectThreadLinks } from "./project-thread-links-
|
|
5
|
+
import { n as ProjectTaskPicker, t as ProjectThreadLinks } from "./project-thread-links-B7uzThL9.js";
|
|
6
6
|
//#region app/client/task-discussion.tsx
|
|
7
7
|
/**
|
|
8
8
|
* Owns a task's filtered discussions and lazy detail requests within its mounted lifetime.
|
|
@@ -70,13 +70,13 @@ function TaskDiscussion(handle) {
|
|
|
70
70
|
creating = false;
|
|
71
71
|
handle.update();
|
|
72
72
|
}),
|
|
73
|
-
children: "
|
|
73
|
+
children: t("app.client.taskDiscussion.reply")
|
|
74
74
|
}) : null]
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
function heading(thread) {
|
|
78
78
|
return /* @__PURE__ */ jsx(CommentThreadHeading, {
|
|
79
|
-
location: thread.anchor ? conversationLabel(thread) : "
|
|
79
|
+
location: thread.anchor ? conversationLabel(thread) : t("app.client.taskDiscussion.discussion"),
|
|
80
80
|
actions: handle.props.renderThreadLinks ? void 0 : /* @__PURE__ */ jsx(ProjectThreadLinks, {
|
|
81
81
|
part: "action",
|
|
82
82
|
...threadLinks(thread)
|
|
@@ -110,7 +110,7 @@ function TaskDiscussion(handle) {
|
|
|
110
110
|
let count = threads.reduce((sum, thread) => sum + thread.messageCount, 0);
|
|
111
111
|
return /* @__PURE__ */ jsx("section", {
|
|
112
112
|
class: "flex min-w-0 flex-col gap-3",
|
|
113
|
-
"aria-label": "
|
|
113
|
+
"aria-label": t("app.client.taskDiscussion.taskDiscussion"),
|
|
114
114
|
mix: mount,
|
|
115
115
|
children: [
|
|
116
116
|
/* @__PURE__ */ jsx("div", {
|
|
@@ -120,7 +120,7 @@ function TaskDiscussion(handle) {
|
|
|
120
120
|
as: "h3",
|
|
121
121
|
variant: "ui",
|
|
122
122
|
weight: "medium",
|
|
123
|
-
children: "
|
|
123
|
+
children: t("app.client.taskDiscussion.discussion")
|
|
124
124
|
}),
|
|
125
125
|
count ? /* @__PURE__ */ jsx(Text, {
|
|
126
126
|
variant: "ui-caption",
|
|
@@ -136,7 +136,7 @@ function TaskDiscussion(handle) {
|
|
|
136
136
|
creating = true;
|
|
137
137
|
handle.update();
|
|
138
138
|
}),
|
|
139
|
-
children: "
|
|
139
|
+
children: t("app.client.taskDiscussion.newDiscussion")
|
|
140
140
|
}) : null
|
|
141
141
|
]
|
|
142
142
|
}),
|
|
@@ -152,18 +152,18 @@ function TaskDiscussion(handle) {
|
|
|
152
152
|
mix: on("click", () => {
|
|
153
153
|
comments.load().then(() => selected ? comments.loadThread(selected, true) : void 0);
|
|
154
154
|
}),
|
|
155
|
-
children: "
|
|
155
|
+
children: t("app.client.taskDiscussion.reloadComments")
|
|
156
156
|
})]
|
|
157
157
|
}) : null,
|
|
158
158
|
!comments.loaded ? /* @__PURE__ */ jsx(Text, {
|
|
159
159
|
variant: "ui-caption",
|
|
160
160
|
tone: "muted",
|
|
161
161
|
role: "status",
|
|
162
|
-
children: "
|
|
162
|
+
children: t("app.client.taskDiscussion.loadingDiscussion")
|
|
163
163
|
}) : !comments.ready ? /* @__PURE__ */ jsx(Text, {
|
|
164
164
|
variant: "ui-caption",
|
|
165
165
|
tone: "muted",
|
|
166
|
-
children: commentsUnavailable
|
|
166
|
+
children: t("app.client.taskDiscussion.commentsUnavailable")
|
|
167
167
|
}) : /* @__PURE__ */ jsx(Fragment, { children: [threads.length ? threads.map((thread) => !thread.anchor ? /* @__PURE__ */ jsx(ItemDiscussion, {
|
|
168
168
|
thread,
|
|
169
169
|
links: links(thread)
|
|
@@ -198,12 +198,12 @@ function TaskDiscussion(handle) {
|
|
|
198
198
|
}, thread.id)) : /* @__PURE__ */ jsx(Text, {
|
|
199
199
|
variant: "ui-caption",
|
|
200
200
|
tone: "muted",
|
|
201
|
-
children: "
|
|
201
|
+
children: t("app.client.taskDiscussion.noDiscussionYet")
|
|
202
202
|
}), capabilities.create || capabilities.reply && (explicit || threads.some((thread) => !thread.anchor)) ? /* @__PURE__ */ jsx("div", {
|
|
203
203
|
class: "flex min-w-0 flex-col gap-2",
|
|
204
204
|
children: [capabilities.create && (creating || !explicit && !threads.length) ? /* @__PURE__ */ jsx("div", {
|
|
205
205
|
class: "flex items-start justify-between gap-2",
|
|
206
|
-
"aria-label": "
|
|
206
|
+
"aria-label": t("app.client.taskDiscussion.newDiscussionTasks"),
|
|
207
207
|
children: [/* @__PURE__ */ jsx(ThreadTaskLinks, {
|
|
208
208
|
itemIds: draftItemIds,
|
|
209
209
|
items: handle.props.items ?? [],
|
|
@@ -221,19 +221,19 @@ function TaskDiscussion(handle) {
|
|
|
221
221
|
creating = false;
|
|
222
222
|
handle.update();
|
|
223
223
|
}),
|
|
224
|
-
children: "
|
|
224
|
+
children: t("app.client.taskDiscussion.cancel")
|
|
225
225
|
}) : null]
|
|
226
226
|
}) : threads.length > 1 ? /* @__PURE__ */ jsx(Text, {
|
|
227
227
|
variant: "ui-caption",
|
|
228
228
|
tone: "muted",
|
|
229
|
-
children:
|
|
229
|
+
children: t("app.client.taskDiscussion.replyingTo", { name: reply?.messages[0]?.author.name ?? t("app.client.taskDiscussion.theDiscussion") })
|
|
230
230
|
}) : null, /* @__PURE__ */ jsx(CommentComposer, {
|
|
231
|
-
label: "
|
|
232
|
-
placeholder: "
|
|
231
|
+
label: t("app.client.taskDiscussion.addTaskComment"),
|
|
232
|
+
placeholder: t("app.client.taskDiscussion.addContextPlaceholder"),
|
|
233
233
|
busy: comments.busy || replyPending,
|
|
234
234
|
class: "w-full",
|
|
235
235
|
onSubmit: async (body) => {
|
|
236
|
-
if (replyPending) throw new Error("
|
|
236
|
+
if (replyPending) throw new Error(t("app.client.taskDiscussion.loadBeforeReplying"));
|
|
237
237
|
if (reply && capabilities.reply) {
|
|
238
238
|
await write({
|
|
239
239
|
id: reply.id,
|
|
@@ -283,7 +283,7 @@ async function loadTask(token, id, schema, signal, conversationId) {
|
|
|
283
283
|
schema
|
|
284
284
|
]);
|
|
285
285
|
let detail = parseWorkDetail(value, resolved);
|
|
286
|
-
if (detail.item.id !== id) throw new Error("
|
|
286
|
+
if (detail.item.id !== id) throw new Error(t("app.client.projectTasks.differentTaskRefresh"));
|
|
287
287
|
return {
|
|
288
288
|
detail,
|
|
289
289
|
discussion
|
|
@@ -310,7 +310,7 @@ async function loadTasks(project, signal, href, conversationId) {
|
|
|
310
310
|
if (!stored || cause instanceof TaskRequestError) throw cause;
|
|
311
311
|
return open(projectWork(project).refresh(signal).then((value) => value.schema));
|
|
312
312
|
}).catch((cause) => {
|
|
313
|
-
taskError = cause instanceof Error ? cause.message : "
|
|
313
|
+
taskError = cause instanceof Error ? cause.message : t("app.client.projectTasks.couldNotLoadTask");
|
|
314
314
|
return null;
|
|
315
315
|
}) : null;
|
|
316
316
|
try {
|
|
@@ -328,7 +328,7 @@ async function loadTasks(project, signal, href, conversationId) {
|
|
|
328
328
|
return {
|
|
329
329
|
store,
|
|
330
330
|
stored: false,
|
|
331
|
-
error: cause instanceof Error ? cause.message : "
|
|
331
|
+
error: cause instanceof Error ? cause.message : t("app.client.projectTasks.couldNotLoadTasks")
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
334
|
}
|
|
@@ -382,7 +382,7 @@ function ProjectTasks(handle) {
|
|
|
382
382
|
};
|
|
383
383
|
}
|
|
384
384
|
function currentSchema() {
|
|
385
|
-
if (!workspace) throw new Error("
|
|
385
|
+
if (!workspace) throw new Error(t("app.client.projectTasks.refreshBeforeChanges"));
|
|
386
386
|
return workspace.schema;
|
|
387
387
|
}
|
|
388
388
|
async function write(url, body, parse) {
|
|
@@ -419,7 +419,7 @@ function ProjectTasks(handle) {
|
|
|
419
419
|
...body,
|
|
420
420
|
expectedRevision: prior.to
|
|
421
421
|
} : body, (value) => parseWorkMutationResult(value, currentSchema()));
|
|
422
|
-
if (id && result.item.id !== id) throw new Error("
|
|
422
|
+
if (id && result.item.id !== id) throw new Error(t("app.client.projectTasks.differentTaskRefreshRetry"));
|
|
423
423
|
await accepted(result.item);
|
|
424
424
|
settled.resolve(from ? {
|
|
425
425
|
from,
|
|
@@ -431,7 +431,7 @@ function ProjectTasks(handle) {
|
|
|
431
431
|
return item;
|
|
432
432
|
} catch (cause) {
|
|
433
433
|
settled.resolve(null);
|
|
434
|
-
if (!handle.signal.aborted) toast.error("
|
|
434
|
+
if (!handle.signal.aborted) toast.error(t("app.client.projectTasks.undidTaskChange"), { description: cause instanceof Error ? cause.message : t("app.client.projectTasks.writeNotConfirmed") });
|
|
435
435
|
refreshAfterWrite();
|
|
436
436
|
throw cause;
|
|
437
437
|
} finally {
|
|
@@ -456,7 +456,7 @@ function ProjectTasks(handle) {
|
|
|
456
456
|
act: (id, action) => save(routes.tasksApi.mutate.href({ id }), action, predicted(id, (item) => predictWorkAction(currentSchema(), item, action)), id),
|
|
457
457
|
get: async (id) => {
|
|
458
458
|
let next = await requestTasks(routes.tasksApi.show.href({ id }), project.token, handle.signal, (value) => parseWorkDetail(value, currentSchema()));
|
|
459
|
-
if (next.item.id !== id) throw new Error("
|
|
459
|
+
if (next.item.id !== id) throw new Error(t("app.client.projectTasks.differentTaskRefresh"));
|
|
460
460
|
return next.item;
|
|
461
461
|
},
|
|
462
462
|
section: (id, section, signal = handle.signal) => requestTasks(routes.tasksApi.section.href({
|
|
@@ -487,7 +487,7 @@ function ProjectTasks(handle) {
|
|
|
487
487
|
try {
|
|
488
488
|
await work.refresh(AbortSignal.any([handle.signal, controller.signal]));
|
|
489
489
|
} catch (cause) {
|
|
490
|
-
if (!controller.signal.aborted && !handle.signal.aborted) error = cause instanceof Error ? cause.message : "
|
|
490
|
+
if (!controller.signal.aborted && !handle.signal.aborted) error = cause instanceof Error ? cause.message : t("app.client.projectTasks.couldNotLoadTasks");
|
|
491
491
|
} finally {
|
|
492
492
|
if (listRequest === controller) {
|
|
493
493
|
loading = false;
|
|
@@ -523,10 +523,10 @@ function ProjectTasks(handle) {
|
|
|
523
523
|
}
|
|
524
524
|
let next = await requestTasks(routes.tasksApi.show.href({ id }), project.token, signal, (value) => parseWorkDetail(value, currentSchema()));
|
|
525
525
|
if (controller.signal.aborted || id !== selectedId) return;
|
|
526
|
-
if (next.item.id !== id) throw new Error("
|
|
526
|
+
if (next.item.id !== id) throw new Error(t("app.client.projectTasks.differentTaskRefresh"));
|
|
527
527
|
detail = next;
|
|
528
528
|
} catch (cause) {
|
|
529
|
-
if (!controller.signal.aborted && !handle.signal.aborted && id === selectedId) detailError = cause instanceof Error ? cause.message : "
|
|
529
|
+
if (!controller.signal.aborted && !handle.signal.aborted && id === selectedId) detailError = cause instanceof Error ? cause.message : t("app.client.projectTasks.couldNotLoadTask");
|
|
530
530
|
} finally {
|
|
531
531
|
if (detailRequest === controller) {
|
|
532
532
|
detailLoading = false;
|