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

Refacto details top icons #1304

Merged
merged 5 commits into from
Nov 19, 2024
Merged

Refacto details top icons #1304

merged 5 commits into from
Nov 19, 2024

Conversation

dtrucs
Copy link
Collaborator

@dtrucs dtrucs commented Nov 14, 2024

  • Reduce the markup
  • Add explicit label to button/link (a11y purpose)

@dtrucs dtrucs requested a review from a team November 14, 2024 10:09
@dtrucs dtrucs force-pushed the Refacto-details-top-icons branch from cd14a6e to 9b59d56 Compare November 14, 2024 10:12
</DetailsButton>
</ToolTip>
)}
{displayReport && Number(details.id) && getGlobalConfig().enableReport && (
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{displayReport && Number(details.id) && getGlobalConfig().enableReport && (
{displayReport && Boolean(Number(details.id)) && getGlobalConfig().enableReport && (

(or it will display 0 in DOM if Number(details.id) is 0)

Copy link
Member

Choose a reason for hiding this comment

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

Or maybe:

Suggested change
{displayReport && Number(details.id) && getGlobalConfig().enableReport && (
{Boolean(displayReport && Number(details.id) && getGlobalConfig().enableReport) && (

Copy link
Member

Choose a reason for hiding this comment

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

Or event better: preparing a variable like

const showMyContent = Boolean(displayReport && Number(details.id) && getGlobalConfig().enableReport);

then:

Suggested change
{displayReport && Number(details.id) && getGlobalConfig().enableReport && (
{showMyContent && (

Comment on lines 116 to 120
{displayReservationWidget &&
(details as Details).reservation &&
(details as Details).reservation_id &&
getGlobalConfig().reservationPartner &&
getGlobalConfig().reservationProject && (
Copy link
Member

Choose a reason for hiding this comment

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

Same as previous one: should be better with a tailored variable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes you're right for a better readability, i just pushed a commit with all suggestions 👍
(Cast the detail.id to number was useless and 0 value should not exist)

@dtrucs dtrucs force-pushed the Refacto-details-top-icons branch from 9b59d56 to f4cf9d4 Compare November 19, 2024 15:35
@dtrucs dtrucs merged commit 1f7692a into develop Nov 19, 2024
2 checks passed
@dtrucs dtrucs deleted the Refacto-details-top-icons branch November 19, 2024 17:03
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