@appcorp/fusion-storybook 0.1.78 → 0.1.80
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/base-modules/admission/context.d.ts +1 -1
- package/base-modules/admission/context.js +38 -26
- package/base-modules/attendance/context.d.ts +1 -1
- package/base-modules/attendance/context.js +37 -18
- package/base-modules/campus/context.d.ts +1 -1
- package/base-modules/campus/context.js +40 -21
- package/base-modules/class/context.js +15 -8
- package/base-modules/course/context.d.ts +1 -1
- package/base-modules/course/context.js +37 -18
- package/base-modules/discount-code/context.d.ts +1 -1
- package/base-modules/discount-code/context.js +29 -20
- package/base-modules/enrollment/context.d.ts +1 -1
- package/base-modules/enrollment/context.js +37 -18
- package/base-modules/expense/context.d.ts +1 -1
- package/base-modules/expense/context.js +31 -20
- package/base-modules/family/context.d.ts +1 -1
- package/base-modules/family/context.js +36 -21
- package/base-modules/family-member/context.d.ts +1 -1
- package/base-modules/family-member/context.js +37 -21
- package/base-modules/fee-structure/context.d.ts +1 -1
- package/base-modules/fee-structure/context.js +29 -20
- package/base-modules/rbac/context.d.ts +1 -1
- package/base-modules/rbac/context.js +26 -22
- package/base-modules/section/context.d.ts +1 -1
- package/base-modules/section/context.js +26 -19
- package/base-modules/student-fee/context.d.ts +1 -1
- package/base-modules/student-fee/context.js +30 -20
- package/base-modules/student-profile/context.d.ts +1 -1
- package/base-modules/student-profile/context.js +34 -22
- package/base-modules/subject/context.d.ts +2 -2
- package/base-modules/subject/context.js +54 -30
- package/base-modules/teacher/context.d.ts +1 -1
- package/base-modules/teacher/context.js +29 -22
- package/base-modules/user/context.d.ts +1 -1
- package/base-modules/user/context.js +27 -20
- package/base-modules/workspace-user/context.d.ts +1 -1
- package/base-modules/workspace-user/context.js +32 -19
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -111,6 +111,10 @@ export const useWorkspaceUserModule = () => {
|
|
|
111
111
|
}), [state.enabled, state.id, state.roleId, state.userId, workspace === null || workspace === void 0 ? void 0 : workspace.id]);
|
|
112
112
|
const byIdParams = useMemo(() => ({ id: state.id }), [state.id]);
|
|
113
113
|
const deleteParams = useMemo(() => ({ id: state.id }), [state.id]);
|
|
114
|
+
const isDefaultListState = state.currentPage === 1 &&
|
|
115
|
+
state.pageLimit === pageLimit &&
|
|
116
|
+
!debouncedQuery &&
|
|
117
|
+
state.filterEnabled === undefined;
|
|
114
118
|
// ============================================================================
|
|
115
119
|
// 1.4.3 UTILITIES
|
|
116
120
|
// ============================================================================
|
|
@@ -258,9 +262,8 @@ export const useWorkspaceUserModule = () => {
|
|
|
258
262
|
type: WORKSPACE_USER_ACTION_TYPES.SET_CURRENT_PAGE,
|
|
259
263
|
payload: { currentPage: 1 },
|
|
260
264
|
});
|
|
261
|
-
listFetchNow();
|
|
262
265
|
handleCloseDrawer();
|
|
263
|
-
}, [dispatch,
|
|
266
|
+
}, [dispatch, handleCloseDrawer]);
|
|
264
267
|
const clearFilters = useCallback(() => {
|
|
265
268
|
dispatch({
|
|
266
269
|
type: WORKSPACE_USER_ACTION_TYPES.SET_FILTERS,
|
|
@@ -281,16 +284,21 @@ export const useWorkspaceUserModule = () => {
|
|
|
281
284
|
const handleCreate = useCallback(() => { }, []);
|
|
282
285
|
const handleEdit = useCallback(() => { }, []);
|
|
283
286
|
const handlePageChange = useCallback((page) => {
|
|
287
|
+
const nextPage = typeof page === "number" ? page : state.currentPage + 1;
|
|
284
288
|
dispatch({
|
|
285
289
|
type: WORKSPACE_USER_ACTION_TYPES.SET_CURRENT_PAGE,
|
|
286
|
-
payload: { currentPage:
|
|
290
|
+
payload: { currentPage: nextPage },
|
|
287
291
|
});
|
|
288
|
-
}, [dispatch]);
|
|
292
|
+
}, [dispatch, state.currentPage]);
|
|
289
293
|
const handlePageLimitChange = useCallback((limit) => {
|
|
290
294
|
dispatch({
|
|
291
295
|
type: WORKSPACE_USER_ACTION_TYPES.SET_PAGE_LIMIT,
|
|
292
296
|
payload: { pageLimit: limit },
|
|
293
297
|
});
|
|
298
|
+
dispatch({
|
|
299
|
+
type: WORKSPACE_USER_ACTION_TYPES.SET_CURRENT_PAGE,
|
|
300
|
+
payload: { currentPage: 1 },
|
|
301
|
+
});
|
|
294
302
|
}, [dispatch]);
|
|
295
303
|
// ============================================================================
|
|
296
304
|
// 1.4.7 NETWORK ACTIONS
|
|
@@ -353,23 +361,28 @@ export const useWorkspaceUserModule = () => {
|
|
|
353
361
|
// 1.4.9 EFFECTS
|
|
354
362
|
// ============================================================================
|
|
355
363
|
useEffect(() => {
|
|
364
|
+
var _a;
|
|
356
365
|
if (!(workspace === null || workspace === void 0 ? void 0 : workspace.id))
|
|
357
366
|
return;
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
367
|
+
if (isDefaultListState) {
|
|
368
|
+
(async () => {
|
|
369
|
+
try {
|
|
370
|
+
const { count, items } = await getCachedWorkspaceUsers({
|
|
371
|
+
params: listParams,
|
|
372
|
+
});
|
|
373
|
+
dispatch({
|
|
374
|
+
type: WORKSPACE_USER_ACTION_TYPES.SET_ITEMS,
|
|
375
|
+
payload: { items: items || [], count: count || 0 },
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
catch (_a) {
|
|
379
|
+
showToast(t("messagesFetchFailed"), TOAST_VARIANT.ERROR);
|
|
380
|
+
}
|
|
381
|
+
})();
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
(_a = listFetchNowRef.current) === null || _a === void 0 ? void 0 : _a.call(listFetchNowRef);
|
|
385
|
+
}, [dispatch, isDefaultListState, listParams, workspace === null || workspace === void 0 ? void 0 : workspace.id, showToast, t]);
|
|
373
386
|
// ============================================================================
|
|
374
387
|
// 1.4.10 RETURN
|
|
375
388
|
// ============================================================================
|