mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[ML] Make sure anomalyChartRecords gets initialized as an Array. (#24021)
Fixes an issue where resizing the Anomaly Explorer window could trigger an error if the only job being loaded so far didn't have any anomalyChartRecords.
This commit is contained in:
parent
8fe71f888f
commit
81d22d2fea
2 changed files with 2 additions and 0 deletions
|
@ -19,6 +19,7 @@ describe('ML - Explorer Controller', () => {
|
|||
const scope = $rootScope.$new();
|
||||
$controller('MlExplorerController', { $scope: scope });
|
||||
|
||||
expect(Array.isArray(scope.anomalyChartRecords)).to.be(true);
|
||||
expect(scope.loading).to.be(true);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -81,6 +81,7 @@ module.controller('MlExplorerController', function (
|
|||
mlSelectIntervalService,
|
||||
mlSelectSeverityService) {
|
||||
|
||||
$scope.anomalyChartRecords = [];
|
||||
$scope.timeFieldName = 'timestamp';
|
||||
$scope.loading = true;
|
||||
timefilter.enableTimeRangeSelector();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue