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

Handle popover prop on JSONFormat #468

Merged

Conversation

themadcreator
Copy link
Contributor

Changes proposed in this pull request:

Previously, JSONFormat cells would not allow you to change the
showPopover prop because it wanted to detect nulls and override
the value.

Now, if the user actually sets the prop on JSONFormat, we will
still hide the popover for nully values, but will use their
prop as the default.

Previously, JSONFormat cells would not allow you to change the
showPopover prop because it wanted to detect nulls and override
the value.

Now, if the user actually sets the prop on JSONFormat, we will
still hide the popover for nully values, but will use their
prop as the default.
@blueprint-bot
Copy link

Handle popover prop on JSONFormat

Preview: docs | table
Coverage: core | datetime

@blueprint-bot
Copy link

Adding unit test

Preview: docs | table
Coverage: core | datetime

Copy link
Contributor

@giladgray giladgray left a comment

Choose a reason for hiding this comment

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

👍 could be done with 60% fewer lines

const showPopover = isNully ? TruncatedPopoverMode.NEVER : TruncatedPopoverMode.ALWAYS;
if (isNully) {
showPopover = TruncatedPopoverMode.NEVER;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

pretty sure this is a prefect ternary:

const showPopover = (children == null) ? TruncatedPopoverMode.NEVER : this.props.showPopover;

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 re-use isNully to apply a classname later on

Copy link
Contributor Author

Choose a reason for hiding this comment

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

could still use isNully in a ternary, if you care

@themadcreator themadcreator merged commit 6f1a776 into master Jan 12, 2017
@themadcreator themadcreator deleted the bd/dont-ignore-popover-setting-jsonformatted-cell branch January 12, 2017 20:35
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.

3 participants