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

[#173890674] Refactoring props for accessibility events on base header #2087

Merged
merged 10 commits into from
Jul 30, 2020

Conversation

CrisTofani
Copy link
Contributor

@CrisTofani CrisTofani commented Jul 22, 2020

Short description:
This PR adds a prop on base header to avoid the accessibility focus on chosen screens

the new prop is defined as a new object type:

export type AccessibilityEvents = {
  avoidNavigationEventsUsage?: boolean; // to avoid the use of NavigationEvent
  disableAccessibilityFocus?: boolean; // to avoid the setAccessibilityFocus on header title
};

@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Jul 22, 2020

Affected stories

  • 🌟 #173890674: Rendere possibile di evitare il focus sull'header tramite prop

Generated by 🚫 dangerJS

@CrisTofani CrisTofani added the a11y Activities related to accessibility label Jul 22, 2020
@CrisTofani CrisTofani marked this pull request as ready for review July 22, 2020 13:04
ts/components/screens/BaseHeader.tsx Outdated Show resolved Hide resolved
{fromNullable(this.props.accessibilityEvents).fold(
true,
({ avoidNavigationEventsUsage, disableAccessibilityFocus }) =>
!(avoidNavigationEventsUsage && disableAccessibilityFocus)
Copy link
Contributor

Choose a reason for hiding this comment

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

this condition causes a crash:

  • avoidNavigationEventsUsage = true , disableAccessibilityFocus = false -> true (error)

fix and refactor 1068bdf

@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2020

Codecov Report

Merging #2087 into master will decrease coverage by 0.02%.
The diff coverage is 14.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2087      +/-   ##
==========================================
- Coverage   45.53%   45.51%   -0.03%     
==========================================
  Files         464      464              
  Lines       13975    13984       +9     
  Branches     2676     2888     +212     
==========================================
+ Hits         6364     6365       +1     
- Misses       7567     7575       +8     
  Partials       44       44              
Impacted Files Coverage Δ
ts/components/ContextualHelpModal.tsx 37.70% <ø> (ø)
ts/components/RemindEmailValidationOverlay.tsx 23.38% <ø> (ø)
ts/components/screens/TopScreenComponent.tsx 42.85% <ø> (ø)
ts/screens/modal/RootedDeviceModal.tsx 46.87% <ø> (ø)
ts/components/screens/BaseHeader.tsx 25.25% <7.69%> (-1.42%) ⬇️
ts/components/screens/BaseScreenComponent.tsx 24.67% <100.00%> (ø)

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 46fe9c9...8c2d88e. Read the comment docs.

@Undermaken Undermaken merged commit d2f421e into master Jul 30, 2020
@Undermaken Undermaken deleted the 173890674-focus-on-header-prop branch July 30, 2020 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Activities related to accessibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants