@replyke/core 5.1.6-beta.3 → 5.1.6-beta.4
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/cjs/hooks/lists-redux/useIsEntitySaved.js +4 -4
- package/dist/cjs/hooks/lists-redux/useIsEntitySaved.js.map +1 -1
- package/dist/cjs/hooks/lists-redux/useListsRedux.js +6 -6
- package/dist/cjs/hooks/lists-redux/useListsRedux.js.map +1 -1
- package/dist/cjs/store/slices/listsSlice.d.ts +18 -8
- package/dist/cjs/store/slices/listsSlice.js +107 -99
- package/dist/cjs/store/slices/listsSlice.js.map +1 -1
- package/dist/esm/hooks/lists-redux/useIsEntitySaved.js +4 -4
- package/dist/esm/hooks/lists-redux/useIsEntitySaved.js.map +1 -1
- package/dist/esm/hooks/lists-redux/useListsRedux.js +7 -7
- package/dist/esm/hooks/lists-redux/useListsRedux.js.map +1 -1
- package/dist/esm/store/slices/listsSlice.d.ts +18 -8
- package/dist/esm/store/slices/listsSlice.js +103 -97
- package/dist/esm/store/slices/listsSlice.js.map +1 -1
- package/package.json +1 -1
|
@@ -39,9 +39,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var react_1 = require("react");
|
|
42
43
|
var useAxiosPrivate_1 = __importDefault(require("../../config/useAxiosPrivate"));
|
|
43
44
|
var useProject_1 = __importDefault(require("../projects/useProject"));
|
|
44
|
-
var react_1 = require("react");
|
|
45
45
|
var auth_redux_1 = require("../auth-redux");
|
|
46
46
|
function useIsEntitySaved() {
|
|
47
47
|
var _this = this;
|
|
@@ -49,18 +49,18 @@ function useIsEntitySaved() {
|
|
|
49
49
|
var projectId = (0, useProject_1.default)().projectId;
|
|
50
50
|
var user = (0, auth_redux_1.useUserRedux)().user;
|
|
51
51
|
var _a = (0, react_1.useState)(null), entityIsSaved = _a[0], setEntityIsSaved = _a[1];
|
|
52
|
-
|
|
52
|
+
// const checkedStatus = useRef<Record<string, boolean>>({}); // Track status by entityId
|
|
53
53
|
var checkIfEntityIsSaved = (0, react_1.useCallback)(function (entityId) { return __awaiter(_this, void 0, void 0, function () {
|
|
54
54
|
var response;
|
|
55
55
|
return __generator(this, function (_a) {
|
|
56
56
|
switch (_a.label) {
|
|
57
57
|
case 0:
|
|
58
|
-
if (!user || !entityId || checkedStatus.current[entityId])
|
|
58
|
+
// if (!user || !entityId || checkedStatus.current[entityId]) return;
|
|
59
|
+
if (!user || !entityId)
|
|
59
60
|
return [2 /*return*/];
|
|
60
61
|
if (!projectId) {
|
|
61
62
|
throw new Error("No projectId available.");
|
|
62
63
|
}
|
|
63
|
-
checkedStatus.current[entityId] = true; // Mark this entityId as checked
|
|
64
64
|
return [4 /*yield*/, axios.get("/".concat(projectId, "/lists/is-entity-saved"), {
|
|
65
65
|
params: { entityId: entityId },
|
|
66
66
|
withCredentials: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsEntitySaved.js","sourceRoot":"","sources":["../../../../src/hooks/lists-redux/useIsEntitySaved.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iFAA2D;AAC3D,sEAAgD;AAChD
|
|
1
|
+
{"version":3,"file":"useIsEntitySaved.js","sourceRoot":"","sources":["../../../../src/hooks/lists-redux/useIsEntitySaved.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA8C;AAC9C,iFAA2D;AAC3D,sEAAgD;AAChD,4CAA6C;AAE7C,SAAS,gBAAgB;IAAzB,iBAgCC;IA/BC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IACxB,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,IAAA,yBAAY,GAAE,KAAnB,CAAoB;IAE1B,IAAA,KAAoC,IAAA,gBAAQ,EAAiB,IAAI,CAAC,EAAjE,aAAa,QAAA,EAAE,gBAAgB,QAAkC,CAAC;IACzE,yFAAyF;IAEzF,IAAM,oBAAoB,GAAG,IAAA,mBAAW,EACtC,UAAO,QAAgB;;;;;oBACrB,qEAAqE;oBACrE,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ;wBAAE,sBAAO;oBAE/B,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAGgB,qBAAM,KAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,2BAAwB,EACrC;4BACE,MAAM,EAAE,EAAE,QAAQ,UAAA,EAAE;4BACpB,eAAe,EAAE,IAAI;yBACtB,CACF,EAAA;;oBANK,QAAQ,GAAG,SAMhB;oBAED,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;;;;SACjC,EACD,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CACzB,CAAC;IAEF,OAAO,EAAE,oBAAoB,sBAAA,EAAE,aAAa,eAAA,EAAE,CAAC;AACjD,CAAC;AAED,kBAAe,gBAAgB,CAAC"}
|
|
@@ -69,8 +69,8 @@ function useListsRedux(_) {
|
|
|
69
69
|
var listHistory = (0, react_redux_1.useSelector)(function (state) {
|
|
70
70
|
return (0, listsSlice_1.selectListHistory)(state);
|
|
71
71
|
});
|
|
72
|
-
var
|
|
73
|
-
return (0, listsSlice_1.
|
|
72
|
+
var subListsMap = (0, react_redux_1.useSelector)(function (state) {
|
|
73
|
+
return (0, listsSlice_1.selectSubListsMap)(state);
|
|
74
74
|
});
|
|
75
75
|
var currentProjectId = (0, react_redux_1.useSelector)(function (state) {
|
|
76
76
|
return (0, listsSlice_1.selectCurrentProjectId)(state);
|
|
@@ -93,12 +93,12 @@ function useListsRedux(_) {
|
|
|
93
93
|
(0, react_1.useEffect)(function () {
|
|
94
94
|
if (!user || !projectId || !currentList)
|
|
95
95
|
return;
|
|
96
|
-
// Check if sub-lists for this list are already
|
|
97
|
-
if (
|
|
98
|
-
return; // No need to fetch, we have
|
|
96
|
+
// Check if sub-lists for this list are already fetched
|
|
97
|
+
if (subListsMap[currentList.id] !== undefined) {
|
|
98
|
+
return; // No need to fetch, we already have the mapping (even if empty)
|
|
99
99
|
}
|
|
100
100
|
fetchSubLists(projectId, currentList.id);
|
|
101
|
-
}, [fetchSubLists, user, projectId, currentList,
|
|
101
|
+
}, [fetchSubLists, user, projectId, currentList, subListsMap]);
|
|
102
102
|
// Entity membership checker
|
|
103
103
|
var isEntityInList = (0, react_1.useCallback)(function (selectedEntityId) {
|
|
104
104
|
if (!currentList)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useListsRedux.js","sourceRoot":"","sources":["../../../../src/hooks/lists-redux/useListsRedux.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAwD;AACxD,2CAAuD;AAGvD,4DAQuC;AACvC,+DAA8D;AAC9D,sEAAgD;AAChD,4CAA6C;AA0B7C;;;GAGG;AACH,SAAS,aAAa,CAAC,CAA0B;IAAjD,iBAuMC;IAvMsB,kBAAA,EAAA,MAA0B;IAC/C,IAAM,QAAQ,GAAG,IAAA,yBAAW,GAAe,CAAC;IAE5C,uBAAuB;IACf,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,IAAA,yBAAY,GAAE,KAAnB,CAAoB;IAEhC,kBAAkB;IAClB,IAAM,WAAW,GAAG,IAAA,yBAAW,EAAC,UAAC,KAAgB;QAC/C,OAAA,IAAA,8BAAiB,EAAC,KAAK,CAAC;IAAxB,CAAwB,CACzB,CAAC;IACF,IAAM,QAAQ,GAAG,IAAA,yBAAW,EAAC,UAAC,KAAgB;QAC5C,OAAA,IAAA,2BA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AAM,oBAAoB,GAAG,IAAA,mBAAW,EACtC,gEAAO,EAAkC;YAAhC,QAAQ,cAAA;;;;oBACf,IAAI,CAAC,WAAW,EAAE,CAAC;wBACjB,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;wBAClC,sBAAO;oBACT,CAAC;oBAED,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;wBACzC,sBAAO;oBACT,CAAC;oBAED,qBAAM,oBAAoB,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAA;;oBAA/D,SAA+D,CAAC;;;;SACjE,EACD,CAAC,oBAAoB,EAAE,WAAW,EAAE,SAAS,CAAC,CAC/C,CAAC;IAEF,iDAAiD;IACjD,OAAO,IAAA,eAAO,EACZ,cAAM,OAAA,CAAC;QACL,WAAW,aAAA;QACX,QAAQ,UAAA;QACR,OAAO,SAAA;QAEP,QAAQ,UAAA;QACR,MAAM,QAAA;QACN,QAAQ,UAAA;QAER,cAAc,gBAAA;QAEd,UAAU,EAAE,gBAAgB;QAC5B,UAAU,EAAE,gBAAgB;QAC5B,UAAU,EAAE,gBAAgB;QAC5B,SAAS,EAAE,eAAe;QAC1B,cAAc,EAAE,oBAAoB;KACrC,CAAC,EAhBI,CAgBJ,EACF;QACE,WAAW;QACX,QAAQ;QACR,OAAO;QACP,QAAQ;QACR,MAAM;QACN,QAAQ;QACR,cAAc;QACd,gBAAgB;QAChB,gBAAgB;QAChB,gBAAgB;QAChB,eAAe;QACf,oBAAoB;KACrB,CACF,CAAC;AACJ,CAAC;AAED,kBAAe,aAAa,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { PayloadAction } from "@reduxjs/toolkit";
|
|
2
2
|
import type { List } from "../../interfaces/models/List";
|
|
3
3
|
export interface ListsState {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
[listId: string]: List[];
|
|
4
|
+
listsById: {
|
|
5
|
+
[listId: string]: List;
|
|
6
|
+
};
|
|
7
|
+
sublistsMap: {
|
|
8
|
+
[parentId: string]: string[];
|
|
10
9
|
};
|
|
10
|
+
currentListId: string | null;
|
|
11
|
+
listHistory: string[];
|
|
12
|
+
loading: boolean;
|
|
11
13
|
currentProjectId?: string;
|
|
12
14
|
}
|
|
13
15
|
export declare const listsSlice: import("@reduxjs/toolkit").Slice<ListsState, {
|
|
@@ -53,11 +55,19 @@ export declare const selectListsLoading: (state: {
|
|
|
53
55
|
export declare const selectListHistory: (state: {
|
|
54
56
|
lists: ListsState;
|
|
55
57
|
}) => List[];
|
|
56
|
-
export declare const
|
|
58
|
+
export declare const selectSubListsMap: (state: {
|
|
57
59
|
lists: ListsState;
|
|
58
60
|
}) => {
|
|
59
|
-
[
|
|
61
|
+
[parentId: string]: string[];
|
|
62
|
+
};
|
|
63
|
+
export declare const selectListsById: (state: {
|
|
64
|
+
lists: ListsState;
|
|
65
|
+
}) => {
|
|
66
|
+
[listId: string]: List;
|
|
60
67
|
};
|
|
61
68
|
export declare const selectCurrentProjectId: (state: {
|
|
62
69
|
lists: ListsState;
|
|
63
70
|
}) => string | undefined;
|
|
71
|
+
export declare const selectCurrentListId: (state: {
|
|
72
|
+
lists: ListsState;
|
|
73
|
+
}) => string | null;
|
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
2
|
var _a;
|
|
12
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.selectCurrentProjectId = exports.
|
|
4
|
+
exports.selectCurrentListId = exports.selectCurrentProjectId = exports.selectListsById = exports.selectSubListsMap = exports.selectListHistory = exports.selectListsLoading = exports.selectSubLists = exports.selectCurrentList = exports.handleError = exports.resetLists = exports.handleListDeletion = exports.removeListFromSubLists = exports.addNewListAndNavigate = exports.updateListInSubLists = exports.updateCurrentList = exports.setSubLists = exports.setCurrentList = exports.goToRoot = exports.goBack = exports.openList = exports.setLoading = exports.setProjectContext = exports.listsSlice = void 0;
|
|
14
5
|
var toolkit_1 = require("@reduxjs/toolkit");
|
|
15
6
|
// Initial state
|
|
16
7
|
var initialState = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
listsById: {},
|
|
9
|
+
sublistsMap: {},
|
|
10
|
+
currentListId: null,
|
|
20
11
|
listHistory: [],
|
|
21
|
-
|
|
12
|
+
loading: false,
|
|
22
13
|
currentProjectId: undefined,
|
|
23
14
|
};
|
|
24
15
|
// Create the slice
|
|
@@ -37,133 +28,129 @@ exports.listsSlice = (0, toolkit_1.createSlice)({
|
|
|
37
28
|
// Navigation actions
|
|
38
29
|
openList: function (state, action) {
|
|
39
30
|
var list = action.payload;
|
|
40
|
-
//
|
|
41
|
-
state.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
// Store the list if not already stored
|
|
32
|
+
if (!state.listsById[list.id]) {
|
|
33
|
+
state.listsById[list.id] = list;
|
|
34
|
+
}
|
|
35
|
+
// Push current list ID to history stack before opening new one
|
|
36
|
+
if (state.currentListId) {
|
|
37
|
+
state.listHistory.push(state.currentListId);
|
|
45
38
|
}
|
|
46
|
-
// Set new current list
|
|
47
|
-
state.
|
|
39
|
+
// Set new current list ID
|
|
40
|
+
state.currentListId = list.id;
|
|
48
41
|
},
|
|
49
42
|
goBack: function (state) {
|
|
50
43
|
if (state.listHistory.length === 0)
|
|
51
44
|
return;
|
|
52
|
-
var
|
|
53
|
-
if (!
|
|
45
|
+
var previousListId = state.listHistory.pop();
|
|
46
|
+
if (!previousListId)
|
|
54
47
|
return;
|
|
55
|
-
state.
|
|
56
|
-
// Check if sub-lists for this list are already in the cache
|
|
57
|
-
if (state.subListCache[previousList.id]) {
|
|
58
|
-
state.subLists = state.subListCache[previousList.id];
|
|
59
|
-
}
|
|
48
|
+
state.currentListId = previousListId;
|
|
60
49
|
},
|
|
61
50
|
goToRoot: function (state) {
|
|
62
51
|
if (state.listHistory.length === 0)
|
|
63
52
|
return;
|
|
64
|
-
var
|
|
53
|
+
var rootListId = state.listHistory[0];
|
|
65
54
|
state.listHistory = [];
|
|
66
|
-
state.
|
|
67
|
-
// Check if sub-lists for this list are already in the cache
|
|
68
|
-
if (state.subListCache[rootList.id]) {
|
|
69
|
-
state.subLists = state.subListCache[rootList.id];
|
|
70
|
-
}
|
|
55
|
+
state.currentListId = rootListId;
|
|
71
56
|
},
|
|
72
57
|
// Set current list (for initial root list fetch)
|
|
73
58
|
setCurrentList: function (state, action) {
|
|
74
|
-
|
|
59
|
+
var list = action.payload;
|
|
60
|
+
if (list) {
|
|
61
|
+
state.listsById[list.id] = list;
|
|
62
|
+
state.currentListId = list.id;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
state.currentListId = null;
|
|
66
|
+
}
|
|
75
67
|
},
|
|
76
|
-
// Set sub-lists and update
|
|
68
|
+
// Set sub-lists and update mapping
|
|
77
69
|
setSubLists: function (state, action) {
|
|
78
70
|
var _a = action.payload, lists = _a.lists, parentListId = _a.parentListId;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
// Store all lists in listsById
|
|
72
|
+
lists.forEach(function (list) {
|
|
73
|
+
state.listsById[list.id] = list;
|
|
74
|
+
});
|
|
75
|
+
// Update parent-child mapping
|
|
76
|
+
state.sublistsMap[parentListId] = lists.map(function (list) { return list.id; });
|
|
82
77
|
},
|
|
83
78
|
// Update current list (for entity add/remove operations)
|
|
84
79
|
updateCurrentList: function (state, action) {
|
|
85
80
|
var updatedList = action.payload;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (updatedList.parentId && state.subListCache[updatedList.parentId]) {
|
|
89
|
-
var parentSubLists = state.subListCache[updatedList.parentId];
|
|
90
|
-
state.subListCache[updatedList.parentId] = parentSubLists.map(function (list) {
|
|
91
|
-
return list.id === updatedList.id ? updatedList : list;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
81
|
+
// Update in listsById (single source of truth)
|
|
82
|
+
state.listsById[updatedList.id] = updatedList;
|
|
94
83
|
},
|
|
95
|
-
// Update a list
|
|
84
|
+
// Update a list (now just updates in listsById)
|
|
96
85
|
updateListInSubLists: function (state, action) {
|
|
97
86
|
var updatedList = action.payload;
|
|
98
|
-
// Update in
|
|
99
|
-
state.
|
|
100
|
-
return list.id === updatedList.id ? updatedList : list;
|
|
101
|
-
});
|
|
102
|
-
// Update in cache
|
|
103
|
-
if (state.currentList && state.subListCache[state.currentList.id]) {
|
|
104
|
-
state.subListCache[state.currentList.id] = state.subListCache[state.currentList.id].map(function (list) { return (list.id === updatedList.id ? updatedList : list); });
|
|
105
|
-
}
|
|
87
|
+
// Update in listsById (single source of truth)
|
|
88
|
+
state.listsById[updatedList.id] = updatedList;
|
|
106
89
|
},
|
|
107
90
|
// Add new list to sub-lists and navigate to it
|
|
108
91
|
addNewListAndNavigate: function (state, action) {
|
|
109
92
|
var newList = action.payload;
|
|
110
|
-
if (!state.
|
|
93
|
+
if (!state.currentListId)
|
|
111
94
|
return;
|
|
112
|
-
//
|
|
113
|
-
state.
|
|
114
|
-
// Push current list to history
|
|
115
|
-
state.listHistory.push(state.
|
|
95
|
+
// Store the new list
|
|
96
|
+
state.listsById[newList.id] = newList;
|
|
97
|
+
// Push current list ID to history
|
|
98
|
+
state.listHistory.push(state.currentListId);
|
|
116
99
|
// Set new list as current
|
|
117
|
-
state.
|
|
118
|
-
// Update
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
newList
|
|
122
|
-
|
|
100
|
+
state.currentListId = newList.id;
|
|
101
|
+
// Update parent-child mapping
|
|
102
|
+
if (newList.parentId) {
|
|
103
|
+
if (!state.sublistsMap[newList.parentId]) {
|
|
104
|
+
state.sublistsMap[newList.parentId] = [];
|
|
105
|
+
}
|
|
106
|
+
if (!state.sublistsMap[newList.parentId].includes(newList.id)) {
|
|
107
|
+
state.sublistsMap[newList.parentId].push(newList.id);
|
|
108
|
+
}
|
|
123
109
|
}
|
|
124
110
|
},
|
|
125
|
-
// Remove list from sub-lists and
|
|
111
|
+
// Remove list from sub-lists and storage
|
|
126
112
|
removeListFromSubLists: function (state, action) {
|
|
127
113
|
var listId = action.payload;
|
|
128
|
-
// Remove from
|
|
129
|
-
|
|
130
|
-
// Remove from
|
|
131
|
-
Object.keys(state.
|
|
132
|
-
state.
|
|
114
|
+
// Remove from listsById
|
|
115
|
+
delete state.listsById[listId];
|
|
116
|
+
// Remove from all parent-child mappings
|
|
117
|
+
Object.keys(state.sublistsMap).forEach(function (parentId) {
|
|
118
|
+
state.sublistsMap[parentId] = state.sublistsMap[parentId].filter(function (id) { return id !== listId; });
|
|
133
119
|
});
|
|
120
|
+
// Remove its own sublists mapping if it exists
|
|
121
|
+
delete state.sublistsMap[listId];
|
|
134
122
|
},
|
|
135
123
|
// Handle list deletion
|
|
136
124
|
handleListDeletion: function (state, action) {
|
|
137
|
-
var _a;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
state.subListCache[parentId] = state.subListCache[parentId].filter(function (list) { return list.id !== listId; });
|
|
125
|
+
var _a = action.payload, listId = _a.listId, parentId = _a.parentId;
|
|
126
|
+
// Remove from parent-child mapping
|
|
127
|
+
if (parentId && state.sublistsMap[parentId]) {
|
|
128
|
+
state.sublistsMap[parentId] = state.sublistsMap[parentId].filter(function (id) { return id !== listId; });
|
|
142
129
|
}
|
|
130
|
+
// Remove from listsById
|
|
131
|
+
delete state.listsById[listId];
|
|
132
|
+
// Remove its own sublists mapping
|
|
133
|
+
delete state.sublistsMap[listId];
|
|
143
134
|
// If deleted list is current list, go back
|
|
144
|
-
if (
|
|
145
|
-
if (state.listHistory.length === 0)
|
|
135
|
+
if (state.currentListId === listId) {
|
|
136
|
+
if (state.listHistory.length === 0) {
|
|
137
|
+
state.currentListId = null;
|
|
146
138
|
return;
|
|
147
|
-
|
|
148
|
-
|
|
139
|
+
}
|
|
140
|
+
var previousListId = state.listHistory.pop();
|
|
141
|
+
if (!previousListId) {
|
|
142
|
+
state.currentListId = null;
|
|
149
143
|
return;
|
|
150
|
-
state.currentList = previousList;
|
|
151
|
-
// Check if sub-lists for this list are already in the cache
|
|
152
|
-
if (state.subListCache[previousList.id]) {
|
|
153
|
-
state.subLists = state.subListCache[previousList.id];
|
|
154
144
|
}
|
|
155
|
-
|
|
156
|
-
else {
|
|
157
|
-
// Remove from current sub-lists
|
|
158
|
-
state.subLists = state.subLists.filter(function (list) { return list.id !== listId; });
|
|
145
|
+
state.currentListId = previousListId;
|
|
159
146
|
}
|
|
160
147
|
},
|
|
161
148
|
// Reset all lists data
|
|
162
149
|
resetLists: function (state) {
|
|
163
|
-
state.
|
|
164
|
-
state.
|
|
150
|
+
state.listsById = {};
|
|
151
|
+
state.sublistsMap = {};
|
|
152
|
+
state.currentListId = null;
|
|
165
153
|
state.listHistory = [];
|
|
166
|
-
state.subListCache = {};
|
|
167
154
|
state.loading = false;
|
|
168
155
|
},
|
|
169
156
|
// Handle errors by stopping loading
|
|
@@ -178,11 +165,18 @@ exports.setProjectContext = (_a = exports.listsSlice.actions, _a.setProjectConte
|
|
|
178
165
|
exports.default = exports.listsSlice.reducer;
|
|
179
166
|
// Selectors
|
|
180
167
|
var selectCurrentList = function (state) {
|
|
181
|
-
|
|
168
|
+
var _a = state.lists, currentListId = _a.currentListId, listsById = _a.listsById;
|
|
169
|
+
return currentListId ? listsById[currentListId] || null : null;
|
|
182
170
|
};
|
|
183
171
|
exports.selectCurrentList = selectCurrentList;
|
|
184
172
|
var selectSubLists = function (state) {
|
|
185
|
-
|
|
173
|
+
var _a = state.lists, currentListId = _a.currentListId, sublistsMap = _a.sublistsMap, listsById = _a.listsById;
|
|
174
|
+
if (!currentListId || !sublistsMap[currentListId]) {
|
|
175
|
+
return [];
|
|
176
|
+
}
|
|
177
|
+
return sublistsMap[currentListId]
|
|
178
|
+
.map(function (listId) { return listsById[listId]; })
|
|
179
|
+
.filter(Boolean); // Remove any undefined entries
|
|
186
180
|
};
|
|
187
181
|
exports.selectSubLists = selectSubLists;
|
|
188
182
|
var selectListsLoading = function (state) {
|
|
@@ -190,15 +184,29 @@ var selectListsLoading = function (state) {
|
|
|
190
184
|
};
|
|
191
185
|
exports.selectListsLoading = selectListsLoading;
|
|
192
186
|
var selectListHistory = function (state) {
|
|
193
|
-
|
|
187
|
+
var _a = state.lists, listHistory = _a.listHistory, listsById = _a.listsById;
|
|
188
|
+
return listHistory
|
|
189
|
+
.map(function (listId) { return listsById[listId]; })
|
|
190
|
+
.filter(Boolean); // Remove any undefined entries
|
|
194
191
|
};
|
|
195
192
|
exports.selectListHistory = selectListHistory;
|
|
196
|
-
|
|
197
|
-
|
|
193
|
+
// New selector for the sublists mapping
|
|
194
|
+
var selectSubListsMap = function (state) {
|
|
195
|
+
return state.lists.sublistsMap;
|
|
198
196
|
};
|
|
199
|
-
exports.
|
|
197
|
+
exports.selectSubListsMap = selectSubListsMap;
|
|
198
|
+
// New selector for all lists
|
|
199
|
+
var selectListsById = function (state) {
|
|
200
|
+
return state.lists.listsById;
|
|
201
|
+
};
|
|
202
|
+
exports.selectListsById = selectListsById;
|
|
200
203
|
var selectCurrentProjectId = function (state) {
|
|
201
204
|
return state.lists.currentProjectId;
|
|
202
205
|
};
|
|
203
206
|
exports.selectCurrentProjectId = selectCurrentProjectId;
|
|
207
|
+
// New selector for current list ID
|
|
208
|
+
var selectCurrentListId = function (state) {
|
|
209
|
+
return state.lists.currentListId;
|
|
210
|
+
};
|
|
211
|
+
exports.selectCurrentListId = selectCurrentListId;
|
|
204
212
|
//# sourceMappingURL=listsSlice.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listsSlice.js","sourceRoot":"","sources":["../../../../src/store/slices/listsSlice.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"listsSlice.js","sourceRoot":"","sources":["../../../../src/store/slices/listsSlice.ts"],"names":[],"mappings":";;;;AAAA,4CAA8D;AAwB9D,gBAAgB;AAChB,IAAM,YAAY,GAAe;IAC/B,SAAS,EAAE,EAAE;IACb,WAAW,EAAE,EAAE;IACf,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,EAAE;IACf,OAAO,EAAE,KAAK;IACd,gBAAgB,EAAE,SAAS;CAC5B,CAAC;AAEF,mBAAmB;AACN,QAAA,UAAU,GAAG,IAAA,qBAAW,EAAC;IACpC,IAAI,EAAE,OAAO;IACb,YAAY,cAAA;IACZ,QAAQ,EAAE;QACR,kCAAkC;QAClC,iBAAiB,EAAE,UAAC,KAAK,EAAE,MAA6B;YACtD,KAAK,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC;QAC1C,CAAC;QAED,oBAAoB;QACpB,UAAU,EAAE,UAAC,KAAK,EAAE,MAA8B;YAChD,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QACjC,CAAC;QAED,qBAAqB;QACrB,QAAQ,EAAE,UAAC,KAAK,EAAE,MAA2B;YAC3C,IAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;YAE5B,uCAAuC;YACvC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;gBAC9B,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;YAClC,CAAC;YAED,+DAA+D;YAC/D,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;gBACxB,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CA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AC,EAAjB,CAAiB,CAAC;SAChC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,+BAA+B;AACrD,CAAC,CAAC;AALW,QAAA,iBAAiB,qBAK5B;AAEF,wCAAwC;AACjC,IAAM,iBAAiB,GAAG,UAAC,KAA4B;IAC5D,OAAA,KAAK,CAAC,KAAK,CAAC,WAAW;AAAvB,CAAuB,CAAC;AADb,QAAA,iBAAiB,qBACJ;AAE1B,6BAA6B;AACtB,IAAM,eAAe,GAAG,UAAC,KAA4B;IAC1D,OAAA,KAAK,CAAC,KAAK,CAAC,SAAS;AAArB,CAAqB,CAAC;AADX,QAAA,eAAe,mBACJ;AAEjB,IAAM,sBAAsB,GAAG,UAAC,KAA4B;IACjE,OAAA,KAAK,CAAC,KAAK,CAAC,gBAAgB;AAA5B,CAA4B,CAAC;AADlB,QAAA,sBAAsB,0BACJ;AAE/B,mCAAmC;AAC5B,IAAM,mBAAmB,GAAG,UAAC,KAA4B;IAC9D,OAAA,KAAK,CAAC,KAAK,CAAC,aAAa;AAAzB,CAAyB,CAAC;AADf,QAAA,mBAAmB,uBACJ"}
|
|
@@ -34,9 +34,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
34
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
+
import { useCallback, useState } from "react";
|
|
37
38
|
import useAxiosPrivate from "../../config/useAxiosPrivate";
|
|
38
39
|
import useProject from "../projects/useProject";
|
|
39
|
-
import { useCallback, useRef, useState } from "react";
|
|
40
40
|
import { useUserRedux } from "../auth-redux";
|
|
41
41
|
function useIsEntitySaved() {
|
|
42
42
|
var _this = this;
|
|
@@ -44,18 +44,18 @@ function useIsEntitySaved() {
|
|
|
44
44
|
var projectId = useProject().projectId;
|
|
45
45
|
var user = useUserRedux().user;
|
|
46
46
|
var _a = useState(null), entityIsSaved = _a[0], setEntityIsSaved = _a[1];
|
|
47
|
-
|
|
47
|
+
// const checkedStatus = useRef<Record<string, boolean>>({}); // Track status by entityId
|
|
48
48
|
var checkIfEntityIsSaved = useCallback(function (entityId) { return __awaiter(_this, void 0, void 0, function () {
|
|
49
49
|
var response;
|
|
50
50
|
return __generator(this, function (_a) {
|
|
51
51
|
switch (_a.label) {
|
|
52
52
|
case 0:
|
|
53
|
-
if (!user || !entityId || checkedStatus.current[entityId])
|
|
53
|
+
// if (!user || !entityId || checkedStatus.current[entityId]) return;
|
|
54
|
+
if (!user || !entityId)
|
|
54
55
|
return [2 /*return*/];
|
|
55
56
|
if (!projectId) {
|
|
56
57
|
throw new Error("No projectId available.");
|
|
57
58
|
}
|
|
58
|
-
checkedStatus.current[entityId] = true; // Mark this entityId as checked
|
|
59
59
|
return [4 /*yield*/, axios.get("/".concat(projectId, "/lists/is-entity-saved"), {
|
|
60
60
|
params: { entityId: entityId },
|
|
61
61
|
withCredentials: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsEntitySaved.js","sourceRoot":"","sources":["../../../../src/hooks/lists-redux/useIsEntitySaved.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useIsEntitySaved.js","sourceRoot":"","sources":["../../../../src/hooks/lists-redux/useIsEntitySaved.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,SAAS,gBAAgB;IAAzB,iBAgCC;IA/BC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,YAAY,EAAE,KAAnB,CAAoB;IAE1B,IAAA,KAAoC,QAAQ,CAAiB,IAAI,CAAC,EAAjE,aAAa,QAAA,EAAE,gBAAgB,QAAkC,CAAC;IACzE,yFAAyF;IAEzF,IAAM,oBAAoB,GAAG,WAAW,CACtC,UAAO,QAAgB;;;;;oBACrB,qEAAqE;oBACrE,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ;wBAAE,sBAAO;oBAE/B,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAGgB,qBAAM,KAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,2BAAwB,EACrC;4BACE,MAAM,EAAE,EAAE,QAAQ,UAAA,EAAE;4BACpB,eAAe,EAAE,IAAI;yBACtB,CACF,EAAA;;oBANK,QAAQ,GAAG,SAMhB;oBAED,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;;;;SACjC,EACD,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CACzB,CAAC;IAEF,OAAO,EAAE,oBAAoB,sBAAA,EAAE,aAAa,eAAA,EAAE,CAAC;AACjD,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
};
|
|
37
37
|
import { useEffect, useMemo, useCallback } from "react";
|
|
38
38
|
import { useDispatch, useSelector } from "react-redux";
|
|
39
|
-
import { setProjectContext, selectCurrentList, selectSubLists, selectListsLoading, selectListHistory,
|
|
39
|
+
import { setProjectContext, selectCurrentList, selectSubLists, selectListsLoading, selectListHistory, selectSubListsMap, selectCurrentProjectId, } from "../../store/slices/listsSlice";
|
|
40
40
|
import { useListsActionsRedux } from "./useListsActionsRedux";
|
|
41
41
|
import useProject from "../projects/useProject";
|
|
42
42
|
import { useUserRedux } from "../auth-redux";
|
|
@@ -64,8 +64,8 @@ function useListsRedux(_) {
|
|
|
64
64
|
var listHistory = useSelector(function (state) {
|
|
65
65
|
return selectListHistory(state);
|
|
66
66
|
});
|
|
67
|
-
var
|
|
68
|
-
return
|
|
67
|
+
var subListsMap = useSelector(function (state) {
|
|
68
|
+
return selectSubListsMap(state);
|
|
69
69
|
});
|
|
70
70
|
var currentProjectId = useSelector(function (state) {
|
|
71
71
|
return selectCurrentProjectId(state);
|
|
@@ -88,12 +88,12 @@ function useListsRedux(_) {
|
|
|
88
88
|
useEffect(function () {
|
|
89
89
|
if (!user || !projectId || !currentList)
|
|
90
90
|
return;
|
|
91
|
-
// Check if sub-lists for this list are already
|
|
92
|
-
if (
|
|
93
|
-
return; // No need to fetch, we have
|
|
91
|
+
// Check if sub-lists for this list are already fetched
|
|
92
|
+
if (subListsMap[currentList.id] !== undefined) {
|
|
93
|
+
return; // No need to fetch, we already have the mapping (even if empty)
|
|
94
94
|
}
|
|
95
95
|
fetchSubLists(projectId, currentList.id);
|
|
96
|
-
}, [fetchSubLists, user, projectId, currentList,
|
|
96
|
+
}, [fetchSubLists, user, projectId, currentList, subListsMap]);
|
|
97
97
|
// Entity membership checker
|
|
98
98
|
var isEntityInList = useCallback(function (selectedEntityId) {
|
|
99
99
|
if (!currentList)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useListsRedux.js","sourceRoot":"","sources":["../../../../src/hooks/lists-redux/useListsRedux.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGvD,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"useListsRedux.js","sourceRoot":"","sources":["../../../../src/hooks/lists-redux/useListsRedux.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AAyB,CAAC,CAAC;wBACzC,sBAAO;oBACT,CAAC;oBAED,qBAAM,oBAAoB,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAA;;oBAA/D,SAA+D,CAAC;;;;SACjE,EACD,CAAC,oBAAoB,EAAE,WAAW,EAAE,SAAS,CAAC,CAC/C,CAAC;IAEF,iDAAiD;IACjD,OAAO,OAAO,CACZ,cAAM,OAAA,CAAC;QACL,WAAW,aAAA;QACX,QAAQ,UAAA;QACR,OAAO,SAAA;QAEP,QAAQ,UAAA;QACR,MAAM,QAAA;QACN,QAAQ,UAAA;QAER,cAAc,gBAAA;QAEd,UAAU,EAAE,gBAAgB;QAC5B,UAAU,EAAE,gBAAgB;QAC5B,UAAU,EAAE,gBAAgB;QAC5B,SAAS,EAAE,eAAe;QAC1B,cAAc,EAAE,oBAAoB;KACrC,CAAC,EAhBI,CAgBJ,EACF;QACE,WAAW;QACX,QAAQ;QACR,OAAO;QACP,QAAQ;QACR,MAAM;QACN,QAAQ;QACR,cAAc;QACd,gBAAgB;QAChB,gBAAgB;QAChB,gBAAgB;QAChB,eAAe;QACf,oBAAoB;KACrB,CACF,CAAC;AACJ,CAAC;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { PayloadAction } from "@reduxjs/toolkit";
|
|
2
2
|
import type { List } from "../../interfaces/models/List";
|
|
3
3
|
export interface ListsState {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
[listId: string]: List[];
|
|
4
|
+
listsById: {
|
|
5
|
+
[listId: string]: List;
|
|
6
|
+
};
|
|
7
|
+
sublistsMap: {
|
|
8
|
+
[parentId: string]: string[];
|
|
10
9
|
};
|
|
10
|
+
currentListId: string | null;
|
|
11
|
+
listHistory: string[];
|
|
12
|
+
loading: boolean;
|
|
11
13
|
currentProjectId?: string;
|
|
12
14
|
}
|
|
13
15
|
export declare const listsSlice: import("@reduxjs/toolkit").Slice<ListsState, {
|
|
@@ -53,11 +55,19 @@ export declare const selectListsLoading: (state: {
|
|
|
53
55
|
export declare const selectListHistory: (state: {
|
|
54
56
|
lists: ListsState;
|
|
55
57
|
}) => List[];
|
|
56
|
-
export declare const
|
|
58
|
+
export declare const selectSubListsMap: (state: {
|
|
57
59
|
lists: ListsState;
|
|
58
60
|
}) => {
|
|
59
|
-
[
|
|
61
|
+
[parentId: string]: string[];
|
|
62
|
+
};
|
|
63
|
+
export declare const selectListsById: (state: {
|
|
64
|
+
lists: ListsState;
|
|
65
|
+
}) => {
|
|
66
|
+
[listId: string]: List;
|
|
60
67
|
};
|
|
61
68
|
export declare const selectCurrentProjectId: (state: {
|
|
62
69
|
lists: ListsState;
|
|
63
70
|
}) => string | undefined;
|
|
71
|
+
export declare const selectCurrentListId: (state: {
|
|
72
|
+
lists: ListsState;
|
|
73
|
+
}) => string | null;
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
-
if (ar || !(i in from)) {
|
|
4
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
-
ar[i] = from[i];
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
-
};
|
|
10
1
|
var _a;
|
|
11
2
|
import { createSlice } from "@reduxjs/toolkit";
|
|
12
3
|
// Initial state
|
|
13
4
|
var initialState = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
listsById: {},
|
|
6
|
+
sublistsMap: {},
|
|
7
|
+
currentListId: null,
|
|
17
8
|
listHistory: [],
|
|
18
|
-
|
|
9
|
+
loading: false,
|
|
19
10
|
currentProjectId: undefined,
|
|
20
11
|
};
|
|
21
12
|
// Create the slice
|
|
@@ -34,133 +25,129 @@ export var listsSlice = createSlice({
|
|
|
34
25
|
// Navigation actions
|
|
35
26
|
openList: function (state, action) {
|
|
36
27
|
var list = action.payload;
|
|
37
|
-
//
|
|
38
|
-
state.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
// Store the list if not already stored
|
|
29
|
+
if (!state.listsById[list.id]) {
|
|
30
|
+
state.listsById[list.id] = list;
|
|
31
|
+
}
|
|
32
|
+
// Push current list ID to history stack before opening new one
|
|
33
|
+
if (state.currentListId) {
|
|
34
|
+
state.listHistory.push(state.currentListId);
|
|
42
35
|
}
|
|
43
|
-
// Set new current list
|
|
44
|
-
state.
|
|
36
|
+
// Set new current list ID
|
|
37
|
+
state.currentListId = list.id;
|
|
45
38
|
},
|
|
46
39
|
goBack: function (state) {
|
|
47
40
|
if (state.listHistory.length === 0)
|
|
48
41
|
return;
|
|
49
|
-
var
|
|
50
|
-
if (!
|
|
42
|
+
var previousListId = state.listHistory.pop();
|
|
43
|
+
if (!previousListId)
|
|
51
44
|
return;
|
|
52
|
-
state.
|
|
53
|
-
// Check if sub-lists for this list are already in the cache
|
|
54
|
-
if (state.subListCache[previousList.id]) {
|
|
55
|
-
state.subLists = state.subListCache[previousList.id];
|
|
56
|
-
}
|
|
45
|
+
state.currentListId = previousListId;
|
|
57
46
|
},
|
|
58
47
|
goToRoot: function (state) {
|
|
59
48
|
if (state.listHistory.length === 0)
|
|
60
49
|
return;
|
|
61
|
-
var
|
|
50
|
+
var rootListId = state.listHistory[0];
|
|
62
51
|
state.listHistory = [];
|
|
63
|
-
state.
|
|
64
|
-
// Check if sub-lists for this list are already in the cache
|
|
65
|
-
if (state.subListCache[rootList.id]) {
|
|
66
|
-
state.subLists = state.subListCache[rootList.id];
|
|
67
|
-
}
|
|
52
|
+
state.currentListId = rootListId;
|
|
68
53
|
},
|
|
69
54
|
// Set current list (for initial root list fetch)
|
|
70
55
|
setCurrentList: function (state, action) {
|
|
71
|
-
|
|
56
|
+
var list = action.payload;
|
|
57
|
+
if (list) {
|
|
58
|
+
state.listsById[list.id] = list;
|
|
59
|
+
state.currentListId = list.id;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
state.currentListId = null;
|
|
63
|
+
}
|
|
72
64
|
},
|
|
73
|
-
// Set sub-lists and update
|
|
65
|
+
// Set sub-lists and update mapping
|
|
74
66
|
setSubLists: function (state, action) {
|
|
75
67
|
var _a = action.payload, lists = _a.lists, parentListId = _a.parentListId;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
68
|
+
// Store all lists in listsById
|
|
69
|
+
lists.forEach(function (list) {
|
|
70
|
+
state.listsById[list.id] = list;
|
|
71
|
+
});
|
|
72
|
+
// Update parent-child mapping
|
|
73
|
+
state.sublistsMap[parentListId] = lists.map(function (list) { return list.id; });
|
|
79
74
|
},
|
|
80
75
|
// Update current list (for entity add/remove operations)
|
|
81
76
|
updateCurrentList: function (state, action) {
|
|
82
77
|
var updatedList = action.payload;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (updatedList.parentId && state.subListCache[updatedList.parentId]) {
|
|
86
|
-
var parentSubLists = state.subListCache[updatedList.parentId];
|
|
87
|
-
state.subListCache[updatedList.parentId] = parentSubLists.map(function (list) {
|
|
88
|
-
return list.id === updatedList.id ? updatedList : list;
|
|
89
|
-
});
|
|
90
|
-
}
|
|
78
|
+
// Update in listsById (single source of truth)
|
|
79
|
+
state.listsById[updatedList.id] = updatedList;
|
|
91
80
|
},
|
|
92
|
-
// Update a list
|
|
81
|
+
// Update a list (now just updates in listsById)
|
|
93
82
|
updateListInSubLists: function (state, action) {
|
|
94
83
|
var updatedList = action.payload;
|
|
95
|
-
// Update in
|
|
96
|
-
state.
|
|
97
|
-
return list.id === updatedList.id ? updatedList : list;
|
|
98
|
-
});
|
|
99
|
-
// Update in cache
|
|
100
|
-
if (state.currentList && state.subListCache[state.currentList.id]) {
|
|
101
|
-
state.subListCache[state.currentList.id] = state.subListCache[state.currentList.id].map(function (list) { return (list.id === updatedList.id ? updatedList : list); });
|
|
102
|
-
}
|
|
84
|
+
// Update in listsById (single source of truth)
|
|
85
|
+
state.listsById[updatedList.id] = updatedList;
|
|
103
86
|
},
|
|
104
87
|
// Add new list to sub-lists and navigate to it
|
|
105
88
|
addNewListAndNavigate: function (state, action) {
|
|
106
89
|
var newList = action.payload;
|
|
107
|
-
if (!state.
|
|
90
|
+
if (!state.currentListId)
|
|
108
91
|
return;
|
|
109
|
-
//
|
|
110
|
-
state.
|
|
111
|
-
// Push current list to history
|
|
112
|
-
state.listHistory.push(state.
|
|
92
|
+
// Store the new list
|
|
93
|
+
state.listsById[newList.id] = newList;
|
|
94
|
+
// Push current list ID to history
|
|
95
|
+
state.listHistory.push(state.currentListId);
|
|
113
96
|
// Set new list as current
|
|
114
|
-
state.
|
|
115
|
-
// Update
|
|
116
|
-
if (
|
|
117
|
-
|
|
118
|
-
newList
|
|
119
|
-
|
|
97
|
+
state.currentListId = newList.id;
|
|
98
|
+
// Update parent-child mapping
|
|
99
|
+
if (newList.parentId) {
|
|
100
|
+
if (!state.sublistsMap[newList.parentId]) {
|
|
101
|
+
state.sublistsMap[newList.parentId] = [];
|
|
102
|
+
}
|
|
103
|
+
if (!state.sublistsMap[newList.parentId].includes(newList.id)) {
|
|
104
|
+
state.sublistsMap[newList.parentId].push(newList.id);
|
|
105
|
+
}
|
|
120
106
|
}
|
|
121
107
|
},
|
|
122
|
-
// Remove list from sub-lists and
|
|
108
|
+
// Remove list from sub-lists and storage
|
|
123
109
|
removeListFromSubLists: function (state, action) {
|
|
124
110
|
var listId = action.payload;
|
|
125
|
-
// Remove from
|
|
126
|
-
|
|
127
|
-
// Remove from
|
|
128
|
-
Object.keys(state.
|
|
129
|
-
state.
|
|
111
|
+
// Remove from listsById
|
|
112
|
+
delete state.listsById[listId];
|
|
113
|
+
// Remove from all parent-child mappings
|
|
114
|
+
Object.keys(state.sublistsMap).forEach(function (parentId) {
|
|
115
|
+
state.sublistsMap[parentId] = state.sublistsMap[parentId].filter(function (id) { return id !== listId; });
|
|
130
116
|
});
|
|
117
|
+
// Remove its own sublists mapping if it exists
|
|
118
|
+
delete state.sublistsMap[listId];
|
|
131
119
|
},
|
|
132
120
|
// Handle list deletion
|
|
133
121
|
handleListDeletion: function (state, action) {
|
|
134
|
-
var _a;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
state.subListCache[parentId] = state.subListCache[parentId].filter(function (list) { return list.id !== listId; });
|
|
122
|
+
var _a = action.payload, listId = _a.listId, parentId = _a.parentId;
|
|
123
|
+
// Remove from parent-child mapping
|
|
124
|
+
if (parentId && state.sublistsMap[parentId]) {
|
|
125
|
+
state.sublistsMap[parentId] = state.sublistsMap[parentId].filter(function (id) { return id !== listId; });
|
|
139
126
|
}
|
|
127
|
+
// Remove from listsById
|
|
128
|
+
delete state.listsById[listId];
|
|
129
|
+
// Remove its own sublists mapping
|
|
130
|
+
delete state.sublistsMap[listId];
|
|
140
131
|
// If deleted list is current list, go back
|
|
141
|
-
if (
|
|
142
|
-
if (state.listHistory.length === 0)
|
|
132
|
+
if (state.currentListId === listId) {
|
|
133
|
+
if (state.listHistory.length === 0) {
|
|
134
|
+
state.currentListId = null;
|
|
143
135
|
return;
|
|
144
|
-
|
|
145
|
-
|
|
136
|
+
}
|
|
137
|
+
var previousListId = state.listHistory.pop();
|
|
138
|
+
if (!previousListId) {
|
|
139
|
+
state.currentListId = null;
|
|
146
140
|
return;
|
|
147
|
-
state.currentList = previousList;
|
|
148
|
-
// Check if sub-lists for this list are already in the cache
|
|
149
|
-
if (state.subListCache[previousList.id]) {
|
|
150
|
-
state.subLists = state.subListCache[previousList.id];
|
|
151
141
|
}
|
|
152
|
-
|
|
153
|
-
else {
|
|
154
|
-
// Remove from current sub-lists
|
|
155
|
-
state.subLists = state.subLists.filter(function (list) { return list.id !== listId; });
|
|
142
|
+
state.currentListId = previousListId;
|
|
156
143
|
}
|
|
157
144
|
},
|
|
158
145
|
// Reset all lists data
|
|
159
146
|
resetLists: function (state) {
|
|
160
|
-
state.
|
|
161
|
-
state.
|
|
147
|
+
state.listsById = {};
|
|
148
|
+
state.sublistsMap = {};
|
|
149
|
+
state.currentListId = null;
|
|
162
150
|
state.listHistory = [];
|
|
163
|
-
state.subListCache = {};
|
|
164
151
|
state.loading = false;
|
|
165
152
|
},
|
|
166
153
|
// Handle errors by stopping loading
|
|
@@ -175,21 +162,40 @@ export var setProjectContext = (_a = listsSlice.actions, _a.setProjectContext),
|
|
|
175
162
|
export default listsSlice.reducer;
|
|
176
163
|
// Selectors
|
|
177
164
|
export var selectCurrentList = function (state) {
|
|
178
|
-
|
|
165
|
+
var _a = state.lists, currentListId = _a.currentListId, listsById = _a.listsById;
|
|
166
|
+
return currentListId ? listsById[currentListId] || null : null;
|
|
179
167
|
};
|
|
180
168
|
export var selectSubLists = function (state) {
|
|
181
|
-
|
|
169
|
+
var _a = state.lists, currentListId = _a.currentListId, sublistsMap = _a.sublistsMap, listsById = _a.listsById;
|
|
170
|
+
if (!currentListId || !sublistsMap[currentListId]) {
|
|
171
|
+
return [];
|
|
172
|
+
}
|
|
173
|
+
return sublistsMap[currentListId]
|
|
174
|
+
.map(function (listId) { return listsById[listId]; })
|
|
175
|
+
.filter(Boolean); // Remove any undefined entries
|
|
182
176
|
};
|
|
183
177
|
export var selectListsLoading = function (state) {
|
|
184
178
|
return state.lists.loading;
|
|
185
179
|
};
|
|
186
180
|
export var selectListHistory = function (state) {
|
|
187
|
-
|
|
181
|
+
var _a = state.lists, listHistory = _a.listHistory, listsById = _a.listsById;
|
|
182
|
+
return listHistory
|
|
183
|
+
.map(function (listId) { return listsById[listId]; })
|
|
184
|
+
.filter(Boolean); // Remove any undefined entries
|
|
188
185
|
};
|
|
189
|
-
|
|
190
|
-
|
|
186
|
+
// New selector for the sublists mapping
|
|
187
|
+
export var selectSubListsMap = function (state) {
|
|
188
|
+
return state.lists.sublistsMap;
|
|
189
|
+
};
|
|
190
|
+
// New selector for all lists
|
|
191
|
+
export var selectListsById = function (state) {
|
|
192
|
+
return state.lists.listsById;
|
|
191
193
|
};
|
|
192
194
|
export var selectCurrentProjectId = function (state) {
|
|
193
195
|
return state.lists.currentProjectId;
|
|
194
196
|
};
|
|
197
|
+
// New selector for current list ID
|
|
198
|
+
export var selectCurrentListId = function (state) {
|
|
199
|
+
return state.lists.currentListId;
|
|
200
|
+
};
|
|
195
201
|
//# sourceMappingURL=listsSlice.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listsSlice.js","sourceRoot":"","sources":["../../../../src/store/slices/listsSlice.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"listsSlice.js","sourceRoot":"","sources":["../../../../src/store/slices/listsSlice.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAiB,MAAM,kBAAkB,CAAC;AAwB9D,gBAAgB;AAChB,IAAM,YAAY,GAAe;IAC/B,SAAS,EAAE,EAAE;IACb,WAAW,EAAE,EAAE;IACf,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,EAAE;IACf,OAAO,EAAE,KAAK;IACd,gBAAgB,EAAE,SAAS;CAC5B,CAAC;AAEF,mBAAmB;AACnB,MAAM,CAAC,IAAM,UAAU,GAAG,WAAW,CAAC;IACpC,IAAI,EAAE,OAAO;IACb,YAAY,cAAA;IACZ,QAAQ,EAAE;QACR,kCAAkC;QAClC,iBAAiB,EAAE,UAAC,KAAK,EAAE,MAA6B;YACtD,KAAK,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC;QAC1C,CAAC;QAED,oBAAoB;QACpB,UAAU,EAAE,UAAC,KAAK,EAAE,MAA8B;YAChD,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QACjC,CAAC;QAED,qBAAqB;QACrB,QAAQ,EAAE,UAAC,KAAK,EAAE,MAA2B;YAC3C,IAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;YAE5B,uCAAuC;YACvC,IAAI,CAAC,K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