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

feat(onboarding): improve onboarding template component #13134

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

tibs245
Copy link
Contributor

@tibs245 tibs245 commented Sep 17, 2024

Question Answer
Branch? develop
Bug fix? no
New feature? no
Breaking change? no
Tickets None
License BSD 3-Clause
  • Try to keep pull requests small so they can be easily reviewed.
  • Commits are signed-off
  • Only FR translations have been updated
  • Branch is up-to-date with target branch
  • Lint has passed locally
  • Standalone app was ran and tested locally
  • Ticket reference is mentioned in linked commits (internal only)
  • Breaking change is mentioned in relevant commits

Description

Improve img props type to add more flexibility on image rules and be more readable

@tibs245 tibs245 requested review from a team as code owners September 17, 2024 10:00
@github-actions github-actions bot added the feature New feature label Sep 17, 2024
fredericvilcot
fredericvilcot previously approved these changes Sep 17, 2024
Copy link
Contributor

@fredericvilcot fredericvilcot left a comment

Choose a reason for hiding this comment

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

Great improvement 👍🏻

</div>
)}
<section className="flex flex-col items-center mt-8">
<img className="max-h-28" src={placeholderSrc} {...img} />
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick(blocking):placeHolderSrc is just an example image. We have to consider the src from img tag if it's present. This causes confusion if it display the img.src or placeholderSrc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The img.src overwrite the src already set. Same if className exists on img props.

You want still I add more logic for readability ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should concat img.className with the current className instead of overwriting it completely though

Copy link
Contributor Author

@tibs245 tibs245 Sep 18, 2024

Choose a reason for hiding this comment

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

It's a choice.

  • No do that allow to have more flexibility.
  • Do that add behavior by default but can add adverse reaction on specific case.

Example : On MANAGER-14496 see #13146 . We have image with text title. So I want set max-h-36

It's easier it className is overwrite. And if we add a className. I think you can be responsible of all display rules.

After. May be export DEFAULT_MAX_HEIGHT_CLASS if we want add possibility to extends on parent component ?

I try to keep simple. That's how I did it. But not hesitate if you think it's better to do otherwise

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @chipp972 for concatenating the classname.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Not hesitate to say me if change is good for you ;)

chipp972
chipp972 previously approved these changes Sep 18, 2024
@tibs245 tibs245 force-pushed the feat/onboarding-template branch 2 times, most recently from 38c94e2 to 54e47b7 Compare September 19, 2024 07:20
Copy link
Contributor

@darsene darsene left a comment

Choose a reason for hiding this comment

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

Unit test to fix

chipp972
chipp972 previously approved these changes Sep 19, 2024
@github-actions github-actions bot added the has conflicts Has conflicts to resolve before merging label Sep 19, 2024
@github-actions github-actions bot removed the has conflicts Has conflicts to resolve before merging label Sep 19, 2024
Use React.ComponentProps to improve flexibility of image rules

Signed-off-by: Thibault Barske <[email protected]>
chipp972
chipp972 previously approved these changes Sep 23, 2024
Copy link

sonarcloud bot commented Sep 23, 2024

@tibs245 tibs245 merged commit 6e835fb into develop Sep 24, 2024
15 checks passed
@tibs245 tibs245 deleted the feat/onboarding-template branch September 24, 2024 12:12
rjamet-ovh pushed a commit that referenced this pull request Sep 25, 2024
Use React.ComponentProps to improve flexibility of image rules

Signed-off-by: Thibault Barske <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants