flowcat 1.8.0 → 1.9.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 +10 -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);
|
|
@@ -17301,8 +17305,9 @@ var runListCommand = async ({
|
|
|
17301
17305
|
if (resolvedStatus && isListScope(resolvedStatus)) {
|
|
17302
17306
|
const dates = listDatesForScope(resolvedStatus);
|
|
17303
17307
|
const tasks = await listAllTasks(workspaceRoot);
|
|
17308
|
+
const checkAssignment = includeUnassigned ? wasEverAssignedOnDate : isAssignedOnDate;
|
|
17304
17309
|
for (const entry of tasks) {
|
|
17305
|
-
const hasAssignment = dates.some((date) =>
|
|
17310
|
+
const hasAssignment = dates.some((date) => checkAssignment(entry.task, date));
|
|
17306
17311
|
if (!hasAssignment) {
|
|
17307
17312
|
continue;
|
|
17308
17313
|
}
|
|
@@ -17333,11 +17338,12 @@ var runListCommand = async ({
|
|
|
17333
17338
|
helpers.printLines(storedEntries.map(buildLine));
|
|
17334
17339
|
};
|
|
17335
17340
|
var registerListCommand = (program2, helpers) => {
|
|
17336
|
-
program2.command("list").description("list tasks").argument("[status]", "task status or date scope").action(helpers.handleAction(async (status,
|
|
17341
|
+
program2.command("list").description("list tasks").argument("[status]", "task status or date scope").option("-u, --include-unassigned", "include tasks that were unassigned (for date scopes)").action(helpers.handleAction(async (status, options, command) => {
|
|
17337
17342
|
await runListCommand({
|
|
17338
17343
|
helpers,
|
|
17339
17344
|
status,
|
|
17340
|
-
command
|
|
17345
|
+
command,
|
|
17346
|
+
includeUnassigned: options.includeUnassigned
|
|
17341
17347
|
});
|
|
17342
17348
|
}));
|
|
17343
17349
|
};
|