Skip to content
Merged
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
33 changes: 18 additions & 15 deletions ui/src/components/ContentMapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
isDisabled={OptionValue?.isDisabled || newMigrationData?.project_current_step > 4}
/>
</div>
{!OptionValue?.isDisabled || OptionValue?.label === 'Dropdown' && (
{(!OptionValue?.isDisabled || OptionValue?.label === 'Dropdown') && (
<div className='advanced-setting-button'>
<Tooltip
content="Advanced properties"
Expand Down Expand Up @@ -1507,19 +1507,22 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
type: 'success'
});
setIsDropDownChanged(false);
const newMigrationDataObj: INewMigration = {
...newMigrationData,
content_mapping: {
...newMigrationData?.content_mapping,
content_type_mapping: {

...newMigrationData?.content_mapping?.content_type_mapping,
[selectedContentType?.contentstackUid]: otherContentType?.id ?? ''
} ,
isDropDownChanged: false
}
};
dispatch(updateNewMigrationData(newMigrationDataObj));
if(otherContentType?.id){
const newMigrationDataObj: INewMigration = {
...newMigrationData,
content_mapping: {
...newMigrationData?.content_mapping,
content_type_mapping: {

...newMigrationData?.content_mapping?.content_type_mapping,
[selectedContentType?.contentstackUid]: otherContentType?.id ?? ''
} ,
isDropDownChanged: false
}
};
dispatch(updateNewMigrationData(newMigrationDataObj));

}



Expand All @@ -1531,7 +1534,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
setContentTypes(savedCT);

try {
await updateContentMapper(orgId, projectID, {...contentTypeMapped, [selectedContentType?.contentstackUid]: otherContentType?.id});
otherContentType?.id && await updateContentMapper(orgId, projectID, {...contentTypeMapped, [selectedContentType?.contentstackUid]: otherContentType?.id});
} catch (err) {
console.log(err);
return err;
Expand Down