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

ArgsTable: Fix union type splitting #11868

Merged
merged 4 commits into from Aug 28, 2020
Merged

ArgsTable: Fix union type splitting #11868

merged 4 commits into from Aug 28, 2020

Conversation

ajkl2533
Copy link
Contributor

Issue: #11840

What I did

This is more like hotfix, I disabled splitting for complex union types containing (), {}, [], <>. I'll need more time to find out how to properly split those complex union types.

How to test

  • Is this testable with Jest or Chromatic screenshots? yes, added
  • Does this need a new example in the kitchen sink apps? no
  • Does this need an update to the documentation? no

@ajkl2533
Copy link
Contributor Author

@shilman Can we merge this fix?

const cannotBeSafelySplitted = /[(){}[\]<>]/.test(summaryAsString);

if (cannotBeSafelySplitted) {
return <ArgText text={summaryAsString} simple={summaryAsString.includes('|')} />;
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain simple to me? Don't understand why we need it.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry I have a vacation. Simple is turning on and off styling of values (border, background...). And I used it because when you have non splitted values it looked strange with styling.

@shilman shilman changed the title fix(ArgValue): fix wrong union type splitting ArgsTable: Fix union type splitting Aug 20, 2020
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

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.

None yet

3 participants