mirror of
https://github.com/apache/superset.git
synced 2026-04-12 20:57:55 +00:00
Sort searched queries by recency (#1735)
* Sort searched queries by recency * Fixed sqllab tests * Add one more tr to QueryTable spec for pagination * Change desc to asc as we reverse queries in component
This commit is contained in:
@@ -65,14 +65,20 @@ class QueryTable extends React.PureComponent {
|
||||
removeQuery(query) {
|
||||
this.props.actions.removeQuery(query);
|
||||
}
|
||||
|
||||
render() {
|
||||
const data = this.props.queries.map((query) => {
|
||||
const q = Object.assign({}, query);
|
||||
if (q.endDttm) {
|
||||
q.duration = fDuration(q.startDttm, q.endDttm);
|
||||
}
|
||||
q.date = moment(q.startDttm).format('MMM Do YYYY');
|
||||
const time = moment(q.startDttm).format().split('T');
|
||||
q.time = (
|
||||
<div>
|
||||
<span>
|
||||
{time[0]} <br /> {time[1]}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
q.user = (
|
||||
<button
|
||||
className="btn btn-link btn-xs"
|
||||
@@ -188,6 +194,7 @@ class QueryTable extends React.PureComponent {
|
||||
columns={this.props.columns}
|
||||
className="table table-condensed"
|
||||
data={data}
|
||||
itemsPerPage={50}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user