@anchrd/intel-api 0.32.0 → 0.33.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/nodes/nodes.js +12 -11
- package/package.json +1 -1
package/dist/nodes/nodes.js
CHANGED
|
@@ -120,16 +120,17 @@ async function boardFor(deps, actor, parent) {
|
|
|
120
120
|
return null;
|
|
121
121
|
return (await deps.boardOfTask?.(actor, parent.id)) ?? null;
|
|
122
122
|
}
|
|
123
|
-
function refuseArchivedParent(
|
|
124
|
-
// ⚠️
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
// `boards.int.ts` covering it. It is #679, which also asks what such data already exists.
|
|
123
|
+
function refuseArchivedParent(parent) {
|
|
124
|
+
// ⚠️ EVERY kind, not just tasks (#679). It was narrowed to tasks in #677 because widening it out
|
|
125
|
+
// of a board ticket would have changed the whole tree with no test outside `boards.int.ts`; the
|
|
126
|
+
// hole it left is older than that ticket and is what this one closes.
|
|
128
127
|
//
|
|
129
|
-
// ⚠️
|
|
130
|
-
//
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
// ⚠️ **This asks the DIRECT parent only, and the hole one level up stays open** (#733). Archiving a
|
|
129
|
+
// folder that still holds something live is allowed for every kind but `task`, so `Aussen`
|
|
130
|
+
// archived over a live `Innen` still takes anything filed under `Innen` when it is purged:
|
|
131
|
+
// `inspectPurgeTree` walks the whole subtree and `purge` checks `archived_at` on the root alone.
|
|
132
|
+
// Closing that needs a decision (refuse the archive, cascade it, refuse the purge, or name the
|
|
133
|
+
// live nodes in the preview) and #733 carries it with the count of what already exists.
|
|
133
134
|
if (parent === null || parent.archivedAt === null)
|
|
134
135
|
return;
|
|
135
136
|
throw new IntelError(409, "parent_archived", `This ${parent.kind} is archived, so nothing new can be filed under it. Restore it first.`);
|
|
@@ -597,7 +598,7 @@ export function createNodes(deps) {
|
|
|
597
598
|
// reason — a task lives on a board — and saying "restore the folder first" would send the
|
|
598
599
|
// reader to do something that changes nothing: restored, the folder still cannot hold a task.
|
|
599
600
|
refuseWrongParent(input.kind, destinationParent, { destination: destinationBoard });
|
|
600
|
-
refuseArchivedParent(
|
|
601
|
+
refuseArchivedParent(destinationParent);
|
|
601
602
|
const timestamp = deps.now().toISOString();
|
|
602
603
|
const created = await deps.repository.insertNode({
|
|
603
604
|
node: {
|
|
@@ -983,7 +984,7 @@ export function createNodes(deps) {
|
|
|
983
984
|
destination: destinationBoard,
|
|
984
985
|
current: currentBoard,
|
|
985
986
|
});
|
|
986
|
-
refuseArchivedParent(
|
|
987
|
+
refuseArchivedParent(parent);
|
|
987
988
|
}
|
|
988
989
|
const updatedAt = deps.now().toISOString();
|
|
989
990
|
const updated = await deps.repository.updateNode({
|