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

[sqllab] slide animations when adding/removing/toggling TableElement #1472

Merged
merged 2 commits into from
Oct 29, 2016

Conversation

mistercrunch
Copy link
Member

@ascott @vera-liu @bkyryliuk

Added a mockedActions in fixtures that uses the sinon lib, makes it easy to test if actions are triggered as they should.

To test outcomes after animations I decided to define timeout as a prop, which can be set to zero in the context of a test, using a short delay (using setTimeout) was still necessary.

@ascott
Copy link
Contributor

ascott commented Oct 28, 2016

would be great to see screenshots/gif of this ui change!

@@ -122,9 +122,10 @@ class TabbedSqlEditors extends React.PureComponent {
<MenuItem eventKey="2" onClick={this.renameTab.bind(this, qe)}>
<i className="fa fa-i-cursor" /> rename tab
</MenuItem>
<MenuItem eventKey="3">
{qe && <MenuItem eventKey="3">
Copy link
Contributor

Choose a reason for hiding this comment

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

i think this is more readable when the condition and component are on separate lines:

{qe && 
  <MenuItem eventKey="3">
    <i className="fa fa-clipboard" /> <CopyQueryTabUrl queryEditor={qe} />
  </MenuItem>
}

tooltip="Data preview"
href="#"
/>
{table.selectStar && <CopyToClipboard
Copy link
Contributor

Choose a reason for hiding this comment

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

move <CopyToClipboard to next line plz.

expect(React.isValidElement(<CopyQueryTabUrl />)).to.equal(true);
});
it('renders with props', () => {
it('be valid with props', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

s/be/is

@@ -65,11 +67,8 @@ class TableElement extends React.PureComponent {
this.setState({ sortColumns: !this.state.sortColumns });
}

render() {
getHeader() {
Copy link
Contributor

Choose a reason for hiding this comment

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

for any method that returns a node/element it's a nice pattern to name them with render, so this would be renderHeader,

Copy link
Contributor

Choose a reason for hiding this comment

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

could this be pulled out into it's own component called <TableHeader />, nice to break things into smaller components, makes things more easily testable.

const cols = table.columns.slice();
return header;
}
getMetadata() {
Copy link
Contributor

Choose a reason for hiding this comment

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

s/getMetadata/renderMetadata

</a>
</div>
<div className="pull-right">
<ButtonGroup className="ws-el-controls pull-right">
Copy link
Contributor

Choose a reason for hiding this comment

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

would be nice to pull this out into a component called <TableControls />

@mistercrunch
Copy link
Member Author

@ascott I addressed all the comments except the ones calling to refactor out smaller components. I understand the value of doing that, but I'd rather keep it out of the scope of this PR.

@ascott
Copy link
Contributor

ascott commented Oct 28, 2016

LGTM 🚢

@mistercrunch mistercrunch merged commit ab083b8 into apache:master Oct 29, 2016
@mistercrunch mistercrunch deleted the animations branch October 29, 2016 14:48
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.13.0 labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants