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
6 changes: 3 additions & 3 deletions ui/src/components/ContentMapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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]){
Expand Down
8 changes: 5 additions & 3 deletions upload-api/migration-contentful/libs/contentTypeMapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -364,27 +364,29 @@ 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,
nonLocalizable: !(item?.localized === true) || false
}
});
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,
Expand Down
Loading