[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:
Melissa Alvarez 2019-01-30 10:35:53 -05:00 committed by GitHub
parent 9827900a9b
commit 9ca8c9fe67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

File diff suppressed because one or more lines are too long

View file

@ -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)} />;
}
});

View file

@ -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>`
);