Skip to content

Commit 5fbde93

Browse files
authored
Merge pull request #2448 from tekdi/release-1.13.0-prod-register
Release 1.13.0 prod register to learner prod
2 parents 4d4948c + 55dba2a commit 5fbde93

File tree

5 files changed

+25
-9
lines changed

5 files changed

+25
-9
lines changed

apps/learner-web-app/src/components/Content/Player.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ const App = ({
7878
console.log('rt=======>', rt);
7979
const currentPath =
8080
typeof window !== 'undefined' ? window.location.pathname : '';
81-
const isThematicPath = currentPath.includes('/themantic');
81+
const hostname = typeof window !== 'undefined' ? window.location.hostname : '';
82+
const isThematicPath = currentPath.includes('/themantic')||hostname.includes('experimentoindia');
8283
const isPosPath = currentPath.includes('/pos');
8384

8485
if (!isThematicPath && !isPosPath && rt?.program) {

apps/learner-web-app/src/components/EditProfile/EditProfile.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,18 @@ const [responseFormData, setResponseFormData] = useState<any>({});
119119
},
120120
},
121121
]);
122+
delete responseFormForEnroll?.schema?.properties?.password;
123+
delete responseFormForEnroll?.schema?.properties.confirm_password;
124+
delete responseFormForEnroll?.schema?.properties?.username;
125+
delete responseFormForEnroll?.schema?.properties?.program;
126+
delete responseFormForEnroll?.schema?.properties?.batch;
127+
delete responseFormForEnroll?.schema?.properties?.center;
128+
delete responseFormForEnroll?.schema?.properties?.state;
129+
delete responseFormForEnroll?.schema?.properties?.district;
130+
delete responseFormForEnroll?.schema?.properties?.block;
131+
delete responseFormForEnroll?.schema?.properties?.village;
132+
responseFormForEnroll?.schema?.required?.pop('batch');
133+
122134
const responseFormCopy = JSON.parse(JSON.stringify(responseForm));
123135
setResponseFormData(responseFormCopy);
124136
console.log('responseForm===>', responseFormCopy?.schema);
@@ -159,10 +171,10 @@ const [responseFormData, setResponseFormData] = useState<any>({});
159171

160172
setUserFormData(mappedData);
161173
//unit name is missing from required so handled from frotnend
162-
let alterSchema = uponEnrollCompletion?updatedSchemaForEnroll:completeProfile
174+
let alterSchema = enrolledProgram?responseFormForEnroll?.schema:completeProfile
163175
? updatedSchema
164176
: responseForm?.schema;
165-
let alterUISchema = responseForm?.uiSchema;
177+
let alterUISchema =enrolledProgram? responseFormForEnroll?.uiSchema: responseForm?.uiSchema;
166178

167179
// Set mobile field states
168180
setMobileAddUiSchema(responseForm?.uiSchema?.mobile);

libs/shared-lib-v2/src/DynamicForm/components/DynamicForm.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ const DynamicForm = ({
315315
});
316316

317317
// remove from required mobile
318-
requiredArray = requiredArray.filter(
318+
requiredArray = requiredArray?.filter(
319319
(key) => !requiredKeys2.includes(key)
320320
);
321321

@@ -388,7 +388,7 @@ const DynamicForm = ({
388388
delete formData?.guardian_name;
389389

390390
// remove from required
391-
requiredArray = requiredArray.filter(
391+
requiredArray = requiredArray?.filter(
392392
(key) => !requiredKeys.includes(key)
393393
);
394394

@@ -466,10 +466,10 @@ const DynamicForm = ({
466466
let requiredArray = oldFormSchema?.required;
467467

468468
// remove from required
469-
requiredArray = requiredArray.filter(
469+
requiredArray = requiredArray?.filter(
470470
(key) => !requiredKeys.includes(key)
471471
);
472-
requiredArray = requiredArray.filter(
472+
requiredArray = requiredArray?.filter(
473473
(key) => !requiredKeys2.includes(key)
474474
);
475475

mfes/content/src/components/Content/ContentEnroll.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ const ContentDetails = (props: ContentDetailsProps) => {
5858

5959
console.log('result=======>', result?.program);
6060
const currentPath = typeof window !== 'undefined' ? window.location.pathname : '';
61+
const hostname = typeof window !== 'undefined' ? window.location.hostname : '';
6162
console.log('currentPath=======>', currentPath);
62-
const isThematicPath = currentPath.includes('/themantic');
63+
const isThematicPath = currentPath.includes('/themantic') || hostname.includes('experimentoindia');
6364
const isPosPath = currentPath.includes('/pos');
6465
console.log('isThematicPath=======>', isThematicPath);
6566

mfes/content/src/components/Content/CourseUnitDetails.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ export default function Details(props: DetailsProps) {
7777
mode: 'edit',
7878
}) as any;
7979
const currentPath = typeof window !== 'undefined' ? window.location.pathname : '';
80-
const isThematicPath = currentPath.includes('/themantic');
80+
const hostname = typeof window !== 'undefined' ? window.location.hostname : '';
8181
const isPosPath = currentPath.includes('/pos');
82+
const isThematicPath = currentPath.includes('/themantic')||hostname.includes('experimentoindia');
83+
8284
if(!isThematicPath && !isPosPath && resultHierarchyCourse?.program) {
8385
console.log('rt=======>', resultHierarchyCourse);
8486
if(localStorage.getItem('channelId')==="pos-channel"){

0 commit comments

Comments
 (0)