Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions ui/src/common/assets/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -851,3 +851,20 @@ export const SCHEMA_PREVIEW = (
);


export const NoDataFound = (
<svg width="240"
height="240" viewBox="0 0 240 240"
fill="none" xmlns="http://www.w3.org/2000/svg"
name="NoDataEmptyState" data-test-id="cs-empty-state-module-image">
<path fill="#f7f9fc" d="M0 0h240v240H0z"></path>
<path opacity="0.25" d="M15.082 118.747c2.297 19.398 11.134 41.932 28.853 52.315 26.731 15.642 24.478 39.723 76.661 50.195 8.13 1.635 15.862 2.341 23.153 2.165a93.893 93.893 0 0011.355-.928c33.139-4.86 55.452-27.881 63.671-55.717 10.781-36.586-10.737-60.534-25.009-74.982-14.272-14.36-24.744-59.341-75.91-70.034-7.821-1.635-15.818-2.474-23.771-2.297-18.205.442-38.088 6.45-51.83 18.91a62.043 62.043 0 00-3.004 2.917c-19.132 19.618-27.218 50.99-24.125 77.412l-.044.044z" fill="#DDE3EE"></path>
<path d="M76.92 64.92L81 57l6.6-1.68 7.2 2.28 3 4.56.72 3.72-21.6.12v-1.08z" fill="#EDEBFD"></path><path d="M76.08 65.76l34.8.84v2.52l-24.6-.6-5.64-1.44-4.56.48v-1.8z" fill="#EDEBFD"></path><path d="M71.28 83.64l4.08-8.76 6.36-3.48 5.16-3.12 11.76.6 1.536 11.137a11.342 11.342 0 01-.576 5.423l-15 11.4-8.4.48-6.96-4.44-2.28-2.64 4.32-6.6z" fill="#fff"></path>
<path d="M66.72 89.76L73.08 96l8.52 1.56 5.04-.84 2.16 5.88 3.6 13.92v5.28l-1.68 6 1.08 2.16 2.76.84v6.96l-6.6.48-11.16 4.2-5.04-.72-5.04 1.2-6.96 4.08-9.84 8.28-2.4-1.92-2.76-6.36 2.04-14.4 5.64-22.44 6.36-15.12 7.92-5.28z" fill="#6E6B86"></path><path d="M76.08 67.92l5.04-.96 3.84 1.68 3.6 4.44 1.8 6.12 3 3 4.2 1.8 2.04 2.88.72 3.48-1.8 6.48-4.2 3-4.56.96v-1.32l-2.28-.6-3.12-1.68-1.44-5.16.48-7.2.96-6.48.6-4.32-1.2-1.8-2.16-.96-1.8 1.8-.96 1.32 1.92 2.64H79.2l-3.6-3-.96-2.76 1.44-3.36z" fill="#475161"></path>
<path d="M50.28 154.68L63.96 144l8.16-2.28 4.68.6 9.6-3.6 7.56-.96 6 .96 2.76 1.44 2.76 3.36 3.96-1.32 3.48.12.72 6.12-2.88 13.08-4.08 13.2v4.08l2.64 1.08v3.24l7.92 1.56 1.32 3.12-3.84 3.84-9.72 1.2H91.08l-6.24-3.36-1.32-4.8.36-8.76 2.88-17.64-8.4 3.72-12.6.6-10.56-2.28-4.92-5.64z" fill="#fff"></path><path d="M52.32 162.24H78.6v29.4l-3.12 1.08-10.08.36-12.48-1.2-.24-.96-.36-28.68z" fill="#DDE3EE"></path>
<path d="M92.04 123.6l5.04-2.64 3.24-.84h3.48l3.12.84 2.76 1.56.96 3.12 3.84.96.96 1.68 3.24 3 .84 3-1.68 1.56-1.56 4.44-2.88 1.68-4.2.36-3.84 1.32-1.2-2.64-4.08-2.28-5.88-1.08.36-6.72-3.48-1.44-.48-2.04 1.44-3.84z" fill="#fff"></path>
<path d="M14.4 181.68h37.92M109.68 181.68H224.4M78.48 181.68h5.04M75.6 74.4c-1.72 4.28-5.832 13.344-8.52 15.36-3.36 2.52-7.56 2.4-10.8 10.44-2.592 6.432-3.72 9.64-3.96 10.44-2.12 7.68-6.504 24.936-7.08 32.52-.576 7.584 2.88 11.16 4.68 12M72.12 141.84c-7.777.384-17.88 9.12-21.96 13.44 1.52 2.52 6.36 6.48 14.28 7.08m7.68-20.52c-2.6-4.8-7.657-16.056-7.08-22.68m7.08 22.68l2.754.403a7.91 7.91 0 004.186-.523l7.22-3c1.6-.6 6.527-1.44 13.44 0 8.639 1.8 5.759 14.04 5.519 15.84-.192 1.44-1.44 19.56-2.04 28.44m-26.16-20.64l9.44-4.259a.238.238 0 01.337.249c-.98 6.655-2.869 19.365-3.057 20.21-.24 1.08-.48 10.08 1.32 10.8.21.084.625.059 1.2-.052M103.2 183c-4.65 2.017-13.537 5.654-16.92 6.308M103.2 183c21.582-.304 15.103 6.322 11.913 8.392-.773.501-1.698.683-2.609.817-19.733 2.89-25.715-.694-26.224-2.901M81.48 105c.96.6 2.855 2.16 2.76 3.6-.12 1.8.72 16.92 2.04 18.72" stroke="#475161" strokeWidth="0.96" strokeLinecap="round"></path><path d="M52.44 191.555V162.36H78.6v29.242a.231.231 0 01-.143.218c-5.605 2.293-19.384.96-25.82-.029a.235.235 0 01-.197-.236zM109.079 182.88c.28-1 .624-3.12-.24-3.6-1.08-.6-4.08.96-2.04-4.44 1.469-3.887 4.538-16.293 6.303-23.752.361-1.524.64-3.074.577-4.639-.078-1.974-.468-4.102-1.6-4.369-1.632-.384-5.08.8-6.6 1.44M67.08 90c1.8 3.16 7.703 8.977 16.92 6.96M84.96 68.4l25.01.72c1.354-.295 1.522-1.116 1.317-1.726-.173-.515-.762-.666-1.304-.677L76.559 66c-.56.44-1.343 1.391 0 1.68M98.28 66c1.8-7.68-15.72-19.2-21.6-.48" stroke="#475161" strokeWidth="0.96" strokeLinecap="round"></path>
<path d="M84.097 68.085c1.831 1.002 2.747 2.508 3.787 4.296 2.24 3.769 1.23 4.881 2.849 7.261 2.572 3.797 6.008 2.318 8.24 5.99 1.911 3.12 1.031 6.789.804 7.639-.22.803-1.154 4.057-4.22 5.927-2.666 1.598-5.917 1.573-6.035 1.1-.045-.174.274-.532 2.208-1.429a6.17 6.17 0 01-2.49.62c-1.224.026-2.337-.362-2.312-.526.022-.14.653-.042 1.223-.48.351-.257.526-.613.643-.906-1.056.483-2.331.836-3.446.304-2.984-1.443-2.47-8.47-2.299-10.813.546-7.55 3.33-11.306 1.14-14.326-.177-.243-1.063-1.48-2.264-1.451-1.516.053-2.966 2.15-2.73 3.717.222 1.351 1.613 1.95 1.484 2.169-.188.282-2.593-.57-4.393-2.547-.654-.724-1.21-1.312-1.376-2.247-.322-1.63.608-3.304 1.635-4.222 2.156-1.868 5.567-1.172 7.552-.076z" stroke="#475161" strokeWidth="0.96" strokeMiterlimit="10"></path><path d="M87.6 99.36c.64 1.76 2.016 6.12 2.4 8.04.48 2.4 1.68 6.84 1.92 8.04.135.675.475 2.217.762 3.506a5.07 5.07 0 01-.163 2.782c-.794 2.268-1.84 5.278-1.92 5.592-.12.48-.36 2.76 3.36 3.24M98.28 69.12l2.104 13.448a.24.24 0 01-.292.27l-3.733-.878M92.64 71.4c.76-.48 2.544-1.08 3.6.36M99.84 73.503c.76-.48 2.544-1.08 3.6.36" stroke="#475161" strokeWidth="0.96" strokeLinecap="round"></path><circle cx="94.8" cy="73.92" r="0.84" fill="#475161" stroke="#475161" strokeWidth="0.24"></circle><circle cx="101.52" cy="75.6" r="0.84" fill="#475161" stroke="#475161" strokeWidth="0.24"></circle><path d="M92.04 124.08c2.16-1.72 7.127-4.872 9.719-3.72M98.52 122.4c1.72-1.32 5.328-3.528 6-1.8.672 1.728 2.44 4.8 3.24 6.12M94.32 129.24v8.4" stroke="#475161" strokeWidth="0.96" strokeLinecap="round"></path><path d="M112.559 142.08c1.12-.24 3.408-.984 3.6-2.04.24-1.32.96-3.12 1.56-3.72.6-.6 4.56-3.36-1.8-7.44-.84-.84-.12-1.8-1.2-2.28-.486-.216-1.527-.366-2.558-.463-1.402-.132-2.81.066-4.162.463v0l-1.28 1.361a2.157 2.157 0 01-1.573.679h-7.595c-1.105 0-2.2.204-3.232.6v0" stroke="#475161" strokeWidth="0.96" strokeLinecap="round"></path><path d="M98.16 125.521c.896.597 3.07 1.586 4.996 1.088a.808.808 0 01.727.144l1.956 1.648M111.84 192.48h17.52M132.479 192.24h2.88M130.56 187.2h2.88M121.199 187.2h7.2M107.039 125.4c12.48-11.4 43.68-33.96 88.8-37.2M104.519 127.32l-1.08.96M104.64 120.48c1.92.08 5.832 1.248 6.12 5.28" stroke="#475161" strokeWidth="0.96" strokeLinecap="round"></path><path d="M115.319 118.92c1.96 2.64 7.464 4.44 13.8-9.48M129.119 109.32c1.96 2.64 17.16 1.44 22.68-10.68 1.96 2.64 17.28.84 23.88-7.32M175.92 91.44c5.88 4.56 17.64-2.04 17.64-3M195.84 88.68l5.28 61.2" stroke="#475161" strokeWidth="0.48" strokeLinecap="round"></path><circle cx="201.48" cy="151.56" r="1.56" stroke="#475161" strokeWidth="0.48"></circle><path d="M201.72 153.12c.36 1.4.648 4.128-1.08 3.84" stroke="#475161" strokeWidth="0.48" strokeLinecap="round"></path><path d="M200.639 156.12l-.48 1.44M199.92 156.24l-.24.72" stroke="#475161" strokeWidth="0.96" strokeLinecap="round"></path><ellipse cx="202.44" cy="190.92" rx="16.68" ry="5.88" fill="#EEF1F7"></ellipse><ellipse cx="202.439" cy="190.92" rx="9.24" ry="3.24" fill="#DDE3EE"></ellipse><path d="M161.596 190.393c-3.246-.866 1.803-1.793 5.891-2.473 1.963 0 5.986.124 6.371.618.481.619 2.404.495 6.251.371 3.847-.123.962 1.855 1.683 3.029.721 1.174-7.093 3.461-10.218 3.647-3.126.185-5.891-1.298-.842-2.226 5.049-.927.962-1.668-1.923-1.854l-.099-.006c-2.811-.181-3.906-.251-7.114-1.106zM210.163 204.554c3.245.73-1.804 1.512-5.891 2.086-1.963 0-5.987-.104-6.371-.521-.481-.522-2.404-.418-6.251-.313-3.847.104-.962-1.565-1.683-2.556-.722-.99 7.092-2.92 10.218-3.076 3.125-.157 5.89 1.095.841 1.877-5.049.782-.961 1.408 1.924 1.564l.099.006c2.811.152 3.905.211 7.114.933z" fill="#EEF1F7"></path><path d="M144.36 193.92c0 .041-.029.105-.138.183a1.716 1.716 0 01-.48.211c-.42.126-1.008.206-1.662.206-.655 0-1.243-.08-1.663-.206a1.694 1.694 0 01-.479-.211c-.11-.078-.138-.142-.138-.183 0-.041.028-.104.138-.182.106-.076.268-.149.479-.212.42-.126 1.008-.206 1.663-.206.654 0 1.242.08 1.662.206.211.063.373.136.48.212.109.078.138.141.138.182zM144.36 198.48c0 .041-.029.105-.138.183a1.716 1.716 0 01-.48.211c-.42.127-1.008.206-1.662.206-.655 0-1.243-.079-1.663-.206a1.694 1.694 0 01-.479-.211c-.11-.078-.138-.142-.138-.183 0-.041.028-.104.138-.182.106-.076.268-.149.479-.212.42-.126 1.008-.206 1.663-.206.654 0 1.242.08 1.662.206.211.063.373.136.48.212.109.078.138.141.138.182zM157.08 196.08c0 .005-.005.037-.079.087-.071.048-.18.095-.326.137a4.408 4.408 0 01-1.155.136c-.456 0-.865-.053-1.155-.136a1.174 1.174 0 01-.326-.137c-.074-.05-.079-.082-.079-.087 0-.005.005-.037.079-.087.07-.048.18-.095.326-.137.29-.083.699-.136 1.155-.136.456 0 .864.053 1.155.136.146.042.255.089.326.137.074.05.079.082.079.087zM186.359 206.16c0 .006-.005.037-.079.088-.07.047-.18.094-.326.136-.29.083-.699.136-1.155.136-.456 0-.864-.053-1.155-.136a1.223 1.223 0 01-.326-.136c-.074-.051-.079-.082-.079-.088 0-.005.005-.037.079-.087.071-.048.18-.095.326-.137a4.408 4.408 0 011.155-.136c.456 0 .865.053 1.155.136.146.042.256.089.326.137.074.05.079.082.079.087z" stroke="#475161" strokeWidth="0.24"></path><path d="M119.3 41.52H43.114a.236.236 0 01-.212-.347c1.346-2.512 4.333-7.194 6.898-8.293 3.36-1.44 4.8-.6 7.8 0s4.2-2.16 4.92-3c.72-.84 4.56-4.8 11.64-5.76 7.08-.96 9.36-.6 12.72 3.36 3.36 3.96 2.64 5.28 7.56 5.4 4.92.12 4.2.6 9.24 2.88s2.16.6 7.32.6c3.85 0 7.094 2.992 8.487 4.79a.23.23 0 01-.187.37zM159.621 32.64h-39.229a.234.234 0 01-.209-.346c.736-1.347 2.219-3.632 3.499-4.185 1.748-.755 2.498-.315 4.058 0 1.561.315 2.185-1.133 2.56-1.574.375-.44 2.372-2.517 6.056-3.02 3.683-.504 4.869-.315 6.617 1.762 1.748 2.077 1.374 2.769 3.933 2.832 2.56.063 2.185.314 4.807 1.51 2.622 1.196 1.124.315 3.809.315 1.886 0 3.494 1.392 4.28 2.342.123.15.013.364-.181.364zM159.382 63.84h-39.23a.235.235 0 01-.209-.346c.737-1.347 2.22-3.632 3.5-4.185 1.748-.755 2.497-.315 4.058 0s2.185-1.133 2.56-1.573c.374-.441 2.372-2.518 6.055-3.021 3.684-.504 4.87-.315 6.618 1.762 1.748 2.077 1.373 2.77 3.933 2.832 2.56.063 2.185.315 4.807 1.51 2.622 1.196 1.124.315 3.808.315 1.887 0 3.494 1.393 4.28 2.343.124.149.013.364-.18.364z" stroke="#475161" strokeWidth="0.96" strokeLinecap="round"></path><path d="M64.27 57.766c-.661.639-1.775 2.063-.936 2.652 1.048.736 2.342.775 2.662 1.202.32.427.213 1.174-.444 2.146-.657.97-.589 1.518-.14 1.729.359.169.804.092.982.033M67.365 56.712c-.661.638-1.775 2.062-.936 2.651 1.047.737 2.342.775 2.662 1.203.32.426.213 1.173-.444 2.145-.657.971-.59 1.518-.14 1.73.359.168.804.092.982.032M71.67 48.38c-.662.639-1.775 2.063-.937 2.652 1.048.736 2.343.775 2.662 1.202.32.427.214 1.174-.444 2.145-.657.972-.588 1.519-.14 1.73.36.169.805.092.983.033M74.765 47.326c-.662.638-1.775 2.062-.937 2.651 1.048.737 2.342.776 2.662 1.203.32.427.213 1.174-.444 2.145-.657.971-.589 1.519-.14 1.73.36.168.805.092.982.033" stroke="#6E6B86" strokeWidth="0.96" strokeLinecap="round"></path></svg>

);


