-
-
Notifications
You must be signed in to change notification settings - Fork 554
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
XWIKI-22580: New release input fields have no text alternative #3580
base: master
Are you sure you want to change the base?
Conversation
* Implemented a text alt. TODO: test the feature. Could only get the translation key to work so far...
* Implemented a text alt. TODO: Fix the test in StringClassTest. Somehow it doesn't find the component for Localization...
* Fixed the test by providing the component.
* Fixed the date displayer and tests going along it
* Fixed indentation
@@ -293,6 +293,12 @@ public void displayCustom(StringBuffer buffer, String fieldName, String prefix, | |||
ScriptContext.ENGINE_SCOPE); | |||
scontext.setAttribute("object", new com.xpn.xwiki.api.Object(object, context), ScriptContext.ENGINE_SCOPE); | |||
scontext.setAttribute("type", type, ScriptContext.ENGINE_SCOPE); | |||
/* This is a text alternative fallback to explain what the input is about. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does having an aria-label
only apply to PropertyClass
and StringClass
only?
If we provide a default generic text alternative, it is probably better if we try to cover all cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before reaching this solution, I tried to provide a generic fix for all Property types. However, the
displayEdit
function is overridden for a lot of object classes. This solution only fix String properties, but a similar solution could be used to provide text alternatives for the inputs of other property types.
Since there's no straightforward way to generalize this without updating all of the classes implementations for displayEdit
, I don't think I want to merge it all at once.
These changes have a wide impact, so I'd rather keep them as minimal as necessary to avoid breaking things. See for example the number of test updates needed just for what was done until now.
Moreover it doesn't seem to me like it's needed for other property types. This might already be too generalized, in practice I only need this change to the displayEdit function for
Lines 53 to 63 in e5357c3
#if ($xcontext.action == "edit" || $xcontext.action == "inline") | |
$doc.use("ReleaseCode.ReleaseClass") | |
Version: $doc.display("version") | |
Release Managers: $doc.display("releaseManagers") | |
Release Date: $doc.display("releaseDate") | |
#else | |
## Note: We use the include macro below to circumvent the "nested script" execution issue... | |
{{include reference="ReleaseCode.ReleaseSheetHeader"/}} | |
{{include reference=""/}} | |
#end |
WDYT?
@Sereza7 you are probably missing a re-build of the distribution.
Let me know if this lead to better results. Also, you can check if the server produced by the test contains the right version of |
Thanks for the help! After building the distribution again it used the right version in the tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Jira URL
https://jira.xwiki.org/browse/XWIKI-22580
Changes
Description
Clarifications
Screenshots & Video
After the PR, we can see that both of the fields are labelled in a generic but correct way.
A test with axe devtool does not find any warning on this page. Before the changes it would have found two
missing label
.Executed Tests
Successfully built oldcore with
mvn clean install -f xwiki-platform-core/xwiki-platform-oldcore -Pquality
After building the other changes withmvn clean install -f xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates
, I ran the test that sent a WCAG warning on CI withmvn clean install -f xwiki-platform-core/xwiki-platform-release/xwiki-platform-release-test/xwiki-platform-release-test-docker -Pdocker -Dxwiki.test.ui.wcag=true
. It returned only the warning for the date field (less than the two warnings from before). I do not understand why this automated test still warns about the date field. Manual tests on a local instance with updatedStringClass.class
,PropertyClass.class
anddisplayer_date.vm
showed that this date input warning is solved.If this PR gets merged, I'll keep an eye on the CI tests to see how the results evolve. Hopefully it was just a test setup mistake from my end and this PR solves the ticket completely. If not, I'll try to figure out what's happening in the test suite and provide a patch to correct this test.
Expected merging strategy