flowcat 1.8.0 → 1.10.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/core/taskOperations.ts +6 -0
- package/dist/fweb +0 -0
- package/dist/index.mjs +18 -4
- package/package.json +1 -1
package/core/taskOperations.ts
CHANGED
|
@@ -58,6 +58,12 @@ export const isAssignedOnDate = (task: Task, date: string): boolean => {
|
|
|
58
58
|
return latest.event.action === "assign" || latest.event.action === "reorder";
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
+
export const wasEverAssignedOnDate = (task: Task, date: string): boolean => {
|
|
62
|
+
return task.day_assignments.some(
|
|
63
|
+
(event) => event.date === date && (event.action === "assign" || event.action === "reorder"),
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
61
67
|
export const getLatestDayAssignment = (
|
|
62
68
|
task: Task,
|
|
63
69
|
date: string,
|
package/dist/fweb
CHANGED
|
Binary file
|
package/dist/index.mjs
CHANGED
|
@@ -17227,6 +17227,9 @@ var isAssignedOnDate = (task, date) => {
|
|
|
17227
17227
|
}
|
|
17228
17228
|
return latest.event.action === "assign" || latest.event.action === "reorder";
|
|
17229
17229
|
};
|
|
17230
|
+
var wasEverAssignedOnDate = (task, date) => {
|
|
17231
|
+
return task.day_assignments.some((event) => event.date === date && (event.action === "assign" || event.action === "reorder"));
|
|
17232
|
+
};
|
|
17230
17233
|
var getLatestDayAssignment = (task, date) => {
|
|
17231
17234
|
let latestIndex = -1;
|
|
17232
17235
|
for (let i = 0;i < task.day_assignments.length; i += 1) {
|
|
@@ -17269,7 +17272,8 @@ var isListScope = (value) => {
|
|
|
17269
17272
|
var runListCommand = async ({
|
|
17270
17273
|
helpers,
|
|
17271
17274
|
status,
|
|
17272
|
-
command
|
|
17275
|
+
command,
|
|
17276
|
+
includeUnassigned
|
|
17273
17277
|
}) => {
|
|
17274
17278
|
const resolvedStatus = status;
|
|
17275
17279
|
const workspaceRoot = await helpers.resolveWorkspaceFor(true, command);
|
|
@@ -17298,11 +17302,19 @@ var runListCommand = async ({
|
|
|
17298
17302
|
throw new Error(`Invalid status or scope: ${resolvedStatus}`);
|
|
17299
17303
|
}
|
|
17300
17304
|
}
|
|
17305
|
+
if (includeUnassigned && (!resolvedStatus || !isListScope(resolvedStatus))) {
|
|
17306
|
+
if (command) {
|
|
17307
|
+
helpers.failWithHelp(command, "--include-unassigned can only be used with date scopes (today, yesterday, this_week, last_week)");
|
|
17308
|
+
return;
|
|
17309
|
+
}
|
|
17310
|
+
throw new Error("--include-unassigned can only be used with date scopes (today, yesterday, this_week, last_week)");
|
|
17311
|
+
}
|
|
17301
17312
|
if (resolvedStatus && isListScope(resolvedStatus)) {
|
|
17302
17313
|
const dates = listDatesForScope(resolvedStatus);
|
|
17303
17314
|
const tasks = await listAllTasks(workspaceRoot);
|
|
17315
|
+
const checkAssignment = includeUnassigned ? wasEverAssignedOnDate : isAssignedOnDate;
|
|
17304
17316
|
for (const entry of tasks) {
|
|
17305
|
-
const hasAssignment = dates.some((date) =>
|
|
17317
|
+
const hasAssignment = dates.some((date) => checkAssignment(entry.task, date));
|
|
17306
17318
|
if (!hasAssignment) {
|
|
17307
17319
|
continue;
|
|
17308
17320
|
}
|
|
@@ -17333,11 +17345,12 @@ var runListCommand = async ({
|
|
|
17333
17345
|
helpers.printLines(storedEntries.map(buildLine));
|
|
17334
17346
|
};
|
|
17335
17347
|
var registerListCommand = (program2, helpers) => {
|
|
17336
|
-
program2.command("list").description("list tasks").argument("[status]", "task status or date scope").action(helpers.handleAction(async (status,
|
|
17348
|
+
program2.command("list").description("list tasks").argument("[status]", "task status (backlog, active, paused, completed, cancelled) or date scope (today, yesterday, this_week, last_week)").option("-u, --include-unassigned", "include tasks that were unassigned (for date scopes)").action(helpers.handleAction(async (status, options, command) => {
|
|
17337
17349
|
await runListCommand({
|
|
17338
17350
|
helpers,
|
|
17339
17351
|
status,
|
|
17340
|
-
command
|
|
17352
|
+
command,
|
|
17353
|
+
includeUnassigned: options.includeUnassigned
|
|
17341
17354
|
});
|
|
17342
17355
|
}));
|
|
17343
17356
|
};
|
|
@@ -18554,6 +18567,7 @@ var commandExamples = {
|
|
|
18554
18567
|
"flowcat list",
|
|
18555
18568
|
"flowcat list active",
|
|
18556
18569
|
"flowcat list today",
|
|
18570
|
+
"flowcat list today --include-unassigned",
|
|
18557
18571
|
"flowcat list backlog --json"
|
|
18558
18572
|
],
|
|
18559
18573
|
show: [
|