@aneuhold/core-ts-db-lib 1.0.18 → 1.0.19
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.
|
@@ -7,6 +7,22 @@ export declare const validateDashboardTask: DocumentValidator<DashboardTask>;
|
|
|
7
7
|
* Gets all the children task IDs for the given parent task IDs.
|
|
8
8
|
*/
|
|
9
9
|
export declare const getDashboardTaskChildrenIds: (allUserTasks: DashboardTask[], parentTaskIds: ObjectId[]) => ObjectId[];
|
|
10
|
+
/**
|
|
11
|
+
* When thinking about the logic of tasks, the following thoughts come to mind:
|
|
12
|
+
*
|
|
13
|
+
* What would you expect a task manager to do in the case that you have a task
|
|
14
|
+
* with a bunch of subtasks, and you share that single task with another person?
|
|
15
|
+
*
|
|
16
|
+
* - Should the subtasks be automatically shared as well no matter what? (Would make behavior simpler for the user)
|
|
17
|
+
* - Should there instead be an option to share the subtasks automatically?
|
|
18
|
+
* - In the case that the other user adds a subtask to the original task you shared, would you expect to see that subtask?
|
|
19
|
+
* - If there is an option to not share the subtasks automatically, what happens when the other user adds a subtask to the one you shared?
|
|
20
|
+
*
|
|
21
|
+
* Because of the complexity for the user in not automatically sharing subtasks,
|
|
22
|
+
* it seems better to always automatically share subtasks. In a theoretical sense,
|
|
23
|
+
* sharing a task with someone seems to imply the shared ownership of completing
|
|
24
|
+
* the overall task, including all the subtasks.
|
|
25
|
+
*/
|
|
10
26
|
export default class DashboardTask extends BaseDocumentWithType implements RequiredUserId {
|
|
11
27
|
static docType: string;
|
|
12
28
|
docType: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../../../src/documents/dashboard/Task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAC3D,OAAO,cAAc,MAAM,4CAA4C,CAAC;AAExE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAE/E,eAAO,MAAM,qBAAqB,EAAE,iBAAiB,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../../../src/documents/dashboard/Task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAC3D,OAAO,cAAc,MAAM,4CAA4C,CAAC;AAExE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAE/E,eAAO,MAAM,qBAAqB,EAAE,iBAAiB,CAAC,aAAa,CAmBlE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,iBACxB,aAAa,EAAE,iBACd,QAAQ,EAAE,KACxB,QAAQ,EA2BV,CAAC;AAyBF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,OAAO,aACnB,SAAQ,oBACR,YAAW,cAAc;IAEzB,MAAM,CAAC,OAAO,SAAU;IAExB,OAAO,SAAyB;IAEhC;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC;IAEjB;;;OAGG;IACH,UAAU,EAAE,QAAQ,EAAE,CAAM;IAE5B,KAAK,SAAM;IAEX,SAAS,UAAS;IAElB;;OAEG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC;IAExB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,OAAc;IAEzB;;OAEG;IACH,eAAe,OAAc;IAE7B,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB,OAAO,CAAC,EAAE,IAAI,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,CAAM;IAEpB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAa;gBAEjB,OAAO,EAAE,QAAQ;CAI9B"}
|
|
@@ -14,6 +14,7 @@ const validateDashboardTask = (task) => {
|
|
|
14
14
|
validate.string('title', exampleTask.title);
|
|
15
15
|
validate.boolean('completed', exampleTask.completed);
|
|
16
16
|
validate.optionalString('description');
|
|
17
|
+
validate.array('sharedWith', exampleTask.sharedWith);
|
|
17
18
|
validate.array('tags', exampleTask.tags);
|
|
18
19
|
validate.string('category', exampleTask.category);
|
|
19
20
|
validate.object('createdDate', exampleTask.createdDate);
|
|
@@ -63,6 +64,22 @@ function getChildrenTaskIds(taskIdToTaskDict, parentToTaskIdsDict, taskId) {
|
|
|
63
64
|
});
|
|
64
65
|
return childrenIds;
|
|
65
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* When thinking about the logic of tasks, the following thoughts come to mind:
|
|
69
|
+
*
|
|
70
|
+
* What would you expect a task manager to do in the case that you have a task
|
|
71
|
+
* with a bunch of subtasks, and you share that single task with another person?
|
|
72
|
+
*
|
|
73
|
+
* - Should the subtasks be automatically shared as well no matter what? (Would make behavior simpler for the user)
|
|
74
|
+
* - Should there instead be an option to share the subtasks automatically?
|
|
75
|
+
* - In the case that the other user adds a subtask to the original task you shared, would you expect to see that subtask?
|
|
76
|
+
* - If there is an option to not share the subtasks automatically, what happens when the other user adds a subtask to the one you shared?
|
|
77
|
+
*
|
|
78
|
+
* Because of the complexity for the user in not automatically sharing subtasks,
|
|
79
|
+
* it seems better to always automatically share subtasks. In a theoretical sense,
|
|
80
|
+
* sharing a task with someone seems to imply the shared ownership of completing
|
|
81
|
+
* the overall task, including all the subtasks.
|
|
82
|
+
*/
|
|
66
83
|
class DashboardTask extends BaseDocumentWithType_1.default {
|
|
67
84
|
static docType = 'task';
|
|
68
85
|
docType = DashboardTask.docType;
|