-
-
Notifications
You must be signed in to change notification settings - Fork 556
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-21782: Incentivize use of header rows for the WYSIWYG editor tables #3310
base: master
Are you sure you want to change the base?
Conversation
…bles * Added a translation key-value for the warning message * Updated the default value of the table header to `top row` * Added a warning message (style from bootstrap, consistent with the color theme) that is displayed when the user chooses to have No headers for the table.
…bles * Updated test to take into account the new defaults
…bles * Fixed superfluous codestyle change * Improved the translation default value.
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.
Looks good overall. I added some minor comments.
...wiki-platform-ckeditor/xwiki-platform-ckeditor-plugins/src/main/webjar/xwiki-table/plugin.js
Outdated
Show resolved
Hide resolved
...wiki-platform-ckeditor/xwiki-platform-ckeditor-plugins/src/main/webjar/xwiki-table/plugin.js
Outdated
Show resolved
Hide resolved
...wiki-platform-ckeditor/xwiki-platform-ckeditor-plugins/src/main/webjar/xwiki-table/plugin.js
Outdated
Show resolved
Hide resolved
...wiki-platform-ckeditor/xwiki-platform-ckeditor-plugins/src/main/webjar/xwiki-table/plugin.js
Outdated
Show resolved
Hide resolved
...ki-platform-ckeditor/xwiki-platform-ckeditor-ui/src/main/resources/CKEditor/Translations.xml
Outdated
Show resolved
Hide resolved
...xwiki-platform-ckeditor/xwiki-platform-ckeditor-ui/src/main/resources/CKEditor/EditSheet.xml
Show resolved
Hide resolved
…bles * Comment improvements Co-authored-by: Marius Dumitru Florea <[email protected]>
…bles * Escaped the translation for HTML * Added comments on the style
This PR is ready for further review, and probably a merge. |
// Create a warning message for the accessibility without headers. | ||
const warningMessage = document.createElement('span'); | ||
warningMessage.classList.add('box', 'warningmessage'); | ||
warningMessage.textContent = CKEDITOR.tools.htmlEncode( |
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.
There's no need to escape HTML when you set the textContent
. If you want to use CKEDITOR.tools.htmlEncode()
then you can keep your previous code and just call CKEDITOR.tools.htmlEncode()
on the translation value. So either use directly the DOM API (textContent
) as I suggested, or use string concatenation but with HTML escaping.
Jira URL
https://jira.xwiki.org/browse/XWIKI-21782
Changes
Description
top row
Clarifications
Screenshots & Video
We can see on the demo video below that the new default for the table header field is
First row
, and selecting theNone
option displays a warning.https://github.com/user-attachments/assets/fabcea6f-7c02-4bc8-9b64-266e43fefeab
Executed Tests
Looking for
table
in the ckeditor test module only prompted me with one significant result, which isQuickActionsIT#table
.The default state of the table changed, so I also changed the output obtained with this minimal set of inputs. After the change of the test,
successfully passed while it did fail without the changes.
Expected merging strategy