@appcorp/fusion-storybook 0.3.41 → 0.3.42
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.
|
@@ -28,13 +28,14 @@ export const useStudentFeeModule = () => {
|
|
|
28
28
|
// ============================================================================
|
|
29
29
|
// 1.4.1 STATE & CORE HOOKS
|
|
30
30
|
// ============================================================================
|
|
31
|
-
var _a, _b, _c, _d, _e, _f;
|
|
31
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
32
32
|
const context = useStudentFeeContext();
|
|
33
33
|
const { dispatch } = context;
|
|
34
34
|
const state = context.state;
|
|
35
35
|
const t = useTranslations("studentFee");
|
|
36
36
|
const { theme } = useTheme();
|
|
37
37
|
const workspace = getCachedWorkspaceSync();
|
|
38
|
+
console.log("[DIAG] useStudentFeeModule workspace?.school?.id:", (_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id, "workspace keys:", workspace ? Object.keys(workspace) : null);
|
|
38
39
|
const listFetchNowRef = useRef(null);
|
|
39
40
|
const debouncedQuery = useDebounce(state.searchQuery, 800);
|
|
40
41
|
// ============================================================================
|
|
@@ -51,7 +52,7 @@ export const useStudentFeeModule = () => {
|
|
|
51
52
|
state.filterStatus,
|
|
52
53
|
state.pageLimit,
|
|
53
54
|
debouncedQuery,
|
|
54
|
-
(
|
|
55
|
+
(_b = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _b === void 0 ? void 0 : _b.id,
|
|
55
56
|
]);
|
|
56
57
|
const updateParams = useMemo(() => {
|
|
57
58
|
var _a;
|
|
@@ -71,7 +72,7 @@ export const useStudentFeeModule = () => {
|
|
|
71
72
|
status: state.status,
|
|
72
73
|
studentProfileId: state.studentProfileId,
|
|
73
74
|
});
|
|
74
|
-
}, [state, (
|
|
75
|
+
}, [state, (_c = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _c === void 0 ? void 0 : _c.id]);
|
|
75
76
|
const byIdParams = useMemo(() => ({ id: state.id }), [state.id]);
|
|
76
77
|
const deleteParams = useMemo(() => ({ id: state.id }), [state.id]);
|
|
77
78
|
// ============================================================================
|
|
@@ -140,7 +141,7 @@ export const useStudentFeeModule = () => {
|
|
|
140
141
|
},
|
|
141
142
|
},
|
|
142
143
|
});
|
|
143
|
-
}, [dispatch, workspace === null || workspace === void 0 ? void 0 : workspace.dueDateLength, (
|
|
144
|
+
}, [dispatch, workspace === null || workspace === void 0 ? void 0 : workspace.dueDateLength, (_d = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _d === void 0 ? void 0 : _d.id]);
|
|
144
145
|
// ============================================================================
|
|
145
146
|
// 1.4.4 API CALLBACKS
|
|
146
147
|
// ============================================================================
|
|
@@ -539,7 +540,7 @@ export const useStudentFeeModule = () => {
|
|
|
539
540
|
payload: { disabled: false },
|
|
540
541
|
});
|
|
541
542
|
}
|
|
542
|
-
}, [dispatch, showToast, t, (
|
|
543
|
+
}, [dispatch, showToast, t, (_e = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _e === void 0 ? void 0 : _e.id, resetFormAndCloseDrawer]);
|
|
543
544
|
const handleSubmit = useCallback(() => {
|
|
544
545
|
dispatch({
|
|
545
546
|
type: STUDENT_FEE_ACTION_TYPES.SET_DISABLE_SAVE_BUTTON,
|
|
@@ -603,7 +604,7 @@ export const useStudentFeeModule = () => {
|
|
|
603
604
|
payload: { disabled: false },
|
|
604
605
|
});
|
|
605
606
|
}
|
|
606
|
-
}, [dispatch, showToast, t, (
|
|
607
|
+
}, [dispatch, showToast, t, (_f = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _f === void 0 ? void 0 : _f.id, resetFormAndCloseDrawer]);
|
|
607
608
|
// ============================================================================
|
|
608
609
|
// 1.4.8 HEADER & ROW ACTIONS
|
|
609
610
|
// ============================================================================
|
|
@@ -671,14 +672,17 @@ export const useStudentFeeModule = () => {
|
|
|
671
672
|
// 1.4.9 EFFECTS
|
|
672
673
|
// ============================================================================
|
|
673
674
|
useEffect(() => {
|
|
675
|
+
console.log("[DIAG] listFetchNow available:", !!listFetchNow);
|
|
674
676
|
listFetchNowRef.current = listFetchNow;
|
|
675
677
|
}, [listFetchNow]);
|
|
676
678
|
useEffect(() => {
|
|
677
|
-
var _a, _b;
|
|
678
|
-
|
|
679
|
+
var _a, _b, _c;
|
|
680
|
+
console.log("[DIAG] initial fetch effect running, guard:", !!((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id), "has listFetchNowRef:", !!listFetchNowRef.current, "listParams:", JSON.stringify(listParams));
|
|
681
|
+
if (!((_b = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _b === void 0 ? void 0 : _b.id))
|
|
679
682
|
return;
|
|
680
|
-
(
|
|
681
|
-
|
|
683
|
+
console.log("[DIAG] about to call listFetchNowRef.current()");
|
|
684
|
+
(_c = listFetchNowRef.current) === null || _c === void 0 ? void 0 : _c.call(listFetchNowRef);
|
|
685
|
+
}, [dispatch, listParams, (_g = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _g === void 0 ? void 0 : _g.id, showToast, t]);
|
|
682
686
|
// ============================================================================
|
|
683
687
|
// 1.4.10 RETURN
|
|
684
688
|
// ============================================================================
|