Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

feat(mixed): add accessibility prop to all components #927

Merged
merged 8 commits into from
Feb 20, 2019

Conversation

layershifter
Copy link
Member

Fixes #633.

@codecov
Copy link

codecov bot commented Feb 19, 2019

Codecov Report

Merging #927 into master will increase coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #927      +/-   ##
==========================================
+ Coverage   80.43%   80.51%   +0.08%     
==========================================
  Files         659      659              
  Lines        8412     8447      +35     
  Branches     1424     1492      +68     
==========================================
+ Hits         6766     6801      +35     
  Misses       1631     1631              
  Partials       15       15
Impacted Files Coverage Δ
packages/react/src/components/List/ListItem.tsx 100% <ø> (ø) ⬆️
packages/react/src/components/Flex/FlexItem.tsx 53.57% <ø> (ø) ⬆️
...c/lib/accessibility/Behaviors/Grid/gridBehavior.ts 100% <ø> (ø) ⬆️
packages/react/src/components/Menu/MenuDivider.tsx 100% <ø> (ø) ⬆️
packages/react/src/components/Image/Image.tsx 100% <ø> (ø) ⬆️
packages/react/src/components/Tree/TreeItem.tsx 58.06% <ø> (ø) ⬆️
...t/src/components/Dropdown/DropdownSelectedItem.tsx 42.85% <ø> (ø) ⬆️
packages/react/src/components/Chat/ChatMessage.tsx 93.61% <ø> (ø) ⬆️
packages/react/src/components/Chat/Chat.tsx 95.45% <ø> (ø) ⬆️
packages/react/src/components/Tree/TreeTitle.tsx 73.68% <ø> (ø) ⬆️
... and 41 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f979147...3a8be1e. Read the comment docs.

* Accessibility behavior if overridden by the user.
* @default defaultBehavior
*/
accessibility?: Accessibility
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add this in interface (or if it should be use in all UI components, maybe even move to the UIComponentProps)? At least common interface would allow us to reuse the same description, although not sure how we can add different @defaults there..

Copy link
Contributor

@mnajdova mnajdova Feb 19, 2019

Choose a reason for hiding this comment

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

Btw will we still need these @default description, after removing react-docgen-typescript? @kuzhelov

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm note sure that the issues with @default will be solved right now while some components have different defaults 🐱

@@ -46,19 +54,22 @@ class ChatItem extends UIComponent<ReactProps<ChatItemProps>, any> {

static propTypes = {
...commonPropTypes.createCommon({ content: false }),
accessibility: customPropTypes.accessibility,
Copy link
Contributor

Choose a reason for hiding this comment

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

I would definitely expect this to be in the commonPropTypes.createCommon factory.. We can use {accessibility: false} if we don't want it there for some components

Copy link
Member Author

Choose a reason for hiding this comment

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

I like createCommon(), but #647 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, if we agree to remove this abstraction, then we should do this, but having now some property being defined directly, and some of them as result of a function is really confusing. Let's create then issue for this, because I missed that comment and was not aware of it by now...

@@ -104,7 +104,7 @@ class Accordion extends AutoControlledComponent<ReactProps<AccordionProps>, any>
}),
),
]),
accessibility: PropTypes.func,
accessibility: customPropTypes.accessibility,
Copy link
Contributor

Choose a reason for hiding this comment

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

we can remove this from here now

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch 👍

@@ -197,6 +197,7 @@ class Dropdown extends AutoControlledComponent<Extendable<DropdownProps>, Dropdo

static propTypes = {
...commonPropTypes.createCommon({
accessibility: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure which component should not have the accessibility property?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, it's not implemented yet #875

@codecov-io
Copy link

codecov-io commented Feb 20, 2019

Codecov Report

Merging #927 into master will increase coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #927      +/-   ##
==========================================
+ Coverage   80.43%   80.51%   +0.08%     
==========================================
  Files         659      659              
  Lines        8412     8447      +35     
  Branches     1424     1492      +68     
==========================================
+ Hits         6766     6801      +35     
  Misses       1631     1631              
  Partials       15       15
Impacted Files Coverage Δ
packages/react/src/components/Menu/MenuDivider.tsx 100% <ø> (ø) ⬆️
packages/react/src/components/List/ListItem.tsx 100% <ø> (ø) ⬆️
packages/react/src/components/Flex/FlexItem.tsx 53.57% <ø> (ø) ⬆️
...c/lib/accessibility/Behaviors/Grid/gridBehavior.ts 100% <ø> (ø) ⬆️
packages/react/src/components/Popup/Popup.tsx 71.87% <ø> (ø) ⬆️
packages/react/src/components/Image/Image.tsx 100% <ø> (ø) ⬆️
packages/react/src/components/Tree/TreeItem.tsx 58.06% <ø> (ø) ⬆️
...t/src/components/Dropdown/DropdownSelectedItem.tsx 42.85% <ø> (ø) ⬆️
packages/react/src/components/Chat/ChatMessage.tsx 93.61% <ø> (ø) ⬆️
packages/react/src/components/Chat/Chat.tsx 95.45% <ø> (ø) ⬆️
... and 41 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f979147...3a8be1e. Read the comment docs.

@layershifter layershifter merged commit df26fa6 into master Feb 20, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix/accept-a11y branch February 20, 2019 17:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants