adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
730 stars 736 forks source link

Image v3 Preset Type section is not visible when using this component with ImageDelegate. #2535

Open RSGNR15 opened 1 year ago

RSGNR15 commented 1 year ago

Current Behavior

If I create a new custom component and use Image V3 component with 'ImageDelegate', 'Preset Type' section in the dialog is not displayed. When I drag and drop an image in the asset section of this component, I can see the Preset Type section is visible for the first time. But when I reopen this component. I can't see 'Preset Type' section anymore. It is hidden in the dialog console

Please note that, Asset tab is not a first tab of this custom component.

Expected behavior/code If we use an image in this component and selected a smart crop variation, it should always display 'Preset Type' section in the dialog below the image. It should be hidden.

Environment

Additional context / Screenshots Image v3 component with smart-crop as 'auto'

image

PS: core.wcm.components.image.v3 clientlib has been added to the component.

vabs95 commented 1 year ago

@bpauli the issue is caused by the line 137 in image.js within Image V3 Clientlibs $cqFileUploadEdit = $dialog.find(".cq-FileUpload-edit:visible");

Checking "visible" will work only in Image Dialog but not on another component which use V3 for delegation as Asset Tab is not visible on dialog load on those components.

Fix: $cqFileUploadEdit = $($dialog.find(".cq-FileUpload-edit")[imageFromPageImage.checked ? 0 : 1]);

Check which fileUpload to pick on the basis of "imageFromPageImage" checked value.

vladbailescu commented 1 year ago

Should be fixed by #2537