mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[ML] Ensure Anomaly Explorer 'Overall' swimlane correctly reflects 'View by' swimlane time range selection (#29469)
* update swimlane classes - do not use angular reference * Update tests
This commit is contained in:
parent
9827900a9b
commit
9ca8c9fe67
3 changed files with 6 additions and 4 deletions
File diff suppressed because one or more lines are too long
|
@ -193,7 +193,7 @@ export const ExplorerSwimlane = injectI18n(class ExplorerSwimlane extends React.
|
|||
|
||||
if (swimlaneType === 'viewBy') {
|
||||
// If selecting a cell in the 'view by' swimlane, indicate the corresponding time in the Overall swimlane.
|
||||
const overallSwimlane = d3.select('ml-explorer-swimlane[swimlane-type="overall"]');
|
||||
const overallSwimlane = d3.select('.ml-swimlane-overall');
|
||||
times.forEach(time => {
|
||||
const overallCell = overallSwimlane.selectAll(`div[data-time="${time}"]`).selectAll('.sl-cell-inner,.sl-cell-inner-dragselect');
|
||||
overallCell.classed('sl-cell-inner-selected', true);
|
||||
|
@ -492,6 +492,8 @@ export const ExplorerSwimlane = injectI18n(class ExplorerSwimlane extends React.
|
|||
}
|
||||
|
||||
render() {
|
||||
return <div className="ml-swimlanes" ref={this.setRef.bind(this)} />;
|
||||
const { swimlaneType } = this.props;
|
||||
|
||||
return <div className={`ml-swimlanes ml-swimlane-${swimlaneType}`} ref={this.setRef.bind(this)} />;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -74,7 +74,7 @@ describe('ExplorerSwimlane', () => {
|
|||
/>);
|
||||
|
||||
expect(wrapper.html()).toBe(
|
||||
`<div class="ml-swimlanes"><div class="time-tick-labels"><svg width="${mockChartWidth}" height="25">` +
|
||||
`<div class="ml-swimlanes ml-swimlane-overall"><div class="time-tick-labels"><svg width="${mockChartWidth}" height="25">` +
|
||||
`<g class="x axis"><path class="domain" d="MNaN,6V0H0V6"></path></g></svg></div></div>`
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue