diff --git a/ui/src/components/ContentMapper/index.tsx b/ui/src/components/ContentMapper/index.tsx index 1137fcb03..dfbbf1bf9 100644 --- a/ui/src/components/ContentMapper/index.tsx +++ b/ui/src/components/ContentMapper/index.tsx @@ -825,7 +825,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R }, [tableData]); const getParentId = (uid: string) => { - return tableData?.find(i => i?.uid === uid)?.id ?? '' + return tableData?.find(i => i?.uid?.toLowerCase() === uid?.toLowerCase())?.id ?? '' } const modifiedObj = (obj: FieldMapType) => { @@ -940,8 +940,8 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R } else if(latestRow?.parentId && !["title", "url"]?.includes?.(latestRow?.uid?.toLowerCase())){ // Extract the group UID if item is child of any group const uidBeforeDot = latestRow?.uid?.split?.('.')?.[0]?.toLowerCase(); - const groupItem = tableData?.find((entry) => entry?.uid === uidBeforeDot); - const childItems = tableData?.filter((entry) => entry?.uid?.toLowerCase()?.startsWith(groupItem?.uid + '.')); + const groupItem = tableData?.find((entry) => entry?.uid?.toLowerCase() === uidBeforeDot); + const childItems = tableData?.filter((entry) => entry?.uid?.toLowerCase()?.startsWith(groupItem?.uid?.toLowerCase() + '.')); if(latestRow?.checked) { if(!selectedObj[latestRow?.parentId]){ diff --git a/upload-api/migration-contentful/libs/contentTypeMapper.js b/upload-api/migration-contentful/libs/contentTypeMapper.js index 0edb1cd94..2817b8cbc 100644 --- a/upload-api/migration-contentful/libs/contentTypeMapper.js +++ b/upload-api/migration-contentful/libs/contentTypeMapper.js @@ -70,7 +70,7 @@ const extractAdvancedFields = ( return { default_value: defaultText, validationRegex: regrexValue, - mandatory: ["title", "url"].includes(item.id) ? true : item?.required, + mandatory: item?.required, multiple: singleRef, unique: uniqueValue, nonLocalizable: !(item?.localized === true), @@ -364,13 +364,14 @@ const contentTypeMapper = (data) => { case 'Location': { acc.push(createFieldObject(item, 'group', 'group')); acc.push({ - uid: `${item.name}.lat`, + uid: `${item.id}.lat`, otherCmsField: `${item.name} > lat`, otherCmsType: 'Number', contentstackField: `${item.name} > lat`, contentstackFieldUid: `${uidCorrector(item?.id, item?.prefix)}.lat`, contentstackFieldType: 'number', backupFieldType: 'number', + backupFieldUid: `${uidCorrector(item?.id, item?.prefix)}.lat`, advanced: { mandatory: item?.required, unique: false, @@ -378,13 +379,14 @@ const contentTypeMapper = (data) => { } }); acc.push({ - uid: `${item.name}.lon`, + uid: `${item.id}.lon`, otherCmsField: `${item.name} > lon`, otherCmsType: 'Number', contentstackField: `${item.name} > lon`, contentstackFieldUid: `${uidCorrector(item?.id, item?.prefix)}.lon`, contentstackFieldType: 'number', backupFieldType: 'number', + backupFieldUid: `${uidCorrector(item?.id, item?.prefix)}.lon`, advanced: { mandatory: item?.required, unique: false,