File tree Expand file tree Collapse file tree 4 files changed +29
-18
lines changed
src/apps/content-editor/src/app Expand file tree Collapse file tree 4 files changed +29
-18
lines changed Original file line number Diff line number Diff line change @@ -710,7 +710,7 @@ export const MediaItem = ({
710710 onDragEnd = { handleDragEnd }
711711 onDragOver = { handleDragOver }
712712 onClick = { ( ) => {
713- if ( isURL ) return ;
713+ if ( isURL || ! data ) return ;
714714
715715 onPreview && onPreview ( imageZUID ) ;
716716 } }
@@ -829,7 +829,7 @@ export const MediaItem = ({
829829 ) : (
830830 < > </ >
831831 ) }
832- { ! isURL && (
832+ { ! isURL && data && (
833833 < Tooltip title = "Edit File" placement = "bottom" enterDelay = { 800 } >
834834 < IconButton size = "small" >
835835 < EditRounded fontSize = "small" />
@@ -868,7 +868,7 @@ export const MediaItem = ({
868868 horizontal : "right" ,
869869 } }
870870 >
871- { ! isURL && ! isBynderAsset && (
871+ { ! isURL && ! isBynderAsset && data && (
872872 < Box >
873873 < MenuItem
874874 onClick = { ( event ) => {
@@ -907,17 +907,19 @@ export const MediaItem = ({
907907 </ MenuItem >
908908 </ Box >
909909 ) }
910- < MenuItem
911- onClick = { ( event ) => {
912- event . stopPropagation ( ) ;
913- handleCopyClick ( isURL ? imageZUID : data ?. url , false ) ;
914- } }
915- >
916- < ListItemIcon >
917- { isCopied ? < CheckRounded /> : < LinkRounded /> }
918- </ ListItemIcon >
919- < ListItemText > Copy File Url</ ListItemText >
920- </ MenuItem >
910+ { data && (
911+ < MenuItem
912+ onClick = { ( event ) => {
913+ event . stopPropagation ( ) ;
914+ handleCopyClick ( isURL ? imageZUID : data ?. url , false ) ;
915+ } }
916+ >
917+ < ListItemIcon >
918+ { isCopied ? < CheckRounded /> : < LinkRounded /> }
919+ </ ListItemIcon >
920+ < ListItemText > Copy File Url</ ListItemText >
921+ </ MenuItem >
922+ ) }
921923 < MenuItem
922924 onClick = { ( event ) => {
923925 event . stopPropagation ( ) ;
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ class CSVImportBody extends Component {
4343 sitemapPriority : - 1 ,
4444 canonicalTagMode : 0 ,
4545 } ,
46+ fieldMaps : { } ,
4647 } ;
4748
4849 chunkSize = 30 ;
@@ -145,7 +146,7 @@ class CSVImportBody extends Component {
145146 if ( fieldName === "none" ) {
146147 // filter out the field association if it exists in the fieldMap
147148 if ( this . state . fieldMaps [ csvCol ] ) {
148- let removedFieldMap = { ...this . state . fieldsMaps } ;
149+ let removedFieldMap = { ...this . state . fieldMaps } ;
149150 delete removedFieldMap [ csvCol ] ;
150151 return this . setState ( { fieldMaps : removedFieldMap } , ( ) => {
151152 this . mapFieldsToCols ( ) ;
@@ -346,6 +347,7 @@ class CSVImportBody extends Component {
346347 fields : this . state . fields ,
347348 cols : this . state . cols ,
348349 handleMap : this . handleFieldToCSVMap ,
350+ fieldMaps : this . state . fieldMaps ,
349351 } ,
350352 ...records ,
351353 ] ;
@@ -438,6 +440,7 @@ class Row extends PureComponent {
438440 handleMap = { item . handleMap }
439441 fields = { item . fields }
440442 cols = { item . cols }
443+ fieldMaps = { item . fieldMaps }
441444 />
442445 ) ;
443446 }
Original file line number Diff line number Diff line change @@ -22,10 +22,10 @@ export default function Columns(props) {
2222 < span className = { cx ( styles . Cell ) } > { col . toUpperCase ( ) } </ span >
2323 < Select
2424 name = { colName }
25+ value = { props . fieldMaps [ col ] || "none" }
2526 onChange = { ( evt ) => {
2627 props . handleMap ( evt . target . value , col ) ;
2728 } }
28- defaultValue = "none"
2929 size = "small"
3030 >
3131 < MenuItem value = "none" > none</ MenuItem >
Original file line number Diff line number Diff line change @@ -158,11 +158,14 @@ export const ItemEditHeaderActions = ({
158158 ) ;
159159
160160 useEffect ( ( ) => {
161+ // Automatically opens the create redirect modal
162+ // when there are changes to the url path part
161163 if (
162164 ! isLoadingVersions &&
163165 ! isFetchingVersions &&
164166 ! isFetching &&
165- ! ! isCheckingPathUpdate
167+ ! ! isCheckingPathUpdate &&
168+ Array . isArray ( itemVersions )
166169 ) {
167170 const publishedItemVersions = itemVersions
168171 ?. filter ( ( ver ) => ! ! ver ?. publishAt )
@@ -180,7 +183,10 @@ export const ItemEditHeaderActions = ({
180183 ) ;
181184 } ) ;
182185
183- if ( publishedItemVersions ?. length < 2 ) return ;
186+ if ( publishedItemVersions ?. length < 2 ) {
187+ return ;
188+ }
189+
184190 const activeVersion = publishedItemVersions [ 0 ] ;
185191 const previousVersion = publishedItemVersions [ 1 ] ;
186192 const pathHasChanged =
You can’t perform that action at this time.
0 commit comments