Skip to content

Commit

Permalink
IBX-7954: Applied review remark
Browse files Browse the repository at this point in the history
  • Loading branch information
barw4 committed Mar 18, 2024
1 parent fd71c45 commit d776834
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/bundle/Resources/public/js/scripts/fieldType/ezimageasset.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@
return field.fieldDefinitionIdentifier === imageAssetMapping['contentFieldIdentifier'];
});

if (imageField.fieldValue === null) {
showErrorNotification(
Translator.trans(
/* @Desc("The chosen asset has no image data available.") */ 'ezimageasset.empty_data.message.error',
{},
'fieldtypes_preview'
)
);

return;
}

this.updateData(
response.ContentInfo.Content._id,
response.ContentInfo.Content.TranslatedName,
Expand Down Expand Up @@ -126,18 +138,6 @@
* @param {Object} image
*/
updateData(destinationContentId, destinationContentName, destinationLocationId, image) {
if (image === null) {
showErrorNotification(
Translator.trans(
/* @Desc("The chosen asset has no image data available.") */ 'ezimageasset.empty_data.message.error',
{},
'fieldtypes_preview'
)
);

return;
}

const preview = this.fieldContainer.querySelector('.ez-field-edit__preview');
const previewVisual = preview.querySelector('.ez-field-edit-preview__visual');
const previewImg = preview.querySelector('.ez-field-edit-preview__media');
Expand Down

0 comments on commit d776834

Please sign in to comment.