@zeniai/client-epic-state 5.1.45-betaDI1 → 5.1.45-betaDI2
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.
|
@@ -824,26 +824,24 @@ const getGroupedTaskIds = (tasks) => {
|
|
|
824
824
|
...initialTaskIdsByDueDate,
|
|
825
825
|
};
|
|
826
826
|
const taskIdsByTags = {};
|
|
827
|
-
//
|
|
828
|
-
//
|
|
829
|
-
//
|
|
830
|
-
//
|
|
831
|
-
//
|
|
832
|
-
// the
|
|
833
|
-
// the
|
|
834
|
-
|
|
827
|
+
// A task is a "nested subtask" (hidden from the flat top-level list +
|
|
828
|
+
// dropped from the tab count) iff a parent in the same payload claims
|
|
829
|
+
// it via its `subtasks: [...]` array. Match this criterion exactly to
|
|
830
|
+
// WC's `allSubtaskIds` union in TaskManagementPage.tsx — otherwise
|
|
831
|
+
// the tab count and the visible top-level row count disagree
|
|
832
|
+
// whenever the BE emits `parent_task_id` on a subtask but omits it
|
|
833
|
+
// from the parent's `subtasks` array (a real inconsistency this UI
|
|
834
|
+
// sees today).
|
|
835
|
+
//
|
|
836
|
+
// Using `parent_task_id` here would sometimes drop a task from the
|
|
837
|
+
// count that WC still renders as a flat top-level row — that's the
|
|
838
|
+
// bug we're fixing.
|
|
839
|
+
const nestedSubtaskIds = new Set();
|
|
835
840
|
tasks.forEach((task) => {
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
// but the subtask itself is public and lands in the payload).
|
|
841
|
-
// Datastore string properties default to '' when unset, so treat
|
|
842
|
-
// empty string as null. Matches the sibling `updateTasks` guard
|
|
843
|
-
// at L719-722.
|
|
844
|
-
const isNestedSubtask = task.parent_task_id != null &&
|
|
845
|
-
task.parent_task_id !== '' &&
|
|
846
|
-
visibleTaskIds.has(task.parent_task_id);
|
|
841
|
+
(task.subtasks ?? []).forEach((subtaskId) => nestedSubtaskIds.add(subtaskId));
|
|
842
|
+
});
|
|
843
|
+
tasks.forEach((task) => {
|
|
844
|
+
const isNestedSubtask = nestedSubtaskIds.has(task.task_id);
|
|
847
845
|
// Subtasks stay in every groupBy array so the UI can render them
|
|
848
846
|
// nested under their parent (WC's TaskManagementPage builds
|
|
849
847
|
// `subtasksByParentId` from `group.tasks` and then filters them
|
|
@@ -828,26 +828,24 @@ const getGroupedTaskIds = (tasks) => {
|
|
|
828
828
|
...initialTaskIdsByDueDate,
|
|
829
829
|
};
|
|
830
830
|
const taskIdsByTags = {};
|
|
831
|
-
//
|
|
832
|
-
//
|
|
833
|
-
//
|
|
834
|
-
//
|
|
835
|
-
//
|
|
836
|
-
// the
|
|
837
|
-
// the
|
|
838
|
-
|
|
831
|
+
// A task is a "nested subtask" (hidden from the flat top-level list +
|
|
832
|
+
// dropped from the tab count) iff a parent in the same payload claims
|
|
833
|
+
// it via its `subtasks: [...]` array. Match this criterion exactly to
|
|
834
|
+
// WC's `allSubtaskIds` union in TaskManagementPage.tsx — otherwise
|
|
835
|
+
// the tab count and the visible top-level row count disagree
|
|
836
|
+
// whenever the BE emits `parent_task_id` on a subtask but omits it
|
|
837
|
+
// from the parent's `subtasks` array (a real inconsistency this UI
|
|
838
|
+
// sees today).
|
|
839
|
+
//
|
|
840
|
+
// Using `parent_task_id` here would sometimes drop a task from the
|
|
841
|
+
// count that WC still renders as a flat top-level row — that's the
|
|
842
|
+
// bug we're fixing.
|
|
843
|
+
const nestedSubtaskIds = new Set();
|
|
839
844
|
tasks.forEach((task) => {
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
// but the subtask itself is public and lands in the payload).
|
|
845
|
-
// Datastore string properties default to '' when unset, so treat
|
|
846
|
-
// empty string as null. Matches the sibling `updateTasks` guard
|
|
847
|
-
// at L719-722.
|
|
848
|
-
const isNestedSubtask = task.parent_task_id != null &&
|
|
849
|
-
task.parent_task_id !== '' &&
|
|
850
|
-
visibleTaskIds.has(task.parent_task_id);
|
|
845
|
+
(task.subtasks ?? []).forEach((subtaskId) => nestedSubtaskIds.add(subtaskId));
|
|
846
|
+
});
|
|
847
|
+
tasks.forEach((task) => {
|
|
848
|
+
const isNestedSubtask = nestedSubtaskIds.has(task.task_id);
|
|
851
849
|
// Subtasks stay in every groupBy array so the UI can render them
|
|
852
850
|
// nested under their parent (WC's TaskManagementPage builds
|
|
853
851
|
// `subtasksByParentId` from `group.tasks` and then filters them
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.45-
|
|
3
|
+
"version": "5.1.45-betaDI2",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|