Skip to content

Commit d878f0a

Browse files
Merge pull request #474 from contentstack/feature/dropdown-field-choices
refactor:resolved content mapper bug [CMG-520]
2 parents c9bc9f4 + ce428d0 commit d878f0a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ui/src/components/ContentMapper/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
265265
label: contentTypeMapped?.[otherCmsTitle] ?? `Select ${isContentType ? 'Content Type' : 'Global Field'} from Existing Stack`,
266266
value: contentTypeMapped?.[otherCmsTitle] ?? `Select ${isContentType ? 'Content Type' : 'Global Field'} from Existing Stack`,
267267
});
268-
const [otherCmsUid, setOtherCmsUid] = useState<string>(contentTypes[0]?.otherCmsUid);
268+
const [otherCmsUid, setOtherCmsUid] = useState<string>(contentTypes?.[0]?.otherCmsUid);
269269

270270
const [active, setActive] = useState<number | null>(0);
271271

@@ -1521,7 +1521,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
15211521
isDisabled: true
15221522
}
15231523
: (OptionsForRow?.length === 0 || (OptionsForRow?.length > 0 && OptionsForRow?.every((item)=>item?.isDisabled)
1524-
&& (!existingField[data?.uid] || ! updatedExstingField[data?.uid] ) ) || (OptionsForRow?.length > 0 && data?.contentstackFieldType === "dropdown"))
1524+
&& (!existingField[data?.uid]?.label || ! updatedExstingField[data?.uid]?.label ) ) || (OptionsForRow?.length > 0 && data?.contentstackFieldType === "dropdown"))
15251525
? {
15261526
label: Fields[data?.contentstackFieldType]?.label ?? 'No Option',
15271527
value: Fields[data?.contentstackFieldType]?.label ?? 'No Option',
@@ -2423,4 +2423,4 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
24232423
});
24242424

24252425
ContentMapper.displayName = 'ContentMapper';
2426-
export default ContentMapper;
2426+
export default ContentMapper;

0 commit comments

Comments
 (0)