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

Some polish on query search #1222

Merged
merged 3 commits into from
Oct 5, 2016
Merged

Conversation

vera-liu
Copy link
Contributor

Done:

  • Changed query search icon
    screen shot 2016-09-29 at 2 08 56 pm
  • In query search results, added column for redirect to SQL Editor
    screen shot 2016-09-29 at 2 09 42 pm
  • Make userIds clickable, once a userId is clicked, queries will be refreshed with only queries by that user
    screen shot 2016-09-29 at 2 09 04 pm

Todo:

  • Change userId and dbId columns to userName and dbName so that they are more readable, needs to change this in Query model, will issue another PR on this

needs-review @ascott @bkyryliuk @mistercrunch

@@ -42,6 +52,11 @@ class QueryTable extends React.Component {
if (q.endDttm) {
q.duration = fDuration(q.startDttm, q.endDttm);
}
q.userId = (
<a onClick={this.props.onUserClicked.bind(this, q.userId)}>
Copy link
Contributor

Choose a reason for hiding this comment

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

when we don't have an href we should use a button with a link class:

<button class="btn btn-link" onClick={}>Link</button>

http://getbootstrap.com/css/#buttons-options

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


q.querylink = (
<div style={{ width: '75px' }}>
<a href={this.getQueryLink(q.dbId, source)} >
Copy link
Contributor

Choose a reason for hiding this comment

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

could we use a mini button here with the icon inside?
screenshot 2016-09-30 14 12 13

<a href="#" class="btn btn-primary btn-xs"><i class="fa fa-external-link"></i> Open in SQL Editor</a>

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

@@ -98,7 +113,13 @@ class QueryTable extends React.Component {
/>
</div>
);

q.querylink = (
<div style={{ width: '75px' }}>
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 we should let the button be full-width/on one line, and make the sql-query container a little less wide.

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:)

showVisualizeModal: false,
activeQuery: null,
};
}
getQueryLink(dbId, sql) {
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 we are using a similar getQueryLink method in a few components. can we generalize and add to a utils file?

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:)

@vera-liu
Copy link
Contributor Author

Made some changes, also made dbId clickable like userId does:
screen shot 2016-09-30 at 3 55 36 pm
@ascott

@@ -46,6 +43,12 @@ class DatabaseSelect extends React.Component {

DatabaseSelect.propTypes = {
onChange: React.PropTypes.func,
databaseId: React.PropTypes.number,
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 will probably through a warning when the default prop is set to null and it's expecting a number.

probably want to use React.PropTypes.oneOfType

React.PropTypes.oneOfType([
  React.PropTypes.number,
  React.PropTypes.bool
]);

and make databaseId: false in the defaultProps
and databaseId

Copy link
Contributor Author

@vera-liu vera-liu Oct 3, 2016

Choose a reason for hiding this comment

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

I tested this passing databaseId as null, no warnings were shown. According to https://github.com/facebook/react/issues/2166, for proptypes that are not isRequired, the null value means it's intentional, which will be bypassed by React, the undefined value will cause a warning. For this one I think we don't have to put databaseId as isRequired since it's for passing the value to Select. If null is passed then the Select box is empty, as in default state. What are your suggestions? @ascott

Copy link
Contributor

Choose a reason for hiding this comment

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

if it doesn't throw a warning, i'm good with your implementation 👍

@vera-liu vera-liu merged commit 421a86a into apache:master Oct 5, 2016
@vera-liu vera-liu deleted the vliu_search_polish branch November 1, 2016 19:04
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this pull request Nov 17, 2021
…#1222)

* fix(plugin-chart-table): fix table clear x-filtering highlighting issue

* fix(plugin-chart-table): fix lint
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this pull request Nov 24, 2021
…#1222)

* fix(plugin-chart-table): fix table clear x-filtering highlighting issue

* fix(plugin-chart-table): fix lint
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this pull request Nov 25, 2021
…#1222)

* fix(plugin-chart-table): fix table clear x-filtering highlighting issue

* fix(plugin-chart-table): fix lint
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this pull request Nov 26, 2021
…#1222)

* fix(plugin-chart-table): fix table clear x-filtering highlighting issue

* fix(plugin-chart-table): fix lint
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.12.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.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants