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

Feature/sc 109316/fe pro dashboard accessibility fixes #899

Conversation

meetup-oleksandr-dudiuk
Copy link
Contributor

Related issues

Fixes PIVOTAL-xxx

Description

Screenshots (if applicable)

Copy link

This pull request has been linked to Shortcut Story #109316: [FE] Pro Dashboard Accessibility fixes.

<img className="proIcon" alt={connections.label} src={CONNECTIONS_ICON} />
<img
className="proIcon"
alt={connections && connections.label}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible that connections can be null or undefined? If so let's have a fallback string value here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep it's possible cause on pro-web connections not implemented and I just try to fix issue for update a lib version, it's not a part of my work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it should be removed when connections will be implemented on pro-web, but idk who deals with this

Copy link
Contributor

@meetup-anton-hulak meetup-anton-hulak Jan 29, 2024

Choose a reason for hiding this comment

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

I see, it will fix the type error, but still will leave alt attribute blank. Why not to use ternary here? connections ? connections.label : 'pro-icon (or some other fallback)

ref={forwardedRef}
{...other}
>
{icon ? (
Copy link
Contributor

Choose a reason for hiding this comment

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

It's really hard to read multiple ternary operators in jsx and I surprised that it is allowed in eslint rules. Can we move it to a separate render function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's just a copypast from swarm repo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we have the same ternary above ) from 2019

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's a good chance to improve the code ;)

@meetup-oleksandr-dudiuk meetup-oleksandr-dudiuk merged commit 14ab35d into main Jan 29, 2024
1 check passed
@meetup-oleksandr-dudiuk meetup-oleksandr-dudiuk deleted the feature/sc-109316/fe-pro-dashboard-accessibility-fixes branch January 29, 2024 14:54
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.

2 participants