From ec62a0435db4f3b32e9c326cb0c0fdcb8dd7e47f Mon Sep 17 00:00:00 2001 From: AishDani Date: Sun, 13 Apr 2025 12:17:39 +0530 Subject: [PATCH 1/5] refactor:CMG-506:refactored user flow when content mapper not generated by enabling save and continue button --- ui/src/components/ContentMapper/index.tsx | 5 +- .../LegacyCms/Actions/LoadUploadFile.tsx | 3 +- .../components/MigrationFlowHeader/index.tsx | 6 ++- .../HorizontalStepper/HorizontalStepper.tsx | 2 +- ui/src/context/app/app.interface.ts | 4 +- ui/src/pages/Migration/index.tsx | 48 +++++++++++++++---- ui/src/services/api/service.interface.ts | 4 +- 7 files changed, 56 insertions(+), 16 deletions(-) diff --git a/ui/src/components/ContentMapper/index.tsx b/ui/src/components/ContentMapper/index.tsx index 1137fcb03..3602c6052 100644 --- a/ui/src/components/ContentMapper/index.tsx +++ b/ui/src/components/ContentMapper/index.tsx @@ -215,7 +215,7 @@ const Fields: MappingFields = { } type contentMapperProps = { - handleStepChange: (currentStep: number) => void; + handleStepChange: (step: number) => void; } const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: React.ForwardedRef) => { @@ -2410,7 +2410,8 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R ...newMigrationData?.legacy_cms, uploadedFile:{ ...newMigrationData?.legacy_cms?.uploadedFile, - reValidate: true + reValidate: true, + file_revalidated: true } } } diff --git a/ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx b/ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx index f5927d09d..beffddf33 100644 --- a/ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx +++ b/ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx @@ -137,7 +137,8 @@ const LoadUploadFile = (props: LoadUploadFileProps) => { buketKey: data?.file_details?.awsData?.buketKey } }, - cmsType: data?.cmsType + cmsType: data?.cmsType, + file_revalidated: true } } diff --git a/ui/src/components/MigrationFlowHeader/index.tsx b/ui/src/components/MigrationFlowHeader/index.tsx index 5c87892f3..fe7582c60 100644 --- a/ui/src/components/MigrationFlowHeader/index.tsx +++ b/ui/src/components/MigrationFlowHeader/index.tsx @@ -36,6 +36,7 @@ const MigrationFlowHeader = ({ }: MigrationFlowHeaderProps) => { const [projectName, setProjectName] = useState(''); const [currentStep, setCurrentStep] = useState(0); + const [contentMapperLength, setcontentMapperLength] = useState(); const navigate = useNavigate(); const params: Params = useParams(); @@ -56,6 +57,7 @@ const MigrationFlowHeader = ({ const fetchProject = async () => { setProjectName(projectData?.name); setCurrentStep(projectData?.current_step); + setcontentMapperLength(projectData?.content_mapper?.length) //Navigate to lastest or active Step const url = `/projects/${params?.projectId}/migration/steps/${projectData?.current_step}`; @@ -94,6 +96,8 @@ const MigrationFlowHeader = ({ newMigrationData?.destination_stack?.selectedStack?.value ); + const enableButton = contentMapperLength === 0 && newMigrationData?.project_current_step === 3 && params?.stepId === '1' && (!newMigrationData?.legacy_cms?.uploadedFile?.reValidate || newMigrationData?.legacy_cms?.uploadedFile?.reValidate) && newMigrationData?.legacy_cms?.uploadedFile?.file_revalidated + return (
@@ -112,7 +116,7 @@ const MigrationFlowHeader = ({ aria-label="Save and Continue" isLoading={isLoading || newMigrationData?.isprojectMapped} disabled={ - isStep4AndNotMigrated || isStepInvalid || isExecutionStarted || destinationStackMigrated + (isStep4AndNotMigrated || isStepInvalid || isExecutionStarted || destinationStackMigrated) && !enableButton } > {stepValue} diff --git a/ui/src/components/Stepper/HorizontalStepper/HorizontalStepper.tsx b/ui/src/components/Stepper/HorizontalStepper/HorizontalStepper.tsx index 78db8e418..e7e00d3c8 100644 --- a/ui/src/components/Stepper/HorizontalStepper/HorizontalStepper.tsx +++ b/ui/src/components/Stepper/HorizontalStepper/HorizontalStepper.tsx @@ -50,7 +50,7 @@ export type stepperProps = { }; export type HorizontalStepperHandles = { - handleStepChange: (currentStep: number) => void; + handleStepChange: (stepIndex: number) => void; }; const showNotification = (currentIndex: number) => { diff --git a/ui/src/context/app/app.interface.ts b/ui/src/context/app/app.interface.ts index 148327420..f55478473 100644 --- a/ui/src/context/app/app.interface.ts +++ b/ui/src/context/app/app.interface.ts @@ -68,7 +68,8 @@ export interface IFile { file_details?: FileDetails; isValidated: boolean; reValidate: boolean; - cmsType: string + cmsType: string; + file_revalidated: boolean; } export interface ICMSType extends ICardType { @@ -311,6 +312,7 @@ export const DEFAULT_FILE: IFile = { isValidated: false, reValidate: false, cmsType: '', + file_revalidated: false }; export const DEFAULT_CMS_TYPE: ICMSType = { diff --git a/ui/src/pages/Migration/index.tsx b/ui/src/pages/Migration/index.tsx index d43675269..99f1014ca 100644 --- a/ui/src/pages/Migration/index.tsx +++ b/ui/src/pages/Migration/index.tsx @@ -324,7 +324,8 @@ const Migration = () => { isLocalPath: projectData?.legacy_cms?.is_localPath }, isValidated: projectData?.legacy_cms?.is_fileValid, - reValidate: newMigrationData?.legacy_cms?.uploadedFile?.reValidate + reValidate: newMigrationData?.legacy_cms?.uploadedFile?.reValidate, + file_revalidated: newMigrationData?.legacy_cms?.uploadedFile?.file_revalidated } : uploadObj, isFileFormatCheckboxChecked: true, isRestictedKeywordCheckboxChecked: true, @@ -373,7 +374,7 @@ const Migration = () => { */ const createStepper = ( projectData: MigrationResponse, - handleStepChange: (currentStep: number) => void + handleStepChange: (step: number) => void ) => { const steps = [ { @@ -450,7 +451,7 @@ const Migration = () => { const handleOnClickLegacyCms = async (event: MouseEvent) => { setIsLoading(true); - if (isCompleted) { + if (isCompleted && newMigrationData?.project_current_step === 1) { event.preventDefault(); //Update Data in backend @@ -493,6 +494,26 @@ const Migration = () => { type: 'error' }); } + } + else if(newMigrationData?.project_current_step > 1 && (!newMigrationData?.legacy_cms?.uploadedFile?.reValidate || newMigrationData?.legacy_cms?.uploadedFile?.reValidate)){ + if(!newMigrationData?.legacy_cms?.uploadedFile?.file_revalidated){ + setIsLoading(false); + Notification({ + notificationContent: { + text: 'Please reValidate the file to procced furthur' + }, + type: 'warning' + }); + } + else{ + setIsLoading(false); + handleStepChange(2); + const url = `/projects/${projectId}/migration/steps/3`; + navigate(url, { replace: true }); + + } + + } else { setIsLoading(false); @@ -623,12 +644,21 @@ const Migration = () => { } }); } else { - event.preventDefault(); - const url = `/projects/${projectId}/migration/steps/4`; - navigate(url, { replace: true }); - await updateCurrentStepData(selectedOrganisation.value, projectId); - handleStepChange(3); + const res = await updateCurrentStepData(selectedOrganisation.value, projectId); + if (res?.status === 200) { + setIsLoading(false); + event.preventDefault(); + const url = `/projects/${projectId}/migration/steps/4`; + navigate(url, { replace: true }); + } else { + setIsLoading(false); + Notification({ + notificationContent: { text: res?.data?.error?.message }, + type: 'error' + }); + } + } }; @@ -722,7 +752,7 @@ const Migration = () => {
Date: Mon, 14 Apr 2025 10:43:24 +0530 Subject: [PATCH 2/5] refactor:added await in project services of api service --- api/src/services/projects.service.ts | 47 +++++++++++++--------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/api/src/services/projects.service.ts b/api/src/services/projects.service.ts index 945408a50..05d625e8e 100644 --- a/api/src/services/projects.service.ts +++ b/api/src/services/projects.service.ts @@ -135,7 +135,7 @@ const createProject = async (req: Request) => { //Add logic to create Project from DB await ProjectModelLowdb.read(); - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects.push(projectData); }); @@ -204,7 +204,7 @@ const updateProject = async (req: Request) => { try { // Update the project fields - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].name = updateData?.name; data.projects[projectIndex].description = updateData?.description; if ( @@ -308,7 +308,7 @@ const updateLegacyCMS = async (req: Request) => { // } try { - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].legacy_cms.cms = legacy_cms; data.projects[projectIndex].current_step = STEPPER_STEPS.LEGACY_CMS; data.projects[projectIndex].status = NEW_PROJECT_STATUS[0]; @@ -368,7 +368,7 @@ const updateAffix = async (req: Request) => { true )) as number; - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].legacy_cms.affix = affix; data.projects[projectIndex].updated_at = new Date().toISOString(); }); @@ -405,7 +405,7 @@ const affixConfirmation = async (req: Request) => { true )) as number; - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].legacy_cms.affix_confirmation = affix_confirmation; data.projects[projectIndex].updated_at = new Date().toISOString(); @@ -477,7 +477,7 @@ const updateFileFormat = async (req: Request) => { // } try { - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].legacy_cms.file_format = file_format; data.projects[projectIndex].legacy_cms.file_path = file_path; data.projects[projectIndex].legacy_cms.is_fileValid = is_fileValid; @@ -546,7 +546,7 @@ const fileformatConfirmation = async (req: Request) => { )) as number; if (!fileformat_confirmation) { - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].legacy_cms.file_format_confirmation = fileformat_confirmation; data.projects[projectIndex].updated_at = new Date().toISOString(); @@ -643,7 +643,7 @@ const updateDestinationStack = async (req: Request) => { if (!res.data.stacks.find((stack: any) => stack.api_key === stack_api_key)) throw new BadRequestError(HTTP_TEXTS.DESTINATION_STACK_NOT_FOUND); - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].destination_stack_id = stack_api_key; data.projects[projectIndex].current_step = STEPPER_STEPS.DESTINATION_STACK; @@ -713,11 +713,6 @@ const updateCurrentStep = async (req: Request) => { const isStepCompleted = project?.legacy_cms?.cms && project?.legacy_cms?.file_format; - console.info((project.status === NEW_PROJECT_STATUS[0] || - !isStepCompleted || - !project?.destination_stack_id || - project?.content_mapper?.length === 0 || - !project?.current_test_stack_id) || !project?.migration_execution); switch (project.current_step) { case STEPPER_STEPS.LEGACY_CMS: { @@ -732,7 +727,7 @@ const updateCurrentStep = async (req: Request) => { throw new BadRequestError(HTTP_TEXTS.CANNOT_PROCEED_LEGACY_CMS); } - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].current_step = STEPPER_STEPS.DESTINATION_STACK; data.projects[projectIndex].status = @@ -760,7 +755,7 @@ const updateCurrentStep = async (req: Request) => { ); } - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].current_step = STEPPER_STEPS.CONTENT_MAPPING; data.projects[projectIndex].status = NEW_PROJECT_STATUS[3]; @@ -789,7 +784,7 @@ const updateCurrentStep = async (req: Request) => { ); } - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].current_step = STEPPER_STEPS.TESTING; data.projects[projectIndex].status = NEW_PROJECT_STATUS[4]; @@ -818,7 +813,7 @@ const updateCurrentStep = async (req: Request) => { ); } - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].current_step = STEPPER_STEPS.MIGRATION; data.projects[projectIndex].status = NEW_PROJECT_STATUS[4]; @@ -847,7 +842,7 @@ const updateCurrentStep = async (req: Request) => { ); } - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].current_step = STEPPER_STEPS.MIGRATION; data.projects[projectIndex].status = NEW_PROJECT_STATUS[5]; @@ -913,7 +908,7 @@ const deleteProject = async (req: Request) => { await ContentTypesMapperModelLowdb.read(); await FieldMapperModel.read(); if (!isEmpty(content_mapper_id)) { - content_mapper_id.map((item: any) => { + content_mapper_id.map(async (item: any) => { const contentMapperData = ContentTypesMapperModelLowdb.chain .get("ContentTypesMappers") .find({ id: item, projectId: projectId }) @@ -940,17 +935,17 @@ const deleteProject = async (req: Request) => { .get("ContentTypesMappers") .findIndex({ id: item, projectId: projectId }) .value(); - ContentTypesMapperModelLowdb.update((Cdata: any) => { + await ContentTypesMapperModelLowdb.update((Cdata: any) => { delete Cdata.ContentTypesMappers[contentMapperID]; }); }); } //delete Project - ProjectModelLowdb.update((Pdata: any) => { + await ProjectModelLowdb.update((Pdata: any) => { delete Pdata.projects[projectIndex]; }); } else { - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].isDeleted = true; }); } @@ -1000,7 +995,7 @@ const revertProject = async (req: Request) => { if (!projects) { throw new NotFoundError(HTTP_TEXTS.PROJECT_NOT_FOUND); } else { - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].isDeleted = false; }); logger.info( @@ -1047,7 +1042,7 @@ const updateStackDetails = async (req: Request) => { )) as number; try { - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].stackDetails = stack_details; data.projects[projectIndex].updated_at = new Date().toISOString(); }); @@ -1109,7 +1104,7 @@ const updateContentMapper = async (req: Request) => { )) as number; try { - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].mapperKeys = content_mapper; data.projects[projectIndex].updated_at = new Date().toISOString(); }); @@ -1170,7 +1165,7 @@ const updateMigrationExecution = async (req: Request) => { try { // Update the project in the `ProjectModelLowdb` database - ProjectModelLowdb.update((data: any) => { + await ProjectModelLowdb.update((data: any) => { data.projects[projectIndex].migration_execution = true; // Set migration execution to true data.projects[projectIndex].updated_at = new Date().toISOString(); // Update the `updated_at` timestamp }); From 3f71ad6d0f4d5eb5029e330261e2819d1f18cdf8 Mon Sep 17 00:00:00 2001 From: AishDani Date: Mon, 14 Apr 2025 15:15:19 +0530 Subject: [PATCH 3/5] Revert "refactor:CMG-506:refactored user flow when content mapper not generated by enabling save and continue button" This reverts commit ec62a0435db4f3b32e9c326cb0c0fdcb8dd7e47f. --- ui/src/components/ContentMapper/index.tsx | 5 +- .../LegacyCms/Actions/LoadUploadFile.tsx | 3 +- .../components/MigrationFlowHeader/index.tsx | 6 +-- .../HorizontalStepper/HorizontalStepper.tsx | 2 +- ui/src/context/app/app.interface.ts | 4 +- ui/src/pages/Migration/index.tsx | 48 ++++--------------- ui/src/services/api/service.interface.ts | 4 +- 7 files changed, 16 insertions(+), 56 deletions(-) diff --git a/ui/src/components/ContentMapper/index.tsx b/ui/src/components/ContentMapper/index.tsx index 3602c6052..1137fcb03 100644 --- a/ui/src/components/ContentMapper/index.tsx +++ b/ui/src/components/ContentMapper/index.tsx @@ -215,7 +215,7 @@ const Fields: MappingFields = { } type contentMapperProps = { - handleStepChange: (step: number) => void; + handleStepChange: (currentStep: number) => void; } const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: React.ForwardedRef) => { @@ -2410,8 +2410,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R ...newMigrationData?.legacy_cms, uploadedFile:{ ...newMigrationData?.legacy_cms?.uploadedFile, - reValidate: true, - file_revalidated: true + reValidate: true } } } diff --git a/ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx b/ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx index beffddf33..f5927d09d 100644 --- a/ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx +++ b/ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx @@ -137,8 +137,7 @@ const LoadUploadFile = (props: LoadUploadFileProps) => { buketKey: data?.file_details?.awsData?.buketKey } }, - cmsType: data?.cmsType, - file_revalidated: true + cmsType: data?.cmsType } } diff --git a/ui/src/components/MigrationFlowHeader/index.tsx b/ui/src/components/MigrationFlowHeader/index.tsx index fe7582c60..5c87892f3 100644 --- a/ui/src/components/MigrationFlowHeader/index.tsx +++ b/ui/src/components/MigrationFlowHeader/index.tsx @@ -36,7 +36,6 @@ const MigrationFlowHeader = ({ }: MigrationFlowHeaderProps) => { const [projectName, setProjectName] = useState(''); const [currentStep, setCurrentStep] = useState(0); - const [contentMapperLength, setcontentMapperLength] = useState(); const navigate = useNavigate(); const params: Params = useParams(); @@ -57,7 +56,6 @@ const MigrationFlowHeader = ({ const fetchProject = async () => { setProjectName(projectData?.name); setCurrentStep(projectData?.current_step); - setcontentMapperLength(projectData?.content_mapper?.length) //Navigate to lastest or active Step const url = `/projects/${params?.projectId}/migration/steps/${projectData?.current_step}`; @@ -96,8 +94,6 @@ const MigrationFlowHeader = ({ newMigrationData?.destination_stack?.selectedStack?.value ); - const enableButton = contentMapperLength === 0 && newMigrationData?.project_current_step === 3 && params?.stepId === '1' && (!newMigrationData?.legacy_cms?.uploadedFile?.reValidate || newMigrationData?.legacy_cms?.uploadedFile?.reValidate) && newMigrationData?.legacy_cms?.uploadedFile?.file_revalidated - return (
@@ -116,7 +112,7 @@ const MigrationFlowHeader = ({ aria-label="Save and Continue" isLoading={isLoading || newMigrationData?.isprojectMapped} disabled={ - (isStep4AndNotMigrated || isStepInvalid || isExecutionStarted || destinationStackMigrated) && !enableButton + isStep4AndNotMigrated || isStepInvalid || isExecutionStarted || destinationStackMigrated } > {stepValue} diff --git a/ui/src/components/Stepper/HorizontalStepper/HorizontalStepper.tsx b/ui/src/components/Stepper/HorizontalStepper/HorizontalStepper.tsx index e7e00d3c8..78db8e418 100644 --- a/ui/src/components/Stepper/HorizontalStepper/HorizontalStepper.tsx +++ b/ui/src/components/Stepper/HorizontalStepper/HorizontalStepper.tsx @@ -50,7 +50,7 @@ export type stepperProps = { }; export type HorizontalStepperHandles = { - handleStepChange: (stepIndex: number) => void; + handleStepChange: (currentStep: number) => void; }; const showNotification = (currentIndex: number) => { diff --git a/ui/src/context/app/app.interface.ts b/ui/src/context/app/app.interface.ts index f55478473..148327420 100644 --- a/ui/src/context/app/app.interface.ts +++ b/ui/src/context/app/app.interface.ts @@ -68,8 +68,7 @@ export interface IFile { file_details?: FileDetails; isValidated: boolean; reValidate: boolean; - cmsType: string; - file_revalidated: boolean; + cmsType: string } export interface ICMSType extends ICardType { @@ -312,7 +311,6 @@ export const DEFAULT_FILE: IFile = { isValidated: false, reValidate: false, cmsType: '', - file_revalidated: false }; export const DEFAULT_CMS_TYPE: ICMSType = { diff --git a/ui/src/pages/Migration/index.tsx b/ui/src/pages/Migration/index.tsx index 99f1014ca..d43675269 100644 --- a/ui/src/pages/Migration/index.tsx +++ b/ui/src/pages/Migration/index.tsx @@ -324,8 +324,7 @@ const Migration = () => { isLocalPath: projectData?.legacy_cms?.is_localPath }, isValidated: projectData?.legacy_cms?.is_fileValid, - reValidate: newMigrationData?.legacy_cms?.uploadedFile?.reValidate, - file_revalidated: newMigrationData?.legacy_cms?.uploadedFile?.file_revalidated + reValidate: newMigrationData?.legacy_cms?.uploadedFile?.reValidate } : uploadObj, isFileFormatCheckboxChecked: true, isRestictedKeywordCheckboxChecked: true, @@ -374,7 +373,7 @@ const Migration = () => { */ const createStepper = ( projectData: MigrationResponse, - handleStepChange: (step: number) => void + handleStepChange: (currentStep: number) => void ) => { const steps = [ { @@ -451,7 +450,7 @@ const Migration = () => { const handleOnClickLegacyCms = async (event: MouseEvent) => { setIsLoading(true); - if (isCompleted && newMigrationData?.project_current_step === 1) { + if (isCompleted) { event.preventDefault(); //Update Data in backend @@ -494,26 +493,6 @@ const Migration = () => { type: 'error' }); } - } - else if(newMigrationData?.project_current_step > 1 && (!newMigrationData?.legacy_cms?.uploadedFile?.reValidate || newMigrationData?.legacy_cms?.uploadedFile?.reValidate)){ - if(!newMigrationData?.legacy_cms?.uploadedFile?.file_revalidated){ - setIsLoading(false); - Notification({ - notificationContent: { - text: 'Please reValidate the file to procced furthur' - }, - type: 'warning' - }); - } - else{ - setIsLoading(false); - handleStepChange(2); - const url = `/projects/${projectId}/migration/steps/3`; - navigate(url, { replace: true }); - - } - - } else { setIsLoading(false); @@ -644,21 +623,12 @@ const Migration = () => { } }); } else { + event.preventDefault(); + const url = `/projects/${projectId}/migration/steps/4`; + navigate(url, { replace: true }); - const res = await updateCurrentStepData(selectedOrganisation.value, projectId); - if (res?.status === 200) { - setIsLoading(false); - event.preventDefault(); - const url = `/projects/${projectId}/migration/steps/4`; - navigate(url, { replace: true }); - } else { - setIsLoading(false); - Notification({ - notificationContent: { text: res?.data?.error?.message }, - type: 'error' - }); - } - + await updateCurrentStepData(selectedOrganisation.value, projectId); + handleStepChange(3); } }; @@ -752,7 +722,7 @@ const Migration = () => {
Date: Mon, 14 Apr 2025 15:24:06 +0530 Subject: [PATCH 4/5] refactor:added notification message for current step data in contentMapper function of migration component --- ui/src/pages/Migration/index.tsx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/ui/src/pages/Migration/index.tsx b/ui/src/pages/Migration/index.tsx index d43675269..8512895b9 100644 --- a/ui/src/pages/Migration/index.tsx +++ b/ui/src/pages/Migration/index.tsx @@ -623,12 +623,22 @@ const Migration = () => { } }); } else { - event.preventDefault(); - const url = `/projects/${projectId}/migration/steps/4`; - navigate(url, { replace: true }); - await updateCurrentStepData(selectedOrganisation.value, projectId); - handleStepChange(3); + const res = await updateCurrentStepData(selectedOrganisation.value, projectId); + if (res?.status === 200) { + setIsLoading(false); + event.preventDefault(); + handleStepChange(3); + const url = `/projects/${projectId}/migration/steps/4`; + navigate(url, { replace: true }); + } else { + setIsLoading(false); + Notification({ + notificationContent: { text: res?.data?.error?.message }, + type: 'error' + }); + } + } }; @@ -722,7 +732,7 @@ const Migration = () => {
Date: Mon, 14 Apr 2025 15:25:41 +0530 Subject: [PATCH 5/5] fix:removed full-stops from legacy cms step description --- ui/src/cmsData/legacyCms.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/src/cmsData/legacyCms.json b/ui/src/cmsData/legacyCms.json index 665a2bda3..7befa1f9f 100644 --- a/ui/src/cmsData/legacyCms.json +++ b/ui/src/cmsData/legacyCms.json @@ -326,7 +326,7 @@ "uid": "cs752bfd62296e4791" }, "title": "Select CMS", - "description": "Select the CMS you are migrating content from.", + "description": "Select the CMS you are migrating content from", "step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.", "lock": false, "active": true, @@ -338,7 +338,7 @@ "uid": "cs6c761d71844ac800" }, "title": "Add Source Affix", - "description": "Add a 2–5 character affix for the source name. Use only letters, no numbers or special characters.", + "description": "Add a 2–5 character affix for the source name. Use only letters, no numbers or special characters", "step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.", "lock": false, "active": false, @@ -350,7 +350,7 @@ "uid": "cs7c935e15de9ea7c8" }, "title": "Select File Format", - "description": "Select the file format compatible with the selected CMS.", + "description": "Select the file format compatible with the selected CMS", "step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.", "lock": false, "active": true, @@ -362,7 +362,7 @@ "uid": "cs0279f1f0ce13e83e" }, "title": "Uploaded File", - "description": "This is the file you have uploaded.", + "description": "This is the file you have uploaded", "step_lock_text": "Editing this step is currently disabled. To make changes in Draft mode, please deactivate the migration.", "lock": false, "active": true,