Skip to content

Commit 5fa5960

Browse files
authored
Beta Release (#3868)
Created by Github action
2 parents 8c75b80 + 7f72306 commit 5fa5960

File tree

4 files changed

+29
-18
lines changed

4 files changed

+29
-18
lines changed

src/apps/content-editor/src/app/components/FieldTypeMedia.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff 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();

src/apps/content-editor/src/app/views/CSVImport/CSVImportBody.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

src/apps/content-editor/src/app/views/CSVImport/Columns/Columns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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>

src/apps/content-editor/src/app/views/ItemEdit/components/ItemEditHeader/ItemEditHeaderActions.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff 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 =

0 commit comments

Comments
 (0)