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

fix: accessibility issues on Tree component, adjusting examples #1703

Merged
merged 13 commits into from
Jul 16, 2020

Conversation

hportales2000
Copy link
Contributor

fix: #1669

Changes proposed in this PR:

@nexxtway/react-rainbow

@commit-lint
Copy link

commit-lint bot commented Jul 10, 2020

Bug Fixes

  • accessibility issues on Tree component, adjusting examples (b1fa4a2)
  • tree accesibility issues (3fca233)
  • tree accesibility issues (90ebc66)
  • impriving code (c9904ad)
  • test (224d8ff)

Chore

Tests

Contributors

@hportales2000, @TahimiLeonBravo, @LeandroTorresSicilia

Commit-Lint commands

You can trigger Commit-Lint actions by commenting on this PR:

  • @Commit-Lint merge patch will merge dependabot PR on "patch" versions (X.X.Y - Y change)
  • @Commit-Lint merge minor will merge dependabot PR on "minor" versions (X.Y.Y - Y change)
  • @Commit-Lint merge major will merge dependabot PR on "major" versions (Y.Y.Y - Y change)
  • @Commit-Lint merge disable will desactivate merge dependabot PR
  • @Commit-Lint review will approve dependabot PR
  • @Commit-Lint stop review will stop approve dependabot PR

@TahimiLeonBravo
Copy link
Collaborator

@hportales2000 the styles should look like the zeplin design

  • right now it looks this

Screen Shot 2020-07-12 at 12 48 14 AM

Screen Shot 2020-07-12 at 12 52 15 AM

/>
);
});
}

TreeChildren.propTypes = {
data: PropTypes.arrayOf(
Copy link

Choose a reason for hiding this comment

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

Identical blocks of code found in 2 locations. Consider refactoring.

@@ -9,15 +9,35 @@ import getNode from './helpers/getNode';
* @category Layout
*/
export default function Tree(props) {
const { data, onExpandCollapse, onSelect, className, style, id } = props;
const {
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 6 locations. Consider refactoring.

export default function TreeChildren({ data, onSelect, onExpandCollapse, nodePath }) {
return data.map((props, index) => {
const key = `child-item-${index}`;
export default function TreeChildren(props) {
Copy link

Choose a reason for hiding this comment

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

Function TreeChildren has 28 lines of code (exceeds 25 allowed). Consider refactoring.

`};
> div {
margin-left: ${props =>
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

props['aria-level'] > 1
? `-${(props['aria-level'] - 1) * 20 + props['aria-level'] - 1}px`
: '0'};
padding-left: ${props =>
Copy link

Choose a reason for hiding this comment

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

Similar blocks of code found in 2 locations. Consider refactoring.

package.json Outdated Show resolved Hide resolved
@codeclimate
Copy link

codeclimate bot commented Jul 16, 2020

Code Climate has analyzed commit 258a8d8 and detected 9 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2
Duplication 7

View more on Code Climate.

@LeandroTorresSicilia LeandroTorresSicilia merged commit eb42f71 into master Jul 16, 2020
@LeandroTorresSicilia LeandroTorresSicilia deleted the fix-tree-accessibility branch July 16, 2020 17:10
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.

fix: markup and improve accessibility on the Tree component
4 participants