Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested Fix: [Image + Teaser] Don't require ALT text if no asset selected #2523 #2607

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ConnorJamesLow
Copy link

Q                       A
Fixed Issues? Fixes #2523
Patch: Bug Fix?
Minor: New Feature?
Major: Breaking Change?
Tests Added + Pass? N/A
Documentation Provided ✅ Yes (code comments)
Any Dependency Changes? No
License Apache License, Version 2.0

Fix the image dialog validation logic per #2523.

  • Checking "Don't provide an alternative text" should prevent an error message from showing under alt when done editing.
  • Checking "Inherit from description of asset" should also prevent an error message.

Copy link

sonarcloud bot commented Oct 31, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@ConnorJamesLow ConnorJamesLow changed the title Fix: [Image + Teaser] Don't require ALT text if no asset selected #2523 Suggested Fix: [Image + Teaser] Don't require ALT text if no asset selected #2523 Oct 31, 2023
// - alt is not inherited from the DAM
// - the alt value is empty.
// If all of these are true, return a validation error
if (!isDecorative && !isAltCheckboxChecked && !seededValue) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another check that could be beneficial:

// Do we have an asset at all?
var isImageSelected = !!$('[name="./fileReference"]').val(); 

if (isImageSelected && !isDecorative && !seededValue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Image + Teaser] Don't require ALT text if no asset selected
1 participant