@@ -679,21 +679,21 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
679679 } ;
680680
681681 const openContentType = ( i : number ) => {
682- setIsFieldDeleted ( false ) ;
683- setActive ( i ) ;
684- const otherTitle = filteredContentTypes ?. [ i ] ?. contentstackUid ;
685- const mappedContentType = contentModels && contentModels ?. find ( ( item ) => item ?. uid === newMigrationData ?. content_mapping ?. content_type_mapping ?. [ otherTitle ] ) ;
686- setOtherCmsTitle ( filteredContentTypes ?. [ i ] ?. otherCmsTitle ) ;
687- setContentTypeUid ( filteredContentTypes ?. [ i ] ?. id ?? '' ) ;
688- fetchFields ( filteredContentTypes ?. [ i ] ?. id ?? '' , searchText || '' ) ;
689- setOtherCmsUid ( filteredContentTypes ?. [ i ] ?. otherCmsUid ) ;
690- setSelectedContentType ( filteredContentTypes ?. [ i ] ) ;
691- setIsContentType ( filteredContentTypes ?. [ i ] ?. type === "content_type" ) ;
692- setOtherContentType ( {
693- label : mappedContentType ?. title ?? `Select ${ filteredContentTypes ?. [ i ] ?. type === "content_type" ? 'Content Type' : 'Global Field' } from existing stack` ,
694- value : mappedContentType ?. title ?? `Select ${ filteredContentTypes ?. [ i ] ?. type === "content_type" ? 'Content Type' : 'Global Field' } from existing stack` ,
695-
696- } ) ;
682+ setIsFieldDeleted ( false ) ;
683+ setActive ( i ) ;
684+ const otherTitle = filteredContentTypes ?. [ i ] ?. contentstackUid ;
685+ const mappedContentType = contentModels ?. find ( ( item ) => item ?. uid === newMigrationData ?. content_mapping ?. content_type_mapping ?. [ otherTitle ] ) ;
686+ setOtherCmsTitle ( filteredContentTypes ?. [ i ] ?. otherCmsTitle ) ;
687+ setContentTypeUid ( filteredContentTypes ?. [ i ] ?. id ?? '' ) ;
688+ fetchFields ( filteredContentTypes ?. [ i ] ?. id ?? '' , searchText || '' ) ;
689+ setOtherCmsUid ( filteredContentTypes ?. [ i ] ?. otherCmsUid ) ;
690+ setSelectedContentType ( filteredContentTypes ?. [ i ] ) ;
691+ setIsContentType ( filteredContentTypes ?. [ i ] ?. type === "content_type" ) ;
692+ setOtherContentType ( {
693+ label : mappedContentType ?. title ?? `Select ${ filteredContentTypes ?. [ i ] ?. type === "content_type" ? 'Content Type' : 'Global Field' } from existing stack` ,
694+ value : mappedContentType ?. title ?? `Select ${ filteredContentTypes ?. [ i ] ?. type === "content_type" ? 'Content Type' : 'Global Field' } from existing stack` ,
695+
696+ } ) ;
697697 }
698698
699699 const updateFieldSettings = ( rowId : string , updatedSettings : Advanced , checkBoxChanged : boolean ) => {
@@ -2110,9 +2110,15 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
21102110 < button
21112111 type = 'button'
21122112 className = 'list-button ct-names'
2113- onClick = { ( ) => handleOpenContentType ( index ) }
2113+ onClick = { ( e ) => {
2114+ if ( otherCmsUid === filteredContentTypes [ index ] ?. otherCmsUid ) {
2115+ e . preventDefault ( ) ;
2116+ } else {
2117+ handleOpenContentType ( index )
2118+ }
2119+ } }
21142120 onKeyDown = { ( e ) => {
2115- if ( e . key === 'Enter' ) {
2121+ if ( e . key === 'Enter' && otherCmsUid !== filteredContentTypes [ index ] ?. otherCmsUid ) {
21162122 handleOpenContentType ( index ) ;
21172123 }
21182124 } }
0 commit comments