@appcorp/fusion-storybook 0.3.65 → 0.3.67
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/student-fee/context/shared.d.ts +10 -0
- package/base-modules/student-fee/context/shared.js +4 -1
- package/base-modules/student-fee/context/use-student-fee-module.d.ts +2 -0
- package/base-modules/student-fee/context/use-student-fee-module.js +32 -10
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -56,6 +56,8 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
|
|
|
56
56
|
studentProfileId: string;
|
|
57
57
|
filterEnabled: boolean | undefined;
|
|
58
58
|
filterStatus: PAYMENT_STATUS | "";
|
|
59
|
+
appliedFilterEnabled: boolean | undefined;
|
|
60
|
+
appliedFilterStatus: PAYMENT_STATUS | "";
|
|
59
61
|
}>, initialStudentFeeState: {
|
|
60
62
|
items: StudentFeeBE[];
|
|
61
63
|
count: number;
|
|
@@ -87,6 +89,8 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
|
|
|
87
89
|
studentProfileId: string;
|
|
88
90
|
filterEnabled: boolean | undefined;
|
|
89
91
|
filterStatus: PAYMENT_STATUS | "";
|
|
92
|
+
appliedFilterEnabled: boolean | undefined;
|
|
93
|
+
appliedFilterStatus: PAYMENT_STATUS | "";
|
|
90
94
|
}, StudentFeeProvider: import("react").FC<{
|
|
91
95
|
children: React.ReactNode;
|
|
92
96
|
}>, studentFeeReducer: (state: {
|
|
@@ -120,6 +124,8 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
|
|
|
120
124
|
studentProfileId: string;
|
|
121
125
|
filterEnabled: boolean | undefined;
|
|
122
126
|
filterStatus: PAYMENT_STATUS | "";
|
|
127
|
+
appliedFilterEnabled: boolean | undefined;
|
|
128
|
+
appliedFilterStatus: PAYMENT_STATUS | "";
|
|
123
129
|
}, action: any) => {
|
|
124
130
|
items: StudentFeeBE[];
|
|
125
131
|
count: number;
|
|
@@ -151,6 +157,8 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
|
|
|
151
157
|
studentProfileId: string;
|
|
152
158
|
filterEnabled: boolean | undefined;
|
|
153
159
|
filterStatus: PAYMENT_STATUS | "";
|
|
160
|
+
appliedFilterEnabled: boolean | undefined;
|
|
161
|
+
appliedFilterStatus: PAYMENT_STATUS | "";
|
|
154
162
|
}, useStudentFeeContext: () => import("@react-pakistan/util-functions/factory/generic-module-factory").GenericModuleContextWithHandlers<{
|
|
155
163
|
items: StudentFeeBE[];
|
|
156
164
|
count: number;
|
|
@@ -182,4 +190,6 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
|
|
|
182
190
|
studentProfileId: string;
|
|
183
191
|
filterEnabled: boolean | undefined;
|
|
184
192
|
filterStatus: PAYMENT_STATUS | "";
|
|
193
|
+
appliedFilterEnabled: boolean | undefined;
|
|
194
|
+
appliedFilterStatus: PAYMENT_STATUS | "";
|
|
185
195
|
}>;
|
|
@@ -57,9 +57,12 @@ const studentFeeConfig = {
|
|
|
57
57
|
schoolId: "",
|
|
58
58
|
status: PAYMENT_STATUS.PENDING,
|
|
59
59
|
studentProfileId: "",
|
|
60
|
-
// Filters
|
|
60
|
+
// Filters (pending — updated immediately by UI)
|
|
61
61
|
filterEnabled: undefined,
|
|
62
62
|
filterStatus: "",
|
|
63
|
+
// Applied filters (only updated on "Apply" / "Clear")
|
|
64
|
+
appliedFilterEnabled: undefined,
|
|
65
|
+
appliedFilterStatus: "",
|
|
63
66
|
},
|
|
64
67
|
};
|
|
65
68
|
// ============================================================================
|
|
@@ -68,6 +68,8 @@ export declare const useStudentFeeModule: () => {
|
|
|
68
68
|
studentProfileId: string;
|
|
69
69
|
filterEnabled: boolean | undefined;
|
|
70
70
|
filterStatus: PAYMENT_STATUS | "";
|
|
71
|
+
appliedFilterEnabled: boolean | undefined;
|
|
72
|
+
appliedFilterStatus: PAYMENT_STATUS | "";
|
|
71
73
|
};
|
|
72
74
|
dispatch: React.Dispatch<any>;
|
|
73
75
|
};
|
|
@@ -45,13 +45,15 @@ export const useStudentFeeModule = () => {
|
|
|
45
45
|
// ============================================================================
|
|
46
46
|
const listParams = useMemo(() => {
|
|
47
47
|
var _a;
|
|
48
|
-
return (Object.assign(Object.assign(Object.assign({ currentPage: state.currentPage, pageLimit: state.pageLimit, schoolId: ((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id) || "" }, (debouncedQuery ? { searchQuery: debouncedQuery } : {})), (state.
|
|
49
|
-
? { filterEnabled: state.
|
|
50
|
-
: {})), (state.
|
|
48
|
+
return (Object.assign(Object.assign(Object.assign({ currentPage: state.currentPage, pageLimit: state.pageLimit, schoolId: ((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id) || "" }, (debouncedQuery ? { searchQuery: debouncedQuery } : {})), (state.appliedFilterEnabled !== undefined
|
|
49
|
+
? { filterEnabled: state.appliedFilterEnabled }
|
|
50
|
+
: {})), (state.appliedFilterStatus
|
|
51
|
+
? { status: state.appliedFilterStatus }
|
|
52
|
+
: {})));
|
|
51
53
|
}, [
|
|
52
54
|
state.currentPage,
|
|
53
|
-
state.
|
|
54
|
-
state.
|
|
55
|
+
state.appliedFilterEnabled,
|
|
56
|
+
state.appliedFilterStatus,
|
|
55
57
|
state.pageLimit,
|
|
56
58
|
debouncedQuery,
|
|
57
59
|
(_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id,
|
|
@@ -501,20 +503,40 @@ export const useStudentFeeModule = () => {
|
|
|
501
503
|
});
|
|
502
504
|
}, [dispatch]);
|
|
503
505
|
const applyFilters = useCallback(() => {
|
|
506
|
+
dispatch({
|
|
507
|
+
type: STUDENT_FEE_ACTION_TYPES.SET_INPUT_FIELD,
|
|
508
|
+
payload: { key: "appliedFilterEnabled", value: state.filterEnabled },
|
|
509
|
+
});
|
|
510
|
+
dispatch({
|
|
511
|
+
type: STUDENT_FEE_ACTION_TYPES.SET_INPUT_FIELD,
|
|
512
|
+
payload: { key: "appliedFilterStatus", value: state.filterStatus },
|
|
513
|
+
});
|
|
504
514
|
dispatch({
|
|
505
515
|
type: STUDENT_FEE_ACTION_TYPES.SET_CURRENT_PAGE,
|
|
506
516
|
payload: { currentPage: 1 },
|
|
507
517
|
});
|
|
508
518
|
closeDrawer();
|
|
509
|
-
}, [dispatch, closeDrawer]);
|
|
519
|
+
}, [dispatch, closeDrawer, state.filterEnabled, state.filterStatus]);
|
|
510
520
|
const clearFilters = useCallback(() => {
|
|
511
521
|
dispatch({
|
|
512
|
-
type: STUDENT_FEE_ACTION_TYPES.
|
|
513
|
-
payload: {
|
|
522
|
+
type: STUDENT_FEE_ACTION_TYPES.SET_INPUT_FIELD,
|
|
523
|
+
payload: { key: "filterEnabled", value: undefined },
|
|
524
|
+
});
|
|
525
|
+
dispatch({
|
|
526
|
+
type: STUDENT_FEE_ACTION_TYPES.SET_INPUT_FIELD,
|
|
527
|
+
payload: { key: "filterStatus", value: "" },
|
|
528
|
+
});
|
|
529
|
+
dispatch({
|
|
530
|
+
type: STUDENT_FEE_ACTION_TYPES.SET_INPUT_FIELD,
|
|
531
|
+
payload: { key: "appliedFilterEnabled", value: undefined },
|
|
514
532
|
});
|
|
515
533
|
dispatch({
|
|
516
|
-
type: STUDENT_FEE_ACTION_TYPES.
|
|
517
|
-
payload: {
|
|
534
|
+
type: STUDENT_FEE_ACTION_TYPES.SET_INPUT_FIELD,
|
|
535
|
+
payload: { key: "appliedFilterStatus", value: "" },
|
|
536
|
+
});
|
|
537
|
+
dispatch({
|
|
538
|
+
type: STUDENT_FEE_ACTION_TYPES.SET_CURRENT_PAGE,
|
|
539
|
+
payload: { currentPage: 1 },
|
|
518
540
|
});
|
|
519
541
|
}, [dispatch]);
|
|
520
542
|
const handleSearch = useCallback((query) => {
|