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
2 changes: 1 addition & 1 deletion ui/src/components/MigrationFlowHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const MigrationFlowHeader = ({projectData, handleOnClick, isLoading }: Migration
version="v2"
aria-label='Save and Continue'
isLoading={isLoading}
disabled={newMigrationData?.testStacks?.length > 0}
disabled={newMigrationData?.testStacks?.some((stack) => stack?.isMigrated === false)}
>
{stepValue}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const HorizontalStepper = forwardRef(
!stepsCompleted.includes(idx) && idx !== showStep && !stepsCompleted?.includes(idx - 1)
? 'disableEvents'
: '';
const completeDisable = stepsCompleted?.includes(idx) && idx < steps?.length - 3 ? 'completed disableEvents' : '';
const completeDisable = stepsCompleted?.includes(idx) && stepIndex === steps?.length - 1 ? 'completed disableEvents' : '';
return (
<React.Fragment key={id}>
<div className="stepWrapperContainer">
Expand Down
9 changes: 7 additions & 2 deletions ui/src/components/TestMigration/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useState, useRef } from 'react';
import { useEffect, useState } from 'react';
import { useParams } from 'react-router';
import { Field, FieldLabel, TextInput, Link, Icon, Tooltip, Button, Notification } from '@contentstack/venus-components';
import { useSelector, useDispatch } from 'react-redux';
Expand Down Expand Up @@ -30,6 +30,7 @@ import './index.scss';
const TestMigration = () => {
const [data, setData] = useState<MigrationType>({});
const [isLoading, setIsLoading] = useState<boolean>(false);
const [isMigrationStarted, setIsMigrationStarted] = useState<boolean>(false);

const newMigrationData = useSelector((state: RootState) => state?.migration?.newMigrationData);
const selectedOrganisation = useSelector((state: RootState)=>state?.authentication?.selectedOrganisation);
Expand Down Expand Up @@ -100,6 +101,10 @@ const TestMigration = () => {
newMigrationData?.destination_stack?.selectedOrg?.value,
projectId
);

if (testRes?.status === 200) {
setIsMigrationStarted(true);
}
}

return (
Expand Down Expand Up @@ -154,7 +159,7 @@ const TestMigration = () => {
className="ml-8"
onClick={handleTestMigration}
version="v2"
// size="medium"
disabled={isMigrationStarted}
>
Start Test Migration
</Button>
Expand Down
3 changes: 1 addition & 2 deletions ui/src/pages/Migration/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { RootState } from '../../store';
import { updateMigrationData, updateNewMigrationData } from '../../store/slice/migrationDataSlice';

// Services
import { getMigrationData, updateCurrentStepData, updateLegacyCMSData, updateDestinationStack, createTestStack, updateAffixData, fileformatConfirmation, updateFileFormatData, affixConfirmation, updateStackDetails, getOrgDetails, getExistingContentTypes, getExistingGlobalFields } from '../../services/api/migration.service';
import { getAllStacksInOrg } from '../../services/api/stacks.service';
import { getMigrationData, updateCurrentStepData, updateLegacyCMSData, updateDestinationStack, updateAffixData, fileformatConfirmation, updateFileFormatData, affixConfirmation, updateStackDetails, getExistingContentTypes, getExistingGlobalFields } from '../../services/api/migration.service';
import { getCMSDataFromFile } from '../../cmsData/cmsSelector';

// Utilities
Expand Down