Skip to content

Commit fafbec3

Browse files
committed
conflicts solved prod to registration flow
2 parents 6c827cc + e988614 commit fafbec3

File tree

43 files changed

+2304
-285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2304
-285
lines changed

.github/workflows/qa-deployment-learner.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ jobs:
6060
docker-compose up -d --force-recreate --no-deps
6161
docker system prune -af || true
6262
docker ps -a
63-
sudo systemctl restart nginx
63+
sudo systemctl restart nginx

apps/admin-app-repo/public/locales/en/common.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@
358358
"DELETE_PLANNER": "Delete Planner",
359359
"CSV_TEMPLATE": "CSV Template",
360360
"NEW_TOPIC": "New Topic",
361-
"DOWNLOAD_CSV": "Download Uploaded CSV"
362-
361+
"DOWNLOAD_CSV": "Download Uploaded CSV",
362+
"DURING_COURSE": "Learn"
363363

364364
},
365365
"MASTER": {
@@ -544,7 +544,8 @@
544544
"DATE_OF_BIRTH": "Date of Birth",
545545
"TEST_BELONG_TO": "test belongs to below center",
546546
"WAS_BELONG_TO": "was archived in the below location",
547-
"CONFIRM_TO_ACTIVATE":"Are you sure you want to activate this user again?"
547+
"CONFIRM_TO_ACTIVATE":"Are you sure you want to activate this user again?",
548+
"BELONG_TO": "belongs to below center"
548549
},
549550
"FORM_ERROR_MESSAGES": {
550551
"INVALID_INPUT": "Invalid Input.",

apps/admin-app-repo/src/components/DeleteDetails.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface DeleteDetailsProps {
1616
firstName: string;
1717
lastName: string;
1818
village: string;
19+
center?: string;
1920
checked: boolean;
2021
setChecked: (checked: boolean) => void;
2122
reason: string;
@@ -27,6 +28,7 @@ const DeleteDetails: React.FC<DeleteDetailsProps> = ({
2728
firstName,
2829
lastName,
2930
village,
31+
center,
3032
checked,
3133
setChecked,
3234
reason,
@@ -45,9 +47,9 @@ const DeleteDetails: React.FC<DeleteDetailsProps> = ({
4547
}}
4648
>
4749
<Typography fontWeight="bold">
48-
{ firstName } { lastName } {t("FORM.TEST_BELONG_TO")}
50+
{ firstName } { lastName } {center? t("FORM.BELONG_TO"): t("FORM.WAS_BELONG_TO")}
4951
</Typography>
50-
<TextField fullWidth value={village} disabled sx={{ mt: 1 }} />
52+
<TextField fullWidth value={center? center: village} disabled sx={{ mt: 1 }} />
5153
</Box>
5254

5355
<FormControlLabel

apps/admin-app-repo/src/pages/content-creator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const ContentCreator = () => {
126126
);
127127
const staticFilter = {
128128
role: RoleName.CONTENT_CREATOR,
129-
tenantId: storedUserData.tenantData[0].tenantId,
129+
// tenantId: storedUserData.tenantData[0].tenantId,
130130
};
131131
const { sortBy } = formData;
132132
const staticSort = ['firstName', sortBy || 'asc'];

apps/admin-app-repo/src/pages/facilitator.tsx

Lines changed: 63 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import FacilitatorForm from '@/components/DynamicForm/FacilitatorForm/Facilitato
6565
import CenterLabel from '@/components/Centerlabel';
6666
import ResetFiltersButton from '@/components/ResetFiltersButton/ResetFiltersButton';
6767
import { showToastMessage } from '@/components/Toastify';
68+
import { getOverallStatus } from '@shared-lib-v2/utils/helper';
6869

6970
const Facilitator = () => {
7071
const theme = useTheme<any>();
@@ -100,6 +101,7 @@ const Facilitator = () => {
100101
firstName: '',
101102
lastName: '',
102103
village: '',
104+
center: '',
103105
});
104106

105107
const { t, i18n } = useTranslation();
@@ -310,7 +312,7 @@ const Facilitator = () => {
310312
// )}
311313
// </>
312314
// );
313-
const centers =
315+
let centers =
314316
row.cohortData
315317
?.filter(
316318
(c: any) =>
@@ -319,7 +321,17 @@ const Facilitator = () => {
319321
)
320322
.map((c: any) => transformLabel(c.centerName))
321323
.filter(Boolean) || [];
322-
324+
if (centers.length === 0) {
325+
centers =
326+
row.cohortData
327+
?.filter(
328+
(c: any) =>
329+
c.centerStatus === 'active' &&
330+
c.cohortMember?.status === 'archived'
331+
)
332+
.map((c: any) => transformLabel(c.centerName))
333+
.filter(Boolean) || [];
334+
}
323335
return centers.join(', ');
324336
},
325337
},
@@ -328,7 +340,7 @@ const Facilitator = () => {
328340
label: 'Batch',
329341
render: (row) => {
330342
// console.log('BacthRow', row?.cohortData)
331-
const batches =
343+
let batches =
332344
row.cohortData
333345
?.filter(
334346
(c: any) =>
@@ -338,7 +350,18 @@ const Facilitator = () => {
338350
.map((c: any) => transformLabel(c.batchName))
339351
.filter(Boolean) || [];
340352

341-
return batches.join(', ');
353+
if (batches.length === 0) {
354+
batches =
355+
row.cohortData
356+
?.filter(
357+
(c: any) =>
358+
c.batchStatus === 'active' &&
359+
c.cohortMember?.status === 'archived'
360+
)
361+
.map((c: any) => transformLabel(c.batchName))
362+
.filter(Boolean) || [];
363+
}
364+
return batches.join(', ');
342365
},
343366
},
344367
{
@@ -354,8 +377,8 @@ const Facilitator = () => {
354377
{
355378
key: 'status',
356379
label: 'Status',
357-
render: (row: any) => transformLabel(row.status),
358-
getStyle: (row) => ({ color: row.status === 'active' ? 'green' : 'red' }),
380+
render: (row: any) => transformLabel(getOverallStatus(row?.cohortData)),
381+
getStyle: (row) => ({ color: getOverallStatus(row?.cohortData) === 'active' ? 'green' : 'red' }),
359382
},
360383
];
361384

@@ -367,9 +390,9 @@ const Facilitator = () => {
367390
try {
368391
const userCohortResp = await getCohortList(userID);
369392
if (userCohortResp?.result?.length) {
370-
membershipIds = userCohortResp?.result?.map(
371-
(item) => item.cohortMembershipId
372-
);
393+
membershipIds = userCohortResp?.result
394+
?.filter((c: any) => c.cohortMemberStatus === 'active')
395+
?.map((c: any) => c.cohortMembershipId) || [];
373396
} else {
374397
console.warn('No cohort data found for the user.');
375398
}
@@ -442,9 +465,9 @@ const Facilitator = () => {
442465
try {
443466
const userCohortResp = await getCohortList(userID);
444467
if (userCohortResp?.result?.length) {
445-
membershipIds = userCohortResp?.result?.map(
446-
(item) => item.cohortMembershipId
447-
);
468+
membershipIds = userCohortResp?.result
469+
?.filter((c: any) => c.cohortMemberStatus === 'archived')
470+
?.map((c: any) => c.cohortMembershipId) || [];
448471
} else {
449472
console.warn('No cohort data found for the user.');
450473
}
@@ -559,7 +582,10 @@ console.log('response?.result?.getUserDetails',response?.result?.getUserDetails)
559582
setEditableUserId(row?.userId);
560583
handleOpenModal();
561584
},
562-
show: (row) => row.status !== 'archived',
585+
show: (row) => row.cohortData?.some(
586+
(cohort) =>
587+
cohort?.cohortMember?.status === 'active'
588+
),
563589
},
564590
{
565591
icon: (
@@ -604,6 +630,11 @@ console.log('response?.result?.getUserDetails',response?.result?.getUserDetails)
604630
firstName: row?.firstName || '',
605631
lastName: row?.lastName || '',
606632
village: centerNames.length!==0 ?centerNames :"-" ,
633+
center:
634+
row?.cohortData
635+
?.filter((cohort) => cohort?.cohortMember?.status === 'archived')
636+
?.map((cohort) => cohort?.centerName)
637+
?.join(', ') || '',
607638
});
608639
setOpen(true);
609640
setUserId(row?.userId);
@@ -623,7 +654,10 @@ console.log('response?.result?.getUserDetails',response?.result?.getUserDetails)
623654
// setPrefilledFormData({});
624655
// searchData(prefilledFormData, currentPage);
625656
},
626-
show: (row) => row.status !== 'archived',
657+
show: (row) => row.cohortData?.some(
658+
(cohort) =>
659+
cohort?.cohortMember?.status === 'active'
660+
),
627661
},
628662
{
629663
icon: (
@@ -668,7 +702,10 @@ console.log('response?.result?.getUserDetails',response?.result?.getUserDetails)
668702
setEditableUserId(row?.userId);
669703
handleOpenModal();
670704
},
671-
show: (row) => row.status !== 'archived',
705+
show: (row) => row.cohortData?.some(
706+
(cohort) =>
707+
cohort?.cohortMember?.status === 'active'
708+
),
672709
},
673710
{
674711
icon: (
@@ -711,11 +748,18 @@ console.log('response?.result?.getUserDetails',response?.result?.getUserDetails)
711748
firstName: row?.firstName || '',
712749
lastName: row?.lastName || '',
713750
village: findVillage?.selectedValues?.[0]?.value || '',
751+
center:
752+
row?.cohortData
753+
?.filter((cohort) => cohort?.cohortMember?.status === 'archived')
754+
?.map((cohort) => cohort?.centerName)
755+
?.join(', ') || '',
714756
});
715757
// setReason('');
716758
// setChecked(false);
717759
},
718-
show: (row) => row.status !== 'active',
760+
show: (row) => row.cohortData?.some(
761+
(cohort) =>
762+
cohort?.cohortMember?.status === 'archived')
719763
},
720764
];
721765

@@ -933,6 +977,7 @@ console.log('response?.result?.getUserDetails',response?.result?.getUserDetails)
933977
firstName={userData.firstName}
934978
lastName={userData.lastName}
935979
village={userData.village}
980+
center={userData.center}
936981
checked={checked}
937982
setChecked={setChecked}
938983
reason={reason}
@@ -959,11 +1004,11 @@ console.log('response?.result?.getUserDetails',response?.result?.getUserDetails)
9591004
}}
9601005
>
9611006
<Typography>
962-
{userData.firstName} {userData.lastName} {t('FORM.WAS_BELONG_TO')}
1007+
{userData.firstName} {userData.lastName} {t('FORM.BELONG_TO')}
9631008
</Typography>
9641009
<TextField
9651010
fullWidth
966-
value={userData.village}
1011+
value={userData.center}
9671012
disabled
9681013
sx={{ mt: 1 }}
9691014
/>

apps/admin-app-repo/src/pages/importCsv.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,4 +1026,4 @@ export async function getStaticProps({ locale }: { locale: string }) {
10261026
...(await serverSideTranslations(locale, ['common'])),
10271027
},
10281028
};
1029-
}
1029+
}

0 commit comments

Comments
 (0)