Skip to content

Commit f0bdda0

Browse files
authored
Merge pull request #364 from contentstack/feature/test-migration
Feature/test migration
2 parents 435c754 + 96a06b0 commit f0bdda0

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

ui/src/components/Card/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ const CardList = ({ project }: ProjectType) => {
6464

6565
return (
6666
<div style={{ margin: '0 19px 20px 0' }}>
67-
<div onClick={() => onClickProject(project?.id || '')}>
67+
<div onClick={() => onClickProject(project?.id ?? '')}>
6868
<div className="ProjectCard">
6969
<div className='ProjectCardWrapper'>
70-
<Tooltip content={project?.name} position="top" type="primary" variantType="basic">
70+
<Tooltip content={project?.name} position="right" type="primary" variantType="basic">
7171
<div className="ProjectCard__heading">
7272
{project?.name && <h4 className="ProjectCard__title flex-v-center">{project?.name}</h4>}
7373
</div>

ui/src/components/ContentMapper/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
929929
data?.otherCmsField === 'url' ||
930930
data?.otherCmsField === 'reference'||
931931
data?.contentstackFieldType === "global_field" ||
932-
newMigrationData?.project_current_step?.toString() !== stepId
932+
newMigrationData?.project_current_step > 4
933933
}
934934
/>
935935
</div>
@@ -955,7 +955,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
955955
onClick={() =>
956956
handleAdvancedSetting(fieldLabel, data?.advanced || {}, data?.uid, data)
957957
}
958-
disabled={newMigrationData?.project_current_step?.toString() !== stepId}
958+
disabled={newMigrationData?.project_current_step > 4}
959959
/>
960960
</Tooltip>
961961
)}
@@ -1412,7 +1412,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
14121412
maxWidth="290px"
14131413
isClearable={selectedOptions?.includes(existingField?.[data?.uid]?.label ?? '')}
14141414
options={adjustedOptions}
1415-
isDisabled={OptionValue?.isDisabled || newMigrationData?.project_current_step?.toString() !== stepId}
1415+
isDisabled={OptionValue?.isDisabled || newMigrationData?.project_current_step > 4}
14161416
/>
14171417
</div>
14181418
{!OptionValue?.isDisabled && (
@@ -1427,7 +1427,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
14271427
>
14281428
<Button
14291429
buttonType="light"
1430-
disabled={(contentTypeSchema && existingField[data?.uid] || newMigrationData?.project_current_step?.toString() !== stepId) ? true : false}
1430+
disabled={(contentTypeSchema && existingField[data?.uid] || newMigrationData?.project_current_step > 4) ? true : false}
14311431
>
14321432
<Icon
14331433
version={'v2'}
@@ -2051,7 +2051,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
20512051
placeholder={otherContentType?.label}
20522052
isSearchable
20532053
version="v2"
2054-
isDisabled={newMigrationData?.project_current_step?.toString() !== stepId}
2054+
isDisabled={newMigrationData?.project_current_step > 4}
20552055
/>
20562056
</div>
20572057
)}
@@ -2071,7 +2071,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
20712071
className="saveButton"
20722072
onClick={handleSaveContentType}
20732073
version="v2"
2074-
disabled={newMigrationData?.project_current_step?.toString() !== stepId}
2074+
disabled={newMigrationData?.project_current_step > 4}
20752075
>
20762076
Save
20772077
</Button>

ui/src/components/MigrationFlowHeader/index.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ type MigrationFlowHeaderProps = {
2121
finalExecutionStarted?: boolean;
2222
};
2323

24+
/**
25+
* Renders a MigrationFlowHeader component to show the project name and CTA to proceed to next step
26+
* @param projectData - The projectData object containing project details.
27+
* @param handleOnClick - Callback function to proceed to next step.
28+
* @param isLoading - isLoading flag to load redux data
29+
* @param finalExecutionStarted - The finalExecutionStarted boolean to check if migration execution is started to disable Start Migration button.
30+
*/
2431
const MigrationFlowHeader = ({projectData, handleOnClick, isLoading, finalExecutionStarted }: MigrationFlowHeaderProps) => {
2532
const [projectName, setProjectName] = useState('');
2633
const [currentStep, setCurrentStep] = useState<number>(0);
@@ -37,6 +44,9 @@ const MigrationFlowHeader = ({projectData, handleOnClick, isLoading, finalExecut
3744
}, [selectedOrganisation?.value, params?.projectId]);
3845

3946
/******** Function to get project ********/
47+
/**
48+
* Fetch the project details project name and current step.
49+
*/
4050
const fetchProject = async () => {
4151
setProjectName(projectData?.name);
4252
setCurrentStep(projectData?.current_step);
@@ -59,7 +69,7 @@ const MigrationFlowHeader = ({projectData, handleOnClick, isLoading, finalExecut
5969
<div className='d-flex align-items-center justify-content-between migration-flow-header'>
6070
<div className='d-flex align-items-center'>
6171
{ projectName &&
62-
<Tooltip content={projectName} position='top' version={'v2'}>
72+
<Tooltip content={projectName} position='right' version={'v2'}>
6373
<h1 className='project-name-ellipsis'>{projectName}</h1>
6474
</Tooltip>}
6575
</div>

ui/src/pages/Projects/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
width: 100% !important;
2525
}
2626
.PageLayout__head {
27-
border-top: 0 none;
2827
height: auto;
2928
border-bottom: 1px solid $color-brand-secondary-lightest;
3029
border-top: 1px solid $color-brand-secondary-lightest;
3130
left: 56px;
3231
padding:20px 10px 20px 13px;
3332
position: fixed;
3433
width: calc(100% - 56px) !important;
34+
z-index: 1;
3535
}
3636
}
3737
}

0 commit comments

Comments
 (0)