-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Conversation
@@ -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)}> |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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)} > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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' }}> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done:)
037615c
to
06e05e6
Compare
Made some changes, also made dbId clickable like userId does: |
06e05e6
to
1439ead
Compare
@@ -46,6 +43,12 @@ class DatabaseSelect extends React.Component { | |||
|
|||
DatabaseSelect.propTypes = { | |||
onChange: React.PropTypes.func, | |||
databaseId: React.PropTypes.number, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 👍
- Changed query search icon - CopyToClipboard in action bar
57068b3
to
ee91ecd
Compare
…#1222) * fix(plugin-chart-table): fix table clear x-filtering highlighting issue * fix(plugin-chart-table): fix lint
…#1222) * fix(plugin-chart-table): fix table clear x-filtering highlighting issue * fix(plugin-chart-table): fix lint
…#1222) * fix(plugin-chart-table): fix table clear x-filtering highlighting issue * fix(plugin-chart-table): fix lint
…#1222) * fix(plugin-chart-table): fix table clear x-filtering highlighting issue * fix(plugin-chart-table): fix lint
Done:
Todo:
needs-review @ascott @bkyryliuk @mistercrunch