Use correct environment in anomaly detection setup link (#91877)

This was still using `uiFilters.environment` instead of environment, so the warning would never show.
This commit is contained in:
Nathan L Smith 2021-02-18 13:58:55 -06:00 committed by GitHub
parent a82b13d147
commit 863a2d06a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,8 +30,9 @@ export type AnomalyDetectionApiResponse = APIReturnType<'GET /api/apm/settings/a
const DEFAULT_DATA = { jobs: [], hasLegacyJobs: false };
export function AnomalyDetectionSetupLink() {
const { uiFilters } = useUrlParams();
const environment = uiFilters.environment;
const {
urlParams: { environment },
} = useUrlParams();
const { core } = useApmPluginContext();
const canGetJobs = !!core.application.capabilities.ml?.canGetJobs;
const license = useLicenseContext();