[ML] Removes unused filter bar from the Anomaly Explorer (#29817)

* [ML] Removes unused filter bar from the Anomaly Explorer

* [ML] Remove use of filters in URLs for explore series links

* [ML] Remove check for queryFilters from explorer controller test
This commit is contained in:
Pete Harverson 2019-02-01 14:20:58 +00:00 committed by GitHub
parent 22ca995911
commit c54d60061b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 3 additions and 31 deletions

View file

@ -162,7 +162,6 @@ const AnnotationsTable = injectI18n(class AnnotationsTable extends Component {
};
const appState = {
filters: [],
query: {
query_string: {
analyze_wildcard: true,

View file

@ -194,7 +194,6 @@ export const LinksMenu = injectI18n(class LinksMenu extends Component {
detectorIndex: record.detector_index,
entities: entityCondition,
},
filters: [],
query: {
query_string: {
analyze_wildcard: true,

View file

@ -20,7 +20,6 @@ describe('ML - Explorer Controller', () => {
$controller('MlExplorerController', { $scope: scope });
expect(Array.isArray(scope.jobs)).to.be(true);
expect(Array.isArray(scope.queryFilters)).to.be(true);
});
});
});

View file

@ -5,12 +5,5 @@
<job-select-button></job-select-button>
</navbar>
<filter-bar
class-name="'globalFilterGroup__filterBar'"
filters="queryFilters"
on-filters-updated="updateFilters"
index-patterns="indexPatterns"
></filter-bar>
<ml-explorer-react-wrapper />
</div>

View file

@ -19,7 +19,6 @@ import '../components/anomalies_table';
import '../components/controls';
import '../components/job_select_list';
import { FilterBarQueryFilterProvider } from 'ui/filter_bar/query_filter';
import template from './explorer.html';
import uiRoutes from 'ui/routes';
@ -76,7 +75,6 @@ module.controller('MlExplorerController', function (
// $scope should only contain what's actually still necessary for the angular part.
// For the moment that's the job selector and the (hidden) filter bar.
$scope.jobs = [];
$scope.queryFilters = [];
$scope.indexPatterns = $route.current ? $route.current.locals.indexPatterns.map(getFromSavedObject) : [];
timefilter.enableTimeRangeSelector();
timefilter.enableAutoRefreshSelector();
@ -85,7 +83,6 @@ module.controller('MlExplorerController', function (
const tzConfig = config.get('dateFormat:tz');
$scope.dateFormatTz = (tzConfig !== 'Browser') ? tzConfig : moment.tz.guess();
const queryFilter = Private(FilterBarQueryFilterProvider);
$scope.mlJobSelectService = Private(JobSelectServiceProvider);
$scope.MlTimeBuckets = Private(IntervalHelperProvider);
@ -99,11 +96,6 @@ module.controller('MlExplorerController', function (
return job;
});
$scope.updateFilters = filters => {
// The filters will automatically be set when the queryFilter emits an update event (see below)
queryFilter.setFilters(filters);
};
const selectedJobs = jobs.filter(job => job.selected);
function fieldFormatServiceCallback() {
@ -130,10 +122,9 @@ module.controller('MlExplorerController', function (
});
}
// Initialize the AppState in which to store filters and swimlane settings.
// Initialize the AppState in which to store swimlane settings.
// AppState is used to store state in the URL.
$scope.appState = new AppState({
filters: [],
mlExplorerSwimlane: {},
});
@ -248,13 +239,6 @@ module.controller('MlExplorerController', function (
$scope.$applyAsync();
});
// Refresh the data when the dashboard filters are updated.
$scope.$listen(queryFilter, 'update', () => {
// TODO - add in filtering functionality.
$scope.queryFilters = queryFilter.getFilters();
console.log('explorer_controller queryFilter update, filters:', $scope.queryFilters);
});
$scope.$on('$destroy', () => {
mlExplorerDashboardService.explorer.unwatch(loadJobsListener);
refreshWatcher.cancel();

View file

@ -101,7 +101,6 @@ class ForecastsTableUI extends Component {
});
const appState = {
filters: [],
query: {
query_string: {
analyze_wildcard: true,

View file

@ -875,7 +875,7 @@ function createResultsUrl(jobIds, start, end, resultsPage) {
path += `?_g=(ml:(jobIds:!(${idString}))`;
path += `,refreshInterval:(display:Off,pause:!f,value:0),time:(from:'${from}'`;
path += `,mode:absolute,to:'${to}'`;
path += '))&_a=(filters:!(),query:(query_string:(analyze_wildcard:!t,query:\'*\')))';
path += '))&_a=(query:(query_string:(analyze_wildcard:!t,query:\'*\')))';
return path;
}

View file

@ -202,7 +202,6 @@ export function getExploreSeriesLink(series) {
detectorIndex: series.detectorIndex,
entities: entityCondition,
},
filters: [],
query: {
query_string: {
analyze_wildcard: true,

View file

@ -67,7 +67,7 @@ describe('getExploreSeriesLink', () => {
const link = getExploreSeriesLink(seriesConfig);
const expectedLink = `<basepath>/app/ml#/timeseriesexplorer?_g=(ml:(jobIds:!(population-03)),` +
`refreshInterval:(display:Off,pause:!f,value:0),time:(from:'2017-02-23T00:00:00.000Z',mode:absolute,` +
`to:'2017-02-23T23:59:59.999Z'))&_a=(filters%3A!()%2CmlTimeSeriesExplorer%3A(detectorIndex%3A0%2Centities%3A` +
`to:'2017-02-23T23:59:59.999Z'))&_a=(mlTimeSeriesExplorer%3A(detectorIndex%3A0%2Centities%3A` +
`(nginx.access.remote_ip%3A'72.57.0.53')%2Czoom%3A(from%3A'2017-02-19T20%3A00%3A00.000Z'%2Cto%3A'2017-02-27T04%3A00%3A00.000Z'))` +
`%2Cquery%3A(query_string%3A(analyze_wildcard%3A!t%2Cquery%3A'*')))`;