@harborppm/cli 0.115.0 → 0.117.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.
- package/dist/app.mjs +419 -117
- package/lib/cli.mjs +1 -0
- package/package.json +1 -1
package/dist/app.mjs
CHANGED
|
@@ -2249,9 +2249,9 @@ function isSubtask(task, tasks) {
|
|
|
2249
2249
|
}
|
|
2250
2250
|
/** The subtasks of `parent`, in list order. Empty for a task that is itself a subtask. */
|
|
2251
2251
|
function subtasksOf(parent, tasks) {
|
|
2252
|
-
if (isSubtask(parent, tasks)) return NONE$
|
|
2252
|
+
if (isSubtask(parent, tasks)) return NONE$3;
|
|
2253
2253
|
const list = childrenByParent(tasks).get(parent.id);
|
|
2254
|
-
if (!list) return NONE$
|
|
2254
|
+
if (!list) return NONE$3;
|
|
2255
2255
|
return list.filter((t) => t.projectId === parent.projectId && t.id !== parent.id);
|
|
2256
2256
|
}
|
|
2257
2257
|
/** The tasks that stand on their own: what a board or a list shows. */
|
|
@@ -2275,11 +2275,11 @@ function subtaskProblem(childId, parentId, tasks) {
|
|
|
2275
2275
|
if (subtasksOf(parent, tasks).filter((t) => t.id !== childId).length >= 50) return `A task can hold up to ${50} subtasks.`;
|
|
2276
2276
|
return null;
|
|
2277
2277
|
}
|
|
2278
|
-
var SUBTASKS_MAX, NONE$
|
|
2278
|
+
var SUBTASKS_MAX, NONE$3;
|
|
2279
2279
|
var init_subtasks = __esmMin((() => {
|
|
2280
2280
|
init_indexes();
|
|
2281
2281
|
SUBTASKS_MAX = 50;
|
|
2282
|
-
NONE$
|
|
2282
|
+
NONE$3 = Object.freeze([]);
|
|
2283
2283
|
}));
|
|
2284
2284
|
|
|
2285
2285
|
// src/lib/swatches.ts
|
|
@@ -2582,8 +2582,8 @@ function projectKeyFor(name, taken) {
|
|
|
2582
2582
|
}
|
|
2583
2583
|
/** Whether `a` has the better claim to the number both hold. */
|
|
2584
2584
|
function first$3(a, b, stored) {
|
|
2585
|
-
const ka = kept(a, stored);
|
|
2586
|
-
if (ka !== kept(b, stored)) return ka;
|
|
2585
|
+
const ka = kept$1(a, stored);
|
|
2586
|
+
if (ka !== kept$1(b, stored)) return ka;
|
|
2587
2587
|
return made(a, b) <= 0;
|
|
2588
2588
|
}
|
|
2589
2589
|
/**
|
|
@@ -2728,13 +2728,13 @@ function findByKey(data, text) {
|
|
|
2728
2728
|
const n = Number(m[2]);
|
|
2729
2729
|
return data.tasks.find((t) => t.projectId === project.id && t.number === n) ?? null;
|
|
2730
2730
|
}
|
|
2731
|
-
var MAX_KEY, KEY, made, kept, KEY_TEXT;
|
|
2731
|
+
var MAX_KEY, KEY, made, kept$1, KEY_TEXT;
|
|
2732
2732
|
var init_task_keys = __esmMin((() => {
|
|
2733
2733
|
init_indexes();
|
|
2734
2734
|
MAX_KEY = 5;
|
|
2735
2735
|
KEY = /^[A-Z][A-Z0-9]{0,9}$/;
|
|
2736
2736
|
made = (a, b) => a.createdAt < b.createdAt ? -1 : a.createdAt > b.createdAt ? 1 : a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
|
2737
|
-
kept = (t, stored) => {
|
|
2737
|
+
kept$1 = (t, stored) => {
|
|
2738
2738
|
const was = stored?.get(t.id);
|
|
2739
2739
|
return !!was && was.number === t.number && was.projectId === t.projectId;
|
|
2740
2740
|
};
|
|
@@ -7543,27 +7543,27 @@ var init_csv = __esmMin((() => {
|
|
|
7543
7543
|
*/
|
|
7544
7544
|
function pickData(s) {
|
|
7545
7545
|
return {
|
|
7546
|
-
people: s.people ?? NONE$
|
|
7547
|
-
portfolios: s.portfolios ?? NONE$
|
|
7548
|
-
programs: s.programs ?? NONE$
|
|
7549
|
-
projects: s.projects ?? NONE$
|
|
7550
|
-
milestones: s.milestones ?? NONE$
|
|
7551
|
-
raidItems: s.raidItems ?? NONE$
|
|
7552
|
-
constraints: s.constraints ?? NONE$
|
|
7553
|
-
tasks: s.tasks ?? NONE$
|
|
7554
|
-
comments: s.comments ?? NONE$
|
|
7555
|
-
attachments: s.attachments ?? NONE$
|
|
7556
|
-
activity: s.activity ?? NONE$
|
|
7546
|
+
people: s.people ?? NONE$2,
|
|
7547
|
+
portfolios: s.portfolios ?? NONE$2,
|
|
7548
|
+
programs: s.programs ?? NONE$2,
|
|
7549
|
+
projects: s.projects ?? NONE$2,
|
|
7550
|
+
milestones: s.milestones ?? NONE$2,
|
|
7551
|
+
raidItems: s.raidItems ?? NONE$2,
|
|
7552
|
+
constraints: s.constraints ?? NONE$2,
|
|
7553
|
+
tasks: s.tasks ?? NONE$2,
|
|
7554
|
+
comments: s.comments ?? NONE$2,
|
|
7555
|
+
attachments: s.attachments ?? NONE$2,
|
|
7556
|
+
activity: s.activity ?? NONE$2,
|
|
7557
7557
|
currentUserId: s.currentUserId,
|
|
7558
7558
|
boardConfigs: s.boardConfigs ?? NO_CONFIGS,
|
|
7559
|
-
readPingIds: s.readPingIds ?? NONE$
|
|
7560
|
-
ropes: s.ropes ?? NONE$
|
|
7561
|
-
checkIns: s.checkIns ?? NONE$
|
|
7562
|
-
spendEntries: s.spendEntries ?? NONE$
|
|
7563
|
-
reflections: s.reflections ?? NONE$
|
|
7559
|
+
readPingIds: s.readPingIds ?? NONE$2,
|
|
7560
|
+
ropes: s.ropes ?? NONE$2,
|
|
7561
|
+
checkIns: s.checkIns ?? NONE$2,
|
|
7562
|
+
spendEntries: s.spendEntries ?? NONE$2,
|
|
7563
|
+
reflections: s.reflections ?? NONE$2,
|
|
7564
7564
|
priorityRules: s.priorityRules ?? null,
|
|
7565
7565
|
workCalendar: s.workCalendar ?? null,
|
|
7566
|
-
dashboards: s.dashboards ?? NONE$
|
|
7566
|
+
dashboards: s.dashboards ?? NONE$2
|
|
7567
7567
|
};
|
|
7568
7568
|
}
|
|
7569
7569
|
/** The document as sent to the server: normalized and without inline file data. */
|
|
@@ -7581,9 +7581,9 @@ function payloadOf(s) {
|
|
|
7581
7581
|
} : a)
|
|
7582
7582
|
};
|
|
7583
7583
|
}
|
|
7584
|
-
var NONE$
|
|
7584
|
+
var NONE$2, NO_CONFIGS;
|
|
7585
7585
|
var init_payload = __esmMin((() => {
|
|
7586
|
-
NONE$
|
|
7586
|
+
NONE$2 = [];
|
|
7587
7587
|
NO_CONFIGS = {};
|
|
7588
7588
|
}));
|
|
7589
7589
|
|
|
@@ -12386,20 +12386,134 @@ var init_empty = __esmMin((() => {
|
|
|
12386
12386
|
STARTER_PROGRAM = "The work";
|
|
12387
12387
|
}));
|
|
12388
12388
|
|
|
12389
|
+
// src/lib/rollup-lock.ts
|
|
12390
|
+
/** "Jira RR" for a linked project, "Jira RR-42" for a task from it; the name when there's no key. */
|
|
12391
|
+
function sourceLine(external) {
|
|
12392
|
+
const tail = external.key || ("name" in external ? external.name : "");
|
|
12393
|
+
return tail ? `${sourceLabel(external.from)} ${tail}` : sourceLabel(external.from);
|
|
12394
|
+
}
|
|
12395
|
+
/**
|
|
12396
|
+
* The fields Harbor may not change on this task: none for Harbor's own tasks
|
|
12397
|
+
* and for ones gone from the other tool. Jira owns priority and subtask
|
|
12398
|
+
* parents. Asana owns the start day instead, on the tasks it gives one
|
|
12399
|
+
* (`external.start`, set by the read); a task Asana gives none keeps the
|
|
12400
|
+
* start day it has in Harbor, and that one is changed here.
|
|
12401
|
+
*/
|
|
12402
|
+
function lockedFields(t) {
|
|
12403
|
+
if (!isExternal(t)) return NONE$1;
|
|
12404
|
+
if (t.external.from !== "asana") return JIRA_LOCKED;
|
|
12405
|
+
return t.external.start ? ASANA_LOCKED : ASANA_LOCKED_NO_START;
|
|
12406
|
+
}
|
|
12407
|
+
/** `patch` without the fields the other tool owns; the same object when it held none. */
|
|
12408
|
+
function withoutLocked(t, patch) {
|
|
12409
|
+
const locked = lockedFields(t);
|
|
12410
|
+
if (locked.length === 0 || !locked.some((k) => k in patch)) return patch;
|
|
12411
|
+
const out = { ...patch };
|
|
12412
|
+
for (const k of locked) delete out[k];
|
|
12413
|
+
return out;
|
|
12414
|
+
}
|
|
12415
|
+
/**
|
|
12416
|
+
* Why `patch` can't be made to this task, as one sentence, or null when it
|
|
12417
|
+
* can: the task is Harbor's own, or the patch leaves the other tool's fields
|
|
12418
|
+
* as they are. Say it wherever a silent no-op would puzzle (an agent's tool
|
|
12419
|
+
* answer, a drop on the board).
|
|
12420
|
+
*/
|
|
12421
|
+
function externalRefusal(t, patch) {
|
|
12422
|
+
const touched = lockedFields(t).filter((k) => k in patch && !sameValue(patch[k], t[k]));
|
|
12423
|
+
if (touched.length === 0) return null;
|
|
12424
|
+
const ext = t.external;
|
|
12425
|
+
const tool = sourceLabel(ext.from);
|
|
12426
|
+
const from = `“${t.title}” is kept in step from ${tool}${ext.key ? ` (${ext.key})` : ""}`;
|
|
12427
|
+
const words = [...new Set(touched.flatMap((k) => FIELD_WORD[k] ?? []))];
|
|
12428
|
+
if (words.length === 0) return `${from}, so it can't ${touched.includes("repeat") ? "repeat" : "be sent for approval"} here.`;
|
|
12429
|
+
return `${from}. Change its ${words.length === 1 ? words[0] : `${words.slice(0, -1).join(", ")} and ${words[words.length - 1]}`} there; Harbor follows.`;
|
|
12430
|
+
}
|
|
12431
|
+
/** Why this task can't be deleted here, or null when it can. */
|
|
12432
|
+
function externalDeleteRefusal(t) {
|
|
12433
|
+
if (!isExternal(t)) return null;
|
|
12434
|
+
const ext = t.external;
|
|
12435
|
+
const tool = sourceLabel(ext.from);
|
|
12436
|
+
return `“${t.title}” is kept in step from ${tool}${ext.key ? ` (${ext.key})` : ""}. Remove it there, or unlink the project; Harbor follows.`;
|
|
12437
|
+
}
|
|
12438
|
+
var SOURCE_LABEL, sourceLabel, isExternal, JIRA_LOCKED, ASANA_LOCKED, ASANA_LOCKED_NO_START, NONE$1, FIELD_WORD, sameValue;
|
|
12439
|
+
var init_rollup_lock = __esmMin((() => {
|
|
12440
|
+
SOURCE_LABEL = {
|
|
12441
|
+
jira: "Jira",
|
|
12442
|
+
asana: "Asana"
|
|
12443
|
+
};
|
|
12444
|
+
sourceLabel = (from) => SOURCE_LABEL[from] ?? "Jira";
|
|
12445
|
+
isExternal = (t) => !!t.external && !t.external.goneAt;
|
|
12446
|
+
JIRA_LOCKED = [
|
|
12447
|
+
"title",
|
|
12448
|
+
"status",
|
|
12449
|
+
"completedAt",
|
|
12450
|
+
"assigneeId",
|
|
12451
|
+
"dueDate",
|
|
12452
|
+
"priority",
|
|
12453
|
+
"parentTaskId",
|
|
12454
|
+
"projectId",
|
|
12455
|
+
"approval",
|
|
12456
|
+
"repeat"
|
|
12457
|
+
];
|
|
12458
|
+
ASANA_LOCKED = [
|
|
12459
|
+
"title",
|
|
12460
|
+
"status",
|
|
12461
|
+
"completedAt",
|
|
12462
|
+
"assigneeId",
|
|
12463
|
+
"dueDate",
|
|
12464
|
+
"startDate",
|
|
12465
|
+
"projectId",
|
|
12466
|
+
"approval",
|
|
12467
|
+
"repeat"
|
|
12468
|
+
];
|
|
12469
|
+
ASANA_LOCKED_NO_START = ASANA_LOCKED.filter((k) => k !== "startDate");
|
|
12470
|
+
NONE$1 = Object.freeze([]);
|
|
12471
|
+
FIELD_WORD = {
|
|
12472
|
+
title: "title",
|
|
12473
|
+
status: "status",
|
|
12474
|
+
completedAt: "status",
|
|
12475
|
+
assigneeId: "owner",
|
|
12476
|
+
dueDate: "due day",
|
|
12477
|
+
startDate: "start day",
|
|
12478
|
+
priority: "priority",
|
|
12479
|
+
parentTaskId: "parent task",
|
|
12480
|
+
projectId: "project"
|
|
12481
|
+
};
|
|
12482
|
+
sameValue = (a, b) => (a ?? null) === (b ?? null) || JSON.stringify(a ?? null) === JSON.stringify(b ?? null);
|
|
12483
|
+
}));
|
|
12484
|
+
|
|
12389
12485
|
// src/tui/moves.ts
|
|
12390
12486
|
init_empty();
|
|
12391
12487
|
init_board();
|
|
12488
|
+
init_rollup_lock();
|
|
12392
12489
|
function moveTask(store, go, task, status) {
|
|
12393
12490
|
const s = store.getState();
|
|
12394
12491
|
if (task.status === status) return;
|
|
12492
|
+
const refusal = externalRefusal(task, { status });
|
|
12493
|
+
if (refusal) return go.notify(refusal);
|
|
12395
12494
|
const overflow = columnWip(s, task.projectId, status, 1);
|
|
12396
|
-
if (!overflow)
|
|
12495
|
+
if (!overflow) {
|
|
12496
|
+
s.moveTask(task.id, status);
|
|
12497
|
+
return saidDone(store, go, task, status);
|
|
12498
|
+
}
|
|
12397
12499
|
if (s.myRole !== "owner") return go.notify(wipFullMessage(overflow));
|
|
12398
12500
|
go.confirm(`${wipFullMessage(overflow)} Raise its limit by one and move it?`, () => {
|
|
12399
12501
|
store.getState().raiseColumnCap(task.projectId, status);
|
|
12400
12502
|
store.getState().moveTask(task.id, status);
|
|
12503
|
+
saidDone(store, go, task, status);
|
|
12401
12504
|
}, "Raise the limit");
|
|
12402
12505
|
}
|
|
12506
|
+
/**
|
|
12507
|
+
* Finishing takes the task off Today and most lists, so say which one went
|
|
12508
|
+
* and how to bring it back. Not when the store held it back (it still waits
|
|
12509
|
+
* on another task, and the store asks about that itself).
|
|
12510
|
+
*/
|
|
12511
|
+
function saidDone(store, go, task, status) {
|
|
12512
|
+
if (status !== "done") return;
|
|
12513
|
+
const s = store.getState();
|
|
12514
|
+
if (s.tasks.find((t) => t.id === task.id)?.status !== "done") return;
|
|
12515
|
+
go.notify(`${keyOf$1(s, task)} “${task.title}” done. u undoes it.`);
|
|
12516
|
+
}
|
|
12403
12517
|
/** Whether a new task fits its column; an owner's go raises the limit first. */
|
|
12404
12518
|
function roomFor(store, projectId, status) {
|
|
12405
12519
|
const s = store.getState();
|
|
@@ -14365,7 +14479,7 @@ var init_load = __esmMin((() => {
|
|
|
14365
14479
|
/** Everything a person carries that someone else would have to pick up, grouped in KIND_ORDER. */
|
|
14366
14480
|
function handoverItems(data, personId) {
|
|
14367
14481
|
const projects = byId(data.projects);
|
|
14368
|
-
const tasks = data.tasks.filter((t) => t.assigneeId === personId && t.status !== "done").map((t) => {
|
|
14482
|
+
const tasks = data.tasks.filter((t) => t.assigneeId === personId && t.status !== "done" && !lockedFields(t).includes("assigneeId")).map((t) => {
|
|
14369
14483
|
const project = projects.get(t.projectId);
|
|
14370
14484
|
const key = taskKey(t, project);
|
|
14371
14485
|
return {
|
|
@@ -14538,7 +14652,7 @@ function returnable(data, person) {
|
|
|
14538
14652
|
switch (m.kind) {
|
|
14539
14653
|
case "task": {
|
|
14540
14654
|
const t = tasks.get(m.id);
|
|
14541
|
-
return Boolean(t && t.assigneeId === m.toId && t.status !== "done");
|
|
14655
|
+
return Boolean(t && t.assigneeId === m.toId && t.status !== "done" && !lockedFields(t).includes("assigneeId"));
|
|
14542
14656
|
}
|
|
14543
14657
|
case "signoff": {
|
|
14544
14658
|
const ms = milestones.get(m.id);
|
|
@@ -14573,6 +14687,7 @@ var init_handover = __esmMin((() => {
|
|
|
14573
14687
|
init_load();
|
|
14574
14688
|
init_task_keys();
|
|
14575
14689
|
init_indexes();
|
|
14690
|
+
init_rollup_lock();
|
|
14576
14691
|
KIND_HEADING = {
|
|
14577
14692
|
task: "Tasks",
|
|
14578
14693
|
signoff: "Sign-offs waiting on them",
|
|
@@ -17690,6 +17805,7 @@ init_date_fns();
|
|
|
17690
17805
|
init_format();
|
|
17691
17806
|
init_indexes();
|
|
17692
17807
|
init_load();
|
|
17808
|
+
init_rollup_lock();
|
|
17693
17809
|
init_task_keys();
|
|
17694
17810
|
init_tide();
|
|
17695
17811
|
const ISO_DAY$1 = /^\d{4}-\d{2}-\d{2}$/;
|
|
@@ -17996,12 +18112,48 @@ function describeChange(c, data) {
|
|
|
17996
18112
|
}
|
|
17997
18113
|
}
|
|
17998
18114
|
/**
|
|
18115
|
+
* The changes applying would leave out because Jira (or Asana) owns what they
|
|
18116
|
+
* touch: dropping a task kept in step from it, its due day or its owner, and
|
|
18117
|
+
* taking someone off when every open task of theirs here is such a task.
|
|
18118
|
+
*/
|
|
18119
|
+
function dockHeld(data, projectId, changes) {
|
|
18120
|
+
const tasks = byId(data.tasks);
|
|
18121
|
+
const owns = (id, field) => {
|
|
18122
|
+
const t = tasks.get(id);
|
|
18123
|
+
return !!t && t.projectId === projectId && lockedFields(t).includes(field);
|
|
18124
|
+
};
|
|
18125
|
+
return changes.filter((c) => {
|
|
18126
|
+
switch (c.kind) {
|
|
18127
|
+
case "drop": {
|
|
18128
|
+
const t = tasks.get(c.taskId);
|
|
18129
|
+
return !!t && t.projectId === projectId && isExternal(t);
|
|
18130
|
+
}
|
|
18131
|
+
case "due": return owns(c.taskId, "dueDate");
|
|
18132
|
+
case "assign": return owns(c.taskId, "assigneeId");
|
|
18133
|
+
case "release": {
|
|
18134
|
+
const theirs = tasksOf(data.tasks, projectId).filter((t) => t.assigneeId === c.personId && t.status !== "done");
|
|
18135
|
+
return theirs.length > 0 && theirs.every((t) => lockedFields(t).includes("assigneeId"));
|
|
18136
|
+
}
|
|
18137
|
+
default: return false;
|
|
18138
|
+
}
|
|
18139
|
+
});
|
|
18140
|
+
}
|
|
18141
|
+
/** "2 changes left out: Jira owns what they would change." Empty when none were. */
|
|
18142
|
+
function heldText(data, projectId, held) {
|
|
18143
|
+
if (held.length === 0) return "";
|
|
18144
|
+
const from = tasksOf(data.tasks, projectId).find(isExternal)?.external?.from ?? "jira";
|
|
18145
|
+
return held.length === 1 ? `1 change left out: ${sourceLabel(from)} owns what it would change.` : `${held.length} changes left out: ${sourceLabel(from)} owns what they would change.`;
|
|
18146
|
+
}
|
|
18147
|
+
/**
|
|
17999
18148
|
* Makes the changes for real, in order, through the store's own actions,
|
|
18000
18149
|
* and clears a saved dry dock from the project. Changes that no longer fit
|
|
18001
|
-
* are skipped
|
|
18150
|
+
* are skipped, and so are the ones `dockHeld` names: those stay on a saved
|
|
18151
|
+
* dry dock, so the plan someone agreed to isn't lost with them. Returns how
|
|
18152
|
+
* many were made.
|
|
18002
18153
|
*/
|
|
18003
18154
|
function applyDock(actions, projectId, changes) {
|
|
18004
|
-
const
|
|
18155
|
+
const start = actions.getState();
|
|
18156
|
+
const project = start.projects.find((p) => p.id === projectId);
|
|
18005
18157
|
if (!project) return 0;
|
|
18006
18158
|
const has = (id) => actions.getState().tasks.some((t) => t.id === id && t.projectId === projectId);
|
|
18007
18159
|
const person = (id) => !id || actions.getState().people.some((p) => p.id === id);
|
|
@@ -18009,8 +18161,11 @@ function applyDock(actions, projectId, changes) {
|
|
|
18009
18161
|
allowOverCap: true,
|
|
18010
18162
|
allowBlocked: true
|
|
18011
18163
|
};
|
|
18164
|
+
const held = dockHeld(start, projectId, changes);
|
|
18165
|
+
const left = new Set(held);
|
|
18012
18166
|
let made = 0;
|
|
18013
18167
|
for (const c of changes) {
|
|
18168
|
+
if (left.has(c)) continue;
|
|
18014
18169
|
switch (c.kind) {
|
|
18015
18170
|
case "drop":
|
|
18016
18171
|
if (!has(c.taskId)) continue;
|
|
@@ -18054,7 +18209,11 @@ function applyDock(actions, projectId, changes) {
|
|
|
18054
18209
|
}
|
|
18055
18210
|
made += 1;
|
|
18056
18211
|
}
|
|
18057
|
-
|
|
18212
|
+
const saved = actions.getState().projects.find((p) => p.id === projectId)?.dryDock;
|
|
18213
|
+
if (saved) actions.updateProject(projectId, { dryDock: held.length ? {
|
|
18214
|
+
...saved,
|
|
18215
|
+
changes: held
|
|
18216
|
+
} : null });
|
|
18058
18217
|
return made;
|
|
18059
18218
|
}
|
|
18060
18219
|
|
|
@@ -18455,8 +18614,8 @@ function isScuttled(project) {
|
|
|
18455
18614
|
}
|
|
18456
18615
|
/**
|
|
18457
18616
|
* Scuttle a project: Done by hand with the reason as its note, its open
|
|
18458
|
-
* tasks unassigned and undated (kept in `scuttled.freed
|
|
18459
|
-
* the register. Null for a project that's already scuttled or gone, or a
|
|
18617
|
+
* tasks unassigned and undated (kept in `scuttled.freed`; tasks kept in step
|
|
18618
|
+
* from Jira are left as they are), and a decision on the register. Null for a project that's already scuttled or gone, or a
|
|
18460
18619
|
* blank why.
|
|
18461
18620
|
*/
|
|
18462
18621
|
function scuttleRows(data, projectId, why, byId, at, decisionId, context = "Closed through Scuttle or sail.") {
|
|
@@ -18466,7 +18625,7 @@ function scuttleRows(data, projectId, why, byId, at, decisionId, context = "Clos
|
|
|
18466
18625
|
const freed = [];
|
|
18467
18626
|
const tasks = [];
|
|
18468
18627
|
for (const t of tasksOf(data.tasks, projectId)) {
|
|
18469
|
-
if (t.status === "done" || !t.assigneeId && !t.dueDate) continue;
|
|
18628
|
+
if (t.status === "done" || !t.assigneeId && !t.dueDate || kept(t)) continue;
|
|
18470
18629
|
freed.push({
|
|
18471
18630
|
taskId: t.id,
|
|
18472
18631
|
assigneeId: t.assigneeId,
|
|
@@ -18530,7 +18689,7 @@ function raiseRows(data, projectId, at, byId) {
|
|
|
18530
18689
|
const tasks = [];
|
|
18531
18690
|
for (const t of tasksOf(data.tasks, projectId)) {
|
|
18532
18691
|
const f = byTask.get(t.id);
|
|
18533
|
-
if (!f || t.status === "done") continue;
|
|
18692
|
+
if (!f || t.status === "done" || kept(t)) continue;
|
|
18534
18693
|
const assigneeId = !t.assigneeId && f.assigneeId && people.has(f.assigneeId) ? f.assigneeId : t.assigneeId;
|
|
18535
18694
|
const dueDate = t.dueDate ?? f.dueDate;
|
|
18536
18695
|
if (assigneeId === t.assigneeId && dueDate === t.dueDate) continue;
|
|
@@ -18554,12 +18713,17 @@ function raiseRows(data, projectId, at, byId) {
|
|
|
18554
18713
|
tasks
|
|
18555
18714
|
};
|
|
18556
18715
|
}
|
|
18557
|
-
var WHY_MAX;
|
|
18716
|
+
var WHY_MAX, kept;
|
|
18558
18717
|
var init_scuttle_rows = __esmMin((() => {
|
|
18559
18718
|
init_assignment();
|
|
18560
18719
|
init_indexes();
|
|
18561
18720
|
init_raid();
|
|
18721
|
+
init_rollup_lock();
|
|
18562
18722
|
WHY_MAX = 600;
|
|
18723
|
+
kept = (t) => {
|
|
18724
|
+
const locked = lockedFields(t);
|
|
18725
|
+
return locked.includes("assigneeId") || locked.includes("dueDate");
|
|
18726
|
+
};
|
|
18563
18727
|
}));
|
|
18564
18728
|
|
|
18565
18729
|
// src/lib/sea-trial.ts
|
|
@@ -25232,6 +25396,15 @@ function foggyTasks(data, today, projectIds) {
|
|
|
25232
25396
|
}
|
|
25233
25397
|
return out.sort((a, b) => b.days - a.days);
|
|
25234
25398
|
}
|
|
25399
|
+
/**
|
|
25400
|
+
* Why the sweep can't give this task a new date or drop it, as one line, or
|
|
25401
|
+
* null when it can: the other tool owns the due day and whether it's there.
|
|
25402
|
+
* Still needed and Skip are left.
|
|
25403
|
+
*/
|
|
25404
|
+
function fogLock(task) {
|
|
25405
|
+
if (!isExternal(task)) return null;
|
|
25406
|
+
return `Kept in step from ${sourceLine(task.external)}: change its due day or remove it there. Here it can be kept or skipped.`;
|
|
25407
|
+
}
|
|
25235
25408
|
/** Whether opening this task should count as touching it: only when it is in fog. */
|
|
25236
25409
|
function isFoggy(task, data, today) {
|
|
25237
25410
|
return task.status !== "done" && daysUntouched(task, data, today) >= 21;
|
|
@@ -25240,6 +25413,7 @@ var FOG_DAYS, THICK_FOG_DAYS, commentCache, fileCache;
|
|
|
25240
25413
|
var init_fog = __esmMin((() => {
|
|
25241
25414
|
init_date_fns();
|
|
25242
25415
|
init_date_text();
|
|
25416
|
+
init_rollup_lock();
|
|
25243
25417
|
FOG_DAYS = 21;
|
|
25244
25418
|
THICK_FOG_DAYS = 35;
|
|
25245
25419
|
commentCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -25661,6 +25835,7 @@ init_date_text();
|
|
|
25661
25835
|
init_date_fns();
|
|
25662
25836
|
init_shipping_forecast();
|
|
25663
25837
|
init_handover();
|
|
25838
|
+
init_rollup_lock();
|
|
25664
25839
|
init_work();
|
|
25665
25840
|
init_task_people();
|
|
25666
25841
|
init_fog();
|
|
@@ -25987,6 +26162,45 @@ function milestoneOut(data, m, today, progress = milestoneProgress(data)) {
|
|
|
25987
26162
|
})) } : {}
|
|
25988
26163
|
};
|
|
25989
26164
|
}
|
|
26165
|
+
/** What update_task and the approval tools call the fields the other tool owns. */
|
|
26166
|
+
const READ_ONLY_WORD = {
|
|
26167
|
+
title: "title",
|
|
26168
|
+
status: "status",
|
|
26169
|
+
assigneeId: "assignee",
|
|
26170
|
+
dueDate: "due",
|
|
26171
|
+
startDate: "starts",
|
|
26172
|
+
priority: "priority",
|
|
26173
|
+
parentTaskId: "parent",
|
|
26174
|
+
projectId: "project",
|
|
26175
|
+
approval: "approval",
|
|
26176
|
+
repeat: "repeat"
|
|
26177
|
+
};
|
|
26178
|
+
/**
|
|
26179
|
+
* Where a task kept in step from Jira or Asana comes from, and what can't be
|
|
26180
|
+
* changed here (`readOnly`, in update_task's words): it changes there and
|
|
26181
|
+
* Harbor follows. Nothing for Harbor's own tasks.
|
|
26182
|
+
*/
|
|
26183
|
+
function fromOf(t) {
|
|
26184
|
+
if (!isExternal(t)) return {};
|
|
26185
|
+
const ext = t.external;
|
|
26186
|
+
const url = safeLink(ext.url);
|
|
26187
|
+
return { from: {
|
|
26188
|
+
tool: sourceLabel(ext.from),
|
|
26189
|
+
...ext.key ? { key: ext.key } : {},
|
|
26190
|
+
...url ? { url } : {},
|
|
26191
|
+
readOnly: lockedFields(t).flatMap((k) => READ_ONLY_WORD[k] ?? [])
|
|
26192
|
+
} };
|
|
26193
|
+
}
|
|
26194
|
+
/** The Jira or Asana project a Harbor project's tasks are kept in step from. */
|
|
26195
|
+
function linkedToOf(p) {
|
|
26196
|
+
const ext = p.external;
|
|
26197
|
+
if (!ext) return {};
|
|
26198
|
+
return { linkedTo: {
|
|
26199
|
+
tool: sourceLabel(ext.from),
|
|
26200
|
+
name: ext.name,
|
|
26201
|
+
...ext.key ? { key: ext.key } : {}
|
|
26202
|
+
} };
|
|
26203
|
+
}
|
|
25990
26204
|
function taskLine(t, people, projects, all, data) {
|
|
25991
26205
|
const waitingOn = blockersOf(t, all).filter(isOpen).length;
|
|
25992
26206
|
const project = projects.get(t.projectId);
|
|
@@ -26004,7 +26218,8 @@ function taskLine(t, people, projects, all, data) {
|
|
|
26004
26218
|
assignee: nameOf$2(people, t.assigneeId),
|
|
26005
26219
|
...alsoOnOf(t, people),
|
|
26006
26220
|
project: project?.name ?? null,
|
|
26007
|
-
...waitingOn ? { waitingOn } : {}
|
|
26221
|
+
...waitingOn ? { waitingOn } : {},
|
|
26222
|
+
...fromOf(t)
|
|
26008
26223
|
};
|
|
26009
26224
|
}
|
|
26010
26225
|
/** Everyone also on a task beside its owner, by name; nothing when it's the owner's alone. */
|
|
@@ -26459,7 +26674,7 @@ const HARBOR_TOOLS = [
|
|
|
26459
26674
|
tool({
|
|
26460
26675
|
name: "get_project",
|
|
26461
26676
|
title: "Project details",
|
|
26462
|
-
description: "One project: health and why, dates, budget, task counts, late tasks, what it waits on, milestones and open risks, when it will likely finish at the crew's recent pace (finish: shortHistory when there's under two weeks of it; lastDue names the open task whose due date the dates wait for, when the pace alone would finish sooner), notes the crew left for later (notesForLater: a sealed one shows only who left it and what opens it, unless it's the person's own), its charter (why, in, out, doneWhen, callsBy; null until someone writes one, and outOfScope lists open tasks whose titles name something it leaves out), its landfall (what should be true some days after it's Done, when Harbor asks, and the answer: yes, partly or no with a number; null until someone sets one; state is sailing while not Done, unset, waiting, due or answered), the project's own task fields (fields: name, type and options, when it has any), and its url on the website." + DATA_NOTE,
|
|
26677
|
+
description: "One project: health and why, dates, budget, task counts, late tasks, what it waits on, milestones and open risks, when it will likely finish at the crew's recent pace (finish: shortHistory when there's under two weeks of it; lastDue names the open task whose due date the dates wait for, when the pace alone would finish sooner), notes the crew left for later (notesForLater: a sealed one shows only who left it and what opens it, unless it's the person's own), its charter (why, in, out, doneWhen, callsBy; null until someone writes one, and outOfScope lists open tasks whose titles name something it leaves out), its landfall (what should be true some days after it's Done, when Harbor asks, and the answer: yes, partly or no with a number; null until someone sets one; state is sailing while not Done, unset, waiting, due or answered), the project's own task fields (fields: name, type and options, when it has any), the Jira project its tasks are kept in step from (linkedTo, when it's linked), and its url on the website." + DATA_NOTE,
|
|
26463
26678
|
input: object({
|
|
26464
26679
|
harbor: harborArg,
|
|
26465
26680
|
project: string().min(1).max(200).describe("Project id or name.")
|
|
@@ -26507,6 +26722,7 @@ const HARBOR_TOOLS = [
|
|
|
26507
26722
|
healthSetBy: "a person",
|
|
26508
26723
|
healthNote: p.healthNote ?? null
|
|
26509
26724
|
} : {},
|
|
26725
|
+
...linkedToOf(p),
|
|
26510
26726
|
starts: dayOf(p.startDate),
|
|
26511
26727
|
ends: dayOf(p.endDate),
|
|
26512
26728
|
...p.baselineStart ? { baselineStarts: dayOf(p.baselineStart) } : {},
|
|
@@ -26584,7 +26800,7 @@ const HARBOR_TOOLS = [
|
|
|
26584
26800
|
tool({
|
|
26585
26801
|
name: "get_task",
|
|
26586
26802
|
title: "Task details",
|
|
26587
|
-
description: "One task: its owner (assignee) and anyone also on it (alsoOn), notes, checklist, its files, what it waits on, what waits on it, its latest comments, the earliest due date its owner's queue suggests (pilotDue: fits says whether the due date holds; absent with no owner, an agent owner, or once done), its place in its board column (`position`, from 1 at the top), time logged on it (timeLogged: the total and the latest entries, when there is any), its values for the project's own fields by name (fields, when it has any; set them with set_field), its subtasks or the task it's a subtask of (subtaskOf), the milestone it's tied to (milestone: its due day, whether it's reached, and how many of its tasks are done of all tied to it), and its url on the website." + DATA_NOTE,
|
|
26803
|
+
description: "One task: its owner (assignee) and anyone also on it (alsoOn), notes, checklist, its files, what it waits on, what waits on it, its latest comments, the earliest due date its owner's queue suggests (pilotDue: fits says whether the due date holds; absent with no owner, an agent owner, or once done), its place in its board column (`position`, from 1 at the top), time logged on it (timeLogged: the total and the latest entries, when there is any), its values for the project's own fields by name (fields, when it has any; set them with set_field), its subtasks or the task it's a subtask of (subtaskOf), the milestone it's tied to (milestone: its due day, whether it's reached, and how many of its tasks are done of all tied to it), where it comes from when it's kept in step from Jira (from: the tool, its key and link there, and readOnly, the fields that change there and can't be changed here), and its url on the website." + DATA_NOTE,
|
|
26588
26804
|
input: object({
|
|
26589
26805
|
harbor: harborArg,
|
|
26590
26806
|
task: string().min(1).max(100).describe("Task id or key (\"RR-42\"), from search_tasks or my_work.")
|
|
@@ -26628,6 +26844,7 @@ const HARBOR_TOOLS = [
|
|
|
26628
26844
|
...alsoOnOf(t, people),
|
|
26629
26845
|
project: project?.name ?? null,
|
|
26630
26846
|
projectId: t.projectId,
|
|
26847
|
+
...fromOf(t),
|
|
26631
26848
|
created: dayOf(t.createdAt),
|
|
26632
26849
|
...t.completedAt ? { finished: dayOf(t.completedAt) } : {},
|
|
26633
26850
|
...t.repeat ? { repeats: t.repeat } : {},
|
|
@@ -29491,64 +29708,69 @@ function matches(rule, prev, next, created) {
|
|
|
29491
29708
|
function runActions(actions, start, ctx) {
|
|
29492
29709
|
let task = start;
|
|
29493
29710
|
const comments = [];
|
|
29494
|
-
|
|
29495
|
-
|
|
29496
|
-
|
|
29497
|
-
|
|
29498
|
-
|
|
29499
|
-
|
|
29500
|
-
|
|
29501
|
-
|
|
29502
|
-
|
|
29503
|
-
|
|
29504
|
-
|
|
29711
|
+
const locked = lockedFields(start);
|
|
29712
|
+
for (const action of actions) {
|
|
29713
|
+
const field = ACTION_FIELD[action.type];
|
|
29714
|
+
if (field && locked.includes(field)) continue;
|
|
29715
|
+
switch (action.type) {
|
|
29716
|
+
case "set_status": {
|
|
29717
|
+
if (!action.status) break;
|
|
29718
|
+
if (action.status === "done" && task.status !== "done" && ctx.waiting?.(task)) {
|
|
29719
|
+
comments.push({
|
|
29720
|
+
taskId: task.id,
|
|
29721
|
+
authorId: ctx.authorId,
|
|
29722
|
+
body: "Left open: this still waits on unfinished work, so the rule didn’t finish it.",
|
|
29723
|
+
createdAt: ctx.now,
|
|
29724
|
+
mentionedIds: []
|
|
29725
|
+
});
|
|
29726
|
+
break;
|
|
29727
|
+
}
|
|
29728
|
+
const wasDone = task.status === "done";
|
|
29729
|
+
const completedAt = action.status === "done" ? task.completedAt ?? ctx.now : wasDone ? null : task.completedAt;
|
|
29730
|
+
task = {
|
|
29731
|
+
...task,
|
|
29732
|
+
status: action.status,
|
|
29733
|
+
completedAt
|
|
29734
|
+
};
|
|
29505
29735
|
break;
|
|
29506
29736
|
}
|
|
29507
|
-
|
|
29508
|
-
|
|
29509
|
-
|
|
29510
|
-
|
|
29511
|
-
|
|
29512
|
-
|
|
29513
|
-
|
|
29514
|
-
|
|
29515
|
-
|
|
29516
|
-
|
|
29517
|
-
|
|
29518
|
-
|
|
29519
|
-
|
|
29520
|
-
|
|
29521
|
-
|
|
29522
|
-
|
|
29523
|
-
|
|
29524
|
-
|
|
29525
|
-
|
|
29526
|
-
}
|
|
29527
|
-
|
|
29528
|
-
|
|
29529
|
-
|
|
29530
|
-
|
|
29531
|
-
|
|
29532
|
-
|
|
29533
|
-
|
|
29534
|
-
|
|
29535
|
-
|
|
29536
|
-
|
|
29537
|
-
|
|
29538
|
-
|
|
29539
|
-
|
|
29540
|
-
|
|
29541
|
-
|
|
29542
|
-
};
|
|
29543
|
-
break;
|
|
29737
|
+
case "set_priority":
|
|
29738
|
+
if (action.priority) task = {
|
|
29739
|
+
...task,
|
|
29740
|
+
priority: action.priority
|
|
29741
|
+
};
|
|
29742
|
+
break;
|
|
29743
|
+
case "set_assignee":
|
|
29744
|
+
task = {
|
|
29745
|
+
...task,
|
|
29746
|
+
assigneeId: action.assigneeId ?? null
|
|
29747
|
+
};
|
|
29748
|
+
break;
|
|
29749
|
+
case "set_due": {
|
|
29750
|
+
const n = Math.min(365, Math.max(0, Math.round(action.inDays ?? 0)));
|
|
29751
|
+
task = {
|
|
29752
|
+
...task,
|
|
29753
|
+
dueDate: dayAfter(ctx.today, n)
|
|
29754
|
+
};
|
|
29755
|
+
break;
|
|
29756
|
+
}
|
|
29757
|
+
case "add_follower": {
|
|
29758
|
+
const id = action.personId;
|
|
29759
|
+
if (!id || id === task.assigneeId || task.followerIds?.includes(id)) break;
|
|
29760
|
+
task = {
|
|
29761
|
+
...task,
|
|
29762
|
+
followerIds: [...task.followerIds ?? [], id]
|
|
29763
|
+
};
|
|
29764
|
+
break;
|
|
29765
|
+
}
|
|
29766
|
+
case "add_comment": if (action.commentBody?.trim()) comments.push({
|
|
29767
|
+
taskId: task.id,
|
|
29768
|
+
authorId: ctx.authorId,
|
|
29769
|
+
body: action.commentBody.trim(),
|
|
29770
|
+
createdAt: ctx.now,
|
|
29771
|
+
mentionedIds: []
|
|
29772
|
+
});
|
|
29544
29773
|
}
|
|
29545
|
-
case "add_comment": if (action.commentBody?.trim()) comments.push({
|
|
29546
|
-
taskId: task.id,
|
|
29547
|
-
authorId: ctx.authorId,
|
|
29548
|
-
body: action.commentBody.trim(),
|
|
29549
|
-
createdAt: ctx.now,
|
|
29550
|
-
mentionedIds: []
|
|
29551
|
-
});
|
|
29552
29774
|
}
|
|
29553
29775
|
return {
|
|
29554
29776
|
task,
|
|
@@ -29585,12 +29807,19 @@ function applyAutomations(project, prev, next, opts) {
|
|
|
29585
29807
|
comments
|
|
29586
29808
|
};
|
|
29587
29809
|
}
|
|
29588
|
-
var dayAfter;
|
|
29810
|
+
var dayAfter, ACTION_FIELD;
|
|
29589
29811
|
var init_automations = __esmMin((() => {
|
|
29590
29812
|
init_date_fns();
|
|
29591
29813
|
init_date_text();
|
|
29592
29814
|
init_format();
|
|
29815
|
+
init_rollup_lock();
|
|
29593
29816
|
dayAfter = (day, n) => format(addDays(parseIso(day), n), "yyyy-MM-dd");
|
|
29817
|
+
ACTION_FIELD = {
|
|
29818
|
+
set_status: "status",
|
|
29819
|
+
set_priority: "priority",
|
|
29820
|
+
set_assignee: "assigneeId",
|
|
29821
|
+
set_due: "dueDate"
|
|
29822
|
+
};
|
|
29594
29823
|
}));
|
|
29595
29824
|
|
|
29596
29825
|
// src/lib/focus.ts
|
|
@@ -29713,6 +29942,13 @@ function applyBulk(task, change) {
|
|
|
29713
29942
|
priority: change.priority
|
|
29714
29943
|
};
|
|
29715
29944
|
}
|
|
29945
|
+
/** The task field a bulk change sets. */
|
|
29946
|
+
function bulkField(change) {
|
|
29947
|
+
if ("status" in change) return "status";
|
|
29948
|
+
if ("assigneeId" in change) return "assigneeId";
|
|
29949
|
+
if ("priority" in change) return "priority";
|
|
29950
|
+
return "dueDate";
|
|
29951
|
+
}
|
|
29716
29952
|
/** What the change did, for the Activity line and the tray's notice: "moved 4 tasks to In play". */
|
|
29717
29953
|
function bulkText(change, n, names = {}) {
|
|
29718
29954
|
const tasks = plural$2(n);
|
|
@@ -29726,12 +29962,14 @@ function bulkText(change, n, names = {}) {
|
|
|
29726
29962
|
}
|
|
29727
29963
|
return `set ${tasks} to ${PRIORITY_LABEL[change.priority].toLowerCase()} priority`;
|
|
29728
29964
|
}
|
|
29729
|
-
var plural$2;
|
|
29965
|
+
var bulkLocked, plural$2;
|
|
29730
29966
|
var init_bulk = __esmMin((() => {
|
|
29731
29967
|
init_date_fns();
|
|
29732
29968
|
init_date_text();
|
|
29733
29969
|
init_format();
|
|
29734
29970
|
init_swatches();
|
|
29971
|
+
init_rollup_lock();
|
|
29972
|
+
bulkLocked = (task, change) => lockedFields(task).includes(bulkField(change));
|
|
29735
29973
|
plural$2 = (n) => `${n} ${n === 1 ? "task" : "tasks"}`;
|
|
29736
29974
|
}));
|
|
29737
29975
|
|
|
@@ -29810,6 +30048,13 @@ function tasksSlice({ set, get, write }) {
|
|
|
29810
30048
|
},
|
|
29811
30049
|
updateTask: (id, patch, opts) => {
|
|
29812
30050
|
const task = get().tasks.find((row) => row.id === id);
|
|
30051
|
+
if (task) {
|
|
30052
|
+
const mine = withoutLocked(task, patch);
|
|
30053
|
+
if (mine !== patch) {
|
|
30054
|
+
if (Object.keys(mine).length === 0) return;
|
|
30055
|
+
patch = mine;
|
|
30056
|
+
}
|
|
30057
|
+
}
|
|
29813
30058
|
if (task && patch.parentTaskId && subtaskProblem(id, patch.parentTaskId, get().tasks)) {
|
|
29814
30059
|
patch = { ...patch };
|
|
29815
30060
|
delete patch.parentTaskId;
|
|
@@ -29830,7 +30075,9 @@ function tasksSlice({ set, get, write }) {
|
|
|
29830
30075
|
}
|
|
29831
30076
|
}
|
|
29832
30077
|
const moving = task && patch.projectId && patch.projectId !== task.projectId;
|
|
29833
|
-
const
|
|
30078
|
+
const under = moving ? subtasksOf(task, get().tasks) : [];
|
|
30079
|
+
const carried = moving ? new Set(under.filter((t) => !lockedFields(t).includes("projectId")).map((t) => t.id)) : null;
|
|
30080
|
+
const left = new Set(under.filter((t) => !carried?.has(t.id)).map((t) => t.id));
|
|
29834
30081
|
if (moving && task.parentTaskId && !("parentTaskId" in patch)) patch = {
|
|
29835
30082
|
...patch,
|
|
29836
30083
|
parentTaskId: null
|
|
@@ -29843,6 +30090,10 @@ function tasksSlice({ set, get, write }) {
|
|
|
29843
30090
|
projectId: patch.projectId,
|
|
29844
30091
|
touchedAt: stamp()
|
|
29845
30092
|
};
|
|
30093
|
+
if (left.has(row.id)) return {
|
|
30094
|
+
...row,
|
|
30095
|
+
parentTaskId: null
|
|
30096
|
+
};
|
|
29846
30097
|
if (row.id !== id) return row;
|
|
29847
30098
|
const next = {
|
|
29848
30099
|
...row,
|
|
@@ -29888,6 +30139,7 @@ function tasksSlice({ set, get, write }) {
|
|
|
29888
30139
|
moveTask: (id, status, opts) => {
|
|
29889
30140
|
const task = get().tasks.find((row) => row.id === id);
|
|
29890
30141
|
if (!task || task.status === status) return;
|
|
30142
|
+
if (isExternal(task)) return;
|
|
29891
30143
|
if (status === "done" && !opts?.allowBlocked && isBlocked$1(task, get().tasks)) {
|
|
29892
30144
|
set({ blockPending: {
|
|
29893
30145
|
blockerTitle: openBlockerNames(task, get().tasks) || "another task",
|
|
@@ -29934,6 +30186,7 @@ function tasksSlice({ set, get, write }) {
|
|
|
29934
30186
|
},
|
|
29935
30187
|
deleteTask: (id) => {
|
|
29936
30188
|
const task = get().tasks.find((t) => t.id === id);
|
|
30189
|
+
if (task && isExternal(task)) return;
|
|
29937
30190
|
write({
|
|
29938
30191
|
tasks: get().tasks.filter((t) => t.id !== id),
|
|
29939
30192
|
comments: get().comments.filter((c) => c.taskId !== id),
|
|
@@ -29973,7 +30226,8 @@ function tasksSlice({ set, get, write }) {
|
|
|
29973
30226
|
const task = get().tasks.find((t) => t.id === taskId);
|
|
29974
30227
|
const text = body.trim();
|
|
29975
30228
|
if (!task || !text) return;
|
|
29976
|
-
|
|
30229
|
+
const external = isExternal(task);
|
|
30230
|
+
if (status !== "same" && task.status !== status && !external) get().moveTask(taskId, status, { allowOverCap: opts?.allowOverCap });
|
|
29977
30231
|
const at = stamp();
|
|
29978
30232
|
const moved = get().tasks.find((t) => t.id === taskId);
|
|
29979
30233
|
const agent = get().people.find((p) => p.id === agentId);
|
|
@@ -29981,7 +30235,7 @@ function tasksSlice({ set, get, write }) {
|
|
|
29981
30235
|
const gone = [...useFormerAccounts.getState().ids, ...opts?.gone ?? []];
|
|
29982
30236
|
const asked = get().people.find((p) => p.id === moved?.approval?.approverId);
|
|
29983
30237
|
const lost = waiting && isAgent(get().people.find((p) => p.id === moved.approval.askedById)) && (!asked || isFormerCrew(asked, gone));
|
|
29984
|
-
if (status === "review" && moved?.status === "review" && agent && (!waiting || lost)) {
|
|
30238
|
+
if (status === "review" && moved?.status === "review" && agent && !external && (!waiting || lost)) {
|
|
29985
30239
|
const checker = agentChecker(get().people, moved, agent, gone);
|
|
29986
30240
|
if (checker) write({ tasks: get().tasks.map((t) => t.id === taskId ? {
|
|
29987
30241
|
...t,
|
|
@@ -30149,10 +30403,10 @@ function tasksSlice({ set, get, write }) {
|
|
|
30149
30403
|
set({ readPingIds: [...have] });
|
|
30150
30404
|
},
|
|
30151
30405
|
tickVoyage: (ids) => {
|
|
30152
|
-
const
|
|
30153
|
-
const ticked = get().tasks.filter((t) => tick.has(t.id) && t.status !== "done");
|
|
30406
|
+
const ticked = get().tasks.filter((t) => ids.includes(t.id) && t.status !== "done" && !isExternal(t));
|
|
30154
30407
|
if (ticked.length === 0) return;
|
|
30155
|
-
|
|
30408
|
+
const tick = new Set(ticked.map((t) => t.id));
|
|
30409
|
+
write({ tasks: get().tasks.map((t) => tick.has(t.id) ? withStatus(t, "done", {
|
|
30156
30410
|
people: get().people,
|
|
30157
30411
|
by: get().currentUserId
|
|
30158
30412
|
}) : t) });
|
|
@@ -30172,7 +30426,7 @@ function tasksSlice({ set, get, write }) {
|
|
|
30172
30426
|
editTasks: (ids, change, opts) => {
|
|
30173
30427
|
const s = get();
|
|
30174
30428
|
const pick = new Set(ids.slice(0, 500));
|
|
30175
|
-
const moving = s.tasks.filter((t) => pick.has(t.id)).filter((t) => applyBulk(t, change) !== t);
|
|
30429
|
+
const moving = s.tasks.filter((t) => pick.has(t.id) && !bulkLocked(t, change)).filter((t) => applyBulk(t, change) !== t);
|
|
30176
30430
|
if (moving.length === 0) return { changed: 0 };
|
|
30177
30431
|
if ("status" in change) {
|
|
30178
30432
|
if (change.status === "done" && !opts?.allowBlocked) {
|
|
@@ -30350,6 +30604,7 @@ var init_tasks = __esmMin((() => {
|
|
|
30350
30604
|
init_task_people();
|
|
30351
30605
|
init_subtasks();
|
|
30352
30606
|
init_task_start();
|
|
30607
|
+
init_rollup_lock();
|
|
30353
30608
|
}));
|
|
30354
30609
|
|
|
30355
30610
|
// src/lib/raid-history.ts
|
|
@@ -31033,7 +31288,8 @@ function peopleSpendSlice({ set, get, write }) {
|
|
|
31033
31288
|
/**
|
|
31034
31289
|
* One handover's changes as a single write: each item to its new person, the
|
|
31035
31290
|
* line that travels with it (a comment on a task, an update on a RAID item),
|
|
31036
|
-
* and the moves that actually applied. Done or missing items are skipped
|
|
31291
|
+
* and the moves that actually applied. Done or missing items are skipped, and
|
|
31292
|
+
* so are tasks whose owner Jira sets.
|
|
31037
31293
|
*/
|
|
31038
31294
|
function applyMoves(s, moves, lineFor) {
|
|
31039
31295
|
const by = s.currentUserId;
|
|
@@ -31054,7 +31310,7 @@ function applyMoves(s, moves, lineFor) {
|
|
|
31054
31310
|
const patch = {};
|
|
31055
31311
|
if (tasksTo.size) patch.tasks = s.tasks.map((t) => {
|
|
31056
31312
|
const m = tasksTo.get(t.id);
|
|
31057
|
-
if (!m || t.status === "done" || t.assigneeId === m.toId) return t;
|
|
31313
|
+
if (!m || t.status === "done" || t.assigneeId === m.toId || lockedFields(t).includes("assigneeId")) return t;
|
|
31058
31314
|
done(m);
|
|
31059
31315
|
comments.push({
|
|
31060
31316
|
id: uid("c"),
|
|
@@ -31123,6 +31379,7 @@ var init_people_spend = __esmMin((() => {
|
|
|
31123
31379
|
init_format();
|
|
31124
31380
|
init_handover();
|
|
31125
31381
|
init_assignment();
|
|
31382
|
+
init_rollup_lock();
|
|
31126
31383
|
init_spend();
|
|
31127
31384
|
init_utils();
|
|
31128
31385
|
init_countries();
|
|
@@ -33526,6 +33783,11 @@ async function tryHere(opts) {
|
|
|
33526
33783
|
}
|
|
33527
33784
|
if (opts.apply) {
|
|
33528
33785
|
const s = store.getState();
|
|
33786
|
+
const held = heldText(s, project.id, dockHeld(s, project.id, changes));
|
|
33787
|
+
if (held) {
|
|
33788
|
+
result.held = held;
|
|
33789
|
+
result.lines.push("", held);
|
|
33790
|
+
}
|
|
33529
33791
|
result.applied = applyDock({
|
|
33530
33792
|
getState: store.getState,
|
|
33531
33793
|
deleteTask: s.deleteTask,
|
|
@@ -33720,6 +33982,7 @@ function DockPanel({ id, width, height, go, active, onClose }) {
|
|
|
33720
33982
|
});
|
|
33721
33983
|
go.confirm(`Make ${changes.length === 1 ? "this change" : `these ${changes.length} changes`} to ${project.name} for real?${drops.length ? ` That removes ${drops.join(", ")}.` : ""} u undoes it.`, () => {
|
|
33722
33984
|
const s = store.getState();
|
|
33985
|
+
const held = heldText(s, project.id, dockHeld(s, project.id, changes));
|
|
33723
33986
|
const made = applyDock({
|
|
33724
33987
|
getState: store.getState,
|
|
33725
33988
|
deleteTask: s.deleteTask,
|
|
@@ -33729,7 +33992,7 @@ function DockPanel({ id, width, height, go, active, onClose }) {
|
|
|
33729
33992
|
setAllocation: s.setAllocation
|
|
33730
33993
|
}, project.id, changes);
|
|
33731
33994
|
setChanges([]);
|
|
33732
|
-
go.notify(`Made ${made} change${made === 1 ? "" : "s"}
|
|
33995
|
+
go.notify(`Made ${made} change${made === 1 ? "" : "s"}.${held ? ` ${held}` : ""}`);
|
|
33733
33996
|
onClose();
|
|
33734
33997
|
}, "Apply");
|
|
33735
33998
|
};
|
|
@@ -35210,6 +35473,7 @@ function taskFromTemplate(template, opts) {
|
|
|
35210
35473
|
init_swatches();
|
|
35211
35474
|
init_format();
|
|
35212
35475
|
init_task_people();
|
|
35476
|
+
init_rollup_lock();
|
|
35213
35477
|
init_hill();
|
|
35214
35478
|
init_bottle();
|
|
35215
35479
|
init_clock();
|
|
@@ -35370,7 +35634,11 @@ function ProjectView({ projectId, active, width, height, go, onBack }) {
|
|
|
35370
35634
|
if (key.return && selected) return go.openTask(selected.id);
|
|
35371
35635
|
if (input === "n") return go.newTask(projectId, mode === "board" ? column?.status : void 0);
|
|
35372
35636
|
if (input === "x" && selected) return moveTask(store, go, selected, "done");
|
|
35373
|
-
if (input === "d" && selected)
|
|
35637
|
+
if (input === "d" && selected) {
|
|
35638
|
+
const refusal = externalDeleteRefusal(selected);
|
|
35639
|
+
if (refusal) return go.notify(refusal);
|
|
35640
|
+
return go.confirm(`Delete ${keyOf$1({ projects }, selected)} “${selected.title}”? u undoes it.`, () => store.getState().deleteTask(selected.id), "Delete");
|
|
35641
|
+
}
|
|
35374
35642
|
if (mode === "board") {
|
|
35375
35643
|
if (key.leftArrow || input === "h") setCol((c) => step$1(c, -1, columns.length));
|
|
35376
35644
|
else if (key.rightArrow || input === "l") setCol((c) => step$1(c, 1, columns.length));
|
|
@@ -36587,6 +36855,14 @@ function offer(def, t) {
|
|
|
36587
36855
|
return opts.length ? `“${t}” isn't one of ${def.name}'s options: ${opts.join(", ")}.` : `${def.name} has no options yet.`;
|
|
36588
36856
|
}
|
|
36589
36857
|
|
|
36858
|
+
// src/tui/locks.ts
|
|
36859
|
+
init_rollup_lock();
|
|
36860
|
+
/** Why this field can't be changed here, before any new value is typed; null when it can. */
|
|
36861
|
+
function fieldLock(task, field) {
|
|
36862
|
+
if (!lockedFields(task).includes(field)) return null;
|
|
36863
|
+
return externalRefusal(task, { [field]: Symbol("other") });
|
|
36864
|
+
}
|
|
36865
|
+
|
|
36590
36866
|
// src/tui/views/sounding.ts
|
|
36591
36867
|
init_soundings();
|
|
36592
36868
|
const nameOf = (people, id) => people.find((p) => p.id === id)?.name ?? "someone";
|
|
@@ -36727,6 +37003,7 @@ init_task_people();
|
|
|
36727
37003
|
init_search();
|
|
36728
37004
|
init_swatches();
|
|
36729
37005
|
init_task_milestones();
|
|
37006
|
+
init_rollup_lock();
|
|
36730
37007
|
const FIELDS = [
|
|
36731
37008
|
{
|
|
36732
37009
|
field: "title",
|
|
@@ -36765,6 +37042,16 @@ const FIELDS = [
|
|
|
36765
37042
|
label: "Notes"
|
|
36766
37043
|
}
|
|
36767
37044
|
];
|
|
37045
|
+
/** The task field each row changes, for the ones Jira or Asana may own. */
|
|
37046
|
+
const LOCKABLE = {
|
|
37047
|
+
title: "title",
|
|
37048
|
+
status: "status",
|
|
37049
|
+
assignee: "assigneeId",
|
|
37050
|
+
due: "dueDate",
|
|
37051
|
+
priority: "priority",
|
|
37052
|
+
project: "projectId",
|
|
37053
|
+
repeat: "repeat"
|
|
37054
|
+
};
|
|
36768
37055
|
const REPEATS = [
|
|
36769
37056
|
null,
|
|
36770
37057
|
"weekly",
|
|
@@ -36846,10 +37133,14 @@ function TaskPanel({ taskId, width, height, go, active = true, onClose }) {
|
|
|
36846
37133
|
}
|
|
36847
37134
|
}, task.title);
|
|
36848
37135
|
}
|
|
36849
|
-
if (input === "d")
|
|
36850
|
-
|
|
36851
|
-
|
|
36852
|
-
|
|
37136
|
+
if (input === "d") {
|
|
37137
|
+
const refusal = externalDeleteRefusal(task);
|
|
37138
|
+
if (refusal) return go.notify(refusal);
|
|
37139
|
+
return go.confirm(`Delete ${keyOf$1({ projects }, task)} “${task.title}”? u undoes it.`, () => {
|
|
37140
|
+
store.getState().deleteTask(task.id);
|
|
37141
|
+
onClose();
|
|
37142
|
+
}, "Delete");
|
|
37143
|
+
}
|
|
36853
37144
|
const custom = own[at - FIELDS.length];
|
|
36854
37145
|
if (custom && key.return) return editCustom(custom);
|
|
36855
37146
|
const item = task.checklist[at - stepsFrom];
|
|
@@ -36870,10 +37161,16 @@ function TaskPanel({ taskId, width, height, go, active = true, onClose }) {
|
|
|
36870
37161
|
field: "also"
|
|
36871
37162
|
});
|
|
36872
37163
|
}
|
|
36873
|
-
if (key.return && FIELDS[at])
|
|
36874
|
-
|
|
36875
|
-
|
|
36876
|
-
|
|
37164
|
+
if (key.return && FIELDS[at]) {
|
|
37165
|
+
const field = FIELDS[at].field;
|
|
37166
|
+
const owned = LOCKABLE[field];
|
|
37167
|
+
const refusal = owned ? fieldLock(task, owned) : null;
|
|
37168
|
+
if (refusal) return go.notify(refusal);
|
|
37169
|
+
return setEditing({
|
|
37170
|
+
kind: "field",
|
|
37171
|
+
field
|
|
37172
|
+
});
|
|
37173
|
+
}
|
|
36877
37174
|
}, { isActive: active && editing === null });
|
|
36878
37175
|
if (!task) return null;
|
|
36879
37176
|
const project = projects.find((p) => p.id === task.projectId);
|
|
@@ -38739,12 +39036,17 @@ async function sweepFog(opts) {
|
|
|
38739
39036
|
].filter(Boolean).join(" · ");
|
|
38740
39037
|
say(`${i + 1} of ${queue.length} ${task.title}`);
|
|
38741
39038
|
say(` ${where}`);
|
|
39039
|
+
const lock = fogLock(task);
|
|
39040
|
+
if (lock) say(` ${lock}`);
|
|
38742
39041
|
for (;;) {
|
|
38743
39042
|
const key = (await ask(" k, d, x, s or q: ")).trim().toLowerCase();
|
|
38744
39043
|
if (key === "k") {
|
|
38745
39044
|
store.getState().keepTasks([task.id]);
|
|
38746
39045
|
tally.kept++;
|
|
38747
39046
|
say(" Kept. The fog's off it.\n");
|
|
39047
|
+
} else if (lock && (key === "d" || key === "x")) {
|
|
39048
|
+
say(` ${lock}`);
|
|
39049
|
+
continue;
|
|
38748
39050
|
} else if (key === "d") {
|
|
38749
39051
|
let due = null;
|
|
38750
39052
|
while (!due) {
|
package/lib/cli.mjs
CHANGED
|
@@ -2361,6 +2361,7 @@ export async function run(argv, io = {}) {
|
|
|
2361
2361
|
crewPacePercent: Math.round(c.pace * 100),
|
|
2362
2362
|
...(result.applied !== undefined ? { applied: result.applied } : {}),
|
|
2363
2363
|
...(result.saved ? { saved: true } : {}),
|
|
2364
|
+
...(result.held ? { held: result.held } : {}),
|
|
2364
2365
|
notes: [...c.notes, ...notes],
|
|
2365
2366
|
}),
|
|
2366
2367
|
);
|