mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[ML] Anomaly detection wizard: ensure custom urls test functionality works as expected (#165055)
## Summary Fixes https://github.com/elastic/kibana/issues/165051, ensuring the correct time range is used in the target Dashboard or Discover pages when testing custom URLs created in the Anomaly Detection job wizards. Previously on subsequent tests the page would always open to show `Last 15 minutes` rather than a time range for which there are documents in the data view used by the datafeed. This PR ensures the original job object is not affected when the datafeed is removed for sending off to the endpoint. --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
8fec1d100e
commit
501e9bda2a
1 changed files with 3 additions and 2 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import moment, { type Moment } from 'moment';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import type { SerializableRecord } from '@kbn/utility-types';
|
||||
import rison from '@kbn/rison';
|
||||
import url from 'url';
|
||||
|
@ -459,8 +460,8 @@ async function getAnomalyDetectionJobTestUrl(job: Job, customUrl: MlUrlConfig):
|
|||
// No anomalies yet for this job, so do a preview of the search
|
||||
// configured in the job datafeed to obtain sample docs.
|
||||
|
||||
let { datafeed_config: datafeedConfig } = job;
|
||||
let jobConfig = job;
|
||||
let jobConfig = cloneDeep(job);
|
||||
let { datafeed_config: datafeedConfig } = jobConfig;
|
||||
try {
|
||||
// attempt load the non-combined job and datafeed so they can be used in the datafeed preview
|
||||
const [{ jobs }, { datafeeds }] = await Promise.all([
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue