@@ -324,8 +324,7 @@ const Migration = () => {
324324 isLocalPath : projectData ?. legacy_cms ?. is_localPath
325325 } ,
326326 isValidated : projectData ?. legacy_cms ?. is_fileValid ,
327- reValidate : newMigrationData ?. legacy_cms ?. uploadedFile ?. reValidate ,
328- file_revalidated : newMigrationData ?. legacy_cms ?. uploadedFile ?. file_revalidated
327+ reValidate : newMigrationData ?. legacy_cms ?. uploadedFile ?. reValidate
329328 } : uploadObj ,
330329 isFileFormatCheckboxChecked : true ,
331330 isRestictedKeywordCheckboxChecked : true ,
@@ -374,7 +373,7 @@ const Migration = () => {
374373 */
375374 const createStepper = (
376375 projectData : MigrationResponse ,
377- handleStepChange : ( step : number ) => void
376+ handleStepChange : ( currentStep : number ) => void
378377 ) => {
379378 const steps = [
380379 {
@@ -451,7 +450,7 @@ const Migration = () => {
451450 const handleOnClickLegacyCms = async ( event : MouseEvent ) => {
452451 setIsLoading ( true ) ;
453452
454- if ( isCompleted && newMigrationData ?. project_current_step === 1 ) {
453+ if ( isCompleted ) {
455454 event . preventDefault ( ) ;
456455
457456 //Update Data in backend
@@ -494,26 +493,6 @@ const Migration = () => {
494493 type : 'error'
495494 } ) ;
496495 }
497- }
498- else if ( newMigrationData ?. project_current_step > 1 && ( ! newMigrationData ?. legacy_cms ?. uploadedFile ?. reValidate || newMigrationData ?. legacy_cms ?. uploadedFile ?. reValidate ) ) {
499- if ( ! newMigrationData ?. legacy_cms ?. uploadedFile ?. file_revalidated ) {
500- setIsLoading ( false ) ;
501- Notification ( {
502- notificationContent : {
503- text : 'Please reValidate the file to procced furthur'
504- } ,
505- type : 'warning'
506- } ) ;
507- }
508- else {
509- setIsLoading ( false ) ;
510- handleStepChange ( 2 ) ;
511- const url = `/projects/${ projectId } /migration/steps/3` ;
512- navigate ( url , { replace : true } ) ;
513-
514- }
515-
516-
517496 } else {
518497 setIsLoading ( false ) ;
519498
@@ -644,21 +623,12 @@ const Migration = () => {
644623 }
645624 } ) ;
646625 } else {
626+ event . preventDefault ( ) ;
627+ const url = `/projects/${ projectId } /migration/steps/4` ;
628+ navigate ( url , { replace : true } ) ;
647629
648- const res = await updateCurrentStepData ( selectedOrganisation . value , projectId ) ;
649- if ( res ?. status === 200 ) {
650- setIsLoading ( false ) ;
651- event . preventDefault ( ) ;
652- const url = `/projects/${ projectId } /migration/steps/4` ;
653- navigate ( url , { replace : true } ) ;
654- } else {
655- setIsLoading ( false ) ;
656- Notification ( {
657- notificationContent : { text : res ?. data ?. error ?. message } ,
658- type : 'error'
659- } ) ;
660- }
661-
630+ await updateCurrentStepData ( selectedOrganisation . value , projectId ) ;
631+ handleStepChange ( 3 ) ;
662632 }
663633 } ;
664634
@@ -752,7 +722,7 @@ const Migration = () => {
752722 < div className = "steps-wrapper" >
753723 < HorizontalStepper
754724 ref = { stepperRef }
755- steps = { createStepper ( projectData ?? defaultMigrationResponse , handleStepChange ) }
725+ steps = { createStepper ( projectData ?? defaultMigrationResponse , handleClick ) }
756726 handleSaveCT = { saveRef ?. current ?. handleSaveContentType }
757727 changeDropdownState = { changeDropdownState }
758728 projectData = { projectData || defaultMigrationResponse }
0 commit comments