Skip to content

Commit 8e3f81b

Browse files
authored
Merge pull request #2298 from tekdi/feat-prod-fix
Feat prod fix
2 parents b1b610f + 115c2f3 commit 8e3f81b

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

mfes/scp-teacher-repo/src/components/CohortLearnerList.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ interface CohortLearnerListProp {
2424
reloadState: boolean;
2525
setReloadState: React.Dispatch<React.SetStateAction<boolean>>;
2626
isLearnerAdded: boolean;
27+
isLearnerReassigned?: boolean;
2728
}
2829

2930
const CohortLearnerList: React.FC<CohortLearnerListProp> = ({
3031
cohortId,
3132
reloadState,
3233
setReloadState,
3334
isLearnerAdded,
35+
isLearnerReassigned,
3436
}) => {
3537
const [loading, setLoading] = React.useState<boolean>(false);
3638
const [searchTerm, setSearchTerm] = useState('');
@@ -103,7 +105,13 @@ const CohortLearnerList: React.FC<CohortLearnerListProp> = ({
103105
}
104106
};
105107
getCohortMemberList();
106-
}, [cohortId, reloadState, isLearnerAdded, isLearnerDeleted]);
108+
}, [
109+
cohortId,
110+
reloadState,
111+
isLearnerAdded,
112+
isLearnerDeleted,
113+
isLearnerReassigned,
114+
]);
107115

108116
// Reapply search filter when userData changes
109117
useEffect(() => {
@@ -125,7 +133,7 @@ const CohortLearnerList: React.FC<CohortLearnerListProp> = ({
125133
const handleLearnerDelete = () => {
126134
setIsLearnerDeleted(true);
127135
};
128-
const handleSearch = (searchTerm: string) => {
136+
const handleSearch = (searchTerm: string) => {
129137
setSearchTerm(searchTerm);
130138
const query = searchTerm.toLowerCase().trim();
131139

mfes/scp-teacher-repo/src/components/LearnersListItem.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ const LearnersListItem: React.FC<LearnerListProps> = ({
339339
const handleCloseCentersModal = () => {
340340
setOpenCentersModal(false);
341341
};
342+
const handleLearnerReassigned = () => {
343+
setReloadState(!reloadState);
344+
};
342345

343346
// const handleAssignCenters = async (selectedCenters: any) => {
344347
// setOpenCentersModal(false);
@@ -825,6 +828,7 @@ const LearnersListItem: React.FC<LearnerListProps> = ({
825828
onClose={handleCloseCentersModal}
826829
isReassign={true}
827830
customFields={customFields}
831+
onLearnerReassigned={handleLearnerReassigned}
828832
userId={userId}
829833
/>
830834
)}

mfes/scp-teacher-repo/src/pages/centers/[cohortId]/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ const CohortPage = () => {
184184
const [state, setState] = React.useState<string>();
185185
const [clickedBox, setClickedBox] = useState<string | null>(null);
186186
const [isLearnerAdded, setIsLearnerAdded] = useState(false);
187+
const [isLearnerReassigned, setIsLearnerReassigned] = useState(false);
187188
const [createEvent, setCreateEvent] = useState(false);
188189
const [eventCreated, setEventCreated] = useState(false);
189190
const [onEditEvent, setOnEditEvent] = useState(false);
@@ -1146,6 +1147,7 @@ const CohortPage = () => {
11461147
reloadState={reloadState}
11471148
setReloadState={setReloadState}
11481149
isLearnerAdded={isLearnerAdded}
1150+
isLearnerReassigned={isLearnerReassigned}
11491151
/>
11501152
</Box>
11511153
{openAddLearnerModal && (

mfes/scp-teacher-repo/src/shared/LearnerManage/LearnerManage.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const LearnerManage = ({
3434
open,
3535
onClose,
3636
onLearnerAdded,
37+
onLearnerReassigned,
3738
cohortId,
3839
isReassign,
3940
customFields,
@@ -327,6 +328,9 @@ const LearnerManage = ({
327328
if (typeof onLearnerAdded === 'function') {
328329
onLearnerAdded();
329330
}
331+
// if (typeof onLearnerReassign === 'function') {
332+
onLearnerReassigned();
333+
// }
330334
setOpenModal(false);
331335
}}
332336
schema={isEditProfile ? addEditSchema : addSchema}
@@ -343,6 +347,9 @@ const LearnerManage = ({
343347
if (typeof onLearnerAdded === 'function') {
344348
onLearnerAdded();
345349
}
350+
// if (typeof onLearnerReassign === 'function') {
351+
onLearnerReassigned();
352+
// }
346353
setOpenModal(false);
347354
}}
348355
extraFields={extraFields}

0 commit comments

Comments
 (0)