3 changes: 3 additions & 0 deletions ui/src/components/ContentMapper/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,7 @@ div .table-row {
.table-icons:hover {
background-color: $color-brand-fail-light;
cursor: pointer;
}
.mapper-emptystate{
padding: 10px 10px;
}
76 changes: 66 additions & 10 deletions ui/src/components/ContentMapper/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Libraries
import { useEffect, useState, useRef, useImperativeHandle, forwardRef } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { useParams } from 'react-router-dom';
import { useNavigate, useParams } from 'react-router-dom';
import {
InfiniteScrollTable,
Select,
Expand All @@ -12,7 +12,8 @@ import {
Notification,
cbModal,
InstructionText,
CircularLoader
CircularLoader,
EmptyState
} from '@contentstack/venus-components';

// Services
Expand Down Expand Up @@ -66,7 +67,7 @@ import SaveChangesModal from '../Common/SaveChangesModal';

// Styles and Assets
import './index.scss';
import { SCHEMA_PREVIEW } from '../../common/assets';
import { NoDataFound, SCHEMA_PREVIEW } from '../../common/assets';

const Fields: MappingFields = {
'single_line_text':{
Expand Down Expand Up @@ -165,8 +166,11 @@ const Fields: MappingFields = {
}

}
type contentMapperProps = {
handleStepChange: (currentStep: number) => void;
}

const ContentMapper = forwardRef((props, ref: React.ForwardedRef<ContentTypeSaveHandles>) => {
const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: React.ForwardedRef<ContentTypeSaveHandles>) => {
/** ALL CONTEXT HERE */

const migrationData = useSelector((state:RootState)=>state?.migration?.migrationData);
Expand Down Expand Up @@ -241,9 +245,12 @@ const ContentMapper = forwardRef((props, ref: React.ForwardedRef<ContentTypeSave
const isNewStack = newMigrationData?.stackDetails?.isNewStack;
const [isFieldDeleted, setIsFieldDeleted] = useState<boolean>(false);
const [isContentDeleted, setIsContentDeleted] = useState<boolean>(false);
const [isProjectMapped, setIsProjectMapped] = useState(newMigrationData?.isprojectMapped);


/** ALL HOOKS Here */
const { projectId = '' } = useParams();
const navigate = useNavigate();

const filterRef = useRef<HTMLDivElement | null>(null);

Expand Down Expand Up @@ -464,7 +471,7 @@ const ContentMapper = forwardRef((props, ref: React.ForwardedRef<ContentTypeSave
const fetchContentTypes = async (searchText: string) => {
try {
const { data } = await getContentTypes(projectId || '', 0, 5000, searchContentType || ''); //org id will always present

setContentTypes(data?.contentTypes);
setCount(data?.contentTypes?.length);
setFilteredContentTypes(data?.contentTypes);
Expand Down Expand Up @@ -1781,13 +1788,21 @@ const ContentMapper = forwardRef((props, ref: React.ForwardedRef<ContentTypeSave
//variable for button component in table
const onlyIcon= true;

const modalProps = {
body: 'There is something error occured while generating content mapper. Please go to Legacy Cms step and validate the file again.',
isCancel : false,
header: "",
}

return (
isLoading || newMigrationData?.isprojectMapped
isLoading || newMigrationData?.isprojectMapped
? <div className="loader-container">
<CircularLoader />
</div>
: <div className="step-container">
<div className="d-flex flex-wrap table-container">
:
<div className="step-container">
{contentTypes.length > 0 ?
<div className="d-flex flex-wrap table-container">
{/* Content Types List */}
<div className="content-types-list-wrapper">
<div className="content-types-list-header d-flex align-items-center justify-content-between">
Expand Down Expand Up @@ -1970,8 +1985,49 @@ const ContentMapper = forwardRef((props, ref: React.ForwardedRef<ContentTypeSave
</div>
</div>
</div>
</div>
</div>
</div> :
<EmptyState
forPage="emptyStateV2"
heading={<div className="empty_search_heading">No Content Types available</div>}
description={
<div className="empty_search_description">
{modalProps?.body}
</div>
}
className="mapper-emptystate"
img={NoDataFound}
actions={
<>
<Button buttonType="secondary" size="small" version="v2"
onClick={()=>{
const newMigrationDataObj :INewMigration = {
...newMigrationData,
legacy_cms:{
...newMigrationData?.legacy_cms,
uploadedFile:{
...newMigrationData?.legacy_cms?.uploadedFile,
reValidate: true

}
}


}

dispatch(updateNewMigrationData(newMigrationDataObj));
handleStepChange(0);
const url = `/projects/${projectId}/migration/steps/1`;
navigate(url, { replace: true });
}}
className='ml-10'>Go to Legacy CMS</Button>
</>
}
version="v2"
testId="no-results-found-page"
/>}

</div>

);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ const LoadStacks = (props: LoadFileFormatProps) => {

isClearable={newMigrationData?.destination_stack?.stackArray?.length > 0 && !emptyStackValue}
// hideSelectedOptions={true}
// isDisabled={props?.stepComponentProps?.isSummary || false}
isDisabled={newMigrationData?.project_current_step > 2}
error={isLoading ? false : !!isError }
width="600px"
hasAddOption={true}
Expand Down
2 changes: 2 additions & 0 deletions ui/src/components/LegacyCms/Actions/LoadPrefix.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ const LoadPreFix = (props: LoadSelectCmsProps) => {
version="v2"
error={isError}
aria-label='affix'
disabled={newMigrationData?.project_current_step > 1}
isReadOnly={newMigrationData?.project_current_step > 1}
/>
{isError && <p className="errorMessage">{errorMessage}</p>}

Expand Down
20 changes: 14 additions & 6 deletions ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const LoadUploadFile = (props: LoadUploadFileProps) => {
/**** ALL HOOKS HERE ****/

const newMigrationData = useSelector((state:RootState)=>state?.migration?.newMigrationData);
//const selectedOrganisation = useSelector((state:RootState)=>state?.authentication?.selectedOrganisation);
const selectedOrganisation = useSelector((state:RootState)=>state?.authentication?.selectedOrganisation);
const migrationData = useSelector((state:RootState)=>state?.migration?.migrationData);

const newMigrationDataRef = useRef(newMigrationData);
Expand All @@ -86,6 +86,7 @@ const LoadUploadFile = (props: LoadUploadFileProps) => {
const [showProgress, setShowProgress]= useState<boolean>(false);
const [fileFormat, setFileFormat] = useState(newMigrationData?.legacy_cms?.selectedFileFormat?.fileformat_id);
const [processing, setProcessing] = useState('');
const [reValidate, setReValidate] = useState<boolean>(newMigrationData?.legacy_cms?.uploadedFile?.reValidate || false);
//const [isCancelLoading, setIsCancelLoading] = useState<boolean>(false);
//const [setIsFormatValid] = useState<boolean>(false);

Expand Down Expand Up @@ -123,6 +124,7 @@ const LoadUploadFile = (props: LoadUploadFileProps) => {
url: data?.file_details?.localPath,
validation: data?.message,
isValidated: status == 200 ? true : false,
reValidate: false,
file_details: {
isLocalPath: data?.file_details?.isLocalPath,
cmsType: data?.file_details?.cmsType,
Expand Down Expand Up @@ -243,6 +245,7 @@ const LoadUploadFile = (props: LoadUploadFileProps) => {
name: data?.localPath,
url: data?.localPath,
isValidated: newMigrationData?.legacy_cms?.uploadedFile?.isValidated,
reValidate: false,
file_details: {
isLocalPath: data?.isLocalPath,
cmsType: data?.cmsType,
Expand Down Expand Up @@ -374,22 +377,27 @@ const LoadUploadFile = (props: LoadUploadFileProps) => {
]);

useEffect(()=>{
if(newMigrationData?.legacy_cms?.uploadedFile?.isValidated && ! showProgress)
if(newMigrationData?.legacy_cms?.uploadedFile?.isValidated && ! showProgress && !newMigrationData?.legacy_cms?.uploadedFile?.reValidate)
{

setIsValidated(true);
setShowMessage(true)
setValidationMessage('Validation is successful');
setIsDisabled(true);
! isEmptyString(newMigrationData?.legacy_cms?.affix) || ! isEmptyString(newMigrationData?.legacy_cms?.selectedCms?.cms_id) || ! isEmptyString(newMigrationData?.legacy_cms?.selectedFileFormat?.fileformat_id) && props.handleStepChange(props?.currentStep, true);



}

if(newMigrationData?.legacy_cms?.uploadedFile?.reValidate){
setValidationMessage('');
}

// else{
// setIsValidated(false);
// }

},[isValidated,newMigrationData])
setReValidate(newMigrationData?.legacy_cms?.uploadedFile?.reValidate || false);
},[isValidated,newMigrationData]);


useEffect(()=>{
if(newMigrationData?.legacy_cms?.selectedFileFormat?.fileformat_id){
Expand Down
4 changes: 3 additions & 1 deletion ui/src/components/MigrationFlowHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ const MigrationFlowHeader = ({projectData, handleOnClick, isLoading }: Migration
version="v2"
aria-label='Save and Continue'
isLoading={isLoading}
disabled={params?.stepId === '4' && !newMigrationData?.test_migration?.isMigrationComplete}
disabled={(params?.stepId === '4' && !newMigrationData?.test_migration?.isMigrationComplete) ||
(params?.stepId && params?.stepId <= '2' && currentStep.toString() !== params?.stepId)
}
>
{stepValue}
</Button>
Expand Down
Loading