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
744 stars 750 forks source link

[Image] Improve error message when "Get alternative text from DAM" is used on an image bound to an asset not having a description #1276

Closed kwin closed 2 years ago

kwin commented 3 years ago

Bug Report

Current Behavior

  1. add a image component
  2. link with asset from DAM which does have its (optional) description property empty
  3. open edit dialog
  4. click on tab "meta data"
  5. check "get alternative text from DAM"
  6. try to submit dialog by clicking on "Done"
  7. this is not possible as the disabled mandatory field "Alternative Text*" is empty

Expected behavior/code A clear error message stating that the referenced asset does not have a description which can be used as alt text.

Environment

Possible Solution The validation should be improved in a way that the (disabled) input field "Alternative Text*" is only mandatory in case "get alternative text from DAM" is not set. In addition some custom validation must be added which checks if the linked DAM asset has a valid description.

Additional context / Screenshots Screenshot 2020-11-23 at 10 49 56

kwin commented 3 years ago

One would probably optionally need to reference a custom validator (https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/clientlibs/foundation/js/validation/index.html#example) in https://github.com/adobe/aem-core-wcm-components/blob/dc2fd8a98f2002c8af824cfee1ccff0f1f2797e7/content/src/content/jcr_root/apps/core/wcm/components/commons/v1/clientlibs/editor/checkboxTextfieldTuple/checkboxTextfieldTuple.js#L124. That would allow to overwrite the error message in case "Get alternative text from DAM" is selected and the seed value is empty!

comanV commented 2 years ago

@adobe export issue to Jira project SITES

github-jira-sync-bot commented 2 years ago

:white_check_mark: Jira issue SITES-6256 is successfully created for this GitHub issue.