@harborppm/cli 0.115.0 → 0.116.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 +399 -116
- 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,12 +12386,107 @@ 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.
|
|
12399
|
+
*/
|
|
12400
|
+
function lockedFields(t) {
|
|
12401
|
+
if (!isExternal(t)) return NONE$1;
|
|
12402
|
+
return t.external.from === "asana" ? ASANA_LOCKED : JIRA_LOCKED;
|
|
12403
|
+
}
|
|
12404
|
+
/** `patch` without the fields the other tool owns; the same object when it held none. */
|
|
12405
|
+
function withoutLocked(t, patch) {
|
|
12406
|
+
const locked = lockedFields(t);
|
|
12407
|
+
if (locked.length === 0 || !locked.some((k) => k in patch)) return patch;
|
|
12408
|
+
const out = { ...patch };
|
|
12409
|
+
for (const k of locked) delete out[k];
|
|
12410
|
+
return out;
|
|
12411
|
+
}
|
|
12412
|
+
/**
|
|
12413
|
+
* Why `patch` can't be made to this task, as one sentence, or null when it
|
|
12414
|
+
* can: the task is Harbor's own, or the patch leaves the other tool's fields
|
|
12415
|
+
* as they are. Say it wherever a silent no-op would puzzle (an agent's tool
|
|
12416
|
+
* answer, a drop on the board).
|
|
12417
|
+
*/
|
|
12418
|
+
function externalRefusal(t, patch) {
|
|
12419
|
+
const touched = lockedFields(t).filter((k) => k in patch && !sameValue(patch[k], t[k]));
|
|
12420
|
+
if (touched.length === 0) return null;
|
|
12421
|
+
const ext = t.external;
|
|
12422
|
+
const tool = sourceLabel(ext.from);
|
|
12423
|
+
const from = `“${t.title}” is kept in step from ${tool}${ext.key ? ` (${ext.key})` : ""}`;
|
|
12424
|
+
const words = [...new Set(touched.flatMap((k) => FIELD_WORD[k] ?? []))];
|
|
12425
|
+
if (words.length === 0) return `${from}, so it can't ${touched.includes("repeat") ? "repeat" : "be sent for approval"} here.`;
|
|
12426
|
+
return `${from}. Change its ${words.length === 1 ? words[0] : `${words.slice(0, -1).join(", ")} and ${words[words.length - 1]}`} there; Harbor follows.`;
|
|
12427
|
+
}
|
|
12428
|
+
/** Why this task can't be deleted here, or null when it can. */
|
|
12429
|
+
function externalDeleteRefusal(t) {
|
|
12430
|
+
if (!isExternal(t)) return null;
|
|
12431
|
+
const ext = t.external;
|
|
12432
|
+
const tool = sourceLabel(ext.from);
|
|
12433
|
+
return `“${t.title}” is kept in step from ${tool}${ext.key ? ` (${ext.key})` : ""}. Remove it there, or unlink the project; Harbor follows.`;
|
|
12434
|
+
}
|
|
12435
|
+
var SOURCE_LABEL, sourceLabel, isExternal, JIRA_LOCKED, ASANA_LOCKED, NONE$1, FIELD_WORD, sameValue;
|
|
12436
|
+
var init_rollup_lock = __esmMin((() => {
|
|
12437
|
+
SOURCE_LABEL = {
|
|
12438
|
+
jira: "Jira",
|
|
12439
|
+
asana: "Asana"
|
|
12440
|
+
};
|
|
12441
|
+
sourceLabel = (from) => SOURCE_LABEL[from] ?? "Jira";
|
|
12442
|
+
isExternal = (t) => !!t.external && !t.external.goneAt;
|
|
12443
|
+
JIRA_LOCKED = [
|
|
12444
|
+
"title",
|
|
12445
|
+
"status",
|
|
12446
|
+
"completedAt",
|
|
12447
|
+
"assigneeId",
|
|
12448
|
+
"dueDate",
|
|
12449
|
+
"priority",
|
|
12450
|
+
"parentTaskId",
|
|
12451
|
+
"projectId",
|
|
12452
|
+
"approval",
|
|
12453
|
+
"repeat"
|
|
12454
|
+
];
|
|
12455
|
+
ASANA_LOCKED = [
|
|
12456
|
+
"title",
|
|
12457
|
+
"status",
|
|
12458
|
+
"completedAt",
|
|
12459
|
+
"assigneeId",
|
|
12460
|
+
"dueDate",
|
|
12461
|
+
"startDate",
|
|
12462
|
+
"projectId",
|
|
12463
|
+
"approval",
|
|
12464
|
+
"repeat"
|
|
12465
|
+
];
|
|
12466
|
+
NONE$1 = Object.freeze([]);
|
|
12467
|
+
FIELD_WORD = {
|
|
12468
|
+
title: "title",
|
|
12469
|
+
status: "status",
|
|
12470
|
+
completedAt: "status",
|
|
12471
|
+
assigneeId: "owner",
|
|
12472
|
+
dueDate: "due day",
|
|
12473
|
+
startDate: "start day",
|
|
12474
|
+
priority: "priority",
|
|
12475
|
+
parentTaskId: "parent task",
|
|
12476
|
+
projectId: "project"
|
|
12477
|
+
};
|
|
12478
|
+
sameValue = (a, b) => (a ?? null) === (b ?? null) || JSON.stringify(a ?? null) === JSON.stringify(b ?? null);
|
|
12479
|
+
}));
|
|
12480
|
+
|
|
12389
12481
|
// src/tui/moves.ts
|
|
12390
12482
|
init_empty();
|
|
12391
12483
|
init_board();
|
|
12484
|
+
init_rollup_lock();
|
|
12392
12485
|
function moveTask(store, go, task, status) {
|
|
12393
12486
|
const s = store.getState();
|
|
12394
12487
|
if (task.status === status) return;
|
|
12488
|
+
const refusal = externalRefusal(task, { status });
|
|
12489
|
+
if (refusal) return go.notify(refusal);
|
|
12395
12490
|
const overflow = columnWip(s, task.projectId, status, 1);
|
|
12396
12491
|
if (!overflow) return s.moveTask(task.id, status);
|
|
12397
12492
|
if (s.myRole !== "owner") return go.notify(wipFullMessage(overflow));
|
|
@@ -14365,7 +14460,7 @@ var init_load = __esmMin((() => {
|
|
|
14365
14460
|
/** Everything a person carries that someone else would have to pick up, grouped in KIND_ORDER. */
|
|
14366
14461
|
function handoverItems(data, personId) {
|
|
14367
14462
|
const projects = byId(data.projects);
|
|
14368
|
-
const tasks = data.tasks.filter((t) => t.assigneeId === personId && t.status !== "done").map((t) => {
|
|
14463
|
+
const tasks = data.tasks.filter((t) => t.assigneeId === personId && t.status !== "done" && !lockedFields(t).includes("assigneeId")).map((t) => {
|
|
14369
14464
|
const project = projects.get(t.projectId);
|
|
14370
14465
|
const key = taskKey(t, project);
|
|
14371
14466
|
return {
|
|
@@ -14538,7 +14633,7 @@ function returnable(data, person) {
|
|
|
14538
14633
|
switch (m.kind) {
|
|
14539
14634
|
case "task": {
|
|
14540
14635
|
const t = tasks.get(m.id);
|
|
14541
|
-
return Boolean(t && t.assigneeId === m.toId && t.status !== "done");
|
|
14636
|
+
return Boolean(t && t.assigneeId === m.toId && t.status !== "done" && !lockedFields(t).includes("assigneeId"));
|
|
14542
14637
|
}
|
|
14543
14638
|
case "signoff": {
|
|
14544
14639
|
const ms = milestones.get(m.id);
|
|
@@ -14573,6 +14668,7 @@ var init_handover = __esmMin((() => {
|
|
|
14573
14668
|
init_load();
|
|
14574
14669
|
init_task_keys();
|
|
14575
14670
|
init_indexes();
|
|
14671
|
+
init_rollup_lock();
|
|
14576
14672
|
KIND_HEADING = {
|
|
14577
14673
|
task: "Tasks",
|
|
14578
14674
|
signoff: "Sign-offs waiting on them",
|
|
@@ -17690,6 +17786,7 @@ init_date_fns();
|
|
|
17690
17786
|
init_format();
|
|
17691
17787
|
init_indexes();
|
|
17692
17788
|
init_load();
|
|
17789
|
+
init_rollup_lock();
|
|
17693
17790
|
init_task_keys();
|
|
17694
17791
|
init_tide();
|
|
17695
17792
|
const ISO_DAY$1 = /^\d{4}-\d{2}-\d{2}$/;
|
|
@@ -17996,12 +18093,48 @@ function describeChange(c, data) {
|
|
|
17996
18093
|
}
|
|
17997
18094
|
}
|
|
17998
18095
|
/**
|
|
18096
|
+
* The changes applying would leave out because Jira (or Asana) owns what they
|
|
18097
|
+
* touch: dropping a task kept in step from it, its due day or its owner, and
|
|
18098
|
+
* taking someone off when every open task of theirs here is such a task.
|
|
18099
|
+
*/
|
|
18100
|
+
function dockHeld(data, projectId, changes) {
|
|
18101
|
+
const tasks = byId(data.tasks);
|
|
18102
|
+
const owns = (id, field) => {
|
|
18103
|
+
const t = tasks.get(id);
|
|
18104
|
+
return !!t && t.projectId === projectId && lockedFields(t).includes(field);
|
|
18105
|
+
};
|
|
18106
|
+
return changes.filter((c) => {
|
|
18107
|
+
switch (c.kind) {
|
|
18108
|
+
case "drop": {
|
|
18109
|
+
const t = tasks.get(c.taskId);
|
|
18110
|
+
return !!t && t.projectId === projectId && isExternal(t);
|
|
18111
|
+
}
|
|
18112
|
+
case "due": return owns(c.taskId, "dueDate");
|
|
18113
|
+
case "assign": return owns(c.taskId, "assigneeId");
|
|
18114
|
+
case "release": {
|
|
18115
|
+
const theirs = tasksOf(data.tasks, projectId).filter((t) => t.assigneeId === c.personId && t.status !== "done");
|
|
18116
|
+
return theirs.length > 0 && theirs.every((t) => lockedFields(t).includes("assigneeId"));
|
|
18117
|
+
}
|
|
18118
|
+
default: return false;
|
|
18119
|
+
}
|
|
18120
|
+
});
|
|
18121
|
+
}
|
|
18122
|
+
/** "2 changes left out: Jira owns what they would change." Empty when none were. */
|
|
18123
|
+
function heldText(data, projectId, held) {
|
|
18124
|
+
if (held.length === 0) return "";
|
|
18125
|
+
const from = tasksOf(data.tasks, projectId).find(isExternal)?.external?.from ?? "jira";
|
|
18126
|
+
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.`;
|
|
18127
|
+
}
|
|
18128
|
+
/**
|
|
17999
18129
|
* Makes the changes for real, in order, through the store's own actions,
|
|
18000
18130
|
* and clears a saved dry dock from the project. Changes that no longer fit
|
|
18001
|
-
* are skipped
|
|
18131
|
+
* are skipped, and so are the ones `dockHeld` names: those stay on a saved
|
|
18132
|
+
* dry dock, so the plan someone agreed to isn't lost with them. Returns how
|
|
18133
|
+
* many were made.
|
|
18002
18134
|
*/
|
|
18003
18135
|
function applyDock(actions, projectId, changes) {
|
|
18004
|
-
const
|
|
18136
|
+
const start = actions.getState();
|
|
18137
|
+
const project = start.projects.find((p) => p.id === projectId);
|
|
18005
18138
|
if (!project) return 0;
|
|
18006
18139
|
const has = (id) => actions.getState().tasks.some((t) => t.id === id && t.projectId === projectId);
|
|
18007
18140
|
const person = (id) => !id || actions.getState().people.some((p) => p.id === id);
|
|
@@ -18009,8 +18142,11 @@ function applyDock(actions, projectId, changes) {
|
|
|
18009
18142
|
allowOverCap: true,
|
|
18010
18143
|
allowBlocked: true
|
|
18011
18144
|
};
|
|
18145
|
+
const held = dockHeld(start, projectId, changes);
|
|
18146
|
+
const left = new Set(held);
|
|
18012
18147
|
let made = 0;
|
|
18013
18148
|
for (const c of changes) {
|
|
18149
|
+
if (left.has(c)) continue;
|
|
18014
18150
|
switch (c.kind) {
|
|
18015
18151
|
case "drop":
|
|
18016
18152
|
if (!has(c.taskId)) continue;
|
|
@@ -18054,7 +18190,11 @@ function applyDock(actions, projectId, changes) {
|
|
|
18054
18190
|
}
|
|
18055
18191
|
made += 1;
|
|
18056
18192
|
}
|
|
18057
|
-
|
|
18193
|
+
const saved = actions.getState().projects.find((p) => p.id === projectId)?.dryDock;
|
|
18194
|
+
if (saved) actions.updateProject(projectId, { dryDock: held.length ? {
|
|
18195
|
+
...saved,
|
|
18196
|
+
changes: held
|
|
18197
|
+
} : null });
|
|
18058
18198
|
return made;
|
|
18059
18199
|
}
|
|
18060
18200
|
|
|
@@ -18455,8 +18595,8 @@ function isScuttled(project) {
|
|
|
18455
18595
|
}
|
|
18456
18596
|
/**
|
|
18457
18597
|
* 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
|
|
18598
|
+
* tasks unassigned and undated (kept in `scuttled.freed`; tasks kept in step
|
|
18599
|
+
* 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
18600
|
* blank why.
|
|
18461
18601
|
*/
|
|
18462
18602
|
function scuttleRows(data, projectId, why, byId, at, decisionId, context = "Closed through Scuttle or sail.") {
|
|
@@ -18466,7 +18606,7 @@ function scuttleRows(data, projectId, why, byId, at, decisionId, context = "Clos
|
|
|
18466
18606
|
const freed = [];
|
|
18467
18607
|
const tasks = [];
|
|
18468
18608
|
for (const t of tasksOf(data.tasks, projectId)) {
|
|
18469
|
-
if (t.status === "done" || !t.assigneeId && !t.dueDate) continue;
|
|
18609
|
+
if (t.status === "done" || !t.assigneeId && !t.dueDate || kept(t)) continue;
|
|
18470
18610
|
freed.push({
|
|
18471
18611
|
taskId: t.id,
|
|
18472
18612
|
assigneeId: t.assigneeId,
|
|
@@ -18530,7 +18670,7 @@ function raiseRows(data, projectId, at, byId) {
|
|
|
18530
18670
|
const tasks = [];
|
|
18531
18671
|
for (const t of tasksOf(data.tasks, projectId)) {
|
|
18532
18672
|
const f = byTask.get(t.id);
|
|
18533
|
-
if (!f || t.status === "done") continue;
|
|
18673
|
+
if (!f || t.status === "done" || kept(t)) continue;
|
|
18534
18674
|
const assigneeId = !t.assigneeId && f.assigneeId && people.has(f.assigneeId) ? f.assigneeId : t.assigneeId;
|
|
18535
18675
|
const dueDate = t.dueDate ?? f.dueDate;
|
|
18536
18676
|
if (assigneeId === t.assigneeId && dueDate === t.dueDate) continue;
|
|
@@ -18554,12 +18694,17 @@ function raiseRows(data, projectId, at, byId) {
|
|
|
18554
18694
|
tasks
|
|
18555
18695
|
};
|
|
18556
18696
|
}
|
|
18557
|
-
var WHY_MAX;
|
|
18697
|
+
var WHY_MAX, kept;
|
|
18558
18698
|
var init_scuttle_rows = __esmMin((() => {
|
|
18559
18699
|
init_assignment();
|
|
18560
18700
|
init_indexes();
|
|
18561
18701
|
init_raid();
|
|
18702
|
+
init_rollup_lock();
|
|
18562
18703
|
WHY_MAX = 600;
|
|
18704
|
+
kept = (t) => {
|
|
18705
|
+
const locked = lockedFields(t);
|
|
18706
|
+
return locked.includes("assigneeId") || locked.includes("dueDate");
|
|
18707
|
+
};
|
|
18563
18708
|
}));
|
|
18564
18709
|
|
|
18565
18710
|
// src/lib/sea-trial.ts
|
|
@@ -25232,6 +25377,15 @@ function foggyTasks(data, today, projectIds) {
|
|
|
25232
25377
|
}
|
|
25233
25378
|
return out.sort((a, b) => b.days - a.days);
|
|
25234
25379
|
}
|
|
25380
|
+
/**
|
|
25381
|
+
* Why the sweep can't give this task a new date or drop it, as one line, or
|
|
25382
|
+
* null when it can: the other tool owns the due day and whether it's there.
|
|
25383
|
+
* Still needed and Skip are left.
|
|
25384
|
+
*/
|
|
25385
|
+
function fogLock(task) {
|
|
25386
|
+
if (!isExternal(task)) return null;
|
|
25387
|
+
return `Kept in step from ${sourceLine(task.external)}: change its due day or remove it there. Here it can be kept or skipped.`;
|
|
25388
|
+
}
|
|
25235
25389
|
/** Whether opening this task should count as touching it: only when it is in fog. */
|
|
25236
25390
|
function isFoggy(task, data, today) {
|
|
25237
25391
|
return task.status !== "done" && daysUntouched(task, data, today) >= 21;
|
|
@@ -25240,6 +25394,7 @@ var FOG_DAYS, THICK_FOG_DAYS, commentCache, fileCache;
|
|
|
25240
25394
|
var init_fog = __esmMin((() => {
|
|
25241
25395
|
init_date_fns();
|
|
25242
25396
|
init_date_text();
|
|
25397
|
+
init_rollup_lock();
|
|
25243
25398
|
FOG_DAYS = 21;
|
|
25244
25399
|
THICK_FOG_DAYS = 35;
|
|
25245
25400
|
commentCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -25661,6 +25816,7 @@ init_date_text();
|
|
|
25661
25816
|
init_date_fns();
|
|
25662
25817
|
init_shipping_forecast();
|
|
25663
25818
|
init_handover();
|
|
25819
|
+
init_rollup_lock();
|
|
25664
25820
|
init_work();
|
|
25665
25821
|
init_task_people();
|
|
25666
25822
|
init_fog();
|
|
@@ -25987,6 +26143,45 @@ function milestoneOut(data, m, today, progress = milestoneProgress(data)) {
|
|
|
25987
26143
|
})) } : {}
|
|
25988
26144
|
};
|
|
25989
26145
|
}
|
|
26146
|
+
/** What update_task and the approval tools call the fields the other tool owns. */
|
|
26147
|
+
const READ_ONLY_WORD = {
|
|
26148
|
+
title: "title",
|
|
26149
|
+
status: "status",
|
|
26150
|
+
assigneeId: "assignee",
|
|
26151
|
+
dueDate: "due",
|
|
26152
|
+
startDate: "starts",
|
|
26153
|
+
priority: "priority",
|
|
26154
|
+
parentTaskId: "parent",
|
|
26155
|
+
projectId: "project",
|
|
26156
|
+
approval: "approval",
|
|
26157
|
+
repeat: "repeat"
|
|
26158
|
+
};
|
|
26159
|
+
/**
|
|
26160
|
+
* Where a task kept in step from Jira or Asana comes from, and what can't be
|
|
26161
|
+
* changed here (`readOnly`, in update_task's words): it changes there and
|
|
26162
|
+
* Harbor follows. Nothing for Harbor's own tasks.
|
|
26163
|
+
*/
|
|
26164
|
+
function fromOf(t) {
|
|
26165
|
+
if (!isExternal(t)) return {};
|
|
26166
|
+
const ext = t.external;
|
|
26167
|
+
const url = safeLink(ext.url);
|
|
26168
|
+
return { from: {
|
|
26169
|
+
tool: sourceLabel(ext.from),
|
|
26170
|
+
...ext.key ? { key: ext.key } : {},
|
|
26171
|
+
...url ? { url } : {},
|
|
26172
|
+
readOnly: lockedFields(t).flatMap((k) => READ_ONLY_WORD[k] ?? [])
|
|
26173
|
+
} };
|
|
26174
|
+
}
|
|
26175
|
+
/** The Jira or Asana project a Harbor project's tasks are kept in step from. */
|
|
26176
|
+
function linkedToOf(p) {
|
|
26177
|
+
const ext = p.external;
|
|
26178
|
+
if (!ext) return {};
|
|
26179
|
+
return { linkedTo: {
|
|
26180
|
+
tool: sourceLabel(ext.from),
|
|
26181
|
+
name: ext.name,
|
|
26182
|
+
...ext.key ? { key: ext.key } : {}
|
|
26183
|
+
} };
|
|
26184
|
+
}
|
|
25990
26185
|
function taskLine(t, people, projects, all, data) {
|
|
25991
26186
|
const waitingOn = blockersOf(t, all).filter(isOpen).length;
|
|
25992
26187
|
const project = projects.get(t.projectId);
|
|
@@ -26004,7 +26199,8 @@ function taskLine(t, people, projects, all, data) {
|
|
|
26004
26199
|
assignee: nameOf$2(people, t.assigneeId),
|
|
26005
26200
|
...alsoOnOf(t, people),
|
|
26006
26201
|
project: project?.name ?? null,
|
|
26007
|
-
...waitingOn ? { waitingOn } : {}
|
|
26202
|
+
...waitingOn ? { waitingOn } : {},
|
|
26203
|
+
...fromOf(t)
|
|
26008
26204
|
};
|
|
26009
26205
|
}
|
|
26010
26206
|
/** Everyone also on a task beside its owner, by name; nothing when it's the owner's alone. */
|
|
@@ -26459,7 +26655,7 @@ const HARBOR_TOOLS = [
|
|
|
26459
26655
|
tool({
|
|
26460
26656
|
name: "get_project",
|
|
26461
26657
|
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,
|
|
26658
|
+
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
26659
|
input: object({
|
|
26464
26660
|
harbor: harborArg,
|
|
26465
26661
|
project: string().min(1).max(200).describe("Project id or name.")
|
|
@@ -26507,6 +26703,7 @@ const HARBOR_TOOLS = [
|
|
|
26507
26703
|
healthSetBy: "a person",
|
|
26508
26704
|
healthNote: p.healthNote ?? null
|
|
26509
26705
|
} : {},
|
|
26706
|
+
...linkedToOf(p),
|
|
26510
26707
|
starts: dayOf(p.startDate),
|
|
26511
26708
|
ends: dayOf(p.endDate),
|
|
26512
26709
|
...p.baselineStart ? { baselineStarts: dayOf(p.baselineStart) } : {},
|
|
@@ -26584,7 +26781,7 @@ const HARBOR_TOOLS = [
|
|
|
26584
26781
|
tool({
|
|
26585
26782
|
name: "get_task",
|
|
26586
26783
|
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,
|
|
26784
|
+
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
26785
|
input: object({
|
|
26589
26786
|
harbor: harborArg,
|
|
26590
26787
|
task: string().min(1).max(100).describe("Task id or key (\"RR-42\"), from search_tasks or my_work.")
|
|
@@ -26628,6 +26825,7 @@ const HARBOR_TOOLS = [
|
|
|
26628
26825
|
...alsoOnOf(t, people),
|
|
26629
26826
|
project: project?.name ?? null,
|
|
26630
26827
|
projectId: t.projectId,
|
|
26828
|
+
...fromOf(t),
|
|
26631
26829
|
created: dayOf(t.createdAt),
|
|
26632
26830
|
...t.completedAt ? { finished: dayOf(t.completedAt) } : {},
|
|
26633
26831
|
...t.repeat ? { repeats: t.repeat } : {},
|
|
@@ -29491,64 +29689,69 @@ function matches(rule, prev, next, created) {
|
|
|
29491
29689
|
function runActions(actions, start, ctx) {
|
|
29492
29690
|
let task = start;
|
|
29493
29691
|
const comments = [];
|
|
29494
|
-
|
|
29495
|
-
|
|
29496
|
-
|
|
29497
|
-
|
|
29498
|
-
|
|
29499
|
-
|
|
29500
|
-
|
|
29501
|
-
|
|
29502
|
-
|
|
29503
|
-
|
|
29504
|
-
|
|
29692
|
+
const locked = lockedFields(start);
|
|
29693
|
+
for (const action of actions) {
|
|
29694
|
+
const field = ACTION_FIELD[action.type];
|
|
29695
|
+
if (field && locked.includes(field)) continue;
|
|
29696
|
+
switch (action.type) {
|
|
29697
|
+
case "set_status": {
|
|
29698
|
+
if (!action.status) break;
|
|
29699
|
+
if (action.status === "done" && task.status !== "done" && ctx.waiting?.(task)) {
|
|
29700
|
+
comments.push({
|
|
29701
|
+
taskId: task.id,
|
|
29702
|
+
authorId: ctx.authorId,
|
|
29703
|
+
body: "Left open: this still waits on unfinished work, so the rule didn’t finish it.",
|
|
29704
|
+
createdAt: ctx.now,
|
|
29705
|
+
mentionedIds: []
|
|
29706
|
+
});
|
|
29707
|
+
break;
|
|
29708
|
+
}
|
|
29709
|
+
const wasDone = task.status === "done";
|
|
29710
|
+
const completedAt = action.status === "done" ? task.completedAt ?? ctx.now : wasDone ? null : task.completedAt;
|
|
29711
|
+
task = {
|
|
29712
|
+
...task,
|
|
29713
|
+
status: action.status,
|
|
29714
|
+
completedAt
|
|
29715
|
+
};
|
|
29505
29716
|
break;
|
|
29506
29717
|
}
|
|
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;
|
|
29718
|
+
case "set_priority":
|
|
29719
|
+
if (action.priority) task = {
|
|
29720
|
+
...task,
|
|
29721
|
+
priority: action.priority
|
|
29722
|
+
};
|
|
29723
|
+
break;
|
|
29724
|
+
case "set_assignee":
|
|
29725
|
+
task = {
|
|
29726
|
+
...task,
|
|
29727
|
+
assigneeId: action.assigneeId ?? null
|
|
29728
|
+
};
|
|
29729
|
+
break;
|
|
29730
|
+
case "set_due": {
|
|
29731
|
+
const n = Math.min(365, Math.max(0, Math.round(action.inDays ?? 0)));
|
|
29732
|
+
task = {
|
|
29733
|
+
...task,
|
|
29734
|
+
dueDate: dayAfter(ctx.today, n)
|
|
29735
|
+
};
|
|
29736
|
+
break;
|
|
29737
|
+
}
|
|
29738
|
+
case "add_follower": {
|
|
29739
|
+
const id = action.personId;
|
|
29740
|
+
if (!id || id === task.assigneeId || task.followerIds?.includes(id)) break;
|
|
29741
|
+
task = {
|
|
29742
|
+
...task,
|
|
29743
|
+
followerIds: [...task.followerIds ?? [], id]
|
|
29744
|
+
};
|
|
29745
|
+
break;
|
|
29746
|
+
}
|
|
29747
|
+
case "add_comment": if (action.commentBody?.trim()) comments.push({
|
|
29748
|
+
taskId: task.id,
|
|
29749
|
+
authorId: ctx.authorId,
|
|
29750
|
+
body: action.commentBody.trim(),
|
|
29751
|
+
createdAt: ctx.now,
|
|
29752
|
+
mentionedIds: []
|
|
29753
|
+
});
|
|
29544
29754
|
}
|
|
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
29755
|
}
|
|
29553
29756
|
return {
|
|
29554
29757
|
task,
|
|
@@ -29585,12 +29788,19 @@ function applyAutomations(project, prev, next, opts) {
|
|
|
29585
29788
|
comments
|
|
29586
29789
|
};
|
|
29587
29790
|
}
|
|
29588
|
-
var dayAfter;
|
|
29791
|
+
var dayAfter, ACTION_FIELD;
|
|
29589
29792
|
var init_automations = __esmMin((() => {
|
|
29590
29793
|
init_date_fns();
|
|
29591
29794
|
init_date_text();
|
|
29592
29795
|
init_format();
|
|
29796
|
+
init_rollup_lock();
|
|
29593
29797
|
dayAfter = (day, n) => format(addDays(parseIso(day), n), "yyyy-MM-dd");
|
|
29798
|
+
ACTION_FIELD = {
|
|
29799
|
+
set_status: "status",
|
|
29800
|
+
set_priority: "priority",
|
|
29801
|
+
set_assignee: "assigneeId",
|
|
29802
|
+
set_due: "dueDate"
|
|
29803
|
+
};
|
|
29594
29804
|
}));
|
|
29595
29805
|
|
|
29596
29806
|
// src/lib/focus.ts
|
|
@@ -29713,6 +29923,13 @@ function applyBulk(task, change) {
|
|
|
29713
29923
|
priority: change.priority
|
|
29714
29924
|
};
|
|
29715
29925
|
}
|
|
29926
|
+
/** The task field a bulk change sets. */
|
|
29927
|
+
function bulkField(change) {
|
|
29928
|
+
if ("status" in change) return "status";
|
|
29929
|
+
if ("assigneeId" in change) return "assigneeId";
|
|
29930
|
+
if ("priority" in change) return "priority";
|
|
29931
|
+
return "dueDate";
|
|
29932
|
+
}
|
|
29716
29933
|
/** What the change did, for the Activity line and the tray's notice: "moved 4 tasks to In play". */
|
|
29717
29934
|
function bulkText(change, n, names = {}) {
|
|
29718
29935
|
const tasks = plural$2(n);
|
|
@@ -29726,12 +29943,14 @@ function bulkText(change, n, names = {}) {
|
|
|
29726
29943
|
}
|
|
29727
29944
|
return `set ${tasks} to ${PRIORITY_LABEL[change.priority].toLowerCase()} priority`;
|
|
29728
29945
|
}
|
|
29729
|
-
var plural$2;
|
|
29946
|
+
var bulkLocked, plural$2;
|
|
29730
29947
|
var init_bulk = __esmMin((() => {
|
|
29731
29948
|
init_date_fns();
|
|
29732
29949
|
init_date_text();
|
|
29733
29950
|
init_format();
|
|
29734
29951
|
init_swatches();
|
|
29952
|
+
init_rollup_lock();
|
|
29953
|
+
bulkLocked = (task, change) => lockedFields(task).includes(bulkField(change));
|
|
29735
29954
|
plural$2 = (n) => `${n} ${n === 1 ? "task" : "tasks"}`;
|
|
29736
29955
|
}));
|
|
29737
29956
|
|
|
@@ -29810,6 +30029,13 @@ function tasksSlice({ set, get, write }) {
|
|
|
29810
30029
|
},
|
|
29811
30030
|
updateTask: (id, patch, opts) => {
|
|
29812
30031
|
const task = get().tasks.find((row) => row.id === id);
|
|
30032
|
+
if (task) {
|
|
30033
|
+
const mine = withoutLocked(task, patch);
|
|
30034
|
+
if (mine !== patch) {
|
|
30035
|
+
if (Object.keys(mine).length === 0) return;
|
|
30036
|
+
patch = mine;
|
|
30037
|
+
}
|
|
30038
|
+
}
|
|
29813
30039
|
if (task && patch.parentTaskId && subtaskProblem(id, patch.parentTaskId, get().tasks)) {
|
|
29814
30040
|
patch = { ...patch };
|
|
29815
30041
|
delete patch.parentTaskId;
|
|
@@ -29830,7 +30056,9 @@ function tasksSlice({ set, get, write }) {
|
|
|
29830
30056
|
}
|
|
29831
30057
|
}
|
|
29832
30058
|
const moving = task && patch.projectId && patch.projectId !== task.projectId;
|
|
29833
|
-
const
|
|
30059
|
+
const under = moving ? subtasksOf(task, get().tasks) : [];
|
|
30060
|
+
const carried = moving ? new Set(under.filter((t) => !lockedFields(t).includes("projectId")).map((t) => t.id)) : null;
|
|
30061
|
+
const left = new Set(under.filter((t) => !carried?.has(t.id)).map((t) => t.id));
|
|
29834
30062
|
if (moving && task.parentTaskId && !("parentTaskId" in patch)) patch = {
|
|
29835
30063
|
...patch,
|
|
29836
30064
|
parentTaskId: null
|
|
@@ -29843,6 +30071,10 @@ function tasksSlice({ set, get, write }) {
|
|
|
29843
30071
|
projectId: patch.projectId,
|
|
29844
30072
|
touchedAt: stamp()
|
|
29845
30073
|
};
|
|
30074
|
+
if (left.has(row.id)) return {
|
|
30075
|
+
...row,
|
|
30076
|
+
parentTaskId: null
|
|
30077
|
+
};
|
|
29846
30078
|
if (row.id !== id) return row;
|
|
29847
30079
|
const next = {
|
|
29848
30080
|
...row,
|
|
@@ -29888,6 +30120,7 @@ function tasksSlice({ set, get, write }) {
|
|
|
29888
30120
|
moveTask: (id, status, opts) => {
|
|
29889
30121
|
const task = get().tasks.find((row) => row.id === id);
|
|
29890
30122
|
if (!task || task.status === status) return;
|
|
30123
|
+
if (isExternal(task)) return;
|
|
29891
30124
|
if (status === "done" && !opts?.allowBlocked && isBlocked$1(task, get().tasks)) {
|
|
29892
30125
|
set({ blockPending: {
|
|
29893
30126
|
blockerTitle: openBlockerNames(task, get().tasks) || "another task",
|
|
@@ -29934,6 +30167,7 @@ function tasksSlice({ set, get, write }) {
|
|
|
29934
30167
|
},
|
|
29935
30168
|
deleteTask: (id) => {
|
|
29936
30169
|
const task = get().tasks.find((t) => t.id === id);
|
|
30170
|
+
if (task && isExternal(task)) return;
|
|
29937
30171
|
write({
|
|
29938
30172
|
tasks: get().tasks.filter((t) => t.id !== id),
|
|
29939
30173
|
comments: get().comments.filter((c) => c.taskId !== id),
|
|
@@ -29973,7 +30207,8 @@ function tasksSlice({ set, get, write }) {
|
|
|
29973
30207
|
const task = get().tasks.find((t) => t.id === taskId);
|
|
29974
30208
|
const text = body.trim();
|
|
29975
30209
|
if (!task || !text) return;
|
|
29976
|
-
|
|
30210
|
+
const external = isExternal(task);
|
|
30211
|
+
if (status !== "same" && task.status !== status && !external) get().moveTask(taskId, status, { allowOverCap: opts?.allowOverCap });
|
|
29977
30212
|
const at = stamp();
|
|
29978
30213
|
const moved = get().tasks.find((t) => t.id === taskId);
|
|
29979
30214
|
const agent = get().people.find((p) => p.id === agentId);
|
|
@@ -29981,7 +30216,7 @@ function tasksSlice({ set, get, write }) {
|
|
|
29981
30216
|
const gone = [...useFormerAccounts.getState().ids, ...opts?.gone ?? []];
|
|
29982
30217
|
const asked = get().people.find((p) => p.id === moved?.approval?.approverId);
|
|
29983
30218
|
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)) {
|
|
30219
|
+
if (status === "review" && moved?.status === "review" && agent && !external && (!waiting || lost)) {
|
|
29985
30220
|
const checker = agentChecker(get().people, moved, agent, gone);
|
|
29986
30221
|
if (checker) write({ tasks: get().tasks.map((t) => t.id === taskId ? {
|
|
29987
30222
|
...t,
|
|
@@ -30149,10 +30384,10 @@ function tasksSlice({ set, get, write }) {
|
|
|
30149
30384
|
set({ readPingIds: [...have] });
|
|
30150
30385
|
},
|
|
30151
30386
|
tickVoyage: (ids) => {
|
|
30152
|
-
const
|
|
30153
|
-
const ticked = get().tasks.filter((t) => tick.has(t.id) && t.status !== "done");
|
|
30387
|
+
const ticked = get().tasks.filter((t) => ids.includes(t.id) && t.status !== "done" && !isExternal(t));
|
|
30154
30388
|
if (ticked.length === 0) return;
|
|
30155
|
-
|
|
30389
|
+
const tick = new Set(ticked.map((t) => t.id));
|
|
30390
|
+
write({ tasks: get().tasks.map((t) => tick.has(t.id) ? withStatus(t, "done", {
|
|
30156
30391
|
people: get().people,
|
|
30157
30392
|
by: get().currentUserId
|
|
30158
30393
|
}) : t) });
|
|
@@ -30172,7 +30407,7 @@ function tasksSlice({ set, get, write }) {
|
|
|
30172
30407
|
editTasks: (ids, change, opts) => {
|
|
30173
30408
|
const s = get();
|
|
30174
30409
|
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);
|
|
30410
|
+
const moving = s.tasks.filter((t) => pick.has(t.id) && !bulkLocked(t, change)).filter((t) => applyBulk(t, change) !== t);
|
|
30176
30411
|
if (moving.length === 0) return { changed: 0 };
|
|
30177
30412
|
if ("status" in change) {
|
|
30178
30413
|
if (change.status === "done" && !opts?.allowBlocked) {
|
|
@@ -30350,6 +30585,7 @@ var init_tasks = __esmMin((() => {
|
|
|
30350
30585
|
init_task_people();
|
|
30351
30586
|
init_subtasks();
|
|
30352
30587
|
init_task_start();
|
|
30588
|
+
init_rollup_lock();
|
|
30353
30589
|
}));
|
|
30354
30590
|
|
|
30355
30591
|
// src/lib/raid-history.ts
|
|
@@ -31033,7 +31269,8 @@ function peopleSpendSlice({ set, get, write }) {
|
|
|
31033
31269
|
/**
|
|
31034
31270
|
* One handover's changes as a single write: each item to its new person, the
|
|
31035
31271
|
* 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
|
|
31272
|
+
* and the moves that actually applied. Done or missing items are skipped, and
|
|
31273
|
+
* so are tasks whose owner Jira sets.
|
|
31037
31274
|
*/
|
|
31038
31275
|
function applyMoves(s, moves, lineFor) {
|
|
31039
31276
|
const by = s.currentUserId;
|
|
@@ -31054,7 +31291,7 @@ function applyMoves(s, moves, lineFor) {
|
|
|
31054
31291
|
const patch = {};
|
|
31055
31292
|
if (tasksTo.size) patch.tasks = s.tasks.map((t) => {
|
|
31056
31293
|
const m = tasksTo.get(t.id);
|
|
31057
|
-
if (!m || t.status === "done" || t.assigneeId === m.toId) return t;
|
|
31294
|
+
if (!m || t.status === "done" || t.assigneeId === m.toId || lockedFields(t).includes("assigneeId")) return t;
|
|
31058
31295
|
done(m);
|
|
31059
31296
|
comments.push({
|
|
31060
31297
|
id: uid("c"),
|
|
@@ -31123,6 +31360,7 @@ var init_people_spend = __esmMin((() => {
|
|
|
31123
31360
|
init_format();
|
|
31124
31361
|
init_handover();
|
|
31125
31362
|
init_assignment();
|
|
31363
|
+
init_rollup_lock();
|
|
31126
31364
|
init_spend();
|
|
31127
31365
|
init_utils();
|
|
31128
31366
|
init_countries();
|
|
@@ -33526,6 +33764,11 @@ async function tryHere(opts) {
|
|
|
33526
33764
|
}
|
|
33527
33765
|
if (opts.apply) {
|
|
33528
33766
|
const s = store.getState();
|
|
33767
|
+
const held = heldText(s, project.id, dockHeld(s, project.id, changes));
|
|
33768
|
+
if (held) {
|
|
33769
|
+
result.held = held;
|
|
33770
|
+
result.lines.push("", held);
|
|
33771
|
+
}
|
|
33529
33772
|
result.applied = applyDock({
|
|
33530
33773
|
getState: store.getState,
|
|
33531
33774
|
deleteTask: s.deleteTask,
|
|
@@ -33720,6 +33963,7 @@ function DockPanel({ id, width, height, go, active, onClose }) {
|
|
|
33720
33963
|
});
|
|
33721
33964
|
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
33965
|
const s = store.getState();
|
|
33966
|
+
const held = heldText(s, project.id, dockHeld(s, project.id, changes));
|
|
33723
33967
|
const made = applyDock({
|
|
33724
33968
|
getState: store.getState,
|
|
33725
33969
|
deleteTask: s.deleteTask,
|
|
@@ -33729,7 +33973,7 @@ function DockPanel({ id, width, height, go, active, onClose }) {
|
|
|
33729
33973
|
setAllocation: s.setAllocation
|
|
33730
33974
|
}, project.id, changes);
|
|
33731
33975
|
setChanges([]);
|
|
33732
|
-
go.notify(`Made ${made} change${made === 1 ? "" : "s"}
|
|
33976
|
+
go.notify(`Made ${made} change${made === 1 ? "" : "s"}.${held ? ` ${held}` : ""}`);
|
|
33733
33977
|
onClose();
|
|
33734
33978
|
}, "Apply");
|
|
33735
33979
|
};
|
|
@@ -35210,6 +35454,7 @@ function taskFromTemplate(template, opts) {
|
|
|
35210
35454
|
init_swatches();
|
|
35211
35455
|
init_format();
|
|
35212
35456
|
init_task_people();
|
|
35457
|
+
init_rollup_lock();
|
|
35213
35458
|
init_hill();
|
|
35214
35459
|
init_bottle();
|
|
35215
35460
|
init_clock();
|
|
@@ -35370,7 +35615,11 @@ function ProjectView({ projectId, active, width, height, go, onBack }) {
|
|
|
35370
35615
|
if (key.return && selected) return go.openTask(selected.id);
|
|
35371
35616
|
if (input === "n") return go.newTask(projectId, mode === "board" ? column?.status : void 0);
|
|
35372
35617
|
if (input === "x" && selected) return moveTask(store, go, selected, "done");
|
|
35373
|
-
if (input === "d" && selected)
|
|
35618
|
+
if (input === "d" && selected) {
|
|
35619
|
+
const refusal = externalDeleteRefusal(selected);
|
|
35620
|
+
if (refusal) return go.notify(refusal);
|
|
35621
|
+
return go.confirm(`Delete ${keyOf$1({ projects }, selected)} “${selected.title}”? u undoes it.`, () => store.getState().deleteTask(selected.id), "Delete");
|
|
35622
|
+
}
|
|
35374
35623
|
if (mode === "board") {
|
|
35375
35624
|
if (key.leftArrow || input === "h") setCol((c) => step$1(c, -1, columns.length));
|
|
35376
35625
|
else if (key.rightArrow || input === "l") setCol((c) => step$1(c, 1, columns.length));
|
|
@@ -36587,6 +36836,14 @@ function offer(def, t) {
|
|
|
36587
36836
|
return opts.length ? `“${t}” isn't one of ${def.name}'s options: ${opts.join(", ")}.` : `${def.name} has no options yet.`;
|
|
36588
36837
|
}
|
|
36589
36838
|
|
|
36839
|
+
// src/tui/locks.ts
|
|
36840
|
+
init_rollup_lock();
|
|
36841
|
+
/** Why this field can't be changed here, before any new value is typed; null when it can. */
|
|
36842
|
+
function fieldLock(task, field) {
|
|
36843
|
+
if (!lockedFields(task).includes(field)) return null;
|
|
36844
|
+
return externalRefusal(task, { [field]: Symbol("other") });
|
|
36845
|
+
}
|
|
36846
|
+
|
|
36590
36847
|
// src/tui/views/sounding.ts
|
|
36591
36848
|
init_soundings();
|
|
36592
36849
|
const nameOf = (people, id) => people.find((p) => p.id === id)?.name ?? "someone";
|
|
@@ -36727,6 +36984,7 @@ init_task_people();
|
|
|
36727
36984
|
init_search();
|
|
36728
36985
|
init_swatches();
|
|
36729
36986
|
init_task_milestones();
|
|
36987
|
+
init_rollup_lock();
|
|
36730
36988
|
const FIELDS = [
|
|
36731
36989
|
{
|
|
36732
36990
|
field: "title",
|
|
@@ -36765,6 +37023,16 @@ const FIELDS = [
|
|
|
36765
37023
|
label: "Notes"
|
|
36766
37024
|
}
|
|
36767
37025
|
];
|
|
37026
|
+
/** The task field each row changes, for the ones Jira or Asana may own. */
|
|
37027
|
+
const LOCKABLE = {
|
|
37028
|
+
title: "title",
|
|
37029
|
+
status: "status",
|
|
37030
|
+
assignee: "assigneeId",
|
|
37031
|
+
due: "dueDate",
|
|
37032
|
+
priority: "priority",
|
|
37033
|
+
project: "projectId",
|
|
37034
|
+
repeat: "repeat"
|
|
37035
|
+
};
|
|
36768
37036
|
const REPEATS = [
|
|
36769
37037
|
null,
|
|
36770
37038
|
"weekly",
|
|
@@ -36846,10 +37114,14 @@ function TaskPanel({ taskId, width, height, go, active = true, onClose }) {
|
|
|
36846
37114
|
}
|
|
36847
37115
|
}, task.title);
|
|
36848
37116
|
}
|
|
36849
|
-
if (input === "d")
|
|
36850
|
-
|
|
36851
|
-
|
|
36852
|
-
|
|
37117
|
+
if (input === "d") {
|
|
37118
|
+
const refusal = externalDeleteRefusal(task);
|
|
37119
|
+
if (refusal) return go.notify(refusal);
|
|
37120
|
+
return go.confirm(`Delete ${keyOf$1({ projects }, task)} “${task.title}”? u undoes it.`, () => {
|
|
37121
|
+
store.getState().deleteTask(task.id);
|
|
37122
|
+
onClose();
|
|
37123
|
+
}, "Delete");
|
|
37124
|
+
}
|
|
36853
37125
|
const custom = own[at - FIELDS.length];
|
|
36854
37126
|
if (custom && key.return) return editCustom(custom);
|
|
36855
37127
|
const item = task.checklist[at - stepsFrom];
|
|
@@ -36870,10 +37142,16 @@ function TaskPanel({ taskId, width, height, go, active = true, onClose }) {
|
|
|
36870
37142
|
field: "also"
|
|
36871
37143
|
});
|
|
36872
37144
|
}
|
|
36873
|
-
if (key.return && FIELDS[at])
|
|
36874
|
-
|
|
36875
|
-
|
|
36876
|
-
|
|
37145
|
+
if (key.return && FIELDS[at]) {
|
|
37146
|
+
const field = FIELDS[at].field;
|
|
37147
|
+
const owned = LOCKABLE[field];
|
|
37148
|
+
const refusal = owned ? fieldLock(task, owned) : null;
|
|
37149
|
+
if (refusal) return go.notify(refusal);
|
|
37150
|
+
return setEditing({
|
|
37151
|
+
kind: "field",
|
|
37152
|
+
field
|
|
37153
|
+
});
|
|
37154
|
+
}
|
|
36877
37155
|
}, { isActive: active && editing === null });
|
|
36878
37156
|
if (!task) return null;
|
|
36879
37157
|
const project = projects.find((p) => p.id === task.projectId);
|
|
@@ -38739,12 +39017,17 @@ async function sweepFog(opts) {
|
|
|
38739
39017
|
].filter(Boolean).join(" · ");
|
|
38740
39018
|
say(`${i + 1} of ${queue.length} ${task.title}`);
|
|
38741
39019
|
say(` ${where}`);
|
|
39020
|
+
const lock = fogLock(task);
|
|
39021
|
+
if (lock) say(` ${lock}`);
|
|
38742
39022
|
for (;;) {
|
|
38743
39023
|
const key = (await ask(" k, d, x, s or q: ")).trim().toLowerCase();
|
|
38744
39024
|
if (key === "k") {
|
|
38745
39025
|
store.getState().keepTasks([task.id]);
|
|
38746
39026
|
tally.kept++;
|
|
38747
39027
|
say(" Kept. The fog's off it.\n");
|
|
39028
|
+
} else if (lock && (key === "d" || key === "x")) {
|
|
39029
|
+
say(` ${lock}`);
|
|
39030
|
+
continue;
|
|
38748
39031
|
} else if (key === "d") {
|
|
38749
39032
|
let due = null;
|
|
38750
39033
|
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
|
);
|