Skip to content

Commit

Permalink
fix drilldown in tsvb (elastic#78005)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Sep 24, 2020
1 parent 19d16cf commit e292d89
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
import _, { isArray, last, get } from 'lodash';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { RedirectAppLinks } from '../../../../../../kibana_react/public';
import { createTickFormatter } from '../../lib/tick_formatter';
import { calculateLabel } from '../../../../../../../plugins/vis_type_timeseries/common/calculate_label';
import { isSortable } from './is_sortable';
import { EuiToolTip, EuiIcon } from '@elastic/eui';
import { replaceVars } from '../../lib/replace_vars';
import { fieldFormats } from '../../../../../../../plugins/data/public';
import { FormattedMessage } from '@kbn/i18n/react';
import { getFieldFormats } from '../../../../services';
import { getFieldFormats, getCoreStart } from '../../../../services';

import { METRIC_TYPES } from '../../../../../../../plugins/vis_type_timeseries/common/metric_types';

Expand Down Expand Up @@ -231,12 +232,16 @@ export class TableVis extends Component {
);
}
return (
<div className="tvbVis" data-test-subj="tableView">
<RedirectAppLinks
application={getCoreStart().application}
className="tvbVis"
data-test-subj="tableView"
>
<table className="table">
<thead>{header}</thead>
<tbody>{rows}</tbody>
</table>
</div>
</RedirectAppLinks>
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/

import { getCoreStart } from '../../../../services';
import { createTickFormatter } from '../../lib/tick_formatter';
import { TopN } from '../../../visualizations/views/top_n';
import { getLastValue } from '../../../../../../../plugins/vis_type_timeseries/common/get_last_value';
Expand Down Expand Up @@ -89,7 +90,8 @@ export function TopNVisualization(props) {

if (model.drilldown_url) {
params.onClick = (item) => {
window.location = replaceVars(model.drilldown_url, {}, { key: item.label });
const url = replaceVars(model.drilldown_url, {}, { key: item.label });
getCoreStart().application.navigateToUrl(url);
};
}

Expand Down

0 comments on commit e292d89

Please sign in to comment.