forked from mattermost/mattermost
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MM-62045 Enable eslint-plugin-jsx-a11y and fix occurrences of jsx-a11…
…y/anchor-has-content (mattermost#29453) * Enable eslint-plugin-jsx-a11y and add standard rules as warnings or errors * Fix jsx-a11y/anchor-has-content in BooleanSetting and add SettingSet The invisible anchor was presumably supposed to let people jump from one setting's help text to another setting. That didn't work for boolean settings because there's no element with the ID of the setting. Instead of an empty anchor, we needed to give something else that ID. To improve the semantics of those settings, I also put those settings into a fieldset with a legend containing the setting's label text instead of using an actual label element as per how it's done on the MDN. We'll probably end up using the SettingSet for other settings as well. Finally, I also fixed the link used by admin.service.useLetsEncryptDescription.disabled to point to the right place and made it so that the link would open in the current tab. Ideally, I'd also remove the Markdown from that help text, but there's a lot here already. * Fix jsx-a11y/anchor-has-content in CheckboxSetting * Use SettingSet in PasswordSettings to improve semantics and layout The main reason for doing this is to use a proper legend and fieldset for these settings, but it also has the benefit of removing the extra spacing from in between these settings. * Change CopyText to use a button and require an aria-label for it This fixes two ESLint warnings: - This was failing jsx-a11y/anchor-has-content because it was an empty anchor element. I fixed that by giving it an aria-label matching the tooltip of the CopyText, but that required that the label was a string, so I had to change how CopyText is used. I also made the label required so that people give an accessible explanation of what is being copied. - This was also failing jsx-a11y/anchor-is-valid because it should be a button instead of a link. I applied the btn-link class and made it so that that doesn't override the link's height which hopefully doesn't cause problems anywhere else. This is to fix jsx-a11y/anchor-has-content and jsx-a11y/anchor-is-valid in the component. The ESLint plugin is complaining that this component is using an anchor instead of a button element, so I changed that * Turn jsx-a11y/anchor-has-content to be an error * Update snapshots * Remove lingering reference to nested prop which has been removed * Changing system console password settings to a list and update padding for alerts in it * Fix typo in SettingSet * Update E2E tests to enable Elasticsearch by ID and remove duplicate enableElasticSearch helper * Update E2E test to look for a legend instead of a label * Fix typo in snapshot
- Loading branch information
Showing
32 changed files
with
347 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.