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

onSort with *correct* sortProperties #749

Merged
merged 4 commits into from
Apr 16, 2018

Conversation

dahlbyk
Copy link
Contributor

@dahlbyk dahlbyk commented Oct 10, 2017

Griddle major version

1.x

Changes proposed in this pull request

onSort is now fired just before the new sortProperties are dispatched.

This essentially renders TableHeadingCell obsolete, but deleting it is a potentially breaking change.

Idea

What if events were fired from a Redux middleware instead of click handlers?

Why these changes are made

Close #716; #717 was insufficient.

Are there tests?

Existing story now demonstrates expected behavior.

It seems like a new React version changed behavior when render() returns a string, so the TS story has been adjusted.

Copy link
Member

@joellanciaux joellanciaux left a comment

Choose a reason for hiding this comment

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

Looks great! 👍

One tiny comment that's absolutely not a blocker.

}))
)(props => <OriginalComponent {...props} />);
// Obsolete
const EnhancedHeadingCell = OriginalComponent => OriginalComponent;
Copy link
Member

Choose a reason for hiding this comment

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

Can this be removed?

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 can, but it's technically a breaking change. Glad to remove if you're not concerned.

Copy link
Member

Choose a reason for hiding this comment

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

Just to double confirm - we're leaving this here to avoid causing a potential breaking change right? I think we're maybe just outside the realm of where a 2.0 release makes sense. If I'm understanding correctly, we can leave this here for now to avoid breaking change and remove the obsolete field in a 2.0 version.

Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct. I left it as a no-op to be cleaned up for a 2.0 release.

The chances someone is actually depending on this seem quite low, but it's been exported as part of the public API.

@dahlbyk
Copy link
Contributor Author

dahlbyk commented Oct 27, 2017

On re-review I noticed a few gaps between core and local versions of TableHeadingCellContainer, so I've added a commit to close the gap (mostly from #699).

@dahlbyk dahlbyk merged commit 7416502 into GriddleGriddle:master Apr 16, 2018
@dahlbyk dahlbyk deleted the setSortColumn branch April 16, 2018 14:10
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