From cf46ec995062b78894b94cd4b36142db2c2cc476 Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Fri, 29 Apr 2022 16:35:27 +0300 Subject: [PATCH 01/18] [TSVB] include/exclude values should be ignored for multi_terms (#130884) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../splits/__snapshots__/terms.test.js.snap | 2 ++ .../application/components/splits/terms.js | 6 ++-- .../series/split_by_terms.js | 13 ++++---- .../series/split_by_terms.test.js | 31 +++++++++++++++++++ 4 files changed, 44 insertions(+), 8 deletions(-) diff --git a/src/plugins/vis_types/timeseries/public/application/components/splits/__snapshots__/terms.test.js.snap b/src/plugins/vis_types/timeseries/public/application/components/splits/__snapshots__/terms.test.js.snap index b7c5095535fbc..fdfe472f46689 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/splits/__snapshots__/terms.test.js.snap +++ b/src/plugins/vis_types/timeseries/public/application/components/splits/__snapshots__/terms.test.js.snap @@ -90,6 +90,7 @@ exports[`src/legacy/core_plugins/metrics/public/components/splits/terms.test.js @@ -113,6 +114,7 @@ exports[`src/legacy/core_plugins/metrics/public/components/splits/terms.test.js diff --git a/src/plugins/vis_types/timeseries/public/application/components/splits/terms.js b/src/plugins/vis_types/timeseries/public/application/components/splits/terms.js index bfc31f7e46d48..071e91ffee981 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/splits/terms.js +++ b/src/plugins/vis_types/timeseries/public/application/components/splits/terms.js @@ -95,6 +95,8 @@ export const SplitByTermsUI = ({ (selectedOptions) => { onChange({ terms_field: selectedOptions.length === 1 ? selectedOptions[0] : selectedOptions, + terms_include: undefined, + terms_exclude: undefined, }); }, [onChange] @@ -174,7 +176,7 @@ export const SplitByTermsUI = ({ } > @@ -191,7 +193,7 @@ export const SplitByTermsUI = ({ } > diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/request_processors/series/split_by_terms.js b/src/plugins/vis_types/timeseries/server/lib/vis_data/request_processors/series/split_by_terms.js index 07e8ef4a0e5fd..d093019fee3d8 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/request_processors/series/split_by_terms.js +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/request_processors/series/split_by_terms.js @@ -37,15 +37,16 @@ export function splitByTerms(req, panel, series, esQueryConfig, seriesIndex) { ); } else { overwrite(doc, `aggs.${series.id}.${termsType}.field`, termsIds[0]); + if (series.terms_include) { + overwrite(doc, `aggs.${series.id}.${termsType}.include`, series.terms_include); + } + if (series.terms_exclude) { + overwrite(doc, `aggs.${series.id}.${termsType}.exclude`, series.terms_exclude); + } } overwrite(doc, `aggs.${series.id}.${termsType}.size`, series.terms_size); - if (series.terms_include) { - overwrite(doc, `aggs.${series.id}.${termsType}.include`, series.terms_include); - } - if (series.terms_exclude) { - overwrite(doc, `aggs.${series.id}.${termsType}.exclude`, series.terms_exclude); - } + if (metric && metric.type !== 'count' && ~basicAggs.indexOf(metric.type)) { const sortAggKey = `${orderByTerms}-SORT`; const fn = bucketTransform[metric.type]; diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/request_processors/series/split_by_terms.test.js b/src/plugins/vis_types/timeseries/server/lib/vis_data/request_processors/series/split_by_terms.test.js index 984eb385ca4a6..0795e3390eb2f 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/request_processors/series/split_by_terms.test.js +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/request_processors/series/split_by_terms.test.js @@ -111,6 +111,37 @@ describe('splitByTerms', () => { }); }); + test('should ignore "include/exclude" for multi terms', () => { + series.terms_include = 'a'; + series.terms_exclude = 'b'; + series.terms_field = ['c', 'd']; + const next = jest.fn((doc) => doc); + const doc = splitByTerms(req, panel, series, config, seriesIndex)(next)({}); + + expect(doc).toMatchInlineSnapshot(` + Object { + "aggs": Object { + "test": Object { + "multi_terms": Object { + "order": Object { + "_count": "desc", + }, + "size": 10, + "terms": Array [ + Object { + "field": "c", + }, + Object { + "field": "d", + }, + ], + }, + }, + }, + } + `); + }); + test('calls next and does not add a terms agg', () => { series.split_mode = 'everything'; const next = jest.fn((doc) => doc); From 9d15ab1ec2dc29b9b8014fade9255233e48062f0 Mon Sep 17 00:00:00 2001 From: Ying Mao Date: Fri, 29 Apr 2022 09:35:39 -0400 Subject: [PATCH 02/18] [Connector] API for adding OAuth support to ServiceNow connectors (#131084) * Adding new OAuth fields to ServiceNow ExternalIncidentServiceConfigurationBase and ExternalIncidentServiceSecretConfiguration * Creating new function in ConnectorTokenClient for updating or replacing token * Update servicenow executors to get Oauth access tokens if configured. Still need to update unit tests for services * Creating wrapper function for createService to only create one axios instance * Fixing translation check error * Adding migration for adding isOAuth to service now connectors * Fixing unit tests * Fixing functional test * Not requiring privateKeyPassword * Fixing tests * Adding functional tests for connector creation * Adding functional tests * Fixing functional test * PR feedback * Fixing test * PR feedback Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../lib/connector_token_client.mock.ts | 1 + .../lib/connector_token_client.test.ts | 141 ++++++ .../lib/connector_token_client.ts | 39 ++ .../lib/create_jwt_assertion.test.ts | 24 ++ .../lib/create_jwt_assertion.ts | 20 +- .../lib/send_email.test.ts | 2 +- .../builtin_action_types/lib/send_email.ts | 31 +- .../servicenow/create_service_wrapper.test.ts | 89 ++++ .../servicenow/create_service_wrapper.ts | 54 +++ .../builtin_action_types/servicenow/index.ts | 31 +- .../builtin_action_types/servicenow/schema.ts | 11 +- .../servicenow/service.test.ts | 360 ++++++++++++---- .../servicenow/service.ts | 46 +- .../servicenow/service_itom.test.ts | 11 +- .../servicenow/service_itom.ts | 35 +- .../servicenow/service_sir.test.ts | 11 +- .../servicenow/service_sir.ts | 37 +- .../servicenow/translations.ts | 39 ++ .../builtin_action_types/servicenow/types.ts | 24 +- .../servicenow/utils.test.ts | 310 +++++++++++++- .../builtin_action_types/servicenow/utils.ts | 141 +++++- .../servicenow/validators.test.ts | 401 ++++++++++++++++++ .../servicenow/validators.ts | 92 +++- .../saved_objects/actions_migrations.test.ts | 60 ++- .../saved_objects/actions_migrations.ts | 33 ++ .../builtin_action_types/servicenow_itom.ts | 232 +++++++++- .../builtin_action_types/servicenow_itsm.ts | 258 +++++++++-- .../builtin_action_types/servicenow_sir.ts | 251 ++++++++++- .../spaces_only/tests/actions/migrations.ts | 18 + .../cases_api_integration/common/lib/utils.ts | 19 +- .../tests/trial/configure/get_connectors.ts | 36 +- .../tests/trial/configure/get_connectors.ts | 45 +- .../functional/es_archives/actions/data.json | 92 ++++ 33 files changed, 2695 insertions(+), 299 deletions(-) create mode 100644 x-pack/plugins/actions/server/builtin_action_types/servicenow/create_service_wrapper.test.ts create mode 100644 x-pack/plugins/actions/server/builtin_action_types/servicenow/create_service_wrapper.ts create mode 100644 x-pack/plugins/actions/server/builtin_action_types/servicenow/validators.test.ts diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.mock.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.mock.ts index 71d0a2f4466a4..4b38f6fcb53e6 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.mock.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.mock.ts @@ -14,6 +14,7 @@ const createConnectorTokenClientMock = () => { get: jest.fn(), update: jest.fn(), deleteConnectorTokens: jest.fn(), + updateOrReplace: jest.fn(), }; return mocked; }; diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.test.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.test.ts index e3e9f3b362ae9..54765b9e01b8f 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.test.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.test.ts @@ -357,3 +357,144 @@ describe('delete()', () => { `); }); }); + +describe('updateOrReplace()', () => { + test('creates new SO if current token is null', async () => { + unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ + id: '1', + type: 'connector_token', + attributes: { + connectorId: '123', + tokenType: 'access_token', + token: 'testtokenvalue', + expiresAt: new Date().toISOString(), + }, + references: [], + }); + await connectorTokenClient.updateOrReplace({ + connectorId: '1', + token: null, + newToken: 'newToken', + expiresInSec: 1000, + deleteExisting: false, + }); + expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledTimes(1); + expect((unsecuredSavedObjectsClient.create.mock.calls[0][1] as ConnectorToken).token).toBe( + 'newToken' + ); + + expect(unsecuredSavedObjectsClient.find).not.toHaveBeenCalled(); + expect(unsecuredSavedObjectsClient.delete).not.toHaveBeenCalled(); + }); + + test('creates new SO and deletes all existing tokens for connector if current token is null and deleteExisting is true', async () => { + unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ + id: '1', + type: 'connector_token', + attributes: { + connectorId: '123', + tokenType: 'access_token', + token: 'testtokenvalue', + expiresAt: new Date().toISOString(), + }, + references: [], + }); + unsecuredSavedObjectsClient.find.mockResolvedValueOnce({ + total: 1, + per_page: 10, + page: 1, + saved_objects: [ + { + id: '1', + type: 'connector_token', + attributes: { + connectorId: '123', + tokenType: 'access_token', + createdAt: new Date().toISOString(), + expiresAt: new Date().toISOString(), + }, + score: 1, + references: [], + }, + { + id: '2', + type: 'connector_token', + attributes: { + connectorId: '123', + tokenType: 'access_token', + createdAt: new Date().toISOString(), + expiresAt: new Date().toISOString(), + }, + score: 1, + references: [], + }, + ], + }); + await connectorTokenClient.updateOrReplace({ + connectorId: '1', + token: null, + newToken: 'newToken', + expiresInSec: 1000, + deleteExisting: true, + }); + expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledTimes(1); + expect((unsecuredSavedObjectsClient.create.mock.calls[0][1] as ConnectorToken).token).toBe( + 'newToken' + ); + + expect(unsecuredSavedObjectsClient.find).toHaveBeenCalledTimes(1); + expect(unsecuredSavedObjectsClient.delete).toHaveBeenCalledTimes(2); + }); + + test('updates existing SO if current token exists', async () => { + unsecuredSavedObjectsClient.get.mockResolvedValueOnce({ + id: '1', + type: 'connector_token', + attributes: { + connectorId: '123', + tokenType: 'access_token', + token: 'testtokenvalue', + createdAt: new Date().toISOString(), + }, + references: [], + }); + unsecuredSavedObjectsClient.checkConflicts.mockResolvedValueOnce({ + errors: [], + }); + unsecuredSavedObjectsClient.create.mockResolvedValueOnce({ + id: '1', + type: 'connector_token', + attributes: { + connectorId: '123', + tokenType: 'access_token', + token: 'testtokenvalue', + expiresAt: new Date().toISOString(), + }, + references: [], + }); + await connectorTokenClient.updateOrReplace({ + connectorId: '1', + token: { + id: '3', + connectorId: '123', + tokenType: 'access_token', + token: 'testtokenvalue', + createdAt: new Date().toISOString(), + expiresAt: new Date().toISOString(), + }, + newToken: 'newToken', + expiresInSec: 1000, + deleteExisting: true, + }); + + expect(unsecuredSavedObjectsClient.find).not.toHaveBeenCalled(); + expect(unsecuredSavedObjectsClient.delete).not.toHaveBeenCalled(); + + expect(unsecuredSavedObjectsClient.get).toHaveBeenCalledTimes(1); + expect(unsecuredSavedObjectsClient.checkConflicts).toHaveBeenCalledTimes(1); + expect(unsecuredSavedObjectsClient.create).toHaveBeenCalledTimes(1); + expect((unsecuredSavedObjectsClient.create.mock.calls[0][1] as ConnectorToken).token).toBe( + 'newToken' + ); + }); +}); diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.ts index 949ec855ee3f0..6ce91fad94546 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.ts @@ -33,6 +33,13 @@ export interface UpdateOptions { tokenType?: string; } +interface UpdateOrReplaceOptions { + connectorId: string; + token: ConnectorToken | null; + newToken: string; + expiresInSec: number; + deleteExisting: boolean; +} export class ConnectorTokenClient { private readonly logger: Logger; private readonly unsecuredSavedObjectsClient: SavedObjectsClientContract; @@ -245,4 +252,36 @@ export class ConnectorTokenClient { throw err; } } + + public async updateOrReplace({ + connectorId, + token, + newToken, + expiresInSec, + deleteExisting, + }: UpdateOrReplaceOptions) { + expiresInSec = expiresInSec ?? 3600; + if (token === null) { + if (deleteExisting) { + await this.deleteConnectorTokens({ + connectorId, + tokenType: 'access_token', + }); + } + + await this.create({ + connectorId, + token: newToken, + expiresAtMillis: new Date(Date.now() + expiresInSec * 1000).toISOString(), + tokenType: 'access_token', + }); + } else { + await this.update({ + id: token.id!.toString(), + token: newToken, + expiresAtMillis: new Date(Date.now() + expiresInSec * 1000).toISOString(), + tokenType: 'access_token', + }); + } + } } diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/create_jwt_assertion.test.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/create_jwt_assertion.test.ts index d68cc9a5e4398..d679564c82472 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/lib/create_jwt_assertion.test.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/create_jwt_assertion.test.ts @@ -17,6 +17,8 @@ import { createJWTAssertion } from './create_jwt_assertion'; const jwtSign = jwt.sign as jest.Mock; const mockLogger = loggingSystemMock.create().get() as jest.Mocked; +Date.now = jest.fn(() => 0); + describe('createJWTAssertion', () => { test('creating a JWT token from provided claims with default values', () => { jwtSign.mockReturnValueOnce('123456qwertyjwttoken'); @@ -27,6 +29,28 @@ describe('createJWTAssertion', () => { subject: 'test@gmail.com', }); + expect(jwtSign).toHaveBeenCalledWith( + { aud: '1', exp: 3600, iat: 0, iss: 'someappid', sub: 'test@gmail.com' }, + { key: 'test', passphrase: '123456' }, + { algorithm: 'RS256' } + ); + expect(assertion).toMatchInlineSnapshot('"123456qwertyjwttoken"'); + }); + + test('creating a JWT token when private key password is null', () => { + jwtSign.mockReturnValueOnce('123456qwertyjwttoken'); + + const assertion = createJWTAssertion(mockLogger, 'test', null, { + audience: '1', + issuer: 'someappid', + subject: 'test@gmail.com', + }); + + expect(jwtSign).toHaveBeenCalledWith( + { aud: '1', exp: 3600, iat: 0, iss: 'someappid', sub: 'test@gmail.com' }, + 'test', + { algorithm: 'RS256' } + ); expect(assertion).toMatchInlineSnapshot('"123456qwertyjwttoken"'); }); diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/create_jwt_assertion.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/create_jwt_assertion.ts index f4723e59b418c..b33a2d17ed9d8 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/lib/create_jwt_assertion.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/create_jwt_assertion.ts @@ -12,18 +12,18 @@ export interface JWTClaims { audience: string; subject: string; issuer: string; - expireInMilisecons?: number; + expireInMilliseconds?: number; keyId?: string; } export function createJWTAssertion( logger: Logger, privateKey: string, - privateKeyPassword: string, + privateKeyPassword: string | null, reservedClaims: JWTClaims, customClaims?: Record ): string { - const { subject, audience, issuer, expireInMilisecons, keyId } = reservedClaims; + const { subject, audience, issuer, expireInMilliseconds, keyId } = reservedClaims; const iat = Math.floor(Date.now() / 1000); const headerObj = { algorithm: 'RS256' as Algorithm, ...(keyId ? { keyid: keyId } : {}) }; @@ -33,17 +33,19 @@ export function createJWTAssertion( aud: audience, // audience claim identifies the recipients that the JWT is intended for iss: issuer, // issuer claim identifies the principal that issued the JWT iat, // issued at claim identifies the time at which the JWT was issued - exp: iat + (expireInMilisecons ?? 3600), // expiration time claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing + exp: iat + (expireInMilliseconds ?? 3600), // expiration time claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing ...(customClaims ?? {}), }; try { const jwtToken = jwt.sign( - JSON.stringify(payloadObj), - { - key: privateKey, - passphrase: privateKeyPassword, - }, + payloadObj, + privateKeyPassword + ? { + key: privateKey, + passphrase: privateKeyPassword, + } + : privateKey, headerObj ); return jwtToken; diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.test.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.test.ts index 8c36113032461..1d1c2c46cb0e4 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.test.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.test.ts @@ -601,7 +601,7 @@ describe('send_email module', () => { await sendEmail(mockLogger, sendEmailOptions, connectorTokenClientM); expect(requestOAuthClientCredentialsTokenMock.mock.calls.length).toBe(1); - expect(connectorTokenClientM.deleteConnectorTokens.mock.calls.length).toBe(1); + expect(connectorTokenClientM.updateOrReplace.mock.calls.length).toBe(1); delete sendEmailGraphApiMock.mock.calls[0][0].options.configurationUtilities; sendEmailGraphApiMock.mock.calls[0].pop(); diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.ts index a664b22f9df34..983846adc71e0 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.ts @@ -105,30 +105,13 @@ async function sendEmailWithExchange( // try to update connector_token SO try { - if (connectorToken === null) { - if (hasErrors) { - // delete existing access tokens - await connectorTokenClient.deleteConnectorTokens({ - connectorId, - tokenType: 'access_token', - }); - } - await connectorTokenClient.create({ - connectorId, - token: accessToken, - // convert MS Exchange expiresIn from seconds to milliseconds - expiresAtMillis: new Date(Date.now() + tokenResult.expiresIn * 1000).toISOString(), - tokenType: 'access_token', - }); - } else { - await connectorTokenClient.update({ - id: connectorToken.id!.toString(), - token: accessToken, - // convert MS Exchange expiresIn from seconds to milliseconds - expiresAtMillis: new Date(Date.now() + tokenResult.expiresIn * 1000).toISOString(), - tokenType: 'access_token', - }); - } + await connectorTokenClient.updateOrReplace({ + connectorId, + token: connectorToken, + newToken: accessToken, + expiresInSec: tokenResult.expiresIn, + deleteExisting: hasErrors, + }); } catch (err) { logger.warn( `Not able to update connector token for connectorId: ${connectorId} due to error: ${err.message}` diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/create_service_wrapper.test.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/create_service_wrapper.test.ts new file mode 100644 index 0000000000000..37ada260c75a9 --- /dev/null +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/create_service_wrapper.test.ts @@ -0,0 +1,89 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import axios from 'axios'; +import { createServiceWrapper } from './create_service_wrapper'; +import { Logger } from '@kbn/core/server'; +import { loggingSystemMock } from '@kbn/core/server/mocks'; +import { actionsConfigMock } from '../../actions_config.mock'; +import { connectorTokenClientMock } from '../lib/connector_token_client.mock'; +import { snExternalServiceConfig } from './config'; + +const logger = loggingSystemMock.create().get() as jest.Mocked; +const connectorTokenClient = connectorTokenClientMock.create(); +const configurationUtilities = actionsConfigMock.create(); + +jest.mock('axios'); +axios.create = jest.fn(() => axios); + +describe('createServiceWrapper', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + test('creates axios instance with apiUrl', () => { + const createServiceFn = jest.fn(); + const credentials = { + config: { + apiUrl: 'https://test-sn.service-now.com', + }, + secrets: { + username: 'username', + password: 'password', + }, + }; + const serviceConfig = snExternalServiceConfig['.servicenow']; + createServiceWrapper({ + connectorId: '123', + credentials, + logger, + configurationUtilities, + serviceConfig, + connectorTokenClient, + createServiceFn, + }); + + expect(createServiceFn).toHaveBeenCalledWith({ + credentials, + logger, + configurationUtilities, + serviceConfig, + axiosInstance: axios, + }); + }); + + test('handles apiUrl with trailing slash', () => { + const createServiceFn = jest.fn(); + const credentials = { + config: { + apiUrl: 'https://test-sn.service-now.com/', + }, + secrets: { + username: 'username', + password: 'password', + }, + }; + const serviceConfig = snExternalServiceConfig['.servicenow']; + createServiceWrapper({ + connectorId: '123', + credentials, + logger, + configurationUtilities, + serviceConfig, + connectorTokenClient, + createServiceFn, + }); + + expect(createServiceFn).toHaveBeenCalledWith({ + credentials, + logger, + configurationUtilities, + serviceConfig, + axiosInstance: axios, + }); + }); +}); diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/create_service_wrapper.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/create_service_wrapper.ts new file mode 100644 index 0000000000000..cd431027a720f --- /dev/null +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/create_service_wrapper.ts @@ -0,0 +1,54 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Logger } from '@kbn/core/server'; +import { ExternalService, ExternalServiceCredentials, SNProductsConfigValue } from './types'; + +import { ServiceNowPublicConfigurationType, ServiceFactory } from './types'; +import { ActionsConfigurationUtilities } from '../../actions_config'; +import { getAxiosInstance } from './utils'; +import { ConnectorTokenClientContract } from '../../types'; + +interface CreateServiceWrapperOpts { + connectorId: string; + credentials: ExternalServiceCredentials; + logger: Logger; + configurationUtilities: ActionsConfigurationUtilities; + serviceConfig: SNProductsConfigValue; + connectorTokenClient: ConnectorTokenClientContract; + createServiceFn: ServiceFactory; +} + +export function createServiceWrapper({ + connectorId, + credentials, + logger, + configurationUtilities, + serviceConfig, + connectorTokenClient, + createServiceFn, +}: CreateServiceWrapperOpts): T { + const { config } = credentials; + const { apiUrl: url } = config as ServiceNowPublicConfigurationType; + const urlWithoutTrailingSlash = url.endsWith('/') ? url.slice(0, -1) : url; + const axiosInstance = getAxiosInstance({ + connectorId, + logger, + configurationUtilities, + credentials, + snServiceUrl: urlWithoutTrailingSlash, + connectorTokenClient, + }); + + return createServiceFn({ + credentials, + logger, + configurationUtilities, + serviceConfig, + axiosInstance, + }); +} diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/index.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/index.ts index e22c65a3694bb..17a3b1982f487 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/index.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/index.ts @@ -39,6 +39,7 @@ import { ExternalServiceApiITOM, ExternalServiceITOM, ServiceNowPublicConfigurationBaseType, + ExternalService, } from './types'; import { ServiceNowITOMActionTypeId, @@ -53,6 +54,7 @@ import { apiSIR } from './api_sir'; import { throwIfSubActionIsNotSupported } from './utils'; import { createExternalServiceITOM } from './service_itom'; import { apiITOM } from './api_itom'; +import { createServiceWrapper } from './create_service_wrapper'; export { ServiceNowITSMActionTypeId, @@ -97,6 +99,7 @@ export function getServiceNowITSMActionType( secrets: schema.object(ExternalIncidentServiceSecretConfiguration, { validate: curry(validate.secrets)(configurationUtilities), }), + connector: validate.connector, params: ExecutorParamsSchemaITSM, }, executor: curry(executor)({ @@ -124,6 +127,7 @@ export function getServiceNowSIRActionType( secrets: schema.object(ExternalIncidentServiceSecretConfiguration, { validate: curry(validate.secrets)(configurationUtilities), }), + connector: validate.connector, params: ExecutorParamsSchemaSIR, }, executor: curry(executor)({ @@ -151,6 +155,7 @@ export function getServiceNowITOMActionType( secrets: schema.object(ExternalIncidentServiceSecretConfiguration, { validate: curry(validate.secrets)(configurationUtilities), }), + connector: validate.connector, params: ExecutorParamsSchemaITOM, }, executor: curry(executorITOM)({ @@ -184,20 +189,24 @@ async function executor( ExecutorParams > ): Promise> { - const { actionId, config, params, secrets } = execOptions; + const { actionId, config, params, secrets, services } = execOptions; const { subAction, subActionParams } = params; + const connectorTokenClient = services.connectorTokenClient; const externalServiceConfig = snExternalServiceConfig[actionTypeId]; let data: ServiceNowExecutorResultData | null = null; - const externalService = createService( - { + const externalService = createServiceWrapper({ + connectorId: actionId, + credentials: { config, secrets, }, logger, configurationUtilities, - externalServiceConfig - ); + serviceConfig: externalServiceConfig, + connectorTokenClient, + createServiceFn: createService, + }); const apiAsRecord = api as unknown as Record; throwIfSubActionIsNotSupported({ api: apiAsRecord, subAction, supportedSubActions, logger }); @@ -260,18 +269,22 @@ async function executorITOM( ): Promise> { const { actionId, config, params, secrets } = execOptions; const { subAction, subActionParams } = params; + const connectorTokenClient = execOptions.services.connectorTokenClient; const externalServiceConfig = snExternalServiceConfig[actionTypeId]; let data: ServiceNowExecutorResultData | null = null; - const externalService = createService( - { + const externalService = createServiceWrapper({ + connectorId: actionId, + credentials: { config, secrets, }, logger, configurationUtilities, - externalServiceConfig - ) as ExternalServiceITOM; + serviceConfig: externalServiceConfig, + connectorTokenClient, + createServiceFn: createService, + }); const apiAsRecord = api as unknown as Record; diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/schema.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/schema.ts index e41eea24834c7..5f5ea6ab0ff93 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/schema.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/schema.ts @@ -10,6 +10,10 @@ import { DEFAULT_ALERTS_GROUPING_KEY } from './config'; export const ExternalIncidentServiceConfigurationBase = { apiUrl: schema.string(), + isOAuth: schema.boolean({ defaultValue: false }), + userIdentifierValue: schema.nullable(schema.string()), // required if isOAuth = true + clientId: schema.nullable(schema.string()), // required if isOAuth = true + jwtKeyId: schema.nullable(schema.string()), // required if isOAuth = true }; export const ExternalIncidentServiceConfiguration = { @@ -26,8 +30,11 @@ export const ExternalIncidentServiceConfigurationSchema = schema.object( ); export const ExternalIncidentServiceSecretConfiguration = { - password: schema.string(), - username: schema.string(), + password: schema.nullable(schema.string()), // required if isOAuth = false + username: schema.nullable(schema.string()), // required if isOAuth = false + clientSecret: schema.nullable(schema.string()), // required if isOAuth = true + privateKey: schema.nullable(schema.string()), // required if isOAuth = true + privateKeyPassword: schema.nullable(schema.string()), }; export const ExternalIncidentServiceSecretConfigurationSchema = schema.object( diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/service.test.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/service.test.ts index c179277956aa9..68fa57e93f31b 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/service.test.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/service.test.ts @@ -147,64 +147,240 @@ describe('ServiceNow service', () => { let service: ExternalService; beforeEach(() => { - service = createExternalService( - { + jest.clearAllMocks(); + service = createExternalService({ + credentials: { // The trailing slash at the end of the url is intended. // All API calls need to have the trailing slash removed. - config: { apiUrl: 'https://example.com/' }, + config: { apiUrl: 'https://example.com/', isOAuth: false }, secrets: { username: 'admin', password: 'admin' }, }, logger, configurationUtilities, - snExternalServiceConfig['.servicenow'] - ); - }); - - beforeEach(() => { - jest.clearAllMocks(); + serviceConfig: snExternalServiceConfig['.servicenow'], + axiosInstance: axios, + }); }); describe('createExternalService', () => { test('throws without url', () => { expect(() => - createExternalService( - { - config: { apiUrl: null }, + createExternalService({ + credentials: { + config: { apiUrl: null, isOAuth: false }, secrets: { username: 'admin', password: 'admin' }, }, logger, configurationUtilities, - snExternalServiceConfig['.servicenow'] - ) + serviceConfig: snExternalServiceConfig['.servicenow'], + axiosInstance: axios, + }) ).toThrow(); }); - test('throws without username', () => { - expect(() => - createExternalService( - { - config: { apiUrl: 'test.com' }, - secrets: { username: '', password: 'admin' }, - }, - logger, - configurationUtilities, - snExternalServiceConfig['.servicenow'] - ) - ).toThrow(); + test('throws when isOAuth is false and basic auth required values are falsy', () => { + const badBasicCredentials = [ + { + config: { apiUrl: 'test.com', isOAuth: false }, + secrets: { username: '', password: 'admin' }, + }, + { + config: { apiUrl: 'test.com', isOAuth: false }, + secrets: { username: null, password: 'admin' }, + }, + { + config: { apiUrl: 'test.com', isOAuth: false }, + secrets: { password: 'admin' }, + }, + { + config: { apiUrl: 'test.com', isOAuth: false }, + secrets: { username: 'admin', password: '' }, + }, + { + config: { apiUrl: 'test.com', isOAuth: false }, + secrets: { username: 'admin', password: null }, + }, + { + config: { apiUrl: 'test.com', isOAuth: false }, + secrets: { username: 'admin' }, + }, + ]; + + badBasicCredentials.forEach((badCredentials) => { + expect(() => + createExternalService({ + credentials: badCredentials, + logger, + configurationUtilities, + serviceConfig: snExternalServiceConfig['.servicenow'], + axiosInstance: axios, + }) + ).toThrow(); + }); }); - test('throws without password', () => { - expect(() => - createExternalService( - { - config: { apiUrl: 'test.com' }, - secrets: { username: '', password: undefined }, + test('throws when isOAuth is true and OAuth required values are falsy', () => { + const badOAuthCredentials = [ + { + config: { + apiUrl: 'test.com', + isOAuth: true, + clientId: '', + jwtKeyId: 'jwtKeyId', + userIdentifierValue: 'user@email.com', }, - logger, - configurationUtilities, - snExternalServiceConfig['.servicenow'] - ) - ).toThrow(); + secrets: { clientSecret: 'clientSecret', privateKey: 'privateKey' }, + }, + { + config: { + apiUrl: 'test.com', + isOAuth: true, + clientId: null, + jwtKeyId: 'jwtKeyId', + userIdentifierValue: 'user@email.com', + }, + secrets: { clientSecret: 'clientSecret', privateKey: 'privateKey' }, + }, + { + config: { + apiUrl: 'test.com', + isOAuth: true, + jwtKeyId: 'jwtKeyId', + userIdentifierValue: 'user@email.com', + }, + secrets: { clientSecret: 'clientSecret', privateKey: 'privateKey' }, + }, + { + config: { + apiUrl: 'test.com', + isOAuth: true, + clientId: 'clientId', + jwtKeyId: '', + userIdentifierValue: 'user@email.com', + }, + secrets: { clientSecret: 'clientSecret', privateKey: 'privateKey' }, + }, + { + config: { + apiUrl: 'test.com', + isOAuth: true, + clientId: 'clientId', + jwtKeyId: null, + userIdentifierValue: 'user@email.com', + }, + secrets: { clientSecret: 'clientSecret', privateKey: 'privateKey' }, + }, + { + config: { + apiUrl: 'test.com', + isOAuth: true, + clientId: 'clientId', + userIdentifierValue: 'user@email.com', + }, + secrets: { clientSecret: 'clientSecret', privateKey: 'privateKey' }, + }, + { + config: { + apiUrl: 'test.com', + isOAuth: true, + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + userIdentifierValue: '', + }, + secrets: { clientSecret: 'clientSecret', privateKey: 'privateKey' }, + }, + { + config: { + apiUrl: 'test.com', + isOAuth: true, + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + userIdentifierValue: null, + }, + secrets: { clientSecret: 'clientSecret', privateKey: 'privateKey' }, + }, + { + config: { + apiUrl: 'test.com', + isOAuth: true, + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + }, + secrets: { clientSecret: 'clientSecret', privateKey: 'privateKey' }, + }, + { + config: { + apiUrl: 'test.com', + isOAuth: true, + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + userIdentifierValue: 'user@email.com', + }, + secrets: { clientSecret: '', privateKey: 'privateKey' }, + }, + { + config: { + apiUrl: 'test.com', + isOAuth: true, + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + userIdentifierValue: 'user@email.com', + }, + secrets: { clientSecret: null, privateKey: 'privateKey' }, + }, + { + config: { + apiUrl: 'test.com', + isOAuth: true, + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + userIdentifierValue: 'user@email.com', + }, + secrets: { privateKey: 'privateKey' }, + }, + { + config: { + apiUrl: 'test.com', + isOAuth: true, + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + userIdentifierValue: 'user@email.com', + }, + secrets: { clientSecret: 'clientSecret', privateKey: '' }, + }, + { + config: { + apiUrl: 'test.com', + isOAuth: true, + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + userIdentifierValue: 'user@email.com', + }, + secrets: { clientSecret: 'clientSecret', privateKey: null }, + }, + { + config: { + apiUrl: 'test.com', + isOAuth: true, + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + userIdentifierValue: 'user@email.com', + }, + secrets: { clientSecret: 'clientSecret' }, + }, + ]; + + badOAuthCredentials.forEach((badCredentials) => { + expect(() => + createExternalService({ + credentials: badCredentials, + logger, + configurationUtilities, + serviceConfig: snExternalServiceConfig['.servicenow'], + axiosInstance: axios, + }) + ).toThrow(); + }); }); }); @@ -233,15 +409,16 @@ describe('ServiceNow service', () => { }); test('it should call request with correct arguments when table changes', async () => { - service = createExternalService( - { - config: { apiUrl: 'https://example.com/' }, + service = createExternalService({ + credentials: { + config: { apiUrl: 'https://example.com/', isOAuth: false }, secrets: { username: 'admin', password: 'admin' }, }, logger, configurationUtilities, - { ...snExternalServiceConfig['.servicenow'], table: 'sn_si_incident' } - ); + serviceConfig: { ...snExternalServiceConfig['.servicenow'], table: 'sn_si_incident' }, + axiosInstance: axios, + }); requestMock.mockImplementation(() => ({ data: { result: { sys_id: '1', number: 'INC01' } }, @@ -298,15 +475,16 @@ describe('ServiceNow service', () => { }); test('it should call request with correct arguments when table changes', async () => { - service = createExternalService( - { - config: { apiUrl: 'https://example.com/' }, + service = createExternalService({ + credentials: { + config: { apiUrl: 'https://example.com/', isOAuth: false }, secrets: { username: 'admin', password: 'admin' }, }, logger, configurationUtilities, - snExternalServiceConfig['.servicenow-sir'] - ); + serviceConfig: snExternalServiceConfig['.servicenow-sir'], + axiosInstance: axios, + }); const res = await createIncident(service); @@ -382,15 +560,16 @@ describe('ServiceNow service', () => { // old connectors describe('table API', () => { beforeEach(() => { - service = createExternalService( - { - config: { apiUrl: 'https://example.com/' }, + service = createExternalService({ + credentials: { + config: { apiUrl: 'https://example.com/', isOAuth: false }, secrets: { username: 'admin', password: 'admin' }, }, logger, configurationUtilities, - { ...snExternalServiceConfig['.servicenow'], useImportAPI: false } - ); + serviceConfig: { ...snExternalServiceConfig['.servicenow'], useImportAPI: false }, + axiosInstance: axios, + }); }); test('it creates the incident correctly', async () => { @@ -418,15 +597,16 @@ describe('ServiceNow service', () => { }); test('it should call request with correct arguments when table changes', async () => { - service = createExternalService( - { - config: { apiUrl: 'https://example.com/' }, + service = createExternalService({ + credentials: { + config: { apiUrl: 'https://example.com/', isOAuth: false }, secrets: { username: 'admin', password: 'admin' }, }, logger, configurationUtilities, - { ...snExternalServiceConfig['.servicenow-sir'], useImportAPI: false } - ); + serviceConfig: { ...snExternalServiceConfig['.servicenow-sir'], useImportAPI: false }, + axiosInstance: axios, + }); mockIncidentResponse(false); @@ -468,15 +648,16 @@ describe('ServiceNow service', () => { }); test('it should call request with correct arguments when table changes', async () => { - service = createExternalService( - { - config: { apiUrl: 'https://example.com/' }, + service = createExternalService({ + credentials: { + config: { apiUrl: 'https://example.com/', isOAuth: false }, secrets: { username: 'admin', password: 'admin' }, }, logger, configurationUtilities, - snExternalServiceConfig['.servicenow-sir'] - ); + serviceConfig: snExternalServiceConfig['.servicenow-sir'], + axiosInstance: axios, + }); const res = await updateIncident(service); expect(requestMock).toHaveBeenNthCalledWith(1, { @@ -554,15 +735,16 @@ describe('ServiceNow service', () => { // old connectors describe('table API', () => { beforeEach(() => { - service = createExternalService( - { - config: { apiUrl: 'https://example.com/' }, + service = createExternalService({ + credentials: { + config: { apiUrl: 'https://example.com/', isOAuth: false }, secrets: { username: 'admin', password: 'admin' }, }, logger, configurationUtilities, - { ...snExternalServiceConfig['.servicenow'], useImportAPI: false } - ); + serviceConfig: { ...snExternalServiceConfig['.servicenow'], useImportAPI: false }, + axiosInstance: axios, + }); }); test('it updates the incident correctly', async () => { @@ -591,15 +773,16 @@ describe('ServiceNow service', () => { }); test('it should call request with correct arguments when table changes', async () => { - service = createExternalService( - { - config: { apiUrl: 'https://example.com/' }, + service = createExternalService({ + credentials: { + config: { apiUrl: 'https://example.com/', isOAuth: false }, secrets: { username: 'admin', password: 'admin' }, }, logger, configurationUtilities, - { ...snExternalServiceConfig['.servicenow-sir'], useImportAPI: false } - ); + serviceConfig: { ...snExternalServiceConfig['.servicenow-sir'], useImportAPI: false }, + axiosInstance: axios, + }); mockIncidentResponse(false); @@ -646,15 +829,16 @@ describe('ServiceNow service', () => { }); test('it should call request with correct arguments when table changes', async () => { - service = createExternalService( - { - config: { apiUrl: 'https://example.com/' }, + service = createExternalService({ + credentials: { + config: { apiUrl: 'https://example.com/', isOAuth: false }, secrets: { username: 'admin', password: 'admin' }, }, logger, configurationUtilities, - { ...snExternalServiceConfig['.servicenow'], table: 'sn_si_incident' } - ); + serviceConfig: { ...snExternalServiceConfig['.servicenow'], table: 'sn_si_incident' }, + axiosInstance: axios, + }); requestMock.mockImplementation(() => ({ data: { result: serviceNowCommonFields }, @@ -714,15 +898,16 @@ describe('ServiceNow service', () => { }); test('it should call request with correct arguments when table changes', async () => { - service = createExternalService( - { - config: { apiUrl: 'https://example.com/' }, + service = createExternalService({ + credentials: { + config: { apiUrl: 'https://example.com/', isOAuth: false }, secrets: { username: 'admin', password: 'admin' }, }, logger, configurationUtilities, - { ...snExternalServiceConfig['.servicenow'], table: 'sn_si_incident' } - ); + serviceConfig: { ...snExternalServiceConfig['.servicenow'], table: 'sn_si_incident' }, + axiosInstance: axios, + }); requestMock.mockImplementation(() => ({ data: { result: serviceNowChoices }, @@ -818,15 +1003,16 @@ describe('ServiceNow service', () => { }); test('it does not log if useOldApi = true', async () => { - service = createExternalService( - { - config: { apiUrl: 'https://example.com/' }, + service = createExternalService({ + credentials: { + config: { apiUrl: 'https://example.com/', isOAuth: false }, secrets: { username: 'admin', password: 'admin' }, }, logger, configurationUtilities, - { ...snExternalServiceConfig['.servicenow'], useImportAPI: false } - ); + serviceConfig: { ...snExternalServiceConfig['.servicenow'], useImportAPI: false }, + axiosInstance: axios, + }); await service.checkIfApplicationIsInstalled(); expect(requestMock).not.toHaveBeenCalled(); expect(logger.debug).not.toHaveBeenCalled(); diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/service.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/service.ts index 8e606ca5f8ef7..5a1b1f604cb81 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/service.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/service.ts @@ -5,11 +5,9 @@ * 2.0. */ -import axios, { AxiosResponse } from 'axios'; +import { AxiosResponse } from 'axios'; -import { Logger } from '@kbn/core/server'; import { - ExternalServiceCredentials, ExternalService, ExternalServiceParamsCreate, ExternalServiceParamsUpdate, @@ -17,29 +15,41 @@ import { ImportSetApiResponseError, ServiceNowIncident, GetApplicationInfoResponse, - SNProductsConfigValue, ServiceFactory, } from './types'; import * as i18n from './translations'; import { ServiceNowPublicConfigurationType, ServiceNowSecretConfigurationType } from './types'; import { request } from '../lib/axios_utils'; -import { ActionsConfigurationUtilities } from '../../actions_config'; import { createServiceError, getPushedDate, prepareIncident } from './utils'; export const SYS_DICTIONARY_ENDPOINT = `api/now/table/sys_dictionary`; -export const createExternalService: ServiceFactory = ( - { config, secrets }: ExternalServiceCredentials, - logger: Logger, - configurationUtilities: ActionsConfigurationUtilities, - { table, importSetTable, useImportAPI, appScope }: SNProductsConfigValue -): ExternalService => { - const { apiUrl: url, usesTableApi: usesTableApiConfigValue } = - config as ServiceNowPublicConfigurationType; - const { username, password } = secrets as ServiceNowSecretConfigurationType; - - if (!url || !username || !password) { +export const createExternalService: ServiceFactory = ({ + credentials, + logger, + configurationUtilities, + serviceConfig, + axiosInstance, +}): ExternalService => { + const { config, secrets } = credentials; + const { table, importSetTable, useImportAPI, appScope } = serviceConfig; + const { + apiUrl: url, + usesTableApi: usesTableApiConfigValue, + isOAuth, + clientId, + jwtKeyId, + userIdentifierValue, + } = config as ServiceNowPublicConfigurationType; + const { username, password, clientSecret, privateKey } = + secrets as ServiceNowSecretConfigurationType; + + if ( + !url || + (!isOAuth && (!username || !password)) || + (isOAuth && (!clientSecret || !privateKey || !clientId || !jwtKeyId || !userIdentifierValue)) + ) { throw Error(`[Action]${i18n.SERVICENOW}: Wrong configuration.`); } @@ -54,10 +64,6 @@ export const createExternalService: ServiceFactory = ( */ const getVersionUrl = () => `${urlWithoutTrailingSlash}/api/${appScope}/elastic_api/health`; - const axiosInstance = axios.create({ - auth: { username, password }, - }); - const useTableApi = !useImportAPI || usesTableApiConfigValue; const getCreateIncidentUrl = () => (useTableApi ? tableApiIncidentUrl : importSetTableUrl); diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_itom.test.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_itom.test.ts index 57e7a7506171a..855cff79d608e 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_itom.test.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_itom.test.ts @@ -35,15 +35,16 @@ describe('ServiceNow SIR service', () => { let service: ExternalServiceITOM; beforeEach(() => { - service = createExternalServiceITOM( - { - config: { apiUrl: 'https://example.com/' }, + service = createExternalServiceITOM({ + credentials: { + config: { apiUrl: 'https://example.com/', isOAuth: false }, secrets: { username: 'admin', password: 'admin' }, }, logger, configurationUtilities, - snExternalServiceConfig['.servicenow-itom'] - ) as ExternalServiceITOM; + serviceConfig: snExternalServiceConfig['.servicenow-itom'], + axiosInstance: axios, + }) as ExternalServiceITOM; }); beforeEach(() => { diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_itom.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_itom.ts index 65c9c70545acc..3e33564fe7364 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_itom.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_itom.ts @@ -4,41 +4,28 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import axios from 'axios'; -import { Logger } from '@kbn/core/server'; -import { - ExternalServiceCredentials, - SNProductsConfigValue, - ServiceFactory, - ExternalServiceITOM, - ExecutorSubActionAddEventParams, -} from './types'; +import { ServiceFactory, ExternalServiceITOM, ExecutorSubActionAddEventParams } from './types'; -import { ServiceNowSecretConfigurationType } from './types'; import { request } from '../lib/axios_utils'; -import { ActionsConfigurationUtilities } from '../../actions_config'; import { createExternalService } from './service'; import { createServiceError } from './utils'; const getAddEventURL = (url: string) => `${url}/api/global/em/jsonv2`; -export const createExternalServiceITOM: ServiceFactory = ( - credentials: ExternalServiceCredentials, - logger: Logger, - configurationUtilities: ActionsConfigurationUtilities, - serviceConfig: SNProductsConfigValue -): ExternalServiceITOM => { - const snService = createExternalService( +export const createExternalServiceITOM: ServiceFactory = ({ + credentials, + logger, + configurationUtilities, + serviceConfig, + axiosInstance, +}): ExternalServiceITOM => { + const snService = createExternalService({ credentials, logger, configurationUtilities, - serviceConfig - ); - - const { username, password } = credentials.secrets as ServiceNowSecretConfigurationType; - const axiosInstance = axios.create({ - auth: { username, password }, + serviceConfig, + axiosInstance, }); const addEvent = async (params: ExecutorSubActionAddEventParams) => { diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_sir.test.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_sir.test.ts index cbd47fb2552c7..59c71ac6887c8 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_sir.test.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_sir.test.ts @@ -92,15 +92,16 @@ describe('ServiceNow SIR service', () => { let service: ExternalServiceSIR; beforeEach(() => { - service = createExternalServiceSIR( - { - config: { apiUrl: 'https://example.com/' }, + service = createExternalServiceSIR({ + credentials: { + config: { apiUrl: 'https://example.com/', isOAuth: false }, secrets: { username: 'admin', password: 'admin' }, }, logger, configurationUtilities, - snExternalServiceConfig['.servicenow-sir'] - ) as ExternalServiceSIR; + serviceConfig: snExternalServiceConfig['.servicenow-sir'], + axiosInstance: axios, + }) as ExternalServiceSIR; }); beforeEach(() => { diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_sir.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_sir.ts index 41c02a57643e3..0ecd838c93bd2 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_sir.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/service_sir.ts @@ -5,21 +5,9 @@ * 2.0. */ -import axios from 'axios'; +import { Observable, ExternalServiceSIR, ObservableResponse, ServiceFactory } from './types'; -import { Logger } from '@kbn/core/server'; -import { - ExternalServiceCredentials, - SNProductsConfigValue, - Observable, - ExternalServiceSIR, - ObservableResponse, - ServiceFactory, -} from './types'; - -import { ServiceNowSecretConfigurationType } from './types'; import { request } from '../lib/axios_utils'; -import { ActionsConfigurationUtilities } from '../../actions_config'; import { createExternalService } from './service'; import { createServiceError } from './utils'; @@ -29,22 +17,19 @@ const getAddObservableToIncidentURL = (url: string, incidentID: string) => const getBulkAddObservableToIncidentURL = (url: string, incidentID: string) => `${url}/api/x_elas2_sir_int/elastic_api/incident/${incidentID}/observables/bulk`; -export const createExternalServiceSIR: ServiceFactory = ( - credentials: ExternalServiceCredentials, - logger: Logger, - configurationUtilities: ActionsConfigurationUtilities, - serviceConfig: SNProductsConfigValue -): ExternalServiceSIR => { - const snService = createExternalService( +export const createExternalServiceSIR: ServiceFactory = ({ + credentials, + logger, + configurationUtilities, + serviceConfig, + axiosInstance, +}): ExternalServiceSIR => { + const snService = createExternalService({ credentials, logger, configurationUtilities, - serviceConfig - ); - - const { username, password } = credentials.secrets as ServiceNowSecretConfigurationType; - const axiosInstance = axios.create({ - auth: { username, password }, + serviceConfig, + axiosInstance, }); const _addObservable = async (data: Observable | Observable[], url: string) => { diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/translations.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/translations.ts index 8b2bb9423d012..b007e57773989 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/translations.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/translations.ts @@ -30,3 +30,42 @@ export const ALLOWED_HOSTS_ERROR = (message: string) => message, }, }); + +export const CREDENTIALS_ERROR = i18n.translate( + 'xpack.actions.builtin.configuration.apiCredentialsError', + { + defaultMessage: 'Either basic auth or OAuth credentials must be specified', + } +); + +export const BASIC_AUTH_CREDENTIALS_ERROR = i18n.translate( + 'xpack.actions.builtin.configuration.apiBasicAuthCredentialsError', + { + defaultMessage: 'username and password must both be specified', + } +); + +export const OAUTH_CREDENTIALS_ERROR = i18n.translate( + 'xpack.actions.builtin.configuration.apiOAuthCredentialsError', + { + defaultMessage: 'clientSecret and privateKey must both be specified', + } +); + +export const VALIDATE_OAUTH_MISSING_FIELD_ERROR = (field: string, isOAuth: boolean) => + i18n.translate('xpack.actions.builtin.configuration.apiValidateMissingOAuthFieldError', { + defaultMessage: '{field} must be provided when isOAuth = {isOAuth}', + values: { + field, + isOAuth: isOAuth ? 'true' : 'false', + }, + }); + +export const VALIDATE_OAUTH_POPULATED_FIELD_ERROR = (field: string, isOAuth: boolean) => + i18n.translate('xpack.actions.builtin.configuration.apiValidateOAuthFieldError', { + defaultMessage: '{field} should not be provided with isOAuth = {isOAuth}', + values: { + field, + isOAuth: isOAuth ? 'true' : 'false', + }, + }); diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/types.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/types.ts index 4475832e1a7f7..ff3a92e935818 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/types.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/types.ts @@ -7,7 +7,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { AxiosError, AxiosResponse } from 'axios'; +import { AxiosError, AxiosInstance, AxiosResponse } from 'axios'; import { TypeOf } from '@kbn/config-schema'; import { Logger } from '@kbn/core/server'; import { @@ -78,6 +78,7 @@ export interface ExternalServiceCredentials { export interface ExternalServiceValidation { config: (configurationUtilities: ActionsConfigurationUtilities, configObject: any) => void; secrets: (configurationUtilities: ActionsConfigurationUtilities, secrets: any) => void; + connector: (config: any, secrets: any) => string | null; } export interface ExternalServiceIncidentResponse { @@ -277,12 +278,21 @@ export interface ExternalServiceSIR extends ExternalService { ) => Promise; } -export type ServiceFactory = ( - credentials: ExternalServiceCredentials, - logger: Logger, - configurationUtilities: ActionsConfigurationUtilities, - serviceConfig: SNProductsConfigValue -) => T; +interface ServiceFactoryOpts { + credentials: ExternalServiceCredentials; + logger: Logger; + configurationUtilities: ActionsConfigurationUtilities; + serviceConfig: SNProductsConfigValue; + axiosInstance: AxiosInstance; +} + +export type ServiceFactory = ({ + credentials, + logger, + configurationUtilities, + serviceConfig, + axiosInstance, +}: ServiceFactoryOpts) => T; /** * ITOM diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/utils.test.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/utils.test.ts index 7d66949d4473f..dae4e59728a0c 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/utils.test.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/utils.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { AxiosError } from 'axios'; +import axios, { AxiosError } from 'axios'; import { Logger } from '@kbn/core/server'; import { loggingSystemMock } from '@kbn/core/server/mocks'; @@ -14,10 +14,35 @@ import { createServiceError, getPushedDate, throwIfSubActionIsNotSupported, + getAccessToken, + getAxiosInstance, } from './utils'; +import { connectorTokenClientMock } from '../lib/connector_token_client.mock'; +import { actionsConfigMock } from '../../actions_config.mock'; +import { createJWTAssertion } from '../lib/create_jwt_assertion'; +import { requestOAuthJWTToken } from '../lib/request_oauth_jwt_token'; -const logger = loggingSystemMock.create().get() as jest.Mocked; +jest.mock('../lib/create_jwt_assertion', () => ({ + createJWTAssertion: jest.fn(), +})); +jest.mock('../lib/request_oauth_jwt_token', () => ({ + requestOAuthJWTToken: jest.fn(), +})); + +jest.mock('axios', () => ({ + create: jest.fn(), +})); +const createAxiosInstanceMock = axios.create as jest.Mock; +const axiosInstanceMock = { + interceptors: { + request: { eject: jest.fn(), use: jest.fn() }, + response: { eject: jest.fn(), use: jest.fn() }, + }, +}; +const connectorTokenClient = connectorTokenClientMock.create(); +const logger = loggingSystemMock.create().get() as jest.Mocked; +const configurationUtilities = actionsConfigMock.create(); /** * The purpose of this test is to * prevent developers from accidentally @@ -131,4 +156,285 @@ describe('utils', () => { ).not.toThrow(); }); }); + + describe('getAxiosInstance', () => { + beforeEach(() => { + jest.clearAllMocks(); + createAxiosInstanceMock.mockReturnValue(axiosInstanceMock); + }); + + test('creates axios instance with basic auth when isOAuth is false and username and password are defined', () => { + getAxiosInstance({ + connectorId: '123', + logger, + configurationUtilities, + credentials: { + config: { + apiUrl: 'https://servicenow', + usesTableApi: true, + isOAuth: false, + clientId: null, + jwtKeyId: null, + userIdentifierValue: null, + }, + secrets: { + clientSecret: null, + privateKey: null, + privateKeyPassword: null, + username: 'username', + password: 'password', + }, + }, + snServiceUrl: 'https://dev23432523.service-now.com', + connectorTokenClient, + }); + + expect(createAxiosInstanceMock).toHaveBeenCalledTimes(1); + expect(createAxiosInstanceMock).toHaveBeenCalledWith({ + auth: { password: 'password', username: 'username' }, + }); + }); + + test('creates axios instance with interceptor when isOAuth is true and OAuth fields are defined', () => { + connectorTokenClient.get.mockResolvedValueOnce({ + hasErrors: false, + connectorToken: { + id: '1', + connectorId: '123', + tokenType: 'access_token', + token: 'testtokenvalue', + createdAt: new Date().toISOString(), + expiresAt: new Date(Date.now() + 10000000000).toISOString(), + }, + }); + getAxiosInstance({ + connectorId: '123', + logger, + configurationUtilities, + credentials: { + config: { + apiUrl: 'https://servicenow', + usesTableApi: true, + isOAuth: true, + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + userIdentifierValue: 'userIdentifierValue', + }, + secrets: { + clientSecret: 'clientSecret', + privateKey: 'privateKey', + privateKeyPassword: null, + username: null, + password: null, + }, + }, + snServiceUrl: 'https://dev23432523.service-now.com', + connectorTokenClient, + }); + + expect(createAxiosInstanceMock).toHaveBeenCalledTimes(1); + expect(createAxiosInstanceMock).toHaveBeenCalledWith(); + expect(axiosInstanceMock.interceptors.request.use).toHaveBeenCalledTimes(1); + }); + }); + + describe('getAccessToken', () => { + const getAccessTokenOpts = { + connectorId: '123', + logger, + configurationUtilities, + credentials: { + config: { + apiUrl: 'https://servicenow', + usesTableApi: true, + isOAuth: true, + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + userIdentifierValue: 'userIdentifierValue', + }, + secrets: { + clientSecret: 'clientSecret', + privateKey: 'privateKey', + privateKeyPassword: 'privateKeyPassword', + username: null, + password: null, + }, + }, + snServiceUrl: 'https://dev23432523.service-now.com', + connectorTokenClient, + }; + beforeEach(() => { + jest.resetAllMocks(); + jest.clearAllMocks(); + }); + + test('uses stored access token if it exists', async () => { + connectorTokenClient.get.mockResolvedValueOnce({ + hasErrors: false, + connectorToken: { + id: '1', + connectorId: '123', + tokenType: 'access_token', + token: 'testtokenvalue', + createdAt: new Date().toISOString(), + expiresAt: new Date(Date.now() + 10000000000).toISOString(), + }, + }); + const accessToken = await getAccessToken(getAccessTokenOpts); + + expect(accessToken).toEqual('testtokenvalue'); + expect(createJWTAssertion as jest.Mock).not.toHaveBeenCalled(); + expect(requestOAuthJWTToken as jest.Mock).not.toHaveBeenCalled(); + }); + + test('creates new assertion if stored access token does not exist', async () => { + connectorTokenClient.get.mockResolvedValueOnce({ + hasErrors: false, + connectorToken: null, + }); + (createJWTAssertion as jest.Mock).mockReturnValueOnce('newassertion'); + (requestOAuthJWTToken as jest.Mock).mockResolvedValueOnce({ + tokenType: 'access_token', + accessToken: 'brandnewaccesstoken', + expiresIn: 1000, + }); + + const accessToken = await getAccessToken(getAccessTokenOpts); + + expect(accessToken).toEqual('access_token brandnewaccesstoken'); + expect(createJWTAssertion as jest.Mock).toHaveBeenCalledWith( + logger, + 'privateKey', + 'privateKeyPassword', + { + audience: 'clientId', + issuer: 'clientId', + subject: 'userIdentifierValue', + keyId: 'jwtKeyId', + } + ); + expect(requestOAuthJWTToken as jest.Mock).toHaveBeenCalledWith( + 'https://dev23432523.service-now.com/oauth_token.do', + { clientId: 'clientId', clientSecret: 'clientSecret', assertion: 'newassertion' }, + logger, + configurationUtilities + ); + expect(connectorTokenClient.updateOrReplace).toHaveBeenCalledWith({ + connectorId: '123', + token: null, + newToken: 'access_token brandnewaccesstoken', + expiresInSec: 1000, + deleteExisting: false, + }); + }); + + test('creates new assertion if stored access token exists but is expired', async () => { + const createdAt = new Date().toISOString(); + const expiresAt = new Date(Date.now() - 100).toISOString(); + connectorTokenClient.get.mockResolvedValueOnce({ + hasErrors: false, + connectorToken: { + id: '1', + connectorId: '123', + tokenType: 'access_token', + token: 'testtokenvalue', + createdAt, + expiresAt, + }, + }); + (createJWTAssertion as jest.Mock).mockReturnValueOnce('newassertion'); + (requestOAuthJWTToken as jest.Mock).mockResolvedValueOnce({ + tokenType: 'access_token', + accessToken: 'brandnewaccesstoken', + expiresIn: 1000, + }); + + const accessToken = await getAccessToken(getAccessTokenOpts); + + expect(accessToken).toEqual('access_token brandnewaccesstoken'); + expect(createJWTAssertion as jest.Mock).toHaveBeenCalledWith( + logger, + 'privateKey', + 'privateKeyPassword', + { + audience: 'clientId', + issuer: 'clientId', + subject: 'userIdentifierValue', + keyId: 'jwtKeyId', + } + ); + expect(requestOAuthJWTToken as jest.Mock).toHaveBeenCalledWith( + 'https://dev23432523.service-now.com/oauth_token.do', + { clientId: 'clientId', clientSecret: 'clientSecret', assertion: 'newassertion' }, + logger, + configurationUtilities + ); + expect(connectorTokenClient.updateOrReplace).toHaveBeenCalledWith({ + connectorId: '123', + token: { + id: '1', + connectorId: '123', + tokenType: 'access_token', + token: 'testtokenvalue', + createdAt, + expiresAt, + }, + newToken: 'access_token brandnewaccesstoken', + expiresInSec: 1000, + deleteExisting: false, + }); + }); + + test('throws error if createJWTAssertion throws error', async () => { + connectorTokenClient.get.mockResolvedValueOnce({ + hasErrors: false, + connectorToken: null, + }); + (createJWTAssertion as jest.Mock).mockImplementationOnce(() => { + throw new Error('createJWTAssertion error!!'); + }); + + await expect(getAccessToken(getAccessTokenOpts)).rejects.toThrowErrorMatchingInlineSnapshot( + `"createJWTAssertion error!!"` + ); + }); + + test('throws error if requestOAuthJWTToken throws error', async () => { + connectorTokenClient.get.mockResolvedValueOnce({ + hasErrors: false, + connectorToken: null, + }); + (createJWTAssertion as jest.Mock).mockReturnValueOnce('newassertion'); + (requestOAuthJWTToken as jest.Mock).mockRejectedValueOnce( + new Error('requestOAuthJWTToken error!!') + ); + + await expect(getAccessToken(getAccessTokenOpts)).rejects.toThrowErrorMatchingInlineSnapshot( + `"requestOAuthJWTToken error!!"` + ); + }); + + test('logs warning if connectorTokenClient.updateOrReplace throws error', async () => { + connectorTokenClient.get.mockResolvedValueOnce({ + hasErrors: false, + connectorToken: null, + }); + (createJWTAssertion as jest.Mock).mockReturnValueOnce('newassertion'); + (requestOAuthJWTToken as jest.Mock).mockResolvedValueOnce({ + tokenType: 'access_token', + accessToken: 'brandnewaccesstoken', + expiresIn: 1000, + }); + connectorTokenClient.updateOrReplace.mockRejectedValueOnce( + new Error('updateOrReplace error') + ); + + const accessToken = await getAccessToken(getAccessTokenOpts); + + expect(accessToken).toEqual('access_token brandnewaccesstoken'); + expect(logger.warn).toHaveBeenCalledWith( + `Not able to update ServiceNow connector token for connectorId: 123 due to error: updateOrReplace error` + ); + }); + }); }); diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/utils.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/utils.ts index f18d09cdaedb9..84d6741398bce 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/utils.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/utils.ts @@ -5,11 +5,24 @@ * 2.0. */ +import axios, { AxiosInstance, AxiosRequestConfig } from 'axios'; import { Logger } from '@kbn/core/server'; -import { Incident, PartialIncident, ResponseError, ServiceNowError } from './types'; +import { + ExternalServiceCredentials, + Incident, + PartialIncident, + ResponseError, + ServiceNowError, + ServiceNowPublicConfigurationType, + ServiceNowSecretConfigurationType, +} from './types'; import { FIELD_PREFIX } from './config'; import { addTimeZoneToDate, getErrorMessage } from '../lib/axios_utils'; import * as i18n from './translations'; +import { ActionsConfigurationUtilities } from '../../actions_config'; +import { ConnectorTokenClientContract } from '../../types'; +import { createJWTAssertion } from '../lib/create_jwt_assertion'; +import { requestOAuthJWTToken } from '../lib/request_oauth_jwt_token'; export const prepareIncident = (useOldApi: boolean, incident: PartialIncident): PartialIncident => useOldApi @@ -69,3 +82,129 @@ export const throwIfSubActionIsNotSupported = ({ throw new Error(errorMessage); } }; + +export interface GetAccessTokenAndAxiosInstanceOpts { + connectorId: string; + logger: Logger; + configurationUtilities: ActionsConfigurationUtilities; + credentials: ExternalServiceCredentials; + snServiceUrl: string; + connectorTokenClient: ConnectorTokenClientContract; +} + +export const getAxiosInstance = ({ + connectorId, + logger, + configurationUtilities, + credentials, + snServiceUrl, + connectorTokenClient, +}: GetAccessTokenAndAxiosInstanceOpts): AxiosInstance => { + const { config, secrets } = credentials; + const { isOAuth } = config as ServiceNowPublicConfigurationType; + const { username, password } = secrets as ServiceNowSecretConfigurationType; + + let axiosInstance; + + if (!isOAuth && username && password) { + axiosInstance = axios.create({ + auth: { username, password }, + }); + } else { + axiosInstance = axios.create(); + axiosInstance.interceptors.request.use( + async (axiosConfig: AxiosRequestConfig) => { + const accessToken = await getAccessToken({ + connectorId, + logger, + configurationUtilities, + credentials: { + config: config as ServiceNowPublicConfigurationType, + secrets, + }, + snServiceUrl, + connectorTokenClient, + }); + axiosConfig.headers.Authorization = accessToken; + return axiosConfig; + }, + (error) => { + Promise.reject(error); + } + ); + } + + return axiosInstance; +}; + +export const getAccessToken = async ({ + connectorId, + logger, + configurationUtilities, + credentials, + snServiceUrl, + connectorTokenClient, +}: GetAccessTokenAndAxiosInstanceOpts) => { + const { isOAuth, clientId, jwtKeyId, userIdentifierValue } = + credentials.config as ServiceNowPublicConfigurationType; + const { clientSecret, privateKey, privateKeyPassword } = + credentials.secrets as ServiceNowSecretConfigurationType; + + let accessToken: string; + + // Check if there is a token stored for this connector + const { connectorToken, hasErrors } = await connectorTokenClient.get({ connectorId }); + + if (connectorToken === null || Date.parse(connectorToken.expiresAt) <= Date.now()) { + // generate a new assertion + if ( + !isOAuth || + !clientId || + !clientSecret || + !jwtKeyId || + !privateKey || + !userIdentifierValue + ) { + return null; + } + + const assertion = createJWTAssertion(logger, privateKey, privateKeyPassword, { + audience: clientId, + issuer: clientId, + subject: userIdentifierValue, + keyId: jwtKeyId, + }); + + // request access token with jwt assertion + const tokenResult = await requestOAuthJWTToken( + `${snServiceUrl}/oauth_token.do`, + { + clientId, + clientSecret, + assertion, + }, + logger, + configurationUtilities + ); + accessToken = `${tokenResult.tokenType} ${tokenResult.accessToken}`; + + // try to update connector_token SO + try { + await connectorTokenClient.updateOrReplace({ + connectorId, + token: connectorToken, + newToken: accessToken, + expiresInSec: tokenResult.expiresIn, + deleteExisting: hasErrors, + }); + } catch (err) { + logger.warn( + `Not able to update ServiceNow connector token for connectorId: ${connectorId} due to error: ${err.message}` + ); + } + } else { + // use existing valid token + accessToken = connectorToken.token; + } + return accessToken; +}; diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/validators.test.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/validators.test.ts new file mode 100644 index 0000000000000..547c025fcdb61 --- /dev/null +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/validators.test.ts @@ -0,0 +1,401 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { validateCommonConfig, validateCommonSecrets, validateCommonConnector } from './validators'; +import { actionsConfigMock } from '../../actions_config.mock'; + +const configurationUtilities = actionsConfigMock.create(); + +describe('validateCommonConfig', () => { + test('config validation fails when apiUrl is not allowed', () => { + expect( + validateCommonConfig( + { + ...configurationUtilities, + ensureUriAllowed: (_) => { + throw new Error(`target url is not present in allowedHosts`); + }, + }, + { + apiUrl: 'example.com/do-something', + usesTableApi: true, + isOAuth: false, + userIdentifierValue: null, + clientId: null, + jwtKeyId: null, + } + ) + ).toEqual(`error configuring connector action: target url is not present in allowedHosts`); + }); + describe('when isOAuth = true', () => { + test('config validation fails when userIdentifierValue is null', () => { + expect( + validateCommonConfig(configurationUtilities, { + apiUrl: 'https://url', + usesTableApi: true, + isOAuth: true, + userIdentifierValue: null, + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + }) + ).toEqual(`userIdentifierValue must be provided when isOAuth = true`); + }); + test('config validation fails when clientId is null', () => { + expect( + validateCommonConfig(configurationUtilities, { + apiUrl: 'https://url', + usesTableApi: true, + isOAuth: true, + userIdentifierValue: 'userIdentifierValue', + clientId: null, + jwtKeyId: 'jwtKeyId', + }) + ).toEqual(`clientId must be provided when isOAuth = true`); + }); + test('config validation fails when jwtKeyId is null', () => { + expect( + validateCommonConfig(configurationUtilities, { + apiUrl: 'https://url', + usesTableApi: true, + isOAuth: true, + userIdentifierValue: 'userIdentifierValue', + clientId: 'clientId', + jwtKeyId: null, + }) + ).toEqual(`jwtKeyId must be provided when isOAuth = true`); + }); + }); + + describe('when isOAuth = false', () => { + test('connector validation fails when username is null', () => { + expect( + validateCommonConnector( + { + apiUrl: 'https://url', + usesTableApi: true, + isOAuth: false, + userIdentifierValue: null, + clientId: null, + jwtKeyId: null, + }, + { + password: 'password', + username: null, + clientSecret: null, + privateKey: null, + privateKeyPassword: null, + } + ) + ).toEqual(`username must be provided when isOAuth = false`); + }); + test('connector validation fails when password is null', () => { + expect( + validateCommonConnector( + { + apiUrl: 'https://url', + usesTableApi: true, + isOAuth: false, + userIdentifierValue: null, + clientId: null, + jwtKeyId: null, + }, + { + password: null, + username: 'username', + clientSecret: null, + privateKey: null, + privateKeyPassword: null, + } + ) + ).toEqual(`password must be provided when isOAuth = false`); + }); + test('connector validation fails when any oauth related field is defined', () => { + expect( + validateCommonConnector( + { + apiUrl: 'https://url', + usesTableApi: true, + isOAuth: false, + userIdentifierValue: null, + clientId: null, + jwtKeyId: null, + }, + { + password: 'password', + username: 'username', + clientSecret: 'clientSecret', + privateKey: null, + privateKeyPassword: null, + } + ) + ).toEqual( + `clientId, clientSecret, userIdentifierValue, jwtKeyId and privateKey should not be provided with isOAuth = false` + ); + }); + }); +}); + +describe('validateCommonSecrets', () => { + test('secrets validation fails when no credentials are defined', () => { + expect( + validateCommonSecrets(configurationUtilities, { + password: null, + username: null, + clientSecret: null, + privateKey: null, + privateKeyPassword: null, + }) + ).toEqual(`Either basic auth or OAuth credentials must be specified`); + }); + + test('secrets validation fails when username is defined and password is not', () => { + expect( + validateCommonSecrets(configurationUtilities, { + password: null, + username: 'admin', + clientSecret: null, + privateKey: null, + privateKeyPassword: null, + }) + ).toEqual(`username and password must both be specified`); + }); + + test('secrets validation fails when password is defined and username is not', () => { + expect( + validateCommonSecrets(configurationUtilities, { + password: 'password', + username: null, + clientSecret: null, + privateKey: null, + privateKeyPassword: null, + }) + ).toEqual(`username and password must both be specified`); + }); + + test('secrets validation fails when clientSecret is defined and privateKey is not', () => { + expect( + validateCommonSecrets(configurationUtilities, { + password: null, + username: null, + clientSecret: 'secret', + privateKey: null, + privateKeyPassword: null, + }) + ).toEqual(`clientSecret and privateKey must both be specified`); + }); + + test('secrets validation fails when privateKey is defined and clientSecret is not', () => { + expect( + validateCommonSecrets(configurationUtilities, { + password: null, + username: null, + clientSecret: null, + privateKey: 'private', + privateKeyPassword: null, + }) + ).toEqual(`clientSecret and privateKey must both be specified`); + }); +}); + +describe('validateCommonConnector', () => { + describe('when isOAuth = true', () => { + test('connector validation fails when userIdentifierValue is null', () => { + expect( + validateCommonConnector( + { + apiUrl: 'https://url', + usesTableApi: true, + isOAuth: true, + userIdentifierValue: null, + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + }, + { + password: null, + username: null, + clientSecret: 'clientSecret', + privateKey: 'privateKey', + privateKeyPassword: null, + } + ) + ).toEqual(`userIdentifierValue must be provided when isOAuth = true`); + }); + test('connector validation fails when clientId is null', () => { + expect( + validateCommonConnector( + { + apiUrl: 'https://url', + usesTableApi: true, + isOAuth: true, + userIdentifierValue: 'userIdentifierValue', + clientId: null, + jwtKeyId: 'jwtKeyId', + }, + { + password: null, + username: null, + clientSecret: 'clientSecret', + privateKey: 'privateKey', + privateKeyPassword: null, + } + ) + ).toEqual(`clientId must be provided when isOAuth = true`); + }); + test('connector validation fails when jwtKeyId is null', () => { + expect( + validateCommonConnector( + { + apiUrl: 'https://url', + usesTableApi: true, + isOAuth: true, + userIdentifierValue: 'userIdentifierValue', + clientId: 'clientId', + jwtKeyId: null, + }, + { + password: null, + username: null, + clientSecret: 'clientSecret', + privateKey: 'privateKey', + privateKeyPassword: null, + } + ) + ).toEqual(`jwtKeyId must be provided when isOAuth = true`); + }); + test('connector validation fails when clientSecret is null', () => { + expect( + validateCommonConnector( + { + apiUrl: 'https://url', + usesTableApi: true, + isOAuth: true, + userIdentifierValue: 'userIdentifierValue', + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + }, + { + password: null, + username: null, + clientSecret: null, + privateKey: 'privateKey', + privateKeyPassword: null, + } + ) + ).toEqual(`clientSecret must be provided when isOAuth = true`); + }); + test('connector validation fails when privateKey is null', () => { + expect( + validateCommonConnector( + { + apiUrl: 'https://url', + usesTableApi: true, + isOAuth: true, + userIdentifierValue: 'userIdentifierValue', + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + }, + { + password: null, + username: null, + clientSecret: 'clientSecret', + privateKey: null, + privateKeyPassword: null, + } + ) + ).toEqual(`privateKey must be provided when isOAuth = true`); + }); + test('connector validation fails when username and password are not null', () => { + expect( + validateCommonConnector( + { + apiUrl: 'https://url', + usesTableApi: true, + isOAuth: true, + userIdentifierValue: 'userIdentifierValue', + clientId: 'clientId', + jwtKeyId: 'jwtKeyId', + }, + { + password: 'password', + username: 'username', + clientSecret: 'clientSecret', + privateKey: 'privateKey', + privateKeyPassword: null, + } + ) + ).toEqual(`Username and password should not be provided with isOAuth = true`); + }); + }); + + describe('when isOAuth = false', () => { + test('connector validation fails when username is null', () => { + expect( + validateCommonConnector( + { + apiUrl: 'https://url', + usesTableApi: true, + isOAuth: false, + userIdentifierValue: null, + clientId: null, + jwtKeyId: null, + }, + { + password: 'password', + username: null, + clientSecret: null, + privateKey: null, + privateKeyPassword: null, + } + ) + ).toEqual(`username must be provided when isOAuth = false`); + }); + test('connector validation fails when password is null', () => { + expect( + validateCommonConnector( + { + apiUrl: 'https://url', + usesTableApi: true, + isOAuth: false, + userIdentifierValue: null, + clientId: null, + jwtKeyId: null, + }, + { + password: null, + username: 'username', + clientSecret: null, + privateKey: null, + privateKeyPassword: null, + } + ) + ).toEqual(`password must be provided when isOAuth = false`); + }); + test('connector validation fails when any oauth related field is defined', () => { + expect( + validateCommonConnector( + { + apiUrl: 'https://url', + usesTableApi: true, + isOAuth: false, + userIdentifierValue: null, + clientId: null, + jwtKeyId: null, + }, + { + password: 'password', + username: 'username', + clientSecret: 'clientSecret', + privateKey: null, + privateKeyPassword: null, + } + ) + ).toEqual( + `clientId, clientSecret, userIdentifierValue, jwtKeyId and privateKey should not be provided with isOAuth = false` + ); + }); + }); +}); diff --git a/x-pack/plugins/actions/server/builtin_action_types/servicenow/validators.ts b/x-pack/plugins/actions/server/builtin_action_types/servicenow/validators.ts index f074e28863642..87ea4922fa5cc 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/servicenow/validators.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/servicenow/validators.ts @@ -16,21 +16,107 @@ import * as i18n from './translations'; export const validateCommonConfig = ( configurationUtilities: ActionsConfigurationUtilities, - configObject: ServiceNowPublicConfigurationType + config: ServiceNowPublicConfigurationType ) => { + const { isOAuth, apiUrl, userIdentifierValue, clientId, jwtKeyId } = config; + try { - configurationUtilities.ensureUriAllowed(configObject.apiUrl); + configurationUtilities.ensureUriAllowed(apiUrl); } catch (allowedListError) { return i18n.ALLOWED_HOSTS_ERROR(allowedListError.message); } + + if (isOAuth) { + if (userIdentifierValue == null) { + return i18n.VALIDATE_OAUTH_MISSING_FIELD_ERROR('userIdentifierValue', true); + } + + if (clientId == null) { + return i18n.VALIDATE_OAUTH_MISSING_FIELD_ERROR('clientId', true); + } + + if (jwtKeyId == null) { + return i18n.VALIDATE_OAUTH_MISSING_FIELD_ERROR('jwtKeyId', true); + } + } }; export const validateCommonSecrets = ( configurationUtilities: ActionsConfigurationUtilities, secrets: ServiceNowSecretConfigurationType -) => {}; +) => { + const { username, password, clientSecret, privateKey } = secrets; + + if (!username && !password && !clientSecret && !privateKey) { + return i18n.CREDENTIALS_ERROR; + } + + if (username || password) { + // Username and password must be set and set together + if (!username || !password) { + return i18n.BASIC_AUTH_CREDENTIALS_ERROR; + } + } else if (clientSecret || privateKey) { + // Client secret and private key must be set and set together + if (!clientSecret || !privateKey) { + return i18n.OAUTH_CREDENTIALS_ERROR; + } + } +}; + +export const validateCommonConnector = ( + config: ServiceNowPublicConfigurationType, + secrets: ServiceNowSecretConfigurationType +): string | null => { + const { isOAuth, userIdentifierValue, clientId, jwtKeyId } = config; + const { username, password, clientSecret, privateKey } = secrets; + + if (isOAuth) { + if (userIdentifierValue == null) { + return i18n.VALIDATE_OAUTH_MISSING_FIELD_ERROR('userIdentifierValue', true); + } + + if (clientId == null) { + return i18n.VALIDATE_OAUTH_MISSING_FIELD_ERROR('clientId', true); + } + + if (jwtKeyId == null) { + return i18n.VALIDATE_OAUTH_MISSING_FIELD_ERROR('jwtKeyId', true); + } + + if (clientSecret == null) { + return i18n.VALIDATE_OAUTH_MISSING_FIELD_ERROR('clientSecret', true); + } + + if (privateKey == null) { + return i18n.VALIDATE_OAUTH_MISSING_FIELD_ERROR('privateKey', true); + } + + if (username || password) { + return i18n.VALIDATE_OAUTH_POPULATED_FIELD_ERROR('Username and password', true); + } + } else { + if (username == null) { + return i18n.VALIDATE_OAUTH_MISSING_FIELD_ERROR('username', false); + } + + if (password == null) { + return i18n.VALIDATE_OAUTH_MISSING_FIELD_ERROR('password', false); + } + + if (clientSecret || clientId || userIdentifierValue || jwtKeyId || privateKey) { + return i18n.VALIDATE_OAUTH_POPULATED_FIELD_ERROR( + 'clientId, clientSecret, userIdentifierValue, jwtKeyId and privateKey', + false + ); + } + } + + return null; +}; export const validate: ExternalServiceValidation = { config: validateCommonConfig, secrets: validateCommonSecrets, + connector: validateCommonConnector, }; diff --git a/x-pack/plugins/actions/server/saved_objects/actions_migrations.test.ts b/x-pack/plugins/actions/server/saved_objects/actions_migrations.test.ts index d350e40c1b362..12bf3984907b4 100644 --- a/x-pack/plugins/actions/server/saved_objects/actions_migrations.test.ts +++ b/x-pack/plugins/actions/server/saved_objects/actions_migrations.test.ts @@ -168,7 +168,7 @@ describe('successful migrations', () => { test('set usesTableApi config property for .servicenow', () => { const migration716 = getActionsMigrations(encryptedSavedObjectsSetup)['7.16.0']; - const action = getMockDataForServiceNow(); + const action = getMockDataForServiceNow716({ usesTableApi: true }); const migratedAction = migration716(action, context); expect(migratedAction).toEqual({ @@ -185,7 +185,7 @@ describe('successful migrations', () => { test('set usesTableApi config property for .servicenow-sir', () => { const migration716 = getActionsMigrations(encryptedSavedObjectsSetup)['7.16.0']; - const action = getMockDataForServiceNow({ actionTypeId: '.servicenow-sir' }); + const action = getMockDataForServiceNow716({ actionTypeId: '.servicenow-sir' }); const migratedAction = migration716(action, context); expect(migratedAction).toEqual({ @@ -215,6 +215,52 @@ describe('successful migrations', () => { expect(migration800(action, context)).toEqual(action); }); }); + + describe('8.3.0', () => { + test('set isOAuth config property for .servicenow', () => { + const migration830 = getActionsMigrations(encryptedSavedObjectsSetup)['8.3.0']; + const action = getMockDataForServiceNow83(); + const migratedAction = migration830(action, context); + + expect(migratedAction.attributes.config).toEqual({ + apiUrl: 'https://example.com', + usesTableApi: true, + isOAuth: false, + }); + }); + + test('set isOAuth config property for .servicenow-sir', () => { + const migration830 = getActionsMigrations(encryptedSavedObjectsSetup)['8.3.0']; + const action = getMockDataForServiceNow83({ actionTypeId: '.servicenow-sir' }); + const migratedAction = migration830(action, context); + + expect(migratedAction.attributes.config).toEqual({ + apiUrl: 'https://example.com', + usesTableApi: true, + isOAuth: false, + }); + }); + + test('set isOAuth config property for .servicenow-itom', () => { + const migration830 = getActionsMigrations(encryptedSavedObjectsSetup)['8.3.0']; + const action = getMockDataForServiceNow83({ actionTypeId: '.servicenow-itom' }); + const migratedAction = migration830(action, context); + + expect(migratedAction.attributes.config).toEqual({ + apiUrl: 'https://example.com', + usesTableApi: true, + isOAuth: false, + }); + }); + + test('it does not set isOAuth config for other connectors', () => { + const migration830 = getActionsMigrations(encryptedSavedObjectsSetup)['8.3.0']; + const action = getMockData(); + const migratedAction = migration830(action, context); + + expect(migratedAction).toEqual(action); + }); + }); }); describe('handles errors during migrations', () => { @@ -348,7 +394,7 @@ function getMockData( }; } -function getMockDataForServiceNow( +function getMockDataForServiceNow716( overwrites: Record = {} ): SavedObjectUnsanitizedDoc> { return { @@ -363,3 +409,11 @@ function getMockDataForServiceNow( type: 'action', }; } + +function getMockDataForServiceNow83( + overwrites: Record = {} +): SavedObjectUnsanitizedDoc> { + return getMockDataForServiceNow716({ + config: { apiUrl: 'https://example.com', usesTableApi: true }, + }); +} diff --git a/x-pack/plugins/actions/server/saved_objects/actions_migrations.ts b/x-pack/plugins/actions/server/saved_objects/actions_migrations.ts index 4c113a09b81b5..f785fa9ee4ac9 100644 --- a/x-pack/plugins/actions/server/saved_objects/actions_migrations.ts +++ b/x-pack/plugins/actions/server/saved_objects/actions_migrations.ts @@ -78,12 +78,22 @@ export function getActionsMigrations( (doc) => doc // no-op ); + const migrationActions830 = createEsoMigration( + encryptedSavedObjects, + (doc): doc is SavedObjectUnsanitizedDoc => + doc.attributes.actionTypeId === '.servicenow' || + doc.attributes.actionTypeId === '.servicenow-sir' || + doc.attributes.actionTypeId === '.servicenow-itom', + pipeMigrations(addIsOAuthToServiceNowConnectors) + ); + return { '7.10.0': executeMigrationWithErrorHandling(migrationActionsTen, '7.10.0'), '7.11.0': executeMigrationWithErrorHandling(migrationActionsEleven, '7.11.0'), '7.14.0': executeMigrationWithErrorHandling(migrationActionsFourteen, '7.14.0'), '7.16.0': executeMigrationWithErrorHandling(migrationActionsSixteen, '7.16.0'), '8.0.0': executeMigrationWithErrorHandling(migrationActions800, '8.0.0'), + '8.3.0': executeMigrationWithErrorHandling(migrationActions830, '8.3.0'), }; } @@ -219,6 +229,29 @@ const addUsesTableApiToServiceNowConnectors = ( }; }; +const addIsOAuthToServiceNowConnectors = ( + doc: SavedObjectUnsanitizedDoc +): SavedObjectUnsanitizedDoc => { + if ( + doc.attributes.actionTypeId !== '.servicenow' && + doc.attributes.actionTypeId !== '.servicenow-sir' && + doc.attributes.actionTypeId !== '.servicenow-itom' + ) { + return doc; + } + + return { + ...doc, + attributes: { + ...doc.attributes, + config: { + ...doc.attributes.config, + isOAuth: false, + }, + }, + }; +}; + function pipeMigrations(...migrations: ActionMigration[]): ActionMigration { return (doc: SavedObjectUnsanitizedDoc) => migrations.reduce((migratedDoc, nextMigration) => nextMigration(migratedDoc), doc); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_itom.ts b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_itom.ts index 9dcc3ef05266e..c685fff8abfc6 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_itom.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_itom.ts @@ -7,6 +7,7 @@ import httpProxy from 'http-proxy'; import expect from '@kbn/expect'; +import { asyncForEach } from '@kbn/std'; import getPort from 'get-port'; import http from 'http'; @@ -19,14 +20,7 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const configService = getService('config'); - const mockServiceNow = { - config: { - apiUrl: 'www.servicenowisinkibanaactions.com', - }, - secrets: { - password: 'elastic', - username: 'changeme', - }, + const mockServiceNowCommon = { params: { subAction: 'addEvent', subActionParams: { @@ -44,6 +38,30 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { }, }, }; + const mockServiceNowBasic = { + ...mockServiceNowCommon, + config: { + apiUrl: 'www.servicenowisinkibanaactions.com', + }, + secrets: { + password: 'elastic', + username: 'changeme', + }, + }; + const mockServiceNowOAuth = { + ...mockServiceNowCommon, + config: { + apiUrl: 'www.servicenowisinkibanaactions.com', + isOAuth: true, + clientId: 'abc', + userIdentifierValue: 'elastic', + jwtKeyId: 'def', + }, + secrets: { + clientSecret: 'xyz', + privateKey: '-----BEGIN RSA PRIVATE KEY-----\nddddddd\n-----END RSA PRIVATE KEY-----', + }, + }; describe('ServiceNow ITOM', () => { let simulatedActionId = ''; @@ -76,7 +94,7 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { }); describe('ServiceNow ITOM - Action Creation', () => { - it('should return 200 when creating a servicenow action successfully', async () => { + it('should return 200 when creating a servicenow Basic Auth connector successfully', async () => { const { body: createdAction } = await supertest .post('/api/actions/connector') .set('kbn-xsrf', 'foo') @@ -86,7 +104,7 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { config: { apiUrl: serviceNowSimulatorURL, }, - secrets: mockServiceNow.secrets, + secrets: mockServiceNowBasic.secrets, }) .expect(200); @@ -99,6 +117,10 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { is_missing_secrets: false, config: { apiUrl: serviceNowSimulatorURL, + isOAuth: false, + clientId: null, + jwtKeyId: null, + userIdentifierValue: null, }, }); @@ -115,11 +137,67 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { is_missing_secrets: false, config: { apiUrl: serviceNowSimulatorURL, + isOAuth: false, + clientId: null, + jwtKeyId: null, + userIdentifierValue: null, }, }); }); - it('should respond with a 400 Bad Request when creating a servicenow action with no apiUrl', async () => { + it('should return 200 when creating a servicenow OAuth connector successfully', async () => { + const { body: createdConnector } = await supertest + .post('/api/actions/connector') + .set('kbn-xsrf', 'foo') + .send({ + name: 'A servicenow action', + connector_type_id: '.servicenow-itom', + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + }, + secrets: mockServiceNowOAuth.secrets, + }) + .expect(200); + + expect(createdConnector).to.eql({ + id: createdConnector.id, + is_preconfigured: false, + is_deprecated: false, + name: 'A servicenow action', + connector_type_id: '.servicenow-itom', + is_missing_secrets: false, + config: { + apiUrl: serviceNowSimulatorURL, + isOAuth: true, + clientId: mockServiceNowOAuth.config.clientId, + jwtKeyId: mockServiceNowOAuth.config.jwtKeyId, + userIdentifierValue: mockServiceNowOAuth.config.userIdentifierValue, + }, + }); + + const { body: fetchedConnector } = await supertest + .get(`/api/actions/connector/${createdConnector.id}`) + .expect(200); + + expect(fetchedConnector).to.eql({ + id: fetchedConnector.id, + is_preconfigured: false, + is_deprecated: false, + name: 'A servicenow action', + connector_type_id: '.servicenow-itom', + is_missing_secrets: false, + config: { + apiUrl: serviceNowSimulatorURL, + isOAuth: true, + clientId: mockServiceNowOAuth.config.clientId, + jwtKeyId: mockServiceNowOAuth.config.jwtKeyId, + userIdentifierValue: mockServiceNowOAuth.config.userIdentifierValue, + }, + }); + }); + + it('should respond with a 400 Bad Request when creating a servicenow Basic Auth connector with no apiUrl', async () => { await supertest .post('/api/actions/connector') .set('kbn-xsrf', 'foo') @@ -139,7 +217,30 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { }); }); - it('should respond with a 400 Bad Request when creating a servicenow action with a not present in allowedHosts apiUrl', async () => { + it('should respond with a 400 Bad Request when creating a servicenow OAuth connector with no apiUrl', async () => { + await supertest + .post('/api/actions/connector') + .set('kbn-xsrf', 'foo') + .send({ + name: 'A servicenow action', + connector_type_id: '.servicenow-itom', + config: { + isOAuth: true, + }, + secrets: mockServiceNowOAuth.secrets, + }) + .expect(400) + .then((resp: any) => { + expect(resp.body).to.eql({ + statusCode: 400, + error: 'Bad Request', + message: + 'error validating action type config: [apiUrl]: expected value of type [string] but got [undefined]', + }); + }); + }); + + it('should respond with a 400 Bad Request when creating a servicenow connector with a not present in allowedHosts apiUrl', async () => { await supertest .post('/api/actions/connector') .set('kbn-xsrf', 'foo') @@ -149,7 +250,7 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { config: { apiUrl: 'http://servicenow.mynonexistent.com', }, - secrets: mockServiceNow.secrets, + secrets: mockServiceNowBasic.secrets, }) .expect(400) .then((resp: any) => { @@ -162,7 +263,29 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { }); }); - it('should respond with a 400 Bad Request when creating a servicenow action without secrets', async () => { + it('should respond with a 400 Bad Request when creating a servicenow Basic Auth connector without secrets', async () => { + await supertest + .post('/api/actions/connector') + .set('kbn-xsrf', 'foo') + .send({ + name: 'A servicenow action', + connector_type_id: '.servicenow-itom', + config: { + apiUrl: serviceNowSimulatorURL, + }, + }) + .expect(400) + .then((resp: any) => { + expect(resp.body).to.eql({ + statusCode: 400, + error: 'Bad Request', + message: + 'error validating action type secrets: Either basic auth or OAuth credentials must be specified', + }); + }); + }); + + it('should respond with a 400 Bad Request when creating a servicenow OAuth connector without secrets', async () => { await supertest .post('/api/actions/connector') .set('kbn-xsrf', 'foo') @@ -170,6 +293,7 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { name: 'A servicenow action', connector_type_id: '.servicenow-itom', config: { + ...mockServiceNowOAuth.config, apiUrl: serviceNowSimulatorURL, }, }) @@ -179,10 +303,84 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { statusCode: 400, error: 'Bad Request', message: - 'error validating action type secrets: [password]: expected value of type [string] but got [undefined]', + 'error validating action type secrets: Either basic auth or OAuth credentials must be specified', }); }); }); + + it('should respond with a 400 Bad Request when creating a servicenow OAuth connector with missing fields', async () => { + const badConfigs = [ + { + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + clientId: null, + }, + secrets: mockServiceNowOAuth.secrets, + errorMessage: `error validating action type config: clientId must be provided when isOAuth = true`, + }, + { + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + userIdentifierValue: null, + }, + secrets: mockServiceNowOAuth.secrets, + errorMessage: `error validating action type config: userIdentifierValue must be provided when isOAuth = true`, + }, + { + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + jwtKeyId: null, + }, + secrets: mockServiceNowOAuth.secrets, + errorMessage: `error validating action type config: jwtKeyId must be provided when isOAuth = true`, + }, + { + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + }, + secrets: { + ...mockServiceNowOAuth.secrets, + clientSecret: null, + }, + errorMessage: `error validating action type secrets: clientSecret and privateKey must both be specified`, + }, + { + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + }, + secrets: { + ...mockServiceNowOAuth.secrets, + privateKey: null, + }, + errorMessage: `error validating action type secrets: clientSecret and privateKey must both be specified`, + }, + ]; + + await asyncForEach(badConfigs, async (badConfig) => { + await supertest + .post('/api/actions/connector') + .set('kbn-xsrf', 'foo') + .send({ + name: 'A servicenow action', + connector_type_id: '.servicenow-itom', + config: badConfig.config, + secrets: badConfig.secrets, + }) + .expect(400) + .then((resp: any) => { + expect(resp.body).to.eql({ + statusCode: 400, + error: 'Bad Request', + message: badConfig.errorMessage, + }); + }); + }); + }); }); describe('ServiceNow ITOM - Executor', () => { @@ -196,7 +394,7 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { config: { apiUrl: serviceNowSimulatorURL, }, - secrets: mockServiceNow.secrets, + secrets: mockServiceNowBasic.secrets, }); simulatedActionId = body.id; }); @@ -284,7 +482,7 @@ export default function serviceNowITOMTest({ getService }: FtrProviderContext) { .post(`/api/actions/connector/${simulatedActionId}/_execute`) .set('kbn-xsrf', 'foo') .send({ - params: mockServiceNow.params, + params: mockServiceNowBasic.params, }) .expect(200); expect(result.status).to.eql('ok'); diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_itsm.ts b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_itsm.ts index 4cc65d7103a58..0f81753bbc731 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_itsm.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_itsm.ts @@ -7,6 +7,7 @@ import httpProxy from 'http-proxy'; import expect from '@kbn/expect'; +import { asyncForEach } from '@kbn/std'; import getPort from 'get-port'; import http from 'http'; @@ -19,15 +20,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const configService = getService('config'); - const mockServiceNow = { - config: { - apiUrl: 'www.servicenowisinkibanaactions.com', - usesTableApi: false, - }, - secrets: { - password: 'elastic', - username: 'changeme', - }, + const mockServiceNowCommon = { params: { subAction: 'pushToService', subActionParams: { @@ -51,6 +44,33 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { }, }; + const mockServiceNowBasic = { + ...mockServiceNowCommon, + config: { + apiUrl: 'www.servicenowisinkibanaactions.com', + usesTableApi: false, + }, + secrets: { + password: 'elastic', + username: 'changeme', + }, + }; + const mockServiceNowOAuth = { + ...mockServiceNowCommon, + config: { + apiUrl: 'www.servicenowisinkibanaactions.com', + usesTableApi: false, + isOAuth: true, + clientId: 'abc', + userIdentifierValue: 'elastic', + jwtKeyId: 'def', + }, + secrets: { + clientSecret: 'xyz', + privateKey: '-----BEGIN RSA PRIVATE KEY-----\nddddddd\n-----END RSA PRIVATE KEY-----', + }, + }; + describe('ServiceNow ITSM', () => { let simulatedActionId = ''; let serviceNowSimulatorURL: string = ''; @@ -82,7 +102,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { }); describe('ServiceNow ITSM - Action Creation', () => { - it('should return 200 when creating a servicenow action successfully', async () => { + it('should return 200 when creating a servicenow Basic Auth connector successfully', async () => { const { body: createdAction } = await supertest .post('/api/actions/connector') .set('kbn-xsrf', 'foo') @@ -93,7 +113,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { apiUrl: serviceNowSimulatorURL, usesTableApi: false, }, - secrets: mockServiceNow.secrets, + secrets: mockServiceNowBasic.secrets, }) .expect(200); @@ -107,6 +127,10 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { config: { apiUrl: serviceNowSimulatorURL, usesTableApi: false, + isOAuth: false, + clientId: null, + jwtKeyId: null, + userIdentifierValue: null, }, }); @@ -124,6 +148,64 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { config: { apiUrl: serviceNowSimulatorURL, usesTableApi: false, + isOAuth: false, + clientId: null, + jwtKeyId: null, + userIdentifierValue: null, + }, + }); + }); + + it('should return 200 when creating a servicenow OAuth connector successfully', async () => { + const { body: createdConnector } = await supertest + .post('/api/actions/connector') + .set('kbn-xsrf', 'foo') + .send({ + name: 'A servicenow action', + connector_type_id: '.servicenow', + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + }, + secrets: mockServiceNowOAuth.secrets, + }) + .expect(200); + + expect(createdConnector).to.eql({ + id: createdConnector.id, + is_preconfigured: false, + is_deprecated: false, + name: 'A servicenow action', + connector_type_id: '.servicenow', + is_missing_secrets: false, + config: { + apiUrl: serviceNowSimulatorURL, + usesTableApi: false, + isOAuth: true, + clientId: mockServiceNowOAuth.config.clientId, + jwtKeyId: mockServiceNowOAuth.config.jwtKeyId, + userIdentifierValue: mockServiceNowOAuth.config.userIdentifierValue, + }, + }); + + const { body: fetchedConnector } = await supertest + .get(`/api/actions/connector/${createdConnector.id}`) + .expect(200); + + expect(fetchedConnector).to.eql({ + id: fetchedConnector.id, + is_preconfigured: false, + is_deprecated: false, + name: 'A servicenow action', + connector_type_id: '.servicenow', + is_missing_secrets: false, + config: { + apiUrl: serviceNowSimulatorURL, + usesTableApi: false, + isOAuth: true, + clientId: mockServiceNowOAuth.config.clientId, + jwtKeyId: mockServiceNowOAuth.config.jwtKeyId, + userIdentifierValue: mockServiceNowOAuth.config.userIdentifierValue, }, }); }); @@ -138,7 +220,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { config: { apiUrl: serviceNowSimulatorURL, }, - secrets: mockServiceNow.secrets, + secrets: mockServiceNowBasic.secrets, }) .expect(200); @@ -149,7 +231,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { expect(fetchedAction.config.usesTableApi).to.be(true); }); - it('should respond with a 400 Bad Request when creating a servicenow action with no apiUrl', async () => { + it('should respond with a 400 Bad Request when creating a servicenow Basic Auth connector with no apiUrl', async () => { await supertest .post('/api/actions/connector') .set('kbn-xsrf', 'foo') @@ -169,7 +251,30 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { }); }); - it('should respond with a 400 Bad Request when creating a servicenow action with a not present in allowedHosts apiUrl', async () => { + it('should respond with a 400 Bad Request when creating a servicenow OAuth connector with no apiUrl', async () => { + await supertest + .post('/api/actions/connector') + .set('kbn-xsrf', 'foo') + .send({ + name: 'A servicenow action', + connector_type_id: '.servicenow', + config: { + isOAuth: true, + }, + secrets: mockServiceNowOAuth.secrets, + }) + .expect(400) + .then((resp: any) => { + expect(resp.body).to.eql({ + statusCode: 400, + error: 'Bad Request', + message: + 'error validating action type config: [apiUrl]: expected value of type [string] but got [undefined]', + }); + }); + }); + + it('should respond with a 400 Bad Request when creating a servicenow connector with a not present in allowedHosts apiUrl', async () => { await supertest .post('/api/actions/connector') .set('kbn-xsrf', 'foo') @@ -179,7 +284,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { config: { apiUrl: 'http://servicenow.mynonexistent.com', }, - secrets: mockServiceNow.secrets, + secrets: mockServiceNowBasic.secrets, }) .expect(400) .then((resp: any) => { @@ -192,7 +297,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { }); }); - it('should respond with a 400 Bad Request when creating a servicenow action without secrets', async () => { + it('should respond with a 400 Bad Request when creating a servicenow Basic Auth connector without secrets', async () => { await supertest .post('/api/actions/connector') .set('kbn-xsrf', 'foo') @@ -209,10 +314,107 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { statusCode: 400, error: 'Bad Request', message: - 'error validating action type secrets: [password]: expected value of type [string] but got [undefined]', + 'error validating action type secrets: Either basic auth or OAuth credentials must be specified', }); }); }); + + it('should respond with a 400 Bad Request when creating a servicenow OAuth connector without secrets', async () => { + await supertest + .post('/api/actions/connector') + .set('kbn-xsrf', 'foo') + .send({ + name: 'A servicenow action', + connector_type_id: '.servicenow', + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + }, + }) + .expect(400) + .then((resp: any) => { + expect(resp.body).to.eql({ + statusCode: 400, + error: 'Bad Request', + message: + 'error validating action type secrets: Either basic auth or OAuth credentials must be specified', + }); + }); + }); + + it('should respond with a 400 Bad Request when creating a servicenow OAuth connector with missing fields', async () => { + const badConfigs = [ + { + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + clientId: null, + }, + secrets: mockServiceNowOAuth.secrets, + errorMessage: `error validating action type config: clientId must be provided when isOAuth = true`, + }, + { + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + userIdentifierValue: null, + }, + secrets: mockServiceNowOAuth.secrets, + errorMessage: `error validating action type config: userIdentifierValue must be provided when isOAuth = true`, + }, + { + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + jwtKeyId: null, + }, + secrets: mockServiceNowOAuth.secrets, + errorMessage: `error validating action type config: jwtKeyId must be provided when isOAuth = true`, + }, + { + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + }, + secrets: { + ...mockServiceNowOAuth.secrets, + clientSecret: null, + }, + errorMessage: `error validating action type secrets: clientSecret and privateKey must both be specified`, + }, + { + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + }, + secrets: { + ...mockServiceNowOAuth.secrets, + privateKey: null, + }, + errorMessage: `error validating action type secrets: clientSecret and privateKey must both be specified`, + }, + ]; + + await asyncForEach(badConfigs, async (badConfig) => { + await supertest + .post('/api/actions/connector') + .set('kbn-xsrf', 'foo') + .send({ + name: 'A servicenow action', + connector_type_id: '.servicenow', + config: badConfig.config, + secrets: badConfig.secrets, + }) + .expect(400) + .then((resp: any) => { + expect(resp.body).to.eql({ + statusCode: 400, + error: 'Bad Request', + message: badConfig.errorMessage, + }); + }); + }); + }); }); describe('ServiceNow ITSM - Executor', () => { @@ -227,7 +429,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { apiUrl: serviceNowSimulatorURL, usesTableApi: false, }, - secrets: mockServiceNow.secrets, + secrets: mockServiceNowBasic.secrets, }); simulatedActionId = body.id; }); @@ -289,7 +491,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { .set('kbn-xsrf', 'foo') .send({ params: { - ...mockServiceNow.params, + ...mockServiceNowBasic.params, subActionParams: { savedObjectId: 'success', }, @@ -312,10 +514,10 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { .set('kbn-xsrf', 'foo') .send({ params: { - ...mockServiceNow.params, + ...mockServiceNowBasic.params, subActionParams: { incident: { - ...mockServiceNow.params.subActionParams.incident, + ...mockServiceNowBasic.params.subActionParams.incident, short_description: 'success', }, comments: [{ comment: 'boo' }], @@ -339,10 +541,10 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { .set('kbn-xsrf', 'foo') .send({ params: { - ...mockServiceNow.params, + ...mockServiceNowBasic.params, subActionParams: { incident: { - ...mockServiceNow.params.subActionParams.incident, + ...mockServiceNowBasic.params.subActionParams.incident, short_description: 'success', }, comments: [{ commentId: 'success' }], @@ -393,9 +595,9 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { .set('kbn-xsrf', 'foo') .send({ params: { - ...mockServiceNow.params, + ...mockServiceNowBasic.params, subActionParams: { - incident: mockServiceNow.params.subActionParams.incident, + incident: mockServiceNowBasic.params.subActionParams.incident, comments: [], }, }, @@ -429,7 +631,7 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { apiUrl: serviceNowSimulatorURL, usesTableApi: true, }, - secrets: mockServiceNow.secrets, + secrets: mockServiceNowBasic.secrets, }); simulatedActionId = body.id; }); @@ -440,9 +642,9 @@ export default function serviceNowITSMTest({ getService }: FtrProviderContext) { .set('kbn-xsrf', 'foo') .send({ params: { - ...mockServiceNow.params, + ...mockServiceNowBasic.params, subActionParams: { - incident: mockServiceNow.params.subActionParams.incident, + incident: mockServiceNowBasic.params.subActionParams.incident, comments: [], }, }, diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_sir.ts b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_sir.ts index 305bbef7cf70a..0f5640f7edd3e 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_sir.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow_sir.ts @@ -7,6 +7,7 @@ import httpProxy from 'http-proxy'; import expect from '@kbn/expect'; +import { asyncForEach } from '@kbn/std'; import getPort from 'get-port'; import http from 'http'; @@ -19,7 +20,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const configService = getService('config'); - const mockServiceNow = { + const mockServiceNowCommon = { config: { apiUrl: 'www.servicenowisinkibanaactions.com', usesTableApi: false, @@ -55,6 +56,33 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { }, }; + const mockServiceNowBasic = { + ...mockServiceNowCommon, + config: { + apiUrl: 'www.servicenowisinkibanaactions.com', + usesTableApi: false, + }, + secrets: { + password: 'elastic', + username: 'changeme', + }, + }; + const mockServiceNowOAuth = { + ...mockServiceNowCommon, + config: { + apiUrl: 'www.servicenowisinkibanaactions.com', + usesTableApi: false, + isOAuth: true, + clientId: 'abc', + userIdentifierValue: 'elastic', + jwtKeyId: 'def', + }, + secrets: { + clientSecret: 'xyz', + privateKey: '-----BEGIN RSA PRIVATE KEY-----\nddddddd\n-----END RSA PRIVATE KEY-----', + }, + }; + describe('ServiceNow SIR', () => { let simulatedActionId = ''; let serviceNowSimulatorURL: string = ''; @@ -86,7 +114,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { }); describe('ServiceNow SIR - Action Creation', () => { - it('should return 200 when creating a servicenow action successfully', async () => { + it('should return 200 when creating a servicenow Basic Auth connector successfully', async () => { const { body: createdAction } = await supertest .post('/api/actions/connector') .set('kbn-xsrf', 'foo') @@ -97,7 +125,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { apiUrl: serviceNowSimulatorURL, usesTableApi: false, }, - secrets: mockServiceNow.secrets, + secrets: mockServiceNowBasic.secrets, }) .expect(200); @@ -111,6 +139,10 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { config: { apiUrl: serviceNowSimulatorURL, usesTableApi: false, + isOAuth: false, + clientId: null, + jwtKeyId: null, + userIdentifierValue: null, }, }); @@ -128,6 +160,64 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { config: { apiUrl: serviceNowSimulatorURL, usesTableApi: false, + isOAuth: false, + clientId: null, + jwtKeyId: null, + userIdentifierValue: null, + }, + }); + }); + + it('should return 200 when creating a servicenow OAuth connector successfully', async () => { + const { body: createdConnector } = await supertest + .post('/api/actions/connector') + .set('kbn-xsrf', 'foo') + .send({ + name: 'A servicenow action', + connector_type_id: '.servicenow-sir', + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + }, + secrets: mockServiceNowOAuth.secrets, + }) + .expect(200); + + expect(createdConnector).to.eql({ + id: createdConnector.id, + is_preconfigured: false, + is_deprecated: false, + name: 'A servicenow action', + connector_type_id: '.servicenow-sir', + is_missing_secrets: false, + config: { + apiUrl: serviceNowSimulatorURL, + usesTableApi: false, + isOAuth: true, + clientId: mockServiceNowOAuth.config.clientId, + jwtKeyId: mockServiceNowOAuth.config.jwtKeyId, + userIdentifierValue: mockServiceNowOAuth.config.userIdentifierValue, + }, + }); + + const { body: fetchedConnector } = await supertest + .get(`/api/actions/connector/${createdConnector.id}`) + .expect(200); + + expect(fetchedConnector).to.eql({ + id: fetchedConnector.id, + is_preconfigured: false, + is_deprecated: false, + name: 'A servicenow action', + connector_type_id: '.servicenow-sir', + is_missing_secrets: false, + config: { + apiUrl: serviceNowSimulatorURL, + usesTableApi: false, + isOAuth: true, + clientId: mockServiceNowOAuth.config.clientId, + jwtKeyId: mockServiceNowOAuth.config.jwtKeyId, + userIdentifierValue: mockServiceNowOAuth.config.userIdentifierValue, }, }); }); @@ -142,7 +232,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { config: { apiUrl: serviceNowSimulatorURL, }, - secrets: mockServiceNow.secrets, + secrets: mockServiceNowBasic.secrets, }) .expect(200); @@ -153,7 +243,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { expect(fetchedAction.config.usesTableApi).to.be(true); }); - it('should respond with a 400 Bad Request when creating a servicenow action with no apiUrl', async () => { + it('should respond with a 400 Bad Request when creating a servicenow Basic Auth connector with no apiUrl', async () => { await supertest .post('/api/actions/connector') .set('kbn-xsrf', 'foo') @@ -173,7 +263,30 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { }); }); - it('should respond with a 400 Bad Request when creating a servicenow action with a not present in allowedHosts apiUrl', async () => { + it('should respond with a 400 Bad Request when creating a servicenow OAuth connector with no apiUrl', async () => { + await supertest + .post('/api/actions/connector') + .set('kbn-xsrf', 'foo') + .send({ + name: 'A servicenow action', + connector_type_id: '.servicenow-sir', + config: { + isOAuth: true, + }, + secrets: mockServiceNowOAuth.secrets, + }) + .expect(400) + .then((resp: any) => { + expect(resp.body).to.eql({ + statusCode: 400, + error: 'Bad Request', + message: + 'error validating action type config: [apiUrl]: expected value of type [string] but got [undefined]', + }); + }); + }); + + it('should respond with a 400 Bad Request when creating a servicenow connector with a not present in allowedHosts apiUrl', async () => { await supertest .post('/api/actions/connector') .set('kbn-xsrf', 'foo') @@ -183,7 +296,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { config: { apiUrl: 'http://servicenow.mynonexistent.com', }, - secrets: mockServiceNow.secrets, + secrets: mockServiceNowBasic.secrets, }) .expect(400) .then((resp: any) => { @@ -196,7 +309,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { }); }); - it('should respond with a 400 Bad Request when creating a servicenow action without secrets', async () => { + it('should respond with a 400 Bad Request when creating a servicenow Basic Auth connector without secrets', async () => { await supertest .post('/api/actions/connector') .set('kbn-xsrf', 'foo') @@ -213,10 +326,107 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { statusCode: 400, error: 'Bad Request', message: - 'error validating action type secrets: [password]: expected value of type [string] but got [undefined]', + 'error validating action type secrets: Either basic auth or OAuth credentials must be specified', }); }); }); + + it('should respond with a 400 Bad Request when creating a servicenow OAuth connector without secrets', async () => { + await supertest + .post('/api/actions/connector') + .set('kbn-xsrf', 'foo') + .send({ + name: 'A servicenow action', + connector_type_id: '.servicenow-sir', + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + }, + }) + .expect(400) + .then((resp: any) => { + expect(resp.body).to.eql({ + statusCode: 400, + error: 'Bad Request', + message: + 'error validating action type secrets: Either basic auth or OAuth credentials must be specified', + }); + }); + }); + + it('should respond with a 400 Bad Request when creating a servicenow OAuth connector with missing fields', async () => { + const badConfigs = [ + { + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + clientId: null, + }, + secrets: mockServiceNowOAuth.secrets, + errorMessage: `error validating action type config: clientId must be provided when isOAuth = true`, + }, + { + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + userIdentifierValue: null, + }, + secrets: mockServiceNowOAuth.secrets, + errorMessage: `error validating action type config: userIdentifierValue must be provided when isOAuth = true`, + }, + { + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + jwtKeyId: null, + }, + secrets: mockServiceNowOAuth.secrets, + errorMessage: `error validating action type config: jwtKeyId must be provided when isOAuth = true`, + }, + { + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + }, + secrets: { + ...mockServiceNowOAuth.secrets, + clientSecret: null, + }, + errorMessage: `error validating action type secrets: clientSecret and privateKey must both be specified`, + }, + { + config: { + ...mockServiceNowOAuth.config, + apiUrl: serviceNowSimulatorURL, + }, + secrets: { + ...mockServiceNowOAuth.secrets, + privateKey: null, + }, + errorMessage: `error validating action type secrets: clientSecret and privateKey must both be specified`, + }, + ]; + + await asyncForEach(badConfigs, async (badConfig) => { + await supertest + .post('/api/actions/connector') + .set('kbn-xsrf', 'foo') + .send({ + name: 'A servicenow action', + connector_type_id: '.servicenow-sir', + config: badConfig.config, + secrets: badConfig.secrets, + }) + .expect(400) + .then((resp: any) => { + expect(resp.body).to.eql({ + statusCode: 400, + error: 'Bad Request', + message: badConfig.errorMessage, + }); + }); + }); + }); }); describe('ServiceNow SIR - Executor', () => { @@ -230,8 +440,9 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { config: { apiUrl: serviceNowSimulatorURL, usesTableApi: false, + isOAuth: false, }, - secrets: mockServiceNow.secrets, + secrets: mockServiceNowBasic.secrets, }); simulatedActionId = body.id; }); @@ -293,7 +504,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { .set('kbn-xsrf', 'foo') .send({ params: { - ...mockServiceNow.params, + ...mockServiceNowBasic.params, subActionParams: { savedObjectId: 'success', }, @@ -316,10 +527,10 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { .set('kbn-xsrf', 'foo') .send({ params: { - ...mockServiceNow.params, + ...mockServiceNowBasic.params, subActionParams: { incident: { - ...mockServiceNow.params.subActionParams.incident, + ...mockServiceNowBasic.params.subActionParams.incident, short_description: 'success', }, comments: [{ comment: 'boo' }], @@ -343,10 +554,10 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { .set('kbn-xsrf', 'foo') .send({ params: { - ...mockServiceNow.params, + ...mockServiceNowBasic.params, subActionParams: { incident: { - ...mockServiceNow.params.subActionParams.incident, + ...mockServiceNowBasic.params.subActionParams.incident, short_description: 'success', }, comments: [{ commentId: 'success' }], @@ -397,9 +608,9 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { .set('kbn-xsrf', 'foo') .send({ params: { - ...mockServiceNow.params, + ...mockServiceNowBasic.params, subActionParams: { - incident: mockServiceNow.params.subActionParams.incident, + incident: mockServiceNowBasic.params.subActionParams.incident, comments: [], }, }, @@ -433,7 +644,7 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { apiUrl: serviceNowSimulatorURL, usesTableApi: true, }, - secrets: mockServiceNow.secrets, + secrets: mockServiceNowBasic.secrets, }); simulatedActionId = body.id; }); @@ -444,9 +655,9 @@ export default function serviceNowSIRTest({ getService }: FtrProviderContext) { .set('kbn-xsrf', 'foo') .send({ params: { - ...mockServiceNow.params, + ...mockServiceNowBasic.params, subActionParams: { - incident: mockServiceNow.params.subActionParams.incident, + incident: mockServiceNowBasic.params.subActionParams.incident, comments: [], }, }, diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/migrations.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/migrations.ts index 7b28161c18238..4f23a5ff3a727 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/migrations.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/migrations.ts @@ -6,6 +6,7 @@ */ import expect from '@kbn/expect'; +import { asyncForEach } from '@kbn/std'; import { getUrlPrefix } from '../../../common/lib'; import { FtrProviderContext } from '../../../common/ftr_provider_context'; @@ -83,6 +84,23 @@ export default function createGetTests({ getService }: FtrProviderContext) { expect(connectorWithoutService.body.config.service).to.eql('other'); }); + it('8.3.0 migrates service now connectors to have `isOAuth` property', async () => { + const serviceNowConnectorIds = [ + '7d04bc30-c4c0-11ec-ae29-917aa31a5b75', + '8a9331b0-c4c0-11ec-ae29-917aa31a5b75', + '6d3a1250-c4c0-11ec-ae29-917aa31a5b75', + ]; + + await asyncForEach(serviceNowConnectorIds, async (serviceNowConnectorId) => { + const connectorResponse = await supertest.get( + `${getUrlPrefix(``)}/api/actions/action/${serviceNowConnectorId}` + ); + + expect(connectorResponse.status).to.eql(200); + expect(connectorResponse.body.config.isOAuth).to.eql(false); + }); + }); + it('decryption error during migration', async () => { const badEmailConnector = await supertest.get( `${getUrlPrefix(``)}/api/actions/connector/0f8f2810-0a59-11ec-9a7c-fd0c2b83ff7d` diff --git a/x-pack/test/cases_api_integration/common/lib/utils.ts b/x-pack/test/cases_api_integration/common/lib/utils.ts index 7714c85b11d9a..ec0f9074df099 100644 --- a/x-pack/test/cases_api_integration/common/lib/utils.ts +++ b/x-pack/test/cases_api_integration/common/lib/utils.ts @@ -217,6 +217,23 @@ export const getServiceNowConnector = () => ({ }, }); +export const getServiceNowOAuthConnector = () => ({ + name: 'ServiceNow OAuth Connector', + connector_type_id: '.servicenow', + secrets: { + clientSecret: 'xyz', + privateKey: '-----BEGIN RSA PRIVATE KEY-----\nddddddd\n-----END RSA PRIVATE KEY-----', + }, + config: { + apiUrl: 'http://some.non.existent.com', + usesTableApi: false, + isOAuth: true, + clientId: 'abc', + userIdentifierValue: 'elastic', + jwtKeyId: 'def', + }, +}); + export const getJiraConnector = () => ({ name: 'Jira Connector', connector_type_id: '.jira', @@ -262,7 +279,7 @@ export const getResilientConnector = () => ({ }); export const getServiceNowSIRConnector = () => ({ - name: 'ServiceNow Connector', + name: 'ServiceNow SIR Connector', connector_type_id: '.servicenow-sir', secrets: { username: 'admin', diff --git a/x-pack/test/cases_api_integration/security_and_spaces/tests/trial/configure/get_connectors.ts b/x-pack/test/cases_api_integration/security_and_spaces/tests/trial/configure/get_connectors.ts index 26df77bfbc924..de72e0f343026 100644 --- a/x-pack/test/cases_api_integration/security_and_spaces/tests/trial/configure/get_connectors.ts +++ b/x-pack/test/cases_api_integration/security_and_spaces/tests/trial/configure/get_connectors.ts @@ -11,6 +11,7 @@ import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { ObjectRemover as ActionsRemover } from '../../../../../alerting_api_integration/common/lib'; import { getServiceNowConnector, + getServiceNowOAuthConnector, getJiraConnector, getResilientConnector, createConnector, @@ -31,6 +32,10 @@ export default ({ getService }: FtrProviderContext): void => { it('should return the correct connectors', async () => { const snConnector = await createConnector({ supertest, req: getServiceNowConnector() }); + const snOAuthConnector = await createConnector({ + supertest, + req: getServiceNowOAuthConnector(), + }); const emailConnector = await createConnector({ supertest, req: getEmailConnector() }); const jiraConnector = await createConnector({ supertest, req: getJiraConnector() }); const resilientConnector = await createConnector({ supertest, req: getResilientConnector() }); @@ -38,13 +43,15 @@ export default ({ getService }: FtrProviderContext): void => { actionsRemover.add('default', sir.id, 'action', 'actions'); actionsRemover.add('default', snConnector.id, 'action', 'actions'); + actionsRemover.add('default', snOAuthConnector.id, 'action', 'actions'); actionsRemover.add('default', emailConnector.id, 'action', 'actions'); actionsRemover.add('default', jiraConnector.id, 'action', 'actions'); actionsRemover.add('default', resilientConnector.id, 'action', 'actions'); const connectors = await getCaseConnectors({ supertest }); + const sortedConnectors = connectors.sort((a, b) => a.name.localeCompare(b.name)); - expect(connectors).to.eql([ + expect(sortedConnectors).to.eql([ { id: jiraConnector.id, actionTypeId: '.jira', @@ -90,6 +97,27 @@ export default ({ getService }: FtrProviderContext): void => { config: { apiUrl: 'http://some.non.existent.com', usesTableApi: false, + isOAuth: false, + clientId: null, + jwtKeyId: null, + userIdentifierValue: null, + }, + isPreconfigured: false, + isDeprecated: false, + isMissingSecrets: false, + referencedByCount: 0, + }, + { + id: snOAuthConnector.id, + actionTypeId: '.servicenow', + name: 'ServiceNow OAuth Connector', + config: { + apiUrl: 'http://some.non.existent.com', + usesTableApi: false, + isOAuth: true, + clientId: 'abc', + userIdentifierValue: 'elastic', + jwtKeyId: 'def', }, isPreconfigured: false, isDeprecated: false, @@ -99,10 +127,14 @@ export default ({ getService }: FtrProviderContext): void => { { id: sir.id, actionTypeId: '.servicenow-sir', - name: 'ServiceNow Connector', + name: 'ServiceNow SIR Connector', config: { apiUrl: 'http://some.non.existent.com', usesTableApi: false, + isOAuth: false, + clientId: null, + jwtKeyId: null, + userIdentifierValue: null, }, isPreconfigured: false, isDeprecated: false, diff --git a/x-pack/test/cases_api_integration/spaces_only/tests/trial/configure/get_connectors.ts b/x-pack/test/cases_api_integration/spaces_only/tests/trial/configure/get_connectors.ts index c4115b5c4902d..0ca47597e7b6b 100644 --- a/x-pack/test/cases_api_integration/spaces_only/tests/trial/configure/get_connectors.ts +++ b/x-pack/test/cases_api_integration/spaces_only/tests/trial/configure/get_connectors.ts @@ -11,6 +11,7 @@ import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { ObjectRemover as ActionsRemover } from '../../../../../alerting_api_integration/common/lib'; import { getServiceNowConnector, + getServiceNowOAuthConnector, getJiraConnector, getResilientConnector, createConnector, @@ -39,7 +40,11 @@ export default ({ getService }: FtrProviderContext): void => { req: getServiceNowConnector(), auth: authSpace1, }); - + const snOAuthConnector = await createConnector({ + supertest, + req: getServiceNowOAuthConnector(), + auth: authSpace1, + }); const emailConnector = await createConnector({ supertest, req: getEmailConnector(), @@ -66,13 +71,15 @@ export default ({ getService }: FtrProviderContext): void => { actionsRemover.add(space, sir.id, 'action', 'actions'); actionsRemover.add(space, snConnector.id, 'action', 'actions'); + actionsRemover.add(space, snOAuthConnector.id, 'action', 'actions'); actionsRemover.add(space, emailConnector.id, 'action', 'actions'); actionsRemover.add(space, jiraConnector.id, 'action', 'actions'); actionsRemover.add(space, resilientConnector.id, 'action', 'actions'); const connectors = await getCaseConnectors({ supertest, auth: authSpace1 }); + const sortedConnectors = connectors.sort((a, b) => a.name.localeCompare(b.name)); - expect(connectors).to.eql([ + expect(sortedConnectors).to.eql([ { id: jiraConnector.id, actionTypeId: '.jira', @@ -118,6 +125,27 @@ export default ({ getService }: FtrProviderContext): void => { config: { apiUrl: 'http://some.non.existent.com', usesTableApi: false, + isOAuth: false, + clientId: null, + jwtKeyId: null, + userIdentifierValue: null, + }, + isPreconfigured: false, + isDeprecated: false, + isMissingSecrets: false, + referencedByCount: 0, + }, + { + id: snOAuthConnector.id, + actionTypeId: '.servicenow', + name: 'ServiceNow OAuth Connector', + config: { + apiUrl: 'http://some.non.existent.com', + usesTableApi: false, + isOAuth: true, + clientId: 'abc', + userIdentifierValue: 'elastic', + jwtKeyId: 'def', }, isPreconfigured: false, isDeprecated: false, @@ -127,10 +155,14 @@ export default ({ getService }: FtrProviderContext): void => { { id: sir.id, actionTypeId: '.servicenow-sir', - name: 'ServiceNow Connector', + name: 'ServiceNow SIR Connector', config: { apiUrl: 'http://some.non.existent.com', usesTableApi: false, + isOAuth: false, + clientId: null, + jwtKeyId: null, + userIdentifierValue: null, }, isPreconfigured: false, isDeprecated: false, @@ -147,6 +179,12 @@ export default ({ getService }: FtrProviderContext): void => { auth: authSpace1, }); + const snOAuthConnector = await createConnector({ + supertest, + req: getServiceNowOAuthConnector(), + auth: authSpace1, + }); + const emailConnector = await createConnector({ supertest, req: getEmailConnector(), @@ -173,6 +211,7 @@ export default ({ getService }: FtrProviderContext): void => { actionsRemover.add(space, sir.id, 'action', 'actions'); actionsRemover.add(space, snConnector.id, 'action', 'actions'); + actionsRemover.add(space, snOAuthConnector.id, 'action', 'actions'); actionsRemover.add(space, emailConnector.id, 'action', 'actions'); actionsRemover.add(space, jiraConnector.id, 'action', 'actions'); actionsRemover.add(space, resilientConnector.id, 'action', 'actions'); diff --git a/x-pack/test/functional/es_archives/actions/data.json b/x-pack/test/functional/es_archives/actions/data.json index 79e7920872ab0..75206672358db 100644 --- a/x-pack/test/functional/es_archives/actions/data.json +++ b/x-pack/test/functional/es_archives/actions/data.json @@ -205,4 +205,96 @@ "updated_at": "2021-08-31T12:43:37.117Z" } } +} + +{ + "type": "doc", + "value": { + "id": "action:7d04bc30-c4c0-11ec-ae29-917aa31a5b75", + "index": ".kibana_1", + "source": { + "action": { + "actionTypeId" : ".servicenow-sir", + "name" : "test servicenow SecOps", + "isMissingSecrets" : false, + "config" : { + "apiUrl": "https://devtestsecops.service-now.com", + "usesTableApi": false + }, + "secrets" : "kPp4tl4ueQ2ZNWSfATR3dFrbxd+NNBo4MY8izS6GJf358Lmeg/YaYjb2rIymrbPktR6HnPBRaVyXWlRTvBGstRicJc0LJHZbx3wNJlTRIj4UFlVqZLGQWQ/GcSqFLSZ1JQbKwgAvyfLtF6BhjAhGYEovK3/OLUNzGc3gvUOOHBiPWjiAY8A=" + }, + "migrationVersion": { + "action": "8.0.0" + }, + "coreMigrationVersion" : "8.2.0", + "references": [ + ], + "namespaces": [ + "default" + ], + "type": "action", + "updated_at": "2022-04-25T17:52:35.201Z" + } + } +} + +{ + "type": "doc", + "value": { + "id": "action:8a9331b0-c4c0-11ec-ae29-917aa31a5b75", + "index": ".kibana_1", + "source": { + "action": { + "actionTypeId" : ".servicenow-itom", + "name" : "test servicenow ITOM", + "isMissingSecrets" : false, + "config" : { + "apiUrl": "https://devtestsecops.service-now.com" + }, + "secrets" : "yYThM4vbrSTIg5IjKWE+eMDrxzL7UO0JQIyh6FvEMgqoNREUxRrIavSo25v+DXQIX1DyfsvjjKg97pNPlZhvS3siCwDZZafSFrwkCKDl+S4KHORgIMX+slilcQeuEnzwit7bFxcY7Y/AcNF8Ks6jO0Gs1UR58ibSPUALXoK2VOlJnHSgtvE=" + }, + "migrationVersion": { + "action": "8.0.0" + }, + "coreMigrationVersion" : "8.2.0", + "references": [ + ], + "namespaces": [ + "default" + ], + "type": "action", + "updated_at": "2022-04-25T17:52:35.201Z" + } + } +} + +{ + "type": "doc", + "value": { + "id": "action:6d3a1250-c4c0-11ec-ae29-917aa31a5b75", + "index": ".kibana_1", + "source": { + "action": { + "actionTypeId" : ".servicenow", + "name" : "test servicenow ITSM", + "isMissingSecrets" : false, + "config" : { + "usesTableApi": false, + "apiUrl": "https://devtestsecops.service-now.com" + }, + "secrets" : "zfXUDtG0CyJkJUKnQ8rSqo75hb6ZhbRUWkV1NiFEjApM87b72Rcqz3Fv+sbm8eBDOO1Fdd9CVyK+Bfly4ZwVCgL2lR0qIbPzz34q36r267dnGVsaERyJIVv2WPy+EGdiRZKgfpy4XFbMNT1R3gyIsUkd4TT+McqGfVTont2XTFIpMW2A9y8=" + }, + "migrationVersion": { + "action": "8.0.0" + }, + "coreMigrationVersion" : "8.2.0", + "references": [ + ], + "namespaces": [ + "default" + ], + "type": "action", + "updated_at": "2022-04-25T17:52:35.201Z" + } + } } \ No newline at end of file From 6bc515fb644f7c8412e287b61447c983e2995268 Mon Sep 17 00:00:00 2001 From: Miriam <31922082+MiriamAparicio@users.noreply.github.com> Date: Fri, 29 Apr 2022 15:43:26 +0200 Subject: [PATCH 03/18] [APM] set max limit back to 500 (#131160) --- x-pack/plugins/apm/common/service_groups.ts | 2 +- .../apm/server/routes/service_groups/get_service_groups.ts | 4 ++-- .../apm/server/routes/service_groups/lookup_services.ts | 4 ++-- .../server/routes/services/__snapshots__/queries.test.ts.snap | 4 ++-- .../server/routes/services/get_services/get_services_items.ts | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/apm/common/service_groups.ts b/x-pack/plugins/apm/common/service_groups.ts index d56acc846dc1b..1fa6e03f43719 100644 --- a/x-pack/plugins/apm/common/service_groups.ts +++ b/x-pack/plugins/apm/common/service_groups.ts @@ -7,7 +7,7 @@ export const APM_SERVICE_GROUP_SAVED_OBJECT_TYPE = 'apm-service-group'; export const SERVICE_GROUP_COLOR_DEFAULT = '#D1DAE7'; -export const MAX_NUMBER_OF_SERVICES_IN_GROUP = 500; +export const MAX_NUMBER_OF_SERVICE_GROUPS = 500; export interface ServiceGroup { groupName: string; diff --git a/x-pack/plugins/apm/server/routes/service_groups/get_service_groups.ts b/x-pack/plugins/apm/server/routes/service_groups/get_service_groups.ts index 6307d273e12f5..2e4690777d466 100644 --- a/x-pack/plugins/apm/server/routes/service_groups/get_service_groups.ts +++ b/x-pack/plugins/apm/server/routes/service_groups/get_service_groups.ts @@ -10,7 +10,7 @@ import { ServiceGroup, SavedServiceGroup, APM_SERVICE_GROUP_SAVED_OBJECT_TYPE, - MAX_NUMBER_OF_SERVICES_IN_GROUP, + MAX_NUMBER_OF_SERVICE_GROUPS, } from '../../../common/service_groups'; export async function getServiceGroups({ @@ -21,7 +21,7 @@ export async function getServiceGroups({ const result = await savedObjectsClient.find({ type: APM_SERVICE_GROUP_SAVED_OBJECT_TYPE, page: 1, - perPage: MAX_NUMBER_OF_SERVICES_IN_GROUP, + perPage: MAX_NUMBER_OF_SERVICE_GROUPS, }); return result.saved_objects.map( ({ id, attributes, updated_at: upatedAt }) => ({ diff --git a/x-pack/plugins/apm/server/routes/service_groups/lookup_services.ts b/x-pack/plugins/apm/server/routes/service_groups/lookup_services.ts index a9b0d9fe8c57b..78b066a538699 100644 --- a/x-pack/plugins/apm/server/routes/service_groups/lookup_services.ts +++ b/x-pack/plugins/apm/server/routes/service_groups/lookup_services.ts @@ -14,7 +14,7 @@ import { } from '../../../common/elasticsearch_fieldnames'; import { ProcessorEvent } from '../../../common/processor_event'; import { Setup } from '../../lib/helpers/setup_request'; -import { MAX_NUMBER_OF_SERVICES_IN_GROUP } from '../../../common/service_groups'; +import { MAX_NUMBER_OF_SERVICE_GROUPS } from '../../../common/service_groups'; export async function lookupServices({ setup, @@ -49,7 +49,7 @@ export async function lookupServices({ services: { terms: { field: SERVICE_NAME, - size: MAX_NUMBER_OF_SERVICES_IN_GROUP, + size: MAX_NUMBER_OF_SERVICE_GROUPS, }, aggs: { environments: { diff --git a/x-pack/plugins/apm/server/routes/services/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/routes/services/__snapshots__/queries.test.ts.snap index e09c50708c476..8e2afb1bd1bf7 100644 --- a/x-pack/plugins/apm/server/routes/services/__snapshots__/queries.test.ts.snap +++ b/x-pack/plugins/apm/server/routes/services/__snapshots__/queries.test.ts.snap @@ -126,7 +126,7 @@ Array [ }, "terms": Object { "field": "service.name", - "size": 50, + "size": 500, }, }, }, @@ -186,7 +186,7 @@ Array [ }, "terms": Object { "field": "service.name", - "size": 50, + "size": 500, }, }, }, diff --git a/x-pack/plugins/apm/server/routes/services/get_services/get_services_items.ts b/x-pack/plugins/apm/server/routes/services/get_services/get_services_items.ts index a5936dd68d026..de484ed309884 100644 --- a/x-pack/plugins/apm/server/routes/services/get_services/get_services_items.ts +++ b/x-pack/plugins/apm/server/routes/services/get_services/get_services_items.ts @@ -16,7 +16,7 @@ import { ServiceGroup } from '../../../../common/service_groups'; export type ServicesItemsSetup = Setup; -const MAX_NUMBER_OF_SERVICES = 50; +const MAX_NUMBER_OF_SERVICES = 500; export async function getServicesItems({ environment, From 6e6c9614f5afec1f068d877ab6c3d7e125c1d07a Mon Sep 17 00:00:00 2001 From: Paul Tavares <56442535+paul-tavares@users.noreply.github.com> Date: Fri, 29 Apr 2022 10:04:25 -0400 Subject: [PATCH 04/18] [Security Solution][Endpoint] Add default query options to React-Query client and adjust existing hooks (#131165) * Expose the QueryClient used in the app as SecuritySolutionQueryClient * Add defaults to `SecuritySolutionQueryClient` * Update existing hooks and remove defaults from useQuery * Fix option Type for hooks that use `useMutation()` from React-Query --- .../query_client/query_client_provider.tsx | 28 +++++++++++++++++-- .../artifacts/use_bulk_delete_artifact.tsx | 9 ++++-- .../artifacts/use_bulk_update_artifact.tsx | 9 ++++-- .../hooks/artifacts/use_create_artifact.tsx | 9 ++++-- .../hooks/artifacts/use_delete_artifact.tsx | 9 ++++-- .../hooks/artifacts/use_get_artifact.tsx | 11 ++------ .../hooks/artifacts/use_list_artifact.tsx | 12 ++------ .../hooks/artifacts/use_summary_artifact.tsx | 12 ++------ .../hooks/artifacts/use_update_artifact.tsx | 9 ++++-- .../view/ingest_manager_integration/mocks.tsx | 4 +-- .../render_context_providers.tsx | 8 ++++-- .../management/services/policies/hooks.ts | 26 ++++++----------- 12 files changed, 83 insertions(+), 63 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/containers/query_client/query_client_provider.tsx b/x-pack/plugins/security_solution/public/common/containers/query_client/query_client_provider.tsx index 9d2f9ca9f48fa..2f67dc2734fed 100644 --- a/x-pack/plugins/security_solution/public/common/containers/query_client/query_client_provider.tsx +++ b/x-pack/plugins/security_solution/public/common/containers/query_client/query_client_provider.tsx @@ -8,14 +8,38 @@ import React, { memo, PropsWithChildren, useMemo } from 'react'; import { QueryClient, QueryClientProvider } from 'react-query'; +type QueryClientOptionsProp = ConstructorParameters[0]; + +/** + * A security solution specific react-query query client that sets defaults + */ +export class SecuritySolutionQueryClient extends QueryClient { + constructor(options: QueryClientOptionsProp = {}) { + const optionsWithDefaults: QueryClientOptionsProp = { + ...options, + defaultOptions: { + ...(options.defaultOptions ?? {}), + queries: { + refetchIntervalInBackground: false, + refetchOnWindowFocus: false, + refetchOnMount: true, + keepPreviousData: true, + ...(options?.defaultOptions?.queries ?? {}), + }, + }, + }; + super(optionsWithDefaults); + } +} + export type ReactQueryClientProviderProps = PropsWithChildren<{ - queryClient?: QueryClient; + queryClient?: SecuritySolutionQueryClient; }>; export const ReactQueryClientProvider = memo( ({ queryClient, children }) => { const client = useMemo(() => { - return queryClient || new QueryClient(); + return queryClient || new SecuritySolutionQueryClient(); }, [queryClient]); return {children}; } diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx index 994ed4f466d00..f534cc01e62ee 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx @@ -7,14 +7,19 @@ import pMap from 'p-map'; import { HttpFetchError } from '@kbn/core/public'; import { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; -import { useMutation, UseMutationResult, UseQueryOptions } from 'react-query'; +import { useMutation, UseMutationOptions, UseMutationResult } from 'react-query'; import { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; const DEFAULT_OPTIONS = Object.freeze({}); export function useBulkDeleteArtifact( exceptionListApiClient: ExceptionsListApiClient, - customOptions: UseQueryOptions = DEFAULT_OPTIONS, + customOptions: UseMutationOptions< + ExceptionListItemSchema[], + HttpFetchError, + Array<{ itemId?: string; id?: string }>, + () => void + > = DEFAULT_OPTIONS, options: { concurrency: number; } = { diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx index 3389b3563577a..68090e2aabc90 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx @@ -10,14 +10,19 @@ import { UpdateExceptionListItemSchema, ExceptionListItemSchema, } from '@kbn/securitysolution-io-ts-list-types'; -import { useMutation, UseMutationResult, UseQueryOptions } from 'react-query'; +import { useMutation, UseMutationOptions, UseMutationResult } from 'react-query'; import { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; const DEFAULT_OPTIONS = Object.freeze({}); export function useBulkUpdateArtifact( exceptionListApiClient: ExceptionsListApiClient, - customOptions: UseQueryOptions = DEFAULT_OPTIONS, + customOptions: UseMutationOptions< + ExceptionListItemSchema[], + HttpFetchError, + UpdateExceptionListItemSchema[], + () => void + > = DEFAULT_OPTIONS, options: { concurrency: number; } = { diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx index c1aed4be8005b..79dd59d744e7f 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx @@ -9,14 +9,19 @@ import { ExceptionListItemSchema, } from '@kbn/securitysolution-io-ts-list-types'; import { HttpFetchError } from '@kbn/core/public'; -import { useMutation, UseMutationResult, UseQueryOptions } from 'react-query'; +import { useMutation, UseMutationOptions, UseMutationResult } from 'react-query'; import { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; const DEFAULT_OPTIONS = Object.freeze({}); export function useCreateArtifact( exceptionListApiClient: ExceptionsListApiClient, - customOptions: UseQueryOptions = DEFAULT_OPTIONS + customOptions: UseMutationOptions< + ExceptionListItemSchema, + HttpFetchError, + CreateExceptionListItemSchema, + () => void + > = DEFAULT_OPTIONS ): UseMutationResult< ExceptionListItemSchema, HttpFetchError, diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx index 16568a0766444..a12b3aaa9ba40 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx @@ -6,14 +6,19 @@ */ import { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import { HttpFetchError } from '@kbn/core/public'; -import { useMutation, UseMutationResult, UseQueryOptions } from 'react-query'; +import { useMutation, UseMutationOptions, UseMutationResult } from 'react-query'; import { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; const DEFAULT_OPTIONS = Object.freeze({}); export function useDeleteArtifact( exceptionListApiClient: ExceptionsListApiClient, - customOptions: UseQueryOptions = DEFAULT_OPTIONS + customOptions: UseMutationOptions< + ExceptionListItemSchema, + HttpFetchError, + { itemId?: string; id?: string }, + () => void + > = DEFAULT_OPTIONS ): UseMutationResult< ExceptionListItemSchema, HttpFetchError, diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx index eb80a689e5a0d..36ae203707c28 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx @@ -9,24 +9,17 @@ import { HttpFetchError } from '@kbn/core/public'; import { QueryObserverResult, useQuery, UseQueryOptions } from 'react-query'; import { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; -const DEFAULT_OPTIONS = Object.freeze({}); - export function useGetArtifact( exceptionListApiClient: ExceptionsListApiClient, itemId?: string, id?: string, - customQueryOptions: UseQueryOptions = DEFAULT_OPTIONS + customQueryOptions?: UseQueryOptions ): QueryObserverResult { return useQuery( ['get', exceptionListApiClient, itemId, id], () => { return exceptionListApiClient.get(itemId, id); }, - { - refetchIntervalInBackground: false, - refetchOnWindowFocus: false, - refetchOnMount: true, - ...customQueryOptions, - } + customQueryOptions ); } diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx index 68bee6de0113a..64a5b908e2d9e 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx @@ -31,9 +31,7 @@ export function useListArtifact( excludedPolicies: string[]; }> = DEFAULT_OPTIONS, searchableFields: MaybeImmutable = DEFAULT_EXCEPTION_LIST_ITEM_SEARCHABLE_FIELDS, - customQueryOptions: Partial< - UseQueryOptions - > = DEFAULT_OPTIONS, + customQueryOptions?: Partial>, customQueryIds: string[] = [] ): QueryObserverResult { const { @@ -64,12 +62,6 @@ export function useListArtifact( return result; }, - { - refetchIntervalInBackground: false, - refetchOnWindowFocus: false, - refetchOnMount: true, - keepPreviousData: true, - ...customQueryOptions, - } + customQueryOptions ); } diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx index 62e5372dc39aa..111fdb4565785 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx @@ -21,9 +21,7 @@ export function useSummaryArtifact( policies: string[]; }> = DEFAULT_OPTIONS, searchableFields: MaybeImmutable = DEFAULT_EXCEPTION_LIST_ITEM_SEARCHABLE_FIELDS, - customQueryOptions: Partial< - UseQueryOptions - > = DEFAULT_OPTIONS + customQueryOptions: Partial> ): QueryObserverResult { const { filter = '', policies = [] } = options; @@ -37,12 +35,6 @@ export function useSummaryArtifact( }) ); }, - { - refetchIntervalInBackground: false, - refetchOnWindowFocus: false, - refetchOnMount: true, - keepPreviousData: true, - ...customQueryOptions, - } + customQueryOptions ); } diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx index 92da096f71e66..e3a7e37eebf56 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx @@ -9,14 +9,19 @@ import { ExceptionListItemSchema, } from '@kbn/securitysolution-io-ts-list-types'; import { HttpFetchError } from '@kbn/core/public'; -import { useMutation, UseMutationResult, UseQueryOptions } from 'react-query'; +import { useMutation, UseMutationOptions, UseMutationResult } from 'react-query'; import { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; const DEFAULT_OPTIONS = Object.freeze({}); export function useUpdateArtifact( exceptionListApiClient: ExceptionsListApiClient, - customQueryOptions: UseQueryOptions = DEFAULT_OPTIONS + customQueryOptions: UseMutationOptions< + ExceptionListItemSchema, + HttpFetchError, + UpdateExceptionListItemSchema, + () => void + > = DEFAULT_OPTIONS ): UseMutationResult< ExceptionListItemSchema, HttpFetchError, diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/mocks.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/mocks.tsx index 908ebc22a19cd..daa44f01dbffd 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/mocks.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/mocks.tsx @@ -13,7 +13,7 @@ import { I18nProvider } from '@kbn/i18n-react'; import type { PackageInfo } from '@kbn/fleet-plugin/common/types'; import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import { QueryClient } from 'react-query'; +import { SecuritySolutionQueryClient } from '../../../../../common/containers/query_client/query_client_provider'; import { AppContextTestRender, createAppRootMockRenderer, @@ -85,7 +85,7 @@ export const createFleetContextRendererMock = (): AppContextTestRender => { additionalMiddleware: [mockedContext.middlewareSpy.actionSpyMiddleware], }); - const queryClient = new QueryClient(); + const queryClient = new SecuritySolutionQueryClient(); const Wrapper: RenderOptions['wrapper'] = ({ children }) => { const services = useMemo(() => { diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/with_security_context/render_context_providers.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/with_security_context/render_context_providers.tsx index 9b3472192a718..ec222de1713f0 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/with_security_context/render_context_providers.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/with_security_context/render_context_providers.tsx @@ -8,8 +8,10 @@ import React, { memo, PropsWithChildren } from 'react'; import { Provider as ReduxStoreProvider } from 'react-redux'; import { Store } from 'redux'; -import type { QueryClient } from 'react-query'; -import { ReactQueryClientProvider } from '../../../../../../common/containers/query_client/query_client_provider'; +import { + ReactQueryClientProvider, + SecuritySolutionQueryClient, +} from '../../../../../../common/containers/query_client/query_client_provider'; import { SecuritySolutionStartDependenciesContext } from '../../../../../../common/components/user_privileges/endpoint/security_solution_start_dependencies'; import { CurrentLicense } from '../../../../../../common/components/current_license'; import { StartPlugins } from '../../../../../../types'; @@ -17,7 +19,7 @@ import { StartPlugins } from '../../../../../../types'; export type RenderContextProvidersProps = PropsWithChildren<{ store: Store; depsStart: Pick; - queryClient?: QueryClient; + queryClient?: SecuritySolutionQueryClient; }>; export const RenderContextProviders = memo( diff --git a/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts b/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts index 6cc6140d336d2..cf053128e5f37 100644 --- a/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts +++ b/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts @@ -40,11 +40,11 @@ export function useGetEndpointSpecificPolicies( }, }); }, - { - refetchIntervalInBackground: false, - refetchOnWindowFocus: false, - onError, - } + onError + ? { + onError, + } + : undefined ); } @@ -56,7 +56,7 @@ export function useGetEndpointSpecificPolicies( */ export function useGetAgentCountForPolicy({ policyIds, - customQueryOptions = {}, + customQueryOptions, }: { policyIds: string[]; customQueryOptions?: UseQueryOptions; @@ -72,11 +72,7 @@ export function useGetAgentCountForPolicy({ }, }); }, - { - refetchIntervalInBackground: false, - refetchOnWindowFocus: false, - ...customQueryOptions, - } + customQueryOptions ); } @@ -84,7 +80,7 @@ export function useGetAgentCountForPolicy({ * This hook returns the endpoint security package which contains endpoint version info */ export function useGetEndpointSecurityPackage({ - customQueryOptions = {}, + customQueryOptions, }: { customQueryOptions?: UseQueryOptions; }): QueryObserverResult { @@ -94,10 +90,6 @@ export function useGetEndpointSecurityPackage({ () => { return sendGetEndpointSecurityPackage(http); }, - { - refetchIntervalInBackground: false, - refetchOnWindowFocus: false, - ...customQueryOptions, - } + customQueryOptions ); } From e603d92552f14c609e76790f8e64af1c659bde30 Mon Sep 17 00:00:00 2001 From: Anton Dosov Date: Fri, 29 Apr 2022 16:43:59 +0200 Subject: [PATCH 05/18] Remove `data_enhanced` plugin (#122075) Code moved into `data` plugin --- .../steps/storybooks/build_and_upload.js | 2 +- .github/CODEOWNERS | 1 - dev_docs/tutorials/data/search.mdx | 2 +- docs/developer/plugin-list.asciidoc | 4 - packages/kbn-optimizer/limits.yml | 3 +- .../resources/base/bin/kibana-docker | 7 + src/dev/storybook/aliases.ts | 2 +- .../plugins/data}/.storybook/main.js | 5 +- src/plugins/data/config.ts | 31 +- src/plugins/data/kibana.json | 12 +- src/plugins/data/public/plugin.ts | 10 +- .../data/public/search/search_service.test.ts | 14 +- .../data/public/search/search_service.ts | 101 ++- ...onnected_search_session_indicator.test.tsx | 11 +- .../connected_search_session_indicator.tsx | 15 +- .../index.ts | 5 +- .../search_session_tour.tsx | 8 +- .../search_session_view_state.ts | 5 +- .../session/session_indicator}/index.ts | 5 +- .../components}/index.ts | 5 +- .../components/search_session_name}/index.ts | 5 +- .../search_session_name.tsx | 16 +- .../search_session_indicator/custom_icons.tsx | 5 +- .../search_session_indicator/index.tsx | 5 +- .../search_session_indicator.scss | 0 .../search_session_indicator.stories.tsx | 7 +- .../search_session_indicator.test.tsx | 7 +- .../search_session_indicator.tsx | 113 ++-- .../sessions_mgmt/__mocks__/index.tsx | 5 +- .../sessions_mgmt/application/index.tsx | 29 +- .../sessions_mgmt/application/render.tsx | 5 +- .../components/actions/delete_button.tsx | 17 +- .../components/actions/extend_button.tsx | 17 +- .../components/actions/get_action.tsx | 5 +- .../components/actions/index.tsx | 5 +- .../components/actions/inspect_button.scss | 0 .../components/actions/inspect_button.tsx | 11 +- .../components/actions/popover_actions.tsx | 9 +- .../components/actions/rename_button.tsx | 24 +- .../sessions_mgmt/components/actions/types.ts | 5 +- .../sessions_mgmt/components/index.tsx | 5 +- .../sessions_mgmt/components/main.test.tsx | 23 +- .../sessions_mgmt/components/main.tsx | 19 +- .../sessions_mgmt/components/status.test.tsx | 7 +- .../sessions_mgmt/components/status.tsx | 47 +- .../components/table/app_filter.tsx | 7 +- .../sessions_mgmt/components/table/index.ts | 5 +- .../components/table/status_filter.tsx | 7 +- .../components/table/table.test.tsx | 31 +- .../sessions_mgmt/components/table/table.tsx | 32 +- .../sessions_mgmt/icons/extend_session.svg | 0 .../search/session}/sessions_mgmt/index.ts | 36 +- .../session}/sessions_mgmt/lib/api.test.ts | 13 +- .../search/session}/sessions_mgmt/lib/api.ts | 32 +- .../session}/sessions_mgmt/lib/date_string.ts | 5 +- .../sessions_mgmt/lib/documentation.ts | 5 +- .../sessions_mgmt/lib/get_columns.test.tsx | 59 +- .../sessions_mgmt/lib/get_columns.tsx | 41 +- .../lib/get_expiration_status.ts | 29 +- .../search/session}/sessions_mgmt/types.ts | 7 +- src/plugins/data/public/types.ts | 6 + .../data/server/config_deprecations.test.ts | 40 +- .../data/server/config_deprecations.ts | 11 +- src/plugins/data/server/index.ts | 2 + src/plugins/data/server/plugin.ts | 43 +- .../search/collectors/{ => search}/fetch.ts | 0 .../search/collectors/{ => search}/index.ts | 0 .../collectors/{ => search}/register.ts | 0 .../search/collectors/{ => search}/usage.ts | 4 +- .../collectors/search_session}/fetch.test.ts | 5 +- .../collectors/search_session}/fetch.ts | 8 +- .../collectors/search_session}/index.ts | 5 +- .../collectors/search_session}/register.ts | 5 +- src/plugins/data/server/search/index.ts | 4 +- src/plugins/data/server/search/mocks.ts | 1 - .../data/server/search/routes/index.ts | 1 + .../server/search}/routes/session.test.ts | 10 +- .../data/server/search}/routes/session.ts | 9 +- .../server/search}/saved_objects/index.ts | 5 +- .../search}/saved_objects/search_session.ts | 7 +- .../search_session_migration.test.ts | 7 +- .../saved_objects/search_session_migration.ts | 7 +- .../data/server/search/search_service.test.ts | 20 +- .../data/server/search/search_service.ts | 82 ++- .../check_non_persisted_sessions.test.ts | 18 +- .../session/check_non_persisted_sessions.ts | 16 +- .../session/check_persisted_sessions.test.ts | 9 +- .../session/check_persisted_sessions.ts | 19 +- .../session/expire_persisted_sessions.ts | 19 +- .../session/get_search_session_page.test.ts | 13 +- .../search/session/get_search_session_page.ts | 12 +- .../search/session/get_search_status.test.ts | 5 +- .../search/session/get_search_status.ts | 13 +- .../search/session/get_session_status.test.ts | 12 +- .../search/session/get_session_status.ts | 12 +- .../search/session/session_service.test.ts | 17 +- .../server/search/session/session_service.ts | 578 ++++++++++++++++-- .../data}/server/search/session/setup_task.ts | 14 +- .../data/server/search/session/types.ts | 52 +- .../session/update_session_status.test.ts | 7 +- .../search/session/update_session_status.ts | 19 +- .../data}/server/search/session/utils.test.ts | 5 +- .../data}/server/search/session/utils.ts | 7 +- .../es_search/es_search_strategy.ts | 6 +- .../ese_search/ese_search_strategy.ts | 2 +- src/plugins/data/server/search/types.ts | 13 +- src/plugins/data/tsconfig.json | 6 +- src/plugins/es_ui_shared/kibana.json | 2 +- .../public/indices/constants/index.ts | 6 +- .../field_validators/index_pattern_field.ts | 4 +- src/plugins/es_ui_shared/tsconfig.json | 2 +- src/plugins/telemetry/schema/oss_plugins.json | 13 + .../test_suites/core_plugins/rendering.ts | 28 +- test/scripts/jenkins_storybook.sh | 2 +- tsconfig.base.json | 2 - tsconfig.types.json | 8 +- x-pack/.i18nrc.json | 1 - x-pack/plugins/actions/tsconfig.json | 1 + x-pack/plugins/data_enhanced/README.md | 16 - x-pack/plugins/data_enhanced/common/index.ts | 6 - .../data_enhanced/common/search/index.ts | 6 - .../search_phase_execution_exception.json | 229 ------- x-pack/plugins/data_enhanced/config.ts | 17 - x-pack/plugins/data_enhanced/jest.config.js | 17 - x-pack/plugins/data_enhanced/kibana.json | 29 - x-pack/plugins/data_enhanced/public/index.ts | 17 - x-pack/plugins/data_enhanced/public/plugin.ts | 92 --- .../data_enhanced/public/search/index.ts | 8 - x-pack/plugins/data_enhanced/server/index.ts | 25 - x-pack/plugins/data_enhanced/server/plugin.ts | 71 --- .../data_enhanced/server/routes/index.ts | 8 - .../data_enhanced/server/search/index.ts | 8 - .../server/search/session/index.ts | 8 - .../server/search/session/session_service.ts | 548 ----------------- .../server/search/session/types.ts | 63 -- x-pack/plugins/data_enhanced/server/type.ts | 41 -- x-pack/plugins/data_enhanced/tsconfig.json | 31 - x-pack/plugins/infra/kibana.json | 1 - x-pack/plugins/infra/public/types.ts | 3 - x-pack/plugins/infra/tsconfig.json | 1 - x-pack/plugins/osquery/kibana.json | 1 - x-pack/plugins/osquery/tsconfig.json | 1 - x-pack/plugins/runtime_fields/public/types.ts | 7 +- .../roles/edit_role/edit_role_page.test.tsx | 6 +- .../roles/edit_role/edit_role_page.tsx | 2 +- x-pack/plugins/security_solution/kibana.json | 1 - .../common/hooks/eql/use_eql_preview.ts | 2 +- .../plugins/security_solution/tsconfig.json | 1 - .../schema/xpack_plugins.json | 13 - x-pack/plugins/timelines/kibana.json | 2 +- x-pack/plugins/timelines/tsconfig.json | 1 - .../translations/translations/fr-FR.json | 317 +++++++--- .../translations/translations/ja-JP.json | 205 ++++--- .../translations/translations/zh-CN.json | 205 ++++--- .../plugins/timelines_test/kibana.json | 2 +- x-pack/test/tsconfig.json | 1 - 156 files changed, 1874 insertions(+), 2311 deletions(-) rename {x-pack/plugins/data_enhanced => src/plugins/data}/.storybook/main.js (54%) rename {x-pack/plugins/data_enhanced/public/search/ui => src/plugins/data/public/search/session/session_indicator}/connected_search_session_indicator/connected_search_session_indicator.test.tsx (97%) rename {x-pack/plugins/data_enhanced/public/search/ui => src/plugins/data/public/search/session/session_indicator}/connected_search_session_indicator/connected_search_session_indicator.tsx (92%) rename {x-pack/plugins/data_enhanced/public/search/ui => src/plugins/data/public/search/session/session_indicator}/connected_search_session_indicator/index.ts (64%) rename {x-pack/plugins/data_enhanced/public/search/ui => src/plugins/data/public/search/session/session_indicator}/connected_search_session_indicator/search_session_tour.tsx (92%) rename {x-pack/plugins/data_enhanced/public/search/ui => src/plugins/data/public/search/session/session_indicator}/connected_search_session_indicator/search_session_view_state.ts (80%) rename {x-pack/plugins/data_enhanced/public/search/ui => src/plugins/data/public/search/session/session_indicator}/index.ts (53%) rename {x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/components/search_session_name => src/plugins/data/public/search/session/session_indicator/search_session_indicator/components}/index.ts (52%) rename {x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/components => src/plugins/data/public/search/session/session_indicator/search_session_indicator/components/search_session_name}/index.ts (52%) rename {x-pack/plugins/data_enhanced/public/search/ui => src/plugins/data/public/search/session/session_indicator}/search_session_indicator/components/search_session_name/search_session_name.tsx (83%) rename {x-pack/plugins/data_enhanced/public/search/ui => src/plugins/data/public/search/session/session_indicator}/search_session_indicator/custom_icons.tsx (91%) rename {x-pack/plugins/data_enhanced/public/search/ui => src/plugins/data/public/search/session/session_indicator}/search_session_indicator/index.tsx (82%) rename {x-pack/plugins/data_enhanced/public/search/ui => src/plugins/data/public/search/session/session_indicator}/search_session_indicator/search_session_indicator.scss (100%) rename {x-pack/plugins/data_enhanced/public/search/ui => src/plugins/data/public/search/session/session_indicator}/search_session_indicator/search_session_indicator.stories.tsx (90%) rename {x-pack/plugins/data_enhanced/public/search/ui => src/plugins/data/public/search/session/session_indicator}/search_session_indicator/search_session_indicator.test.tsx (93%) rename {x-pack/plugins/data_enhanced/public/search/ui => src/plugins/data/public/search/session/session_indicator}/search_session_indicator/search_session_indicator.tsx (75%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/__mocks__/index.tsx (68%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/application/index.tsx (67%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/application/render.tsx (85%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/actions/delete_button.tsx (77%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/actions/extend_button.tsx (79%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/actions/get_action.tsx (87%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/actions/index.tsx (56%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/actions/inspect_button.scss (100%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/actions/inspect_button.tsx (88%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/actions/popover_actions.tsx (89%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/actions/rename_button.tsx (80%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/actions/types.ts (65%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/index.tsx (83%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/main.test.tsx (83%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/main.tsx (72%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/status.test.tsx (94%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/status.tsx (78%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/table/app_filter.tsx (76%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/table/index.ts (53%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/table/status_filter.tsx (79%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/table/table.test.tsx (87%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/components/table/table.tsx (81%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/icons/extend_session.svg (100%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/index.ts (60%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/lib/api.test.ts (95%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/lib/api.ts (85%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/lib/date_string.ts (77%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/lib/documentation.ts (71%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/lib/get_columns.test.tsx (89%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/lib/get_columns.tsx (85%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/lib/get_expiration_status.ts (56%) rename {x-pack/plugins/data_enhanced/public/search => src/plugins/data/public/search/session}/sessions_mgmt/types.ts (84%) rename src/plugins/data/server/search/collectors/{ => search}/fetch.ts (100%) rename src/plugins/data/server/search/collectors/{ => search}/index.ts (100%) rename src/plugins/data/server/search/collectors/{ => search}/register.ts (100%) rename src/plugins/data/server/search/collectors/{ => search}/usage.ts (97%) rename {x-pack/plugins/data_enhanced/server/collectors => src/plugins/data/server/search/collectors/search_session}/fetch.test.ts (92%) rename {x-pack/plugins/data_enhanced/server/collectors => src/plugins/data/server/search/collectors/search_session}/fetch.ts (89%) rename {x-pack/plugins/data_enhanced/server/collectors => src/plugins/data/server/search/collectors/search_session}/index.ts (53%) rename {x-pack/plugins/data_enhanced/server/collectors => src/plugins/data/server/search/collectors/search_session}/register.ts (84%) rename {x-pack/plugins/data_enhanced/server => src/plugins/data/server/search}/routes/session.test.ts (94%) rename {x-pack/plugins/data_enhanced/server => src/plugins/data/server/search}/routes/session.ts (95%) rename {x-pack/plugins/data_enhanced/server => src/plugins/data/server/search}/saved_objects/index.ts (51%) rename {x-pack/plugins/data_enhanced/server => src/plugins/data/server/search}/saved_objects/search_session.ts (85%) rename {x-pack/plugins/data_enhanced/server => src/plugins/data/server/search}/saved_objects/search_session_migration.test.ts (97%) rename {x-pack/plugins/data_enhanced/server => src/plugins/data/server/search}/saved_objects/search_session_migration.ts (93%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/check_non_persisted_sessions.test.ts (96%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/check_non_persisted_sessions.ts (91%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/check_persisted_sessions.test.ts (87%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/check_persisted_sessions.ts (81%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/expire_persisted_sessions.ts (80%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/get_search_session_page.test.ts (94%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/get_search_session_page.ts (81%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/get_search_status.test.ts (92%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/get_search_status.ts (80%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/get_session_status.test.ts (85%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/get_session_status.ts (75%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/session_service.test.ts (98%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/setup_task.ts (88%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/update_session_status.test.ts (97%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/update_session_status.ts (90%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/utils.test.ts (75%) rename {x-pack/plugins/data_enhanced => src/plugins/data}/server/search/session/utils.ts (78%) delete mode 100644 x-pack/plugins/data_enhanced/README.md delete mode 100644 x-pack/plugins/data_enhanced/common/index.ts delete mode 100644 x-pack/plugins/data_enhanced/common/search/index.ts delete mode 100644 x-pack/plugins/data_enhanced/common/search/test_data/search_phase_execution_exception.json delete mode 100644 x-pack/plugins/data_enhanced/config.ts delete mode 100644 x-pack/plugins/data_enhanced/jest.config.js delete mode 100644 x-pack/plugins/data_enhanced/kibana.json delete mode 100644 x-pack/plugins/data_enhanced/public/index.ts delete mode 100644 x-pack/plugins/data_enhanced/public/plugin.ts delete mode 100644 x-pack/plugins/data_enhanced/public/search/index.ts delete mode 100644 x-pack/plugins/data_enhanced/server/index.ts delete mode 100644 x-pack/plugins/data_enhanced/server/plugin.ts delete mode 100644 x-pack/plugins/data_enhanced/server/routes/index.ts delete mode 100644 x-pack/plugins/data_enhanced/server/search/index.ts delete mode 100644 x-pack/plugins/data_enhanced/server/search/session/index.ts delete mode 100644 x-pack/plugins/data_enhanced/server/search/session/session_service.ts delete mode 100644 x-pack/plugins/data_enhanced/server/search/session/types.ts delete mode 100644 x-pack/plugins/data_enhanced/server/type.ts delete mode 100644 x-pack/plugins/data_enhanced/tsconfig.json diff --git a/.buildkite/scripts/steps/storybooks/build_and_upload.js b/.buildkite/scripts/steps/storybooks/build_and_upload.js index 482640b8d9cc0..becb8f1bd871f 100644 --- a/.buildkite/scripts/steps/storybooks/build_and_upload.js +++ b/.buildkite/scripts/steps/storybooks/build_and_upload.js @@ -20,7 +20,7 @@ const STORYBOOKS = [ 'custom_integrations', 'dashboard_enhanced', 'dashboard', - 'data_enhanced', + 'data', 'embeddable', 'expression_error', 'expression_image', diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 215514d58f601..7f7c048717f02 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -79,7 +79,6 @@ /src/plugins/inspector/ @elastic/kibana-app-services /src/plugins/unified_search/ @elastic/kibana-app-services /x-pack/examples/ui_actions_enhanced_examples/ @elastic/kibana-app-services -/x-pack/plugins/data_enhanced/ @elastic/kibana-app-services /x-pack/plugins/embeddable_enhanced/ @elastic/kibana-app-services /x-pack/plugins/ui_actions_enhanced/ @elastic/kibana-app-services /x-pack/plugins/runtime_fields @elastic/kibana-app-services diff --git a/dev_docs/tutorials/data/search.mdx b/dev_docs/tutorials/data/search.mdx index 0787c44b632ec..ab5c3f29ea1be 100644 --- a/dev_docs/tutorials/data/search.mdx +++ b/dev_docs/tutorials/data/search.mdx @@ -259,7 +259,7 @@ export const myEnhancedSearchStrategyProvider = ( await ese.cancel(id, options, deps); }, extend: async (id, keepAlive, options, deps) => { - // async search results are not stored indefinitely. By default, they expire after 7 days (or as defined by xpack.data_enhanced.search.sessions.defaultExpiration setting in kibana.yml). + // async search results are not stored indefinitely. By default, they expire after 7 days (or as defined by data.search.sessions.defaultExpiration setting in kibana.yml). // call the extend method of the async strategy you are using or implement your own extend function. await ese.extend(id, options, deps); }, diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 90bf3d3c29b41..63e104c44b173 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -412,10 +412,6 @@ The plugin exposes the static DefaultEditorController class to consume. |Adds drilldown capabilities to dashboard. Owned by the Kibana App team. -|{kib-repo}blob/{branch}/x-pack/plugins/data_enhanced/README.md[dataEnhanced] -|The data_enhanced plugin is the x-pack counterpart to the src/plguins/data plugin. - - |{kib-repo}blob/{branch}/x-pack/plugins/data_visualizer/README.md[dataVisualizer] |The data_visualizer plugin enables you to explore the fields in your data. diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index dc16c080306ad..4c83bc19f1cda 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -104,8 +104,7 @@ pageLoadAssetSize: fieldFormats: 65209 kibanaReact: 74422 share: 71239 - uiActions: 35121 - dataEnhanced: 24980 + uiActions: 35121 embeddable: 87309 embeddableEnhanced: 22107 uiActionsEnhanced: 38494 diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index 7b569f8d02068..77e8e5d63bbdf 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -40,6 +40,13 @@ kibana_vars=( csp.report_to data.autocomplete.valueSuggestions.terminateAfter data.autocomplete.valueSuggestions.timeout + data.search.sessions.defaultExpiration + data.search.sessions.enabled + data.search.sessions.maxUpdateRetries + data.search.sessions.notTouchedInProgressTimeout + data.search.sessions.notTouchedTimeout + data.search.sessions.pageSize + data.search.sessions.trackingInterval unifiedSearch.autocomplete.valueSuggestions.terminateAfter unifiedSearch.autocomplete.valueSuggestions.timeout unifiedSearch.autocomplete.querySuggestions.enabled diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index 8075abcdcf79b..4167719d3bb31 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -17,7 +17,7 @@ export const storybookAliases = { custom_integrations: 'src/plugins/custom_integrations/storybook', dashboard_enhanced: 'x-pack/plugins/dashboard_enhanced/.storybook', dashboard: 'src/plugins/dashboard/.storybook', - data_enhanced: 'x-pack/plugins/data_enhanced/.storybook', + data: 'src/plugins/data/.storybook', discover: 'src/plugins/discover/.storybook', embeddable: 'src/plugins/embeddable/.storybook', expression_error: 'src/plugins/expression_error/.storybook', diff --git a/x-pack/plugins/data_enhanced/.storybook/main.js b/src/plugins/data/.storybook/main.js similarity index 54% rename from x-pack/plugins/data_enhanced/.storybook/main.js rename to src/plugins/data/.storybook/main.js index 86b48c32f103e..8dc3c5d1518f4 100644 --- a/x-pack/plugins/data_enhanced/.storybook/main.js +++ b/src/plugins/data/.storybook/main.js @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ module.exports = require('@kbn/storybook').defaultConfig; diff --git a/src/plugins/data/config.ts b/src/plugins/data/config.ts index c419683de9868..0ec794d9bd63c 100644 --- a/src/plugins/data/config.ts +++ b/src/plugins/data/config.ts @@ -8,21 +8,6 @@ import { schema, TypeOf } from '@kbn/config-schema'; -export const configSchema = schema.object({ - search: schema.object({ - aggs: schema.object({ - shardDelay: schema.object({ - // Whether or not to register the shard_delay (which is only available in snapshot versions - // of Elasticsearch) agg type/expression function to make it available in the UI for either - // functional or manual testing - enabled: schema.boolean({ defaultValue: false }), - }), - }), - }), -}); - -export type ConfigSchema = TypeOf; - export const searchSessionsConfigSchema = schema.object({ /** * Turns the feature on \ off (incl. removing indicator and management screens) @@ -90,4 +75,20 @@ export const searchSessionsConfigSchema = schema.object({ }), }); +export const configSchema = schema.object({ + search: schema.object({ + aggs: schema.object({ + shardDelay: schema.object({ + // Whether or not to register the shard_delay (which is only available in snapshot versions + // of Elasticsearch) agg type/expression function to make it available in the UI for either + // functional or manual testing + enabled: schema.boolean({ defaultValue: false }), + }), + }), + sessions: searchSessionsConfigSchema, + }), +}); + +export type ConfigSchema = TypeOf; + export type SearchSessionsConfigSchema = TypeOf; diff --git a/src/plugins/data/kibana.json b/src/plugins/data/kibana.json index fa7453d4c5bda..9c428930bc9ab 100644 --- a/src/plugins/data/kibana.json +++ b/src/plugins/data/kibana.json @@ -3,7 +3,17 @@ "version": "kibana", "server": true, "ui": true, - "requiredPlugins": ["bfetch", "expressions", "uiActions", "share", "inspector", "fieldFormats", "dataViews"], + "requiredPlugins": [ + "bfetch", + "expressions", + "uiActions", + "share", + "inspector", + "fieldFormats", + "dataViews", + "screenshotMode", + "management" + ], "serviceFolders": ["search", "query", "ui"], "optionalPlugins": ["usageCollection", "taskManager", "security"], "extraPublicDirs": ["common"], diff --git a/src/plugins/data/public/plugin.ts b/src/plugins/data/public/plugin.ts index 175d05870b0c6..0790df6a95df2 100644 --- a/src/plugins/data/public/plugin.ts +++ b/src/plugins/data/public/plugin.ts @@ -73,6 +73,7 @@ export class DataPublicPlugin usageCollection, inspector, fieldFormats, + management, }: DataSetupDependencies ): DataPublicPluginSetup { const startServices = createStartServicesGetter(core.getStartServices); @@ -84,6 +85,7 @@ export class DataPublicPlugin usageCollection, expressions, nowProvider: this.nowProvider, + management, }); const queryService = this.queryService.setup({ @@ -117,7 +119,7 @@ export class DataPublicPlugin public start( core: CoreStart, - { uiActions, fieldFormats, dataViews }: DataStartDependencies + { uiActions, fieldFormats, dataViews, screenshotMode }: DataStartDependencies ): DataPublicPluginStart { const { uiSettings, notifications, overlays } = core; setNotifications(notifications); @@ -131,7 +133,11 @@ export class DataPublicPlugin uiSettings, }); - const search = this.searchService.start(core, { fieldFormats, indexPatterns: dataViews }); + const search = this.searchService.start(core, { + fieldFormats, + indexPatterns: dataViews, + screenshotMode, + }); setSearchService(search); uiActions.addTriggerAction( diff --git a/src/plugins/data/public/search/search_service.test.ts b/src/plugins/data/public/search/search_service.test.ts index 8c1fba48c7b4b..d717d275f55cd 100644 --- a/src/plugins/data/public/search/search_service.test.ts +++ b/src/plugins/data/public/search/search_service.test.ts @@ -12,6 +12,8 @@ import { CoreSetup, CoreStart } from '@kbn/core/public'; import { SearchService, SearchServiceSetupDependencies } from './search_service'; import { bfetchPluginMock } from '@kbn/bfetch-plugin/public/mocks'; +import { managementPluginMock } from '@kbn/management-plugin/public/mocks'; +import { screenshotModePluginMock } from '@kbn/screenshot-mode-plugin/public/mocks'; describe('Search service', () => { let searchService: SearchService; @@ -19,7 +21,7 @@ describe('Search service', () => { let mockCoreStart: MockedKeys; const initializerContext = coreMock.createPluginInitializerContext(); initializerContext.config.get = jest.fn().mockReturnValue({ - search: { aggs: { shardDelay: { enabled: false } } }, + search: { aggs: { shardDelay: { enabled: false } }, sessions: { enabled: true } }, }); beforeEach(() => { @@ -35,6 +37,7 @@ describe('Search service', () => { packageInfo: { version: '8' }, bfetch, expressions: { registerFunction: jest.fn(), registerType: jest.fn() }, + management: managementPluginMock.createSetupContract(), } as unknown as SearchServiceSetupDependencies); expect(setup).toHaveProperty('aggs'); expect(setup).toHaveProperty('usageCollector'); @@ -45,9 +48,18 @@ describe('Search service', () => { describe('start()', () => { it('exposes proper contract', async () => { + const bfetch = bfetchPluginMock.createSetupContract(); + searchService.setup(mockCoreSetup, { + packageInfo: { version: '8' }, + bfetch, + expressions: { registerFunction: jest.fn(), registerType: jest.fn() }, + management: managementPluginMock.createSetupContract(), + } as unknown as SearchServiceSetupDependencies); + const start = searchService.start(mockCoreStart, { fieldFormats: {}, indexPatterns: {}, + screenshotMode: screenshotModePluginMock.createStartContract(), } as any); expect(start).toHaveProperty('aggs'); expect(start).toHaveProperty('search'); diff --git a/src/plugins/data/public/search/search_service.ts b/src/plugins/data/public/search/search_service.ts index 52271426d28e1..767fcaf815927 100644 --- a/src/plugins/data/public/search/search_service.ts +++ b/src/plugins/data/public/search/search_service.ts @@ -7,62 +7,71 @@ */ import { - Plugin, CoreSetup, CoreStart, + Plugin, PluginInitializerContext, StartServicesAccessor, } from '@kbn/core/public'; import { BehaviorSubject } from 'rxjs'; +import React from 'react'; +import moment from 'moment'; import { BfetchPublicSetup } from '@kbn/bfetch-plugin/public'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; import { ExpressionsSetup } from '@kbn/expressions-plugin/public'; +import { toMountPoint } from '@kbn/kibana-react-plugin/public'; +import { Storage } from '@kbn/kibana-utils-plugin/public'; +import { ScreenshotModePluginStart } from '@kbn/screenshot-mode-plugin/public'; +import { ManagementSetup } from '@kbn/management-plugin/public'; import type { ISearchSetup, ISearchStart } from './types'; import { handleResponse } from './fetch'; import { - kibana, - kibanaContext, - ISearchGeneric, - SearchSourceDependencies, - SearchSourceService, - extendedBoundsFunction, - ipRangeFunction, - kibanaTimerangeFunction, - luceneFunction, - kqlFunction, - fieldFunction, - numericalRangeFunction, - rangeFunction, cidrFunction, dateRangeFunction, + esRawResponse, existsFilterFunction, + extendedBoundsFunction, + fieldFunction, geoBoundingBoxFunction, geoPointFunction, + ipRangeFunction, + ISearchGeneric, + kibana, + kibanaContext, + kibanaFilterFunction, + kibanaTimerangeFunction, + kqlFunction, + luceneFunction, + numericalRangeFunction, + phraseFilterFunction, queryFilterFunction, rangeFilterFunction, + rangeFunction, removeFilterFunction, + SearchSourceDependencies, + SearchSourceService, selectFilterFunction, - kibanaFilterFunction, - phraseFilterFunction, - esRawResponse, eqlRawResponse, } from '../../common/search'; import { AggsService, AggsStartDependencies } from './aggs'; import { IKibanaSearchResponse, IndexPatternsContract, SearchRequest } from '..'; import { ISearchInterceptor, SearchInterceptor } from './search_interceptor'; -import { SearchUsageCollector, createUsageCollector } from './collectors'; +import { createUsageCollector, SearchUsageCollector } from './collectors'; import { getEsaggs, getEsdsl, getEql } from './expressions'; import { ISessionsClient, ISessionService, SessionsClient, SessionService } from './session'; import { ConfigSchema } from '../../config'; import { - SHARD_DELAY_AGG_NAME, getShardDelayBucketAgg, + SHARD_DELAY_AGG_NAME, } from '../../common/search/aggs/buckets/shard_delay'; import { aggShardDelay } from '../../common/search/aggs/buckets/shard_delay_fn'; import { DataPublicPluginStart, DataStartDependencies } from '../types'; import { NowProviderInternalContract } from '../now_provider'; import { getKibanaContext } from './expressions/kibana_context'; +import { createConnectedSearchSessionIndicator } from './session/session_indicator'; + +import { registerSearchSessionsMgmt } from './session/sessions_mgmt'; /** @internal */ export interface SearchServiceSetupDependencies { @@ -70,12 +79,14 @@ export interface SearchServiceSetupDependencies { expressions: ExpressionsSetup; usageCollection?: UsageCollectionSetup; nowProvider: NowProviderInternalContract; + management: ManagementSetup; } /** @internal */ export interface SearchServiceStartDependencies { fieldFormats: AggsStartDependencies['fieldFormats']; indexPatterns: IndexPatternsContract; + screenshotMode: ScreenshotModePluginStart; } export class SearchService implements Plugin { @@ -89,9 +100,16 @@ export class SearchService implements Plugin { constructor(private initializerContext: PluginInitializerContext) {} public setup( - { http, getStartServices, notifications, uiSettings, executionContext, theme }: CoreSetup, - { bfetch, expressions, usageCollection, nowProvider }: SearchServiceSetupDependencies + core: CoreSetup, + { + bfetch, + expressions, + usageCollection, + nowProvider, + management, + }: SearchServiceSetupDependencies ): ISearchSetup { + const { http, getStartServices, notifications, uiSettings, executionContext, theme } = core; this.usageCollector = createUsageCollector(getStartServices, usageCollection); this.sessionsClient = new SessionsClient({ http }); @@ -173,6 +191,21 @@ export class SearchService implements Plugin { expressions.registerFunction(aggShardDelay); } + const config = this.initializerContext.config.get(); + if (config.search.sessions.enabled) { + const sessionsConfig = config.search.sessions; + registerSearchSessionsMgmt( + core as CoreSetup, + { + searchUsageCollector: this.usageCollector!, + sessionsClient: this.sessionsClient, + management, + }, + sessionsConfig, + this.initializerContext.env.packageInfo.version + ); + } + return { aggs, usageCollector: this.usageCollector!, @@ -182,8 +215,8 @@ export class SearchService implements Plugin { } public start( - { http, theme, uiSettings }: CoreStart, - { fieldFormats, indexPatterns }: SearchServiceStartDependencies + { http, theme, uiSettings, chrome, application }: CoreStart, + { fieldFormats, indexPatterns, screenshotMode }: SearchServiceStartDependencies ): ISearchStart { const search = ((request, options = {}) => { return this.searchInterceptor.search(request, options); @@ -199,6 +232,28 @@ export class SearchService implements Plugin { handleResponse(request, response, theme), }; + const config = this.initializerContext.config.get(); + if (config.search.sessions.enabled) { + chrome.setBreadcrumbsAppendExtension({ + content: toMountPoint( + React.createElement( + createConnectedSearchSessionIndicator({ + sessionService: this.sessionService, + application, + basePath: http.basePath, + storage: new Storage(window.localStorage), + disableSaveAfterSessionCompletesTimeout: moment + .duration(config.search.sessions.notTouchedTimeout) + .asMilliseconds(), + usageCollector: this.usageCollector, + tourDisabled: screenshotMode.isScreenshotMode(), + }) + ), + { theme$: theme.theme$ } + ), + }); + } + return { aggs: this.aggsService.start({ fieldFormats, uiSettings, indexPatterns }), search, diff --git a/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.test.tsx b/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.test.tsx similarity index 97% rename from x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.test.tsx rename to src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.test.tsx index 7c93d5cd78e68..d791cf51ddbe6 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.test.tsx +++ b/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.test.tsx @@ -1,15 +1,16 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React, { ReactNode } from 'react'; import { StubBrowserStorage } from '@kbn/test-jest-helpers'; import { render, waitFor, screen, act } from '@testing-library/react'; import { Storage } from '@kbn/kibana-utils-plugin/public'; -import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; +import { dataPluginMock } from '../../../../mocks'; import { createConnectedSearchSessionIndicator } from './connected_search_session_indicator'; import { BehaviorSubject } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -19,12 +20,12 @@ import { SearchSessionState, SearchUsageCollector, TimefilterContract, -} from '@kbn/data-plugin/public'; +} from '../../../..'; import { coreMock } from '@kbn/core/public/mocks'; import { TOUR_RESTORE_STEP_KEY, TOUR_TAKING_TOO_LONG_STEP_KEY } from './search_session_tour'; import userEvent from '@testing-library/user-event'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; -import { createSearchUsageCollectorMock } from '@kbn/data-plugin/public/search/collectors/mocks'; +import { createSearchUsageCollectorMock } from '../../../collectors/mocks'; const coreStart = coreMock.createStart(); const application = coreStart.application; diff --git a/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.tsx b/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.tsx similarity index 92% rename from x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.tsx rename to src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.tsx index 23abbf3084073..727a188fc2c00 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.tsx +++ b/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/connected_search_session_indicator.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React, { useCallback, useEffect, useState } from 'react'; @@ -10,12 +11,14 @@ import { debounce, distinctUntilChanged, mapTo, switchMap, tap } from 'rxjs/oper import { merge, of, timer } from 'rxjs'; import useObservable from 'react-use/lib/useObservable'; import { i18n } from '@kbn/i18n'; -import { ISessionService, SearchSessionState, SearchUsageCollector } from '@kbn/data-plugin/public'; import { RedirectAppLinks } from '@kbn/kibana-react-plugin/public'; -import { ApplicationStart, IBasePath } from '@kbn/core/public'; import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; +import { ApplicationStart, IBasePath } from '@kbn/core/public'; import { SearchSessionIndicator, SearchSessionIndicatorRef } from '../search_session_indicator'; import { useSearchSessionTour } from './search_session_tour'; +import { SearchUsageCollector } from '../../../collectors'; +import { ISessionService } from '../../session_service'; +import { SearchSessionState } from '../../search_session_state'; export interface SearchSessionIndicatorDeps { sessionService: ISessionService; @@ -82,7 +85,7 @@ export const createConnectedSearchSessionIndicator = ({ if (disableSaveAfterSessionCompleteTimedOut) { saveDisabled = true; saveDisabledReasonText = i18n.translate( - 'xpack.data.searchSessionIndicator.disabledDueToTimeoutMessage', + 'data.searchSessionIndicator.disabledDueToTimeoutMessage', { defaultMessage: 'Search session results expired.', } @@ -99,7 +102,7 @@ export const createConnectedSearchSessionIndicator = ({ if (!sessionService.hasAccess()) { managementDisabled = saveDisabled = true; managementDisabledReasonText = saveDisabledReasonText = i18n.translate( - 'xpack.data.searchSessionIndicator.disabledDueToDisabledGloballyMessage', + 'data.searchSessionIndicator.disabledDueToDisabledGloballyMessage', { defaultMessage: "You don't have permissions to manage search sessions", } diff --git a/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/index.ts b/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/index.ts similarity index 64% rename from x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/index.ts rename to src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/index.ts index fec61f8115486..def7915b836c8 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/index.ts +++ b/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/index.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export type { SearchSessionIndicatorDeps } from './connected_search_session_indicator'; diff --git a/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/search_session_tour.tsx b/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/search_session_tour.tsx similarity index 92% rename from x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/search_session_tour.tsx rename to src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/search_session_tour.tsx index 2d9c29681a41c..2975ffb774b5c 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/search_session_tour.tsx +++ b/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/search_session_tour.tsx @@ -1,15 +1,17 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { useCallback, useEffect } from 'react'; import { once } from 'lodash'; import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; -import { SearchSessionState, SearchUsageCollector } from '@kbn/data-plugin/public'; import { SearchSessionIndicatorRef } from '../search_session_indicator'; +import { SearchSessionState } from '../../search_session_state'; +import { SearchUsageCollector } from '../../../collectors'; const TOUR_TAKING_TOO_LONG_TIMEOUT = 10000; export const TOUR_TAKING_TOO_LONG_STEP_KEY = `data.searchSession.tour.takingTooLong`; diff --git a/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/search_session_view_state.ts b/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/search_session_view_state.ts similarity index 80% rename from x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/search_session_view_state.ts rename to src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/search_session_view_state.ts index 84884115093d6..2fec31333650b 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/search_session_view_state.ts +++ b/src/plugins/data/public/search/session/session_indicator/connected_search_session_indicator/search_session_view_state.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export enum SearchSessionViewState { diff --git a/x-pack/plugins/data_enhanced/public/search/ui/index.ts b/src/plugins/data/public/search/session/session_indicator/index.ts similarity index 53% rename from x-pack/plugins/data_enhanced/public/search/ui/index.ts rename to src/plugins/data/public/search/session/session_indicator/index.ts index e8f83db6ed98c..c126347a07691 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/index.ts +++ b/src/plugins/data/public/search/session/session_indicator/index.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export * from './connected_search_session_indicator'; diff --git a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/components/search_session_name/index.ts b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/components/index.ts similarity index 52% rename from x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/components/search_session_name/index.ts rename to src/plugins/data/public/search/session/session_indicator/search_session_indicator/components/index.ts index 9093e1a2535e2..d0e7457b882b0 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/components/search_session_name/index.ts +++ b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/components/index.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export * from './search_session_name'; diff --git a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/components/index.ts b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/components/search_session_name/index.ts similarity index 52% rename from x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/components/index.ts rename to src/plugins/data/public/search/session/session_indicator/search_session_indicator/components/search_session_name/index.ts index 9093e1a2535e2..d0e7457b882b0 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/components/index.ts +++ b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/components/search_session_name/index.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export * from './search_session_name'; diff --git a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/components/search_session_name/search_session_name.tsx b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/components/search_session_name/search_session_name.tsx similarity index 83% rename from x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/components/search_session_name/search_session_name.tsx rename to src/plugins/data/public/search/session/session_indicator/search_session_indicator/components/search_session_name/search_session_name.tsx index 4cb72dcbf4554..2473b844097bf 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/components/search_session_name/search_session_name.tsx +++ b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/components/search_session_name/search_session_name.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React, { useEffect } from 'react'; @@ -45,7 +46,7 @@ export const SearchSessionName: React.FC = ({ name, edit autoFocus={true} iconType={'pencil'} color={'text'} - aria-label={i18n.translate('xpack.data.searchSessionName.editAriaLabelText', { + aria-label={i18n.translate('data.searchSessionName.editAriaLabelText', { defaultMessage: 'Edit search session name', })} data-test-subj={'searchSessionNameEdit'} @@ -56,14 +57,14 @@ export const SearchSessionName: React.FC = ({ name, edit { setNewName(e.target.value); }} - aria-label={i18n.translate('xpack.data.searchSessionName.ariaLabelText', { + aria-label={i18n.translate('data.searchSessionName.ariaLabelText', { defaultMessage: 'Search session name', })} data-test-subj={'searchSessionNameInput'} @@ -89,10 +90,7 @@ export const SearchSessionName: React.FC = ({ name, edit isLoading={isSaving} data-test-subj={'searchSessionNameSave'} > - + } /> diff --git a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/custom_icons.tsx b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/custom_icons.tsx similarity index 91% rename from x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/custom_icons.tsx rename to src/plugins/data/public/search/session/session_indicator/search_session_indicator/custom_icons.tsx index 94aa1d41abd38..18acd56d9a51b 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/custom_icons.tsx +++ b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/custom_icons.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; diff --git a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/index.tsx b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/index.tsx similarity index 82% rename from x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/index.tsx rename to src/plugins/data/public/search/session/session_indicator/search_session_indicator/index.tsx index fe86ad2fb5cea..eb35ea58339e2 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/index.tsx +++ b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/index.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiDelayRender, EuiLoadingSpinner } from '@elastic/eui'; diff --git a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.scss b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/search_session_indicator.scss similarity index 100% rename from x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.scss rename to src/plugins/data/public/search/session/session_indicator/search_session_indicator/search_session_indicator.scss diff --git a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.stories.tsx b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/search_session_indicator.stories.tsx similarity index 90% rename from x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.stories.tsx rename to src/plugins/data/public/search/session/session_indicator/search_session_indicator/search_session_indicator.stories.tsx index 654dfee17c5a2..ffb77a872ec75 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.stories.tsx +++ b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/search_session_indicator.stories.tsx @@ -1,14 +1,15 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; import { storiesOf } from '@storybook/react'; -import { SearchSessionState } from '@kbn/data-plugin/public'; import { SearchSessionIndicator } from './search_session_indicator'; +import { SearchSessionState } from '../../search_session_state'; storiesOf('components/SearchSessionIndicator', module).add('default', () => { const [searchSessionName, setSearchSessionName] = React.useState('Discover session'); diff --git a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.test.tsx b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/search_session_indicator.test.tsx similarity index 93% rename from x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.test.tsx rename to src/plugins/data/public/search/session/session_indicator/search_session_indicator/search_session_indicator.test.tsx index 26563bfa02fa7..3fe0e1172487c 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.test.tsx +++ b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/search_session_indicator.test.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React, { ReactNode } from 'react'; @@ -10,7 +11,7 @@ import { screen, render } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { SearchSessionIndicator } from './search_session_indicator'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; -import { SearchSessionState } from '@kbn/data-plugin/public'; +import { SearchSessionState } from '../../../..'; function Container({ children }: { children?: ReactNode }) { return {children}; diff --git a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.tsx b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/search_session_indicator.tsx similarity index 75% rename from x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.tsx rename to src/plugins/data/public/search/session/session_indicator/search_session_indicator/search_session_indicator.tsx index 540cb6b5bebd4..239a4ea4c2aa7 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.tsx +++ b/src/plugins/data/public/search/session/session_indicator/search_session_indicator/search_session_indicator.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React, { useCallback, useImperativeHandle } from 'react'; @@ -22,10 +23,10 @@ import { import moment from 'moment'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; -import { SearchSessionState } from '@kbn/data-plugin/public'; import { CheckInEmptyCircle, PartialClock } from './custom_icons'; import './search_session_indicator.scss'; import { SearchSessionName } from './components'; +import { SearchSessionState } from '../../search_session_state'; export interface SearchSessionIndicatorProps { state: SearchSessionState; @@ -59,7 +60,7 @@ const CancelButton = ({ onCancel = () => {}, buttonProps = {} }: ActionButtonPro {...buttonProps} > @@ -79,7 +80,7 @@ const ContinueInBackgroundButton = ({ {...buttonProps} > @@ -103,7 +104,7 @@ const ViewAllSearchSessionsButton = ({ {...buttonProps} > @@ -124,7 +125,7 @@ const SaveButton = ({ {...buttonProps} > @@ -150,24 +151,22 @@ const searchSessionIndicatorViewStateToProps: { button: { color: 'text', iconType: PartialClock, - 'aria-label': i18n.translate( - 'xpack.data.searchSessionIndicator.loadingResultsIconAriaLabel', - { defaultMessage: 'Search session loading' } - ), - tooltipText: i18n.translate( - 'xpack.data.searchSessionIndicator.loadingResultsIconTooltipText', - { defaultMessage: 'Search session loading' } - ), + 'aria-label': i18n.translate('data.searchSessionIndicator.loadingResultsIconAriaLabel', { + defaultMessage: 'Search session loading', + }), + tooltipText: i18n.translate('data.searchSessionIndicator.loadingResultsIconTooltipText', { + defaultMessage: 'Search session loading', + }), }, popover: { - title: i18n.translate('xpack.data.searchSessionIndicator.loadingResultsTitle', { + title: i18n.translate('data.searchSessionIndicator.loadingResultsTitle', { defaultMessage: 'Your search is taking a while...', }), - description: i18n.translate('xpack.data.searchSessionIndicator.loadingResultsDescription', { + description: i18n.translate('data.searchSessionIndicator.loadingResultsDescription', { defaultMessage: 'Save your session, continue your work, and return to completed results', }), whenText: (props: SearchSessionIndicatorProps) => - i18n.translate('xpack.data.searchSessionIndicator.loadingResultsWhenText', { + i18n.translate('data.searchSessionIndicator.loadingResultsWhenText', { defaultMessage: 'Started {when}', values: { when: props.startedTime ? moment(props.startedTime).format(`L @ LTS`) : '', @@ -181,28 +180,22 @@ const searchSessionIndicatorViewStateToProps: { button: { color: 'text', iconType: 'check', - 'aria-label': i18n.translate('xpack.data.searchSessionIndicator.resultsLoadedIconAriaLabel', { + 'aria-label': i18n.translate('data.searchSessionIndicator.resultsLoadedIconAriaLabel', { + defaultMessage: 'Search session complete', + }), + tooltipText: i18n.translate('data.searchSessionIndicator.resultsLoadedIconTooltipText', { defaultMessage: 'Search session complete', }), - tooltipText: i18n.translate( - 'xpack.data.searchSessionIndicator.resultsLoadedIconTooltipText', - { - defaultMessage: 'Search session complete', - } - ), }, popover: { - title: i18n.translate('xpack.data.searchSessionIndicator.resultsLoadedText', { + title: i18n.translate('data.searchSessionIndicator.resultsLoadedText', { defaultMessage: 'Search session complete', }), - description: i18n.translate( - 'xpack.data.searchSessionIndicator.resultsLoadedDescriptionText', - { - defaultMessage: 'Save your session and return to it later', - } - ), + description: i18n.translate('data.searchSessionIndicator.resultsLoadedDescriptionText', { + defaultMessage: 'Save your session and return to it later', + }), whenText: (props: SearchSessionIndicatorProps) => - i18n.translate('xpack.data.searchSessionIndicator.resultsLoadedWhenText', { + i18n.translate('data.searchSessionIndicator.resultsLoadedWhenText', { defaultMessage: 'Completed {when}', values: { when: props.completedTime ? moment(props.completedTime).format(`L @ LTS`) : '', @@ -216,30 +209,30 @@ const searchSessionIndicatorViewStateToProps: { button: { iconType: EuiLoadingSpinner, 'aria-label': i18n.translate( - 'xpack.data.searchSessionIndicator.loadingInTheBackgroundIconAriaLabel', + 'data.searchSessionIndicator.loadingInTheBackgroundIconAriaLabel', { defaultMessage: 'Saved session in progress', } ), tooltipText: i18n.translate( - 'xpack.data.searchSessionIndicator.loadingInTheBackgroundIconTooltipText', + 'data.searchSessionIndicator.loadingInTheBackgroundIconTooltipText', { defaultMessage: 'Saved session in progress', } ), }, popover: { - title: i18n.translate('xpack.data.searchSessionIndicator.loadingInTheBackgroundTitleText', { + title: i18n.translate('data.searchSessionIndicator.loadingInTheBackgroundTitleText', { defaultMessage: 'Saved session in progress', }), description: i18n.translate( - 'xpack.data.searchSessionIndicator.loadingInTheBackgroundDescriptionText', + 'data.searchSessionIndicator.loadingInTheBackgroundDescriptionText', { defaultMessage: 'You can return to completed results from Management', } ), whenText: (props: SearchSessionIndicatorProps) => - i18n.translate('xpack.data.searchSessionIndicator.loadingInTheBackgroundWhenText', { + i18n.translate('data.searchSessionIndicator.loadingInTheBackgroundWhenText', { defaultMessage: 'Started {when}', values: { when: props.startedTime ? moment(props.startedTime).format(`L @ LTS`) : '', @@ -254,33 +247,30 @@ const searchSessionIndicatorViewStateToProps: { color: 'success', iconType: 'checkInCircleFilled', 'aria-label': i18n.translate( - 'xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundIconAriaLabel', + 'data.searchSessionIndicator.resultLoadedInTheBackgroundIconAriaLabel', { defaultMessage: 'Saved session complete', } ), tooltipText: i18n.translate( - 'xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundIconTooltipText', + 'data.searchSessionIndicator.resultLoadedInTheBackgroundIconTooltipText', { defaultMessage: 'Saved session complete', } ), }, popover: { - title: i18n.translate( - 'xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundTitleText', - { - defaultMessage: 'Search session saved', - } - ), + title: i18n.translate('data.searchSessionIndicator.resultLoadedInTheBackgroundTitleText', { + defaultMessage: 'Search session saved', + }), description: i18n.translate( - 'xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundDescriptionText', + 'data.searchSessionIndicator.resultLoadedInTheBackgroundDescriptionText', { defaultMessage: 'You can return to these results from Management', } ), whenText: (props: SearchSessionIndicatorProps) => - i18n.translate('xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundWhenText', { + i18n.translate('data.searchSessionIndicator.resultLoadedInTheBackgroundWhenText', { defaultMessage: 'Completed {when}', values: { when: props.completedTime ? moment(props.completedTime).format(`L @ LTS`) : '', @@ -293,26 +283,23 @@ const searchSessionIndicatorViewStateToProps: { button: { color: 'success', iconType: CheckInEmptyCircle, - 'aria-label': i18n.translate( - 'xpack.data.searchSessionIndicator.restoredResultsIconAriaLabel', - { - defaultMessage: 'Saved session restored', - } - ), - tooltipText: i18n.translate('xpack.data.searchSessionIndicator.restoredResultsTooltipText', { + 'aria-label': i18n.translate('data.searchSessionIndicator.restoredResultsIconAriaLabel', { + defaultMessage: 'Saved session restored', + }), + tooltipText: i18n.translate('data.searchSessionIndicator.restoredResultsTooltipText', { defaultMessage: 'Search session restored', }), }, popover: { - title: i18n.translate('xpack.data.searchSessionIndicator.restoredTitleText', { + title: i18n.translate('data.searchSessionIndicator.restoredTitleText', { defaultMessage: 'Search session restored', }), - description: i18n.translate('xpack.data.searchSessionIndicator.restoredDescriptionText', { + description: i18n.translate('data.searchSessionIndicator.restoredDescriptionText', { defaultMessage: 'You are viewing cached data from a specific time range. Changing the time range or filters will re-run the session', }), whenText: (props: SearchSessionIndicatorProps) => - i18n.translate('xpack.data.searchSessionIndicator.restoredWhenText', { + i18n.translate('data.searchSessionIndicator.restoredWhenText', { defaultMessage: 'Completed {when}', values: { when: props.completedTime ? moment(props.completedTime).format(`L @ LTS`) : '', @@ -325,22 +312,22 @@ const searchSessionIndicatorViewStateToProps: { button: { color: 'danger', iconType: 'alert', - 'aria-label': i18n.translate('xpack.data.searchSessionIndicator.canceledIconAriaLabel', { + 'aria-label': i18n.translate('data.searchSessionIndicator.canceledIconAriaLabel', { defaultMessage: 'Search session stopped', }), - tooltipText: i18n.translate('xpack.data.searchSessionIndicator.canceledTooltipText', { + tooltipText: i18n.translate('data.searchSessionIndicator.canceledTooltipText', { defaultMessage: 'Search session stopped', }), }, popover: { - title: i18n.translate('xpack.data.searchSessionIndicator.canceledTitleText', { + title: i18n.translate('data.searchSessionIndicator.canceledTitleText', { defaultMessage: 'Search session stopped', }), - description: i18n.translate('xpack.data.searchSessionIndicator.canceledDescriptionText', { + description: i18n.translate('data.searchSessionIndicator.canceledDescriptionText', { defaultMessage: 'You are viewing incomplete data', }), whenText: (props: SearchSessionIndicatorProps) => - i18n.translate('xpack.data.searchSessionIndicator.canceledWhenText', { + i18n.translate('data.searchSessionIndicator.canceledWhenText', { defaultMessage: 'Stopped {when}', values: { when: props.canceledTime ? moment(props.canceledTime).format(`L @ LTS`) : '', diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/__mocks__/index.tsx b/src/plugins/data/public/search/session/sessions_mgmt/__mocks__/index.tsx similarity index 68% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/__mocks__/index.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/__mocks__/index.tsx index 7c089c8db9634..3d3592df0bb67 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/__mocks__/index.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/__mocks__/index.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React, { ReactNode } from 'react'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/application/index.tsx b/src/plugins/data/public/search/session/sessions_mgmt/application/index.tsx similarity index 67% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/application/index.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/application/index.tsx index d2be863170a4b..b0a15ca405743 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/application/index.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/application/index.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { CoreSetup } from '@kbn/core/public'; @@ -11,24 +12,24 @@ import type { AppDependencies, IManagementSectionsPluginsSetup, IManagementSectionsPluginsStart, - SessionsConfigSchema, } from '..'; import { APP } from '..'; import { SearchSessionsMgmtAPI } from '../lib/api'; import { AsyncSearchIntroDocumentation } from '../lib/documentation'; import { renderApp } from './render'; +import { SearchSessionsConfigSchema } from '../../../../../config'; export class SearchSessionsMgmtApp { constructor( private coreSetup: CoreSetup, - private config: SessionsConfigSchema, + private setupDeps: IManagementSectionsPluginsSetup, + private config: SearchSessionsConfigSchema, private kibanaVersion: string, - private params: ManagementAppMountParams, - private pluginsSetup: IManagementSectionsPluginsSetup + private params: ManagementAppMountParams ) {} public async mountManagementSection() { - const { coreSetup, params, pluginsSetup } = this; + const { coreSetup, params, setupDeps } = this; const [coreStart, pluginsStart] = await coreSetup.getStartServices(); const { @@ -40,24 +41,21 @@ export class SearchSessionsMgmtApp { uiSettings, application, } = coreStart; - const { data, share } = pluginsStart; const pluginName = APP.getI18nName(); docTitle.change(pluginName); - params.setBreadcrumbs([{ text: pluginName }]); + this.params.setBreadcrumbs([{ text: pluginName }]); - const { sessionsClient } = data.search; - const api = new SearchSessionsMgmtAPI(sessionsClient, this.config, { + const api = new SearchSessionsMgmtAPI(setupDeps.sessionsClient, this.config, { notifications, - locators: share.url.locators, + locators: pluginsStart.share.url.locators, application, - usageCollector: pluginsSetup.data.search.usageCollector, + usageCollector: setupDeps.searchUsageCollector, }); const documentation = new AsyncSearchIntroDocumentation(docLinks); const dependencies: AppDependencies = { - plugins: pluginsSetup, config: this.config, documentation, core: coreStart, @@ -65,8 +63,9 @@ export class SearchSessionsMgmtApp { http, i18n, uiSettings, - share, + share: pluginsStart.share, kibanaVersion: this.kibanaVersion, + searchUsageCollector: setupDeps.searchUsageCollector, }; const { element } = params; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/application/render.tsx b/src/plugins/data/public/search/session/sessions_mgmt/application/render.tsx similarity index 85% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/application/render.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/application/render.tsx index 563179064062b..87ceb6ee8a942 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/application/render.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/application/render.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/delete_button.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/actions/delete_button.tsx similarity index 77% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/delete_button.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/components/actions/delete_button.tsx index d612aada1084a..0581af4a872ff 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/delete_button.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/actions/delete_button.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiConfirmModal } from '@elastic/eui'; @@ -26,16 +27,16 @@ const DeleteConfirm = (props: DeleteButtonProps & { onActionDismiss: OnActionDis const { name, id } = searchSession; const [isLoading, setIsLoading] = useState(false); - const title = i18n.translate('xpack.data.mgmt.searchSessions.cancelModal.title', { + const title = i18n.translate('data.mgmt.searchSessions.cancelModal.title', { defaultMessage: 'Delete search session', }); - const confirm = i18n.translate('xpack.data.mgmt.searchSessions.cancelModal.deleteButton', { + const confirm = i18n.translate('data.mgmt.searchSessions.cancelModal.deleteButton', { defaultMessage: 'Delete', }); - const cancel = i18n.translate('xpack.data.mgmt.searchSessions.cancelModal.cancelButton', { + const cancel = i18n.translate('data.mgmt.searchSessions.cancelModal.cancelButton', { defaultMessage: 'Cancel', }); - const message = i18n.translate('xpack.data.mgmt.searchSessions.cancelModal.message', { + const message = i18n.translate('data.mgmt.searchSessions.cancelModal.message', { defaultMessage: `Deleting the search session \'{name}\' deletes all cached results.`, values: { name, @@ -68,9 +69,7 @@ export const createDeleteActionDescriptor = ( core: CoreStart ): IClickActionDescriptor => ({ iconType: 'crossInACircleFilled', - label: ( - - ), + label: , onClick: async () => { const ref = core.overlays.openModal( toMountPoint( diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/extend_button.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/actions/extend_button.tsx similarity index 79% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/extend_button.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/components/actions/extend_button.tsx index bb64fef09aba8..4b955e7bf93a3 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/extend_button.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/actions/extend_button.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiConfirmModal } from '@elastic/eui'; @@ -31,16 +32,16 @@ const ExtendConfirm = ({ ...props }: ExtendButtonProps & { onActionDismiss: OnAc const newExpiration = moment(expires).add(extendByDuration); - const title = i18n.translate('xpack.data.mgmt.searchSessions.extendModal.title', { + const title = i18n.translate('data.mgmt.searchSessions.extendModal.title', { defaultMessage: 'Extend search session expiration', }); - const confirm = i18n.translate('xpack.data.mgmt.searchSessions.extendModal.extendButton', { + const confirm = i18n.translate('data.mgmt.searchSessions.extendModal.extendButton', { defaultMessage: 'Extend expiration', }); - const extend = i18n.translate('xpack.data.mgmt.searchSessions.extendModal.dontExtendButton', { + const extend = i18n.translate('data.mgmt.searchSessions.extendModal.dontExtendButton', { defaultMessage: 'Cancel', }); - const message = i18n.translate('xpack.data.mgmt.searchSessions.extendModal.extendMessage', { + const message = i18n.translate('data.mgmt.searchSessions.extendModal.extendMessage', { defaultMessage: "The search session '{name}' expiration would be extended until {newExpires}.", values: { name, @@ -75,9 +76,7 @@ export const createExtendActionDescriptor = ( core: CoreStart ): IClickActionDescriptor => ({ iconType: extendSessionIcon, - label: ( - - ), + label: , onClick: async () => { const ref = core.overlays.openModal( toMountPoint( diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/get_action.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/actions/get_action.tsx similarity index 87% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/get_action.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/components/actions/get_action.tsx index 4ab246b5ee403..33ea4013d605e 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/get_action.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/actions/get_action.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { CoreStart } from '@kbn/core/public'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/index.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/actions/index.tsx similarity index 56% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/index.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/components/actions/index.tsx index cecd50125e90e..7b01e2fb7673f 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/index.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/actions/index.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { PopoverActionsMenu } from './popover_actions'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/inspect_button.scss b/src/plugins/data/public/search/session/sessions_mgmt/components/actions/inspect_button.scss similarity index 100% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/inspect_button.scss rename to src/plugins/data/public/search/session/sessions_mgmt/components/actions/inspect_button.scss diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/inspect_button.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/actions/inspect_button.tsx similarity index 88% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/inspect_button.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/components/actions/inspect_button.tsx index 823ab99c0213f..4ba404e708662 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/inspect_button.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/actions/inspect_button.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiFlyoutBody, EuiFlyoutHeader, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; @@ -58,7 +59,7 @@ const InspectFlyout = ({ uiSettings, searchSession }: InspectFlyoutProps) => {

@@ -69,7 +70,7 @@ const InspectFlyout = ({ uiSettings, searchSession }: InspectFlyoutProps) => {

@@ -90,7 +91,7 @@ export const createInspectActionDescriptor = ( iconType: 'document', label: ( diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/popover_actions.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/actions/popover_actions.tsx similarity index 89% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/popover_actions.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/components/actions/popover_actions.tsx index 35661dce80da6..a335c481b1d3e 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/popover_actions.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/actions/popover_actions.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { @@ -49,12 +50,12 @@ export const PopoverActionsMenu = ({ const renderPopoverButton = () => ( ({ iconType: 'pencil', - label: ( - - ), + label: , onClick: async () => { const ref = core.overlays.openModal( toMountPoint( diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/types.ts b/src/plugins/data/public/search/session/sessions_mgmt/components/actions/types.ts similarity index 65% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/types.ts rename to src/plugins/data/public/search/session/sessions_mgmt/components/actions/types.ts index c808f8469cccf..645cee6725c8f 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/types.ts +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/actions/types.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export type OnActionComplete = () => void; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/index.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/index.tsx similarity index 83% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/index.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/components/index.tsx index 2970c75e651d6..c9ba988e1330b 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/index.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/index.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiLinkProps, EuiText, EuiTextProps } from '@elastic/eui'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/main.test.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/main.test.tsx similarity index 83% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/main.test.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/components/main.test.tsx index fac9cda42eef2..183dc80883c57 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/main.test.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/main.test.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { MockedKeys } from '@kbn/utility-types/jest'; @@ -12,34 +13,30 @@ import moment from 'moment'; import React from 'react'; import { act } from 'react-dom/test-utils'; import { coreMock } from '@kbn/core/public/mocks'; -import { SessionsClient } from '@kbn/data-plugin/public/search'; -import { IManagementSectionsPluginsSetup, SessionsConfigSchema } from '..'; +import { SearchUsageCollector, SessionsClient } from '../../..'; import { SearchSessionsMgmtAPI } from '../lib/api'; import { AsyncSearchIntroDocumentation } from '../lib/documentation'; import { LocaleWrapper } from '../__mocks__'; import { SearchSessionsMgmtMain } from './main'; -import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; -import { managementPluginMock } from '@kbn/management-plugin/public/mocks'; import { SharePluginStart } from '@kbn/share-plugin/public'; import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; +import { SearchSessionsConfigSchema } from '../../../../../config'; +import { createSearchUsageCollectorMock } from '../../../collectors/mocks'; let mockCoreSetup: MockedKeys; let mockCoreStart: MockedKeys; let mockShareStart: jest.Mocked; -let mockPluginsSetup: IManagementSectionsPluginsSetup; -let mockConfig: SessionsConfigSchema; +let mockConfig: SearchSessionsConfigSchema; let sessionsClient: SessionsClient; let api: SearchSessionsMgmtAPI; +let mockSearchUsageCollector: SearchUsageCollector; describe('Background Search Session Management Main', () => { beforeEach(() => { mockCoreSetup = coreMock.createSetup(); mockCoreStart = coreMock.createStart(); mockShareStart = sharePluginMock.createStartContract(); - mockPluginsSetup = { - data: dataPluginMock.createSetupContract(), - management: managementPluginMock.createSetupContract(), - }; + mockSearchUsageCollector = createSearchUsageCollectorMock(); mockConfig = { defaultExpiration: moment.duration('7d'), management: { @@ -80,13 +77,13 @@ describe('Background Search Session Management Main', () => { ); diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/main.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/main.tsx similarity index 72% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/main.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/components/main.tsx index e065a20003dd9..424ec701f79ad 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/main.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/main.tsx @@ -1,19 +1,20 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiButtonEmpty, EuiPageHeader, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import type { CoreStart, HttpStart } from '@kbn/core/public'; import React from 'react'; -import type { SessionsConfigSchema } from '..'; -import { IManagementSectionsPluginsSetup } from '..'; import type { SearchSessionsMgmtAPI } from '../lib/api'; import type { AsyncSearchIntroDocumentation } from '../lib/documentation'; import { SearchSessionsMgmtTable } from './table'; +import { SearchSessionsConfigSchema } from '../../../../../config'; +import { SearchUsageCollector } from '../../../collectors'; interface Props { documentation: AsyncSearchIntroDocumentation; @@ -21,9 +22,9 @@ interface Props { api: SearchSessionsMgmtAPI; http: HttpStart; timezone: string; - config: SessionsConfigSchema; - plugins: IManagementSectionsPluginsSetup; + config: SearchSessionsConfigSchema; kibanaVersion: string; + searchUsageCollector: SearchUsageCollector; } export function SearchSessionsMgmtMain({ documentation, ...tableProps }: Props) { @@ -32,13 +33,13 @@ export function SearchSessionsMgmtMain({ documentation, ...tableProps }: Props) } description={ } @@ -50,7 +51,7 @@ export function SearchSessionsMgmtMain({ documentation, ...tableProps }: Props) iconType="help" > , diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/status.test.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/status.test.tsx similarity index 94% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/status.test.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/components/status.test.tsx index 83f4494dff504..5cee810997393 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/status.test.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/status.test.tsx @@ -1,14 +1,15 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiTextProps, EuiToolTipProps } from '@elastic/eui'; import { mount } from 'enzyme'; import React from 'react'; -import { SearchSessionStatus } from '@kbn/data-plugin/common'; +import { SearchSessionStatus } from '../../../../../common'; import { UISession } from '../types'; import { LocaleWrapper } from '../__mocks__'; import { getStatusText, StatusIndicator } from './status'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/status.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/status.tsx similarity index 78% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/status.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/components/status.tsx index 577e89f2c761b..bb41ff05c1099 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/status.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/status.tsx @@ -1,14 +1,15 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiLoadingSpinner, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { ReactElement } from 'react'; -import { SearchSessionStatus } from '@kbn/data-plugin/common'; +import { SearchSessionStatus } from '../../../../../common'; import { dateString } from '../lib/date_string'; import { UISession } from '../types'; import { StatusDef as StatusAttributes, TableText } from '.'; @@ -17,23 +18,23 @@ import { StatusDef as StatusAttributes, TableText } from '.'; export const getStatusText = (statusType: string): string => { switch (statusType) { case SearchSessionStatus.IN_PROGRESS: - return i18n.translate('xpack.data.mgmt.searchSessions.status.label.inProgress', { + return i18n.translate('data.mgmt.searchSessions.status.label.inProgress', { defaultMessage: 'In progress', }); case SearchSessionStatus.EXPIRED: - return i18n.translate('xpack.data.mgmt.searchSessions.status.label.expired', { + return i18n.translate('data.mgmt.searchSessions.status.label.expired', { defaultMessage: 'Expired', }); case SearchSessionStatus.CANCELLED: - return i18n.translate('xpack.data.mgmt.searchSessions.status.label.cancelled', { + return i18n.translate('data.mgmt.searchSessions.status.label.cancelled', { defaultMessage: 'Cancelled', }); case SearchSessionStatus.COMPLETE: - return i18n.translate('xpack.data.mgmt.searchSessions.status.label.complete', { + return i18n.translate('data.mgmt.searchSessions.status.label.complete', { defaultMessage: 'Complete', }); case SearchSessionStatus.ERROR: - return i18n.translate('xpack.data.mgmt.searchSessions.status.label.error', { + return i18n.translate('data.mgmt.searchSessions.status.label.error', { defaultMessage: 'Error', }); default: @@ -60,7 +61,7 @@ const getStatusAttributes = ({ if (session.expires) { expireDate = dateString(session.expires!, timezone); } else { - expireDate = i18n.translate('xpack.data.mgmt.searchSessions.status.expireDateUnknown', { + expireDate = i18n.translate('data.mgmt.searchSessions.status.expireDateUnknown', { defaultMessage: 'unknown', }); } @@ -72,13 +73,10 @@ const getStatusAttributes = ({ textColor: 'default', icon: , label: {getStatusText(session.status)}, - toolTipContent: i18n.translate( - 'xpack.data.mgmt.searchSessions.status.message.createdOn', - { - defaultMessage: 'Expires on {expireDate}', - values: { expireDate }, - } - ), + toolTipContent: i18n.translate('data.mgmt.searchSessions.status.message.createdOn', { + defaultMessage: 'Expires on {expireDate}', + values: { expireDate }, + }), }; } catch (err) { // eslint-disable-next-line no-console @@ -88,13 +86,10 @@ const getStatusAttributes = ({ case SearchSessionStatus.EXPIRED: try { - const toolTipContent = i18n.translate( - 'xpack.data.mgmt.searchSessions.status.message.expiredOn', - { - defaultMessage: 'Expired on {expireDate}', - values: { expireDate }, - } - ); + const toolTipContent = i18n.translate('data.mgmt.searchSessions.status.message.expiredOn', { + defaultMessage: 'Expired on {expireDate}', + values: { expireDate }, + }); return { icon: , @@ -111,7 +106,7 @@ const getStatusAttributes = ({ return { icon: , label: {getStatusText(session.status)}, - toolTipContent: i18n.translate('xpack.data.mgmt.searchSessions.status.message.cancelled', { + toolTipContent: i18n.translate('data.mgmt.searchSessions.status.message.cancelled', { defaultMessage: 'Cancelled by user', }), }; @@ -121,7 +116,7 @@ const getStatusAttributes = ({ textColor: 'danger', icon: , label: {getStatusText(session.status)}, - toolTipContent: i18n.translate('xpack.data.mgmt.searchSessions.status.message.error', { + toolTipContent: i18n.translate('data.mgmt.searchSessions.status.message.error', { defaultMessage: 'Error: {error}', values: { error: (session as any).error || 'unknown' }, }), @@ -129,7 +124,7 @@ const getStatusAttributes = ({ case SearchSessionStatus.COMPLETE: try { - const toolTipContent = i18n.translate('xpack.data.mgmt.searchSessions.status.expiresOn', { + const toolTipContent = i18n.translate('data.mgmt.searchSessions.status.expiresOn', { defaultMessage: 'Expires on {expireDate}', values: { expireDate }, }); diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/app_filter.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/table/app_filter.tsx similarity index 76% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/app_filter.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/components/table/app_filter.tsx index e0988fbf80acf..48cfda93e1f91 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/app_filter.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/table/app_filter.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { FieldValueOptionType, SearchFilterConfig } from '@elastic/eui'; @@ -12,7 +13,7 @@ import { UISession } from '../../types'; export const getAppFilter: (tableData: UISession[]) => SearchFilterConfig = (tableData) => ({ type: 'field_value_selection', - name: i18n.translate('xpack.data.mgmt.searchSessions.search.filterApp', { + name: i18n.translate('data.mgmt.searchSessions.search.filterApp', { defaultMessage: 'App', }), field: 'appId', diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/index.ts b/src/plugins/data/public/search/session/sessions_mgmt/components/table/index.ts similarity index 53% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/index.ts rename to src/plugins/data/public/search/session/sessions_mgmt/components/table/index.ts index 361261ff65c87..84f0cfd24159d 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/index.ts +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/table/index.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { SearchSessionsMgmtTable } from './table'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/status_filter.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/table/status_filter.tsx similarity index 79% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/status_filter.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/components/table/status_filter.tsx index 33e085fbb646d..25fc7dc092ab8 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/status_filter.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/table/status_filter.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { FieldValueOptionType, SearchFilterConfig } from '@elastic/eui'; @@ -14,7 +15,7 @@ import { getStatusText } from '../status'; export const getStatusFilter: (tableData: UISession[]) => SearchFilterConfig = (tableData) => ({ type: 'field_value_selection', - name: i18n.translate('xpack.data.mgmt.searchSessions.search.filterStatus', { + name: i18n.translate('data.mgmt.searchSessions.search.filterStatus', { defaultMessage: 'Status', }), field: 'status', diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/table.test.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.test.tsx similarity index 87% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/table.test.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/components/table/table.test.tsx index 2023aed902c9f..1e8dd423a8bf9 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/table.test.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.test.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { MockedKeys } from '@kbn/utility-types/jest'; @@ -12,34 +13,29 @@ import { CoreSetup, CoreStart } from '@kbn/core/public'; import moment from 'moment'; import React from 'react'; import { coreMock } from '@kbn/core/public/mocks'; -import { SessionsClient } from '@kbn/data-plugin/public/search'; -import { SearchSessionStatus } from '@kbn/data-plugin/common'; -import { IManagementSectionsPluginsSetup, SessionsConfigSchema } from '../..'; +import { SearchUsageCollector, SessionsClient } from '../../../..'; +import { SearchSessionStatus } from '../../../../../../common'; import { SearchSessionsMgmtAPI } from '../../lib/api'; import { LocaleWrapper } from '../../__mocks__'; import { SearchSessionsMgmtTable } from './table'; -import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; -import { managementPluginMock } from '@kbn/management-plugin/public/mocks'; import { SharePluginStart } from '@kbn/share-plugin/public'; import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; +import { SearchSessionsConfigSchema } from '../../../../../../config'; +import { createSearchUsageCollectorMock } from '../../../../collectors/mocks'; let mockCoreSetup: MockedKeys; let mockCoreStart: CoreStart; let mockShareStart: jest.Mocked; -let mockPluginsSetup: IManagementSectionsPluginsSetup; -let mockConfig: SessionsConfigSchema; +let mockConfig: SearchSessionsConfigSchema; let sessionsClient: SessionsClient; let api: SearchSessionsMgmtAPI; +let mockSearchUsageCollector: SearchUsageCollector; describe('Background Search Session Management Table', () => { beforeEach(async () => { mockCoreSetup = coreMock.createSetup(); mockCoreStart = coreMock.createStart(); mockShareStart = sharePluginMock.createStartContract(); - mockPluginsSetup = { - data: dataPluginMock.createSetupContract(), - management: managementPluginMock.createSetupContract(), - }; mockConfig = { defaultExpiration: moment.duration('7d'), management: { @@ -49,6 +45,7 @@ describe('Background Search Session Management Table', () => { refreshTimeout: moment.duration(10, 'minutes'), }, } as any; + mockSearchUsageCollector = createSearchUsageCollectorMock(); sessionsClient = new SessionsClient({ http: mockCoreSetup.http }); api = new SearchSessionsMgmtAPI(sessionsClient, mockConfig, { @@ -91,11 +88,11 @@ describe('Background Search Session Management Table', () => { ); @@ -124,11 +121,11 @@ describe('Background Search Session Management Table', () => { ); @@ -168,11 +165,11 @@ describe('Background Search Session Management Table', () => { ); @@ -202,11 +199,11 @@ describe('Background Search Session Management Table', () => { ); diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/table.tsx b/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.tsx similarity index 81% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/table.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/components/table/table.tsx index 88ffb5ed2d749..b887d9af43f53 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/table.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/components/table/table.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiButton, EuiInMemoryTable, EuiSearchBarProps } from '@elastic/eui'; @@ -12,23 +13,24 @@ import moment from 'moment'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import useDebounce from 'react-use/lib/useDebounce'; import useInterval from 'react-use/lib/useInterval'; -import { SEARCH_SESSIONS_TABLE_ID } from '@kbn/data-plugin/common'; import { TableText } from '..'; -import { IManagementSectionsPluginsSetup, SessionsConfigSchema } from '../..'; +import { SEARCH_SESSIONS_TABLE_ID } from '../../../../../../common'; import { SearchSessionsMgmtAPI } from '../../lib/api'; import { getColumns } from '../../lib/get_columns'; import { UISession } from '../../types'; import { OnActionComplete } from '../actions'; import { getAppFilter } from './app_filter'; import { getStatusFilter } from './status_filter'; +import { SearchUsageCollector } from '../../../../collectors'; +import { SearchSessionsConfigSchema } from '../../../../../../config'; interface Props { core: CoreStart; api: SearchSessionsMgmtAPI; timezone: string; - config: SessionsConfigSchema; - plugins: IManagementSectionsPluginsSetup; + config: SearchSessionsConfigSchema; kibanaVersion: string; + searchUsageCollector: SearchUsageCollector; } export function SearchSessionsMgmtTable({ @@ -36,8 +38,8 @@ export function SearchSessionsMgmtTable({ api, timezone, config, - plugins, kibanaVersion, + searchUsageCollector, ...props }: Props) { const [tableData, setTableData] = useState([]); @@ -80,8 +82,8 @@ export function SearchSessionsMgmtTable({ // initial data load useEffect(() => { doRefresh(); - plugins.data.search.usageCollector?.trackSessionsListLoaded(); - }, [doRefresh, plugins]); + searchUsageCollector.trackSessionsListLoaded(); + }, [doRefresh, searchUsageCollector]); useInterval(doRefresh, refreshInterval); @@ -104,7 +106,7 @@ export function SearchSessionsMgmtTable({ data-test-subj="sessionManagementRefreshBtn" > @@ -121,7 +123,15 @@ export function SearchSessionsMgmtTable({ 'data-test-subj': `searchSessionsRow`, 'data-test-search-session-id': `id-${searchSession.id}`, })} - columns={getColumns(core, plugins, api, config, timezone, onActionComplete, kibanaVersion)} + columns={getColumns( + core, + api, + config, + timezone, + onActionComplete, + kibanaVersion, + searchUsageCollector + )} items={tableData} pagination={pagination} search={search} diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/icons/extend_session.svg b/src/plugins/data/public/search/session/sessions_mgmt/icons/extend_session.svg similarity index 100% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/icons/extend_session.svg rename to src/plugins/data/public/search/session/sessions_mgmt/icons/extend_session.svg diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/index.ts b/src/plugins/data/public/search/session/sessions_mgmt/index.ts similarity index 60% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/index.ts rename to src/plugins/data/public/search/session/sessions_mgmt/index.ts index 35eb3cb4e36a4..7b95305f6e568 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/index.ts +++ b/src/plugins/data/public/search/session/sessions_mgmt/index.ts @@ -1,34 +1,33 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { i18n } from '@kbn/i18n'; import type { CoreStart, HttpStart, I18nStart, IUiSettingsClient } from '@kbn/core/public'; import { CoreSetup } from '@kbn/core/public'; -import type { DataPublicPluginSetup, DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { ManagementSetup } from '@kbn/management-plugin/public'; import type { SharePluginStart } from '@kbn/share-plugin/public'; -import { SEARCH_SESSIONS_MANAGEMENT_ID } from '@kbn/data-plugin/public'; -import type { ConfigSchema } from '../../../config'; -import type { DataEnhancedStartDependencies } from '../../plugin'; +import type { ISessionsClient, SearchUsageCollector } from '../../..'; +import { SEARCH_SESSIONS_MANAGEMENT_ID } from '../constants'; import type { SearchSessionsMgmtAPI } from './lib/api'; import type { AsyncSearchIntroDocumentation } from './lib/documentation'; +import { SearchSessionsConfigSchema } from '../../../../config'; export interface IManagementSectionsPluginsSetup { - data: DataPublicPluginSetup; management: ManagementSetup; + searchUsageCollector: SearchUsageCollector; + sessionsClient: ISessionsClient; } export interface IManagementSectionsPluginsStart { - data: DataPublicPluginStart; share: SharePluginStart; } export interface AppDependencies { - plugins: IManagementSectionsPluginsSetup; share: SharePluginStart; uiSettings: IUiSettingsClient; documentation: AsyncSearchIntroDocumentation; @@ -36,33 +35,32 @@ export interface AppDependencies { api: SearchSessionsMgmtAPI; http: HttpStart; i18n: I18nStart; - config: SessionsConfigSchema; + config: SearchSessionsConfigSchema; kibanaVersion: string; + searchUsageCollector: SearchUsageCollector; } export const APP = { id: SEARCH_SESSIONS_MANAGEMENT_ID, getI18nName: (): string => - i18n.translate('xpack.data.mgmt.searchSessions.appTitle', { + i18n.translate('data.mgmt.searchSessions.appTitle', { defaultMessage: 'Search Sessions', }), }; -export type SessionsConfigSchema = ConfigSchema['search']['sessions']; - export function registerSearchSessionsMgmt( - coreSetup: CoreSetup, - config: SessionsConfigSchema, - kibanaVersion: string, - services: IManagementSectionsPluginsSetup + coreSetup: CoreSetup, + deps: IManagementSectionsPluginsSetup, + config: SearchSessionsConfigSchema, + kibanaVersion: string ) { - services.management.sections.section.kibana.registerApp({ + deps.management.sections.section.kibana.registerApp({ id: APP.id, title: APP.getI18nName(), order: 1.75, mount: async (params) => { const { SearchSessionsMgmtApp: MgmtApp } = await import('./application'); - const mgmtApp = new MgmtApp(coreSetup, config, kibanaVersion, params, services); + const mgmtApp = new MgmtApp(coreSetup, deps, config, kibanaVersion, params); return mgmtApp.mountManagementSection(); }, }); diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/api.test.ts b/src/plugins/data/public/search/session/sessions_mgmt/lib/api.test.ts similarity index 95% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/api.test.ts rename to src/plugins/data/public/search/session/sessions_mgmt/lib/api.test.ts index 69c0d165ac6c0..a1d95a83d1ccd 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/api.test.ts +++ b/src/plugins/data/public/search/session/sessions_mgmt/lib/api.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { MockedKeys } from '@kbn/utility-types/jest'; @@ -11,17 +12,17 @@ import moment from 'moment'; import { coreMock } from '@kbn/core/public/mocks'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import type { SavedObjectsFindResponse } from '@kbn/core/server'; -import { SessionsClient } from '@kbn/data-plugin/public/search'; -import type { SessionsConfigSchema } from '..'; -import { SearchSessionStatus } from '@kbn/data-plugin/common'; +import { SessionsClient } from '../../..'; +import { SearchSessionStatus } from '../../../../../common'; import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; import { SharePluginStart } from '@kbn/share-plugin/public'; import { SearchSessionsMgmtAPI } from './api'; +import { SearchSessionsConfigSchema } from '../../../../../config'; let mockCoreSetup: MockedKeys; let mockCoreStart: MockedKeys; let mockShareStart: jest.Mocked; -let mockConfig: SessionsConfigSchema; +let mockConfig: SearchSessionsConfigSchema; let sessionsClient: SessionsClient; describe('Search Sessions Management API', () => { diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/api.ts b/src/plugins/data/public/search/session/sessions_mgmt/lib/api.ts similarity index 85% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/api.ts rename to src/plugins/data/public/search/session/sessions_mgmt/lib/api.ts index bb58efd01d957..9830cb436f7df 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/api.ts +++ b/src/plugins/data/public/search/session/sessions_mgmt/lib/api.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { i18n } from '@kbn/i18n'; @@ -12,15 +13,16 @@ import { from, race, timer } from 'rxjs'; import { mapTo, tap } from 'rxjs/operators'; import type { SharePluginStart } from '@kbn/share-plugin/public'; import { SerializableRecord } from '@kbn/utility-types'; -import { ISessionsClient, SearchUsageCollector } from '@kbn/data-plugin/public'; -import { SearchSessionStatus } from '@kbn/data-plugin/common'; import { ACTION } from '../components/actions'; import { PersistedSearchSessionSavedObjectAttributes, UISearchSessionState, UISession, } from '../types'; -import { SessionsConfigSchema } from '..'; +import { ISessionsClient } from '../../sessions_client'; +import { SearchUsageCollector } from '../../../collectors'; +import { SearchSessionStatus } from '../../../../../common'; +import { SearchSessionsConfigSchema } from '../../../../../config'; type LocatorsStart = SharePluginStart['url']['locators']; @@ -73,7 +75,7 @@ function getUrlFromState(locators: LocatorsStart, locatorId: string, state: Seri // Helper: factory for a function to map server objects to UI objects const mapToUISession = - (locators: LocatorsStart, config: SessionsConfigSchema) => + (locators: LocatorsStart, config: SearchSessionsConfigSchema) => async ( savedObject: SavedObject ): Promise => { @@ -125,7 +127,7 @@ interface SearchSessionManagementDeps { export class SearchSessionsMgmtAPI { constructor( private sessionsClient: ISessionsClient, - private config: SessionsConfigSchema, + private config: SearchSessionsConfigSchema, private deps: SearchSessionManagementDeps ) {} @@ -147,7 +149,7 @@ export class SearchSessionsMgmtAPI { const timeout$ = timer(refreshTimeout.asMilliseconds()).pipe( tap(() => { this.deps.notifications.toasts.addDanger( - i18n.translate('xpack.data.mgmt.searchSessions.api.fetchTimeout', { + i18n.translate('data.mgmt.searchSessions.api.fetchTimeout', { defaultMessage: 'Fetching the Search Session info timed out after {timeout} seconds', values: { timeout: refreshTimeout.asSeconds() }, }) @@ -169,7 +171,7 @@ export class SearchSessionsMgmtAPI { // eslint-disable-next-line no-console console.error(err); this.deps.notifications.toasts.addError(err, { - title: i18n.translate('xpack.data.mgmt.searchSessions.api.fetchError', { + title: i18n.translate('data.mgmt.searchSessions.api.fetchError', { defaultMessage: 'Failed to refresh the page!', }), }); @@ -194,13 +196,13 @@ export class SearchSessionsMgmtAPI { await this.sessionsClient.delete(id); this.deps.notifications.toasts.addSuccess({ - title: i18n.translate('xpack.data.mgmt.searchSessions.api.deleted', { + title: i18n.translate('data.mgmt.searchSessions.api.deleted', { defaultMessage: 'The search session was deleted.', }), }); } catch (err) { this.deps.notifications.toasts.addError(err, { - title: i18n.translate('xpack.data.mgmt.searchSessions.api.deletedError', { + title: i18n.translate('data.mgmt.searchSessions.api.deletedError', { defaultMessage: 'Failed to delete the search session!', }), }); @@ -214,13 +216,13 @@ export class SearchSessionsMgmtAPI { await this.sessionsClient.extend(id, expires); this.deps.notifications.toasts.addSuccess({ - title: i18n.translate('xpack.data.mgmt.searchSessions.api.extended', { + title: i18n.translate('data.mgmt.searchSessions.api.extended', { defaultMessage: 'The search session was extended.', }), }); } catch (err) { this.deps.notifications.toasts.addError(err, { - title: i18n.translate('xpack.data.mgmt.searchSessions.api.extendError', { + title: i18n.translate('data.mgmt.searchSessions.api.extendError', { defaultMessage: 'Failed to extend the search session!', }), }); @@ -233,13 +235,13 @@ export class SearchSessionsMgmtAPI { await this.sessionsClient.rename(id, newName); this.deps.notifications.toasts.addSuccess({ - title: i18n.translate('xpack.data.mgmt.searchSessions.api.rename', { + title: i18n.translate('data.mgmt.searchSessions.api.rename', { defaultMessage: 'The search session was renamed', }), }); } catch (err) { this.deps.notifications.toasts.addError(err, { - title: i18n.translate('xpack.data.mgmt.searchSessions.api.renameError', { + title: i18n.translate('data.mgmt.searchSessions.api.renameError', { defaultMessage: 'Failed to rename the search session', }), }); diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/date_string.ts b/src/plugins/data/public/search/session/sessions_mgmt/lib/date_string.ts similarity index 77% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/date_string.ts rename to src/plugins/data/public/search/session/sessions_mgmt/lib/date_string.ts index 2bad2f7c3367e..89ffcb596b094 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/date_string.ts +++ b/src/plugins/data/public/search/session/sessions_mgmt/lib/date_string.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import moment from 'moment'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/documentation.ts b/src/plugins/data/public/search/session/sessions_mgmt/lib/documentation.ts similarity index 71% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/documentation.ts rename to src/plugins/data/public/search/session/sessions_mgmt/lib/documentation.ts index 03279199912c0..2af7fb5025cd9 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/documentation.ts +++ b/src/plugins/data/public/search/session/sessions_mgmt/lib/documentation.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { DocLinksStart } from '@kbn/core/public'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_columns.test.tsx b/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.test.tsx similarity index 89% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_columns.test.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.test.tsx index 35da6b995169a..5833ac516fa4b 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_columns.test.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.test.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EuiTableFieldDataColumnType } from '@elastic/eui'; @@ -12,23 +13,22 @@ import { CoreSetup, CoreStart } from '@kbn/core/public'; import moment from 'moment'; import { ReactElement } from 'react'; import { coreMock } from '@kbn/core/public/mocks'; -import { SessionsClient } from '@kbn/data-plugin/public/search'; -import { IManagementSectionsPluginsSetup, SessionsConfigSchema } from '..'; -import { SearchSessionStatus } from '@kbn/data-plugin/common'; +import { SearchUsageCollector, SessionsClient } from '../../..'; +import { SearchSessionStatus } from '../../../../../common'; import { OnActionComplete } from '../components'; import { UISession } from '../types'; import { SearchSessionsMgmtAPI } from './api'; import { getColumns } from './get_columns'; -import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; -import { managementPluginMock } from '@kbn/management-plugin/public/mocks'; import { SharePluginStart } from '@kbn/share-plugin/public'; import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; +import { SearchSessionsConfigSchema } from '../../../../../config'; +import { createSearchUsageCollectorMock } from '../../../collectors/mocks'; let mockCoreSetup: MockedKeys; let mockCoreStart: CoreStart; let mockShareStart: jest.Mocked; -let mockPluginsSetup: IManagementSectionsPluginsSetup; -let mockConfig: SessionsConfigSchema; +let mockSearchUsageCollector: SearchUsageCollector; +let mockConfig: SearchSessionsConfigSchema; let api: SearchSessionsMgmtAPI; let sessionsClient: SessionsClient; let handleAction: OnActionComplete; @@ -41,10 +41,6 @@ describe('Search Sessions Management table column factory', () => { mockCoreSetup = coreMock.createSetup(); mockCoreStart = coreMock.createStart(); mockShareStart = sharePluginMock.createStartContract(); - mockPluginsSetup = { - data: dataPluginMock.createSetupContract(), - management: managementPluginMock.createSetupContract(), - }; mockConfig = { defaultExpiration: moment.duration('7d'), management: { @@ -55,6 +51,7 @@ describe('Search Sessions Management table column factory', () => { }, } as any; sessionsClient = new SessionsClient({ http: mockCoreSetup.http }); + mockSearchUsageCollector = createSearchUsageCollectorMock(); api = new SearchSessionsMgmtAPI(sessionsClient, mockConfig, { locators: mockShareStart.url.locators, @@ -86,12 +83,12 @@ describe('Search Sessions Management table column factory', () => { test('returns columns', () => { const columns = getColumns( mockCoreStart, - mockPluginsSetup, api, mockConfig, tz, handleAction, - '7.14.0' + '7.14.0', + mockSearchUsageCollector ); expect(columns).toMatchInlineSnapshot(` Array [ @@ -152,12 +149,12 @@ describe('Search Sessions Management table column factory', () => { test('rendering', () => { const [, nameColumn] = getColumns( mockCoreStart, - mockPluginsSetup, api, mockConfig, tz, handleAction, - '7.14.0' + '7.14.0', + mockSearchUsageCollector ) as Array>; const name = mount(nameColumn.render!(mockSession.name, mockSession) as ReactElement); @@ -172,12 +169,12 @@ describe('Search Sessions Management table column factory', () => { beforeEach(() => { const [, nameColumn] = getColumns( mockCoreStart, - mockPluginsSetup, api, mockConfig, tz, handleAction, - currentKibanaVersion + currentKibanaVersion, + mockSearchUsageCollector ) as Array>; hasRenderedVersionWarning = (partialSession: Partial): boolean => { @@ -235,12 +232,12 @@ describe('Search Sessions Management table column factory', () => { test('renders', () => { const [, , numOfSearches] = getColumns( mockCoreStart, - mockPluginsSetup, api, mockConfig, tz, handleAction, - '7.14.0' + '7.14.0', + mockSearchUsageCollector ) as Array>; const numOfSearchesLine = mount( @@ -255,12 +252,12 @@ describe('Search Sessions Management table column factory', () => { test('render in_progress', () => { const [, , , status] = getColumns( mockCoreStart, - mockPluginsSetup, api, mockConfig, tz, handleAction, - '7.14.0' + '7.14.0', + mockSearchUsageCollector ) as Array>; const statusLine = mount(status.render!(mockSession.status, mockSession) as ReactElement); @@ -272,12 +269,12 @@ describe('Search Sessions Management table column factory', () => { test('error handling', () => { const [, , , status] = getColumns( mockCoreStart, - mockPluginsSetup, api, mockConfig, tz, handleAction, - '7.14.0' + '7.14.0', + mockSearchUsageCollector ) as Array>; mockSession.status = 'INVALID' as SearchSessionStatus; @@ -296,12 +293,12 @@ describe('Search Sessions Management table column factory', () => { const [, , , , createdDateCol] = getColumns( mockCoreStart, - mockPluginsSetup, api, mockConfig, tz, handleAction, - '7.14.0' + '7.14.0', + mockSearchUsageCollector ) as Array>; const date = mount(createdDateCol.render!(mockSession.created, mockSession) as ReactElement); @@ -314,12 +311,12 @@ describe('Search Sessions Management table column factory', () => { const [, , , , createdDateCol] = getColumns( mockCoreStart, - mockPluginsSetup, api, mockConfig, tz, handleAction, - '7.14.0' + '7.14.0', + mockSearchUsageCollector ) as Array>; const date = mount(createdDateCol.render!(mockSession.created, mockSession) as ReactElement); @@ -330,12 +327,12 @@ describe('Search Sessions Management table column factory', () => { test('error handling', () => { const [, , , , createdDateCol] = getColumns( mockCoreStart, - mockPluginsSetup, api, mockConfig, tz, handleAction, - '7.14.0' + '7.14.0', + mockSearchUsageCollector ) as Array>; mockSession.created = 'INVALID'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_columns.tsx b/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.tsx similarity index 85% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_columns.tsx rename to src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.tsx index d9a71639f8fe2..f6db378bb2942 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_columns.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/lib/get_columns.tsx @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { @@ -21,15 +22,15 @@ import { CoreStart } from '@kbn/core/public'; import { capitalize } from 'lodash'; import React from 'react'; import { RedirectAppLinks } from '@kbn/kibana-react-plugin/public'; -import { SearchSessionStatus } from '@kbn/data-plugin/common'; -import { IManagementSectionsPluginsSetup, SessionsConfigSchema } from '..'; -import { TableText } from '../components'; -import { OnActionComplete, PopoverActionsMenu } from '../components'; +import { SearchSessionStatus } from '../../../../../common'; +import { OnActionComplete, PopoverActionsMenu, TableText } from '../components'; import { StatusIndicator } from '../components/status'; import { dateString } from './date_string'; import { SearchSessionsMgmtAPI } from './api'; import { getExpirationStatus } from './get_expiration_status'; import { UISession } from '../types'; +import { SearchUsageCollector } from '../../../collectors'; +import { SearchSessionsConfigSchema } from '../../../../../config'; // Helper function: translate an app string to EuiIcon-friendly string const appToIcon = (app: string) => { @@ -46,7 +47,7 @@ const appToIcon = (app: string) => { // Helper function: translate an app id to user friendly string const appToTooltip = (appId: string | undefined) => { if (appId === 'ml') { - return i18n.translate('xpack.data.mgmt.searchSessions.table.mlAppName', { + return i18n.translate('data.mgmt.searchSessions.table.mlAppName', { defaultMessage: 'Machine Learning', }); } @@ -58,19 +59,19 @@ function isSessionRestorable(status: SearchSessionStatus) { export const getColumns = ( core: CoreStart, - plugins: IManagementSectionsPluginsSetup, api: SearchSessionsMgmtAPI, - config: SessionsConfigSchema, + config: SearchSessionsConfigSchema, timezone: string, onActionComplete: OnActionComplete, - kibanaVersion: string + kibanaVersion: string, + searchUsageCollector: SearchUsageCollector ): Array> => { // Use a literal array of table column definitions to detail a UISession object return [ // App { field: 'appId', - name: i18n.translate('xpack.data.mgmt.searchSessions.table.headerType', { + name: i18n.translate('data.mgmt.searchSessions.table.headerType', { defaultMessage: 'App', }), sortable: true, @@ -91,7 +92,7 @@ export const getColumns = ( // Name, links to app and displays the search session data { field: 'name', - name: i18n.translate('xpack.data.mgmt.searchSessions.table.headerName', { + name: i18n.translate('data.mgmt.searchSessions.table.headerName', { defaultMessage: 'Name', }), sortable: true, @@ -100,8 +101,8 @@ export const getColumns = ( const isRestorable = isSessionRestorable(status); const href = isRestorable ? restoreUrl : reloadUrl; const trackAction = isRestorable - ? plugins.data.search.usageCollector?.trackSessionViewRestored - : plugins.data.search.usageCollector?.trackSessionReloaded; + ? searchUsageCollector.trackSessionViewRestored + : searchUsageCollector.trackSessionReloaded; const notRestorableWarning = isRestorable ? null : ( <> {' '} @@ -109,7 +110,7 @@ export const getColumns = ( type="alert" content={ } @@ -130,7 +131,7 @@ export const getColumns = ( iconProps={{ 'data-test-subj': 'versionIncompatibleWarningTestSubj' }} content={ } @@ -160,7 +161,7 @@ export const getColumns = ( // # Searches { field: 'numSearches', - name: i18n.translate('xpack.data.mgmt.searchSessions.table.numSearches', { + name: i18n.translate('data.mgmt.searchSessions.table.numSearches', { defaultMessage: '# Searches', }), sortable: true, @@ -174,7 +175,7 @@ export const getColumns = ( // Session status { field: 'status', - name: i18n.translate('xpack.data.mgmt.searchSessions.table.headerStatus', { + name: i18n.translate('data.mgmt.searchSessions.table.headerStatus', { defaultMessage: 'Status', }), sortable: true, @@ -186,7 +187,7 @@ export const getColumns = ( // Started date { field: 'created', - name: i18n.translate('xpack.data.mgmt.searchSessions.table.headerStarted', { + name: i18n.translate('data.mgmt.searchSessions.table.headerStarted', { defaultMessage: 'Created', }), sortable: true, @@ -209,7 +210,7 @@ export const getColumns = ( // Expiration date { field: 'expires', - name: i18n.translate('xpack.data.mgmt.searchSessions.table.headerExpiration', { + name: i18n.translate('data.mgmt.searchSessions.table.headerExpiration', { defaultMessage: 'Expiration', }), sortable: true, diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_expiration_status.ts b/src/plugins/data/public/search/session/sessions_mgmt/lib/get_expiration_status.ts similarity index 56% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_expiration_status.ts rename to src/plugins/data/public/search/session/sessions_mgmt/lib/get_expiration_status.ts index a220b414ba659..52a1ba3b983d2 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_expiration_status.ts +++ b/src/plugins/data/public/search/session/sessions_mgmt/lib/get_expiration_status.ts @@ -1,15 +1,16 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { i18n } from '@kbn/i18n'; import moment from 'moment'; -import { SessionsConfigSchema } from '..'; +import { SearchSessionsConfigSchema } from '../../../../../config'; -export const getExpirationStatus = (config: SessionsConfigSchema, expires: string | null) => { +export const getExpirationStatus = (config: SearchSessionsConfigSchema, expires: string | null) => { const tNow = moment.utc().valueOf(); const tFuture = moment.utc(expires).valueOf(); @@ -19,27 +20,27 @@ export const getExpirationStatus = (config: SessionsConfigSchema, expires: strin const expiresInDays = Math.floor(durationToExpire.asDays()); const sufficientDays = Math.ceil(moment.duration(config.management.expiresSoonWarning).asDays()); - let toolTipContent = i18n.translate('xpack.data.mgmt.searchSessions.status.expiresSoonInDays', { + let toolTipContent = i18n.translate('data.mgmt.searchSessions.status.expiresSoonInDays', { defaultMessage: 'Expires in {numDays} days', values: { numDays: expiresInDays }, }); - let statusContent = i18n.translate( - 'xpack.data.mgmt.searchSessions.status.expiresSoonInDaysTooltip', - { defaultMessage: '{numDays} days', values: { numDays: expiresInDays } } - ); + let statusContent = i18n.translate('data.mgmt.searchSessions.status.expiresSoonInDaysTooltip', { + defaultMessage: '{numDays} days', + values: { numDays: expiresInDays }, + }); if (expiresInDays === 0) { // switch to show expires in hours const expiresInHours = Math.floor(durationToExpire.asHours()); - toolTipContent = i18n.translate('xpack.data.mgmt.searchSessions.status.expiresSoonInHours', { + toolTipContent = i18n.translate('data.mgmt.searchSessions.status.expiresSoonInHours', { defaultMessage: 'This session expires in {numHours} hours', values: { numHours: expiresInHours }, }); - statusContent = i18n.translate( - 'xpack.data.mgmt.searchSessions.status.expiresSoonInHoursTooltip', - { defaultMessage: '{numHours} hours', values: { numHours: expiresInHours } } - ); + statusContent = i18n.translate('data.mgmt.searchSessions.status.expiresSoonInHoursTooltip', { + defaultMessage: '{numHours} hours', + values: { numHours: expiresInHours }, + }); } if (durationToExpire.valueOf() > 0 && expiresInDays <= sufficientDays) { diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/types.ts b/src/plugins/data/public/search/session/sessions_mgmt/types.ts similarity index 84% rename from x-pack/plugins/data_enhanced/public/search/sessions_mgmt/types.ts rename to src/plugins/data/public/search/session/sessions_mgmt/types.ts index c66290a968240..d21b4371099c7 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/types.ts +++ b/src/plugins/data/public/search/session/sessions_mgmt/types.ts @@ -1,11 +1,12 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import { SearchSessionSavedObjectAttributes, SearchSessionStatus } from '@kbn/data-plugin/common'; +import { SearchSessionSavedObjectAttributes, SearchSessionStatus } from '../../../../common'; import { ACTION } from './components/actions'; export const DATE_STRING_FORMAT = 'D MMM, YYYY, HH:mm:ss'; diff --git a/src/plugins/data/public/types.ts b/src/plugins/data/public/types.ts index b596e02e7f2ac..69c2035b28e5c 100644 --- a/src/plugins/data/public/types.ts +++ b/src/plugins/data/public/types.ts @@ -15,6 +15,9 @@ import { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public'; import { FieldFormatsSetup, FieldFormatsStart } from '@kbn/field-formats-plugin/public'; import { UsageCollectionSetup, UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; import { Setup as InspectorSetup } from '@kbn/inspector-plugin/public'; +import { ScreenshotModePluginStart } from '@kbn/screenshot-mode-plugin/public'; +import { SharePluginStart } from '@kbn/share-plugin/public'; +import { ManagementSetup } from '@kbn/management-plugin/public'; import { DatatableUtilitiesService } from '../common'; import { createFiltersFromRangeSelectAction, createFiltersFromValueClickAction } from './actions'; import type { ISearchSetup, ISearchStart } from './search'; @@ -29,12 +32,15 @@ export interface DataSetupDependencies { inspector: InspectorSetup; usageCollection?: UsageCollectionSetup; fieldFormats: FieldFormatsSetup; + management: ManagementSetup; } export interface DataStartDependencies { uiActions: UiActionsStart; fieldFormats: FieldFormatsStart; dataViews: DataViewsPublicPluginStart; + screenshotMode: ScreenshotModePluginStart; + share: SharePluginStart; } /** diff --git a/src/plugins/data/server/config_deprecations.test.ts b/src/plugins/data/server/config_deprecations.test.ts index 7da937c840560..9c54c793f661a 100644 --- a/src/plugins/data/server/config_deprecations.test.ts +++ b/src/plugins/data/server/config_deprecations.test.ts @@ -11,12 +11,12 @@ import { cloneDeep } from 'lodash'; import { applyDeprecations, configDeprecationFactory } from '@kbn/config'; import { configDeprecationsMock } from '@kbn/core/server/mocks'; -import { autocompleteConfigDeprecationProvider } from './config_deprecations'; +import { configDeprecationProvider } from './config_deprecations'; const deprecationContext = configDeprecationsMock.createContext(); const applyConfigDeprecations = (settings: Record = {}) => { - const deprecations = autocompleteConfigDeprecationProvider(configDeprecationFactory); + const deprecations = configDeprecationProvider(configDeprecationFactory); const deprecationMessages: string[] = []; const migrated = applyDeprecations( settings, @@ -37,40 +37,30 @@ const applyConfigDeprecations = (settings: Record = {}) => { describe('Config Deprecations', () => { it('does not report deprecations for default configuration', () => { - const defaultConfig = { data: { autocomplete: { valueSuggestions: {} } } }; + const defaultConfig = { data: { search: { sessions: {} } } }; const { messages, migrated } = applyConfigDeprecations(cloneDeep(defaultConfig)); expect(migrated).toEqual(defaultConfig); expect(messages).toHaveLength(0); }); - it('renames kibana.autocompleteTerminateAfter to data.autocomplete.valueSuggestions.terminateAfter', () => { + it('renames xpack.data_enhanced.search.sessions.* to data.search.sessions.*', () => { const config = { - kibana: { - autocompleteTerminateAfter: 123, + xpack: { + data_enhanced: { + search: { + sessions: { + enabled: false, + }, + }, + }, }, }; const { messages, migrated } = applyConfigDeprecations(cloneDeep(config)); - expect(migrated.kibana?.autocompleteTerminateAfter).not.toBeDefined(); - expect(migrated.data.autocomplete.valueSuggestions.terminateAfter).toEqual(123); + expect(migrated.xpack?.data_enhanced).not.toBeDefined(); + expect(migrated.data.search.sessions.enabled).toEqual(false); expect(messages).toMatchInlineSnapshot(` Array [ - "Setting \\"kibana.autocompleteTerminateAfter\\" has been replaced by \\"data.autocomplete.valueSuggestions.terminateAfter\\"", - ] - `); - }); - - it('renames kibana.autocompleteTimeout to data.autocomplete.valueSuggestions.timeout', () => { - const config = { - kibana: { - autocompleteTimeout: 123, - }, - }; - const { messages, migrated } = applyConfigDeprecations(cloneDeep(config)); - expect(migrated.kibana?.autocompleteTimeout).not.toBeDefined(); - expect(migrated.data.autocomplete.valueSuggestions.timeout).toEqual(123); - expect(messages).toMatchInlineSnapshot(` - Array [ - "Setting \\"kibana.autocompleteTimeout\\" has been replaced by \\"data.autocomplete.valueSuggestions.timeout\\"", + "Setting \\"xpack.data_enhanced.search.sessions\\" has been replaced by \\"data.search.sessions\\"", ] `); }); diff --git a/src/plugins/data/server/config_deprecations.ts b/src/plugins/data/server/config_deprecations.ts index 7f704dac1f431..dcc168f306e1e 100644 --- a/src/plugins/data/server/config_deprecations.ts +++ b/src/plugins/data/server/config_deprecations.ts @@ -8,15 +8,8 @@ import type { ConfigDeprecationProvider } from '@kbn/core/server'; -export const autocompleteConfigDeprecationProvider: ConfigDeprecationProvider = ({ - renameFromRoot, -}) => [ - renameFromRoot( - 'kibana.autocompleteTerminateAfter', - 'data.autocomplete.valueSuggestions.terminateAfter', - { level: 'warning' } - ), - renameFromRoot('kibana.autocompleteTimeout', 'data.autocomplete.valueSuggestions.timeout', { +export const configDeprecationProvider: ConfigDeprecationProvider = ({ renameFromRoot }) => [ + renameFromRoot('xpack.data_enhanced.search.sessions', 'data.search.sessions', { level: 'warning', }), ]; diff --git a/src/plugins/data/server/index.ts b/src/plugins/data/server/index.ts index b970221c43391..cac9f9c08209e 100644 --- a/src/plugins/data/server/index.ts +++ b/src/plugins/data/server/index.ts @@ -70,6 +70,7 @@ import { // tabify calcAutoIntervalLessThan, } from '../common'; +import { configDeprecationProvider } from './config_deprecations'; export type { ParsedInterval, @@ -122,6 +123,7 @@ export type { DataPluginSetup as PluginSetup, DataPluginStart as PluginStart }; export { DataServerPlugin as Plugin }; export const config: PluginConfigDescriptor = { + deprecations: configDeprecationProvider, exposeToBrowser: { search: true, }, diff --git a/src/plugins/data/server/plugin.ts b/src/plugins/data/server/plugin.ts index d1beb335dd35c..70fa72b1634cb 100644 --- a/src/plugins/data/server/plugin.ts +++ b/src/plugins/data/server/plugin.ts @@ -12,9 +12,14 @@ import { BfetchServerSetup } from '@kbn/bfetch-plugin/server'; import { PluginStart as DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import { FieldFormatsSetup, FieldFormatsStart } from '@kbn/field-formats-plugin/server'; +import type { + TaskManagerSetupContract, + TaskManagerStartContract, +} from '@kbn/task-manager-plugin/server'; +import type { SecurityPluginSetup } from '@kbn/security-plugin/server'; import { ConfigSchema } from '../config'; +import type { ISearchSetup, ISearchStart } from './search'; import { DatatableUtilitiesService } from './datatable_utilities'; -import type { ISearchSetup, ISearchStart, SearchEnhancements } from './search'; import { SearchService } from './search/search_service'; import { QueryService } from './query/query_service'; import { ScriptsService } from './scripts'; @@ -22,10 +27,6 @@ import { KqlTelemetryService } from './kql_telemetry'; import { getUiSettings } from './ui_settings'; import { QuerySetup } from './query'; -interface DataEnhancements { - search: SearchEnhancements; -} - export interface DataPluginSetup { search: ISearchSetup; query: QuerySetup; @@ -33,10 +34,6 @@ export interface DataPluginSetup { * @deprecated - use "fieldFormats" plugin directly instead */ fieldFormats: FieldFormatsSetup; - /** - * @internal - */ - __enhance: (enhancements: DataEnhancements) => void; } export interface DataPluginStart { @@ -58,12 +55,15 @@ export interface DataPluginSetupDependencies { expressions: ExpressionsServerSetup; usageCollection?: UsageCollectionSetup; fieldFormats: FieldFormatsSetup; + taskManager?: TaskManagerSetupContract; + security?: SecurityPluginSetup; } export interface DataPluginStartDependencies { fieldFormats: FieldFormatsStart; logger: Logger; dataViews: DataViewsServerPluginStart; + taskManager?: TaskManagerStartContract; } export class DataServerPlugin @@ -90,7 +90,14 @@ export class DataServerPlugin public setup( core: CoreSetup, - { bfetch, expressions, usageCollection, fieldFormats }: DataPluginSetupDependencies + { + bfetch, + expressions, + usageCollection, + fieldFormats, + taskManager, + security, + }: DataPluginSetupDependencies ) { this.scriptsService.setup(core); const querySetup = this.queryService.setup(core); @@ -102,20 +109,26 @@ export class DataServerPlugin bfetch, expressions, usageCollection, + security, + taskManager, }); return { - __enhance: (enhancements: DataEnhancements) => { - searchSetup.__enhance(enhancements.search); - }, search: searchSetup, query: querySetup, fieldFormats, }; } - public start(core: CoreStart, { fieldFormats, dataViews }: DataPluginStartDependencies) { - const search = this.searchService.start(core, { fieldFormats, indexPatterns: dataViews }); + public start( + core: CoreStart, + { fieldFormats, dataViews, taskManager }: DataPluginStartDependencies + ) { + const search = this.searchService.start(core, { + fieldFormats, + indexPatterns: dataViews, + taskManager, + }); const datatableUtilities = new DatatableUtilitiesService( search.aggs, dataViews, diff --git a/src/plugins/data/server/search/collectors/fetch.ts b/src/plugins/data/server/search/collectors/search/fetch.ts similarity index 100% rename from src/plugins/data/server/search/collectors/fetch.ts rename to src/plugins/data/server/search/collectors/search/fetch.ts diff --git a/src/plugins/data/server/search/collectors/index.ts b/src/plugins/data/server/search/collectors/search/index.ts similarity index 100% rename from src/plugins/data/server/search/collectors/index.ts rename to src/plugins/data/server/search/collectors/search/index.ts diff --git a/src/plugins/data/server/search/collectors/register.ts b/src/plugins/data/server/search/collectors/search/register.ts similarity index 100% rename from src/plugins/data/server/search/collectors/register.ts rename to src/plugins/data/server/search/collectors/search/register.ts diff --git a/src/plugins/data/server/search/collectors/usage.ts b/src/plugins/data/server/search/collectors/search/usage.ts similarity index 97% rename from src/plugins/data/server/search/collectors/usage.ts rename to src/plugins/data/server/search/collectors/search/usage.ts index 5b1904737b9bc..c3e09257a4628 100644 --- a/src/plugins/data/server/search/collectors/usage.ts +++ b/src/plugins/data/server/search/collectors/search/usage.ts @@ -8,8 +8,8 @@ import { once, debounce } from 'lodash'; import type { CoreSetup, Logger } from '@kbn/core/server'; -import type { IEsSearchResponse, ISearchOptions } from '../../../common'; -import { isCompleteResponse } from '../../../common'; +import type { IEsSearchResponse, ISearchOptions } from '../../../../common'; +import { isCompleteResponse } from '../../../../common'; import { CollectedUsage } from './register'; const SAVED_OBJECT_ID = 'search-telemetry'; diff --git a/x-pack/plugins/data_enhanced/server/collectors/fetch.test.ts b/src/plugins/data/server/search/collectors/search_session/fetch.test.ts similarity index 92% rename from x-pack/plugins/data_enhanced/server/collectors/fetch.test.ts rename to src/plugins/data/server/search/collectors/search_session/fetch.test.ts index 260577298e81b..1290b06b94ee0 100644 --- a/x-pack/plugins/data_enhanced/server/collectors/fetch.test.ts +++ b/src/plugins/data/server/search/collectors/search_session/fetch.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { SavedObjectsErrorHelpers, Logger } from '@kbn/core/server'; diff --git a/x-pack/plugins/data_enhanced/server/collectors/fetch.ts b/src/plugins/data/server/search/collectors/search_session/fetch.ts similarity index 89% rename from x-pack/plugins/data_enhanced/server/collectors/fetch.ts rename to src/plugins/data/server/search/collectors/search_session/fetch.ts index eb3b50b3a64e9..536ca4b168188 100644 --- a/x-pack/plugins/data_enhanced/server/collectors/fetch.ts +++ b/src/plugins/data/server/search/collectors/search_session/fetch.ts @@ -1,14 +1,16 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ + import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { Logger } from '@kbn/core/server'; import { CollectorFetchContext } from '@kbn/usage-collection-plugin/server'; -import { SEARCH_SESSION_TYPE } from '@kbn/data-plugin/common'; import { ReportedUsage } from './register'; +import { SEARCH_SESSION_TYPE } from '../../../../common'; interface SessionPersistedTermsBucket { key_as_string: 'false' | 'true'; diff --git a/x-pack/plugins/data_enhanced/server/collectors/index.ts b/src/plugins/data/server/search/collectors/search_session/index.ts similarity index 53% rename from x-pack/plugins/data_enhanced/server/collectors/index.ts rename to src/plugins/data/server/search/collectors/search_session/index.ts index 4a82c76e96dee..c52a71b6c98f3 100644 --- a/x-pack/plugins/data_enhanced/server/collectors/index.ts +++ b/src/plugins/data/server/search/collectors/search_session/index.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export { registerUsageCollector } from './register'; diff --git a/x-pack/plugins/data_enhanced/server/collectors/register.ts b/src/plugins/data/server/search/collectors/search_session/register.ts similarity index 84% rename from x-pack/plugins/data_enhanced/server/collectors/register.ts rename to src/plugins/data/server/search/collectors/search_session/register.ts index 6b98627fce11f..c6ea85a2b53d3 100644 --- a/x-pack/plugins/data_enhanced/server/collectors/register.ts +++ b/src/plugins/data/server/search/collectors/search_session/register.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { Logger } from '@kbn/core/server'; diff --git a/src/plugins/data/server/search/index.ts b/src/plugins/data/server/search/index.ts index b7087e95c0a2c..a61a74609cc6f 100644 --- a/src/plugins/data/server/search/index.ts +++ b/src/plugins/data/server/search/index.ts @@ -10,8 +10,8 @@ export * from './types'; export * from './strategies/es_search'; export * from './strategies/ese_search'; export * from './strategies/eql_search'; -export type { SearchUsage } from './collectors'; -export { usageProvider, searchUsageObserver } from './collectors'; +export type { SearchUsage } from './collectors/search'; +export { usageProvider, searchUsageObserver } from './collectors/search'; export * from './aggs'; export * from './session'; export * from './errors/no_search_id_in_session'; diff --git a/src/plugins/data/server/search/mocks.ts b/src/plugins/data/server/search/mocks.ts index 740be105703a7..31944922c7b44 100644 --- a/src/plugins/data/server/search/mocks.ts +++ b/src/plugins/data/server/search/mocks.ts @@ -16,7 +16,6 @@ export function createSearchSetupMock(): jest.Mocked { return { aggs: searchAggsSetupMock(), registerSearchStrategy: jest.fn(), - __enhance: jest.fn(), searchSource: searchSourceMock.createSetupContract(), }; } diff --git a/src/plugins/data/server/search/routes/index.ts b/src/plugins/data/server/search/routes/index.ts index 0a4f5467c8fa9..f118a3bb4b6c9 100644 --- a/src/plugins/data/server/search/routes/index.ts +++ b/src/plugins/data/server/search/routes/index.ts @@ -7,3 +7,4 @@ */ export * from './search'; +export * from './session'; diff --git a/x-pack/plugins/data_enhanced/server/routes/session.test.ts b/src/plugins/data/server/search/routes/session.test.ts similarity index 94% rename from x-pack/plugins/data_enhanced/server/routes/session.test.ts rename to src/plugins/data/server/search/routes/session.test.ts index c6625a3491886..20dbac04a7674 100644 --- a/x-pack/plugins/data_enhanced/server/routes/session.test.ts +++ b/src/plugins/data/server/search/routes/session.test.ts @@ -1,16 +1,18 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import type { MockedKeys } from '@kbn/utility-types/jest'; import type { CoreSetup, Logger } from '@kbn/core/server'; import { coreMock, httpServerMock } from '@kbn/core/server/mocks'; -import type { PluginStart as DataPluginStart } from '@kbn/data-plugin/server'; -import { dataPluginMock } from '@kbn/data-plugin/server/mocks'; +import type { PluginStart as DataPluginStart } from '../..'; +import { dataPluginMock } from '../../mocks'; + import { registerSessionRoutes } from './session'; enum PostHandlerIndex { diff --git a/x-pack/plugins/data_enhanced/server/routes/session.ts b/src/plugins/data/server/search/routes/session.ts similarity index 95% rename from x-pack/plugins/data_enhanced/server/routes/session.ts rename to src/plugins/data/server/search/routes/session.ts index a0eea258c4db5..6106a69df207a 100644 --- a/x-pack/plugins/data_enhanced/server/routes/session.ts +++ b/src/plugins/data/server/search/routes/session.ts @@ -1,18 +1,19 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { schema } from '@kbn/config-schema'; import { Logger } from '@kbn/core/server'; import { reportServerError } from '@kbn/kibana-utils-plugin/server'; -import { DataEnhancedPluginRouter } from '../type'; +import { DataPluginRouter } from '../types'; const STORE_SEARCH_SESSIONS_ROLE_TAG = `access:store_search_session`; -export function registerSessionRoutes(router: DataEnhancedPluginRouter, logger: Logger): void { +export function registerSessionRoutes(router: DataPluginRouter, logger: Logger): void { router.post( { path: '/internal/session', diff --git a/x-pack/plugins/data_enhanced/server/saved_objects/index.ts b/src/plugins/data/server/search/saved_objects/index.ts similarity index 51% rename from x-pack/plugins/data_enhanced/server/saved_objects/index.ts rename to src/plugins/data/server/search/saved_objects/index.ts index 3736eb7e0394b..207cd6e64ea4a 100644 --- a/x-pack/plugins/data_enhanced/server/saved_objects/index.ts +++ b/src/plugins/data/server/search/saved_objects/index.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ export * from './search_session'; diff --git a/x-pack/plugins/data_enhanced/server/saved_objects/search_session.ts b/src/plugins/data/server/search/saved_objects/search_session.ts similarity index 85% rename from x-pack/plugins/data_enhanced/server/saved_objects/search_session.ts rename to src/plugins/data/server/search/saved_objects/search_session.ts index 68f37e1e2adac..c77c8379af365 100644 --- a/x-pack/plugins/data_enhanced/server/saved_objects/search_session.ts +++ b/src/plugins/data/server/search/saved_objects/search_session.ts @@ -1,12 +1,13 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { SavedObjectsType } from '@kbn/core/server'; -import { SEARCH_SESSION_TYPE } from '@kbn/data-plugin/common'; +import { SEARCH_SESSION_TYPE } from '../../../common'; import { searchSessionSavedObjectMigrations } from './search_session_migration'; export const searchSessionSavedObjectType: SavedObjectsType = { diff --git a/x-pack/plugins/data_enhanced/server/saved_objects/search_session_migration.test.ts b/src/plugins/data/server/search/saved_objects/search_session_migration.test.ts similarity index 97% rename from x-pack/plugins/data_enhanced/server/saved_objects/search_session_migration.test.ts rename to src/plugins/data/server/search/saved_objects/search_session_migration.test.ts index a94b22de5b0ed..251d57e884ac1 100644 --- a/x-pack/plugins/data_enhanced/server/saved_objects/search_session_migration.test.ts +++ b/src/plugins/data/server/search/saved_objects/search_session_migration.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { @@ -12,7 +13,7 @@ import { SearchSessionSavedObjectAttributesPre$8$0$0, } from './search_session_migration'; import { SavedObject } from '@kbn/core/types'; -import { SEARCH_SESSION_TYPE, SearchSessionStatus } from '@kbn/data-plugin/common'; +import { SEARCH_SESSION_TYPE, SearchSessionStatus } from '../../../common'; import { SavedObjectMigrationContext } from '@kbn/core/server'; describe('7.12.0 -> 7.13.0', () => { diff --git a/x-pack/plugins/data_enhanced/server/saved_objects/search_session_migration.ts b/src/plugins/data/server/search/saved_objects/search_session_migration.ts similarity index 93% rename from x-pack/plugins/data_enhanced/server/saved_objects/search_session_migration.ts rename to src/plugins/data/server/search/saved_objects/search_session_migration.ts index f2de5df91de95..314db0fb8b58f 100644 --- a/x-pack/plugins/data_enhanced/server/saved_objects/search_session_migration.ts +++ b/src/plugins/data/server/search/saved_objects/search_session_migration.ts @@ -1,15 +1,16 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { SavedObjectMigrationMap, SavedObjectUnsanitizedDoc } from '@kbn/core/server'; import { SearchSessionSavedObjectAttributes as SearchSessionSavedObjectAttributesLatest, SearchSessionStatus, -} from '@kbn/data-plugin/common'; +} from '../../../common'; /** * Search sessions were released in 7.12.0 diff --git a/src/plugins/data/server/search/search_service.test.ts b/src/plugins/data/server/search/search_service.test.ts index 121de2e068e3c..663b28e733e29 100644 --- a/src/plugins/data/server/search/search_service.test.ts +++ b/src/plugins/data/server/search/search_service.test.ts @@ -22,7 +22,6 @@ import type { IEsSearchResponse, IScopedSearchClient, IScopedSearchSessionsClient, - ISearchSessionService, ISearchStart, ISearchStrategy, } from '.'; @@ -32,6 +31,16 @@ import { expressionsPluginMock } from '@kbn/expressions-plugin/public/mocks'; import { createSearchSessionsClientMock } from './mocks'; import { ENHANCED_ES_SEARCH_STRATEGY } from '../../common'; +let mockSessionClient: jest.Mocked; +jest.mock('./session', () => { + class SearchSessionService { + asScopedProvider = () => (request: any) => mockSessionClient; + } + return { + SearchSessionService, + }; +}); + describe('Search service', () => { let plugin: SearchService; let mockCoreSetup: MockedKeys>; @@ -88,8 +97,7 @@ describe('Search service', () => { let searchPluginStart: ISearchStart>; let mockStrategy: any; let mockStrategyNoCancel: jest.Mocked; - let mockSessionService: ISearchSessionService; - let mockSessionClient: jest.Mocked; + const sessionId = '1234'; beforeEach(() => { @@ -104,9 +112,6 @@ describe('Search service', () => { }; mockSessionClient = createSearchSessionsClientMock(); - mockSessionService = { - asScopedProvider: () => (request: any) => mockSessionClient, - }; const pluginSetup = plugin.setup(mockCoreSetup, { bfetch: bfetchPluginMock.createSetupContract(), @@ -114,9 +119,6 @@ describe('Search service', () => { }); pluginSetup.registerSearchStrategy(ENHANCED_ES_SEARCH_STRATEGY, mockStrategy); pluginSetup.registerSearchStrategy('nocancel', mockStrategyNoCancel); - pluginSetup.__enhance({ - sessionService: mockSessionService, - }); searchPluginStart = plugin.start(mockCoreStart, { fieldFormats: createFieldFormatsStartMock(), diff --git a/src/plugins/data/server/search/search_service.ts b/src/plugins/data/server/search/search_service.ts index c59893cdead96..36479b3c5298c 100644 --- a/src/plugins/data/server/search/search_service.ts +++ b/src/plugins/data/server/search/search_service.ts @@ -26,58 +26,63 @@ import { FieldFormatsStart } from '@kbn/field-formats-plugin/server'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; import { KbnServerError } from '@kbn/kibana-utils-plugin/server'; import type { + TaskManagerSetupContract, + TaskManagerStartContract, +} from '@kbn/task-manager-plugin/server'; +import type { SecurityPluginSetup } from '@kbn/security-plugin/server'; +import type { + DataRequestHandlerContext, IScopedSearchClient, ISearchSetup, ISearchStart, ISearchStrategy, - SearchEnhancements, SearchStrategyDependencies, - DataRequestHandlerContext, } from './types'; import { AggsService } from './aggs'; import { IndexPatternsServiceStart } from '../data_views'; -import { registerSearchRoute } from './routes'; +import { registerSearchRoute, registerSessionRoutes } from './routes'; import { ES_SEARCH_STRATEGY, esSearchStrategyProvider } from './strategies/es_search'; import { DataPluginStart, DataPluginStartDependencies } from '../plugin'; -import { registerUsageCollector } from './collectors/register'; -import { usageProvider } from './collectors/usage'; +import { usageProvider } from './collectors/search/usage'; +import { registerUsageCollector as registerSearchUsageCollector } from './collectors/search/register'; +import { registerUsageCollector as registerSearchSessionUsageCollector } from './collectors/search_session/register'; import { searchTelemetry } from '../saved_objects'; import { + cidrFunction, + dateRangeFunction, + ENHANCED_ES_SEARCH_STRATEGY, + EQL_SEARCH_STRATEGY, + esRawResponse, existsFilterFunction, + extendedBoundsFunction, fieldFunction, + geoBoundingBoxFunction, + geoPointFunction, IEsSearchRequest, IEsSearchResponse, IKibanaSearchRequest, IKibanaSearchResponse, - ISearchOptions, - cidrFunction, - dateRangeFunction, - extendedBoundsFunction, - geoBoundingBoxFunction, - geoPointFunction, ipRangeFunction, + ISearchOptions, kibana, kibanaContext, - kibanaTimerangeFunction, kibanaFilterFunction, + kibanaTimerangeFunction, kqlFunction, luceneFunction, numericalRangeFunction, + phraseFilterFunction, queryFilterFunction, rangeFilterFunction, - removeFilterFunction, selectFilterFunction, rangeFunction, + removeFilterFunction, SearchSourceDependencies, searchSourceRequiredUiSettings, SearchSourceService, - phraseFilterFunction, - esRawResponse, eqlRawResponse, - ENHANCED_ES_SEARCH_STRATEGY, - EQL_SEARCH_STRATEGY, SQL_SEARCH_STRATEGY, } from '../../common/search'; import { getEsaggs, getEsdsl, getEql } from './expressions'; @@ -87,7 +92,7 @@ import { } from '../../common/search/aggs/buckets/shard_delay'; import { aggShardDelay } from '../../common/search/aggs/buckets/shard_delay_fn'; import { ConfigSchema } from '../../config'; -import { ISearchSessionService, SearchSessionService } from './session'; +import { SearchSessionService } from './session'; import { registerBsearchRoute } from './routes/bsearch'; import { getKibanaContext } from './expressions/kibana_context'; import { enhancedEsSearchStrategyProvider } from './strategies/ese_search'; @@ -95,6 +100,7 @@ import { eqlSearchStrategyProvider } from './strategies/eql_search'; import { NoSearchIdInSessionError } from './errors/no_search_id_in_session'; import { CachedUiSettingsClient } from './services'; import { sqlSearchStrategyProvider } from './strategies/sql_search'; +import { searchSessionSavedObjectType } from './saved_objects'; type StrategyMap = Record>; @@ -103,12 +109,15 @@ export interface SearchServiceSetupDependencies { bfetch: BfetchServerSetup; expressions: ExpressionsServerSetup; usageCollection?: UsageCollectionSetup; + taskManager?: TaskManagerSetupContract; + security?: SecurityPluginSetup; } /** @internal */ export interface SearchServiceStartDependencies { fieldFormats: FieldFormatsStart; indexPatterns: IndexPatternsServiceStart; + taskManager?: TaskManagerStartContract; } /** @internal */ @@ -121,7 +130,7 @@ export class SearchService implements Plugin { private readonly aggsService = new AggsService(); private readonly searchSourceService = new SearchSourceService(); private searchStrategies: StrategyMap = {}; - private sessionService: ISearchSessionService; + private sessionService: SearchSessionService; private asScoped!: ISearchStart['asScoped']; private searchAsInternalUser!: ISearchStrategy; @@ -129,17 +138,31 @@ export class SearchService implements Plugin { private initializerContext: PluginInitializerContext, private readonly logger: Logger ) { - this.sessionService = new SearchSessionService(); + this.sessionService = new SearchSessionService( + logger, + initializerContext.config.get(), + initializerContext.env.packageInfo.version + ); } public setup( core: CoreSetup, - { bfetch, expressions, usageCollection }: SearchServiceSetupDependencies + { bfetch, expressions, usageCollection, taskManager, security }: SearchServiceSetupDependencies ): ISearchSetup { + core.savedObjects.registerType(searchSessionSavedObjectType); const usage = usageCollection ? usageProvider(core) : undefined; const router = core.http.createRouter(); registerSearchRoute(router); + registerSessionRoutes(router, this.logger); + + if (taskManager) { + this.sessionService.setup(core, { taskManager, security }); + } else { + // this should never happen in real world, but + // taskManager and security are optional deps because they are in x-pack + this.logger.debug('Skipping sessionService setup because taskManager is not available'); + } core.http.registerRouteHandlerContext( 'search', @@ -188,7 +211,12 @@ export class SearchService implements Plugin { core.savedObjects.registerType(searchTelemetry); if (usageCollection) { - registerUsageCollector(usageCollection, core.savedObjects.getKibanaIndex()); + registerSearchUsageCollector(usageCollection, core.savedObjects.getKibanaIndex()); + registerSearchSessionUsageCollector( + usageCollection, + core.savedObjects.getKibanaIndex(), + this.logger + ); } expressions.registerFunction(getEsaggs({ getStartServices: core.getStartServices })); @@ -229,9 +257,6 @@ export class SearchService implements Plugin { }); return { - __enhance: (enhancements: SearchEnhancements) => { - this.sessionService = enhancements.sessionService; - }, aggs, registerSearchStrategy: this.registerSearchStrategy, usage, @@ -241,9 +266,14 @@ export class SearchService implements Plugin { public start( core: CoreStart, - { fieldFormats, indexPatterns }: SearchServiceStartDependencies + { fieldFormats, indexPatterns, taskManager }: SearchServiceStartDependencies ): ISearchStart { const { elasticsearch, savedObjects, uiSettings } = core; + + if (taskManager) { + this.sessionService.start(core, { taskManager }); + } + this.asScoped = this.asScopedProvider(core); return { aggs: this.aggsService.start({ diff --git a/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.test.ts b/src/plugins/data/server/search/session/check_non_persisted_sessions.test.ts similarity index 96% rename from x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.test.ts rename to src/plugins/data/server/search/session/check_non_persisted_sessions.test.ts index d7e472f4b3245..edbef1938a82f 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.test.ts +++ b/src/plugins/data/server/search/session/check_non_persisted_sessions.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { checkNonPersistedSessions as checkNonPersistedSessions$ } from './check_non_persisted_sessions'; @@ -11,25 +12,28 @@ import { SearchSessionSavedObjectAttributes, ENHANCED_ES_SEARCH_STRATEGY, EQL_SEARCH_STRATEGY, -} from '@kbn/data-plugin/common'; +} from '../../../common'; import { savedObjectsClientMock } from '@kbn/core/server/mocks'; -import { SearchSessionsConfig, CheckSearchSessionsDeps, SearchStatus } from './types'; +import { CheckSearchSessionsDeps, SearchStatus } from './types'; import moment from 'moment'; import { SavedObjectsBulkUpdateObject, SavedObjectsDeleteOptions, SavedObjectsClientContract, } from '@kbn/core/server'; +import { SearchSessionsConfigSchema } from '../../../config'; jest.useFakeTimers(); -const checkNonPersistedSessions = (deps: CheckSearchSessionsDeps, config: SearchSessionsConfig) => - checkNonPersistedSessions$(deps, config).toPromise(); +const checkNonPersistedSessions = ( + deps: CheckSearchSessionsDeps, + config: SearchSessionsConfigSchema +) => checkNonPersistedSessions$(deps, config).toPromise(); describe('checkNonPersistedSessions', () => { let mockClient: any; let savedObjectsClient: jest.Mocked; - const config: SearchSessionsConfig = { + const config: SearchSessionsConfigSchema = { enabled: true, pageSize: 5, notTouchedInProgressTimeout: moment.duration(1, 'm'), diff --git a/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts b/src/plugins/data/server/search/session/check_non_persisted_sessions.ts similarity index 91% rename from x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts rename to src/plugins/data/server/search/session/check_non_persisted_sessions.ts index 20903d4508bb1..86f377db57d23 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/check_non_persisted_sessions.ts +++ b/src/plugins/data/server/search/session/check_non_persisted_sessions.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { SavedObjectsFindResult } from '@kbn/core/server'; @@ -16,17 +17,18 @@ import { SearchSessionSavedObjectAttributes, SearchSessionStatus, KueryNode, -} from '@kbn/data-plugin/common'; +} from '../../../common'; import { checkSearchSessionsByPage, getSearchSessionsPage$ } from './get_search_session_page'; -import { SearchSessionsConfig, CheckSearchSessionsDeps, SearchStatus } from './types'; +import { CheckSearchSessionsDeps, SearchStatus } from './types'; import { bulkUpdateSessions, getAllSessionsStatusUpdates } from './update_session_status'; +import { SearchSessionsConfigSchema } from '../../../config'; export const SEARCH_SESSIONS_CLEANUP_TASK_TYPE = 'search_sessions_cleanup'; export const SEARCH_SESSIONS_CLEANUP_TASK_ID = `data_enhanced_${SEARCH_SESSIONS_CLEANUP_TASK_TYPE}`; function isSessionStale( session: SavedObjectsFindResult, - config: SearchSessionsConfig + config: SearchSessionsConfigSchema ) { const curTime = moment(); // Delete cancelled sessions immediately @@ -45,7 +47,7 @@ function isSessionStale( function checkNonPersistedSessionsPage( deps: CheckSearchSessionsDeps, - config: SearchSessionsConfig, + config: SearchSessionsConfigSchema, filter: KueryNode, page: number ) { @@ -118,7 +120,7 @@ function checkNonPersistedSessionsPage( export function checkNonPersistedSessions( deps: CheckSearchSessionsDeps, - config: SearchSessionsConfig + config: SearchSessionsConfigSchema ) { const { logger } = deps; diff --git a/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.test.ts b/src/plugins/data/server/search/session/check_persisted_sessions.test.ts similarity index 87% rename from x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.test.ts rename to src/plugins/data/server/search/session/check_persisted_sessions.test.ts index f27dba05d88e1..1e6de567a0d76 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.test.ts +++ b/src/plugins/data/server/search/session/check_persisted_sessions.test.ts @@ -1,20 +1,21 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { checkPersistedSessionsProgress } from './check_persisted_sessions'; import { savedObjectsClientMock } from '@kbn/core/server/mocks'; -import { SearchSessionsConfig } from './types'; import moment from 'moment'; import { SavedObjectsClientContract } from '@kbn/core/server'; +import { SearchSessionsConfigSchema } from '../../../config'; describe('checkPersistedSessionsProgress', () => { let mockClient: any; let savedObjectsClient: jest.Mocked; - const config: SearchSessionsConfig = { + const config: SearchSessionsConfigSchema = { enabled: true, pageSize: 5, notTouchedInProgressTimeout: moment.duration(1, 'm'), diff --git a/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts b/src/plugins/data/server/search/session/check_persisted_sessions.ts similarity index 81% rename from x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts rename to src/plugins/data/server/search/session/check_persisted_sessions.ts index 2f4cfaaa015c6..915d8af3fe80f 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/check_persisted_sessions.ts +++ b/src/plugins/data/server/search/session/check_persisted_sessions.ts @@ -1,28 +1,25 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EMPTY, Observable } from 'rxjs'; import { catchError, concatMap } from 'rxjs/operators'; -import { - nodeBuilder, - SEARCH_SESSION_TYPE, - SearchSessionStatus, - KueryNode, -} from '@kbn/data-plugin/common'; +import { nodeBuilder, SEARCH_SESSION_TYPE, SearchSessionStatus, KueryNode } from '../../../common'; import { checkSearchSessionsByPage, getSearchSessionsPage$ } from './get_search_session_page'; -import { SearchSessionsConfig, CheckSearchSessionsDeps, SearchSessionsResponse } from './types'; +import { CheckSearchSessionsDeps, SearchSessionsResponse } from './types'; import { bulkUpdateSessions, getAllSessionsStatusUpdates } from './update_session_status'; +import { SearchSessionsConfigSchema } from '../../../config'; export const SEARCH_SESSIONS_TASK_TYPE = 'search_sessions_monitor'; export const SEARCH_SESSIONS_TASK_ID = `data_enhanced_${SEARCH_SESSIONS_TASK_TYPE}`; function checkPersistedSessionsPage( deps: CheckSearchSessionsDeps, - config: SearchSessionsConfig, + config: SearchSessionsConfigSchema, filter: KueryNode, page: number ): Observable { @@ -50,7 +47,7 @@ function checkPersistedSessionsPage( export function checkPersistedSessionsProgress( deps: CheckSearchSessionsDeps, - config: SearchSessionsConfig + config: SearchSessionsConfigSchema ) { const { logger } = deps; diff --git a/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts b/src/plugins/data/server/search/session/expire_persisted_sessions.ts similarity index 80% rename from x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts rename to src/plugins/data/server/search/session/expire_persisted_sessions.ts index dfc77935d2275..77ae9d3f5a155 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/expire_persisted_sessions.ts +++ b/src/plugins/data/server/search/session/expire_persisted_sessions.ts @@ -1,28 +1,25 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { EMPTY, Observable } from 'rxjs'; import { catchError, concatMap } from 'rxjs/operators'; -import { - nodeBuilder, - SEARCH_SESSION_TYPE, - SearchSessionStatus, - KueryNode, -} from '@kbn/data-plugin/common'; +import { nodeBuilder, SEARCH_SESSION_TYPE, SearchSessionStatus, KueryNode } from '../../../common'; import { checkSearchSessionsByPage, getSearchSessionsPage$ } from './get_search_session_page'; -import { SearchSessionsConfig, CheckSearchSessionsDeps, SearchSessionsResponse } from './types'; +import { CheckSearchSessionsDeps, SearchSessionsResponse } from './types'; import { bulkUpdateSessions, getAllSessionsStatusUpdates } from './update_session_status'; +import { SearchSessionsConfigSchema } from '../../../config'; export const SEARCH_SESSIONS_EXPIRE_TASK_TYPE = 'search_sessions_expire'; export const SEARCH_SESSIONS_EXPIRE_TASK_ID = `data_enhanced_${SEARCH_SESSIONS_EXPIRE_TASK_TYPE}`; function checkSessionExpirationPage( deps: CheckSearchSessionsDeps, - config: SearchSessionsConfig, + config: SearchSessionsConfigSchema, filter: KueryNode, page: number ): Observable { @@ -46,7 +43,7 @@ function checkSessionExpirationPage( export function checkPersistedCompletedSessionExpiration( deps: CheckSearchSessionsDeps, - config: SearchSessionsConfig + config: SearchSessionsConfigSchema ) { const { logger } = deps; diff --git a/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.test.ts b/src/plugins/data/server/search/session/get_search_session_page.test.ts similarity index 94% rename from x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.test.ts rename to src/plugins/data/server/search/session/get_search_session_page.test.ts index d78e0567eaec4..43a8f987dc8fc 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.test.ts +++ b/src/plugins/data/server/search/session/get_search_session_page.test.ts @@ -1,24 +1,27 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { checkSearchSessionsByPage, getSearchSessionsPage$ } from './get_search_session_page'; -import { SearchSessionStatus, ENHANCED_ES_SEARCH_STRATEGY } from '@kbn/data-plugin/common'; +import { ENHANCED_ES_SEARCH_STRATEGY, SearchSessionStatus } from '../../../common'; import { savedObjectsClientMock } from '@kbn/core/server/mocks'; -import { SearchSessionsConfig, SearchStatus } from './types'; +import { SearchStatus } from './types'; import moment from 'moment'; import { SavedObjectsClientContract } from '@kbn/core/server'; import { of, Subject, throwError } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; +import { SearchSessionsConfigSchema } from '../../../config'; + jest.useFakeTimers(); describe('checkSearchSessionsByPage', () => { const mockClient = {} as any; let savedObjectsClient: jest.Mocked; - const config: SearchSessionsConfig = { + const config: SearchSessionsConfigSchema = { enabled: true, pageSize: 5, management: {} as any, diff --git a/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts b/src/plugins/data/server/search/session/get_search_session_page.ts similarity index 81% rename from x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts rename to src/plugins/data/server/search/session/get_search_session_page.ts index f59883350898b..30dc72eaa6813 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/get_search_session_page.ts +++ b/src/plugins/data/server/search/session/get_search_session_page.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { SavedObjectsClientContract, Logger } from '@kbn/core/server'; @@ -12,8 +13,9 @@ import { SearchSessionSavedObjectAttributes, SEARCH_SESSION_TYPE, KueryNode, -} from '@kbn/data-plugin/common'; -import { CheckSearchSessionsDeps, CheckSearchSessionsFn, SearchSessionsConfig } from './types'; +} from '../../../common'; +import { CheckSearchSessionsDeps, CheckSearchSessionsFn } from './types'; +import { SearchSessionsConfigSchema } from '../../../config'; export interface GetSessionsDeps { savedObjectsClient: SavedObjectsClientContract; @@ -43,7 +45,7 @@ export function getSearchSessionsPage$( export const checkSearchSessionsByPage = ( checkFn: CheckSearchSessionsFn, deps: CheckSearchSessionsDeps, - config: SearchSessionsConfig, + config: SearchSessionsConfigSchema, filters: any, nextPage = 1 ): Observable => diff --git a/x-pack/plugins/data_enhanced/server/search/session/get_search_status.test.ts b/src/plugins/data/server/search/session/get_search_status.test.ts similarity index 92% rename from x-pack/plugins/data_enhanced/server/search/session/get_search_status.test.ts rename to src/plugins/data/server/search/session/get_search_status.test.ts index 9bb4537f331ab..20fcc6935b0d6 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/get_search_status.test.ts +++ b/src/plugins/data/server/search/session/get_search_status.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { SearchStatus } from './types'; diff --git a/x-pack/plugins/data_enhanced/server/search/session/get_search_status.ts b/src/plugins/data/server/search/session/get_search_status.ts similarity index 80% rename from x-pack/plugins/data_enhanced/server/search/session/get_search_status.ts rename to src/plugins/data/server/search/session/get_search_status.ts index 26a31fdbac20d..3ded923376b18 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/get_search_status.ts +++ b/src/plugins/data/server/search/session/get_search_status.ts @@ -1,15 +1,16 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { i18n } from '@kbn/i18n'; import type { TransportResult } from '@elastic/elasticsearch'; import { ElasticsearchClient } from '@kbn/core/server'; -import { SearchSessionRequestInfo } from '@kbn/data-plugin/common'; -import { AsyncSearchStatusResponse } from '@kbn/data-plugin/server'; +import { SearchSessionRequestInfo } from '../../../common'; +import { AsyncSearchStatusResponse } from '../..'; import { SearchStatus } from './types'; export async function getSearchStatus( @@ -30,7 +31,7 @@ export async function getSearchStatus( if ((response.is_partial && !response.is_running) || response.completion_status >= 400) { return { status: SearchStatus.ERROR, - error: i18n.translate('xpack.data.search.statusError', { + error: i18n.translate('data.search.statusError', { defaultMessage: `Search completed with a {errorCode} status`, values: { errorCode: response.completion_status }, }), @@ -49,7 +50,7 @@ export async function getSearchStatus( } catch (e) { return { status: SearchStatus.ERROR, - error: i18n.translate('xpack.data.search.statusThrow', { + error: i18n.translate('data.search.statusThrow', { defaultMessage: `Search status threw an error {message} ({errorCode}) status`, values: { message: e.message, diff --git a/x-pack/plugins/data_enhanced/server/search/session/get_session_status.test.ts b/src/plugins/data/server/search/session/get_session_status.test.ts similarity index 85% rename from x-pack/plugins/data_enhanced/server/search/session/get_session_status.test.ts rename to src/plugins/data/server/search/session/get_session_status.test.ts index e15e494fdd6b9..db75e322edda5 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/get_session_status.test.ts +++ b/src/plugins/data/server/search/session/get_session_status.test.ts @@ -1,19 +1,21 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ -import { SearchSessionsConfig, SearchStatus } from './types'; +import { SearchStatus } from './types'; import { getSessionStatus } from './get_session_status'; -import { SearchSessionStatus } from '@kbn/data-plugin/common'; +import { SearchSessionStatus } from '../../../common'; import moment from 'moment'; +import { SearchSessionsConfigSchema } from '../../../config'; describe('getSessionStatus', () => { const mockConfig = { notTouchedInProgressTimeout: moment.duration(1, 'm'), - } as unknown as SearchSessionsConfig; + } as unknown as SearchSessionsConfigSchema; test("returns an in_progress status if there's nothing inside the session", () => { const session: any = { idMapping: {}, diff --git a/x-pack/plugins/data_enhanced/server/search/session/get_session_status.ts b/src/plugins/data/server/search/session/get_session_status.ts similarity index 75% rename from x-pack/plugins/data_enhanced/server/search/session/get_session_status.ts rename to src/plugins/data/server/search/session/get_session_status.ts index d6a4670c5e396..4614ea92318e9 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/get_session_status.ts +++ b/src/plugins/data/server/search/session/get_session_status.ts @@ -1,17 +1,19 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import moment from 'moment'; -import { SearchSessionSavedObjectAttributes, SearchSessionStatus } from '@kbn/data-plugin/common'; -import { SearchSessionsConfig, SearchStatus } from './types'; +import { SearchSessionSavedObjectAttributes, SearchSessionStatus } from '../../../common'; +import { SearchStatus } from './types'; +import { SearchSessionsConfigSchema } from '../../../config'; export function getSessionStatus( session: SearchSessionSavedObjectAttributes, - config: SearchSessionsConfig + config: SearchSessionsConfigSchema ): SearchSessionStatus { const searchStatuses = Object.values(session.idMapping); const curTime = moment(); diff --git a/x-pack/plugins/data_enhanced/server/search/session/session_service.test.ts b/src/plugins/data/server/search/session/session_service.test.ts similarity index 98% rename from x-pack/plugins/data_enhanced/server/search/session/session_service.test.ts rename to src/plugins/data/server/search/session/session_service.test.ts index 0f7f4975082a6..9f780239ea023 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/session_service.test.ts +++ b/src/plugins/data/server/search/session/session_service.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { @@ -17,9 +18,9 @@ import moment from 'moment'; import { coreMock } from '@kbn/core/server/mocks'; import { ConfigSchema } from '../../../config'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; -import { AuthenticatedUser } from '@kbn/security-plugin/common/model'; -import { nodeBuilder, SEARCH_SESSION_TYPE, SearchSessionStatus } from '@kbn/data-plugin/common'; -import { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; +import type { AuthenticatedUser } from '@kbn/security-plugin/common/model'; +import { nodeBuilder, SEARCH_SESSION_TYPE, SearchSessionStatus } from '../../../common'; +import type { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; const MAX_UPDATE_RETRIES = 3; @@ -81,13 +82,14 @@ describe('SearchSessionService', () => { management: {} as any, }, }, - }; + } as unknown as ConfigSchema; const mockLogger: any = { debug: jest.fn(), warn: jest.fn(), error: jest.fn(), }; service = new SearchSessionService(mockLogger, config, '8.0.0'); + service.setup(coreMock.createSetup(), { taskManager: taskManagerMock.createSetup() }); const coreStart = coreMock.createStart(); mockTaskManager = taskManagerMock.createStart(); await flushPromises(); @@ -161,13 +163,14 @@ describe('SearchSessionService', () => { management: {} as any, }, }, - }; + } as unknown as ConfigSchema; const mockLogger: any = { debug: jest.fn(), warn: jest.fn(), error: jest.fn(), }; service = new SearchSessionService(mockLogger, config, '8.0.0'); + service.setup(coreMock.createSetup(), { taskManager: taskManagerMock.createSetup() }); const coreStart = coreMock.createStart(); mockTaskManager = taskManagerMock.createStart(); await flushPromises(); diff --git a/src/plugins/data/server/search/session/session_service.ts b/src/plugins/data/server/search/session/session_service.ts index a23b315e47211..02f12a972f8b5 100644 --- a/src/plugins/data/server/search/session/session_service.ts +++ b/src/plugins/data/server/search/session/session_service.ts @@ -6,47 +6,549 @@ * Side Public License, v 1. */ -import { ISearchSessionService } from './types'; +import { notFound } from '@hapi/boom'; +import { debounce } from 'lodash'; +import { nodeBuilder, fromKueryExpression } from '@kbn/es-query'; +import { + CoreSetup, + CoreStart, + KibanaRequest, + SavedObjectsClientContract, + Logger, + SavedObject, + SavedObjectsFindOptions, + SavedObjectsErrorHelpers, +} from '@kbn/core/server'; +import type { AuthenticatedUser, SecurityPluginSetup } from '@kbn/security-plugin/server'; +import type { + TaskManagerSetupContract, + TaskManagerStartContract, +} from '@kbn/task-manager-plugin/server'; +import { + IKibanaSearchRequest, + ISearchOptions, + ENHANCED_ES_SEARCH_STRATEGY, + SEARCH_SESSION_TYPE, + SearchSessionRequestInfo, + SearchSessionSavedObjectAttributes, + SearchSessionStatus, +} from '../../../common'; +import { ISearchSessionService, NoSearchIdInSessionError } from '../..'; +import { createRequestHash } from './utils'; +import { ConfigSchema, SearchSessionsConfigSchema } from '../../../config'; +import { + registerSearchSessionsTask, + scheduleSearchSessionsTask, + unscheduleSearchSessionsTask, +} from './setup_task'; +import { SearchStatus } from './types'; +import { + checkPersistedSessionsProgress, + SEARCH_SESSIONS_TASK_ID, + SEARCH_SESSIONS_TASK_TYPE, +} from './check_persisted_sessions'; +import { + SEARCH_SESSIONS_CLEANUP_TASK_TYPE, + checkNonPersistedSessions, + SEARCH_SESSIONS_CLEANUP_TASK_ID, +} from './check_non_persisted_sessions'; +import { + SEARCH_SESSIONS_EXPIRE_TASK_TYPE, + SEARCH_SESSIONS_EXPIRE_TASK_ID, + checkPersistedCompletedSessionExpiration, +} from './expire_persisted_sessions'; -/** - * The OSS session service, which leaves most search session-related logic unimplemented. - * @see x-pack/plugins/data_enhanced/server/search/session/session_service.ts - * @internal - */ -export class SearchSessionService implements ISearchSessionService { - constructor() {} +export interface SearchSessionDependencies { + savedObjectsClient: SavedObjectsClientContract; +} +interface SetupDependencies { + taskManager: TaskManagerSetupContract; + security?: SecurityPluginSetup; +} - public asScopedProvider() { - return () => ({ - getId: () => { - throw new Error('getId not implemented in OSS search session service'); - }, - trackId: async () => {}, - getSearchIdMapping: async () => new Map(), - save: async () => { - throw new Error('save not implemented in OSS search session service'); - }, - get: async () => { - throw new Error('get not implemented in OSS search session service'); - }, - find: async () => { - throw new Error('find not implemented in OSS search session service'); - }, - update: async () => { - throw new Error('update not implemented in OSS search session service'); - }, - extend: async () => { - throw new Error('extend not implemented in OSS search session service'); - }, - cancel: async () => { - throw new Error('cancel not implemented in OSS search session service'); - }, - delete: async () => { - throw new Error('delete not implemented in OSS search session service'); - }, - getConfig: () => { - return null; +interface StartDependencies { + taskManager: TaskManagerStartContract; +} + +const DEBOUNCE_UPDATE_OR_CREATE_WAIT = 1000; +const DEBOUNCE_UPDATE_OR_CREATE_MAX_WAIT = 5000; + +interface UpdateOrCreateQueueEntry { + deps: SearchSessionDependencies; + user: AuthenticatedUser | null; + sessionId: string; + attributes: Partial; + resolve: () => void; + reject: (reason?: unknown) => void; +} + +function sleep(ms: number) { + return new Promise((r) => setTimeout(r, ms)); +} +export class SearchSessionService + implements ISearchSessionService +{ + private sessionConfig: SearchSessionsConfigSchema; + private readonly updateOrCreateBatchQueue: UpdateOrCreateQueueEntry[] = []; + private security?: SecurityPluginSetup; + private setupCompleted = false; + + constructor( + private readonly logger: Logger, + private readonly config: ConfigSchema, + private readonly version: string + ) { + this.sessionConfig = this.config.search.sessions; + } + + public setup(core: CoreSetup, deps: SetupDependencies) { + this.security = deps.security; + const taskDeps = { + config: this.config, + taskManager: deps.taskManager, + logger: this.logger, + }; + + registerSearchSessionsTask( + core, + taskDeps, + SEARCH_SESSIONS_TASK_TYPE, + 'persisted session progress', + checkPersistedSessionsProgress + ); + + registerSearchSessionsTask( + core, + taskDeps, + SEARCH_SESSIONS_CLEANUP_TASK_TYPE, + 'non persisted session cleanup', + checkNonPersistedSessions + ); + + registerSearchSessionsTask( + core, + taskDeps, + SEARCH_SESSIONS_EXPIRE_TASK_TYPE, + 'complete session expiration', + checkPersistedCompletedSessionExpiration + ); + + this.setupCompleted = true; + } + + public async start(core: CoreStart, deps: StartDependencies) { + if (!this.setupCompleted) + throw new Error('SearchSessionService setup() must be called before start()'); + + return this.setupMonitoring(core, deps); + } + + public stop() {} + + private setupMonitoring = async (core: CoreStart, deps: StartDependencies) => { + const taskDeps = { + config: this.config, + taskManager: deps.taskManager, + logger: this.logger, + }; + + if (this.sessionConfig.enabled) { + scheduleSearchSessionsTask( + taskDeps, + SEARCH_SESSIONS_TASK_ID, + SEARCH_SESSIONS_TASK_TYPE, + this.sessionConfig.trackingInterval + ); + + scheduleSearchSessionsTask( + taskDeps, + SEARCH_SESSIONS_CLEANUP_TASK_ID, + SEARCH_SESSIONS_CLEANUP_TASK_TYPE, + this.sessionConfig.cleanupInterval + ); + + scheduleSearchSessionsTask( + taskDeps, + SEARCH_SESSIONS_EXPIRE_TASK_ID, + SEARCH_SESSIONS_EXPIRE_TASK_TYPE, + this.sessionConfig.expireInterval + ); + } else { + unscheduleSearchSessionsTask(taskDeps, SEARCH_SESSIONS_TASK_ID); + unscheduleSearchSessionsTask(taskDeps, SEARCH_SESSIONS_CLEANUP_TASK_ID); + unscheduleSearchSessionsTask(taskDeps, SEARCH_SESSIONS_EXPIRE_TASK_ID); + } + }; + + private processUpdateOrCreateBatchQueue = debounce( + () => { + const queue = [...this.updateOrCreateBatchQueue]; + if (queue.length === 0) return; + this.updateOrCreateBatchQueue.length = 0; + const batchedSessionAttributes = queue.reduce((res, next) => { + if (!res[next.sessionId]) { + res[next.sessionId] = next.attributes; + } else { + res[next.sessionId] = { + ...res[next.sessionId], + ...next.attributes, + idMapping: { + ...res[next.sessionId].idMapping, + ...next.attributes.idMapping, + }, + }; + } + return res; + }, {} as { [sessionId: string]: Partial }); + + Object.keys(batchedSessionAttributes).forEach((sessionId) => { + const thisSession = queue.filter((s) => s.sessionId === sessionId); + this.updateOrCreate( + thisSession[0].deps, + thisSession[0].user, + sessionId, + batchedSessionAttributes[sessionId] + ) + .then(() => { + thisSession.forEach((s) => s.resolve()); + }) + .catch((e) => { + thisSession.forEach((s) => s.reject(e)); + }); + }); + }, + DEBOUNCE_UPDATE_OR_CREATE_WAIT, + { maxWait: DEBOUNCE_UPDATE_OR_CREATE_MAX_WAIT } + ); + private scheduleUpdateOrCreate = ( + deps: SearchSessionDependencies, + user: AuthenticatedUser | null, + sessionId: string, + attributes: Partial + ): Promise => { + return new Promise((resolve, reject) => { + this.updateOrCreateBatchQueue.push({ deps, user, sessionId, attributes, resolve, reject }); + // TODO: this would be better if we'd debounce per sessionId + this.processUpdateOrCreateBatchQueue(); + }); + }; + + private updateOrCreate = async ( + deps: SearchSessionDependencies, + user: AuthenticatedUser | null, + sessionId: string, + attributes: Partial, + retry: number = 1 + ): Promise | undefined> => { + const retryOnConflict = async (e: any) => { + this.logger.debug(`Conflict error | ${sessionId}`); + // Randomize sleep to spread updates out in case of conflicts + await sleep(100 + Math.random() * 50); + return await this.updateOrCreate(deps, user, sessionId, attributes, retry + 1); + }; + + this.logger.debug(`updateOrCreate | ${sessionId} | ${retry}`); + try { + return (await this.update( + deps, + user, + sessionId, + attributes + )) as SavedObject; + } catch (e) { + if (SavedObjectsErrorHelpers.isNotFoundError(e)) { + try { + this.logger.debug(`Object not found | ${sessionId}`); + return await this.create(deps, user, sessionId, attributes); + } catch (createError) { + if ( + SavedObjectsErrorHelpers.isConflictError(createError) && + retry < this.sessionConfig.maxUpdateRetries + ) { + return await retryOnConflict(createError); + } else { + this.logger.error(createError); + } + } + } else if ( + SavedObjectsErrorHelpers.isConflictError(e) && + retry < this.sessionConfig.maxUpdateRetries + ) { + return await retryOnConflict(e); + } else { + this.logger.error(e); + } + } + + return undefined; + }; + + public save = async ( + deps: SearchSessionDependencies, + user: AuthenticatedUser | null, + sessionId: string, + { + name, + appId, + locatorId, + initialState = {}, + restoreState = {}, + }: Partial + ) => { + if (!this.sessionConfig.enabled) throw new Error('Search sessions are disabled'); + if (!name) throw new Error('Name is required'); + if (!appId) throw new Error('AppId is required'); + if (!locatorId) throw new Error('locatorId is required'); + + return this.updateOrCreate(deps, user, sessionId, { + name, + appId, + locatorId, + initialState, + restoreState, + persisted: true, + }); + }; + + private create = ( + { savedObjectsClient }: SearchSessionDependencies, + user: AuthenticatedUser | null, + sessionId: string, + attributes: Partial + ) => { + this.logger.debug(`create | ${sessionId}`); + + const realmType = user?.authentication_realm.type; + const realmName = user?.authentication_realm.name; + const username = user?.username; + + return savedObjectsClient.create( + SEARCH_SESSION_TYPE, + { + sessionId, + status: SearchSessionStatus.IN_PROGRESS, + expires: new Date( + Date.now() + this.sessionConfig.defaultExpiration.asMilliseconds() + ).toISOString(), + created: new Date().toISOString(), + touched: new Date().toISOString(), + idMapping: {}, + persisted: false, + version: this.version, + realmType, + realmName, + username, + ...attributes, }, + { id: sessionId } + ); + }; + + public get = async ( + { savedObjectsClient }: SearchSessionDependencies, + user: AuthenticatedUser | null, + sessionId: string + ) => { + this.logger.debug(`get | ${sessionId}`); + const session = await savedObjectsClient.get( + SEARCH_SESSION_TYPE, + sessionId + ); + this.throwOnUserConflict(user, session); + return session; + }; + + public find = ( + { savedObjectsClient }: SearchSessionDependencies, + user: AuthenticatedUser | null, + options: Omit + ) => { + const userFilters = + user === null + ? [] + : [ + nodeBuilder.is( + `${SEARCH_SESSION_TYPE}.attributes.realmType`, + `${user.authentication_realm.type}` + ), + nodeBuilder.is( + `${SEARCH_SESSION_TYPE}.attributes.realmName`, + `${user.authentication_realm.name}` + ), + nodeBuilder.is(`${SEARCH_SESSION_TYPE}.attributes.username`, `${user.username}`), + ]; + const filterKueryNode = + typeof options.filter === 'string' ? fromKueryExpression(options.filter) : options.filter; + const filter = nodeBuilder.and(userFilters.concat(filterKueryNode ?? [])); + return savedObjectsClient.find({ + ...options, + filter, + type: SEARCH_SESSION_TYPE, + }); + }; + + public update = async ( + deps: SearchSessionDependencies, + user: AuthenticatedUser | null, + sessionId: string, + attributes: Partial + ) => { + this.logger.debug(`update | ${sessionId}`); + if (!this.sessionConfig.enabled) throw new Error('Search sessions are disabled'); + await this.get(deps, user, sessionId); // Verify correct user + return deps.savedObjectsClient.update( + SEARCH_SESSION_TYPE, + sessionId, + { + ...attributes, + touched: new Date().toISOString(), + } + ); + }; + + public async extend( + deps: SearchSessionDependencies, + user: AuthenticatedUser | null, + sessionId: string, + expires: Date + ) { + this.logger.debug(`extend | ${sessionId}`); + return this.update(deps, user, sessionId, { expires: expires.toISOString() }); + } + + public cancel = async ( + deps: SearchSessionDependencies, + user: AuthenticatedUser | null, + sessionId: string + ) => { + this.logger.debug(`delete | ${sessionId}`); + return this.update(deps, user, sessionId, { + status: SearchSessionStatus.CANCELLED, + }); + }; + + public delete = async ( + deps: SearchSessionDependencies, + user: AuthenticatedUser | null, + sessionId: string + ) => { + if (!this.sessionConfig.enabled) throw new Error('Search sessions are disabled'); + this.logger.debug(`delete | ${sessionId}`); + await this.get(deps, user, sessionId); // Verify correct user + return deps.savedObjectsClient.delete(SEARCH_SESSION_TYPE, sessionId); + }; + + /** + * Tracks the given search request/search ID in the saved session. + * @internal + */ + public trackId = async ( + deps: SearchSessionDependencies, + user: AuthenticatedUser | null, + searchRequest: IKibanaSearchRequest, + searchId: string, + { sessionId, strategy = ENHANCED_ES_SEARCH_STRATEGY }: ISearchOptions + ) => { + if (!this.sessionConfig.enabled || !sessionId || !searchId) return; + this.logger.debug(`trackId | ${sessionId} | ${searchId}`); + + let idMapping: Record = {}; + + if (searchRequest.params) { + const requestHash = createRequestHash(searchRequest.params); + const searchInfo = { + id: searchId, + strategy, + status: SearchStatus.IN_PROGRESS, + }; + idMapping = { [requestHash]: searchInfo }; + } + + await this.scheduleUpdateOrCreate(deps, user, sessionId, { idMapping }); + }; + + public async getSearchIdMapping( + deps: SearchSessionDependencies, + user: AuthenticatedUser | null, + sessionId: string + ) { + const searchSession = await this.get(deps, user, sessionId); + const searchIdMapping = new Map(); + Object.values(searchSession.attributes.idMapping).forEach((requestInfo) => { + searchIdMapping.set(requestInfo.id, requestInfo.strategy); }); + return searchIdMapping; } + + /** + * Look up an existing search ID that matches the given request in the given session so that the + * request can continue rather than restart. + * @internal + */ + public getId = async ( + deps: SearchSessionDependencies, + user: AuthenticatedUser | null, + searchRequest: IKibanaSearchRequest, + { sessionId, isStored, isRestore }: ISearchOptions + ) => { + if (!this.sessionConfig.enabled) { + throw new Error('Search sessions are disabled'); + } else if (!sessionId) { + throw new Error('Session ID is required'); + } else if (!isStored) { + throw new Error('Cannot get search ID from a session that is not stored'); + } else if (!isRestore) { + throw new Error('Get search ID is only supported when restoring a session'); + } + + const session = await this.get(deps, user, sessionId); + const requestHash = createRequestHash(searchRequest.params); + if (!session.attributes.idMapping.hasOwnProperty(requestHash)) { + this.logger.error(`getId | ${sessionId} | ${requestHash} not found`); + throw new NoSearchIdInSessionError(); + } + this.logger.debug(`getId | ${sessionId} | ${requestHash}`); + + return session.attributes.idMapping[requestHash].id; + }; + + public asScopedProvider = ({ savedObjects }: CoreStart) => { + return (request: KibanaRequest) => { + const user = this.security?.authc.getCurrentUser(request) ?? null; + const savedObjectsClient = savedObjects.getScopedClient(request, { + includedHiddenTypes: [SEARCH_SESSION_TYPE], + }); + const deps = { savedObjectsClient }; + return { + getId: this.getId.bind(this, deps, user), + trackId: this.trackId.bind(this, deps, user), + getSearchIdMapping: this.getSearchIdMapping.bind(this, deps, user), + save: this.save.bind(this, deps, user), + get: this.get.bind(this, deps, user), + find: this.find.bind(this, deps, user), + update: this.update.bind(this, deps, user), + extend: this.extend.bind(this, deps, user), + cancel: this.cancel.bind(this, deps, user), + delete: this.delete.bind(this, deps, user), + getConfig: () => this.config.search.sessions, + }; + }; + }; + + private throwOnUserConflict = ( + user: AuthenticatedUser | null, + session?: SavedObject + ) => { + if (user === null || !session) return; + if ( + user.authentication_realm.type !== session.attributes.realmType || + user.authentication_realm.name !== session.attributes.realmName || + user.username !== session.attributes.username + ) { + this.logger.debug( + `User ${user.username} has no access to search session ${session.attributes.sessionId}` + ); + throw notFound(); + } + }; } diff --git a/x-pack/plugins/data_enhanced/server/search/session/setup_task.ts b/src/plugins/data/server/search/session/setup_task.ts similarity index 88% rename from x-pack/plugins/data_enhanced/server/search/session/setup_task.ts rename to src/plugins/data/server/search/session/setup_task.ts index a8d47d5babd57..5fe44b0901b79 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/setup_task.ts +++ b/src/plugins/data/server/search/session/setup_task.ts @@ -1,17 +1,17 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { Duration } from 'moment'; import { filter, takeUntil } from 'rxjs/operators'; import { BehaviorSubject } from 'rxjs'; -import { RunContext, TaskRunCreatorFunction } from '@kbn/task-manager-plugin/server'; +import type { RunContext, TaskRunCreatorFunction } from '@kbn/task-manager-plugin/server'; import { CoreSetup, SavedObjectsClient } from '@kbn/core/server'; -import { SEARCH_SESSION_TYPE } from '@kbn/data-plugin/common'; -import { DataEnhancedStartDependencies } from '../../type'; +import { SEARCH_SESSION_TYPE } from '../../../common'; import { SearchSessionTaskSetupDeps, SearchSessionTaskStartDeps, @@ -19,7 +19,7 @@ import { } from './types'; export function searchSessionTaskRunner( - core: CoreSetup, + core: CoreSetup, deps: SearchSessionTaskSetupDeps, title: string, checkFn: SearchSessionTaskFn @@ -68,7 +68,7 @@ export function searchSessionTaskRunner( } export function registerSearchSessionsTask( - core: CoreSetup, + core: CoreSetup, deps: SearchSessionTaskSetupDeps, taskType: string, title: string, diff --git a/src/plugins/data/server/search/session/types.ts b/src/plugins/data/server/search/session/types.ts index 76c4cff37cfa2..e564a8cef9e79 100644 --- a/src/plugins/data/server/search/session/types.ts +++ b/src/plugins/data/server/search/session/types.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import { Observable } from 'rxjs'; import { CoreStart, KibanaRequest, @@ -13,9 +14,17 @@ import { SavedObjectsFindOptions, SavedObjectsFindResponse, SavedObjectsUpdateResponse, + ElasticsearchClient, + Logger, + SavedObjectsClientContract, } from '@kbn/core/server'; +import type { + TaskManagerSetupContract, + TaskManagerStartContract, +} from '@kbn/task-manager-plugin/server'; +import { KueryNode, SearchSessionSavedObjectAttributes } from '../../../common'; import { IKibanaSearchRequest, ISearchOptions } from '../../../common/search'; -import { SearchSessionsConfigSchema } from '../../../config'; +import { SearchSessionsConfigSchema, ConfigSchema } from '../../../config'; export interface IScopedSearchSessionsClient { getId: (request: IKibanaSearchRequest, options: ISearchOptions) => Promise; @@ -38,3 +47,44 @@ export interface IScopedSearchSessionsClient { export interface ISearchSessionService { asScopedProvider: (core: CoreStart) => (request: KibanaRequest) => IScopedSearchSessionsClient; } + +export enum SearchStatus { + IN_PROGRESS = 'in_progress', + ERROR = 'error', + COMPLETE = 'complete', +} + +export interface CheckSearchSessionsDeps { + savedObjectsClient: SavedObjectsClientContract; + client: ElasticsearchClient; + logger: Logger; +} + +export interface SearchSessionTaskSetupDeps { + taskManager: TaskManagerSetupContract; + logger: Logger; + config: ConfigSchema; +} + +export interface SearchSessionTaskStartDeps { + taskManager: TaskManagerStartContract; + logger: Logger; + config: ConfigSchema; +} + +export type SearchSessionTaskFn = ( + deps: CheckSearchSessionsDeps, + config: SearchSessionsConfigSchema +) => Observable; + +export type SearchSessionsResponse = SavedObjectsFindResponse< + SearchSessionSavedObjectAttributes, + unknown +>; + +export type CheckSearchSessionsFn = ( + deps: CheckSearchSessionsDeps, + config: SearchSessionsConfigSchema, + filter: KueryNode, + page: number +) => Observable; diff --git a/x-pack/plugins/data_enhanced/server/search/session/update_session_status.test.ts b/src/plugins/data/server/search/session/update_session_status.test.ts similarity index 97% rename from x-pack/plugins/data_enhanced/server/search/session/update_session_status.test.ts rename to src/plugins/data/server/search/session/update_session_status.test.ts index 03bdad773f647..38e8ec6cad150 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/update_session_status.test.ts +++ b/src/plugins/data/server/search/session/update_session_status.test.ts @@ -1,12 +1,13 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { bulkUpdateSessions, updateSessionStatus } from './update_session_status'; -import { SearchSessionStatus, SearchSessionSavedObjectAttributes } from '@kbn/data-plugin/common'; +import { SearchSessionStatus, SearchSessionSavedObjectAttributes } from '../../../common'; import { savedObjectsClientMock } from '@kbn/core/server/mocks'; import { SearchStatus } from './types'; import moment from 'moment'; diff --git a/x-pack/plugins/data_enhanced/server/search/session/update_session_status.ts b/src/plugins/data/server/search/session/update_session_status.ts similarity index 90% rename from x-pack/plugins/data_enhanced/server/search/session/update_session_status.ts rename to src/plugins/data/server/search/session/update_session_status.ts index 2f6ef6ab3fc53..e8405eb5427b0 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/update_session_status.ts +++ b/src/plugins/data/server/search/session/update_session_status.ts @@ -1,29 +1,26 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { SavedObjectsFindResult, SavedObjectsUpdateResponse } from '@kbn/core/server'; +import { SearchSessionsConfigSchema } from '../../../config'; import { SearchSessionRequestInfo, SearchSessionSavedObjectAttributes, SearchSessionStatus, -} from '@kbn/data-plugin/common'; +} from '../../../common'; import { getSearchStatus } from './get_search_status'; import { getSessionStatus } from './get_session_status'; -import { - CheckSearchSessionsDeps, - SearchSessionsConfig, - SearchSessionsResponse, - SearchStatus, -} from './types'; +import { CheckSearchSessionsDeps, SearchSessionsResponse, SearchStatus } from './types'; import { isSearchSessionExpired } from './utils'; export async function updateSessionStatus( { logger, client }: CheckSearchSessionsDeps, - config: SearchSessionsConfig, + config: SearchSessionsConfigSchema, session: SavedObjectsFindResult ) { let sessionUpdated = false; @@ -85,7 +82,7 @@ export async function updateSessionStatus( export async function getAllSessionsStatusUpdates( deps: CheckSearchSessionsDeps, - config: SearchSessionsConfig, + config: SearchSessionsConfigSchema, searchSessions: SearchSessionsResponse ) { const updatedSessions = new Array>(); diff --git a/x-pack/plugins/data_enhanced/server/search/session/utils.test.ts b/src/plugins/data/server/search/session/utils.test.ts similarity index 75% rename from x-pack/plugins/data_enhanced/server/search/session/utils.test.ts rename to src/plugins/data/server/search/session/utils.test.ts index 9e142bf25a56a..fea5510f860d7 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/utils.test.ts +++ b/src/plugins/data/server/search/session/utils.test.ts @@ -1,8 +1,9 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { createRequestHash } from './utils'; diff --git a/x-pack/plugins/data_enhanced/server/search/session/utils.ts b/src/plugins/data/server/search/session/utils.ts similarity index 78% rename from x-pack/plugins/data_enhanced/server/search/session/utils.ts rename to src/plugins/data/server/search/session/utils.ts index f7f3c3c17505b..241f8cbbfd029 100644 --- a/x-pack/plugins/data_enhanced/server/search/session/utils.ts +++ b/src/plugins/data/server/search/session/utils.ts @@ -1,15 +1,16 @@ /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import { createHash } from 'crypto'; import stringify from 'json-stable-stringify'; import { SavedObjectsFindResult } from '@kbn/core/server'; import moment from 'moment'; -import { SearchSessionSavedObjectAttributes } from '@kbn/data-plugin/common'; +import { SearchSessionSavedObjectAttributes } from '../../../common'; /** * Generate the hash for this request so that, in the future, this hash can be used to look up diff --git a/src/plugins/data/server/search/strategies/es_search/es_search_strategy.ts b/src/plugins/data/server/search/strategies/es_search/es_search_strategy.ts index 02ebd10f7cb07..741174ac01613 100644 --- a/src/plugins/data/server/search/strategies/es_search/es_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/es_search/es_search_strategy.ts @@ -11,10 +11,10 @@ import { tap } from 'rxjs/operators'; import type { Logger, SharedGlobalConfig } from '@kbn/core/server'; import { getKbnServerError, KbnServerError } from '@kbn/kibana-utils-plugin/server'; import type { ISearchStrategy } from '../../types'; -import type { SearchUsage } from '../../collectors'; +import type { SearchUsage } from '../../collectors/search'; import { getDefaultSearchParams, getShardTimeout } from './request_utils'; import { shimHitsTotal, toKibanaSearchResponse } from './response_utils'; -import { searchUsageObserver } from '../../collectors/usage'; +import { searchUsageObserver } from '../../collectors/search/usage'; export const esSearchStrategyProvider = ( config$: Observable, @@ -30,7 +30,7 @@ export const esSearchStrategyProvider = ( */ search: (request, { abortSignal, ...options }, { esClient, uiSettingsClient }) => { // Only default index pattern type is supported here. - // See data_enhanced for other type support. + // See ese for other type support. if (request.indexType) { throw new KbnServerError(`Unsupported index pattern type ${request.indexType}`, 400); } diff --git a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts index 11229e99526db..450407800e7af 100644 --- a/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/ese_search/ese_search_strategy.ts @@ -26,7 +26,7 @@ import { getIgnoreThrottled, } from './request_utils'; import { toAsyncKibanaSearchResponse } from './response_utils'; -import { SearchUsage, searchUsageObserver } from '../../collectors'; +import { SearchUsage, searchUsageObserver } from '../../collectors/search'; import { getDefaultSearchParams, getShardTimeout, diff --git a/src/plugins/data/server/search/types.ts b/src/plugins/data/server/search/types.ts index 70e04e97ea169..2d2a10300ee69 100644 --- a/src/plugins/data/server/search/types.ts +++ b/src/plugins/data/server/search/types.ts @@ -26,12 +26,8 @@ import { SearchSourceService, } from '../../common/search'; import { AggsSetup, AggsStart } from './aggs'; -import { SearchUsage } from './collectors'; -import type { IScopedSearchSessionsClient, ISearchSessionService } from './session'; - -export interface SearchEnhancements { - sessionService: ISearchSessionService; -} +import { SearchUsage } from './collectors/search'; +import type { IScopedSearchSessionsClient } from './session'; export interface SearchStrategyDependencies { savedObjectsClient: SavedObjectsClientContract; @@ -60,11 +56,6 @@ export interface ISearchSetup { */ usage?: SearchUsage; - /** - * @internal - */ - __enhance: (enhancements: SearchEnhancements) => void; - searchSource: ReturnType; } diff --git a/src/plugins/data/tsconfig.json b/src/plugins/data/tsconfig.json index b618a047f375d..8f391fc15e871 100644 --- a/src/plugins/data/tsconfig.json +++ b/src/plugins/data/tsconfig.json @@ -13,6 +13,7 @@ "config.ts", "common/**/*.json", "public/**/*.json", + "../../../typings/index.d.ts" ], "references": [ { "path": "../../core/tsconfig.json" }, @@ -24,6 +25,9 @@ { "path": "../kibana_utils/tsconfig.json" }, { "path": "../kibana_react/tsconfig.json" }, { "path": "../field_formats/tsconfig.json" }, - { "path": "../data_views/tsconfig.json" } + { "path": "../data_views/tsconfig.json" }, + { "path": "../screenshot_mode/tsconfig.json" }, + { "path": "../../../x-pack/plugins/task_manager/tsconfig.json" }, + { "path": "../../../x-pack/plugins/security/tsconfig.json" } ] } diff --git a/src/plugins/es_ui_shared/kibana.json b/src/plugins/es_ui_shared/kibana.json index 1a4ff33674f95..c7fd36e0c1467 100644 --- a/src/plugins/es_ui_shared/kibana.json +++ b/src/plugins/es_ui_shared/kibana.json @@ -14,5 +14,5 @@ "static/forms/components", "static/forms/helpers/field_validators/types" ], - "requiredBundles": ["data", "kibanaReact"] + "requiredBundles": ["dataViews", "kibanaReact"] } diff --git a/src/plugins/es_ui_shared/public/indices/constants/index.ts b/src/plugins/es_ui_shared/public/indices/constants/index.ts index f7858c94dcab9..01bd15bedc26a 100644 --- a/src/plugins/es_ui_shared/public/indices/constants/index.ts +++ b/src/plugins/es_ui_shared/public/indices/constants/index.ts @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -import { indexPatterns } from '@kbn/data-plugin/public'; +import { ILLEGAL_CHARACTERS_VISIBLE } from '@kbn/data-views-plugin/public'; -export const INDEX_ILLEGAL_CHARACTERS_VISIBLE = [...indexPatterns.ILLEGAL_CHARACTERS_VISIBLE, '*']; +export const INDEX_ILLEGAL_CHARACTERS_VISIBLE = [...ILLEGAL_CHARACTERS_VISIBLE, '*']; // Insert the comma into the middle, so it doesn't look as if it has grammatical meaning when // these characters are rendered in the UI. -const insertionIndex = Math.floor(indexPatterns.ILLEGAL_CHARACTERS_VISIBLE.length / 2); +const insertionIndex = Math.floor(ILLEGAL_CHARACTERS_VISIBLE.length / 2); INDEX_ILLEGAL_CHARACTERS_VISIBLE.splice(insertionIndex, 0, ','); diff --git a/src/plugins/es_ui_shared/static/forms/helpers/field_validators/index_pattern_field.ts b/src/plugins/es_ui_shared/static/forms/helpers/field_validators/index_pattern_field.ts index 52cd12b09a32e..3edb6b2c0090a 100644 --- a/src/plugins/es_ui_shared/static/forms/helpers/field_validators/index_pattern_field.ts +++ b/src/plugins/es_ui_shared/static/forms/helpers/field_validators/index_pattern_field.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { indexPatterns } from '@kbn/data-plugin/public'; +import { validateDataView } from '@kbn/data-views-plugin/public'; import { ValidationFunc } from '../../hook_form_lib'; import { containsChars } from '../../../validators/string'; import { ERROR_CODE } from './types'; @@ -34,7 +34,7 @@ export const indexPatternField = } // Validate illegal characters - const errors = indexPatterns.validate(value); + const errors = validateDataView(value); if (errors.ILLEGAL_CHARACTERS) { return { diff --git a/src/plugins/es_ui_shared/tsconfig.json b/src/plugins/es_ui_shared/tsconfig.json index 38e6cf78f8f60..90459058eec71 100644 --- a/src/plugins/es_ui_shared/tsconfig.json +++ b/src/plugins/es_ui_shared/tsconfig.json @@ -15,6 +15,6 @@ ], "references": [ { "path": "../../core/tsconfig.json" }, - { "path": "../data/tsconfig.json" } + { "path": "../data_views/tsconfig.json" } ] } diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index ca9a57bb4462a..308be959ba67a 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -215,6 +215,19 @@ } } }, + "search-session": { + "properties": { + "transientCount": { + "type": "long" + }, + "persistedCount": { + "type": "long" + }, + "totalCount": { + "type": "long" + } + } + }, "sample-data": { "properties": { "installed": { diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index c4c9d86a4df2f..32fc3be58d39c 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -91,6 +91,20 @@ export default function ({ getService }: PluginFunctionalProviderContext) { 'unifiedSearch.autocomplete.valueSuggestions.tiers (array)', 'unifiedSearch.autocomplete.valueSuggestions.timeout (duration)', 'data.search.aggs.shardDelay.enabled (boolean)', + 'data.search.sessions.cleanupInterval (duration)', + 'data.search.sessions.defaultExpiration (duration)', + 'data.search.sessions.enabled (boolean)', + 'data.search.sessions.expireInterval (duration)', + 'data.search.sessions.management.expiresSoonWarning (duration)', + 'data.search.sessions.management.maxSessions (number)', + 'data.search.sessions.management.refreshInterval (duration)', + 'data.search.sessions.management.refreshTimeout (duration)', + 'data.search.sessions.maxUpdateRetries (number)', + 'data.search.sessions.monitoringTaskTimeout (duration)', + 'data.search.sessions.notTouchedInProgressTimeout (duration)', + 'data.search.sessions.notTouchedTimeout (duration)', + 'data.search.sessions.pageSize (number)', + 'data.search.sessions.trackingInterval (duration)', 'enterpriseSearch.host (string)', 'home.disableWelcomeScreen (boolean)', 'map.emsFileApiUrl (string)', @@ -154,20 +168,6 @@ export default function ({ getService }: PluginFunctionalProviderContext) { 'xpack.cloud.id (string)', 'xpack.cloud.organization_url (string)', 'xpack.cloud.profile_url (string)', - 'xpack.data_enhanced.search.sessions.cleanupInterval (duration)', - 'xpack.data_enhanced.search.sessions.defaultExpiration (duration)', - 'xpack.data_enhanced.search.sessions.enabled (boolean)', - 'xpack.data_enhanced.search.sessions.expireInterval (duration)', - 'xpack.data_enhanced.search.sessions.management.expiresSoonWarning (duration)', - 'xpack.data_enhanced.search.sessions.management.maxSessions (number)', - 'xpack.data_enhanced.search.sessions.management.refreshInterval (duration)', - 'xpack.data_enhanced.search.sessions.management.refreshTimeout (duration)', - 'xpack.data_enhanced.search.sessions.maxUpdateRetries (number)', - 'xpack.data_enhanced.search.sessions.monitoringTaskTimeout (duration)', - 'xpack.data_enhanced.search.sessions.notTouchedInProgressTimeout (duration)', - 'xpack.data_enhanced.search.sessions.notTouchedTimeout (duration)', - 'xpack.data_enhanced.search.sessions.pageSize (number)', - 'xpack.data_enhanced.search.sessions.trackingInterval (duration)', 'xpack.discoverEnhanced.actions.exploreDataInChart.enabled (boolean)', 'xpack.discoverEnhanced.actions.exploreDataInContextMenu.enabled (boolean)', 'xpack.fleet.agents.enabled (boolean)', diff --git a/test/scripts/jenkins_storybook.sh b/test/scripts/jenkins_storybook.sh index e03494e13677d..a07a634d2dba2 100755 --- a/test/scripts/jenkins_storybook.sh +++ b/test/scripts/jenkins_storybook.sh @@ -10,7 +10,7 @@ yarn storybook --site ci_composite yarn storybook --site custom_integrations yarn storybook --site dashboard yarn storybook --site dashboard_enhanced -yarn storybook --site data_enhanced +yarn storybook --site data yarn storybook --site embeddable yarn storybook --site expression_error yarn storybook --site expression_image diff --git a/tsconfig.base.json b/tsconfig.base.json index ac35847201b7f..78023a603276a 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -295,8 +295,6 @@ "@kbn/cross-cluster-replication-plugin/*": ["x-pack/plugins/cross_cluster_replication/*"], "@kbn/dashboard-enhanced-plugin": ["x-pack/plugins/dashboard_enhanced"], "@kbn/dashboard-enhanced-plugin/*": ["x-pack/plugins/dashboard_enhanced/*"], - "@kbn/data-enhanced-plugin": ["x-pack/plugins/data_enhanced"], - "@kbn/data-enhanced-plugin/*": ["x-pack/plugins/data_enhanced/*"], "@kbn/data-visualizer-plugin": ["x-pack/plugins/data_visualizer"], "@kbn/data-visualizer-plugin/*": ["x-pack/plugins/data_visualizer/*"], "@kbn/discover-enhanced-plugin": ["x-pack/plugins/discover_enhanced"], diff --git a/tsconfig.types.json b/tsconfig.types.json index 54a26b6aca404..0217a2cde12bb 100644 --- a/tsconfig.types.json +++ b/tsconfig.types.json @@ -7,17 +7,11 @@ "declaration": true, "emitDeclarationOnly": true, "declarationMap": true, + "rootDir": "./src" }, "include": [ "src/core/server/index.ts", "src/core/public/index.ts", - "src/plugins/data/server/index.ts", - "src/plugins/data/public/index.ts", - "src/plugins/embeddable/server/index.ts", - "src/plugins/embeddable/public/index.ts", - "src/plugins/expressions/server/index.ts", - "src/plugins/expressions/public/index.ts", - "src/plugins/ui_actions/public/index.ts", "typings" ] } diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index a632593f8b96b..b1464f5cfbe2e 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -14,7 +14,6 @@ "xpack.dashboard": "plugins/dashboard_enhanced", "xpack.discover": "plugins/discover_enhanced", "xpack.crossClusterReplication": "plugins/cross_cluster_replication", - "xpack.data": "plugins/data_enhanced", "xpack.embeddableEnhanced": "plugins/embeddable_enhanced", "xpack.endpoint": "plugins/endpoint", "xpack.enterpriseSearch": "plugins/enterprise_search", diff --git a/x-pack/plugins/actions/tsconfig.json b/x-pack/plugins/actions/tsconfig.json index aad127a6ca94c..6fced06e2057f 100644 --- a/x-pack/plugins/actions/tsconfig.json +++ b/x-pack/plugins/actions/tsconfig.json @@ -15,6 +15,7 @@ ], "references": [ { "path": "../../../src/core/tsconfig.json" }, + { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../spaces/tsconfig.json" }, { "path": "../security/tsconfig.json" }, { "path": "../licensing/tsconfig.json" }, diff --git a/x-pack/plugins/data_enhanced/README.md b/x-pack/plugins/data_enhanced/README.md deleted file mode 100644 index fba484261fea2..0000000000000 --- a/x-pack/plugins/data_enhanced/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# data_enhanced - -The `data_enhanced` plugin is the x-pack counterpart to the `src/plguins/data` plugin. - -It exists to provide services, or parts of services, which -enhance existing functionality from `src/plugins/data`. - -Currently, the `data_enhanced` plugin doesn't return any APIs which you can -consume directly, however it is possible that you are indirectly relying on the -enhanced functionality that it provides via the `data` plugin from `src/`. - -Here is the functionality it adds: - -## Search Sessions - -Search sessions are handy when you want to enable a user to run something asynchronously (for example, a dashboard over a long period of time), and then quickly restore the results at a later time. The Search Service transparently fetches results from the .async-search index, instead of running each request again. diff --git a/x-pack/plugins/data_enhanced/common/index.ts b/x-pack/plugins/data_enhanced/common/index.ts deleted file mode 100644 index 1fec1c76430eb..0000000000000 --- a/x-pack/plugins/data_enhanced/common/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ diff --git a/x-pack/plugins/data_enhanced/common/search/index.ts b/x-pack/plugins/data_enhanced/common/search/index.ts deleted file mode 100644 index 1fec1c76430eb..0000000000000 --- a/x-pack/plugins/data_enhanced/common/search/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ diff --git a/x-pack/plugins/data_enhanced/common/search/test_data/search_phase_execution_exception.json b/x-pack/plugins/data_enhanced/common/search/test_data/search_phase_execution_exception.json deleted file mode 100644 index b79a396445e3d..0000000000000 --- a/x-pack/plugins/data_enhanced/common/search/test_data/search_phase_execution_exception.json +++ /dev/null @@ -1,229 +0,0 @@ -{ - "error": { - "root_cause": [ - { - "type": "script_exception", - "reason": "compile error", - "script_stack": [ - "invalid", - "^---- HERE" - ], - "script": "invalid", - "lang": "painless", - "position": { - "offset": 0, - "start": 0, - "end": 7 - } - }, - { - "type": "script_exception", - "reason": "compile error", - "script_stack": [ - "invalid", - "^---- HERE" - ], - "script": "invalid", - "lang": "painless", - "position": { - "offset": 0, - "start": 0, - "end": 7 - } - }, - { - "type": "parse_exception", - "reason": "failed to parse date field [2021-01-19T12:2755.047Z] with format [strict_date_optional_time]: [failed to parse date field [2021-01-19T12:2755.047Z] with format [strict_date_optional_time]]" - }, - { - "type": "script_exception", - "reason": "compile error", - "script_stack": [ - "invalid", - "^---- HERE" - ], - "script": "invalid", - "lang": "painless", - "position": { - "offset": 0, - "start": 0, - "end": 7 - } - }, - { - "type": "script_exception", - "reason": "compile error", - "script_stack": [ - "invalid", - "^---- HERE" - ], - "script": "invalid", - "lang": "painless", - "position": { - "offset": 0, - "start": 0, - "end": 7 - } - }, - { - "type": "script_exception", - "reason": "compile error", - "script_stack": [ - "invalid", - "^---- HERE" - ], - "script": "invalid", - "lang": "painless", - "position": { - "offset": 0, - "start": 0, - "end": 7 - } - } - ], - "type": "search_phase_execution_exception", - "reason": "all shards failed", - "phase": "query", - "grouped": true, - "failed_shards": [ - { - "shard": 0, - "index": ".apm-agent-configuration", - "node": "DEfMVCg5R12TRG4CYIxUgQ", - "reason": { - "type": "script_exception", - "reason": "compile error", - "script_stack": [ - "invalid", - "^---- HERE" - ], - "script": "invalid", - "lang": "painless", - "position": { - "offset": 0, - "start": 0, - "end": 7 - }, - "caused_by": { - "type": "illegal_argument_exception", - "reason": "cannot resolve symbol [invalid]" - } - } - }, - { - "shard": 0, - "index": ".apm-custom-link", - "node": "DEfMVCg5R12TRG4CYIxUgQ", - "reason": { - "type": "script_exception", - "reason": "compile error", - "script_stack": [ - "invalid", - "^---- HERE" - ], - "script": "invalid", - "lang": "painless", - "position": { - "offset": 0, - "start": 0, - "end": 7 - }, - "caused_by": { - "type": "illegal_argument_exception", - "reason": "cannot resolve symbol [invalid]" - } - } - }, - { - "shard": 0, - "index": ".kibana-event-log-8.0.0-000001", - "node": "DEfMVCg5R12TRG4CYIxUgQ", - "reason": { - "type": "parse_exception", - "reason": "failed to parse date field [2021-01-19T12:2755.047Z] with format [strict_date_optional_time]: [failed to parse date field [2021-01-19T12:2755.047Z] with format [strict_date_optional_time]]", - "caused_by": { - "type": "illegal_argument_exception", - "reason": "failed to parse date field [2021-01-19T12:2755.047Z] with format [strict_date_optional_time]", - "caused_by": { - "type": "date_time_parse_exception", - "reason": "Text '2021-01-19T12:2755.047Z' could not be parsed, unparsed text found at index 16" - } - } - } - }, - { - "shard": 0, - "index": ".kibana_1", - "node": "DEfMVCg5R12TRG4CYIxUgQ", - "reason": { - "type": "script_exception", - "reason": "compile error", - "script_stack": [ - "invalid", - "^---- HERE" - ], - "script": "invalid", - "lang": "painless", - "position": { - "offset": 0, - "start": 0, - "end": 7 - }, - "caused_by": { - "type": "illegal_argument_exception", - "reason": "cannot resolve symbol [invalid]" - } - } - }, - { - "shard": 0, - "index": ".kibana_task_manager_1", - "node": "DEfMVCg5R12TRG4CYIxUgQ", - "reason": { - "type": "script_exception", - "reason": "compile error", - "script_stack": [ - "invalid", - "^---- HERE" - ], - "script": "invalid", - "lang": "painless", - "position": { - "offset": 0, - "start": 0, - "end": 7 - }, - "caused_by": { - "type": "illegal_argument_exception", - "reason": "cannot resolve symbol [invalid]" - } - } - }, - { - "shard": 0, - "index": ".security-7", - "node": "DEfMVCg5R12TRG4CYIxUgQ", - "reason": { - "type": "script_exception", - "reason": "compile error", - "script_stack": [ - "invalid", - "^---- HERE" - ], - "script": "invalid", - "lang": "painless", - "position": { - "offset": 0, - "start": 0, - "end": 7 - }, - "caused_by": { - "type": "illegal_argument_exception", - "reason": "cannot resolve symbol [invalid]" - } - } - } - ] - }, - "status": 400 -} \ No newline at end of file diff --git a/x-pack/plugins/data_enhanced/config.ts b/x-pack/plugins/data_enhanced/config.ts deleted file mode 100644 index eb3ee0da41839..0000000000000 --- a/x-pack/plugins/data_enhanced/config.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema, TypeOf } from '@kbn/config-schema'; -import { searchSessionsConfigSchema } from '@kbn/data-plugin/config'; - -export const configSchema = schema.object({ - search: schema.object({ - sessions: searchSessionsConfigSchema, - }), -}); - -export type ConfigSchema = TypeOf; diff --git a/x-pack/plugins/data_enhanced/jest.config.js b/x-pack/plugins/data_enhanced/jest.config.js deleted file mode 100644 index e48de352c2075..0000000000000 --- a/x-pack/plugins/data_enhanced/jest.config.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/data_enhanced'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/data_enhanced', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '/x-pack/plugins/data_enhanced/{common,public,server}/**/*.{ts,tsx}', - ], -}; diff --git a/x-pack/plugins/data_enhanced/kibana.json b/x-pack/plugins/data_enhanced/kibana.json deleted file mode 100644 index d89e76013ebd4..0000000000000 --- a/x-pack/plugins/data_enhanced/kibana.json +++ /dev/null @@ -1,29 +0,0 @@ - -{ - "id": "dataEnhanced", - "version": "8.0.0", - "kibanaVersion": "kibana", - "owner": { - "name": "App Services", - "githubTeam": "kibana-app-services" - }, - "configPath": ["xpack", "data_enhanced"], - "requiredPlugins": [ - "bfetch", - "data", - "features", - "management", - "share", - "taskManager", - "screenshotMode" - ], - "optionalPlugins": ["kibanaUtils", "usageCollection", "security"], - "server": true, - "ui": true, - "requiredBundles": ["kibanaUtils", "kibanaReact"], - "owner": { - "name": "App Services", - "githubTeam": "kibana-app-services" - }, - "description": "Enhanced data plugin. (See src/plugins/data.) Enhances the main data plugin with a search session management UI. Includes a reusable search session indicator component to use in other applications. Exposes routes for managing search sessions. Includes a service that monitors, updates, and cleans up search session saved objects." -} diff --git a/x-pack/plugins/data_enhanced/public/index.ts b/x-pack/plugins/data_enhanced/public/index.ts deleted file mode 100644 index 7af1aff1b3106..0000000000000 --- a/x-pack/plugins/data_enhanced/public/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { PluginInitializerContext } from '@kbn/core/public'; -import { DataEnhancedPlugin, DataEnhancedSetup, DataEnhancedStart } from './plugin'; -import { ConfigSchema } from '../config'; - -export const plugin = (initializerContext: PluginInitializerContext) => - new DataEnhancedPlugin(initializerContext); - -export type { DataEnhancedSetup, DataEnhancedStart }; - -export { ENHANCED_ES_SEARCH_STRATEGY, EQL_SEARCH_STRATEGY } from '@kbn/data-plugin/common'; diff --git a/x-pack/plugins/data_enhanced/public/plugin.ts b/x-pack/plugins/data_enhanced/public/plugin.ts deleted file mode 100644 index f1bb9d7b4b4b6..0000000000000 --- a/x-pack/plugins/data_enhanced/public/plugin.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import moment from 'moment'; -import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import { - DataPublicPluginSetup, - DataPublicPluginStart, - SearchUsageCollector, -} from '@kbn/data-plugin/public'; -import { BfetchPublicSetup } from '@kbn/bfetch-plugin/public'; -import { ManagementSetup } from '@kbn/management-plugin/public'; -import { SharePluginStart } from '@kbn/share-plugin/public'; - -import { toMountPoint } from '@kbn/kibana-react-plugin/public'; -import { Storage } from '@kbn/kibana-utils-plugin/public'; -import { ScreenshotModePluginStart } from '@kbn/screenshot-mode-plugin/public'; -import { registerSearchSessionsMgmt } from './search/sessions_mgmt'; -import { createConnectedSearchSessionIndicator } from './search'; -import { ConfigSchema } from '../config'; - -export interface DataEnhancedSetupDependencies { - bfetch: BfetchPublicSetup; - data: DataPublicPluginSetup; - management: ManagementSetup; -} -export interface DataEnhancedStartDependencies { - data: DataPublicPluginStart; - share: SharePluginStart; - screenshotMode: ScreenshotModePluginStart; -} - -export type DataEnhancedSetup = ReturnType; -export type DataEnhancedStart = ReturnType; - -export class DataEnhancedPlugin - implements Plugin -{ - private config!: ConfigSchema; - private readonly storage = new Storage(window.localStorage); - private usageCollector?: SearchUsageCollector; - - constructor(private initializerContext: PluginInitializerContext) {} - - public setup( - core: CoreSetup, - { bfetch, data, management }: DataEnhancedSetupDependencies - ) { - this.config = this.initializerContext.config.get(); - if (this.config.search.sessions.enabled) { - const sessionsConfig = this.config.search.sessions; - registerSearchSessionsMgmt( - core, - sessionsConfig, - this.initializerContext.env.packageInfo.version, - { data, management } - ); - } - - this.usageCollector = data.search.usageCollector; - } - - public start(core: CoreStart, plugins: DataEnhancedStartDependencies) { - if (this.config.search.sessions.enabled) { - core.chrome.setBreadcrumbsAppendExtension({ - content: toMountPoint( - React.createElement( - createConnectedSearchSessionIndicator({ - sessionService: plugins.data.search.session, - application: core.application, - basePath: core.http.basePath, - storage: this.storage, - disableSaveAfterSessionCompletesTimeout: moment - .duration(this.config.search.sessions.notTouchedTimeout) - .asMilliseconds(), - usageCollector: this.usageCollector, - tourDisabled: plugins.screenshotMode.isScreenshotMode(), - }) - ), - { theme$: core.theme.theme$ } - ), - }); - } - } - - public stop() {} -} diff --git a/x-pack/plugins/data_enhanced/public/search/index.ts b/x-pack/plugins/data_enhanced/public/search/index.ts deleted file mode 100644 index 84e70f41d6746..0000000000000 --- a/x-pack/plugins/data_enhanced/public/search/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export * from './ui'; diff --git a/x-pack/plugins/data_enhanced/server/index.ts b/x-pack/plugins/data_enhanced/server/index.ts deleted file mode 100644 index a56f7216c4706..0000000000000 --- a/x-pack/plugins/data_enhanced/server/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; -import { EnhancedDataServerPlugin } from './plugin'; -import { configSchema, ConfigSchema } from '../config'; - -export const config: PluginConfigDescriptor = { - exposeToBrowser: { - search: true, - }, - schema: configSchema, -}; - -export function plugin(initializerContext: PluginInitializerContext) { - return new EnhancedDataServerPlugin(initializerContext); -} - -export { ENHANCED_ES_SEARCH_STRATEGY, EQL_SEARCH_STRATEGY } from '@kbn/data-plugin/common'; - -export { EnhancedDataServerPlugin as Plugin }; diff --git a/x-pack/plugins/data_enhanced/server/plugin.ts b/x-pack/plugins/data_enhanced/server/plugin.ts deleted file mode 100644 index 007764ec95f0c..0000000000000 --- a/x-pack/plugins/data_enhanced/server/plugin.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { CoreSetup, CoreStart, Logger, Plugin, PluginInitializerContext } from '@kbn/core/server'; -import { registerSessionRoutes } from './routes'; -import { searchSessionSavedObjectType } from './saved_objects'; -import type { - DataEnhancedRequestHandlerContext, - DataEnhancedSetupDependencies as SetupDependencies, - DataEnhancedStartDependencies as StartDependencies, -} from './type'; -import { ConfigSchema } from '../config'; -import { registerUsageCollector } from './collectors'; -import { SearchSessionService } from './search'; - -export class EnhancedDataServerPlugin - implements Plugin -{ - private readonly logger: Logger; - private sessionService!: SearchSessionService; - private config: ConfigSchema; - - constructor(private initializerContext: PluginInitializerContext) { - this.logger = initializerContext.logger.get('data_enhanced'); - this.config = this.initializerContext.config.get(); - } - - public setup(core: CoreSetup, deps: SetupDependencies) { - core.savedObjects.registerType(searchSessionSavedObjectType); - - this.sessionService = new SearchSessionService( - this.logger, - this.config, - this.initializerContext.env.packageInfo.version, - deps.security - ); - - deps.data.__enhance({ - search: { - sessionService: this.sessionService, - }, - }); - - const router = core.http.createRouter(); - registerSessionRoutes(router, this.logger); - - this.sessionService.setup(core, { - taskManager: deps.taskManager, - }); - - if (deps.usageCollection) { - registerUsageCollector(deps.usageCollection, core.savedObjects.getKibanaIndex(), this.logger); - } - } - - public start(core: CoreStart, { taskManager }: StartDependencies) { - this.sessionService.start(core, { - taskManager, - }); - } - - public stop() { - this.sessionService.stop(); - } -} - -export { EnhancedDataServerPlugin as Plugin }; diff --git a/x-pack/plugins/data_enhanced/server/routes/index.ts b/x-pack/plugins/data_enhanced/server/routes/index.ts deleted file mode 100644 index 0430d283667d0..0000000000000 --- a/x-pack/plugins/data_enhanced/server/routes/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export * from './session'; diff --git a/x-pack/plugins/data_enhanced/server/search/index.ts b/x-pack/plugins/data_enhanced/server/search/index.ts deleted file mode 100644 index 0430d283667d0..0000000000000 --- a/x-pack/plugins/data_enhanced/server/search/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export * from './session'; diff --git a/x-pack/plugins/data_enhanced/server/search/session/index.ts b/x-pack/plugins/data_enhanced/server/search/session/index.ts deleted file mode 100644 index 1e6841211bb66..0000000000000 --- a/x-pack/plugins/data_enhanced/server/search/session/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export * from './session_service'; diff --git a/x-pack/plugins/data_enhanced/server/search/session/session_service.ts b/x-pack/plugins/data_enhanced/server/search/session/session_service.ts deleted file mode 100644 index a22e559ecd142..0000000000000 --- a/x-pack/plugins/data_enhanced/server/search/session/session_service.ts +++ /dev/null @@ -1,548 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { notFound } from '@hapi/boom'; -import { debounce } from 'lodash'; -import { nodeBuilder, fromKueryExpression } from '@kbn/es-query'; -import { - CoreSetup, - CoreStart, - KibanaRequest, - SavedObjectsClientContract, - Logger, - SavedObject, - SavedObjectsFindOptions, - SavedObjectsErrorHelpers, -} from '@kbn/core/server'; -import { - IKibanaSearchRequest, - ISearchOptions, - ENHANCED_ES_SEARCH_STRATEGY, - SEARCH_SESSION_TYPE, -} from '@kbn/data-plugin/common'; -import { ISearchSessionService, NoSearchIdInSessionError } from '@kbn/data-plugin/server'; -import { AuthenticatedUser, SecurityPluginSetup } from '@kbn/security-plugin/server'; -import { - TaskManagerSetupContract, - TaskManagerStartContract, -} from '@kbn/task-manager-plugin/server'; -import { - SearchSessionRequestInfo, - SearchSessionSavedObjectAttributes, - SearchSessionStatus, -} from '@kbn/data-plugin/common'; -import { createRequestHash } from './utils'; -import { ConfigSchema } from '../../../config'; -import { - registerSearchSessionsTask, - scheduleSearchSessionsTask, - unscheduleSearchSessionsTask, -} from './setup_task'; -import { SearchSessionsConfig, SearchStatus } from './types'; -import { DataEnhancedStartDependencies } from '../../type'; -import { - checkPersistedSessionsProgress, - SEARCH_SESSIONS_TASK_ID, - SEARCH_SESSIONS_TASK_TYPE, -} from './check_persisted_sessions'; -import { - SEARCH_SESSIONS_CLEANUP_TASK_TYPE, - checkNonPersistedSessions, - SEARCH_SESSIONS_CLEANUP_TASK_ID, -} from './check_non_persisted_sessions'; -import { - SEARCH_SESSIONS_EXPIRE_TASK_TYPE, - SEARCH_SESSIONS_EXPIRE_TASK_ID, - checkPersistedCompletedSessionExpiration, -} from './expire_persisted_sessions'; - -export interface SearchSessionDependencies { - savedObjectsClient: SavedObjectsClientContract; -} -interface SetupDependencies { - taskManager: TaskManagerSetupContract; -} - -interface StartDependencies { - taskManager: TaskManagerStartContract; -} - -const DEBOUNCE_UPDATE_OR_CREATE_WAIT = 1000; -const DEBOUNCE_UPDATE_OR_CREATE_MAX_WAIT = 5000; - -interface UpdateOrCreateQueueEntry { - deps: SearchSessionDependencies; - user: AuthenticatedUser | null; - sessionId: string; - attributes: Partial; - resolve: () => void; - reject: (reason?: unknown) => void; -} - -function sleep(ms: number) { - return new Promise((r) => setTimeout(r, ms)); -} -export class SearchSessionService - implements ISearchSessionService -{ - private sessionConfig: SearchSessionsConfig; - private readonly updateOrCreateBatchQueue: UpdateOrCreateQueueEntry[] = []; - - constructor( - private readonly logger: Logger, - private readonly config: ConfigSchema, - private readonly version: string, - private readonly security?: SecurityPluginSetup - ) { - this.sessionConfig = this.config.search.sessions; - } - - public setup(core: CoreSetup, deps: SetupDependencies) { - const taskDeps = { - config: this.config, - taskManager: deps.taskManager, - logger: this.logger, - }; - - registerSearchSessionsTask( - core, - taskDeps, - SEARCH_SESSIONS_TASK_TYPE, - 'persisted session progress', - checkPersistedSessionsProgress - ); - - registerSearchSessionsTask( - core, - taskDeps, - SEARCH_SESSIONS_CLEANUP_TASK_TYPE, - 'non persisted session cleanup', - checkNonPersistedSessions - ); - - registerSearchSessionsTask( - core, - taskDeps, - SEARCH_SESSIONS_EXPIRE_TASK_TYPE, - 'complete session expiration', - checkPersistedCompletedSessionExpiration - ); - } - - public async start(core: CoreStart, deps: StartDependencies) { - return this.setupMonitoring(core, deps); - } - - public stop() {} - - private setupMonitoring = async (core: CoreStart, deps: StartDependencies) => { - const taskDeps = { - config: this.config, - taskManager: deps.taskManager, - logger: this.logger, - }; - - if (this.sessionConfig.enabled) { - scheduleSearchSessionsTask( - taskDeps, - SEARCH_SESSIONS_TASK_ID, - SEARCH_SESSIONS_TASK_TYPE, - this.sessionConfig.trackingInterval - ); - - scheduleSearchSessionsTask( - taskDeps, - SEARCH_SESSIONS_CLEANUP_TASK_ID, - SEARCH_SESSIONS_CLEANUP_TASK_TYPE, - this.sessionConfig.cleanupInterval - ); - - scheduleSearchSessionsTask( - taskDeps, - SEARCH_SESSIONS_EXPIRE_TASK_ID, - SEARCH_SESSIONS_EXPIRE_TASK_TYPE, - this.sessionConfig.expireInterval - ); - } else { - unscheduleSearchSessionsTask(taskDeps, SEARCH_SESSIONS_TASK_ID); - unscheduleSearchSessionsTask(taskDeps, SEARCH_SESSIONS_CLEANUP_TASK_ID); - unscheduleSearchSessionsTask(taskDeps, SEARCH_SESSIONS_EXPIRE_TASK_ID); - } - }; - - private processUpdateOrCreateBatchQueue = debounce( - () => { - const queue = [...this.updateOrCreateBatchQueue]; - if (queue.length === 0) return; - this.updateOrCreateBatchQueue.length = 0; - const batchedSessionAttributes = queue.reduce((res, next) => { - if (!res[next.sessionId]) { - res[next.sessionId] = next.attributes; - } else { - res[next.sessionId] = { - ...res[next.sessionId], - ...next.attributes, - idMapping: { - ...res[next.sessionId].idMapping, - ...next.attributes.idMapping, - }, - }; - } - return res; - }, {} as { [sessionId: string]: Partial }); - - Object.keys(batchedSessionAttributes).forEach((sessionId) => { - const thisSession = queue.filter((s) => s.sessionId === sessionId); - this.updateOrCreate( - thisSession[0].deps, - thisSession[0].user, - sessionId, - batchedSessionAttributes[sessionId] - ) - .then(() => { - thisSession.forEach((s) => s.resolve()); - }) - .catch((e) => { - thisSession.forEach((s) => s.reject(e)); - }); - }); - }, - DEBOUNCE_UPDATE_OR_CREATE_WAIT, - { maxWait: DEBOUNCE_UPDATE_OR_CREATE_MAX_WAIT } - ); - private scheduleUpdateOrCreate = ( - deps: SearchSessionDependencies, - user: AuthenticatedUser | null, - sessionId: string, - attributes: Partial - ): Promise => { - return new Promise((resolve, reject) => { - this.updateOrCreateBatchQueue.push({ deps, user, sessionId, attributes, resolve, reject }); - // TODO: this would be better if we'd debounce per sessionId - this.processUpdateOrCreateBatchQueue(); - }); - }; - - private updateOrCreate = async ( - deps: SearchSessionDependencies, - user: AuthenticatedUser | null, - sessionId: string, - attributes: Partial, - retry: number = 1 - ): Promise | undefined> => { - const retryOnConflict = async (e: any) => { - this.logger.debug(`Conflict error | ${sessionId}`); - // Randomize sleep to spread updates out in case of conflicts - await sleep(100 + Math.random() * 50); - return await this.updateOrCreate(deps, user, sessionId, attributes, retry + 1); - }; - - this.logger.debug(`updateOrCreate | ${sessionId} | ${retry}`); - try { - return (await this.update( - deps, - user, - sessionId, - attributes - )) as SavedObject; - } catch (e) { - if (SavedObjectsErrorHelpers.isNotFoundError(e)) { - try { - this.logger.debug(`Object not found | ${sessionId}`); - return await this.create(deps, user, sessionId, attributes); - } catch (createError) { - if ( - SavedObjectsErrorHelpers.isConflictError(createError) && - retry < this.sessionConfig.maxUpdateRetries - ) { - return await retryOnConflict(createError); - } else { - this.logger.error(createError); - } - } - } else if ( - SavedObjectsErrorHelpers.isConflictError(e) && - retry < this.sessionConfig.maxUpdateRetries - ) { - return await retryOnConflict(e); - } else { - this.logger.error(e); - } - } - - return undefined; - }; - - public save = async ( - deps: SearchSessionDependencies, - user: AuthenticatedUser | null, - sessionId: string, - { - name, - appId, - locatorId, - initialState = {}, - restoreState = {}, - }: Partial - ) => { - if (!this.sessionConfig.enabled) throw new Error('Search sessions are disabled'); - if (!name) throw new Error('Name is required'); - if (!appId) throw new Error('AppId is required'); - if (!locatorId) throw new Error('locatorId is required'); - - return this.updateOrCreate(deps, user, sessionId, { - name, - appId, - locatorId, - initialState, - restoreState, - persisted: true, - }); - }; - - private create = ( - { savedObjectsClient }: SearchSessionDependencies, - user: AuthenticatedUser | null, - sessionId: string, - attributes: Partial - ) => { - this.logger.debug(`create | ${sessionId}`); - - const realmType = user?.authentication_realm.type; - const realmName = user?.authentication_realm.name; - const username = user?.username; - - return savedObjectsClient.create( - SEARCH_SESSION_TYPE, - { - sessionId, - status: SearchSessionStatus.IN_PROGRESS, - expires: new Date( - Date.now() + this.sessionConfig.defaultExpiration.asMilliseconds() - ).toISOString(), - created: new Date().toISOString(), - touched: new Date().toISOString(), - idMapping: {}, - persisted: false, - version: this.version, - realmType, - realmName, - username, - ...attributes, - }, - { id: sessionId } - ); - }; - - public get = async ( - { savedObjectsClient }: SearchSessionDependencies, - user: AuthenticatedUser | null, - sessionId: string - ) => { - this.logger.debug(`get | ${sessionId}`); - const session = await savedObjectsClient.get( - SEARCH_SESSION_TYPE, - sessionId - ); - this.throwOnUserConflict(user, session); - return session; - }; - - public find = ( - { savedObjectsClient }: SearchSessionDependencies, - user: AuthenticatedUser | null, - options: Omit - ) => { - const userFilters = - user === null - ? [] - : [ - nodeBuilder.is( - `${SEARCH_SESSION_TYPE}.attributes.realmType`, - `${user.authentication_realm.type}` - ), - nodeBuilder.is( - `${SEARCH_SESSION_TYPE}.attributes.realmName`, - `${user.authentication_realm.name}` - ), - nodeBuilder.is(`${SEARCH_SESSION_TYPE}.attributes.username`, `${user.username}`), - ]; - const filterKueryNode = - typeof options.filter === 'string' ? fromKueryExpression(options.filter) : options.filter; - const filter = nodeBuilder.and(userFilters.concat(filterKueryNode ?? [])); - return savedObjectsClient.find({ - ...options, - filter, - type: SEARCH_SESSION_TYPE, - }); - }; - - public update = async ( - deps: SearchSessionDependencies, - user: AuthenticatedUser | null, - sessionId: string, - attributes: Partial - ) => { - this.logger.debug(`update | ${sessionId}`); - if (!this.sessionConfig.enabled) throw new Error('Search sessions are disabled'); - await this.get(deps, user, sessionId); // Verify correct user - return deps.savedObjectsClient.update( - SEARCH_SESSION_TYPE, - sessionId, - { - ...attributes, - touched: new Date().toISOString(), - } - ); - }; - - public async extend( - deps: SearchSessionDependencies, - user: AuthenticatedUser | null, - sessionId: string, - expires: Date - ) { - this.logger.debug(`extend | ${sessionId}`); - return this.update(deps, user, sessionId, { expires: expires.toISOString() }); - } - - public cancel = async ( - deps: SearchSessionDependencies, - user: AuthenticatedUser | null, - sessionId: string - ) => { - this.logger.debug(`delete | ${sessionId}`); - return this.update(deps, user, sessionId, { - status: SearchSessionStatus.CANCELLED, - }); - }; - - public delete = async ( - deps: SearchSessionDependencies, - user: AuthenticatedUser | null, - sessionId: string - ) => { - if (!this.sessionConfig.enabled) throw new Error('Search sessions are disabled'); - this.logger.debug(`delete | ${sessionId}`); - await this.get(deps, user, sessionId); // Verify correct user - return deps.savedObjectsClient.delete(SEARCH_SESSION_TYPE, sessionId); - }; - - /** - * Tracks the given search request/search ID in the saved session. - * @internal - */ - public trackId = async ( - deps: SearchSessionDependencies, - user: AuthenticatedUser | null, - searchRequest: IKibanaSearchRequest, - searchId: string, - { sessionId, strategy = ENHANCED_ES_SEARCH_STRATEGY }: ISearchOptions - ) => { - if (!this.sessionConfig.enabled || !sessionId || !searchId) return; - this.logger.debug(`trackId | ${sessionId} | ${searchId}`); - - let idMapping: Record = {}; - - if (searchRequest.params) { - const requestHash = createRequestHash(searchRequest.params); - const searchInfo = { - id: searchId, - strategy, - status: SearchStatus.IN_PROGRESS, - }; - idMapping = { [requestHash]: searchInfo }; - } - - await this.scheduleUpdateOrCreate(deps, user, sessionId, { idMapping }); - }; - - public async getSearchIdMapping( - deps: SearchSessionDependencies, - user: AuthenticatedUser | null, - sessionId: string - ) { - const searchSession = await this.get(deps, user, sessionId); - const searchIdMapping = new Map(); - Object.values(searchSession.attributes.idMapping).forEach((requestInfo) => { - searchIdMapping.set(requestInfo.id, requestInfo.strategy); - }); - return searchIdMapping; - } - - /** - * Look up an existing search ID that matches the given request in the given session so that the - * request can continue rather than restart. - * @internal - */ - public getId = async ( - deps: SearchSessionDependencies, - user: AuthenticatedUser | null, - searchRequest: IKibanaSearchRequest, - { sessionId, isStored, isRestore }: ISearchOptions - ) => { - if (!this.sessionConfig.enabled) { - throw new Error('Search sessions are disabled'); - } else if (!sessionId) { - throw new Error('Session ID is required'); - } else if (!isStored) { - throw new Error('Cannot get search ID from a session that is not stored'); - } else if (!isRestore) { - throw new Error('Get search ID is only supported when restoring a session'); - } - - const session = await this.get(deps, user, sessionId); - const requestHash = createRequestHash(searchRequest.params); - if (!session.attributes.idMapping.hasOwnProperty(requestHash)) { - this.logger.error(`getId | ${sessionId} | ${requestHash} not found`); - throw new NoSearchIdInSessionError(); - } - this.logger.debug(`getId | ${sessionId} | ${requestHash}`); - - return session.attributes.idMapping[requestHash].id; - }; - - public asScopedProvider = ({ savedObjects }: CoreStart) => { - return (request: KibanaRequest) => { - const user = this.security?.authc.getCurrentUser(request) ?? null; - const savedObjectsClient = savedObjects.getScopedClient(request, { - includedHiddenTypes: [SEARCH_SESSION_TYPE], - }); - const deps = { savedObjectsClient }; - return { - getId: this.getId.bind(this, deps, user), - trackId: this.trackId.bind(this, deps, user), - getSearchIdMapping: this.getSearchIdMapping.bind(this, deps, user), - save: this.save.bind(this, deps, user), - get: this.get.bind(this, deps, user), - find: this.find.bind(this, deps, user), - update: this.update.bind(this, deps, user), - extend: this.extend.bind(this, deps, user), - cancel: this.cancel.bind(this, deps, user), - delete: this.delete.bind(this, deps, user), - getConfig: () => this.config.search.sessions, - }; - }; - }; - - private throwOnUserConflict = ( - user: AuthenticatedUser | null, - session?: SavedObject - ) => { - if (user === null || !session) return; - if ( - user.authentication_realm.type !== session.attributes.realmType || - user.authentication_realm.name !== session.attributes.realmName || - user.username !== session.attributes.username - ) { - this.logger.debug( - `User ${user.username} has no access to search session ${session.attributes.sessionId}` - ); - throw notFound(); - } - }; -} diff --git a/x-pack/plugins/data_enhanced/server/search/session/types.ts b/x-pack/plugins/data_enhanced/server/search/session/types.ts deleted file mode 100644 index 37e1cb2486154..0000000000000 --- a/x-pack/plugins/data_enhanced/server/search/session/types.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { - ElasticsearchClient, - Logger, - SavedObjectsClientContract, - SavedObjectsFindResponse, -} from '@kbn/core/server'; -import { Observable } from 'rxjs'; -import { KueryNode, SearchSessionSavedObjectAttributes } from '@kbn/data-plugin/common'; -import { - TaskManagerSetupContract, - TaskManagerStartContract, -} from '@kbn/task-manager-plugin/server'; -import { ConfigSchema } from '../../../config'; - -export enum SearchStatus { - IN_PROGRESS = 'in_progress', - ERROR = 'error', - COMPLETE = 'complete', -} - -export type SearchSessionsConfig = ConfigSchema['search']['sessions']; - -export interface CheckSearchSessionsDeps { - savedObjectsClient: SavedObjectsClientContract; - client: ElasticsearchClient; - logger: Logger; -} - -export interface SearchSessionTaskSetupDeps { - taskManager: TaskManagerSetupContract; - logger: Logger; - config: ConfigSchema; -} - -export interface SearchSessionTaskStartDeps { - taskManager: TaskManagerStartContract; - logger: Logger; - config: ConfigSchema; -} - -export type SearchSessionTaskFn = ( - deps: CheckSearchSessionsDeps, - config: SearchSessionsConfig -) => Observable; - -export type SearchSessionsResponse = SavedObjectsFindResponse< - SearchSessionSavedObjectAttributes, - unknown ->; - -export type CheckSearchSessionsFn = ( - deps: CheckSearchSessionsDeps, - config: SearchSessionsConfig, - filter: KueryNode, - page: number -) => Observable; diff --git a/x-pack/plugins/data_enhanced/server/type.ts b/x-pack/plugins/data_enhanced/server/type.ts deleted file mode 100644 index df465cdbb381d..0000000000000 --- a/x-pack/plugins/data_enhanced/server/type.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { IRouter } from '@kbn/core/server'; -import type { DataRequestHandlerContext } from '@kbn/data-plugin/server'; -import { - TaskManagerSetupContract, - TaskManagerStartContract, -} from '@kbn/task-manager-plugin/server'; -import { - PluginSetup as DataPluginSetup, - PluginStart as DataPluginStart, -} from '@kbn/data-plugin/server'; -import { SecurityPluginSetup } from '@kbn/security-plugin/server'; -import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; - -/** - * @internal - */ -export type DataEnhancedRequestHandlerContext = DataRequestHandlerContext; - -/** - * @internal - */ -export type DataEnhancedPluginRouter = IRouter; - -export interface DataEnhancedSetupDependencies { - data: DataPluginSetup; - usageCollection?: UsageCollectionSetup; - taskManager: TaskManagerSetupContract; - security?: SecurityPluginSetup; -} - -export interface DataEnhancedStartDependencies { - data: DataPluginStart; - taskManager: TaskManagerStartContract; -} diff --git a/x-pack/plugins/data_enhanced/tsconfig.json b/x-pack/plugins/data_enhanced/tsconfig.json deleted file mode 100644 index 5627951c3d9eb..0000000000000 --- a/x-pack/plugins/data_enhanced/tsconfig.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true, - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - "config.ts", - "../../../typings/**/*", - "common/search/test_data/*.json" - ], - "references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/bfetch/tsconfig.json" }, - { "path": "../../../src/plugins/data/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, - { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, - { "path": "../../../src/plugins/management/tsconfig.json" }, - { "path": "../../../src/plugins/screenshot_mode/tsconfig.json"}, - { "path": "../security/tsconfig.json" }, - { "path": "../task_manager/tsconfig.json" }, - - { "path": "../features/tsconfig.json" }, - ] -} diff --git a/x-pack/plugins/infra/kibana.json b/x-pack/plugins/infra/kibana.json index 2eec94187900f..d9d432fc702e4 100644 --- a/x-pack/plugins/infra/kibana.json +++ b/x-pack/plugins/infra/kibana.json @@ -9,7 +9,6 @@ "spaces", "embeddable", "data", - "dataEnhanced", "dataViews", "visTypeTimeseries", "alerting", diff --git a/x-pack/plugins/infra/public/types.ts b/x-pack/plugins/infra/public/types.ts index ab7df75592712..b5147f343ea5b 100644 --- a/x-pack/plugins/infra/public/types.ts +++ b/x-pack/plugins/infra/public/types.ts @@ -20,7 +20,6 @@ import type { TriggersAndActionsUIPublicPluginSetup, TriggersAndActionsUIPublicPluginStart, } from '@kbn/triggers-actions-ui-plugin/public'; -import type { DataEnhancedSetup, DataEnhancedStart } from '@kbn/data-enhanced-plugin/public'; import { MlPluginSetup, MlPluginStart } from '@kbn/ml-plugin/public'; import type { ObservabilityPublicSetup, @@ -52,7 +51,6 @@ export interface InfraClientStartExports { } export interface InfraClientSetupDeps { - dataEnhanced: DataEnhancedSetup; home?: HomePublicPluginSetup; observability: ObservabilityPublicSetup; triggersActionsUi: TriggersAndActionsUIPublicPluginSetup; @@ -64,7 +62,6 @@ export interface InfraClientSetupDeps { export interface InfraClientStartDeps { data: DataPublicPluginStart; - dataEnhanced: DataEnhancedStart; dataViews: DataViewsPublicPluginStart; observability: ObservabilityPublicStart; spaces: SpacesPluginStart; diff --git a/x-pack/plugins/infra/tsconfig.json b/x-pack/plugins/infra/tsconfig.json index b508b8fb6da80..370644367b441 100644 --- a/x-pack/plugins/infra/tsconfig.json +++ b/x-pack/plugins/infra/tsconfig.json @@ -24,7 +24,6 @@ { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, { "path": "../../../src/plugins/vis_types/timeseries/tsconfig.json" }, - { "path": "../data_enhanced/tsconfig.json" }, { "path": "../alerting/tsconfig.json" }, { "path": "../features/tsconfig.json" }, { "path": "../license_management/tsconfig.json" }, diff --git a/x-pack/plugins/osquery/kibana.json b/x-pack/plugins/osquery/kibana.json index 619bcbeed14f4..1ea8468529b85 100644 --- a/x-pack/plugins/osquery/kibana.json +++ b/x-pack/plugins/osquery/kibana.json @@ -12,7 +12,6 @@ "requiredPlugins": [ "actions", "data", - "dataEnhanced", "discover", "features", "navigation", diff --git a/x-pack/plugins/osquery/tsconfig.json b/x-pack/plugins/osquery/tsconfig.json index 5c70e5ffbb944..4eac1baa43d79 100644 --- a/x-pack/plugins/osquery/tsconfig.json +++ b/x-pack/plugins/osquery/tsconfig.json @@ -24,7 +24,6 @@ // requiredPlugins from ./kibana.json { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/navigation/tsconfig.json" }, - { "path": "../data_enhanced/tsconfig.json" }, { "path": "../fleet/tsconfig.json" }, // optionalPlugins from ./kibana.json diff --git a/x-pack/plugins/runtime_fields/public/types.ts b/x-pack/plugins/runtime_fields/public/types.ts index 3cd8506c01b10..b39e5e2ee5e6d 100644 --- a/x-pack/plugins/runtime_fields/public/types.ts +++ b/x-pack/plugins/runtime_fields/public/types.ts @@ -5,8 +5,6 @@ * 2.0. */ -import { DataPublicPluginStart } from '@kbn/data-plugin/public'; - import { RUNTIME_FIELD_TYPES } from './constants'; import { OpenRuntimeFieldEditorProps } from './load_editor'; @@ -24,9 +22,8 @@ export interface PluginStart {} // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface SetupPlugins {} -export interface StartPlugins { - data: DataPublicPluginStart; -} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface StartPlugins {} export type RuntimeType = typeof RUNTIME_FIELD_TYPES[number]; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx index ae64ad4655ba5..72612904f1c08 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.test.tsx @@ -11,7 +11,7 @@ import React from 'react'; import type { Capabilities } from '@kbn/core/public'; import { coreMock, scopedHistoryMock } from '@kbn/core/public/mocks'; -import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; +import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { KibanaFeature } from '@kbn/features-plugin/public'; import type { Space } from '@kbn/spaces-plugin/public'; import { mountWithIntl, nextTick } from '@kbn/test-jest-helpers'; @@ -139,7 +139,7 @@ function getProps({ const rolesAPIClient = rolesAPIClientMock.create(); rolesAPIClient.getRole.mockResolvedValue(role); - const dataViews = dataPluginMock.createStartContract().dataViews; + const dataViews = dataViewPluginMocks.createStartContract(); // `undefined` titles can technically happen via import/export or other manual manipulation dataViews.getTitles = jest.fn().mockResolvedValue(['foo*', 'bar*', undefined]); @@ -352,7 +352,7 @@ describe('', () => { }); it('can render if index patterns are not available', async () => { - const dataViews = dataPluginMock.createStartContract().dataViews; + const dataViews = dataViewPluginMocks.createStartContract(); dataViews.getTitles = jest.fn().mockRejectedValue({ response: { status: 403 } }); const wrapper = mountWithIntl( diff --git a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx index 1cda335ace204..cc9803063b860 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx @@ -31,7 +31,7 @@ import type { NotificationsStart, ScopedHistory, } from '@kbn/core/public'; -import type { DataViewsContract } from '@kbn/data-plugin/public'; +import type { DataViewsContract } from '@kbn/data-views-plugin/public'; import type { KibanaFeature } from '@kbn/features-plugin/common'; import type { FeaturesPluginStart } from '@kbn/features-plugin/public'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/security_solution/kibana.json b/x-pack/plugins/security_solution/kibana.json index af0bd12303119..0c72f5af846d7 100644 --- a/x-pack/plugins/security_solution/kibana.json +++ b/x-pack/plugins/security_solution/kibana.json @@ -13,7 +13,6 @@ "alerting", "cases", "data", - "dataEnhanced", "embeddable", "eventLog", "features", diff --git a/x-pack/plugins/security_solution/public/common/hooks/eql/use_eql_preview.ts b/x-pack/plugins/security_solution/public/common/hooks/eql/use_eql_preview.ts index 4addd9048a565..20a9ccbefa900 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/eql/use_eql_preview.ts +++ b/x-pack/plugins/security_solution/public/common/hooks/eql/use_eql_preview.ts @@ -17,9 +17,9 @@ import { isPartialResponse, EqlSearchStrategyRequest, EqlSearchStrategyResponse, + EQL_SEARCH_STRATEGY, } from '@kbn/data-plugin/common'; import { AbortError } from '@kbn/kibana-utils-plugin/common'; -import { EQL_SEARCH_STRATEGY } from '@kbn/data-enhanced-plugin/public'; import * as i18n from '../translations'; import { useKibana } from '../../lib/kibana'; import { formatInspect, getEqlAggsData } from './helpers'; diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index 95aaeffad7f71..cc1656ace3c65 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -32,7 +32,6 @@ { "path": "../actions/tsconfig.json" }, { "path": "../alerting/tsconfig.json" }, { "path": "../cases/tsconfig.json" }, - { "path": "../data_enhanced/tsconfig.json" }, { "path": "../encrypted_saved_objects/tsconfig.json" }, { "path": "../features/tsconfig.json" }, { "path": "../fleet/tsconfig.json" }, diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json index 0ac826d27ea7b..a361c5fef7a40 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -4557,19 +4557,6 @@ } } }, - "search-session": { - "properties": { - "transientCount": { - "type": "long" - }, - "persistedCount": { - "type": "long" - }, - "totalCount": { - "type": "long" - } - } - }, "discoverEnhanced": { "properties": { "exploreDataInChartActionEnabled": { diff --git a/x-pack/plugins/timelines/kibana.json b/x-pack/plugins/timelines/kibana.json index 11adf42b3a6b4..77a5dcc699bdc 100644 --- a/x-pack/plugins/timelines/kibana.json +++ b/x-pack/plugins/timelines/kibana.json @@ -10,6 +10,6 @@ "extraPublicDirs": ["common"], "server": true, "ui": true, - "requiredPlugins": ["alerting", "cases", "data", "dataEnhanced", "kibanaReact", "kibanaUtils"], + "requiredPlugins": ["alerting", "cases", "data", "kibanaReact", "kibanaUtils"], "optionalPlugins": ["security"] } diff --git a/x-pack/plugins/timelines/tsconfig.json b/x-pack/plugins/timelines/tsconfig.json index 9677c0e64dd88..3063c1acda545 100644 --- a/x-pack/plugins/timelines/tsconfig.json +++ b/x-pack/plugins/timelines/tsconfig.json @@ -20,7 +20,6 @@ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/home/tsconfig.json" }, - { "path": "../data_enhanced/tsconfig.json" }, { "path": "../features/tsconfig.json" }, { "path": "../cases/tsconfig.json" }, { "path": "../licensing/tsconfig.json" }, diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 84fee5016b778..8179a03244e50 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -2621,6 +2621,107 @@ "data.searchSessions.sessionService.sessionObjectFetchError": "Échec de récupération des informations de la session de recherche", "data.triggers.applyFilterDescription": "Lorsque le filtre Kibana est appliqué. Peut être un filtre simple ou un filtre de plage.", "data.triggers.applyFilterTitle": "Appliquer le filtre", + "data.mgmt.searchSessions.actionDelete": "Supprimer", + "data.mgmt.searchSessions.actionExtend": "Étendre", + "data.mgmt.searchSessions.actionRename": "Modifier le nom", + "data.mgmt.searchSessions.actions.tooltip.moreActions": "Plus d'actions", + "data.mgmt.searchSessions.api.deleted": "La session de recherche a été supprimée.", + "data.mgmt.searchSessions.api.deletedError": "Impossible de supprimer la session de recherche !", + "data.mgmt.searchSessions.api.extended": "La session de recherche a été étendue.", + "data.mgmt.searchSessions.api.extendError": "Impossible d'étendre la session de recherche !", + "data.mgmt.searchSessions.api.fetchError": "Impossible d'actualiser la page !", + "data.mgmt.searchSessions.api.fetchTimeout": "La récupération des informations de la session de recherche a expiré après {timeout} secondes", + "data.mgmt.searchSessions.api.rename": "La session de recherche a été renommée", + "data.mgmt.searchSessions.api.renameError": "Impossible de renommer la session de recherche", + "data.mgmt.searchSessions.appTitle": "Sessions de recherche", + "data.mgmt.searchSessions.ariaLabel.moreActions": "Plus d'actions", + "data.mgmt.searchSessions.cancelModal.cancelButton": "Annuler", + "data.mgmt.searchSessions.cancelModal.deleteButton": "Supprimer", + "data.mgmt.searchSessions.cancelModal.message": "La suppression de la session de recherche \"{name}\" supprime tous les résultats mis en cache.", + "data.mgmt.searchSessions.cancelModal.title": "Supprimer la session de recherche", + "data.mgmt.searchSessions.extendModal.dontExtendButton": "Annuler", + "data.mgmt.searchSessions.extendModal.extendButton": "Étendre l'expiration", + "data.mgmt.searchSessions.extendModal.extendMessage": "L'expiration de la session de recherche \"{name}\" sera étendue jusqu'à {newExpires}.", + "data.mgmt.searchSessions.extendModal.title": "Étendre l'expiration de la session de recherche", + "data.mgmt.searchSessions.flyoutTitle": "Inspecter", + "data.mgmt.searchSessions.main.backgroundSessionsDocsLinkText": "Documentation", + "data.mgmt.searchSessions.main.sectionDescription": "Gérez vos sessions de recherche enregistrées.", + "data.mgmt.searchSessions.main.sectionTitle": "Sessions de recherche", + "data.mgmt.searchSessions.renameModal.cancelButton": "Annuler", + "data.mgmt.searchSessions.renameModal.renameButton": "Enregistrer", + "data.mgmt.searchSessions.renameModal.searchSessionNameInputLabel": "Nom de la session de recherche", + "data.mgmt.searchSessions.renameModal.title": "Modifier le nom de la session de recherche", + "data.mgmt.searchSessions.search.filterApp": "Application", + "data.mgmt.searchSessions.search.filterStatus": "Statut", + "data.mgmt.searchSessions.search.tools.refresh": "Actualiser", + "data.mgmt.searchSessions.status.expireDateUnknown": "inconnu", + "data.mgmt.searchSessions.status.expiresOn": "Expire le {expireDate}", + "data.mgmt.searchSessions.status.expiresSoonInDays": "Expire dans {numDays} jours", + "data.mgmt.searchSessions.status.expiresSoonInDaysTooltip": "{numDays} jours", + "data.mgmt.searchSessions.status.expiresSoonInHours": "Cette session expire dans {numHours} heures", + "data.mgmt.searchSessions.status.expiresSoonInHoursTooltip": "{numHours} heures", + "data.mgmt.searchSessions.status.label.cancelled": "Annulé", + "data.mgmt.searchSessions.status.label.complete": "Terminé", + "data.mgmt.searchSessions.status.label.error": "Erreur", + "data.mgmt.searchSessions.status.label.expired": "Expiré", + "data.mgmt.searchSessions.status.label.inProgress": "En cours", + "data.mgmt.searchSessions.status.message.cancelled": "Annulé par l'utilisateur", + "data.mgmt.searchSessions.status.message.createdOn": "Expire le {expireDate}", + "data.mgmt.searchSessions.status.message.error": "Erreur : {error}", + "data.mgmt.searchSessions.status.message.expiredOn": "Expiré le {expireDate}", + "data.mgmt.searchSessions.table.headerExpiration": "Expiration", + "data.mgmt.searchSessions.table.headerName": "Nom", + "data.mgmt.searchSessions.table.headerStarted": "Créé", + "data.mgmt.searchSessions.table.headerStatus": "Statut", + "data.mgmt.searchSessions.table.headerType": "Application", + "data.mgmt.searchSessions.table.notRestorableWarning": "La session de recherche va être de nouveau exécutée. Vous pouvez ensuite l'enregistrer pour une utilisation ultérieure.", + "data.mgmt.searchSessions.table.numSearches": "# recherches", + "data.mgmt.searchSessions.table.versionIncompatibleWarning": "Cette session de recherche a été créée dans une instance Kibana exécutant une version différente. Il se peut qu'elle ne soit pas correctement restaurée.", + "data.mgmt.searchSessions.table.mlAppName": "Machine Learning", + "data.search.statusError": "Recherche terminée avec un statut {errorCode}", + "data.search.statusThrow": "Le statut de la recherche a généré un statut d'erreur {message} ({errorCode})", + "data.searchSessionIndicator.cancelButtonText": "Arrêter la session", + "data.searchSessionIndicator.canceledDescriptionText": "Vous visualisez des données incomplètes", + "data.searchSessionIndicator.canceledIconAriaLabel": "La session de recherche s'est arrêtée", + "data.searchSessionIndicator.canceledTitleText": "La session de recherche s'est arrêtée", + "data.searchSessionIndicator.canceledTooltipText": "La session de recherche s'est arrêtée", + "data.searchSessionIndicator.canceledWhenText": "Arrêtée {when}", + "data.searchSessionIndicator.continueInBackgroundButtonText": "Enregistrer la session", + "data.searchSessionIndicator.disabledDueToDisabledGloballyMessage": "Vous ne disposez pas d'autorisations pour gérer les sessions de recherche", + "data.searchSessionIndicator.disabledDueToTimeoutMessage": "Les résultats de la session de recherche ont expiré.", + "data.searchSessionIndicator.loadingInTheBackgroundDescriptionText": "Vous pouvez retourner aux résultats terminés à partir de la page Gestion", + "data.searchSessionIndicator.loadingInTheBackgroundIconAriaLabel": "Session enregistrée en cours", + "data.searchSessionIndicator.loadingInTheBackgroundIconTooltipText": "Session enregistrée en cours", + "data.searchSessionIndicator.loadingInTheBackgroundTitleText": "Session enregistrée en cours", + "data.searchSessionIndicator.loadingInTheBackgroundWhenText": "Débuté {when}", + "data.searchSessionIndicator.loadingResultsDescription": "Enregistrer votre session, poursuivre votre travail et retourner aux résultats terminés", + "data.searchSessionIndicator.loadingResultsIconAriaLabel": "Chargement de la session de recherche", + "data.searchSessionIndicator.loadingResultsIconTooltipText": "Chargement de la session de recherche", + "data.searchSessionIndicator.loadingResultsTitle": "Votre recherche prend un certain temps…", + "data.searchSessionIndicator.loadingResultsWhenText": "Débuté {when}", + "data.searchSessionIndicator.restoredDescriptionText": "Vous affichez des données mises en cache d'une plage temporelle spécifique. La modification de la plage temporelle ou des filtres entraînera la réexécution de la session", + "data.searchSessionIndicator.restoredResultsIconAriaLabel": "Session enregistrée restaurée", + "data.searchSessionIndicator.restoredResultsTooltipText": "Session de recherche restaurée", + "data.searchSessionIndicator.restoredTitleText": "Session de recherche restaurée", + "data.searchSessionIndicator.restoredWhenText": "Terminé {when}", + "data.searchSessionIndicator.resultLoadedInTheBackgroundDescriptionText": "Vous pouvez retourner à ces résultats à partir de la page de gestion", + "data.searchSessionIndicator.resultLoadedInTheBackgroundIconAriaLabel": "Session enregistrée terminée", + "data.searchSessionIndicator.resultLoadedInTheBackgroundIconTooltipText": "Session enregistrée terminée", + "data.searchSessionIndicator.resultLoadedInTheBackgroundTitleText": "Session de recherche enregistrée", + "data.searchSessionIndicator.resultLoadedInTheBackgroundWhenText": "Terminé {when}", + "data.searchSessionIndicator.resultsLoadedDescriptionText": "Enregistrer votre session pour y revenir ultérieurement", + "data.searchSessionIndicator.resultsLoadedIconAriaLabel": "Session de recherche terminée", + "data.searchSessionIndicator.resultsLoadedIconTooltipText": "Session de recherche terminée", + "data.searchSessionIndicator.resultsLoadedText": "Session de recherche terminée", + "data.searchSessionIndicator.resultsLoadedWhenText": "Terminé {when}", + "data.searchSessionIndicator.saveButtonText": "Enregistrer la session", + "data.searchSessionIndicator.viewSearchSessionsLinkText": "Gérer les sessions", + "data.searchSessionName.ariaLabelText": "Nom de la session de recherche", + "data.searchSessionName.editAriaLabelText": "Modifier le nom de la session de recherche", + "data.searchSessionName.placeholderText": "Entrer un nom pour la session de recherche", + "data.searchSessionName.saveButtonText": "Enregistrer", + "data.sessions.management.flyoutText": "Configuration de cette session de recherche", + "data.sessions.management.flyoutTitle": "Inspecter la session de recherche", "dataViews.deprecations.scriptedFields.manualStepOneMessage": "Accédez à Gestion de la Suite > Kibana > Vues de données.", "dataViews.deprecations.scriptedFields.manualStepTwoMessage": "Mettez à jour les vues de données {numberOfIndexPatternsWithScriptedFields} qui ont des champs scriptés pour qu’elles utilisent des champs d’exécution. Dans la plupart des cas, pour migrer des scripts existants, vous devrez remplacer \"return ;\" par \"emit();\". Vues de données avec au moins un champ scripté : {allTitles}", "dataViews.deprecations.scriptedFieldsMessage": "Vous avez {numberOfIndexPatternsWithScriptedFields} vues de données ({titlesPreview}...) qui utilisent des champs scriptés. Les champs scriptés sont déclassés et seront supprimés à l’avenir. Utilisez plutôt des champs d’exécution.", @@ -2633,6 +2734,121 @@ "dataViews.unableWriteLabel": "Impossible d’écrire la vue de données ! Actualisez la page pour obtenir la dernière version de cette vue de données.", "devTools.badge.betaLabel": "Bêta", "devTools.badge.betaTooltipText": "Cette fonctionnalité pourra considérablement changer dans les futures versions", + "unifiedSearch.search.unableToGetSavedQueryToastTitle": "Impossible de charger la requête enregistrée {savedQueryId}", + "unifiedSearch.noDataPopover.content": "Cette plage temporelle ne contient pas de données. Étendez ou ajustez la plage temporelle pour obtenir plus de champs et pouvoir créer des graphiques.", + "unifiedSearch.noDataPopover.dismissAction": "Ne plus afficher", + "unifiedSearch.noDataPopover.subtitle": "Conseil", + "unifiedSearch.noDataPopover.title": "Ensemble de données vide", + "unifiedSearch.query.queryBar.clearInputLabel": "Effacer l'entrée", + "unifiedSearch.query.queryBar.comboboxAriaLabel": "Rechercher et filtrer la page {pageType}", + "unifiedSearch.query.queryBar.kqlFullLanguageName": "Langage de requête Kibana", + "unifiedSearch.query.queryBar.kqlLanguageName": "KQL", + "unifiedSearch.query.queryBar.KQLNestedQuerySyntaxInfoDocLinkText": "documents", + "unifiedSearch.query.queryBar.KQLNestedQuerySyntaxInfoOptOutText": "Ne plus afficher", + "unifiedSearch.query.queryBar.KQLNestedQuerySyntaxInfoText": "Il semblerait que votre requête porte sur un champ imbriqué. Selon le résultat visé, il existe plusieurs façons de construire une syntaxe KQL pour des requêtes imbriquées. Apprenez-en plus avec notre {link}.", + "unifiedSearch.query.queryBar.KQLNestedQuerySyntaxInfoTitle": "Syntaxe de requête imbriquée KQL", + "unifiedSearch.query.queryBar.kqlOffLabel": "Désactivé", + "unifiedSearch.query.queryBar.kqlOnLabel": "Activé", + "unifiedSearch.query.queryBar.languageSwitcher.toText": "Passer au langage de requête Kibana pour la recherche", + "unifiedSearch.query.queryBar.luceneLanguageName": "Lucene", + "unifiedSearch.query.queryBar.searchInputAriaLabel": "Commencer à taper pour rechercher et filtrer la page {pageType}", + "unifiedSearch.query.queryBar.searchInputPlaceholder": "Recherche", + "unifiedSearch.query.queryBar.syntaxOptionsDescription": "{docsLink} (KQL) offre une syntaxe de requête simplifiée et la prise en charge des champs scriptés. KQL offre également une fonctionnalité de saisie semi-automatique. Si vous désactivez KQL, {nonKqlModeHelpText}.", + "unifiedSearch.query.queryBar.syntaxOptionsDescription.nonKqlModeHelpText": "Kibana utilise Lucene.", + "unifiedSearch.search.searchBar.savedQueryDescriptionLabelText": "Description", + "unifiedSearch.search.searchBar.savedQueryDescriptionText": "Enregistrez le texte et les filtres de la requête que vous souhaitez réutiliser.", + "unifiedSearch.search.searchBar.savedQueryForm.titleConflictText": "Ce nom est en conflit avec une requête enregistrée existante.", + "unifiedSearch.search.searchBar.savedQueryFormCancelButtonText": "Annuler", + "unifiedSearch.search.searchBar.savedQueryFormSaveButtonText": "Enregistrer", + "unifiedSearch.search.searchBar.savedQueryFormTitle": "Enregistrer la requête", + "unifiedSearch.search.searchBar.savedQueryIncludeFiltersLabelText": "Inclure les filtres", + "unifiedSearch.search.searchBar.savedQueryIncludeTimeFilterLabelText": "Inclure le filtre temporel", + "unifiedSearch.search.searchBar.savedQueryNameHelpText": "Un nom est requis. Le nom ne peut pas contenir d'espace vide au début ou à la fin. Le nom doit être unique.", + "unifiedSearch.search.searchBar.savedQueryNameLabelText": "Nom", + "unifiedSearch.search.searchBar.savedQueryNoSavedQueriesText": "Aucune requête enregistrée.", + "unifiedSearch.search.searchBar.savedQueryPopoverButtonText": "Voir les requêtes enregistrées", + "unifiedSearch.search.searchBar.savedQueryPopoverClearButtonAriaLabel": "Effacer la requête enregistrée en cours", + "unifiedSearch.search.searchBar.savedQueryPopoverClearButtonText": "Effacer", + "unifiedSearch.search.searchBar.savedQueryPopoverConfirmDeletionCancelButtonText": "Annuler", + "unifiedSearch.search.searchBar.savedQueryPopoverConfirmDeletionConfirmButtonText": "Supprimer", + "unifiedSearch.search.searchBar.savedQueryPopoverConfirmDeletionTitle": "Supprimer \"{savedQueryName}\" ?", + "unifiedSearch.search.searchBar.savedQueryPopoverDeleteButtonAriaLabel": "Supprimer la requête enregistrée {savedQueryName}", + "unifiedSearch.search.searchBar.savedQueryPopoverSaveAsNewButtonAriaLabel": "Enregistrer en tant que nouvelle requête enregistrée", + "unifiedSearch.search.searchBar.savedQueryPopoverSaveAsNewButtonText": "Enregistrer en tant que nouvelle", + "unifiedSearch.search.searchBar.savedQueryPopoverSaveButtonAriaLabel": "Enregistrer une nouvelle requête enregistrée", + "unifiedSearch.search.searchBar.savedQueryPopoverSaveButtonText": "Enregistrer la requête en cours", + "unifiedSearch.search.searchBar.savedQueryPopoverSaveChangesButtonAriaLabel": "Enregistrer les modifications apportées à {title}", + "unifiedSearch.search.searchBar.savedQueryPopoverSaveChangesButtonText": "Enregistrer les modifications", + "unifiedSearch.search.searchBar.savedQueryPopoverSavedQueryListItemButtonAriaLabel": "Bouton de requête enregistrée {savedQueryName}", + "unifiedSearch.search.searchBar.savedQueryPopoverSavedQueryListItemDescriptionAriaLabel": "Description de {savedQueryName}", + "unifiedSearch.search.searchBar.savedQueryPopoverSavedQueryListItemSelectedButtonAriaLabel": "Bouton de requête enregistrée {savedQueryName} sélectionné. Appuyez pour effacer les modifications.", + "unifiedSearch.search.searchBar.savedQueryPopoverTitleText": "Requêtes enregistrées", + "unifiedSearch.query.queryBar.syntaxOptionsTitle": "Options de syntaxe", + "unifiedSearch.filter.applyFilterActionTitle": "Appliquer le filtre à la vue en cours", + "unifiedSearch.filter.applyFilters.popupHeader": "Sélectionner les filtres à appliquer", + "unifiedSearch.filter.applyFiltersPopup.cancelButtonLabel": "Annuler", + "unifiedSearch.filter.applyFiltersPopup.saveButtonLabel": "Appliquer", + "unifiedSearch.filter.filterBar.addFilterButtonLabel": "Ajouter un filtre", + "unifiedSearch.filter.filterBar.deleteFilterButtonLabel": "Supprimer", + "unifiedSearch.filter.filterBar.disabledFilterPrefix": "Désactivé", + "unifiedSearch.filter.filterBar.disableFilterButtonLabel": "Désactiver temporairement", + "unifiedSearch.filter.filterBar.editFilterButtonLabel": "Modifier le filtre", + "unifiedSearch.filter.filterBar.enableFilterButtonLabel": "Réactiver", + "unifiedSearch.filter.filterBar.excludeFilterButtonLabel": "Exclure les résultats", + "unifiedSearch.filter.filterBar.filterItemBadgeAriaLabel": "Actions de filtrage", + "unifiedSearch.filter.filterBar.filterItemBadgeIconAriaLabel": "Supprimer {filter}", + "unifiedSearch.filter.filterBar.includeFilterButtonLabel": "Inclure les résultats", + "unifiedSearch.filter.filterBar.indexPatternSelectPlaceholder": "Sélectionner un modèle d'indexation", + "unifiedSearch.filter.filterBar.labelErrorInfo": "Modèle d'indexation {indexPattern} introuvable", + "unifiedSearch.filter.filterBar.labelErrorText": "Erreur", + "unifiedSearch.filter.filterBar.labelWarningInfo": "Le champ {fieldName} n'existe pas dans la vue en cours.", + "unifiedSearch.filter.filterBar.labelWarningText": "Avertissement", + "unifiedSearch.filter.filterBar.moreFilterActionsMessage": "Filtre : {innerText}. Sélectionner pour plus d’actions de filtrage.", + "unifiedSearch.filter.filterBar.negatedFilterPrefix": "NON ", + "unifiedSearch.filter.filterBar.pinFilterButtonLabel": "Épingler dans toutes les applications", + "unifiedSearch.filter.filterBar.pinnedFilterPrefix": "Épinglé", + "unifiedSearch.filter.filterBar.unpinFilterButtonLabel": "Désépingler", + "unifiedSearch.filter.filterEditor.cancelButtonLabel": "Annuler", + "unifiedSearch.filter.filterEditor.createCustomLabelInputLabel": "Étiquette personnalisée", + "unifiedSearch.filter.filterEditor.createCustomLabelSwitchLabel": "Créer une étiquette personnalisée ?", + "unifiedSearch.filter.filterEditor.doesNotExistOperatorOptionLabel": "n'existe pas", + "unifiedSearch.filter.filterEditor.editFilterPopupTitle": "Modifier le filtre", + "unifiedSearch.filter.filterEditor.editFilterValuesButtonLabel": "Modifier les valeurs du filtre", + "unifiedSearch.filter.filterEditor.editQueryDslButtonLabel": "Modifier en tant que Query DSL", + "unifiedSearch.filter.filterEditor.existsOperatorOptionLabel": "existe", + "unifiedSearch.filter.filterEditor.falseOptionLabel": "false", + "unifiedSearch.filter.filterEditor.fieldSelectLabel": "Champ", + "unifiedSearch.filter.filterEditor.fieldSelectPlaceholder": "Sélectionner d'abord un champ", + "unifiedSearch.filter.filterEditor.indexPatternSelectLabel": "Modèle d'indexation", + "unifiedSearch.filter.filterEditor.isBetweenOperatorOptionLabel": "est entre", + "unifiedSearch.filter.filterEditor.isNotBetweenOperatorOptionLabel": "n'est pas entre", + "unifiedSearch.filter.filterEditor.isNotOneOfOperatorOptionLabel": "n'est pas l'une des options suivantes", + "unifiedSearch.filter.filterEditor.isNotOperatorOptionLabel": "n'est pas", + "unifiedSearch.filter.filterEditor.isOneOfOperatorOptionLabel": "est l'une des options suivantes", + "unifiedSearch.filter.filterEditor.isOperatorOptionLabel": "est", + "unifiedSearch.filter.filterEditor.operatorSelectLabel": "Opérateur", + "unifiedSearch.filter.filterEditor.operatorSelectPlaceholderSelect": "Sélectionner", + "unifiedSearch.filter.filterEditor.operatorSelectPlaceholderWaiting": "En attente", + "unifiedSearch.filter.filterEditor.queryDslLabel": "Query DSL d'Elasticsearch", + "unifiedSearch.filter.filterEditor.rangeEndInputPlaceholder": "Fin de la plage", + "unifiedSearch.filter.filterEditor.rangeInputLabel": "Plage", + "unifiedSearch.filter.filterEditor.rangeStartInputPlaceholder": "Début de la plage", + "unifiedSearch.filter.filterEditor.saveButtonLabel": "Enregistrer", + "unifiedSearch.filter.filterEditor.trueOptionLabel": "vrai", + "unifiedSearch.filter.filterEditor.valueInputLabel": "Valeur", + "unifiedSearch.filter.filterEditor.valueInputPlaceholder": "Saisir une valeur", + "unifiedSearch.filter.filterEditor.valueSelectPlaceholder": "Sélectionner une valeur", + "unifiedSearch.filter.filterEditor.valuesSelectLabel": "Valeurs", + "unifiedSearch.filter.filterEditor.valuesSelectPlaceholder": "Sélectionner des valeurs", + "unifiedSearch.filter.options.changeAllFiltersButtonLabel": "Changer tous les filtres", + "unifiedSearch.filter.options.deleteAllFiltersButtonLabel": "Tout supprimer", + "unifiedSearch.filter.options.disableAllFiltersButtonLabel": "Tout désactiver", + "unifiedSearch.filter.options.enableAllFiltersButtonLabel": "Tout activer", + "unifiedSearch.filter.options.invertDisabledFiltersButtonLabel": "Inverser l’activation/désactivation", + "unifiedSearch.filter.options.invertNegatedFiltersButtonLabel": "Inverser l'inclusion", + "unifiedSearch.filter.options.pinAllFiltersButtonLabel": "Tout épingler", + "unifiedSearch.filter.options.unpinAllFiltersButtonLabel": "Tout désépingler", + "unifiedSearch.filter.searchBar.changeAllFiltersTitle": "Changer tous les filtres", "devTools.badge.readOnly.text": "Lecture seule", "devTools.badge.readOnly.tooltip": "Enregistrement impossible", "devTools.breadcrumb.homeLabel": "Outils de développement", @@ -10077,107 +10293,6 @@ "xpack.dashboard.drilldown.goToDashboard": "Accéder au tableau de bord", "xpack.dashboard.FlyoutCreateDrilldownAction.displayName": "Créer une recherche", "xpack.dashboard.panel.openFlyoutEditDrilldown.displayName": "Gérer les recherches", - "xpack.data.mgmt.searchSessions.actionDelete": "Supprimer", - "xpack.data.mgmt.searchSessions.actionExtend": "Étendre", - "xpack.data.mgmt.searchSessions.actionRename": "Modifier le nom", - "xpack.data.mgmt.searchSessions.actions.tooltip.moreActions": "Plus d'actions", - "xpack.data.mgmt.searchSessions.api.deleted": "La session de recherche a été supprimée.", - "xpack.data.mgmt.searchSessions.api.deletedError": "Impossible de supprimer la session de recherche !", - "xpack.data.mgmt.searchSessions.api.extended": "La session de recherche a été étendue.", - "xpack.data.mgmt.searchSessions.api.extendError": "Impossible d'étendre la session de recherche !", - "xpack.data.mgmt.searchSessions.api.fetchError": "Impossible d'actualiser la page !", - "xpack.data.mgmt.searchSessions.api.fetchTimeout": "La récupération des informations de la session de recherche a expiré après {timeout} secondes", - "xpack.data.mgmt.searchSessions.api.rename": "La session de recherche a été renommée", - "xpack.data.mgmt.searchSessions.api.renameError": "Impossible de renommer la session de recherche", - "xpack.data.mgmt.searchSessions.appTitle": "Sessions de recherche", - "xpack.data.mgmt.searchSessions.ariaLabel.moreActions": "Plus d'actions", - "xpack.data.mgmt.searchSessions.cancelModal.cancelButton": "Annuler", - "xpack.data.mgmt.searchSessions.cancelModal.deleteButton": "Supprimer", - "xpack.data.mgmt.searchSessions.cancelModal.message": "La suppression de la session de recherche \"{name}\" supprime tous les résultats mis en cache.", - "xpack.data.mgmt.searchSessions.cancelModal.title": "Supprimer la session de recherche", - "xpack.data.mgmt.searchSessions.extendModal.dontExtendButton": "Annuler", - "xpack.data.mgmt.searchSessions.extendModal.extendButton": "Étendre l'expiration", - "xpack.data.mgmt.searchSessions.extendModal.extendMessage": "L'expiration de la session de recherche \"{name}\" sera étendue jusqu'à {newExpires}.", - "xpack.data.mgmt.searchSessions.extendModal.title": "Étendre l'expiration de la session de recherche", - "xpack.data.mgmt.searchSessions.flyoutTitle": "Inspecter", - "xpack.data.mgmt.searchSessions.main.backgroundSessionsDocsLinkText": "Documentation", - "xpack.data.mgmt.searchSessions.main.sectionDescription": "Gérez vos sessions de recherche enregistrées.", - "xpack.data.mgmt.searchSessions.main.sectionTitle": "Sessions de recherche", - "xpack.data.mgmt.searchSessions.renameModal.cancelButton": "Annuler", - "xpack.data.mgmt.searchSessions.renameModal.renameButton": "Enregistrer", - "xpack.data.mgmt.searchSessions.renameModal.searchSessionNameInputLabel": "Nom de la session de recherche", - "xpack.data.mgmt.searchSessions.renameModal.title": "Modifier le nom de la session de recherche", - "xpack.data.mgmt.searchSessions.search.filterApp": "Application", - "xpack.data.mgmt.searchSessions.search.filterStatus": "Statut", - "xpack.data.mgmt.searchSessions.search.tools.refresh": "Actualiser", - "xpack.data.mgmt.searchSessions.status.expireDateUnknown": "inconnu", - "xpack.data.mgmt.searchSessions.status.expiresOn": "Expire le {expireDate}", - "xpack.data.mgmt.searchSessions.status.expiresSoonInDays": "Expire dans {numDays} jours", - "xpack.data.mgmt.searchSessions.status.expiresSoonInDaysTooltip": "{numDays} jours", - "xpack.data.mgmt.searchSessions.status.expiresSoonInHours": "Cette session expire dans {numHours} heures", - "xpack.data.mgmt.searchSessions.status.expiresSoonInHoursTooltip": "{numHours} heures", - "xpack.data.mgmt.searchSessions.status.label.cancelled": "Annulé", - "xpack.data.mgmt.searchSessions.status.label.complete": "Terminé", - "xpack.data.mgmt.searchSessions.status.label.error": "Erreur", - "xpack.data.mgmt.searchSessions.status.label.expired": "Expiré", - "xpack.data.mgmt.searchSessions.status.label.inProgress": "En cours", - "xpack.data.mgmt.searchSessions.status.message.cancelled": "Annulé par l'utilisateur", - "xpack.data.mgmt.searchSessions.status.message.createdOn": "Expire le {expireDate}", - "xpack.data.mgmt.searchSessions.status.message.error": "Erreur : {error}", - "xpack.data.mgmt.searchSessions.status.message.expiredOn": "Expiré le {expireDate}", - "xpack.data.mgmt.searchSessions.table.headerExpiration": "Expiration", - "xpack.data.mgmt.searchSessions.table.headerName": "Nom", - "xpack.data.mgmt.searchSessions.table.headerStarted": "Créé", - "xpack.data.mgmt.searchSessions.table.headerStatus": "Statut", - "xpack.data.mgmt.searchSessions.table.headerType": "Application", - "xpack.data.mgmt.searchSessions.table.mlAppName": "Machine Learning", - "xpack.data.mgmt.searchSessions.table.notRestorableWarning": "La session de recherche va être de nouveau exécutée. Vous pouvez ensuite l'enregistrer pour une utilisation ultérieure.", - "xpack.data.mgmt.searchSessions.table.numSearches": "# recherches", - "xpack.data.mgmt.searchSessions.table.versionIncompatibleWarning": "Cette session de recherche a été créée dans une instance Kibana exécutant une version différente. Il se peut qu'elle ne soit pas correctement restaurée.", - "xpack.data.search.statusError": "Recherche terminée avec un statut {errorCode}", - "xpack.data.search.statusThrow": "Le statut de la recherche a généré un statut d'erreur {message} ({errorCode})", - "xpack.data.searchSessionIndicator.cancelButtonText": "Arrêter la session", - "xpack.data.searchSessionIndicator.canceledDescriptionText": "Vous visualisez des données incomplètes", - "xpack.data.searchSessionIndicator.canceledIconAriaLabel": "La session de recherche s'est arrêtée", - "xpack.data.searchSessionIndicator.canceledTitleText": "La session de recherche s'est arrêtée", - "xpack.data.searchSessionIndicator.canceledTooltipText": "La session de recherche s'est arrêtée", - "xpack.data.searchSessionIndicator.canceledWhenText": "Arrêtée {when}", - "xpack.data.searchSessionIndicator.continueInBackgroundButtonText": "Enregistrer la session", - "xpack.data.searchSessionIndicator.disabledDueToDisabledGloballyMessage": "Vous ne disposez pas d'autorisations pour gérer les sessions de recherche", - "xpack.data.searchSessionIndicator.disabledDueToTimeoutMessage": "Les résultats de la session de recherche ont expiré.", - "xpack.data.searchSessionIndicator.loadingInTheBackgroundDescriptionText": "Vous pouvez retourner aux résultats terminés à partir de la page Gestion", - "xpack.data.searchSessionIndicator.loadingInTheBackgroundIconAriaLabel": "Session enregistrée en cours", - "xpack.data.searchSessionIndicator.loadingInTheBackgroundIconTooltipText": "Session enregistrée en cours", - "xpack.data.searchSessionIndicator.loadingInTheBackgroundTitleText": "Session enregistrée en cours", - "xpack.data.searchSessionIndicator.loadingInTheBackgroundWhenText": "Débuté {when}", - "xpack.data.searchSessionIndicator.loadingResultsDescription": "Enregistrer votre session, poursuivre votre travail et retourner aux résultats terminés", - "xpack.data.searchSessionIndicator.loadingResultsIconAriaLabel": "Chargement de la session de recherche", - "xpack.data.searchSessionIndicator.loadingResultsIconTooltipText": "Chargement de la session de recherche", - "xpack.data.searchSessionIndicator.loadingResultsTitle": "Votre recherche prend un certain temps…", - "xpack.data.searchSessionIndicator.loadingResultsWhenText": "Débuté {when}", - "xpack.data.searchSessionIndicator.restoredDescriptionText": "Vous affichez des données mises en cache d'une plage temporelle spécifique. La modification de la plage temporelle ou des filtres entraînera la réexécution de la session", - "xpack.data.searchSessionIndicator.restoredResultsIconAriaLabel": "Session enregistrée restaurée", - "xpack.data.searchSessionIndicator.restoredResultsTooltipText": "Session de recherche restaurée", - "xpack.data.searchSessionIndicator.restoredTitleText": "Session de recherche restaurée", - "xpack.data.searchSessionIndicator.restoredWhenText": "Terminé {when}", - "xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundDescriptionText": "Vous pouvez retourner à ces résultats à partir de la page de gestion", - "xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundIconAriaLabel": "Session enregistrée terminée", - "xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundIconTooltipText": "Session enregistrée terminée", - "xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundTitleText": "Session de recherche enregistrée", - "xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundWhenText": "Terminé {when}", - "xpack.data.searchSessionIndicator.resultsLoadedDescriptionText": "Enregistrer votre session pour y revenir ultérieurement", - "xpack.data.searchSessionIndicator.resultsLoadedIconAriaLabel": "Session de recherche terminée", - "xpack.data.searchSessionIndicator.resultsLoadedIconTooltipText": "Session de recherche terminée", - "xpack.data.searchSessionIndicator.resultsLoadedText": "Session de recherche terminée", - "xpack.data.searchSessionIndicator.resultsLoadedWhenText": "Terminé {when}", - "xpack.data.searchSessionIndicator.saveButtonText": "Enregistrer la session", - "xpack.data.searchSessionIndicator.viewSearchSessionsLinkText": "Gérer les sessions", - "xpack.data.searchSessionName.ariaLabelText": "Nom de la session de recherche", - "xpack.data.searchSessionName.editAriaLabelText": "Modifier le nom de la session de recherche", - "xpack.data.searchSessionName.placeholderText": "Entrer un nom pour la session de recherche", - "xpack.data.searchSessionName.saveButtonText": "Enregistrer", - "xpack.data.sessions.management.flyoutText": "Configuration de cette session de recherche", - "xpack.data.sessions.management.flyoutTitle": "Inspecter la session de recherche", "xpack.dataVisualizer.addCombinedFieldsLabel": "Ajouter un champ combiné", "xpack.dataVisualizer.choroplethMap.topValuesCount": "Compte des valeurs les plus élevées pour {fieldName}", "xpack.dataVisualizer.chrome.help.appName": "Data Visualizer (Visualiseur de données)", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index a74c31404cedc..0a79aba689f57 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -2719,6 +2719,110 @@ "dataViews.deprecations.scriptedFields.manualStepTwoMessage": "ランタイムフィールドを使用するには、スクリプト化されたフィールドがある{numberOfIndexPatternsWithScriptedFields}データビューを更新します。ほとんどの場合、既存のスクリプトを移行するには、「return ;」から「emit();」に変更する必要があります。1つ以上のスクリプト化されたフィールドがあるデータビュー:{allTitles}", "dataViews.deprecations.scriptedFieldsMessage": "スクリプト化されたフィールドを使用する{numberOfIndexPatternsWithScriptedFields}データビュー({titlesPreview}...)があります。スクリプト化されたフィールドは廃止予定であり、今後は削除されます。ランタイムフィールドを使用してください。", "dataViews.deprecations.scriptedFieldsTitle": "スクリプト化されたフィールドを使用しているデータビューが見つかりました。", + "data.mgmt.searchSessions.actionDelete": "削除", + "data.mgmt.searchSessions.actionExtend": "延長", + "data.mgmt.searchSessions.actionRename": "名前を編集", + "data.mgmt.searchSessions.actions.tooltip.moreActions": "さらにアクションを表示", + "data.mgmt.searchSessions.api.deleted": "検索セッションが削除されました。", + "data.mgmt.searchSessions.api.deletedError": "検索セッションを削除できませんでした。", + "data.mgmt.searchSessions.api.extended": "検索セッションが延長されました。", + "data.mgmt.searchSessions.api.extendError": "検索セッションを延長できませんでした。", + "data.mgmt.searchSessions.api.fetchError": "ページを更新できませんでした。", + "data.mgmt.searchSessions.api.fetchTimeout": "{timeout}秒後に検索セッション情報の取得がタイムアウトしました", + "data.mgmt.searchSessions.api.rename": "検索セッション名が変更されました", + "data.mgmt.searchSessions.api.renameError": "検索セッション名を変更できませんでした", + "data.mgmt.searchSessions.appTitle": "検索セッション", + "data.mgmt.searchSessions.ariaLabel.moreActions": "さらにアクションを表示", + "data.mgmt.searchSessions.cancelModal.cancelButton": "キャンセル", + "data.mgmt.searchSessions.cancelModal.deleteButton": "削除", + "data.mgmt.searchSessions.cancelModal.message": "検索セッション'{name}'を削除すると、キャッシュに保存されているすべての結果が削除されます。", + "data.mgmt.searchSessions.cancelModal.title": "検索セッションの削除", + "data.mgmt.searchSessions.extendModal.dontExtendButton": "キャンセル", + "data.mgmt.searchSessions.extendModal.extendButton": "有効期限を延長", + "data.mgmt.searchSessions.extendModal.extendMessage": "検索セッション'{name}'の有効期限が{newExpires}まで延長されます。", + "data.mgmt.searchSessions.extendModal.title": "検索セッションの有効期限を延長", + "data.mgmt.searchSessions.flyoutTitle": "検査", + "data.mgmt.searchSessions.main.backgroundSessionsDocsLinkText": "ドキュメント", + "data.mgmt.searchSessions.main.sectionDescription": "保存された検索セッションを管理します。", + "data.mgmt.searchSessions.main.sectionTitle": "検索セッション", + "data.mgmt.searchSessions.renameModal.cancelButton": "キャンセル", + "data.mgmt.searchSessions.renameModal.renameButton": "保存", + "data.mgmt.searchSessions.renameModal.searchSessionNameInputLabel": "検索セッション名", + "data.mgmt.searchSessions.renameModal.title": "検索セッション名を編集", + "data.mgmt.searchSessions.search.filterApp": "アプリ", + "data.mgmt.searchSessions.search.filterStatus": "ステータス", + "data.mgmt.searchSessions.search.tools.refresh": "更新", + "data.mgmt.searchSessions.status.expireDateUnknown": "不明", + "data.mgmt.searchSessions.status.expiresOn": "有効期限:{expireDate}", + "data.mgmt.searchSessions.status.expiresSoonInDays": "{numDays}日後に期限切れ", + "data.mgmt.searchSessions.status.expiresSoonInDaysTooltip": "{numDays}日", + "data.mgmt.searchSessions.status.expiresSoonInHours": "このセッションは{numHours}時間後に期限切れになります", + "data.mgmt.searchSessions.status.expiresSoonInHoursTooltip": "{numHours}時間", + "data.mgmt.searchSessions.status.label.cancelled": "キャンセル済み", + "data.mgmt.searchSessions.status.label.complete": "完了", + "data.mgmt.searchSessions.status.label.error": "エラー", + "data.mgmt.searchSessions.status.label.expired": "期限切れ", + "data.mgmt.searchSessions.status.label.inProgress": "進行中", + "data.mgmt.searchSessions.status.message.cancelled": "ユーザーがキャンセル", + "data.mgmt.searchSessions.status.message.createdOn": "有効期限:{expireDate}", + "data.mgmt.searchSessions.status.message.error": "エラー:{error}", + "data.mgmt.searchSessions.status.message.expiredOn": "有効期限:{expireDate}", + "data.mgmt.searchSessions.table.headerExpiration": "有効期限", + "data.mgmt.searchSessions.table.headerName": "名前", + "data.mgmt.searchSessions.table.headerStarted": "作成済み", + "data.mgmt.searchSessions.table.headerStatus": "ステータス", + "data.mgmt.searchSessions.table.headerType": "アプリ", + "data.mgmt.searchSessions.table.notRestorableWarning": "検索セッションはもう一度実行されます。今後使用するために保存できます。", + "data.mgmt.searchSessions.table.numSearches": "# 検索", + "data.mgmt.searchSessions.table.versionIncompatibleWarning": "この検索は別のバージョンを実行しているKibanaインスタンスで作成されました。正常に復元されない可能性があります。", + "data.search.statusError": "検索は{errorCode}ステータスで完了しました", + "data.search.statusThrow": "検索ステータスはエラー{message}({errorCode})ステータスを返しました", + "data.searchSessionIndicator.cancelButtonText": "セッションの停止", + "data.searchSessionIndicator.canceledDescriptionText": "不完全なデータを表示しています。", + "data.searchSessionIndicator.canceledIconAriaLabel": "検索セッションが停止しました", + "data.searchSessionIndicator.canceledTitleText": "検索セッションが停止しました", + "data.searchSessionIndicator.canceledTooltipText": "検索セッションが停止しました", + "data.searchSessionIndicator.canceledWhenText": "停止:{when}", + "data.searchSessionIndicator.continueInBackgroundButtonText": "セッションの保存", + "data.searchSessionIndicator.disabledDueToDisabledGloballyMessage": "検索セッションを管理するアクセス権がありません", + "data.searchSessionIndicator.disabledDueToTimeoutMessage": "検索セッション結果が期限切れです。", + "data.searchSessionIndicator.loadingInTheBackgroundDescriptionText": "管理から完了した結果に戻ることができます。", + "data.searchSessionIndicator.loadingInTheBackgroundIconAriaLabel": "保存されたセッションを実行中です", + "data.searchSessionIndicator.loadingInTheBackgroundIconTooltipText": "保存されたセッションを実行中です", + "data.searchSessionIndicator.loadingInTheBackgroundTitleText": "保存されたセッションを実行中です", + "data.searchSessionIndicator.loadingInTheBackgroundWhenText": "開始:{when}", + "data.searchSessionIndicator.loadingResultsDescription": "セッションを保存して作業を続け、完了した結果に戻ってください。", + "data.searchSessionIndicator.loadingResultsIconAriaLabel": "検索セッションを読み込んでいます", + "data.searchSessionIndicator.loadingResultsIconTooltipText": "検索セッションを読み込んでいます", + "data.searchSessionIndicator.loadingResultsTitle": "検索に少し時間がかかっています...", + "data.searchSessionIndicator.loadingResultsWhenText": "開始:{when}", + "data.searchSessionIndicator.restoredDescriptionText": "特定の時間範囲からキャッシュに保存されたデータを表示しています。時間範囲またはフィルターを変更すると、セッションが再実行されます。", + "data.searchSessionIndicator.restoredResultsIconAriaLabel": "保存されたセッションが復元されました", + "data.searchSessionIndicator.restoredResultsTooltipText": "検索セッションが復元されました", + "data.searchSessionIndicator.restoredTitleText": "検索セッションが復元されました", + "data.searchSessionIndicator.restoredWhenText": "完了:{when}", + "data.searchSessionIndicator.resultLoadedInTheBackgroundDescriptionText": "管理からこれらの結果に戻ることができます。", + "data.searchSessionIndicator.resultLoadedInTheBackgroundIconAriaLabel": "保存されたセッションが完了しました", + "data.searchSessionIndicator.resultLoadedInTheBackgroundIconTooltipText": "保存されたセッションが完了しました", + "data.searchSessionIndicator.resultLoadedInTheBackgroundTitleText": "検索セッションが保存されました", + "data.searchSessionIndicator.resultLoadedInTheBackgroundWhenText": "完了:{when}", + "data.searchSessionIndicator.resultsLoadedDescriptionText": "セッションを保存して、後から戻ります。", + "data.searchSessionIndicator.resultsLoadedIconAriaLabel": "検索セッションが完了しました", + "data.searchSessionIndicator.resultsLoadedIconTooltipText": "検索セッションが完了しました", + "data.searchSessionIndicator.resultsLoadedText": "検索セッションが完了しました", + "data.searchSessionIndicator.resultsLoadedWhenText": "完了:{when}", + "data.searchSessionIndicator.saveButtonText": "セッションの保存", + "data.searchSessionIndicator.viewSearchSessionsLinkText": "セッションの管理", + "data.searchSessionName.ariaLabelText": "検索セッション名", + "data.searchSessionName.editAriaLabelText": "検索セッション名を編集", + "data.searchSessionName.placeholderText": "検索セッションの名前を入力", + "data.searchSessionName.saveButtonText": "保存", + "data.sessions.management.flyoutText": "この検索セッションの構成", + "data.sessions.management.flyoutTitle": "検索セッションの検査", + "dataViews.deprecations.scriptedFields.manualStepOneMessage": "[スタック管理]>[Kibana]>[インデックスパターン]に移動します。", + "dataViews.deprecations.scriptedFields.manualStepTwoMessage": "ランタイムフィールドを使用するには、スクリプト化されたフィールドがある{numberOfIndexPatternsWithScriptedFields}インデックスパターンを更新します。ほとんどの場合、既存のスクリプトを移行するには、「return ;」から「emit();」に変更する必要があります。1つ以上のスクリプト化されたフィールドがあるインデックスパターン:{allTitles}", + "dataViews.deprecations.scriptedFieldsMessage": "スクリプト化されたフィールドを使用する{numberOfIndexPatternsWithScriptedFields}インデックスパターン({titlesPreview}...)があります。スクリプト化されたフィールドは廃止予定であり、今後は削除されます。ランタイムフィールドを使用してください。", + "dataViews.deprecations.scriptedFieldsTitle": "スクリプト化されたフィールドを使用しているインデックスパターンが見つかりました", "dataViews.ensureDefaultIndexPattern.bannerLabel": "Kibanaでデータの可視化と閲覧を行うには、Elasticsearchからデータを取得するためのインデックスパターンの作成が必要です。", "dataViews.fetchFieldErrorTitle": "データビューのフィールド取得中にエラーが発生 {title}(ID:{id})", "dataViews.functions.dataViewLoad.help": "データビューを読み込みます", @@ -10189,107 +10293,6 @@ "xpack.dashboard.drilldown.goToDashboard": "ダッシュボードに移動", "xpack.dashboard.FlyoutCreateDrilldownAction.displayName": "ドリルダウンを作成", "xpack.dashboard.panel.openFlyoutEditDrilldown.displayName": "ドリルダウンを管理", - "xpack.data.mgmt.searchSessions.actionDelete": "削除", - "xpack.data.mgmt.searchSessions.actionExtend": "延長", - "xpack.data.mgmt.searchSessions.actionRename": "名前を編集", - "xpack.data.mgmt.searchSessions.actions.tooltip.moreActions": "さらにアクションを表示", - "xpack.data.mgmt.searchSessions.api.deleted": "検索セッションが削除されました。", - "xpack.data.mgmt.searchSessions.api.deletedError": "検索セッションを削除できませんでした。", - "xpack.data.mgmt.searchSessions.api.extended": "検索セッションが延長されました。", - "xpack.data.mgmt.searchSessions.api.extendError": "検索セッションを延長できませんでした。", - "xpack.data.mgmt.searchSessions.api.fetchError": "ページを更新できませんでした。", - "xpack.data.mgmt.searchSessions.api.fetchTimeout": "{timeout}秒後に検索セッション情報の取得がタイムアウトしました", - "xpack.data.mgmt.searchSessions.api.rename": "検索セッション名が変更されました", - "xpack.data.mgmt.searchSessions.api.renameError": "検索セッション名を変更できませんでした", - "xpack.data.mgmt.searchSessions.appTitle": "検索セッション", - "xpack.data.mgmt.searchSessions.ariaLabel.moreActions": "さらにアクションを表示", - "xpack.data.mgmt.searchSessions.cancelModal.cancelButton": "キャンセル", - "xpack.data.mgmt.searchSessions.cancelModal.deleteButton": "削除", - "xpack.data.mgmt.searchSessions.cancelModal.message": "検索セッション'{name}'を削除すると、キャッシュに保存されているすべての結果が削除されます。", - "xpack.data.mgmt.searchSessions.cancelModal.title": "検索セッションの削除", - "xpack.data.mgmt.searchSessions.extendModal.dontExtendButton": "キャンセル", - "xpack.data.mgmt.searchSessions.extendModal.extendButton": "有効期限を延長", - "xpack.data.mgmt.searchSessions.extendModal.extendMessage": "検索セッション'{name}'の有効期限が{newExpires}まで延長されます。", - "xpack.data.mgmt.searchSessions.extendModal.title": "検索セッションの有効期限を延長", - "xpack.data.mgmt.searchSessions.flyoutTitle": "検査", - "xpack.data.mgmt.searchSessions.main.backgroundSessionsDocsLinkText": "ドキュメント", - "xpack.data.mgmt.searchSessions.main.sectionDescription": "保存された検索セッションを管理します。", - "xpack.data.mgmt.searchSessions.main.sectionTitle": "検索セッション", - "xpack.data.mgmt.searchSessions.renameModal.cancelButton": "キャンセル", - "xpack.data.mgmt.searchSessions.renameModal.renameButton": "保存", - "xpack.data.mgmt.searchSessions.renameModal.searchSessionNameInputLabel": "検索セッション名", - "xpack.data.mgmt.searchSessions.renameModal.title": "検索セッション名を編集", - "xpack.data.mgmt.searchSessions.search.filterApp": "アプリ", - "xpack.data.mgmt.searchSessions.search.filterStatus": "ステータス", - "xpack.data.mgmt.searchSessions.search.tools.refresh": "更新", - "xpack.data.mgmt.searchSessions.status.expireDateUnknown": "不明", - "xpack.data.mgmt.searchSessions.status.expiresOn": "有効期限:{expireDate}", - "xpack.data.mgmt.searchSessions.status.expiresSoonInDays": "{numDays}日後に期限切れ", - "xpack.data.mgmt.searchSessions.status.expiresSoonInDaysTooltip": "{numDays}日", - "xpack.data.mgmt.searchSessions.status.expiresSoonInHours": "このセッションは{numHours}時間後に期限切れになります", - "xpack.data.mgmt.searchSessions.status.expiresSoonInHoursTooltip": "{numHours}時間", - "xpack.data.mgmt.searchSessions.status.label.cancelled": "キャンセル済み", - "xpack.data.mgmt.searchSessions.status.label.complete": "完了", - "xpack.data.mgmt.searchSessions.status.label.error": "エラー", - "xpack.data.mgmt.searchSessions.status.label.expired": "期限切れ", - "xpack.data.mgmt.searchSessions.status.label.inProgress": "進行中", - "xpack.data.mgmt.searchSessions.status.message.cancelled": "ユーザーがキャンセル", - "xpack.data.mgmt.searchSessions.status.message.createdOn": "有効期限:{expireDate}", - "xpack.data.mgmt.searchSessions.status.message.error": "エラー:{error}", - "xpack.data.mgmt.searchSessions.status.message.expiredOn": "有効期限:{expireDate}", - "xpack.data.mgmt.searchSessions.table.headerExpiration": "有効期限", - "xpack.data.mgmt.searchSessions.table.headerName": "名前", - "xpack.data.mgmt.searchSessions.table.headerStarted": "作成済み", - "xpack.data.mgmt.searchSessions.table.headerStatus": "ステータス", - "xpack.data.mgmt.searchSessions.table.headerType": "アプリ", - "xpack.data.mgmt.searchSessions.table.mlAppName": "機械学習", - "xpack.data.mgmt.searchSessions.table.notRestorableWarning": "検索セッションはもう一度実行されます。今後使用するために保存できます。", - "xpack.data.mgmt.searchSessions.table.numSearches": "# 検索", - "xpack.data.mgmt.searchSessions.table.versionIncompatibleWarning": "この検索は別のバージョンを実行しているKibanaインスタンスで作成されました。正常に復元されない可能性があります。", - "xpack.data.search.statusError": "検索は{errorCode}ステータスで完了しました", - "xpack.data.search.statusThrow": "検索ステータスはエラー{message}({errorCode})ステータスを返しました", - "xpack.data.searchSessionIndicator.cancelButtonText": "セッションの停止", - "xpack.data.searchSessionIndicator.canceledDescriptionText": "不完全なデータを表示しています。", - "xpack.data.searchSessionIndicator.canceledIconAriaLabel": "検索セッションが停止しました", - "xpack.data.searchSessionIndicator.canceledTitleText": "検索セッションが停止しました", - "xpack.data.searchSessionIndicator.canceledTooltipText": "検索セッションが停止しました", - "xpack.data.searchSessionIndicator.canceledWhenText": "停止:{when}", - "xpack.data.searchSessionIndicator.continueInBackgroundButtonText": "セッションの保存", - "xpack.data.searchSessionIndicator.disabledDueToDisabledGloballyMessage": "検索セッションを管理するアクセス権がありません", - "xpack.data.searchSessionIndicator.disabledDueToTimeoutMessage": "検索セッション結果が期限切れです。", - "xpack.data.searchSessionIndicator.loadingInTheBackgroundDescriptionText": "管理から完了した結果に戻ることができます。", - "xpack.data.searchSessionIndicator.loadingInTheBackgroundIconAriaLabel": "保存されたセッションを実行中です", - "xpack.data.searchSessionIndicator.loadingInTheBackgroundIconTooltipText": "保存されたセッションを実行中です", - "xpack.data.searchSessionIndicator.loadingInTheBackgroundTitleText": "保存されたセッションを実行中です", - "xpack.data.searchSessionIndicator.loadingInTheBackgroundWhenText": "開始:{when}", - "xpack.data.searchSessionIndicator.loadingResultsDescription": "セッションを保存して作業を続け、完了した結果に戻ってください。", - "xpack.data.searchSessionIndicator.loadingResultsIconAriaLabel": "検索セッションを読み込んでいます", - "xpack.data.searchSessionIndicator.loadingResultsIconTooltipText": "検索セッションを読み込んでいます", - "xpack.data.searchSessionIndicator.loadingResultsTitle": "検索に少し時間がかかっています...", - "xpack.data.searchSessionIndicator.loadingResultsWhenText": "開始:{when}", - "xpack.data.searchSessionIndicator.restoredDescriptionText": "特定の時間範囲からキャッシュに保存されたデータを表示しています。時間範囲またはフィルターを変更すると、セッションが再実行されます。", - "xpack.data.searchSessionIndicator.restoredResultsIconAriaLabel": "保存されたセッションが復元されました", - "xpack.data.searchSessionIndicator.restoredResultsTooltipText": "検索セッションが復元されました", - "xpack.data.searchSessionIndicator.restoredTitleText": "検索セッションが復元されました", - "xpack.data.searchSessionIndicator.restoredWhenText": "完了:{when}", - "xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundDescriptionText": "管理からこれらの結果に戻ることができます。", - "xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundIconAriaLabel": "保存されたセッションが完了しました", - "xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundIconTooltipText": "保存されたセッションが完了しました", - "xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundTitleText": "検索セッションが保存されました", - "xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundWhenText": "完了:{when}", - "xpack.data.searchSessionIndicator.resultsLoadedDescriptionText": "セッションを保存して、後から戻ります。", - "xpack.data.searchSessionIndicator.resultsLoadedIconAriaLabel": "検索セッションが完了しました", - "xpack.data.searchSessionIndicator.resultsLoadedIconTooltipText": "検索セッションが完了しました", - "xpack.data.searchSessionIndicator.resultsLoadedText": "検索セッションが完了しました", - "xpack.data.searchSessionIndicator.resultsLoadedWhenText": "完了:{when}", - "xpack.data.searchSessionIndicator.saveButtonText": "セッションの保存", - "xpack.data.searchSessionIndicator.viewSearchSessionsLinkText": "セッションの管理", - "xpack.data.searchSessionName.ariaLabelText": "検索セッション名", - "xpack.data.searchSessionName.editAriaLabelText": "検索セッション名を編集", - "xpack.data.searchSessionName.placeholderText": "検索セッションの名前を入力", - "xpack.data.searchSessionName.saveButtonText": "保存", - "xpack.data.sessions.management.flyoutText": "この検索セッションの構成", - "xpack.data.sessions.management.flyoutTitle": "検索セッションの検査", "xpack.dataVisualizer.addCombinedFieldsLabel": "結合されたフィールドを追加", "xpack.dataVisualizer.choroplethMap.topValuesCount": "{fieldName}の上位の値件数", "xpack.dataVisualizer.chrome.help.appName": "データビジュアライザー", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 9f2a139a65c36..adb097d9936c8 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -2722,6 +2722,110 @@ "data.searchSessions.sessionService.sessionObjectFetchError": "无法提取搜索会话信息", "data.triggers.applyFilterDescription": "应用 kibana 筛选时。可能是单个值或范围筛选。", "data.triggers.applyFilterTitle": "应用筛选", + "data.mgmt.searchSessions.actionDelete": "删除", + "data.mgmt.searchSessions.actionExtend": "延长", + "data.mgmt.searchSessions.actionRename": "编辑名称", + "data.mgmt.searchSessions.actions.tooltip.moreActions": "更多操作", + "data.mgmt.searchSessions.api.deleted": "搜索会话已删除。", + "data.mgmt.searchSessions.api.deletedError": "无法删除搜索会话!", + "data.mgmt.searchSessions.api.extended": "搜索会话已延长。", + "data.mgmt.searchSessions.api.extendError": "无法延长搜索会话!", + "data.mgmt.searchSessions.api.fetchError": "无法刷新页面!", + "data.mgmt.searchSessions.api.fetchTimeout": "获取搜索会话信息在 {timeout} 秒后已超时", + "data.mgmt.searchSessions.api.rename": "搜索会话已重命名", + "data.mgmt.searchSessions.api.renameError": "无法重命名搜索会话", + "data.mgmt.searchSessions.appTitle": "搜索会话", + "data.mgmt.searchSessions.ariaLabel.moreActions": "更多操作", + "data.mgmt.searchSessions.cancelModal.cancelButton": "取消", + "data.mgmt.searchSessions.cancelModal.deleteButton": "删除", + "data.mgmt.searchSessions.cancelModal.message": "删除搜索会话“{name}”将会删除所有缓存的结果。", + "data.mgmt.searchSessions.cancelModal.title": "删除搜索会话", + "data.mgmt.searchSessions.extendModal.dontExtendButton": "取消", + "data.mgmt.searchSessions.extendModal.extendButton": "延长过期时间", + "data.mgmt.searchSessions.extendModal.extendMessage": "搜索会话“{name}”过期时间将延长至 {newExpires}。", + "data.mgmt.searchSessions.extendModal.title": "延长搜索会话过期时间", + "data.mgmt.searchSessions.flyoutTitle": "检查", + "data.mgmt.searchSessions.main.backgroundSessionsDocsLinkText": "文档", + "data.mgmt.searchSessions.main.sectionDescription": "管理已保存搜索会话。", + "data.mgmt.searchSessions.main.sectionTitle": "搜索会话", + "data.mgmt.searchSessions.renameModal.cancelButton": "取消", + "data.mgmt.searchSessions.renameModal.renameButton": "保存", + "data.mgmt.searchSessions.renameModal.searchSessionNameInputLabel": "搜索会话名称", + "data.mgmt.searchSessions.renameModal.title": "编辑搜索会话名称", + "data.mgmt.searchSessions.search.filterApp": "应用", + "data.mgmt.searchSessions.search.filterStatus": "状态", + "data.mgmt.searchSessions.search.tools.refresh": "刷新", + "data.mgmt.searchSessions.status.expireDateUnknown": "未知", + "data.mgmt.searchSessions.status.expiresOn": "于 {expireDate}过期", + "data.mgmt.searchSessions.status.expiresSoonInDays": "将于 {numDays} 天后过期", + "data.mgmt.searchSessions.status.expiresSoonInDaysTooltip": "{numDays} 天", + "data.mgmt.searchSessions.status.expiresSoonInHours": "此会话将于 {numHours} 小时后过期", + "data.mgmt.searchSessions.status.expiresSoonInHoursTooltip": "{numHours} 小时", + "data.mgmt.searchSessions.status.label.cancelled": "已取消", + "data.mgmt.searchSessions.status.label.complete": "已完成", + "data.mgmt.searchSessions.status.label.error": "错误", + "data.mgmt.searchSessions.status.label.expired": "已过期", + "data.mgmt.searchSessions.status.label.inProgress": "进行中", + "data.mgmt.searchSessions.status.message.cancelled": "用户已取消", + "data.mgmt.searchSessions.status.message.createdOn": "于 {expireDate}过期", + "data.mgmt.searchSessions.status.message.error": "错误:{error}", + "data.mgmt.searchSessions.status.message.expiredOn": "已于 {expireDate}过期", + "data.mgmt.searchSessions.table.headerExpiration": "到期", + "data.mgmt.searchSessions.table.headerName": "名称", + "data.mgmt.searchSessions.table.headerStarted": "创建时间", + "data.mgmt.searchSessions.table.headerStatus": "状态", + "data.mgmt.searchSessions.table.headerType": "应用", + "data.mgmt.searchSessions.table.notRestorableWarning": "搜索会话将重新执行。然后,您可以将其保存,供未来使用。", + "data.mgmt.searchSessions.table.numSearches": "搜索数", + "data.mgmt.searchSessions.table.versionIncompatibleWarning": "此搜索会话在运行不同版本的 Kibana 实例中已创建。其可能不会正确还原。", + "data.search.statusError": "搜索完成,状态为 {errorCode}", + "data.search.statusThrow": "搜索状态引发错误 {message} ({errorCode}) 状态", + "data.searchSessionIndicator.cancelButtonText": "停止会话", + "data.searchSessionIndicator.canceledDescriptionText": "您正查看不完整的数据", + "data.searchSessionIndicator.canceledIconAriaLabel": "搜索会话已停止", + "data.searchSessionIndicator.canceledTitleText": "搜索会话已停止", + "data.searchSessionIndicator.canceledTooltipText": "搜索会话已停止", + "data.searchSessionIndicator.canceledWhenText": "已于 {when} 停止", + "data.searchSessionIndicator.continueInBackgroundButtonText": "保存会话", + "data.searchSessionIndicator.disabledDueToDisabledGloballyMessage": "您无权管理搜索会话", + "data.searchSessionIndicator.disabledDueToTimeoutMessage": "搜索会话结果已过期。", + "data.searchSessionIndicator.loadingInTheBackgroundDescriptionText": "可以从“管理”中返回至完成的结果", + "data.searchSessionIndicator.loadingInTheBackgroundIconAriaLabel": "已保存会话正在进行中", + "data.searchSessionIndicator.loadingInTheBackgroundIconTooltipText": "已保存会话正在进行中", + "data.searchSessionIndicator.loadingInTheBackgroundTitleText": "已保存会话正在进行中", + "data.searchSessionIndicator.loadingInTheBackgroundWhenText": "已于 {when} 启动", + "data.searchSessionIndicator.loadingResultsDescription": "保存您的会话,继续您的工作,然后返回到完成的结果", + "data.searchSessionIndicator.loadingResultsIconAriaLabel": "搜索会话正在加载", + "data.searchSessionIndicator.loadingResultsIconTooltipText": "搜索会话正在加载", + "data.searchSessionIndicator.loadingResultsTitle": "您的搜索将需要一些时间......", + "data.searchSessionIndicator.loadingResultsWhenText": "已于 {when} 启动", + "data.searchSessionIndicator.restoredDescriptionText": "您在查看特定时间范围的缓存数据。更改时间范围或筛选将会重新运行会话", + "data.searchSessionIndicator.restoredResultsIconAriaLabel": "已保存会话已还原", + "data.searchSessionIndicator.restoredResultsTooltipText": "搜索会话已还原", + "data.searchSessionIndicator.restoredTitleText": "搜索会话已还原", + "data.searchSessionIndicator.restoredWhenText": "已于 {when} 完成", + "data.searchSessionIndicator.resultLoadedInTheBackgroundDescriptionText": "可以从“管理”中返回到这些结果", + "data.searchSessionIndicator.resultLoadedInTheBackgroundIconAriaLabel": "已保存会话已完成", + "data.searchSessionIndicator.resultLoadedInTheBackgroundIconTooltipText": "已保存会话已完成", + "data.searchSessionIndicator.resultLoadedInTheBackgroundTitleText": "搜索会话已保存", + "data.searchSessionIndicator.resultLoadedInTheBackgroundWhenText": "已于 {when} 完成", + "data.searchSessionIndicator.resultsLoadedDescriptionText": "保存您的会话,之后可返回", + "data.searchSessionIndicator.resultsLoadedIconAriaLabel": "搜索会话已完成", + "data.searchSessionIndicator.resultsLoadedIconTooltipText": "搜索会话已完成", + "data.searchSessionIndicator.resultsLoadedText": "搜索会话已完成", + "data.searchSessionIndicator.resultsLoadedWhenText": "已于 {when} 完成", + "data.searchSessionIndicator.saveButtonText": "保存会话", + "data.searchSessionIndicator.viewSearchSessionsLinkText": "管理会话", + "data.searchSessionName.ariaLabelText": "搜索会话名称", + "data.searchSessionName.editAriaLabelText": "编辑搜索会话名称", + "data.searchSessionName.placeholderText": "为搜索会话输入名称", + "data.searchSessionName.saveButtonText": "保存", + "data.sessions.management.flyoutText": "此搜索会话的配置", + "data.sessions.management.flyoutTitle": "检查搜索会话", + "dataViews.deprecations.scriptedFields.manualStepOneMessage": "导航到“堆栈管理”>“Kibana”>“索引模式”。", + "dataViews.deprecations.scriptedFields.manualStepTwoMessage": "更新 {numberOfIndexPatternsWithScriptedFields} 个具有脚本字段的索引模式以改为使用运行时字段。多数情况下,要迁移现有脚本,您需要将“return ;”更改为“emit();”。至少有一个脚本字段的索引模式:{allTitles}", + "dataViews.deprecations.scriptedFieldsMessage": "您具有 {numberOfIndexPatternsWithScriptedFields} 个使用脚本字段的索引模式 ({titlesPreview}...)。脚本字段已过时,将在未来移除。请改为使用运行时脚本。", + "dataViews.deprecations.scriptedFieldsTitle": "找到使用脚本字段的索引模式", "dataViews.deprecations.scriptedFields.manualStepOneMessage": "导航到“堆栈管理”>“Kibana”>“数据视图”。", "dataViews.deprecations.scriptedFields.manualStepTwoMessage": "更新 {numberOfIndexPatternsWithScriptedFields} 个具有脚本字段的数据视图以改为使用运行时字段。多数情况下,要迁移现有脚本,您需要将“return ;”更改为“emit();”。至少有一个脚本字段的数据视图:{allTitles}", "dataViews.deprecations.scriptedFieldsMessage": "您具有 {numberOfIndexPatternsWithScriptedFields} 个使用脚本字段的数据视图 ({titlesPreview}...)。脚本字段已过时,将在未来移除。请改为使用运行时脚本。", @@ -10210,107 +10314,6 @@ "xpack.dashboard.drilldown.goToDashboard": "前往仪表板", "xpack.dashboard.FlyoutCreateDrilldownAction.displayName": "创建向下钻取", "xpack.dashboard.panel.openFlyoutEditDrilldown.displayName": "管理向下钻取", - "xpack.data.mgmt.searchSessions.actionDelete": "删除", - "xpack.data.mgmt.searchSessions.actionExtend": "延长", - "xpack.data.mgmt.searchSessions.actionRename": "编辑名称", - "xpack.data.mgmt.searchSessions.actions.tooltip.moreActions": "更多操作", - "xpack.data.mgmt.searchSessions.api.deleted": "搜索会话已删除。", - "xpack.data.mgmt.searchSessions.api.deletedError": "无法删除搜索会话!", - "xpack.data.mgmt.searchSessions.api.extended": "搜索会话已延长。", - "xpack.data.mgmt.searchSessions.api.extendError": "无法延长搜索会话!", - "xpack.data.mgmt.searchSessions.api.fetchError": "无法刷新页面!", - "xpack.data.mgmt.searchSessions.api.fetchTimeout": "获取搜索会话信息在 {timeout} 秒后已超时", - "xpack.data.mgmt.searchSessions.api.rename": "搜索会话已重命名", - "xpack.data.mgmt.searchSessions.api.renameError": "无法重命名搜索会话", - "xpack.data.mgmt.searchSessions.appTitle": "搜索会话", - "xpack.data.mgmt.searchSessions.ariaLabel.moreActions": "更多操作", - "xpack.data.mgmt.searchSessions.cancelModal.cancelButton": "取消", - "xpack.data.mgmt.searchSessions.cancelModal.deleteButton": "删除", - "xpack.data.mgmt.searchSessions.cancelModal.message": "删除搜索会话“{name}”将会删除所有缓存的结果。", - "xpack.data.mgmt.searchSessions.cancelModal.title": "删除搜索会话", - "xpack.data.mgmt.searchSessions.extendModal.dontExtendButton": "取消", - "xpack.data.mgmt.searchSessions.extendModal.extendButton": "延长过期时间", - "xpack.data.mgmt.searchSessions.extendModal.extendMessage": "搜索会话“{name}”过期时间将延长至 {newExpires}。", - "xpack.data.mgmt.searchSessions.extendModal.title": "延长搜索会话过期时间", - "xpack.data.mgmt.searchSessions.flyoutTitle": "检查", - "xpack.data.mgmt.searchSessions.main.backgroundSessionsDocsLinkText": "文档", - "xpack.data.mgmt.searchSessions.main.sectionDescription": "管理已保存搜索会话。", - "xpack.data.mgmt.searchSessions.main.sectionTitle": "搜索会话", - "xpack.data.mgmt.searchSessions.renameModal.cancelButton": "取消", - "xpack.data.mgmt.searchSessions.renameModal.renameButton": "保存", - "xpack.data.mgmt.searchSessions.renameModal.searchSessionNameInputLabel": "搜索会话名称", - "xpack.data.mgmt.searchSessions.renameModal.title": "编辑搜索会话名称", - "xpack.data.mgmt.searchSessions.search.filterApp": "应用", - "xpack.data.mgmt.searchSessions.search.filterStatus": "状态", - "xpack.data.mgmt.searchSessions.search.tools.refresh": "刷新", - "xpack.data.mgmt.searchSessions.status.expireDateUnknown": "未知", - "xpack.data.mgmt.searchSessions.status.expiresOn": "于 {expireDate}过期", - "xpack.data.mgmt.searchSessions.status.expiresSoonInDays": "将于 {numDays} 天后过期", - "xpack.data.mgmt.searchSessions.status.expiresSoonInDaysTooltip": "{numDays} 天", - "xpack.data.mgmt.searchSessions.status.expiresSoonInHours": "此会话将于 {numHours} 小时后过期", - "xpack.data.mgmt.searchSessions.status.expiresSoonInHoursTooltip": "{numHours} 小时", - "xpack.data.mgmt.searchSessions.status.label.cancelled": "已取消", - "xpack.data.mgmt.searchSessions.status.label.complete": "已完成", - "xpack.data.mgmt.searchSessions.status.label.error": "错误", - "xpack.data.mgmt.searchSessions.status.label.expired": "已过期", - "xpack.data.mgmt.searchSessions.status.label.inProgress": "进行中", - "xpack.data.mgmt.searchSessions.status.message.cancelled": "用户已取消", - "xpack.data.mgmt.searchSessions.status.message.createdOn": "于 {expireDate}过期", - "xpack.data.mgmt.searchSessions.status.message.error": "错误:{error}", - "xpack.data.mgmt.searchSessions.status.message.expiredOn": "已于 {expireDate}过期", - "xpack.data.mgmt.searchSessions.table.headerExpiration": "到期", - "xpack.data.mgmt.searchSessions.table.headerName": "名称", - "xpack.data.mgmt.searchSessions.table.headerStarted": "创建时间", - "xpack.data.mgmt.searchSessions.table.headerStatus": "状态", - "xpack.data.mgmt.searchSessions.table.headerType": "应用", - "xpack.data.mgmt.searchSessions.table.mlAppName": "Machine Learning", - "xpack.data.mgmt.searchSessions.table.notRestorableWarning": "搜索会话将重新执行。然后,您可以将其保存,供未来使用。", - "xpack.data.mgmt.searchSessions.table.numSearches": "搜索数", - "xpack.data.mgmt.searchSessions.table.versionIncompatibleWarning": "此搜索会话在运行不同版本的 Kibana 实例中已创建。其可能不会正确还原。", - "xpack.data.search.statusError": "搜索完成,状态为 {errorCode}", - "xpack.data.search.statusThrow": "搜索状态引发错误 {message} ({errorCode}) 状态", - "xpack.data.searchSessionIndicator.cancelButtonText": "停止会话", - "xpack.data.searchSessionIndicator.canceledDescriptionText": "您正查看不完整的数据", - "xpack.data.searchSessionIndicator.canceledIconAriaLabel": "搜索会话已停止", - "xpack.data.searchSessionIndicator.canceledTitleText": "搜索会话已停止", - "xpack.data.searchSessionIndicator.canceledTooltipText": "搜索会话已停止", - "xpack.data.searchSessionIndicator.canceledWhenText": "已于 {when} 停止", - "xpack.data.searchSessionIndicator.continueInBackgroundButtonText": "保存会话", - "xpack.data.searchSessionIndicator.disabledDueToDisabledGloballyMessage": "您无权管理搜索会话", - "xpack.data.searchSessionIndicator.disabledDueToTimeoutMessage": "搜索会话结果已过期。", - "xpack.data.searchSessionIndicator.loadingInTheBackgroundDescriptionText": "可以从“管理”中返回至完成的结果", - "xpack.data.searchSessionIndicator.loadingInTheBackgroundIconAriaLabel": "已保存会话正在进行中", - "xpack.data.searchSessionIndicator.loadingInTheBackgroundIconTooltipText": "已保存会话正在进行中", - "xpack.data.searchSessionIndicator.loadingInTheBackgroundTitleText": "已保存会话正在进行中", - "xpack.data.searchSessionIndicator.loadingInTheBackgroundWhenText": "已于 {when} 启动", - "xpack.data.searchSessionIndicator.loadingResultsDescription": "保存您的会话,继续您的工作,然后返回到完成的结果", - "xpack.data.searchSessionIndicator.loadingResultsIconAriaLabel": "搜索会话正在加载", - "xpack.data.searchSessionIndicator.loadingResultsIconTooltipText": "搜索会话正在加载", - "xpack.data.searchSessionIndicator.loadingResultsTitle": "您的搜索将需要一些时间......", - "xpack.data.searchSessionIndicator.loadingResultsWhenText": "已于 {when} 启动", - "xpack.data.searchSessionIndicator.restoredDescriptionText": "您在查看特定时间范围的缓存数据。更改时间范围或筛选将会重新运行会话", - "xpack.data.searchSessionIndicator.restoredResultsIconAriaLabel": "已保存会话已还原", - "xpack.data.searchSessionIndicator.restoredResultsTooltipText": "搜索会话已还原", - "xpack.data.searchSessionIndicator.restoredTitleText": "搜索会话已还原", - "xpack.data.searchSessionIndicator.restoredWhenText": "已于 {when} 完成", - "xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundDescriptionText": "可以从“管理”中返回到这些结果", - "xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundIconAriaLabel": "已保存会话已完成", - "xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundIconTooltipText": "已保存会话已完成", - "xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundTitleText": "搜索会话已保存", - "xpack.data.searchSessionIndicator.resultLoadedInTheBackgroundWhenText": "已于 {when} 完成", - "xpack.data.searchSessionIndicator.resultsLoadedDescriptionText": "保存您的会话,之后可返回", - "xpack.data.searchSessionIndicator.resultsLoadedIconAriaLabel": "搜索会话已完成", - "xpack.data.searchSessionIndicator.resultsLoadedIconTooltipText": "搜索会话已完成", - "xpack.data.searchSessionIndicator.resultsLoadedText": "搜索会话已完成", - "xpack.data.searchSessionIndicator.resultsLoadedWhenText": "已于 {when} 完成", - "xpack.data.searchSessionIndicator.saveButtonText": "保存会话", - "xpack.data.searchSessionIndicator.viewSearchSessionsLinkText": "管理会话", - "xpack.data.searchSessionName.ariaLabelText": "搜索会话名称", - "xpack.data.searchSessionName.editAriaLabelText": "编辑搜索会话名称", - "xpack.data.searchSessionName.placeholderText": "为搜索会话输入名称", - "xpack.data.searchSessionName.saveButtonText": "保存", - "xpack.data.sessions.management.flyoutText": "此搜索会话的配置", - "xpack.data.sessions.management.flyoutTitle": "检查搜索会话", "xpack.dataVisualizer.addCombinedFieldsLabel": "添加组合字段", "xpack.dataVisualizer.choroplethMap.topValuesCount": "{fieldName} 的排名最前值计数", "xpack.dataVisualizer.chrome.help.appName": "数据可视化工具", diff --git a/x-pack/test/plugin_functional/plugins/timelines_test/kibana.json b/x-pack/test/plugin_functional/plugins/timelines_test/kibana.json index f96e8b2bbcc23..1960c49839566 100644 --- a/x-pack/test/plugin_functional/plugins/timelines_test/kibana.json +++ b/x-pack/test/plugin_functional/plugins/timelines_test/kibana.json @@ -4,7 +4,7 @@ "version": "1.0.0", "kibanaVersion": "kibana", "configPath": ["xpack", "timelinesTest"], - "requiredPlugins": ["timelines", "data", "dataEnhanced"], + "requiredPlugins": ["timelines", "data"], "requiredBundles": ["kibanaReact"], "server": false, "ui": true diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index d6bdf8cfaa6fd..8c6a1cb88c0ba 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -58,7 +58,6 @@ { "path": "../plugins/global_search/tsconfig.json" }, { "path": "../plugins/global_search_providers/tsconfig.json" }, { "path": "../plugins/features/tsconfig.json" }, - { "path": "../plugins/data_enhanced/tsconfig.json" }, { "path": "../plugins/drilldowns/url_drilldown/tsconfig.json" }, { "path": "../plugins/embeddable_enhanced/tsconfig.json" }, { "path": "../plugins/encrypted_saved_objects/tsconfig.json" }, From 61364dc93f446aa55a0cdc6fdf63c38ad26ad907 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Fri, 29 Apr 2022 17:00:58 +0200 Subject: [PATCH 06/18] Current state help popover (#130009) --- .../editor_frame/frame_layout.scss | 2 +- .../dimension_panel/dimension_editor.scss | 8 +- .../dimension_panel/dimension_editor.tsx | 52 ++++++- .../indexpattern_datasource/help_popover.tsx | 42 ++++++ .../calculations/moving_average.tsx | 29 +--- .../operations/definitions/date_histogram.tsx | 140 ++++++++---------- .../operations/definitions/index.ts | 8 + .../translations/translations/fr-FR.json | 2 - .../translations/translations/ja-JP.json | 2 - .../translations/translations/zh-CN.json | 2 - 10 files changed, 169 insertions(+), 118 deletions(-) diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/frame_layout.scss b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/frame_layout.scss index b49c77bb8b419..cab1a78294a86 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/frame_layout.scss +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/frame_layout.scss @@ -96,7 +96,7 @@ a tilemap in an iframe: https://github.com/elastic/kibana/issues/16457 */ .lnsFrameLayout__sidebar--right { flex-basis: 25%; background-color: lightOrDarkTheme($euiColorLightestShade, $euiColorInk); - min-width: $lnsPanelMinWidth + $euiSizeXL; + min-width: $lnsPanelMinWidth + 70; max-width: $euiFormMaxWidth + $euiSizeXXL; max-height: 100%; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.scss b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.scss index d4c91f80317fd..99286ad34b380 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.scss +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.scss @@ -37,13 +37,7 @@ .lnsIndexPatternDimensionEditor__columns { column-count: 2; - column-gap: $euiSizeXL; -} - -// overrides the .euiListGroupItem display flex. -// The parent container has a column-count property that only works properly with block elements. -.lnsIndexPatternDimensionEditor__operation { - display: block; + column-gap: $euiSizeM; } .lnsIndexPatternDimensionEditor__operation .euiListGroupItem__label { diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx index 2c03ad902ce81..790873fdc74b2 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx @@ -6,7 +6,7 @@ */ import './dimension_editor.scss'; -import React, { useState, useMemo, useCallback } from 'react'; +import React, { useState, useMemo, useCallback, useRef, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiListGroup, @@ -16,6 +16,7 @@ import { EuiToolTip, EuiText, } from '@elastic/eui'; +import ReactDOM from 'react-dom'; import type { IndexPatternDimensionEditorProps } from './dimension_panel'; import type { OperationSupportMatrix } from './operation_support'; import type { GenericIndexPatternColumn } from '../indexpattern'; @@ -58,6 +59,7 @@ import type { TemporaryState } from './dimensions_editor_helpers'; import { FieldInput } from './field_input'; import { NameInput } from '../../shared_components'; import { ParamEditorProps } from '../operations/definitions'; +import { WrappingHelpPopover } from '../help_popover'; const operationPanels = getOperationDisplay(); @@ -228,6 +230,15 @@ export function DimensionEditor(props: DimensionEditorProps) { const [filterByOpenInitially, setFilterByOpenInitally] = useState(false); const [timeShiftedFocused, setTimeShiftFocused] = useState(false); + const helpPopoverContainer = useRef(null); + useEffect(() => { + return () => { + if (helpPopoverContainer.current) { + ReactDOM.unmountComponentAtNode(helpPopoverContainer.current); + document.body.removeChild(helpPopoverContainer.current); + } + }; + }, []); // Operations are compatible if they match inputs. They are always compatible in // the empty state. Field-based operations are not compatible with field-less operations. @@ -309,6 +320,45 @@ export function DimensionEditor(props: DimensionEditorProps) { compatibleWithCurrentField ? '' : ' incompatible' }`, [`aria-pressed`]: isActive, + extraAction: operationDefinitionMap[operationType].helpComponent + ? { + color: 'primary', + onClick: (e) => { + if (!helpPopoverContainer.current) { + const container = document.createElement('div'); + helpPopoverContainer.current = container; + document.body.appendChild(container); + const HelpComponent = operationDefinitionMap[operationType].helpComponent!; + const element = ( + { + if (helpPopoverContainer.current) { + ReactDOM.unmountComponentAtNode(helpPopoverContainer.current); + document.body.removeChild(helpPopoverContainer.current); + helpPopoverContainer.current = null; + } + }} + > + + + ); + ReactDOM.render(element, helpPopoverContainer.current); + } else { + ReactDOM.unmountComponentAtNode(helpPopoverContainer.current); + document.body.removeChild(helpPopoverContainer.current); + helpPopoverContainer.current = null; + } + }, + iconType: 'documentation', + iconSize: 's', + 'aria-label': i18n.translate('xpack.lens.indexPattern.helpLabel', { + defaultMessage: 'Function help', + }), + } + : undefined, onClick() { if ( ['none', 'fullReference', 'managedReference'].includes( diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/help_popover.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/help_popover.tsx index 88fb96b58cd21..a1bbc7ccd55f1 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/help_popover.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/help_popover.tsx @@ -12,6 +12,8 @@ import { EuiLinkButtonProps, EuiPopover, EuiPopoverProps, + EuiWrappingPopover, + EuiWrappingPopoverProps, EuiPopoverTitle, EuiText, } from '@elastic/eui'; @@ -75,3 +77,43 @@ export const HelpPopover = ({ ); }; + +export const WrappingHelpPopover = ({ + anchorPosition, + button, + children, + closePopover, + isOpen, + title, +}: { + anchorPosition?: EuiWrappingPopoverProps['anchorPosition']; + button: EuiWrappingPopoverProps['button']; + children: ReactNode; + closePopover: EuiWrappingPopoverProps['closePopover']; + isOpen: EuiWrappingPopoverProps['isOpen']; + title?: string; +}) => { + useEffect(() => { + if (isOpen) { + trackUiEvent('open_help_popover'); + } + }, [isOpen]); + return ( + + {title && {title}} + + + {children} + + + ); +}; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/moving_average.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/moving_average.tsx index aa68c8409ad80..cf96bcd11b788 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/moving_average.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/moving_average.tsx @@ -28,7 +28,6 @@ import { combineErrorMessages, } from '../helpers'; import { adjustTimeScaleOnOtherColumnChange } from '../../time_scale_utils'; -import { HelpPopover, HelpPopoverButton } from '../../../help_popover'; import type { OperationDefinition, ParamEditorProps } from '..'; import { getDisallowedPreviousShiftMessage } from '../../../time_shift_utils'; @@ -129,7 +128,10 @@ export const movingAverageOperation: OperationDefinition< getDisallowedPreviousShiftMessage(layer, columnId), ]); }, - getHelpMessage: () => , + helpComponent: () => , + helpComponentTitle: i18n.translate('xpack.lens.indexPattern.movingAverage.titleHelp', { + defaultMessage: 'How moving average works', + }), getDisabledStatus(indexPattern, layer, layerType) { const opName = i18n.translate('xpack.lens.indexPattern.movingAverage', { defaultMessage: 'Moving average', @@ -217,27 +219,8 @@ function MovingAverageParamEditor({ } const MovingAveragePopup = () => { - const [isPopoverOpen, setIsPopoverOpen] = useState(false); return ( - { - setIsPopoverOpen(!isPopoverOpen); - }} - > - {i18n.translate('xpack.lens.indexPattern.movingAverage.helpText', { - defaultMessage: 'How it works', - })} - - } - closePopover={() => setIsPopoverOpen(false)} - isOpen={isPopoverOpen} - title={i18n.translate('xpack.lens.indexPattern.movingAverage.titleHelp', { - defaultMessage: 'How moving average works', - })} - > + <>

{ defaultMessage="The first moving average value starts at the second item." />

-
+ ); }; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx index f96e584326340..56b82dc03101c 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useCallback, useState } from 'react'; +import React, { useCallback } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -25,7 +25,6 @@ import { } from '@elastic/eui'; import { AggFunctionsMapping, - DataPublicPluginStart, IndexPatternAggRestrictions, search, UI_SETTINGS, @@ -36,7 +35,6 @@ import { updateColumnParam } from '../layer_helpers'; import { OperationDefinition, ParamEditorProps } from '.'; import { FieldBasedIndexPatternColumn } from './column_types'; import { getInvalidFieldMessage, getSafeName } from './helpers'; -import { HelpPopover, HelpPopoverButton } from '../../help_popover'; import { IndexPatternLayer } from '../../types'; import { TooltipWrapper } from '../../../shared_components'; @@ -96,7 +94,6 @@ export const dateHistogramOperation: OperationDefinition< ) || []), getMultipleDateHistogramsErrorMessage(layer, columnId) || '', ].filter(Boolean), - getHelpMessage: (props) => , getPossibleOperationForField: ({ aggregationRestrictions, aggregatable, type }) => { if ( (type === 'date' || type === 'date_range') && @@ -467,6 +464,65 @@ export const dateHistogramOperation: OperationDefinition< ); }, + helpComponentTitle: i18n.translate('xpack.lens.indexPattern.dateHistogram.titleHelp', { + defaultMessage: 'How auto date histogram works', + }), + helpComponent() { + const infiniteBound = i18n.translate('xpack.lens.indexPattern.dateHistogram.moreThanYear', { + defaultMessage: 'More than a year', + }); + const upToLabel = i18n.translate('xpack.lens.indexPattern.dateHistogram.upTo', { + defaultMessage: 'Up to', + }); + + return ( + <> +

+ {i18n.translate('xpack.lens.indexPattern.dateHistogram.autoBasicExplanation', { + defaultMessage: 'The auto date histogram splits a data field into buckets by interval.', + })} +

+ +

+ {UI_SETTINGS.HISTOGRAM_MAX_BARS}, + targetBarSetting: {UI_SETTINGS.HISTOGRAM_BAR_TARGET}, + }} + /> +

+ +

+ {i18n.translate('xpack.lens.indexPattern.dateHistogram.autoAdvancedExplanation', { + defaultMessage: 'The interval follows this logic:', + })} +

+ + ({ + bound: typeof bound === 'number' ? infiniteBound : `${upToLabel} ${boundLabel}`, + interval: intervalLabel, + }))} + columns={[ + { + field: 'bound', + name: i18n.translate('xpack.lens.indexPattern.dateHistogram.autoBoundHeader', { + defaultMessage: 'Target interval measured', + }), + }, + { + field: 'interval', + name: i18n.translate('xpack.lens.indexPattern.dateHistogram.autoIntervalHeader', { + defaultMessage: 'Interval used', + }), + }, + ]} + /> + + ); + }, }; function parseInterval(currentInterval: string) { @@ -491,79 +547,3 @@ function restrictedInterval(aggregationRestrictions?: Partial { - const [isPopoverOpen, setIsPopoverOpen] = useState(false); - const infiniteBound = i18n.translate('xpack.lens.indexPattern.dateHistogram.moreThanYear', { - defaultMessage: 'More than a year', - }); - const upToLabel = i18n.translate('xpack.lens.indexPattern.dateHistogram.upTo', { - defaultMessage: 'Up to', - }); - - return ( - { - setIsPopoverOpen(!isPopoverOpen); - }} - > - {i18n.translate('xpack.lens.indexPattern.dateHistogram.autoHelpText', { - defaultMessage: 'How it works', - })} - - } - closePopover={() => setIsPopoverOpen(false)} - isOpen={isPopoverOpen} - title={i18n.translate('xpack.lens.indexPattern.dateHistogram.titleHelp', { - defaultMessage: 'How auto date histogram works', - })} - > -

- {i18n.translate('xpack.lens.indexPattern.dateHistogram.autoBasicExplanation', { - defaultMessage: 'The auto date histogram splits a data field into buckets by interval.', - })} -

- -

- {UI_SETTINGS.HISTOGRAM_MAX_BARS}, - targetBarSetting: {UI_SETTINGS.HISTOGRAM_BAR_TARGET}, - }} - /> -

- -

- {i18n.translate('xpack.lens.indexPattern.dateHistogram.autoAdvancedExplanation', { - defaultMessage: 'The interval follows this logic:', - })} -

- - ({ - bound: typeof bound === 'number' ? infiniteBound : `${upToLabel} ${boundLabel}`, - interval: intervalLabel, - }))} - columns={[ - { - field: 'bound', - name: i18n.translate('xpack.lens.indexPattern.dateHistogram.autoBoundHeader', { - defaultMessage: 'Target interval measured', - }), - }, - { - field: 'interval', - name: i18n.translate('xpack.lens.indexPattern.dateHistogram.autoIntervalHeader', { - defaultMessage: 'Interval used', - }), - }, - ]} - /> -
- ); -}; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts index e62bab6bd808b..36039a058908b 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/index.ts @@ -364,6 +364,14 @@ interface BaseOperationDefinitionProps * are not pass the transferable checks */ getNonTransferableFields?: (column: C, indexPattern: IndexPattern) => string[]; + /** + * Component rendered as inline help + */ + helpComponent?: React.ComponentType<{}>; + /** + * Title for the help component + */ + helpComponentTitle?: string; } interface BaseBuildColumnArgs { diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 8179a03244e50..bbe07a375e42d 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -440,7 +440,6 @@ "xpack.lens.indexPattern.dateHistogram.autoAdvancedExplanation": "L'intervalle suit cette logique :", "xpack.lens.indexPattern.dateHistogram.autoBasicExplanation": "L'histogramme des dates automatique divise un champ de données en groupes par intervalle.", "xpack.lens.indexPattern.dateHistogram.autoBoundHeader": "Intervalle cible mesuré", - "xpack.lens.indexPattern.dateHistogram.autoHelpText": "Fonctionnement", "xpack.lens.indexPattern.dateHistogram.autoInterval": "Personnaliser l'intervalle de temps", "xpack.lens.indexPattern.dateHistogram.autoIntervalHeader": "Intervalle utilisé", "xpack.lens.indexPattern.dateHistogram.autoLongerExplanation": "Pour choisir l'intervalle, Lens divise la plage temporelle spécifiée par le paramètre {targetBarSetting}. Lens calcule le meilleur intervalle pour vos données. Par exemple 30m, 1h et 12. Le nombre maximal de barres est défini par la valeur {maxBarSetting}.", @@ -573,7 +572,6 @@ "xpack.lens.indexPattern.moving_average.signature": "indicateur : nombre, [window] : nombre", "xpack.lens.indexPattern.movingAverage": "Moyenne mobile", "xpack.lens.indexPattern.movingAverage.basicExplanation": "La moyenne mobile fait glisser une fenêtre sur les données et affiche la valeur moyenne. La moyenne mobile est prise en charge uniquement par les histogrammes des dates.", - "xpack.lens.indexPattern.movingAverage.helpText": "Fonctionnement", "xpack.lens.indexPattern.movingAverage.limitations": "La première valeur de moyenne mobile commence au deuxième élément.", "xpack.lens.indexPattern.movingAverage.longerExplanation": "Pour calculer la moyenne mobile, Lens utilise la moyenne de la fenêtre et applique une politique d'omission pour les blancs. Pour les valeurs manquantes, le groupe est ignoré, et le calcul est effectué sur la valeur suivante.", "xpack.lens.indexPattern.movingAverage.tableExplanation": "Par exemple, avec les données [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], vous pouvez calculer une moyenne mobile simple avec une taille de fenêtre de 5 :", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 0a79aba689f57..44cb5fcef981a 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -442,7 +442,6 @@ "xpack.lens.indexPattern.dateHistogram.autoAdvancedExplanation": "間隔は次のロジックに従います。", "xpack.lens.indexPattern.dateHistogram.autoBasicExplanation": "自動日付ヒストグラムは、間隔でデータフィールドをバケットに分割します。", "xpack.lens.indexPattern.dateHistogram.autoBoundHeader": "対象間隔の測定", - "xpack.lens.indexPattern.dateHistogram.autoHelpText": "仕組み", "xpack.lens.indexPattern.dateHistogram.autoInterval": "時間範囲のカスタマイズ", "xpack.lens.indexPattern.dateHistogram.autoIntervalHeader": "使用される間隔", "xpack.lens.indexPattern.dateHistogram.autoLongerExplanation": "間隔を選択するには、Lensは指定された時間範囲を{targetBarSetting}設定で除算します。Lensはデータに最適な間隔を計算します。たとえば、30分、1時間、12です。棒の最大数は{maxBarSetting}値で設定します。", @@ -575,7 +574,6 @@ "xpack.lens.indexPattern.moving_average.signature": "メトリック:数値、[window]:数値", "xpack.lens.indexPattern.movingAverage": "移動平均", "xpack.lens.indexPattern.movingAverage.basicExplanation": "移動平均はデータ全体でウィンドウをスライドし、平均値を表示します。移動平均は日付ヒストグラムでのみサポートされています。", - "xpack.lens.indexPattern.movingAverage.helpText": "仕組み", "xpack.lens.indexPattern.movingAverage.limitations": "最初の移動平均値は2番目の項目から開始します。", "xpack.lens.indexPattern.movingAverage.longerExplanation": "移動平均を計算するには、Lensはウィンドウの平均値を使用し、ギャップのスキップポリシーを適用します。 見つからない値がある場合、バケットがスキップされます。次の値に対して計算が実行されます。", "xpack.lens.indexPattern.movingAverage.tableExplanation": "たとえば、データ[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]がある場合、ウィンドウサイズ5でシンプルな移動平均を計算できます。", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index adb097d9936c8..7101b5b874b78 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -447,7 +447,6 @@ "xpack.lens.indexPattern.dateHistogram.autoAdvancedExplanation": "时间间隔遵循以下逻辑:", "xpack.lens.indexPattern.dateHistogram.autoBasicExplanation": "自动日期直方图按时间间隔将数据字段拆分为桶。", "xpack.lens.indexPattern.dateHistogram.autoBoundHeader": "已度量目标时间间隔", - "xpack.lens.indexPattern.dateHistogram.autoHelpText": "运作方式", "xpack.lens.indexPattern.dateHistogram.autoInterval": "定制时间间隔", "xpack.lens.indexPattern.dateHistogram.autoIntervalHeader": "已用时间间隔", "xpack.lens.indexPattern.dateHistogram.autoLongerExplanation": "要选择时间间隔,Lens 按 {targetBarSetting} 设置分割指定的时间范围。Lens 为您的数据计算最佳时间间隔。例如 30m、1h 和 12。最大条形数由 {maxBarSetting} 值设置。", @@ -580,7 +579,6 @@ "xpack.lens.indexPattern.moving_average.signature": "指标:数字,[window]:数字", "xpack.lens.indexPattern.movingAverage": "移动平均值", "xpack.lens.indexPattern.movingAverage.basicExplanation": "移动平均值在数据上滑动时间窗并显示平均值。仅日期直方图支持移动平均值。", - "xpack.lens.indexPattern.movingAverage.helpText": "运作方式", "xpack.lens.indexPattern.movingAverage.limitations": "第一个移动平均值开始于第二项。", "xpack.lens.indexPattern.movingAverage.longerExplanation": "要计算移动平均值,Lens 使用时间窗的平均值,并为缺口应用跳过策略。 对于缺失值,将跳过桶,计算将基于下一个值执行。", "xpack.lens.indexPattern.movingAverage.tableExplanation": "例如,如果数据为 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],则可以使用时间窗大小 5 计算简单移动平均值:", From ab795cca6bf0bf205254a6f2be05cd0ca143aed7 Mon Sep 17 00:00:00 2001 From: Gloria Hornero Date: Fri, 29 Apr 2022 17:02:22 +0200 Subject: [PATCH 07/18] fixes flakiness (#131236) --- .../cases/attach_alert_to_case.spec.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/security_solution/cypress/integration/cases/attach_alert_to_case.spec.ts b/x-pack/plugins/security_solution/cypress/integration/cases/attach_alert_to_case.spec.ts index daf73d2db69d6..cac79b2114dd7 100644 --- a/x-pack/plugins/security_solution/cypress/integration/cases/attach_alert_to_case.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/cases/attach_alert_to_case.spec.ts @@ -10,10 +10,9 @@ import { ROLES } from '../../../common/test'; import { expandFirstAlertActions } from '../../tasks/alerts'; import { createCustomRuleEnabled } from '../../tasks/api_calls/rules'; -import { cleanKibana } from '../../tasks/common'; +import { cleanKibana, waitForPageToBeLoaded } from '../../tasks/common'; import { waitForAlertsToPopulate } from '../../tasks/create_new_rule'; import { login, visit, waitForPageWithoutDateRange } from '../../tasks/login'; -import { refreshPage } from '../../tasks/security_header'; import { ALERTS_URL } from '../../urls/navigation'; import { ATTACH_ALERT_TO_CASE_BUTTON, TIMELINE_CONTEXT_MENU_BTN } from '../../screens/alerts'; @@ -27,19 +26,17 @@ describe('Alerts timeline', () => { before(() => { // First we login as a privileged user to create alerts. cleanKibana(); - login(ROLES.platform_engineer); - visit(ALERTS_URL); + login(); createCustomRuleEnabled(getNewRule()); - refreshPage(); + visit(ALERTS_URL); waitForAlertsToPopulate(); - - // Then we login as read-only user to test. - login(ROLES.reader); }); context('Privileges: read only', () => { beforeEach(() => { + login(ROLES.reader); loadDetectionsPage(ROLES.reader); + waitForPageToBeLoaded(); }); it('should not allow user with read only privileges to attach alerts to cases', () => { @@ -50,7 +47,9 @@ describe('Alerts timeline', () => { context('Privileges: can crud', () => { beforeEach(() => { + login(ROLES.platform_engineer); loadDetectionsPage(ROLES.platform_engineer); + waitForPageToBeLoaded(); }); it('should allow a user with crud privileges to attach alerts to cases', () => { From a2acfe51172c8c45defcab50f3ca7bad6f0c2915 Mon Sep 17 00:00:00 2001 From: Max Kovalev Date: Fri, 29 Apr 2022 18:27:07 +0300 Subject: [PATCH 08/18] [Maps] allow feature editing for document layers with "applyGlobalTime", "applyGlobalQuery", and joins (#124803) * #124061 - feature editing updated logic for documents layer * 124061 - updates for disabling joins * 124061 - refactoring; Excluding filtering from when enabling editing mode * 124061 - fixes for failed tests * 124061 - fixed test for JoinEditor * 124061 - global time checkbox message fix * 124071 - updated snapshot for JoinEditor * 124061 - excluded applyGlobalQuery/applyGlobalTime from es_source in case of editing layer active * 124061 - refactoring * 124061 - fix for test * 124061 - refactoring; Added message for disabled filter * 124061 - replacing variables * 124061 - fixed test; refactoring * 124061 - refactoring; fixed tests * 124061 - refactoring; fixed tests * 124061 - refactoring; removed reuse isFeatureEditorOpenForLayer * 124061 - fixed tests * 124061 - removed isFeatureEditorOpenForLayer property * 124061 - buildVectorRequestMeta updates * 124061 - fixes for CI checks * 124061 - refactoring * 124061 - fixed test * 124061 - refactoring; fixed conflict * 124061 - syncDataLLayer called inside updateEditLayer * 124061 - reverting changes for Join editor * 124061 - removing unused isFeatureEditorOpenForLayer * 124061 - updating snap Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- docs/maps/import-geospatial-data.asciidoc | 6 ----- .../data_request_descriptor_types.ts | 1 + .../public/actions/data_request_actions.ts | 3 +++ .../maps/public/actions/map_actions.ts | 4 ++- .../layers/__fixtures__/mock_sync_context.ts | 2 ++ .../layers/build_vector_request_meta.ts | 4 ++- .../layers/heatmap_layer/heatmap_layer.ts | 3 ++- .../blended_vector_layer.ts | 3 ++- .../layers/vector_layer/bounds_data.ts | 9 ++++++- .../geojson_vector_layer.tsx | 3 ++- .../mvt_vector_layer/mvt_source_data.test.ts | 7 +++++ .../mvt_vector_layer/mvt_vector_layer.tsx | 3 ++- .../layers/vector_layer/vector_layer.tsx | 16 +++++++++--- .../es_geo_grid_source.test.ts | 1 + .../es_search_source/es_search_source.test.ts | 1 + .../classes/sources/es_source/es_source.ts | 16 +++++++++--- .../sources/vector_source/vector_source.tsx | 1 + .../public/classes/util/can_skip_fetch.ts | 4 +++ .../components/global_filter_checkbox.tsx | 26 +++++++++++++------ .../components/global_time_checkbox.tsx | 26 +++++++++++++------ .../filter_editor/filter_editor.tsx | 13 ++++++++++ .../edit_layer_panel/filter_editor/index.ts | 6 +++-- .../join_editor/join_editor.tsx | 1 + .../__snapshots__/toc_entry.test.tsx.snap | 5 ---- .../layer_toc/toc_entry/index.ts | 2 +- .../layer_toc/toc_entry/toc_entry.test.tsx | 2 +- .../layer_toc/toc_entry/toc_entry.tsx | 7 +++-- .../toc_entry_actions_popover.test.tsx | 5 +--- .../toc_entry_actions_popover.tsx | 7 ++--- 29 files changed, 130 insertions(+), 57 deletions(-) diff --git a/docs/maps/import-geospatial-data.asciidoc b/docs/maps/import-geospatial-data.asciidoc index f58077fa38f92..8ee54e5dba638 100644 --- a/docs/maps/import-geospatial-data.asciidoc +++ b/docs/maps/import-geospatial-data.asciidoc @@ -96,12 +96,6 @@ To open an existing index for drawing: . Click *Add layer*. -. Set *Scaling* to *Limit results to 10,000*. - -. In **Filtering**: -** Clear the *Apply global search to layer data* checkbox. -** If your data view contains a default time field, clear the *Apply global time to layer data* checkbox. - . Click *Save & close*. . In the legend, click the layer name and select *Edit features*. diff --git a/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts b/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts index f3132d145c7a2..a560114d71b4f 100644 --- a/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts +++ b/x-pack/plugins/maps/common/descriptor_types/data_request_descriptor_types.ts @@ -41,6 +41,7 @@ export type VectorSourceRequestMeta = DataFilters & { sourceQuery?: Query; sourceMeta: object | null; isForceRefresh: boolean; + isFeatureEditorOpenForLayer: boolean; }; export type VectorJoinSourceRequestMeta = Omit; diff --git a/x-pack/plugins/maps/public/actions/data_request_actions.ts b/x-pack/plugins/maps/public/actions/data_request_actions.ts index 5788c9360fdf2..d2cb416dcbe20 100644 --- a/x-pack/plugins/maps/public/actions/data_request_actions.ts +++ b/x-pack/plugins/maps/public/actions/data_request_actions.ts @@ -24,6 +24,7 @@ import { getDataRequestDescriptor, getLayerById, getLayerList, + getEditState, } from '../selectors/map_selectors'; import { cancelRequest, @@ -67,6 +68,7 @@ export type DataRequestContext = { dataFilters: DataFilters; forceRefreshDueToDrawing: boolean; // Boolean signaling data request triggered by a user updating layer features via drawing tools. When true, layer will re-load regardless of "source.applyForceRefresh" flag. isForceRefresh: boolean; // Boolean signaling data request triggered by auto-refresh timer or user clicking refresh button. When true, layer will re-load only when "source.applyForceRefresh" flag is set to true. + isFeatureEditorOpenForLayer: boolean; // Boolean signaling that feature editor menu is open for a layer. When true, layer will ignore all global and layer filtering so drawn features are displayed and not filtered out. }; export function clearDataRequests(layer: ILayer) { @@ -145,6 +147,7 @@ function getDataRequestContext( dispatch(registerCancelCallback(requestToken, callback)), forceRefreshDueToDrawing, isForceRefresh, + isFeatureEditorOpenForLayer: getEditState(getState())?.layerId === layerId, }; } diff --git a/x-pack/plugins/maps/public/actions/map_actions.ts b/x-pack/plugins/maps/public/actions/map_actions.ts index 8a16d036393ad..e8585560238fd 100644 --- a/x-pack/plugins/maps/public/actions/map_actions.ts +++ b/x-pack/plugins/maps/public/actions/map_actions.ts @@ -58,6 +58,7 @@ import { autoFitToBounds, syncDataForAllLayers, syncDataForLayerDueToDrawing, + syncDataForLayerId, } from './data_request_actions'; import { addLayer, addLayerWithoutDataSync } from './layer_actions'; import { MapSettings } from '../reducers/map'; @@ -394,7 +395,7 @@ export function setEditLayerToSelectedLayer() { } export function updateEditLayer(layerId: string | null) { - return (dispatch: Dispatch) => { + return (dispatch: ThunkDispatch) => { if (layerId !== null) { dispatch({ type: SET_OPEN_TOOLTIPS, openTooltips: [] }); } @@ -406,6 +407,7 @@ export function updateEditLayer(layerId: string | null) { type: UPDATE_EDIT_STATE, editState: layerId ? { layerId } : undefined, }); + dispatch(syncDataForLayerId(layerId, false)); }; } diff --git a/x-pack/plugins/maps/public/classes/layers/__fixtures__/mock_sync_context.ts b/x-pack/plugins/maps/public/classes/layers/__fixtures__/mock_sync_context.ts index b81ba6c854629..4d1f23599f48d 100644 --- a/x-pack/plugins/maps/public/classes/layers/__fixtures__/mock_sync_context.ts +++ b/x-pack/plugins/maps/public/classes/layers/__fixtures__/mock_sync_context.ts @@ -20,6 +20,7 @@ export class MockSyncContext implements DataRequestContext { updateSourceData: (newData: unknown) => void; forceRefreshDueToDrawing: boolean; isForceRefresh: boolean; + isFeatureEditorOpenForLayer: boolean; constructor({ dataFilters }: { dataFilters: Partial }) { const mapFilters: DataFilters = { @@ -44,5 +45,6 @@ export class MockSyncContext implements DataRequestContext { this.updateSourceData = sinon.spy(); this.forceRefreshDueToDrawing = false; this.isForceRefresh = false; + this.isFeatureEditorOpenForLayer = false; } } diff --git a/x-pack/plugins/maps/public/classes/layers/build_vector_request_meta.ts b/x-pack/plugins/maps/public/classes/layers/build_vector_request_meta.ts index 52dd93033020d..e8d74003c6790 100644 --- a/x-pack/plugins/maps/public/classes/layers/build_vector_request_meta.ts +++ b/x-pack/plugins/maps/public/classes/layers/build_vector_request_meta.ts @@ -16,7 +16,8 @@ export function buildVectorRequestMeta( fieldNames: string[], dataFilters: DataFilters, sourceQuery: Query | null | undefined, - isForceRefresh: boolean + isForceRefresh: boolean, + isFeatureEditorOpenForLayer: boolean ): VectorSourceRequestMeta { return { ...dataFilters, @@ -28,5 +29,6 @@ export function buildVectorRequestMeta( sourceMeta: source.getSyncMeta(), applyForceRefresh: source.isESSource() ? source.getApplyForceRefresh() : false, isForceRefresh, + isFeatureEditorOpenForLayer, }; } diff --git a/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts b/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts index 66aef6d38803f..899db80884bc8 100644 --- a/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts +++ b/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts @@ -89,7 +89,8 @@ export class HeatmapLayer extends AbstractLayer { this.getSource().getFieldNames(), syncContext.dataFilters, this.getQuery(), - syncContext.isForceRefresh + syncContext.isForceRefresh, + syncContext.isFeatureEditorOpenForLayer ), source: this.getSource() as IMvtVectorSource, syncContext, diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/blended_vector_layer/blended_vector_layer.ts b/x-pack/plugins/maps/public/classes/layers/vector_layer/blended_vector_layer/blended_vector_layer.ts index e46c670b677ba..b1fddcca5d5f2 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/blended_vector_layer/blended_vector_layer.ts +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/blended_vector_layer/blended_vector_layer.ts @@ -298,7 +298,8 @@ export class BlendedVectorLayer extends GeoJsonVectorLayer implements IVectorLay syncContext.isForceRefresh, syncContext.dataFilters, this.getSource(), - this.getCurrentStyle() + this.getCurrentStyle(), + syncContext.isFeatureEditorOpenForLayer ); const source = this.getSource(); diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/bounds_data.ts b/x-pack/plugins/maps/public/classes/layers/vector_layer/bounds_data.ts index 29ecf1635d626..7136c9d0c2235 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/bounds_data.ts +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/bounds_data.ts @@ -22,7 +22,13 @@ export async function syncBoundsData({ source: IVectorSource; sourceQuery: Query | null; }): Promise { - const { startLoading, stopLoading, registerCancelCallback, dataFilters } = syncContext; + const { + startLoading, + stopLoading, + registerCancelCallback, + dataFilters, + isFeatureEditorOpenForLayer, + } = syncContext; const requestToken = Symbol(`${SOURCE_BOUNDS_DATA_REQUEST_ID}-${layerId}`); @@ -37,6 +43,7 @@ export async function syncBoundsData({ joinKeyFilter: dataFilters.joinKeyFilter, applyGlobalQuery: source.getApplyGlobalQuery(), applyGlobalTime: source.getApplyGlobalTime(), + isFeatureEditorOpenForLayer, }; let bounds = null; diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/geojson_vector_layer/geojson_vector_layer.tsx b/x-pack/plugins/maps/public/classes/layers/vector_layer/geojson_vector_layer/geojson_vector_layer.tsx index c6f9a282d0fa4..bc7ba78c84d98 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/geojson_vector_layer/geojson_vector_layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/geojson_vector_layer/geojson_vector_layer.tsx @@ -237,7 +237,8 @@ export class GeoJsonVectorLayer extends AbstractVectorLayer { syncContext.isForceRefresh, syncContext.dataFilters, source, - style + style, + syncContext.isFeatureEditorOpenForLayer ), syncContext, source, diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_source_data.test.ts b/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_source_data.test.ts index 4b45adc8848bd..ccc73f94aac57 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_source_data.test.ts +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_source_data.test.ts @@ -59,6 +59,7 @@ describe('syncMvtSourceData', () => { fieldNames: [], sourceMeta: {}, isForceRefresh: false, + isFeatureEditorOpenForLayer: false, }, source: mockSource, syncContext, @@ -90,6 +91,7 @@ describe('syncMvtSourceData', () => { fieldNames: [], sourceMeta: {}, isForceRefresh: false, + isFeatureEditorOpenForLayer: false, }; await syncMvtSourceData({ @@ -131,6 +133,7 @@ describe('syncMvtSourceData', () => { fieldNames: [], sourceMeta: {}, isForceRefresh: false, + isFeatureEditorOpenForLayer: false, }; await syncMvtSourceData({ @@ -169,6 +172,7 @@ describe('syncMvtSourceData', () => { fieldNames: [], sourceMeta: {}, isForceRefresh: false, + isFeatureEditorOpenForLayer: false, }; await syncMvtSourceData({ @@ -215,6 +219,7 @@ describe('syncMvtSourceData', () => { fieldNames: [], sourceMeta: {}, isForceRefresh: false, + isFeatureEditorOpenForLayer: false, }; await syncMvtSourceData({ @@ -253,6 +258,7 @@ describe('syncMvtSourceData', () => { fieldNames: [], sourceMeta: {}, isForceRefresh: false, + isFeatureEditorOpenForLayer: false, }; await syncMvtSourceData({ @@ -291,6 +297,7 @@ describe('syncMvtSourceData', () => { fieldNames: [], sourceMeta: {}, isForceRefresh: false, + isFeatureEditorOpenForLayer: false, }; await syncMvtSourceData({ diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_vector_layer.tsx b/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_vector_layer.tsx index a7a190c1c5b56..a7ec941fceca3 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_vector_layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_vector_layer.tsx @@ -232,7 +232,8 @@ export class MvtVectorLayer extends AbstractVectorLayer { syncContext.isForceRefresh, syncContext.dataFilters, this.getSource(), - this.getCurrentStyle() + this.getCurrentStyle(), + syncContext.isFeatureEditorOpenForLayer ), source: this.getSource() as IMvtVectorSource, syncContext, diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx index 1b178d204f6e2..aee4312713b7d 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.tsx @@ -366,7 +366,8 @@ export class AbstractVectorLayer extends AbstractLayer implements IVectorLayer { isForceRefresh: boolean, dataFilters: DataFilters, source: IVectorSource, - style: IVectorStyle + style: IVectorStyle, + isFeatureEditorOpenForLayer: boolean ): Promise { const fieldNames = [ ...source.getFieldNames(), @@ -378,7 +379,14 @@ export class AbstractVectorLayer extends AbstractLayer implements IVectorLayer { if (timesliceMaskFieldName) { fieldNames.push(timesliceMaskFieldName); } - return buildVectorRequestMeta(source, fieldNames, dataFilters, this.getQuery(), isForceRefresh); + return buildVectorRequestMeta( + source, + fieldNames, + dataFilters, + this.getQuery(), + isForceRefresh, + isFeatureEditorOpenForLayer + ); } async _syncSourceStyleMeta( @@ -542,6 +550,7 @@ export class AbstractVectorLayer extends AbstractLayer implements IVectorLayer { registerCancelCallback, dataFilters, isForceRefresh, + isFeatureEditorOpenForLayer, }: { join: InnerJoin } & DataRequestContext): Promise { const joinSource = join.getRightJoinSource(); const sourceDataId = join.getSourceDataRequestId(); @@ -552,7 +561,8 @@ export class AbstractVectorLayer extends AbstractLayer implements IVectorLayer { joinSource.getFieldNames(), dataFilters, joinSource.getWhereQuery(), - isForceRefresh + isForceRefresh, + isFeatureEditorOpenForLayer ) as VectorJoinSourceRequestMeta; const prevDataRequest = this.getDataRequest(sourceDataId); diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.test.ts b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.test.ts index bcbc50c7e0090..7110473b11261 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.test.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.test.ts @@ -178,6 +178,7 @@ describe('ESGeoGridSource', () => { sourceMeta: null, zoom: 0, isForceRefresh: false, + isFeatureEditorOpenForLayer: false, }; describe('getGeoJsonWithMeta', () => { diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.test.ts b/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.test.ts index 54071848f9a40..2df2e119df30c 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.test.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.test.ts @@ -106,6 +106,7 @@ describe('ESSearchSource', () => { applyGlobalTime: true, applyForceRefresh: true, isForceRefresh: false, + isFeatureEditorOpenForLayer: false, }; it('Should only include required props', async () => { diff --git a/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts b/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts index c0eef8ba1ca22..944bf0ee3e0b1 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts @@ -230,7 +230,17 @@ export class AbstractESSource extends AbstractVectorSource implements IESSource allFilters.push(extentFilter); } - if (searchFilters.applyGlobalTime && (await this.isTimeAware())) { + + let isFeatureEditorOpenForLayer = false; + if ('isFeatureEditorOpenForLayer' in searchFilters) { + isFeatureEditorOpenForLayer = searchFilters.isFeatureEditorOpenForLayer; + } + + if ( + searchFilters.applyGlobalTime && + (await this.isTimeAware()) && + !isFeatureEditorOpenForLayer + ) { const timeRange = searchFilters.timeslice ? { from: new Date(searchFilters.timeslice.from).toISOString(), @@ -250,11 +260,11 @@ export class AbstractESSource extends AbstractVectorSource implements IESSource searchSource.setField('index', indexPattern); searchSource.setField('size', limit); searchSource.setField('filter', allFilters); - if (searchFilters.applyGlobalQuery) { + if (searchFilters.applyGlobalQuery && !isFeatureEditorOpenForLayer) { searchSource.setField('query', searchFilters.query); } - if (searchFilters.sourceQuery) { + if (searchFilters.sourceQuery && !isFeatureEditorOpenForLayer) { const layerSearchSource = searchService.searchSource.createEmpty(); layerSearchSource.setField('index', indexPattern); diff --git a/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx b/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx index 79830068628e5..43a2a00ca59e1 100644 --- a/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx @@ -42,6 +42,7 @@ export interface BoundsRequestMeta { sourceQuery?: Query; timeFilters: TimeRange; timeslice?: Timeslice; + isFeatureEditorOpenForLayer: boolean; joinKeyFilter?: Filter; } diff --git a/x-pack/plugins/maps/public/classes/util/can_skip_fetch.ts b/x-pack/plugins/maps/public/classes/util/can_skip_fetch.ts index 69a5c73ba2933..71d4730880b96 100644 --- a/x-pack/plugins/maps/public/classes/util/can_skip_fetch.ts +++ b/x-pack/plugins/maps/public/classes/util/can_skip_fetch.ts @@ -86,6 +86,10 @@ export async function canSkipSourceUpdate({ return false; } + if (prevMeta.isFeatureEditorOpenForLayer !== nextRequestMeta.isFeatureEditorOpenForLayer) { + return false; + } + let updateDueToApplyGlobalTime = false; let updateDueToTime = false; let updateDueToTimeslice = false; diff --git a/x-pack/plugins/maps/public/components/global_filter_checkbox.tsx b/x-pack/plugins/maps/public/components/global_filter_checkbox.tsx index 96805e0c6b5ec..502cc1973d329 100644 --- a/x-pack/plugins/maps/public/components/global_filter_checkbox.tsx +++ b/x-pack/plugins/maps/public/components/global_filter_checkbox.tsx @@ -13,27 +13,37 @@ interface Props { applyGlobalQuery: boolean; label: string; setApplyGlobalQuery: (applyGlobalQuery: boolean) => void; + isFeatureEditorOpenForLayer?: boolean; } -export function GlobalFilterCheckbox({ applyGlobalQuery, label, setApplyGlobalQuery }: Props) { +export function GlobalFilterCheckbox({ + applyGlobalQuery, + label, + setApplyGlobalQuery, + isFeatureEditorOpenForLayer, +}: Props) { const onApplyGlobalQueryChange = (event: EuiSwitchEvent) => { setApplyGlobalQuery(event.target.checked); }; + const tooltipMessage = isFeatureEditorOpenForLayer + ? i18n.translate('xpack.maps.filterEditor.isGlobalSearchNotApplied', { + defaultMessage: 'Global search is not applied to the layer while editing features', + }) + : i18n.translate('xpack.maps.filterEditor.applyGlobalFilterHelp', { + defaultMessage: 'When enabled, results narrowed by global search', + }); + return ( - + diff --git a/x-pack/plugins/maps/public/components/global_time_checkbox.tsx b/x-pack/plugins/maps/public/components/global_time_checkbox.tsx index 70d6859b8b02a..4db771c1edbaf 100644 --- a/x-pack/plugins/maps/public/components/global_time_checkbox.tsx +++ b/x-pack/plugins/maps/public/components/global_time_checkbox.tsx @@ -12,27 +12,37 @@ interface Props { applyGlobalTime: boolean; label: string; setApplyGlobalTime: (applyGlobalTime: boolean) => void; + isFeatureEditorOpenForLayer?: boolean; } -export function GlobalTimeCheckbox({ applyGlobalTime, label, setApplyGlobalTime }: Props) { +export function GlobalTimeCheckbox({ + applyGlobalTime, + label, + setApplyGlobalTime, + isFeatureEditorOpenForLayer, +}: Props) { const onApplyGlobalTimeChange = (event: EuiSwitchEvent) => { setApplyGlobalTime(event.target.checked); }; + const tooltipMessage = isFeatureEditorOpenForLayer + ? i18n.translate('xpack.maps.filterEditor.isGlobalTimeNotApplied', { + defaultMessage: 'Global time is not applied to the layer while editing features', + }) + : i18n.translate('xpack.maps.filterEditor.applyGlobalTimeHelp', { + defaultMessage: 'When enabled, results narrowed by global time', + }); + return ( - + diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx index afb18aa582a3c..9e3edeb1fc255 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx @@ -35,6 +35,7 @@ export interface Props { layer: ILayer; setLayerQuery: (id: string, query: Query) => void; updateSourceProp: (layerId: string, propName: string, value: unknown) => void; + isFeatureEditorOpenForLayer: boolean; } interface State { @@ -157,6 +158,15 @@ export class FilterEditor extends Component { } _renderQuery() { + if (this.props.isFeatureEditorOpenForLayer) { + return ( + + ); + } + const query = this.props.layer.getQuery(); if (!query || !query.query) { return ( @@ -199,6 +209,7 @@ export class FilterEditor extends Component { onClick={this._toggle} data-test-subj="mapLayerPanelOpenFilterEditorButton" iconType={openButtonIcon} + disabled={this.props.isFeatureEditorOpenForLayer} > {openButtonLabel} @@ -213,6 +224,7 @@ export class FilterEditor extends Component { })} applyGlobalTime={this.props.layer.getSource().getApplyGlobalTime()} setApplyGlobalTime={this._onApplyGlobalTimeChange} + isFeatureEditorOpenForLayer={this.props.isFeatureEditorOpenForLayer} /> ) : null; @@ -244,6 +256,7 @@ export class FilterEditor extends Component { })} applyGlobalQuery={this.props.layer.getSource().getApplyGlobalQuery()} setApplyGlobalQuery={this._onApplyGlobalQueryChange} + isFeatureEditorOpenForLayer={this.props.isFeatureEditorOpenForLayer} /> {globalTimeCheckbox} diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/index.ts b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/index.ts index 7c3db15f10236..51b19e7b05c96 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/index.ts +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/index.ts @@ -10,13 +10,15 @@ import { ThunkDispatch } from 'redux-thunk'; import { connect } from 'react-redux'; import type { Query } from '@kbn/data-plugin/public'; import { FilterEditor } from './filter_editor'; -import { getSelectedLayer } from '../../../selectors/map_selectors'; +import { getEditState, getSelectedLayer } from '../../../selectors/map_selectors'; import { setLayerQuery, updateSourceProp } from '../../../actions'; import { MapStoreState } from '../../../reducers/store'; function mapStateToProps(state: MapStoreState) { + const layer = getSelectedLayer(state)!; return { - layer: getSelectedLayer(state)!, + layer, + isFeatureEditorOpenForLayer: getEditState(state)?.layerId === layer.getId(), }; } diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.tsx index cfa46ecf32b32..2865e2d8099d1 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.tsx @@ -79,6 +79,7 @@ export function JoinEditor({ joins, layer, onChange, leftJoinFields, layerDispla function renderContent() { const disabledReason = layer.getJoinsDisabledReason(); + return disabledReason ? ( {disabledReason} ) : ( diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/__snapshots__/toc_entry.test.tsx.snap b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/__snapshots__/toc_entry.test.tsx.snap index 5beaf12029d2f..cec85cb0e1cd6 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/__snapshots__/toc_entry.test.tsx.snap +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/__snapshots__/toc_entry.test.tsx.snap @@ -11,7 +11,6 @@ exports[`TOCEntry is rendered 1`] = ` > {}, showTOCDetails: () => {}, - editModeActiveForLayer: false, + isFeatureEditorOpenForLayer: false, cancelEditing: () => {}, }; diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx index aeba28cf033bd..65431432d8c6d 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx @@ -31,7 +31,7 @@ export interface ReduxStateProps { hasDirtyStateSelector: boolean; isLegendDetailsOpen: boolean; isEditButtonDisabled: boolean; - editModeActiveForLayer: boolean; + isFeatureEditorOpenForLayer: boolean; } export interface ReduxDispatchProps { @@ -282,7 +282,6 @@ export class TOCEntry extends Component { openLayerSettings={this._openLayerPanelWithCheck} isEditButtonDisabled={this.props.isEditButtonDisabled} supportsFitToBounds={this.state.supportsFitToBounds} - editModeActiveForLayer={this.props.editModeActiveForLayer} /> {this._renderQuickActions()} @@ -317,7 +316,7 @@ export class TOCEntry extends Component { 'mapTocEntry-isSelected': this.props.layer.isPreviewLayer() || (this.props.selectedLayer && this.props.selectedLayer.getId() === this.props.layer.getId()), - 'mapTocEntry-isInEditingMode': this.props.editModeActiveForLayer, + 'mapTocEntry-isInEditingMode': this.props.isFeatureEditorOpenForLayer, }); return ( @@ -334,7 +333,7 @@ export class TOCEntry extends Component { {this._renderCancelModal()} - {this.props.editModeActiveForLayer && ( + {this.props.isFeatureEditorOpenForLayer && (
diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/toc_entry_actions_popover.test.tsx b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/toc_entry_actions_popover.test.tsx index ae62b75400769..cb2697663766a 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/toc_entry_actions_popover.test.tsx +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/toc_entry_actions_popover.test.tsx @@ -48,7 +48,6 @@ const defaultProps = { enableShapeEditing: () => {}, enablePointEditing: () => {}, openLayerSettings: () => {}, - editModeActiveForLayer: false, numLayers: 2, showThisLayerOnly: () => {}, }; @@ -105,9 +104,7 @@ describe('TOCEntryActionsPopover', () => { }); test('should disable Edit features when edit mode active for layer', async () => { - const component = shallow( - - ); + const component = shallow(); // Ensure all promises resolve await new Promise((resolve) => process.nextTick(resolve)); diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/toc_entry_actions_popover.tsx b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/toc_entry_actions_popover.tsx index 3f3b7558409f8..5e33931a8943e 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/toc_entry_actions_popover.tsx +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry_actions_popover/toc_entry_actions_popover.tsx @@ -36,7 +36,6 @@ export interface Props { showThisLayerOnly: (layerId: string) => void; supportsFitToBounds: boolean; toggleVisible: (layerId: string) => void; - editModeActiveForLayer: boolean; numLayers: number; } @@ -90,9 +89,7 @@ export class TOCEntryActionsPopover extends Component { } if ( - (source as ESSearchSource).getApplyGlobalQuery() || (source as ESSearchSource).getSyncMeta().scalingType === SCALING_TYPES.CLUSTERS || - (await vectorLayer.isFilteredByGlobalTime()) || vectorLayer.isPreviewLayer() || !vectorLayer.isVisible() || vectorLayer.hasJoins() @@ -194,9 +191,9 @@ export class TOCEntryActionsPopover extends Component { ? null : i18n.translate('xpack.maps.layerTocActions.editFeaturesTooltip.disabledMessage', { defaultMessage: - 'Edit features only supported for document layers without clustering, term joins, time filtering, or global search.', + 'Edit features is only supported for layers without clustering and term joins', }), - disabled: !this.state.isFeatureEditingEnabled || this.props.editModeActiveForLayer, + disabled: !this.state.isFeatureEditingEnabled, onClick: async () => { this._closePopover(); const supportedShapeTypes = await ( From 4b5c85dc78e2867ef16b7acd8615db4f5d2bd845 Mon Sep 17 00:00:00 2001 From: Esteban Beltran Date: Fri, 29 Apr 2022 17:35:58 +0200 Subject: [PATCH 09/18] =?UTF-8?q?[Actions=20Triggers=20UI]=20Register=20in?= =?UTF-8?q?itial=20alerts=20table=20configuration=20reg=E2=80=A6=20(#13088?= =?UTF-8?q?3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Xavier Mouligneau Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../register_alerts_table_configuration.tsx | 23 +++++++++++++++++++ x-pack/plugins/observability/public/plugin.ts | 8 ++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 x-pack/plugins/observability/public/config/register_alerts_table_configuration.tsx diff --git a/x-pack/plugins/observability/public/config/register_alerts_table_configuration.tsx b/x-pack/plugins/observability/public/config/register_alerts_table_configuration.tsx new file mode 100644 index 0000000000000..1999fe82e3a6d --- /dev/null +++ b/x-pack/plugins/observability/public/config/register_alerts_table_configuration.tsx @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { AlertsTableConfigurationRegistryContract } from '@kbn/triggers-actions-ui-plugin/public'; + +import { observabilityFeatureId } from '../../common'; +import { columns as alertO11yColumns } from '../pages/alerts/containers/alerts_table_t_grid/alerts_table_t_grid'; + +const registerAlertsTableConfiguration = (registry: AlertsTableConfigurationRegistryContract) => { + if (registry.has(observabilityFeatureId)) { + return; + } + registry.register({ + id: observabilityFeatureId, + columns: alertO11yColumns, + }); +}; + +export { registerAlertsTableConfiguration }; diff --git a/x-pack/plugins/observability/public/plugin.ts b/x-pack/plugins/observability/public/plugin.ts index a19c5dfa0c3ce..cb8dcaf2dd7e4 100644 --- a/x-pack/plugins/observability/public/plugin.ts +++ b/x-pack/plugins/observability/public/plugin.ts @@ -32,6 +32,7 @@ import { TriggersAndActionsUIPublicPluginStart, } from '@kbn/triggers-actions-ui-plugin/public'; import { KibanaFeature } from '@kbn/features-plugin/common'; + import { ConfigSchema } from '.'; import { observabilityAppId, observabilityFeatureId, casesPath } from '../common'; import { createLazyObservabilityPageTemplate } from './components/shared'; @@ -144,6 +145,12 @@ export class Plugin const { renderApp } = await import('./application'); // Get start services const [coreStart, pluginsStart, { navigation }] = await coreSetup.getStartServices(); + // Register alerts metadata + const { registerAlertsTableConfiguration } = await import( + './config/register_alerts_table_configuration' + ); + const { alertsTableConfigurationRegistry } = pluginsStart.triggersActionsUi; + registerAlertsTableConfiguration(alertsTableConfigurationRegistry); // The `/api/features` endpoint requires the "Global All" Kibana privilege. Users with a // subset of this privilege are not authorized to access this endpoint and will receive a 404 // error that causes the Alerting view to fail to load. @@ -268,7 +275,6 @@ export class Plugin public start(coreStart: CoreStart, pluginsStart: ObservabilityPublicPluginsStart) { const { application } = coreStart; - const config = this.initializerContext.config.get(); updateGlobalNavigation({ From 78ed6deed4750b149dc4a3cddf12cd1380239f19 Mon Sep 17 00:00:00 2001 From: Dominique Clarke Date: Fri, 29 Apr 2022 11:46:40 -0400 Subject: [PATCH 10/18] synthetics - adjust default monitor values (#131025) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../synthetics/common/constants/index.ts | 1 - .../common/constants/monitor_defaults.ts | 167 ++++++++++++++++++ .../monitor_management/monitor_types.ts | 10 ++ .../fleet_package/common/default_values.ts | 25 --- .../fleet_package/common/normalizers.ts | 16 +- .../contexts/browser_context.tsx | 35 +--- .../contexts/browser_context_advanced.tsx | 16 +- .../fleet_package/contexts/http_context.tsx | 14 +- .../contexts/http_context_advanced.tsx | 21 +-- .../fleet_package/contexts/icmp_context.tsx | 11 +- .../fleet_package/contexts/index.ts | 29 --- .../contexts/policy_config_context.tsx | 2 +- .../fleet_package/contexts/tcp_context.tsx | 13 +- .../contexts/tcp_context_advanced.tsx | 10 +- .../contexts/tls_fields_context.tsx | 4 +- .../fleet_package/hooks/use_policy.ts | 28 +-- .../synthetics_policy_create_extension.tsx | 32 +--- .../fleet_package/tls/default_values.ts | 17 -- .../edit_monitor_config.tsx | 2 +- .../monitor_config/monitor_config.tsx | 5 +- .../formatters/convert_to_data_stream.ts | 2 +- 21 files changed, 220 insertions(+), 240 deletions(-) create mode 100644 x-pack/plugins/synthetics/common/constants/monitor_defaults.ts delete mode 100644 x-pack/plugins/synthetics/public/components/fleet_package/common/default_values.ts delete mode 100644 x-pack/plugins/synthetics/public/components/fleet_package/tls/default_values.ts diff --git a/x-pack/plugins/synthetics/common/constants/index.ts b/x-pack/plugins/synthetics/common/constants/index.ts index c7649d73b8af3..b85cfb0a0d9b6 100644 --- a/x-pack/plugins/synthetics/common/constants/index.ts +++ b/x-pack/plugins/synthetics/common/constants/index.ts @@ -13,4 +13,3 @@ export * from './settings_defaults'; export { QUERY } from './query'; export * from './ui'; export * from './rest_api'; -export const DEFAULT_NAMESPACE_STRING = 'default'; diff --git a/x-pack/plugins/synthetics/common/constants/monitor_defaults.ts b/x-pack/plugins/synthetics/common/constants/monitor_defaults.ts new file mode 100644 index 0000000000000..e7f79fc2086a2 --- /dev/null +++ b/x-pack/plugins/synthetics/common/constants/monitor_defaults.ts @@ -0,0 +1,167 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { + BrowserAdvancedFields, + BrowserSimpleFields, + CommonFields, + DataStream, + HTTPAdvancedFields, + HTTPMethod, + HTTPSimpleFields, + ICMPSimpleFields, + Mode, + MonitorDefaults, + ResponseBodyIndexPolicy, + ScheduleUnit, + ScreenshotOption, + TCPAdvancedFields, + TCPSimpleFields, + TLSFields, + TLSVersion, + VerificationMode, +} from '../runtime_types/monitor_management'; +import { ConfigKey } from './monitor_management'; + +export const DEFAULT_NAMESPACE_STRING = 'default'; + +export const DEFAULT_COMMON_FIELDS: CommonFields = { + [ConfigKey.MONITOR_TYPE]: DataStream.HTTP, + [ConfigKey.ENABLED]: true, + [ConfigKey.SCHEDULE]: { + number: '3', + unit: ScheduleUnit.MINUTES, + }, + [ConfigKey.APM_SERVICE_NAME]: '', + [ConfigKey.TAGS]: [], + [ConfigKey.TIMEOUT]: '16', + [ConfigKey.NAME]: '', + [ConfigKey.LOCATIONS]: [], + [ConfigKey.NAMESPACE]: DEFAULT_NAMESPACE_STRING, +}; + +export const DEFAULT_BROWSER_ADVANCED_FIELDS: BrowserAdvancedFields = { + [ConfigKey.SCREENSHOTS]: ScreenshotOption.ON, + [ConfigKey.SYNTHETICS_ARGS]: [], + [ConfigKey.JOURNEY_FILTERS_MATCH]: '', + [ConfigKey.JOURNEY_FILTERS_TAGS]: [], + [ConfigKey.IGNORE_HTTPS_ERRORS]: false, + [ConfigKey.IS_THROTTLING_ENABLED]: true, + [ConfigKey.DOWNLOAD_SPEED]: '5', + [ConfigKey.UPLOAD_SPEED]: '3', + [ConfigKey.LATENCY]: '20', + [ConfigKey.THROTTLING_CONFIG]: '5d/3u/20l', +}; + +export const DEFAULT_BROWSER_SIMPLE_FIELDS: BrowserSimpleFields = { + ...DEFAULT_COMMON_FIELDS, + [ConfigKey.SCHEDULE]: { + unit: ScheduleUnit.MINUTES, + number: '10', + }, + [ConfigKey.METADATA]: { + script_source: { + is_generated_script: false, + file_name: '', + }, + is_zip_url_tls_enabled: false, + }, + [ConfigKey.MONITOR_TYPE]: DataStream.BROWSER, + [ConfigKey.SOURCE_INLINE]: '', + [ConfigKey.SOURCE_ZIP_URL]: '', + [ConfigKey.SOURCE_ZIP_USERNAME]: '', + [ConfigKey.SOURCE_ZIP_PASSWORD]: '', + [ConfigKey.SOURCE_ZIP_FOLDER]: '', + [ConfigKey.SOURCE_ZIP_PROXY_URL]: '', + [ConfigKey.PARAMS]: '', + [ConfigKey.ZIP_URL_TLS_CERTIFICATE_AUTHORITIES]: undefined, + [ConfigKey.ZIP_URL_TLS_CERTIFICATE]: undefined, + [ConfigKey.ZIP_URL_TLS_KEY]: undefined, + [ConfigKey.ZIP_URL_TLS_KEY_PASSPHRASE]: undefined, + [ConfigKey.ZIP_URL_TLS_VERIFICATION_MODE]: undefined, + [ConfigKey.ZIP_URL_TLS_VERSION]: undefined, + [ConfigKey.URLS]: undefined, + [ConfigKey.PORT]: undefined, +}; + +export const DEFAULT_HTTP_SIMPLE_FIELDS: HTTPSimpleFields = { + ...DEFAULT_COMMON_FIELDS, + [ConfigKey.METADATA]: { + is_tls_enabled: false, + }, + [ConfigKey.URLS]: '', + [ConfigKey.MAX_REDIRECTS]: '0', + [ConfigKey.MONITOR_TYPE]: DataStream.HTTP, +}; + +export const DEFAULT_HTTP_ADVANCED_FIELDS: HTTPAdvancedFields = { + [ConfigKey.PASSWORD]: '', + [ConfigKey.PROXY_URL]: '', + [ConfigKey.RESPONSE_BODY_CHECK_NEGATIVE]: [], + [ConfigKey.RESPONSE_BODY_CHECK_POSITIVE]: [], + [ConfigKey.RESPONSE_BODY_INDEX]: ResponseBodyIndexPolicy.ON_ERROR, + [ConfigKey.RESPONSE_HEADERS_CHECK]: {}, + [ConfigKey.RESPONSE_HEADERS_INDEX]: true, + [ConfigKey.RESPONSE_STATUS_CHECK]: [], + [ConfigKey.REQUEST_BODY_CHECK]: { + value: '', + type: Mode.PLAINTEXT, + }, + [ConfigKey.REQUEST_HEADERS_CHECK]: {}, + [ConfigKey.REQUEST_METHOD_CHECK]: HTTPMethod.GET, + [ConfigKey.USERNAME]: '', +}; + +export const DEFAULT_ICMP_SIMPLE_FIELDS: ICMPSimpleFields = { + ...DEFAULT_COMMON_FIELDS, + [ConfigKey.HOSTS]: '', + [ConfigKey.MONITOR_TYPE]: DataStream.ICMP, + [ConfigKey.WAIT]: '1', +}; + +export const DEFAULT_TCP_SIMPLE_FIELDS: TCPSimpleFields = { + ...DEFAULT_COMMON_FIELDS, + [ConfigKey.METADATA]: { + is_tls_enabled: false, + }, + [ConfigKey.HOSTS]: '', + [ConfigKey.MONITOR_TYPE]: DataStream.TCP, +}; + +export const DEFAULT_TCP_ADVANCED_FIELDS: TCPAdvancedFields = { + [ConfigKey.PROXY_URL]: '', + [ConfigKey.PROXY_USE_LOCAL_RESOLVER]: false, + [ConfigKey.RESPONSE_RECEIVE_CHECK]: '', + [ConfigKey.REQUEST_SEND_CHECK]: '', +}; + +export const DEFAULT_TLS_FIELDS: TLSFields = { + [ConfigKey.TLS_CERTIFICATE_AUTHORITIES]: '', + [ConfigKey.TLS_CERTIFICATE]: '', + [ConfigKey.TLS_KEY]: '', + [ConfigKey.TLS_KEY_PASSPHRASE]: '', + [ConfigKey.TLS_VERIFICATION_MODE]: VerificationMode.FULL, + [ConfigKey.TLS_VERSION]: [TLSVersion.ONE_ONE, TLSVersion.ONE_TWO, TLSVersion.ONE_THREE], +}; + +export const DEFAULT_FIELDS: MonitorDefaults = { + [DataStream.HTTP]: { + ...DEFAULT_HTTP_SIMPLE_FIELDS, + ...DEFAULT_HTTP_ADVANCED_FIELDS, + ...DEFAULT_TLS_FIELDS, + }, + [DataStream.TCP]: { + ...DEFAULT_TCP_SIMPLE_FIELDS, + ...DEFAULT_TCP_ADVANCED_FIELDS, + ...DEFAULT_TLS_FIELDS, + }, + [DataStream.ICMP]: DEFAULT_ICMP_SIMPLE_FIELDS, + [DataStream.BROWSER]: { + ...DEFAULT_BROWSER_SIMPLE_FIELDS, + ...DEFAULT_BROWSER_ADVANCED_FIELDS, + ...DEFAULT_TLS_FIELDS, + }, +}; diff --git a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/monitor_types.ts b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/monitor_types.ts index c093705e858d8..0e96b8b9de6e2 100644 --- a/x-pack/plugins/synthetics/common/runtime_types/monitor_management/monitor_types.ts +++ b/x-pack/plugins/synthetics/common/runtime_types/monitor_management/monitor_types.ts @@ -10,6 +10,7 @@ import { secretKeys } from '../../constants/monitor_management'; import { ConfigKey } from './config_key'; import { MonitorServiceLocationsCodec, ServiceLocationErrors } from './locations'; import { + DataStream, DataStreamCodec, ModeCodec, ResponseBodyIndexPolicyCodec, @@ -308,6 +309,15 @@ export type EncryptedSyntheticsMonitorWithId = t.TypeOf< typeof EncryptedSyntheticsMonitorWithIdCodec >; +export const MonitorDefaultsCodec = t.interface({ + [DataStream.HTTP]: HTTPFieldsCodec, + [DataStream.TCP]: TCPFieldsCodec, + [DataStream.ICMP]: ICMPSimpleFieldsCodec, + [DataStream.BROWSER]: BrowserFieldsCodec, +}); + +export type MonitorDefaults = t.TypeOf; + export const MonitorManagementListResultCodec = t.type({ monitors: t.array( t.interface({ diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/common/default_values.ts b/x-pack/plugins/synthetics/public/components/fleet_package/common/default_values.ts deleted file mode 100644 index 54c6969833cf1..0000000000000 --- a/x-pack/plugins/synthetics/public/components/fleet_package/common/default_values.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { DEFAULT_NAMESPACE_STRING } from '../../../../common/constants'; -import { CommonFields, ConfigKey, ScheduleUnit, DataStream } from '../types'; - -export const defaultValues: CommonFields = { - [ConfigKey.MONITOR_TYPE]: DataStream.HTTP, - [ConfigKey.LOCATIONS]: [], - [ConfigKey.ENABLED]: true, - [ConfigKey.SCHEDULE]: { - number: '3', - unit: ScheduleUnit.MINUTES, - }, - [ConfigKey.APM_SERVICE_NAME]: '', - [ConfigKey.TAGS]: [], - [ConfigKey.TIMEOUT]: '16', - [ConfigKey.NAME]: '', - [ConfigKey.LOCATIONS]: [], - [ConfigKey.NAMESPACE]: DEFAULT_NAMESPACE_STRING, -}; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/common/normalizers.ts b/x-pack/plugins/synthetics/public/components/fleet_package/common/normalizers.ts index 8f1b7ad230d9c..3cb312488868c 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/common/normalizers.ts +++ b/x-pack/plugins/synthetics/public/components/fleet_package/common/normalizers.ts @@ -7,9 +7,11 @@ import { NewPackagePolicyInput } from '@kbn/fleet-plugin/common'; import { CommonFields, ConfigKey, DataStream } from '../types'; -import { defaultValues as commonDefaultValues } from './default_values'; -import { DEFAULT_NAMESPACE_STRING } from '../../../../common/constants'; -import { defaultConfig } from '../contexts'; +import { + DEFAULT_COMMON_FIELDS, + DEFAULT_NAMESPACE_STRING, + DEFAULT_FIELDS, +} from '../../../../common/constants/monitor_defaults'; // TO DO: create a standard input format that all fields resolve to export type Normalizer = (fields: NewPackagePolicyInput['vars']) => unknown; @@ -46,15 +48,15 @@ export function getCronNormalizer(key: string, defaultValues: Fields): N } export const getCommonNormalizer = (key: ConfigKey) => { - return getNormalizer(key, commonDefaultValues); + return getNormalizer(key, DEFAULT_COMMON_FIELDS); }; export const getCommonjsonToJavascriptNormalizer = (key: ConfigKey) => { - return getJsonToJavascriptNormalizer(key, commonDefaultValues); + return getJsonToJavascriptNormalizer(key, DEFAULT_COMMON_FIELDS); }; export const getCommonCronToSecondsNormalizer = (key: ConfigKey) => { - return getCronNormalizer(key, commonDefaultValues); + return getCronNormalizer(key, DEFAULT_COMMON_FIELDS); }; export const commonNormalizers: CommonNormalizerMap = { @@ -76,7 +78,7 @@ export const commonNormalizers: CommonNormalizerMap = { number, }; } else { - return defaultConfig[type][ConfigKey.SCHEDULE]; + return DEFAULT_FIELDS[type][ConfigKey.SCHEDULE]; } }, [ConfigKey.APM_SERVICE_NAME]: getCommonNormalizer(ConfigKey.APM_SERVICE_NAME), diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_context.tsx b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_context.tsx index f7b67488e4bcc..aecd9091c3276 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_context.tsx +++ b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_context.tsx @@ -6,8 +6,8 @@ */ import React, { createContext, useContext, useMemo, useState } from 'react'; -import { BrowserSimpleFields, ConfigKey, DataStream, ScheduleUnit } from '../types'; -import { defaultValues as commonDefaultValues } from '../common/default_values'; +import { BrowserSimpleFields } from '../types'; +import { DEFAULT_BROWSER_SIMPLE_FIELDS } from '../../../../common/constants/monitor_defaults'; interface BrowserSimpleFieldsContext { setFields: React.Dispatch>; @@ -20,36 +20,7 @@ interface BrowserSimpleFieldsContextProvider { defaultValues?: BrowserSimpleFields; } -export const initialValues: BrowserSimpleFields = { - ...commonDefaultValues, - [ConfigKey.SCHEDULE]: { - unit: ScheduleUnit.MINUTES, - number: '10', - }, - [ConfigKey.METADATA]: { - script_source: { - is_generated_script: false, - file_name: '', - }, - is_zip_url_tls_enabled: false, - }, - [ConfigKey.MONITOR_TYPE]: DataStream.BROWSER, - [ConfigKey.SOURCE_ZIP_URL]: '', - [ConfigKey.SOURCE_ZIP_USERNAME]: '', - [ConfigKey.SOURCE_ZIP_PASSWORD]: '', - [ConfigKey.SOURCE_ZIP_FOLDER]: '', - [ConfigKey.SOURCE_ZIP_PROXY_URL]: '', - [ConfigKey.SOURCE_INLINE]: '', - [ConfigKey.PARAMS]: '', - [ConfigKey.ZIP_URL_TLS_CERTIFICATE_AUTHORITIES]: undefined, - [ConfigKey.ZIP_URL_TLS_CERTIFICATE]: undefined, - [ConfigKey.ZIP_URL_TLS_KEY]: undefined, - [ConfigKey.ZIP_URL_TLS_KEY_PASSPHRASE]: undefined, - [ConfigKey.ZIP_URL_TLS_VERIFICATION_MODE]: undefined, - [ConfigKey.ZIP_URL_TLS_VERSION]: undefined, - [ConfigKey.URLS]: undefined, - [ConfigKey.PORT]: undefined, -}; +export const initialValues: BrowserSimpleFields = DEFAULT_BROWSER_SIMPLE_FIELDS; const defaultContext: BrowserSimpleFieldsContext = { setFields: (_fields: React.SetStateAction) => { diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_context_advanced.tsx b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_context_advanced.tsx index 3ddd7953a6310..114491d890394 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_context_advanced.tsx +++ b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_context_advanced.tsx @@ -6,7 +6,8 @@ */ import React, { createContext, useContext, useMemo, useState } from 'react'; -import { BrowserAdvancedFields, ConfigKey, ScreenshotOption } from '../types'; +import { BrowserAdvancedFields } from '../types'; +import { DEFAULT_BROWSER_ADVANCED_FIELDS } from '../../../../common/constants/monitor_defaults'; interface BrowserAdvancedFieldsContext { setFields: React.Dispatch>; @@ -19,18 +20,7 @@ interface BrowserAdvancedFieldsContextProvider { defaultValues?: BrowserAdvancedFields; } -export const initialValues: BrowserAdvancedFields = { - [ConfigKey.SCREENSHOTS]: ScreenshotOption.ON, - [ConfigKey.SYNTHETICS_ARGS]: [], - [ConfigKey.JOURNEY_FILTERS_MATCH]: '', - [ConfigKey.JOURNEY_FILTERS_TAGS]: [], - [ConfigKey.IGNORE_HTTPS_ERRORS]: false, - [ConfigKey.IS_THROTTLING_ENABLED]: true, - [ConfigKey.DOWNLOAD_SPEED]: '5', - [ConfigKey.UPLOAD_SPEED]: '3', - [ConfigKey.LATENCY]: '20', - [ConfigKey.THROTTLING_CONFIG]: '5d/3u/20l', -}; +export const initialValues: BrowserAdvancedFields = DEFAULT_BROWSER_ADVANCED_FIELDS; const defaultContext: BrowserAdvancedFieldsContext = { setFields: (_fields: React.SetStateAction) => { diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_context.tsx b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_context.tsx index a4a0c7bb16aa8..092c938b63f7e 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_context.tsx +++ b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_context.tsx @@ -6,8 +6,8 @@ */ import React, { createContext, useContext, useMemo, useState } from 'react'; -import { HTTPSimpleFields, ConfigKey, DataStream } from '../types'; -import { defaultValues as commonDefaultValues } from '../common/default_values'; +import { HTTPSimpleFields } from '../types'; +import { DEFAULT_HTTP_SIMPLE_FIELDS } from '../../../../common/constants/monitor_defaults'; interface HTTPSimpleFieldsContext { setFields: React.Dispatch>; @@ -20,15 +20,7 @@ interface HTTPSimpleFieldsContextProvider { defaultValues?: HTTPSimpleFields; } -export const initialValues: HTTPSimpleFields = { - ...commonDefaultValues, - [ConfigKey.METADATA]: { - is_tls_enabled: false, - }, - [ConfigKey.URLS]: '', - [ConfigKey.MAX_REDIRECTS]: '0', - [ConfigKey.MONITOR_TYPE]: DataStream.HTTP, -}; +export const initialValues: HTTPSimpleFields = DEFAULT_HTTP_SIMPLE_FIELDS; const defaultContext: HTTPSimpleFieldsContext = { setFields: (_fields: React.SetStateAction) => { diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_context_advanced.tsx b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_context_advanced.tsx index 4d64bd3cf1ad4..19355d38b9486 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_context_advanced.tsx +++ b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_context_advanced.tsx @@ -6,7 +6,8 @@ */ import React, { createContext, useContext, useMemo, useState } from 'react'; -import { HTTPAdvancedFields, ConfigKey, Mode, ResponseBodyIndexPolicy, HTTPMethod } from '../types'; +import { HTTPAdvancedFields } from '../types'; +import { DEFAULT_HTTP_ADVANCED_FIELDS } from '../../../../common/constants/monitor_defaults'; interface HTTPAdvancedFieldsContext { setFields: React.Dispatch>; @@ -19,23 +20,7 @@ interface HTTPAdvancedFieldsContextProvider { defaultValues?: HTTPAdvancedFields; } -export const initialValues: HTTPAdvancedFields = { - [ConfigKey.PASSWORD]: '', - [ConfigKey.PROXY_URL]: '', - [ConfigKey.RESPONSE_BODY_CHECK_NEGATIVE]: [], - [ConfigKey.RESPONSE_BODY_CHECK_POSITIVE]: [], - [ConfigKey.RESPONSE_BODY_INDEX]: ResponseBodyIndexPolicy.ON_ERROR, - [ConfigKey.RESPONSE_HEADERS_CHECK]: {}, - [ConfigKey.RESPONSE_HEADERS_INDEX]: true, - [ConfigKey.RESPONSE_STATUS_CHECK]: [], - [ConfigKey.REQUEST_BODY_CHECK]: { - value: '', - type: Mode.PLAINTEXT, - }, - [ConfigKey.REQUEST_HEADERS_CHECK]: {}, - [ConfigKey.REQUEST_METHOD_CHECK]: HTTPMethod.GET, - [ConfigKey.USERNAME]: '', -}; +export const initialValues: HTTPAdvancedFields = DEFAULT_HTTP_ADVANCED_FIELDS; export const defaultContext: HTTPAdvancedFieldsContext = { setFields: (_fields: React.SetStateAction) => { diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/icmp_context.tsx b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/icmp_context.tsx index f0547e621afc4..39409e4ed76a5 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/icmp_context.tsx +++ b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/icmp_context.tsx @@ -6,8 +6,8 @@ */ import React, { createContext, useContext, useMemo, useState } from 'react'; -import { ICMPSimpleFields, ConfigKey, DataStream } from '../types'; -import { defaultValues as commonDefaultValues } from '../common/default_values'; +import { ICMPSimpleFields } from '../types'; +import { DEFAULT_ICMP_SIMPLE_FIELDS } from '../../../../common/constants/monitor_defaults'; interface ICMPSimpleFieldsContext { setFields: React.Dispatch>; @@ -20,12 +20,7 @@ interface ICMPSimpleFieldsContextProvider { defaultValues?: ICMPSimpleFields; } -export const initialValues: ICMPSimpleFields = { - ...commonDefaultValues, - [ConfigKey.HOSTS]: '', - [ConfigKey.MONITOR_TYPE]: DataStream.ICMP, - [ConfigKey.WAIT]: '1', -}; +export const initialValues: ICMPSimpleFields = DEFAULT_ICMP_SIMPLE_FIELDS; const defaultContext: ICMPSimpleFieldsContext = { setFields: (_fields: React.SetStateAction) => { diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/index.ts b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/index.ts index 3f392c42983b6..a80e295e8bc40 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/index.ts +++ b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/index.ts @@ -4,16 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { DataStream, PolicyConfig } from '../types'; -import { initialValues as defaultHTTPSimpleFields } from './http_context'; -import { initialValues as defaultHTTPAdvancedFields } from './http_context_advanced'; -import { initialValues as defaultTCPSimpleFields } from './tcp_context'; -import { initialValues as defaultICMPSimpleFields } from './icmp_context'; -import { initialValues as defaultTCPAdvancedFields } from './tcp_context_advanced'; -import { initialValues as defaultBrowserSimpleFields } from './browser_context'; -import { initialValues as defaultBrowserAdvancedFields } from './browser_context_advanced'; -import { initialValues as defaultTLSFields } from './tls_fields_context'; - export type { IPolicyConfigContextProvider } from './policy_config_context'; export { PolicyConfigContext, @@ -74,22 +64,3 @@ export { HTTPContextProvider } from './http_provider'; export { TCPContextProvider } from './tcp_provider'; export { BrowserContextProvider } from './browser_provider'; export { SyntheticsProviders } from './synthetics_context_providers'; - -export const defaultConfig: PolicyConfig = { - [DataStream.HTTP]: { - ...defaultHTTPSimpleFields, - ...defaultHTTPAdvancedFields, - ...defaultTLSFields, - }, - [DataStream.TCP]: { - ...defaultTCPSimpleFields, - ...defaultTCPAdvancedFields, - ...defaultTLSFields, - }, - [DataStream.ICMP]: defaultICMPSimpleFields, - [DataStream.BROWSER]: { - ...defaultBrowserSimpleFields, - ...defaultBrowserAdvancedFields, - ...defaultTLSFields, - }, -}; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/policy_config_context.tsx b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/policy_config_context.tsx index 5d47b4e9d0984..a9d5df172d83c 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/policy_config_context.tsx +++ b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/policy_config_context.tsx @@ -6,7 +6,7 @@ */ import React, { createContext, useContext, useMemo, useState } from 'react'; -import { DEFAULT_NAMESPACE_STRING } from '../../../../common/constants'; +import { DEFAULT_NAMESPACE_STRING } from '../../../../common/constants/monitor_defaults'; import { ScheduleUnit, MonitorServiceLocations, diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_context.tsx b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_context.tsx index 38a15c3e39453..ca6788f380118 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_context.tsx +++ b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_context.tsx @@ -6,8 +6,8 @@ */ import React, { createContext, useContext, useMemo, useState } from 'react'; -import { TCPSimpleFields, ConfigKey, DataStream } from '../types'; -import { defaultValues as commonDefaultValues } from '../common/default_values'; +import { TCPSimpleFields } from '../types'; +import { DEFAULT_TCP_SIMPLE_FIELDS } from '../../../../common/constants/monitor_defaults'; interface TCPSimpleFieldsContext { setFields: React.Dispatch>; @@ -20,14 +20,7 @@ interface TCPSimpleFieldsContextProvider { defaultValues?: TCPSimpleFields; } -export const initialValues: TCPSimpleFields = { - ...commonDefaultValues, - [ConfigKey.METADATA]: { - is_tls_enabled: false, - }, - [ConfigKey.HOSTS]: '', - [ConfigKey.MONITOR_TYPE]: DataStream.TCP, -}; +export const initialValues: TCPSimpleFields = DEFAULT_TCP_SIMPLE_FIELDS; const defaultContext: TCPSimpleFieldsContext = { setFields: (_fields: React.SetStateAction) => { diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_context_advanced.tsx b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_context_advanced.tsx index 7fe29f7648841..0a26cb83d9aa0 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_context_advanced.tsx +++ b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_context_advanced.tsx @@ -6,7 +6,8 @@ */ import React, { createContext, useContext, useMemo, useState } from 'react'; -import { TCPAdvancedFields, ConfigKey } from '../types'; +import { TCPAdvancedFields } from '../types'; +import { DEFAULT_TCP_ADVANCED_FIELDS } from '../../../../common/constants/monitor_defaults'; interface TCPAdvancedFieldsContext { setFields: React.Dispatch>; @@ -19,12 +20,7 @@ interface TCPAdvancedFieldsContextProvider { defaultValues?: TCPAdvancedFields; } -export const initialValues: TCPAdvancedFields = { - [ConfigKey.PROXY_URL]: '', - [ConfigKey.PROXY_USE_LOCAL_RESOLVER]: false, - [ConfigKey.RESPONSE_RECEIVE_CHECK]: '', - [ConfigKey.REQUEST_SEND_CHECK]: '', -}; +export const initialValues: TCPAdvancedFields = DEFAULT_TCP_ADVANCED_FIELDS; const defaultContext: TCPAdvancedFieldsContext = { setFields: (_fields: React.SetStateAction) => { diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tls_fields_context.tsx b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tls_fields_context.tsx index a76655a235c4f..7ed41694000b9 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tls_fields_context.tsx +++ b/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tls_fields_context.tsx @@ -7,7 +7,7 @@ import React, { createContext, useContext, useMemo, useState } from 'react'; import { TLSFields } from '../types'; -import { defaultValues as tlsDefaultValues } from '../tls/default_values'; +import { DEFAULT_TLS_FIELDS } from '../../../../common/constants/monitor_defaults'; interface TLSFieldsContext { setFields: React.Dispatch>; @@ -20,7 +20,7 @@ interface TLSFieldsContextProvider { defaultValues?: TLSFields; } -export const initialValues: TLSFields = tlsDefaultValues; +export const initialValues: TLSFields = DEFAULT_TLS_FIELDS; const defaultContext: TLSFieldsContext = { setFields: (_fields: React.SetStateAction) => { diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/hooks/use_policy.ts b/x-pack/plugins/synthetics/public/components/fleet_package/hooks/use_policy.ts index 2fc33de1bab39..8cef83a925515 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/hooks/use_policy.ts +++ b/x-pack/plugins/synthetics/public/components/fleet_package/hooks/use_policy.ts @@ -25,34 +25,10 @@ import { useTLSFieldsContext, useBrowserSimpleFieldsContext, useBrowserAdvancedFieldsContext, - defaultHTTPAdvancedFields, - defaultHTTPSimpleFields, - defaultICMPSimpleFields, - defaultTCPSimpleFields, - defaultTCPAdvancedFields, - defaultBrowserSimpleFields, - defaultBrowserAdvancedFields, - defaultTLSFields, } from '../contexts'; +import { DEFAULT_FIELDS } from '../../../../common/constants/monitor_defaults'; -export const defaultConfig: PolicyConfig = { - [DataStream.HTTP]: { - ...defaultHTTPSimpleFields, - ...defaultHTTPAdvancedFields, - ...defaultTLSFields, - }, - [DataStream.TCP]: { - ...defaultTCPSimpleFields, - ...defaultTCPAdvancedFields, - ...defaultTLSFields, - }, - [DataStream.ICMP]: defaultICMPSimpleFields, - [DataStream.BROWSER]: { - ...defaultBrowserSimpleFields, - ...defaultBrowserAdvancedFields, - ...defaultTLSFields, - }, -}; +export const defaultConfig: PolicyConfig = DEFAULT_FIELDS; export const usePolicy = (fleetPolicyName: string = '') => { const { diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_create_extension.tsx b/x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_create_extension.tsx index e93cc20e4d2ad..ae035550a979d 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_create_extension.tsx +++ b/x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_create_extension.tsx @@ -10,40 +10,14 @@ import { PackagePolicyCreateExtensionComponentProps } from '@kbn/fleet-plugin/pu import { useTrackPageview } from '@kbn/observability-plugin/public'; import { DataStream } from './types'; import { PolicyConfig } from './types'; -import { - usePolicyConfigContext, - defaultHTTPSimpleFields, - defaultHTTPAdvancedFields, - defaultTCPSimpleFields, - defaultTCPAdvancedFields, - defaultICMPSimpleFields, - defaultBrowserSimpleFields, - defaultBrowserAdvancedFields, - defaultTLSFields, -} from './contexts'; +import { usePolicyConfigContext } from './contexts'; +import { DEFAULT_FIELDS } from '../../../common/constants/monitor_defaults'; import { CustomFields } from './custom_fields'; import { useUpdatePolicy } from './hooks/use_update_policy'; import { usePolicy } from './hooks/use_policy'; import { validate } from './validation'; -export const defaultConfig: PolicyConfig = { - [DataStream.HTTP]: { - ...defaultHTTPSimpleFields, - ...defaultHTTPAdvancedFields, - ...defaultTLSFields, - }, - [DataStream.TCP]: { - ...defaultTCPSimpleFields, - ...defaultTCPAdvancedFields, - ...defaultTLSFields, - }, - [DataStream.ICMP]: defaultICMPSimpleFields, - [DataStream.BROWSER]: { - ...defaultBrowserSimpleFields, - ...defaultBrowserAdvancedFields, - ...defaultTLSFields, - }, -}; +export const defaultConfig: PolicyConfig = DEFAULT_FIELDS; /** * Exports Synthetics-specific package policy instructions diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/tls/default_values.ts b/x-pack/plugins/synthetics/public/components/fleet_package/tls/default_values.ts deleted file mode 100644 index 18f291ce20f35..0000000000000 --- a/x-pack/plugins/synthetics/public/components/fleet_package/tls/default_values.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { TLSFields, ConfigKey, VerificationMode, TLSVersion } from '../types'; - -export const defaultValues: TLSFields = { - [ConfigKey.TLS_CERTIFICATE_AUTHORITIES]: '', - [ConfigKey.TLS_CERTIFICATE]: '', - [ConfigKey.TLS_KEY]: '', - [ConfigKey.TLS_KEY_PASSPHRASE]: '', - [ConfigKey.TLS_VERIFICATION_MODE]: VerificationMode.FULL, - [ConfigKey.TLS_VERSION]: [TLSVersion.ONE_ONE, TLSVersion.ONE_TWO, TLSVersion.ONE_THREE], -}; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/edit_monitor_config.tsx b/x-pack/plugins/synthetics/public/components/monitor_management/edit_monitor_config.tsx index 28e0bb105e29a..6c8056c246071 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/edit_monitor_config.tsx +++ b/x-pack/plugins/synthetics/public/components/monitor_management/edit_monitor_config.tsx @@ -18,7 +18,7 @@ import { import { SyntheticsProviders } from '../fleet_package/contexts'; import { PolicyConfig } from '../fleet_package/types'; import { MonitorConfig } from './monitor_config/monitor_config'; -import { DEFAULT_NAMESPACE_STRING } from '../../../common/constants'; +import { DEFAULT_NAMESPACE_STRING } from '../../../common/constants/monitor_defaults'; interface Props { monitor: MonitorFields; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_config.tsx b/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_config.tsx index 8b62b7cde145f..f151d31e3fd98 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_config.tsx +++ b/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_config.tsx @@ -17,7 +17,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { v4 as uuidv4 } from 'uuid'; -import { defaultConfig, usePolicyConfigContext } from '../../fleet_package/contexts'; +import { usePolicyConfigContext } from '../../fleet_package/contexts'; import { usePolicy } from '../../fleet_package/hooks/use_policy'; import { validate } from '../validation'; @@ -26,6 +26,7 @@ import { useFormatMonitor } from '../hooks/use_format_monitor'; import { MonitorFields } from './monitor_fields'; import { TestNowMode, TestRun } from '../test_now_mode/test_now_mode'; import { MonitorFields as MonitorFieldsType } from '../../../../common/runtime_types'; +import { DEFAULT_FIELDS } from '../../../../common/constants/monitor_defaults'; export const MonitorConfig = ({ isEdit = false }: { isEdit: boolean }) => { const { monitorType } = usePolicyConfigContext(); @@ -41,7 +42,7 @@ export const MonitorConfig = ({ isEdit = false }: { isEdit: boolean }) => { monitorType, validate, config: policyConfig[monitorType], - defaultConfig: defaultConfig[monitorType], + defaultConfig: DEFAULT_FIELDS[monitorType], }); const [hasBeenSubmitted, setHasBeenSubmitted] = useState(false); diff --git a/x-pack/plugins/synthetics/server/lib/synthetics_service/formatters/convert_to_data_stream.ts b/x-pack/plugins/synthetics/server/lib/synthetics_service/formatters/convert_to_data_stream.ts index 7d518b189afef..52ae921c78643 100644 --- a/x-pack/plugins/synthetics/server/lib/synthetics_service/formatters/convert_to_data_stream.ts +++ b/x-pack/plugins/synthetics/server/lib/synthetics_service/formatters/convert_to_data_stream.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { DEFAULT_NAMESPACE_STRING } from '../../../../common/constants'; +import { DEFAULT_NAMESPACE_STRING } from '../../../../common/constants/monitor_defaults'; import { DataStream, MonitorFields } from '../../../../common/runtime_types'; interface DataStreamConfig { From f476109d57002189693cca9a6a0eb038c2c08585 Mon Sep 17 00:00:00 2001 From: Esteban Beltran Date: Fri, 29 Apr 2022 17:50:56 +0200 Subject: [PATCH 11/18] Fix double registry bug (#131239) --- .../register_alerts_table_configuration.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x-pack/plugins/security_solution/public/common/lib/triggers_actions_ui/register_alerts_table_configuration.tsx b/x-pack/plugins/security_solution/public/common/lib/triggers_actions_ui/register_alerts_table_configuration.tsx index 1771654780fea..3a1bcee1eed51 100644 --- a/x-pack/plugins/security_solution/public/common/lib/triggers_actions_ui/register_alerts_table_configuration.tsx +++ b/x-pack/plugins/security_solution/public/common/lib/triggers_actions_ui/register_alerts_table_configuration.tsx @@ -17,6 +17,9 @@ const registerAlertsTableConfiguration = ( registry: AlertsTableConfigurationRegistryContract, storage: Storage ) => { + if (registry.has(APP_ID)) { + return; + } const timelineStorage = getTimelinesInStorageByIds(storage, [TimelineId.detectionsPage]); const alertColumns = timelineStorage?.[TimelineId.detectionsPage]?.columns ?? columns; registry.register({ From 7c8e144dd1a901e26d59e678d7d09af60bfa2084 Mon Sep 17 00:00:00 2001 From: Yuliia Naumenko Date: Fri, 29 Apr 2022 10:00:28 -0700 Subject: [PATCH 12/18] [Security Solution] Migrated Users search strategy to fields API (#130213) * [Security Solution] Migrated Users search strategy to fields API * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * fixed tests * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * fixed tests * fixed tests * merge fix * fixed tests * fixed tests * fixed tests * fixed tests * fixed tests Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../users/authentications/index.ts | 2 +- .../security_solution/users/common/index.ts | 2 +- .../factory/users/all/__mocks__/index.ts | 16 +- .../all/__snapshots__/index.test.ts.snap | 4 +- .../query.all_users.dsl.test.ts.snap | 13 +- .../factory/users/all/index.ts | 2 +- .../factory/users/all/query.all_users.dsl.ts | 16 +- .../users/authentications/__mocks__/index.ts | 1690 ++--------------- .../users/authentications/dsl/query.dsl.ts | 36 +- .../users/authentications/helpers.test.ts | 17 +- .../factory/users/authentications/helpers.ts | 115 +- .../factory/users/authentications/index.tsx | 6 +- .../factory/users/details/__mocks__/index.ts | 6 - 13 files changed, 236 insertions(+), 1689 deletions(-) diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/authentications/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/authentications/index.ts index c412c96204138..be60776e683f4 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/authentications/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/authentications/index.ts @@ -59,7 +59,7 @@ export interface LastSourceHost { } export interface AuthenticationHit extends Hit { - _source: { + fields: { '@timestamp': string; lastSuccess?: LastSourceHost; lastFailure?: LastSourceHost; diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/common/index.ts b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/common/index.ts index 9b9d3028594d3..9f3a2e94e7e13 100644 --- a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/common/index.ts +++ b/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/common/index.ts @@ -67,7 +67,7 @@ export interface AllUsersAggEsItem { export interface UsersDomainHitsItem { hits: { hits: Array<{ - _source: { user: { domain: Maybe } }; + fields: { user: { domain: Maybe } }; }>; }; } diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__mocks__/index.ts index bc31f64fcc626..346c8845751ce 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__mocks__/index.ts @@ -13,12 +13,6 @@ import { UsersFields } from '../../../../../../../common/search_strategy/securit export const mockOptions: UsersRequestOptions = { defaultIndex: ['test_indices*'], - docValueFields: [ - { - field: '@timestamp', - format: 'date_time', - }, - ], factoryQueryType: UsersQueries.users, filterQuery: '{"bool":{"must":[],"filter":[{"match_all":{}},{"match_phrase":{"user.name":{"query":"test_user"}}}],"should":[],"must_not":[]}}', @@ -78,10 +72,12 @@ export const mockSearchStrategyResponse: IEsSearchResponse = { _index: 'endgame-00001', _id: 'inT0934BjUd1_U2597Vf', _score: null, - _source: { - user: { - domain: 'ENDPOINT-W-8-03', - }, + fields: { + 'user.name': ['jose52'], + '@timestamp': ['2022-04-13T17:16:34.540Z'], + 'user.id': ['17'], + 'user.email': ['jose52@barrett.com'], + 'user.domain': ['ENDPOINT-W-8-03'], }, sort: [1644837532000], }, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/index.test.ts.snap b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/index.test.ts.snap index b52d0b1fc1cfd..6383808293a9d 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/index.test.ts.snap +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/index.test.ts.snap @@ -3,7 +3,9 @@ exports[`allHosts search strategy parse should parse data correctly 1`] = ` Array [ Object { - "domain": "ENDPOINT-W-8-03", + "domain": Array [ + "ENDPOINT-W-8-03", + ], "lastSeen": "2022-02-14T11:18:52.000Z", "name": "vagrant", }, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/query.all_users.dsl.test.ts.snap b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/query.all_users.dsl.test.ts.snap index 99f85724d2f5c..2b661fe355a13 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/query.all_users.dsl.test.ts.snap +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/query.all_users.dsl.test.ts.snap @@ -4,6 +4,7 @@ exports[`buildUsersQuery build query from options correctly 1`] = ` Object { "allow_no_indices": true, "body": Object { + "_source": false, "aggregations": Object { "user_count": Object { "cardinality": Object { @@ -14,11 +15,7 @@ Object { "aggs": Object { "domain": Object { "top_hits": Object { - "_source": Object { - "includes": Array [ - "user.domain", - ], - }, + "_source": false, "size": 1, "sort": Array [ Object { @@ -44,10 +41,12 @@ Object { }, }, }, - "docvalue_fields": Array [ + "fields": Array [ + "user.name", + "user.domain", Object { "field": "@timestamp", - "format": "date_time", + "format": "strict_date_optional_time", }, ], "query": Object { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts index b8babe0b19845..9c62e55cc0bb1 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts @@ -50,7 +50,7 @@ export const allUsers: SecuritySolutionFactory = { (bucket: AllUsersAggEsItem) => ({ name: bucket.key, lastSeen: getOr(null, `lastSeen.value_as_string`, bucket), - domain: getOr(null, `domain.hits.hits[0]._source.user.domain`, bucket), + domain: getOr(null, `domain.hits.hits[0].fields['user.domain']`, bucket), }), {} ); diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.ts index 82df1d2d97246..d7f8f7e50abe1 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.ts @@ -5,7 +5,6 @@ * 2.0. */ -import { isEmpty } from 'lodash/fp'; import type { ISearchRequestParams } from '@kbn/data-plugin/common'; import { Direction } from '../../../../../../common/search_strategy'; import { createQueryFilterClauses } from '../../../../../utils/build_query'; @@ -18,7 +17,6 @@ import { assertUnreachable } from '../../../../../../common/utility_types'; export const buildUsersQuery = ({ defaultIndex, - docValueFields, filterQuery, pagination: { querySize }, sort, @@ -43,7 +41,6 @@ export const buildUsersQuery = ({ ignore_unavailable: true, track_total_hits: false, body: { - ...(!isEmpty(docValueFields) ? { docvalue_fields: docValueFields } : {}), aggregations: { user_count: { cardinality: { field: 'user.name' } }, user_data: { @@ -60,15 +57,22 @@ export const buildUsersQuery = ({ }, }, ], - _source: { - includes: ['user.domain'], - }, + _source: false, }, }, }, }, }, query: { bool: { filter } }, + _source: false, + fields: [ + 'user.name', + 'user.domain', + { + field: '@timestamp', + format: 'strict_date_optional_time', + }, + ], size: 0, }, }; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/__mocks__/index.ts index 487f4537cd50d..028ee4e4ba1b9 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/__mocks__/index.ts @@ -26,408 +26,6 @@ export const mockOptions: UserAuthenticationsRequestOptions = { 'winlogbeat-*', ], stackByField: AuthStackByField.userName, - docValueFields: [ - { - field: '@timestamp', - format: 'date_time', - }, - { - field: 'event.created', - format: 'date_time', - }, - { - field: 'event.end', - format: 'date_time', - }, - { - field: 'event.ingested', - format: 'date_time', - }, - { - field: 'event.start', - format: 'date_time', - }, - { - field: 'file.accessed', - format: 'date_time', - }, - { - field: 'file.created', - format: 'date_time', - }, - { - field: 'file.ctime', - format: 'date_time', - }, - { - field: 'file.mtime', - format: 'date_time', - }, - { - field: 'package.installed', - format: 'date_time', - }, - { - field: 'process.parent.start', - format: 'date_time', - }, - { - field: 'process.start', - format: 'date_time', - }, - { - field: 'system.audit.host.boottime', - format: 'date_time', - }, - { - field: 'system.audit.package.installtime', - format: 'date_time', - }, - { - field: 'system.audit.user.password.last_changed', - format: 'date_time', - }, - { - field: 'tls.client.not_after', - format: 'date_time', - }, - { - field: 'tls.client.not_before', - format: 'date_time', - }, - { - field: 'tls.server.not_after', - format: 'date_time', - }, - { - field: 'tls.server.not_before', - format: 'date_time', - }, - { - field: 'aws.cloudtrail.user_identity.session_context.creation_date', - format: 'date_time', - }, - { - field: 'azure.auditlogs.properties.activity_datetime', - format: 'date_time', - }, - { - field: 'azure.enqueued_time', - format: 'date_time', - }, - { - field: 'azure.signinlogs.properties.created_at', - format: 'date_time', - }, - { - field: 'cef.extensions.agentReceiptTime', - format: 'date_time', - }, - { - field: 'cef.extensions.deviceCustomDate1', - format: 'date_time', - }, - { - field: 'cef.extensions.deviceCustomDate2', - format: 'date_time', - }, - { - field: 'cef.extensions.deviceReceiptTime', - format: 'date_time', - }, - { - field: 'cef.extensions.endTime', - format: 'date_time', - }, - { - field: 'cef.extensions.fileCreateTime', - format: 'date_time', - }, - { - field: 'cef.extensions.fileModificationTime', - format: 'date_time', - }, - { - field: 'cef.extensions.flexDate1', - format: 'date_time', - }, - { - field: 'cef.extensions.managerReceiptTime', - format: 'date_time', - }, - { - field: 'cef.extensions.oldFileCreateTime', - format: 'date_time', - }, - { - field: 'cef.extensions.oldFileModificationTime', - format: 'date_time', - }, - { - field: 'cef.extensions.startTime', - format: 'date_time', - }, - { - field: 'checkpoint.subs_exp', - format: 'date_time', - }, - { - field: 'crowdstrike.event.EndTimestamp', - format: 'date_time', - }, - { - field: 'crowdstrike.event.IncidentEndTime', - format: 'date_time', - }, - { - field: 'crowdstrike.event.IncidentStartTime', - format: 'date_time', - }, - { - field: 'crowdstrike.event.ProcessEndTime', - format: 'date_time', - }, - { - field: 'crowdstrike.event.ProcessStartTime', - format: 'date_time', - }, - { - field: 'crowdstrike.event.StartTimestamp', - format: 'date_time', - }, - { - field: 'crowdstrike.event.Timestamp', - format: 'date_time', - }, - { - field: 'crowdstrike.event.UTCTimestamp', - format: 'date_time', - }, - { - field: 'crowdstrike.metadata.eventCreationTime', - format: 'date_time', - }, - { - field: 'gsuite.admin.email.log_search_filter.end_date', - format: 'date_time', - }, - { - field: 'gsuite.admin.email.log_search_filter.start_date', - format: 'date_time', - }, - { - field: 'gsuite.admin.user.birthdate', - format: 'date_time', - }, - { - field: 'kafka.block_timestamp', - format: 'date_time', - }, - { - field: 'microsoft.defender_atp.lastUpdateTime', - format: 'date_time', - }, - { - field: 'microsoft.defender_atp.resolvedTime', - format: 'date_time', - }, - { - field: 'misp.campaign.first_seen', - format: 'date_time', - }, - { - field: 'misp.campaign.last_seen', - format: 'date_time', - }, - { - field: 'misp.intrusion_set.first_seen', - format: 'date_time', - }, - { - field: 'misp.intrusion_set.last_seen', - format: 'date_time', - }, - { - field: 'misp.observed_data.first_observed', - format: 'date_time', - }, - { - field: 'misp.observed_data.last_observed', - format: 'date_time', - }, - { - field: 'misp.report.published', - format: 'date_time', - }, - { - field: 'misp.threat_indicator.valid_from', - format: 'date_time', - }, - { - field: 'misp.threat_indicator.valid_until', - format: 'date_time', - }, - { - field: 'netflow.collection_time_milliseconds', - format: 'date_time', - }, - { - field: 'netflow.exporter.timestamp', - format: 'date_time', - }, - { - field: 'netflow.flow_end_microseconds', - format: 'date_time', - }, - { - field: 'netflow.flow_end_milliseconds', - format: 'date_time', - }, - { - field: 'netflow.flow_end_nanoseconds', - format: 'date_time', - }, - { - field: 'netflow.flow_end_seconds', - format: 'date_time', - }, - { - field: 'netflow.flow_start_microseconds', - format: 'date_time', - }, - { - field: 'netflow.flow_start_milliseconds', - format: 'date_time', - }, - { - field: 'netflow.flow_start_nanoseconds', - format: 'date_time', - }, - { - field: 'netflow.flow_start_seconds', - format: 'date_time', - }, - { - field: 'netflow.max_export_seconds', - format: 'date_time', - }, - { - field: 'netflow.max_flow_end_microseconds', - format: 'date_time', - }, - { - field: 'netflow.max_flow_end_milliseconds', - format: 'date_time', - }, - { - field: 'netflow.max_flow_end_nanoseconds', - format: 'date_time', - }, - { - field: 'netflow.max_flow_end_seconds', - format: 'date_time', - }, - { - field: 'netflow.min_export_seconds', - format: 'date_time', - }, - { - field: 'netflow.min_flow_start_microseconds', - format: 'date_time', - }, - { - field: 'netflow.min_flow_start_milliseconds', - format: 'date_time', - }, - { - field: 'netflow.min_flow_start_nanoseconds', - format: 'date_time', - }, - { - field: 'netflow.min_flow_start_seconds', - format: 'date_time', - }, - { - field: 'netflow.monitoring_interval_end_milli_seconds', - format: 'date_time', - }, - { - field: 'netflow.monitoring_interval_start_milli_seconds', - format: 'date_time', - }, - { - field: 'netflow.observation_time_microseconds', - format: 'date_time', - }, - { - field: 'netflow.observation_time_milliseconds', - format: 'date_time', - }, - { - field: 'netflow.observation_time_nanoseconds', - format: 'date_time', - }, - { - field: 'netflow.observation_time_seconds', - format: 'date_time', - }, - { - field: 'netflow.system_init_time_milliseconds', - format: 'date_time', - }, - { - field: 'rsa.internal.lc_ctime', - format: 'date_time', - }, - { - field: 'rsa.internal.time', - format: 'date_time', - }, - { - field: 'rsa.time.effective_time', - format: 'date_time', - }, - { - field: 'rsa.time.endtime', - format: 'date_time', - }, - { - field: 'rsa.time.event_queue_time', - format: 'date_time', - }, - { - field: 'rsa.time.event_time', - format: 'date_time', - }, - { - field: 'rsa.time.expire_time', - format: 'date_time', - }, - { - field: 'rsa.time.recorded_time', - format: 'date_time', - }, - { - field: 'rsa.time.stamp', - format: 'date_time', - }, - { - field: 'rsa.time.starttime', - format: 'date_time', - }, - { - field: 'sophos.xg.date', - format: 'date_time', - }, - { - field: 'sophos.xg.eventtime', - format: 'date_time', - }, - { - field: 'sophos.xg.start_time', - format: 'date_time', - }, - ], factoryQueryType: UsersQueries.authentications, filterQuery: '{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[]}}', pagination: { @@ -481,106 +79,10 @@ export const mockSearchStrategyResponse: IEsSearchResponse = { _index: 'winlogbeat-8.0.0-2020.09.02-000001', _id: 'zqY7WXQBA6bGZw2uLeKI', _score: null, - _source: { - process: { - name: 'services.exe', - pid: 564, - executable: 'C:\\Windows\\System32\\services.exe', - }, - agent: { - build_date: '2020-07-16 09:16:27 +0000 UTC ', - name: 'siem-windows', - commit: '4dcbde39492bdc3843034bba8db811c68cb44b97 ', - id: '05e1bff7-d7a8-416a-8554-aa10288fa07d', - type: 'winlogbeat', - ephemeral_id: '655abd6c-6c33-435d-a2eb-79b2a01e6d61', - version: '8.0.0', - user: { name: 'inside_winlogbeat_user' }, - }, - winlog: { - computer_name: 'siem-windows', - process: { pid: 576, thread: { id: 880 } }, - keywords: ['Audit Success'], - logon: { id: '0x3e7', type: 'Service' }, - channel: 'Security', - event_data: { - LogonGuid: '{00000000-0000-0000-0000-000000000000}', - TargetOutboundDomainName: '-', - VirtualAccount: '%%1843', - LogonType: '5', - IpPort: '-', - TransmittedServices: '-', - SubjectLogonId: '0x3e7', - LmPackageName: '-', - TargetOutboundUserName: '-', - KeyLength: '0', - TargetLogonId: '0x3e7', - RestrictedAdminMode: '-', - SubjectUserName: 'SIEM-WINDOWS$', - TargetLinkedLogonId: '0x0', - ElevatedToken: '%%1842', - SubjectDomainName: 'WORKGROUP', - IpAddress: '-', - ImpersonationLevel: '%%1833', - TargetUserName: 'SYSTEM', - LogonProcessName: 'Advapi ', - TargetDomainName: 'NT AUTHORITY', - SubjectUserSid: 'S-1-5-18', - TargetUserSid: 'S-1-5-18', - AuthenticationPackageName: 'Negotiate', - }, - opcode: 'Info', - version: 2, - record_id: 57818, - task: 'Logon', - event_id: 4624, - provider_guid: '{54849625-5478-4994-a5ba-3e3b0328c30d}', - activity_id: '{d2485217-6bac-0000-8fbb-3f7e2571d601}', - api: 'wineventlog', - provider_name: 'Microsoft-Windows-Security-Auditing', - }, - log: { level: 'information' }, - source: { domain: '-' }, - message: - 'An account was successfully logged on.\n\nSubject:\n\tSecurity ID:\t\tS-1-5-18\n\tAccount Name:\t\tSIEM-WINDOWS$\n\tAccount Domain:\t\tWORKGROUP\n\tLogon ID:\t\t0x3E7\n\nLogon Information:\n\tLogon Type:\t\t5\n\tRestricted Admin Mode:\t-\n\tVirtual Account:\t\tNo\n\tElevated Token:\t\tYes\n\nImpersonation Level:\t\tImpersonation\n\nNew Logon:\n\tSecurity ID:\t\tS-1-5-18\n\tAccount Name:\t\tSYSTEM\n\tAccount Domain:\t\tNT AUTHORITY\n\tLogon ID:\t\t0x3E7\n\tLinked Logon ID:\t\t0x0\n\tNetwork Account Name:\t-\n\tNetwork Account Domain:\t-\n\tLogon GUID:\t\t{00000000-0000-0000-0000-000000000000}\n\nProcess Information:\n\tProcess ID:\t\t0x234\n\tProcess Name:\t\tC:\\Windows\\System32\\services.exe\n\nNetwork Information:\n\tWorkstation Name:\t-\n\tSource Network Address:\t-\n\tSource Port:\t\t-\n\nDetailed Authentication Information:\n\tLogon Process:\t\tAdvapi \n\tAuthentication Package:\tNegotiate\n\tTransited Services:\t-\n\tPackage Name (NTLM only):\t-\n\tKey Length:\t\t0\n\nThis event is generated when a logon session is created. It is generated on the computer that was accessed.\n\nThe subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe.\n\nThe logon type field indicates the kind of logon that occurred. The most common types are 2 (interactive) and 3 (network).\n\nThe New Logon fields indicate the account for whom the new logon was created, i.e. the account that was logged on.\n\nThe network fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.\n\nThe impersonation level field indicates the extent to which a process in the logon session can impersonate.\n\nThe authentication information fields provide detailed information about this specific logon request.\n\t- Logon GUID is a unique identifier that can be used to correlate this event with a KDC event.\n\t- Transited services indicate which intermediate services have participated in this logon request.\n\t- Package name indicates which sub-protocol was used among the NTLM protocols.\n\t- Key length indicates the length of the generated session key. This will be 0 if no session key was requested.', - cloud: { - availability_zone: 'us-central1-c', - instance: { name: 'siem-windows', id: '9156726559029788564' }, - provider: 'gcp', - machine: { type: 'g1-small' }, - project: { id: 'elastic-siem' }, - }, - '@timestamp': '2020-09-04T13:08:02.532Z', - related: { user: ['SYSTEM', 'SIEM-WINDOWS$'] }, - ecs: { version: '1.5.0' }, - host: { - hostname: 'siem-windows', - os: { - build: '17763.1397', - kernel: '10.0.17763.1397 (WinBuild.160101.0800)', - name: 'Windows Server 2019 Datacenter', - family: 'windows', - version: '10.0', - platform: 'windows', - }, - ip: ['fe80::ecf5:decc:3ec3:767e', '10.200.0.15'], - name: 'siem-windows', - id: 'ce1d3c9b-a815-4643-9641-ada0f2c00609', - mac: ['42:01:0a:c8:00:0f'], - architecture: 'x86_64', - }, - event: { - code: 4624, - provider: 'Microsoft-Windows-Security-Auditing', - created: '2020-09-04T13:08:03.638Z', - kind: 'event', - module: 'security', - action: 'logged-in', - category: 'authentication', - type: 'start', - outcome: 'success', - }, - user: { domain: 'NT AUTHORITY', name: 'SYSTEM', id: 'S-1-5-18' }, + fields: { + '@timestamp': ['2020-09-04T13:08:02.532Z'], + 'host.id': ['ce1d3c9b-a815-4643-9641-ada0f2c00609'], + 'host.name': ['siem-windows'], }, sort: [1599224882532], }, @@ -607,76 +109,11 @@ export const mockSearchStrategyResponse: IEsSearchResponse = { _index: '.ds-logs-system.auth-default-000001', _id: '9_sfWXQBc39KFIJbIsDh', _score: null, - _source: { - agent: { - hostname: 'siem-kibana', - name: 'siem-kibana', - id: 'aa3d9dc7-fef1-4c2f-a68d-25785d624e35', - ephemeral_id: 'e503bd85-11c7-4bc9-ae7d-70be1d919fb7', - type: 'filebeat', - version: '7.9.1', - }, - process: { name: 'sshd', pid: 20764 }, - log: { file: { path: '/var/log/auth.log' }, offset: 552463 }, - source: { - geo: { - continent_name: 'Europe', - region_iso_code: 'DE-BE', - city_name: 'Berlin', - country_iso_code: 'DE', - region_name: 'Land Berlin', - location: { lon: 13.3512, lat: 52.5727 }, - }, - as: { number: 6805, organization: { name: 'Telefonica Germany' } }, - port: 57457, - ip: '77.183.42.188', - }, - cloud: { - availability_zone: 'us-east1-b', - instance: { name: 'siem-kibana', id: '5412578377715150143' }, - provider: 'gcp', - machine: { type: 'n1-standard-2' }, - project: { id: 'elastic-beats' }, - }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T11:49:21.000Z', - system: { - auth: { - ssh: { - method: 'publickey', - signature: 'RSA SHA256:vv64JNLzKZWYA9vonnGWuW7zxWhyZrL/BFxyIGbISx8', - event: 'Accepted', - }, - }, - }, - ecs: { version: '1.5.0' }, - data_stream: { namespace: 'default', type: 'logs', dataset: 'system.auth' }, - host: { - hostname: 'siem-kibana', - os: { - kernel: '4.9.0-8-amd64', - codename: 'stretch', - name: 'Debian GNU/Linux', - family: 'debian', - version: '9 (stretch)', - platform: 'debian', - }, - containerized: false, - ip: ['10.142.0.7', 'fe80::4001:aff:fe8e:7'], - name: 'siem-kibana', - id: 'aa7ca589f1b8220002f2fc61c64cfbf1', - mac: ['42:01:0a:8e:00:07'], - architecture: 'x86_64', - }, - event: { - timezone: '+00:00', - action: 'ssh_login', - type: 'authentication_success', - category: 'authentication', - dataset: 'system.auth', - outcome: 'success', - }, - user: { name: 'tsg' }, + fields: { + 'source.ip': ['77.183.42.188'], + 'host.id': ['aa7ca589f1b8220002f2fc61c64cfbf1'], + 'host.name': ['siem-kibana'], + '@timestamp': ['2020-09-04T11:49:21.000Z'], }, sort: [1599220161000], }, @@ -699,67 +136,11 @@ export const mockSearchStrategyResponse: IEsSearchResponse = { _index: '.ds-logs-system.auth-default-000001', _id: 'ZfxZWXQBc39KFIJbLN5U', _score: null, - _source: { - agent: { - hostname: 'siem-kibana', - name: 'siem-kibana', - id: 'aa3d9dc7-fef1-4c2f-a68d-25785d624e35', - ephemeral_id: 'e503bd85-11c7-4bc9-ae7d-70be1d919fb7', - type: 'filebeat', - version: '7.9.1', - }, - process: { name: 'sshd', pid: 22913 }, - log: { file: { path: '/var/log/auth.log' }, offset: 562910 }, - source: { - geo: { - continent_name: 'Asia', - region_iso_code: 'KR-28', - city_name: 'Incheon', - country_iso_code: 'KR', - region_name: 'Incheon', - location: { lon: 126.7288, lat: 37.4562 }, - }, - as: { number: 4766, organization: { name: 'Korea Telecom' } }, - ip: '59.15.3.197', - }, - cloud: { - availability_zone: 'us-east1-b', - instance: { name: 'siem-kibana', id: '5412578377715150143' }, - provider: 'gcp', - machine: { type: 'n1-standard-2' }, - project: { id: 'elastic-beats' }, - }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T13:40:46.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - data_stream: { namespace: 'default', type: 'logs', dataset: 'system.auth' }, - host: { - hostname: 'siem-kibana', - os: { - kernel: '4.9.0-8-amd64', - codename: 'stretch', - name: 'Debian GNU/Linux', - family: 'debian', - version: '9 (stretch)', - platform: 'debian', - }, - containerized: false, - ip: ['10.142.0.7', 'fe80::4001:aff:fe8e:7'], - name: 'siem-kibana', - id: 'aa7ca589f1b8220002f2fc61c64cfbf1', - mac: ['42:01:0a:8e:00:07'], - architecture: 'x86_64', - }, - event: { - timezone: '+00:00', - action: 'ssh_login', - type: 'authentication_failure', - category: 'authentication', - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'admin' }, + fields: { + 'source.ip': ['59.15.3.197'], + 'host.id': ['aa7ca589f1b8220002f2fc61c64cfbf1'], + 'host.name': ['siem-kibana'], + '@timestamp': ['2020-09-04T13:40:46.000Z'], }, sort: [1599226846000], }, @@ -786,47 +167,10 @@ export const mockSearchStrategyResponse: IEsSearchResponse = { _index: 'filebeat-8.0.0-2020.09.02-000001', _id: 'M_xLWXQBc39KFIJbY7Cb', _score: null, - _source: { - agent: { - name: 'bastion00.siem.estc.dev', - id: 'f9a321c1-ec27-49fa-aacf-6a50ef6d836f', - type: 'filebeat', - ephemeral_id: '734ee3da-1a4f-4bc9-b400-e0cf0e5eeebc', - version: '8.0.0', - }, - process: { name: 'sshd', pid: 20671 }, - log: { file: { path: '/var/log/auth.log' }, offset: 1028103 }, - source: { - geo: { - continent_name: 'North America', - region_iso_code: 'US-NY', - city_name: 'New York', - country_iso_code: 'US', - region_name: 'New York', - location: { lon: -74, lat: 40.7157 }, - }, - ip: '64.227.88.245', - }, - fileset: { name: 'auth' }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T13:25:43.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - related: { ip: ['64.227.88.245'], user: ['user'] }, - service: { type: 'system' }, - host: { hostname: 'bastion00', name: 'bastion00.siem.estc.dev' }, - event: { - ingested: '2020-09-04T13:25:47.034172Z', - timezone: '+00:00', - kind: 'event', - module: 'system', - action: 'ssh_login', - type: ['authentication_failure', 'info'], - category: ['authentication'], - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'user' }, + fields: { + 'source.ip': ['64.227.88.245'], + 'host.name': ['bastion00.siem.estc.dev'], + '@timestamp': ['2020-09-04T13:25:43.000Z'], }, sort: [1599225943000], }, @@ -853,47 +197,10 @@ export const mockSearchStrategyResponse: IEsSearchResponse = { _index: 'filebeat-8.0.0-2020.09.02-000001', _id: 'nPxKWXQBc39KFIJb7q4w', _score: null, - _source: { - agent: { - name: 'bastion00.siem.estc.dev', - id: 'f9a321c1-ec27-49fa-aacf-6a50ef6d836f', - ephemeral_id: '734ee3da-1a4f-4bc9-b400-e0cf0e5eeebc', - type: 'filebeat', - version: '8.0.0', - }, - process: { name: 'sshd', pid: 20665 }, - log: { file: { path: '/var/log/auth.log' }, offset: 1027372 }, - source: { - geo: { - continent_name: 'North America', - region_iso_code: 'US-NY', - city_name: 'New York', - country_iso_code: 'US', - region_name: 'New York', - location: { lon: -74, lat: 40.7157 }, - }, - ip: '64.227.88.245', - }, - fileset: { name: 'auth' }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T13:25:07.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - related: { ip: ['64.227.88.245'], user: ['ubuntu'] }, - service: { type: 'system' }, - host: { hostname: 'bastion00', name: 'bastion00.siem.estc.dev' }, - event: { - ingested: '2020-09-04T13:25:16.974606Z', - timezone: '+00:00', - kind: 'event', - module: 'system', - action: 'ssh_login', - type: ['authentication_failure', 'info'], - category: ['authentication'], - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'ubuntu' }, + fields: { + 'source.ip': ['64.227.88.245'], + 'host.name': ['bastion00.siem.estc.dev'], + '@timestamp': ['2020-09-04T13:25:07.000Z'], }, sort: [1599225907000], }, @@ -920,67 +227,11 @@ export const mockSearchStrategyResponse: IEsSearchResponse = { _index: '.ds-logs-system.auth-default-000001', _id: 'mPsfWXQBc39KFIJbI8HI', _score: null, - _source: { - agent: { - hostname: 'siem-kibana', - name: 'siem-kibana', - id: 'aa3d9dc7-fef1-4c2f-a68d-25785d624e35', - type: 'filebeat', - ephemeral_id: 'e503bd85-11c7-4bc9-ae7d-70be1d919fb7', - version: '7.9.1', - }, - process: { name: 'sshd', pid: 21506 }, - log: { file: { path: '/var/log/auth.log' }, offset: 556761 }, - source: { - geo: { - continent_name: 'Asia', - region_iso_code: 'IN-DL', - city_name: 'New Delhi', - country_iso_code: 'IN', - region_name: 'National Capital Territory of Delhi', - location: { lon: 77.2245, lat: 28.6358 }, - }, - as: { number: 10029, organization: { name: 'SHYAM SPECTRA PVT LTD' } }, - ip: '180.151.228.166', - }, - cloud: { - availability_zone: 'us-east1-b', - instance: { name: 'siem-kibana', id: '5412578377715150143' }, - provider: 'gcp', - machine: { type: 'n1-standard-2' }, - project: { id: 'elastic-beats' }, - }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T12:26:36.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - data_stream: { namespace: 'default', type: 'logs', dataset: 'system.auth' }, - host: { - hostname: 'siem-kibana', - os: { - kernel: '4.9.0-8-amd64', - codename: 'stretch', - name: 'Debian GNU/Linux', - family: 'debian', - version: '9 (stretch)', - platform: 'debian', - }, - containerized: false, - ip: ['10.142.0.7', 'fe80::4001:aff:fe8e:7'], - name: 'siem-kibana', - id: 'aa7ca589f1b8220002f2fc61c64cfbf1', - mac: ['42:01:0a:8e:00:07'], - architecture: 'x86_64', - }, - event: { - timezone: '+00:00', - action: 'ssh_login', - type: 'authentication_failure', - category: 'authentication', - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'odoo' }, + fields: { + 'source.ip': ['180.151.228.166'], + 'host.id': ['aa7ca589f1b8220002f2fc61c64cfbf1'], + 'host.name': ['siem-kibana'], + '@timestamp': ['2020-09-04T12:26:36.000Z'], }, sort: [1599222396000], }, @@ -1007,48 +258,10 @@ export const mockSearchStrategyResponse: IEsSearchResponse = { _index: 'filebeat-8.0.0-2020.09.02-000001', _id: 'aaToWHQBA6bGZw2uR-St', _score: null, - _source: { - agent: { - name: 'bastion00.siem.estc.dev', - id: 'f9a321c1-ec27-49fa-aacf-6a50ef6d836f', - type: 'filebeat', - ephemeral_id: '734ee3da-1a4f-4bc9-b400-e0cf0e5eeebc', - version: '8.0.0', - }, - process: { name: 'sshd', pid: 20475 }, - log: { file: { path: '/var/log/auth.log' }, offset: 1019218 }, - source: { - geo: { - continent_name: 'Europe', - region_iso_code: 'SE-AB', - city_name: 'Stockholm', - country_iso_code: 'SE', - region_name: 'Stockholm', - location: { lon: 17.7833, lat: 59.25 }, - }, - as: { number: 8473, organization: { name: 'Bahnhof AB' } }, - ip: '178.174.148.58', - }, - fileset: { name: 'auth' }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T11:37:22.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - related: { ip: ['178.174.148.58'], user: ['pi'] }, - service: { type: 'system' }, - host: { hostname: 'bastion00', name: 'bastion00.siem.estc.dev' }, - event: { - ingested: '2020-09-04T11:37:31.797423Z', - timezone: '+00:00', - kind: 'event', - module: 'system', - action: 'ssh_login', - type: ['authentication_failure', 'info'], - category: ['authentication'], - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'pi' }, + fields: { + 'source.ip': ['178.174.148.58'], + 'host.name': ['bastion00.siem.estc.dev'], + '@timestamp': ['2020-09-04T11:37:22.000Z'], }, sort: [1599219442000], }, @@ -1075,48 +288,10 @@ export const mockSearchStrategyResponse: IEsSearchResponse = { _index: 'filebeat-8.0.0-2020.09.02-000001', _id: 'VaP_V3QBA6bGZw2upUbg', _score: null, - _source: { - agent: { - name: 'bastion00.siem.estc.dev', - id: 'f9a321c1-ec27-49fa-aacf-6a50ef6d836f', - type: 'filebeat', - ephemeral_id: '734ee3da-1a4f-4bc9-b400-e0cf0e5eeebc', - version: '8.0.0', - }, - process: { name: 'sshd', pid: 19849 }, - log: { file: { path: '/var/log/auth.log' }, offset: 981036 }, - source: { - geo: { - continent_name: 'Europe', - country_iso_code: 'HR', - location: { lon: 15.5, lat: 45.1667 }, - }, - as: { - number: 42864, - organization: { name: 'Giganet Internet Szolgaltato Kft' }, - }, - ip: '45.95.168.157', - }, - fileset: { name: 'auth' }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T07:23:22.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - related: { ip: ['45.95.168.157'], user: ['demo'] }, - service: { type: 'system' }, - host: { hostname: 'bastion00', name: 'bastion00.siem.estc.dev' }, - event: { - ingested: '2020-09-04T07:23:26.046346Z', - timezone: '+00:00', - kind: 'event', - module: 'system', - action: 'ssh_login', - type: ['authentication_failure', 'info'], - category: ['authentication'], - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'demo' }, + fields: { + 'source.ip': ['45.95.168.157'], + 'host.name': ['bastion00.siem.estc.dev'], + '@timestamp': ['2020-09-04T07:23:22.000Z'], }, sort: [1599204202000], }, @@ -1143,72 +318,11 @@ export const mockSearchStrategyResponse: IEsSearchResponse = { _index: '.ds-logs-system.auth-default-000001', _id: 'PqYfWXQBA6bGZw2uIhVU', _score: null, - _source: { - agent: { - hostname: 'siem-kibana', - name: 'siem-kibana', - id: 'aa3d9dc7-fef1-4c2f-a68d-25785d624e35', - ephemeral_id: 'e503bd85-11c7-4bc9-ae7d-70be1d919fb7', - type: 'filebeat', - version: '7.9.1', - }, - process: { name: 'sshd', pid: 20396 }, - log: { file: { path: '/var/log/auth.log' }, offset: 550795 }, - source: { - geo: { - continent_name: 'Asia', - region_iso_code: 'CN-BJ', - city_name: 'Beijing', - country_iso_code: 'CN', - region_name: 'Beijing', - location: { lon: 116.3889, lat: 39.9288 }, - }, - as: { - number: 45090, - organization: { - name: 'Shenzhen Tencent Computer Systems Company Limited', - }, - }, - ip: '123.206.30.76', - }, - cloud: { - availability_zone: 'us-east1-b', - instance: { name: 'siem-kibana', id: '5412578377715150143' }, - provider: 'gcp', - machine: { type: 'n1-standard-2' }, - project: { id: 'elastic-beats' }, - }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T11:20:26.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - data_stream: { namespace: 'default', type: 'logs', dataset: 'system.auth' }, - host: { - hostname: 'siem-kibana', - os: { - kernel: '4.9.0-8-amd64', - codename: 'stretch', - name: 'Debian GNU/Linux', - family: 'debian', - version: '9 (stretch)', - platform: 'debian', - }, - containerized: false, - ip: ['10.142.0.7', 'fe80::4001:aff:fe8e:7'], - name: 'siem-kibana', - id: 'aa7ca589f1b8220002f2fc61c64cfbf1', - mac: ['42:01:0a:8e:00:07'], - architecture: 'x86_64', - }, - event: { - timezone: '+00:00', - action: 'ssh_login', - type: 'authentication_failure', - category: 'authentication', - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'git' }, + fields: { + 'source.ip': ['123.206.30.76'], + 'host.id': ['aa7ca589f1b8220002f2fc61c64cfbf1'], + 'host.name': ['siem-kibana'], + '@timestamp': ['2020-09-04T11:20:26.000Z'], }, sort: [1599218426000], }, @@ -1235,48 +349,10 @@ export const mockSearchStrategyResponse: IEsSearchResponse = { _index: 'filebeat-8.0.0-2020.09.02-000001', _id: 'iMABWHQBB-gskclyitP-', _score: null, - _source: { - agent: { - name: 'bastion00.siem.estc.dev', - id: 'f9a321c1-ec27-49fa-aacf-6a50ef6d836f', - type: 'filebeat', - ephemeral_id: '734ee3da-1a4f-4bc9-b400-e0cf0e5eeebc', - version: '8.0.0', - }, - process: { name: 'sshd', pid: 19870 }, - log: { file: { path: '/var/log/auth.log' }, offset: 984133 }, - source: { - geo: { - continent_name: 'Europe', - country_iso_code: 'HR', - location: { lon: 15.5, lat: 45.1667 }, - }, - as: { - number: 42864, - organization: { name: 'Giganet Internet Szolgaltato Kft' }, - }, - ip: '45.95.168.157', - }, - fileset: { name: 'auth' }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T07:25:28.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - related: { ip: ['45.95.168.157'], user: ['webadmin'] }, - service: { type: 'system' }, - host: { hostname: 'bastion00', name: 'bastion00.siem.estc.dev' }, - event: { - ingested: '2020-09-04T07:25:30.236651Z', - timezone: '+00:00', - kind: 'event', - module: 'system', - action: 'ssh_login', - type: ['authentication_failure', 'info'], - category: ['authentication'], - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'webadmin' }, + fields: { + 'source.ip': ['45.95.168.157'], + 'host.name': ['bastion00.siem.estc.dev'], + '@timestamp': ['2020-09-04T07:25:28.000Z'], }, sort: [1599204328000], }, @@ -1331,106 +407,10 @@ export const formattedSearchStrategyResponse = { _index: 'winlogbeat-8.0.0-2020.09.02-000001', _id: 'zqY7WXQBA6bGZw2uLeKI', _score: null, - _source: { - process: { - name: 'services.exe', - pid: 564, - executable: 'C:\\Windows\\System32\\services.exe', - }, - agent: { - build_date: '2020-07-16 09:16:27 +0000 UTC ', - name: 'siem-windows', - commit: '4dcbde39492bdc3843034bba8db811c68cb44b97 ', - id: '05e1bff7-d7a8-416a-8554-aa10288fa07d', - type: 'winlogbeat', - ephemeral_id: '655abd6c-6c33-435d-a2eb-79b2a01e6d61', - version: '8.0.0', - user: { name: 'inside_winlogbeat_user' }, - }, - winlog: { - computer_name: 'siem-windows', - process: { pid: 576, thread: { id: 880 } }, - keywords: ['Audit Success'], - logon: { id: '0x3e7', type: 'Service' }, - channel: 'Security', - event_data: { - LogonGuid: '{00000000-0000-0000-0000-000000000000}', - TargetOutboundDomainName: '-', - VirtualAccount: '%%1843', - LogonType: '5', - IpPort: '-', - TransmittedServices: '-', - SubjectLogonId: '0x3e7', - LmPackageName: '-', - TargetOutboundUserName: '-', - KeyLength: '0', - TargetLogonId: '0x3e7', - RestrictedAdminMode: '-', - SubjectUserName: 'SIEM-WINDOWS$', - TargetLinkedLogonId: '0x0', - ElevatedToken: '%%1842', - SubjectDomainName: 'WORKGROUP', - IpAddress: '-', - ImpersonationLevel: '%%1833', - TargetUserName: 'SYSTEM', - LogonProcessName: 'Advapi ', - TargetDomainName: 'NT AUTHORITY', - SubjectUserSid: 'S-1-5-18', - TargetUserSid: 'S-1-5-18', - AuthenticationPackageName: 'Negotiate', - }, - opcode: 'Info', - version: 2, - record_id: 57818, - task: 'Logon', - event_id: 4624, - provider_guid: '{54849625-5478-4994-a5ba-3e3b0328c30d}', - activity_id: '{d2485217-6bac-0000-8fbb-3f7e2571d601}', - api: 'wineventlog', - provider_name: 'Microsoft-Windows-Security-Auditing', - }, - log: { level: 'information' }, - source: { domain: '-' }, - message: - 'An account was successfully logged on.\n\nSubject:\n\tSecurity ID:\t\tS-1-5-18\n\tAccount Name:\t\tSIEM-WINDOWS$\n\tAccount Domain:\t\tWORKGROUP\n\tLogon ID:\t\t0x3E7\n\nLogon Information:\n\tLogon Type:\t\t5\n\tRestricted Admin Mode:\t-\n\tVirtual Account:\t\tNo\n\tElevated Token:\t\tYes\n\nImpersonation Level:\t\tImpersonation\n\nNew Logon:\n\tSecurity ID:\t\tS-1-5-18\n\tAccount Name:\t\tSYSTEM\n\tAccount Domain:\t\tNT AUTHORITY\n\tLogon ID:\t\t0x3E7\n\tLinked Logon ID:\t\t0x0\n\tNetwork Account Name:\t-\n\tNetwork Account Domain:\t-\n\tLogon GUID:\t\t{00000000-0000-0000-0000-000000000000}\n\nProcess Information:\n\tProcess ID:\t\t0x234\n\tProcess Name:\t\tC:\\Windows\\System32\\services.exe\n\nNetwork Information:\n\tWorkstation Name:\t-\n\tSource Network Address:\t-\n\tSource Port:\t\t-\n\nDetailed Authentication Information:\n\tLogon Process:\t\tAdvapi \n\tAuthentication Package:\tNegotiate\n\tTransited Services:\t-\n\tPackage Name (NTLM only):\t-\n\tKey Length:\t\t0\n\nThis event is generated when a logon session is created. It is generated on the computer that was accessed.\n\nThe subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe.\n\nThe logon type field indicates the kind of logon that occurred. The most common types are 2 (interactive) and 3 (network).\n\nThe New Logon fields indicate the account for whom the new logon was created, i.e. the account that was logged on.\n\nThe network fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.\n\nThe impersonation level field indicates the extent to which a process in the logon session can impersonate.\n\nThe authentication information fields provide detailed information about this specific logon request.\n\t- Logon GUID is a unique identifier that can be used to correlate this event with a KDC event.\n\t- Transited services indicate which intermediate services have participated in this logon request.\n\t- Package name indicates which sub-protocol was used among the NTLM protocols.\n\t- Key length indicates the length of the generated session key. This will be 0 if no session key was requested.', - cloud: { - availability_zone: 'us-central1-c', - instance: { name: 'siem-windows', id: '9156726559029788564' }, - provider: 'gcp', - machine: { type: 'g1-small' }, - project: { id: 'elastic-siem' }, - }, - '@timestamp': '2020-09-04T13:08:02.532Z', - related: { user: ['SYSTEM', 'SIEM-WINDOWS$'] }, - ecs: { version: '1.5.0' }, - host: { - hostname: 'siem-windows', - os: { - build: '17763.1397', - kernel: '10.0.17763.1397 (WinBuild.160101.0800)', - name: 'Windows Server 2019 Datacenter', - family: 'windows', - version: '10.0', - platform: 'windows', - }, - ip: ['fe80::ecf5:decc:3ec3:767e', '10.200.0.15'], - name: 'siem-windows', - id: 'ce1d3c9b-a815-4643-9641-ada0f2c00609', - mac: ['42:01:0a:c8:00:0f'], - architecture: 'x86_64', - }, - event: { - code: 4624, - provider: 'Microsoft-Windows-Security-Auditing', - created: '2020-09-04T13:08:03.638Z', - kind: 'event', - module: 'security', - action: 'logged-in', - category: 'authentication', - type: 'start', - outcome: 'success', - }, - user: { domain: 'NT AUTHORITY', name: 'SYSTEM', id: 'S-1-5-18' }, + fields: { + 'host.id': ['ce1d3c9b-a815-4643-9641-ada0f2c00609'], + 'host.name': ['siem-windows'], + '@timestamp': ['2020-09-04T13:08:02.532Z'], }, sort: [1599224882532], }, @@ -1457,76 +437,11 @@ export const formattedSearchStrategyResponse = { _index: '.ds-logs-system.auth-default-000001', _id: '9_sfWXQBc39KFIJbIsDh', _score: null, - _source: { - agent: { - hostname: 'siem-kibana', - name: 'siem-kibana', - id: 'aa3d9dc7-fef1-4c2f-a68d-25785d624e35', - ephemeral_id: 'e503bd85-11c7-4bc9-ae7d-70be1d919fb7', - type: 'filebeat', - version: '7.9.1', - }, - process: { name: 'sshd', pid: 20764 }, - log: { file: { path: '/var/log/auth.log' }, offset: 552463 }, - source: { - geo: { - continent_name: 'Europe', - region_iso_code: 'DE-BE', - city_name: 'Berlin', - country_iso_code: 'DE', - region_name: 'Land Berlin', - location: { lon: 13.3512, lat: 52.5727 }, - }, - as: { number: 6805, organization: { name: 'Telefonica Germany' } }, - port: 57457, - ip: '77.183.42.188', - }, - cloud: { - availability_zone: 'us-east1-b', - instance: { name: 'siem-kibana', id: '5412578377715150143' }, - provider: 'gcp', - machine: { type: 'n1-standard-2' }, - project: { id: 'elastic-beats' }, - }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T11:49:21.000Z', - system: { - auth: { - ssh: { - method: 'publickey', - signature: 'RSA SHA256:vv64JNLzKZWYA9vonnGWuW7zxWhyZrL/BFxyIGbISx8', - event: 'Accepted', - }, - }, - }, - ecs: { version: '1.5.0' }, - data_stream: { namespace: 'default', type: 'logs', dataset: 'system.auth' }, - host: { - hostname: 'siem-kibana', - os: { - kernel: '4.9.0-8-amd64', - codename: 'stretch', - name: 'Debian GNU/Linux', - family: 'debian', - version: '9 (stretch)', - platform: 'debian', - }, - containerized: false, - ip: ['10.142.0.7', 'fe80::4001:aff:fe8e:7'], - name: 'siem-kibana', - id: 'aa7ca589f1b8220002f2fc61c64cfbf1', - mac: ['42:01:0a:8e:00:07'], - architecture: 'x86_64', - }, - event: { - timezone: '+00:00', - action: 'ssh_login', - type: 'authentication_success', - category: 'authentication', - dataset: 'system.auth', - outcome: 'success', - }, - user: { name: 'tsg' }, + fields: { + 'source.ip': ['77.183.42.188'], + 'host.id': ['aa7ca589f1b8220002f2fc61c64cfbf1'], + 'host.name': ['siem-kibana'], + '@timestamp': ['2020-09-04T11:49:21.000Z'], }, sort: [1599220161000], }, @@ -1549,67 +464,11 @@ export const formattedSearchStrategyResponse = { _index: '.ds-logs-system.auth-default-000001', _id: 'ZfxZWXQBc39KFIJbLN5U', _score: null, - _source: { - agent: { - hostname: 'siem-kibana', - name: 'siem-kibana', - id: 'aa3d9dc7-fef1-4c2f-a68d-25785d624e35', - ephemeral_id: 'e503bd85-11c7-4bc9-ae7d-70be1d919fb7', - type: 'filebeat', - version: '7.9.1', - }, - process: { name: 'sshd', pid: 22913 }, - log: { file: { path: '/var/log/auth.log' }, offset: 562910 }, - source: { - geo: { - continent_name: 'Asia', - region_iso_code: 'KR-28', - city_name: 'Incheon', - country_iso_code: 'KR', - region_name: 'Incheon', - location: { lon: 126.7288, lat: 37.4562 }, - }, - as: { number: 4766, organization: { name: 'Korea Telecom' } }, - ip: '59.15.3.197', - }, - cloud: { - availability_zone: 'us-east1-b', - instance: { name: 'siem-kibana', id: '5412578377715150143' }, - provider: 'gcp', - machine: { type: 'n1-standard-2' }, - project: { id: 'elastic-beats' }, - }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T13:40:46.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - data_stream: { namespace: 'default', type: 'logs', dataset: 'system.auth' }, - host: { - hostname: 'siem-kibana', - os: { - kernel: '4.9.0-8-amd64', - codename: 'stretch', - name: 'Debian GNU/Linux', - family: 'debian', - version: '9 (stretch)', - platform: 'debian', - }, - containerized: false, - ip: ['10.142.0.7', 'fe80::4001:aff:fe8e:7'], - name: 'siem-kibana', - id: 'aa7ca589f1b8220002f2fc61c64cfbf1', - mac: ['42:01:0a:8e:00:07'], - architecture: 'x86_64', - }, - event: { - timezone: '+00:00', - action: 'ssh_login', - type: 'authentication_failure', - category: 'authentication', - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'admin' }, + fields: { + 'source.ip': ['59.15.3.197'], + 'host.id': ['aa7ca589f1b8220002f2fc61c64cfbf1'], + 'host.name': ['siem-kibana'], + '@timestamp': ['2020-09-04T13:40:46.000Z'], }, sort: [1599226846000], }, @@ -1636,47 +495,10 @@ export const formattedSearchStrategyResponse = { _index: 'filebeat-8.0.0-2020.09.02-000001', _id: 'M_xLWXQBc39KFIJbY7Cb', _score: null, - _source: { - agent: { - name: 'bastion00.siem.estc.dev', - id: 'f9a321c1-ec27-49fa-aacf-6a50ef6d836f', - type: 'filebeat', - ephemeral_id: '734ee3da-1a4f-4bc9-b400-e0cf0e5eeebc', - version: '8.0.0', - }, - process: { name: 'sshd', pid: 20671 }, - log: { file: { path: '/var/log/auth.log' }, offset: 1028103 }, - source: { - geo: { - continent_name: 'North America', - region_iso_code: 'US-NY', - city_name: 'New York', - country_iso_code: 'US', - region_name: 'New York', - location: { lon: -74, lat: 40.7157 }, - }, - ip: '64.227.88.245', - }, - fileset: { name: 'auth' }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T13:25:43.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - related: { ip: ['64.227.88.245'], user: ['user'] }, - service: { type: 'system' }, - host: { hostname: 'bastion00', name: 'bastion00.siem.estc.dev' }, - event: { - ingested: '2020-09-04T13:25:47.034172Z', - timezone: '+00:00', - kind: 'event', - module: 'system', - action: 'ssh_login', - type: ['authentication_failure', 'info'], - category: ['authentication'], - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'user' }, + fields: { + 'source.ip': ['64.227.88.245'], + 'host.name': ['bastion00.siem.estc.dev'], + '@timestamp': ['2020-09-04T13:25:43.000Z'], }, sort: [1599225943000], }, @@ -1703,47 +525,10 @@ export const formattedSearchStrategyResponse = { _index: 'filebeat-8.0.0-2020.09.02-000001', _id: 'nPxKWXQBc39KFIJb7q4w', _score: null, - _source: { - agent: { - name: 'bastion00.siem.estc.dev', - id: 'f9a321c1-ec27-49fa-aacf-6a50ef6d836f', - ephemeral_id: '734ee3da-1a4f-4bc9-b400-e0cf0e5eeebc', - type: 'filebeat', - version: '8.0.0', - }, - process: { name: 'sshd', pid: 20665 }, - log: { file: { path: '/var/log/auth.log' }, offset: 1027372 }, - source: { - geo: { - continent_name: 'North America', - region_iso_code: 'US-NY', - city_name: 'New York', - country_iso_code: 'US', - region_name: 'New York', - location: { lon: -74, lat: 40.7157 }, - }, - ip: '64.227.88.245', - }, - fileset: { name: 'auth' }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T13:25:07.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - related: { ip: ['64.227.88.245'], user: ['ubuntu'] }, - service: { type: 'system' }, - host: { hostname: 'bastion00', name: 'bastion00.siem.estc.dev' }, - event: { - ingested: '2020-09-04T13:25:16.974606Z', - timezone: '+00:00', - kind: 'event', - module: 'system', - action: 'ssh_login', - type: ['authentication_failure', 'info'], - category: ['authentication'], - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'ubuntu' }, + fields: { + 'source.ip': ['64.227.88.245'], + 'host.name': ['bastion00.siem.estc.dev'], + '@timestamp': ['2020-09-04T13:25:07.000Z'], }, sort: [1599225907000], }, @@ -1770,67 +555,11 @@ export const formattedSearchStrategyResponse = { _index: '.ds-logs-system.auth-default-000001', _id: 'mPsfWXQBc39KFIJbI8HI', _score: null, - _source: { - agent: { - hostname: 'siem-kibana', - name: 'siem-kibana', - id: 'aa3d9dc7-fef1-4c2f-a68d-25785d624e35', - type: 'filebeat', - ephemeral_id: 'e503bd85-11c7-4bc9-ae7d-70be1d919fb7', - version: '7.9.1', - }, - process: { name: 'sshd', pid: 21506 }, - log: { file: { path: '/var/log/auth.log' }, offset: 556761 }, - source: { - geo: { - continent_name: 'Asia', - region_iso_code: 'IN-DL', - city_name: 'New Delhi', - country_iso_code: 'IN', - region_name: 'National Capital Territory of Delhi', - location: { lon: 77.2245, lat: 28.6358 }, - }, - as: { number: 10029, organization: { name: 'SHYAM SPECTRA PVT LTD' } }, - ip: '180.151.228.166', - }, - cloud: { - availability_zone: 'us-east1-b', - instance: { name: 'siem-kibana', id: '5412578377715150143' }, - provider: 'gcp', - machine: { type: 'n1-standard-2' }, - project: { id: 'elastic-beats' }, - }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T12:26:36.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - data_stream: { namespace: 'default', type: 'logs', dataset: 'system.auth' }, - host: { - hostname: 'siem-kibana', - os: { - kernel: '4.9.0-8-amd64', - codename: 'stretch', - name: 'Debian GNU/Linux', - family: 'debian', - version: '9 (stretch)', - platform: 'debian', - }, - containerized: false, - ip: ['10.142.0.7', 'fe80::4001:aff:fe8e:7'], - name: 'siem-kibana', - id: 'aa7ca589f1b8220002f2fc61c64cfbf1', - mac: ['42:01:0a:8e:00:07'], - architecture: 'x86_64', - }, - event: { - timezone: '+00:00', - action: 'ssh_login', - type: 'authentication_failure', - category: 'authentication', - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'odoo' }, + fields: { + 'source.ip': ['180.151.228.166'], + 'host.id': ['aa7ca589f1b8220002f2fc61c64cfbf1'], + 'host.name': ['siem-kibana'], + '@timestamp': ['2020-09-04T12:26:36.000Z'], }, sort: [1599222396000], }, @@ -1857,48 +586,10 @@ export const formattedSearchStrategyResponse = { _index: 'filebeat-8.0.0-2020.09.02-000001', _id: 'aaToWHQBA6bGZw2uR-St', _score: null, - _source: { - agent: { - name: 'bastion00.siem.estc.dev', - id: 'f9a321c1-ec27-49fa-aacf-6a50ef6d836f', - type: 'filebeat', - ephemeral_id: '734ee3da-1a4f-4bc9-b400-e0cf0e5eeebc', - version: '8.0.0', - }, - process: { name: 'sshd', pid: 20475 }, - log: { file: { path: '/var/log/auth.log' }, offset: 1019218 }, - source: { - geo: { - continent_name: 'Europe', - region_iso_code: 'SE-AB', - city_name: 'Stockholm', - country_iso_code: 'SE', - region_name: 'Stockholm', - location: { lon: 17.7833, lat: 59.25 }, - }, - as: { number: 8473, organization: { name: 'Bahnhof AB' } }, - ip: '178.174.148.58', - }, - fileset: { name: 'auth' }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T11:37:22.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - related: { ip: ['178.174.148.58'], user: ['pi'] }, - service: { type: 'system' }, - host: { hostname: 'bastion00', name: 'bastion00.siem.estc.dev' }, - event: { - ingested: '2020-09-04T11:37:31.797423Z', - timezone: '+00:00', - kind: 'event', - module: 'system', - action: 'ssh_login', - type: ['authentication_failure', 'info'], - category: ['authentication'], - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'pi' }, + fields: { + 'source.ip': ['178.174.148.58'], + 'host.name': ['bastion00.siem.estc.dev'], + '@timestamp': ['2020-09-04T11:37:22.000Z'], }, sort: [1599219442000], }, @@ -1925,48 +616,10 @@ export const formattedSearchStrategyResponse = { _index: 'filebeat-8.0.0-2020.09.02-000001', _id: 'VaP_V3QBA6bGZw2upUbg', _score: null, - _source: { - agent: { - name: 'bastion00.siem.estc.dev', - id: 'f9a321c1-ec27-49fa-aacf-6a50ef6d836f', - type: 'filebeat', - ephemeral_id: '734ee3da-1a4f-4bc9-b400-e0cf0e5eeebc', - version: '8.0.0', - }, - process: { name: 'sshd', pid: 19849 }, - log: { file: { path: '/var/log/auth.log' }, offset: 981036 }, - source: { - geo: { - continent_name: 'Europe', - country_iso_code: 'HR', - location: { lon: 15.5, lat: 45.1667 }, - }, - as: { - number: 42864, - organization: { name: 'Giganet Internet Szolgaltato Kft' }, - }, - ip: '45.95.168.157', - }, - fileset: { name: 'auth' }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T07:23:22.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - related: { ip: ['45.95.168.157'], user: ['demo'] }, - service: { type: 'system' }, - host: { hostname: 'bastion00', name: 'bastion00.siem.estc.dev' }, - event: { - ingested: '2020-09-04T07:23:26.046346Z', - timezone: '+00:00', - kind: 'event', - module: 'system', - action: 'ssh_login', - type: ['authentication_failure', 'info'], - category: ['authentication'], - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'demo' }, + fields: { + 'source.ip': ['45.95.168.157'], + 'host.name': ['bastion00.siem.estc.dev'], + '@timestamp': ['2020-09-04T07:23:22.000Z'], }, sort: [1599204202000], }, @@ -1993,72 +646,11 @@ export const formattedSearchStrategyResponse = { _index: '.ds-logs-system.auth-default-000001', _id: 'PqYfWXQBA6bGZw2uIhVU', _score: null, - _source: { - agent: { - hostname: 'siem-kibana', - name: 'siem-kibana', - id: 'aa3d9dc7-fef1-4c2f-a68d-25785d624e35', - ephemeral_id: 'e503bd85-11c7-4bc9-ae7d-70be1d919fb7', - type: 'filebeat', - version: '7.9.1', - }, - process: { name: 'sshd', pid: 20396 }, - log: { file: { path: '/var/log/auth.log' }, offset: 550795 }, - source: { - geo: { - continent_name: 'Asia', - region_iso_code: 'CN-BJ', - city_name: 'Beijing', - country_iso_code: 'CN', - region_name: 'Beijing', - location: { lon: 116.3889, lat: 39.9288 }, - }, - as: { - number: 45090, - organization: { - name: 'Shenzhen Tencent Computer Systems Company Limited', - }, - }, - ip: '123.206.30.76', - }, - cloud: { - availability_zone: 'us-east1-b', - instance: { name: 'siem-kibana', id: '5412578377715150143' }, - provider: 'gcp', - machine: { type: 'n1-standard-2' }, - project: { id: 'elastic-beats' }, - }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T11:20:26.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - data_stream: { namespace: 'default', type: 'logs', dataset: 'system.auth' }, - host: { - hostname: 'siem-kibana', - os: { - kernel: '4.9.0-8-amd64', - codename: 'stretch', - name: 'Debian GNU/Linux', - family: 'debian', - version: '9 (stretch)', - platform: 'debian', - }, - containerized: false, - ip: ['10.142.0.7', 'fe80::4001:aff:fe8e:7'], - name: 'siem-kibana', - id: 'aa7ca589f1b8220002f2fc61c64cfbf1', - mac: ['42:01:0a:8e:00:07'], - architecture: 'x86_64', - }, - event: { - timezone: '+00:00', - action: 'ssh_login', - type: 'authentication_failure', - category: 'authentication', - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'git' }, + fields: { + 'source.ip': ['123.206.30.76'], + 'host.id': ['aa7ca589f1b8220002f2fc61c64cfbf1'], + 'host.name': ['siem-kibana'], + '@timestamp': ['2020-09-04T11:20:26.000Z'], }, sort: [1599218426000], }, @@ -2085,48 +677,10 @@ export const formattedSearchStrategyResponse = { _index: 'filebeat-8.0.0-2020.09.02-000001', _id: 'iMABWHQBB-gskclyitP-', _score: null, - _source: { - agent: { - name: 'bastion00.siem.estc.dev', - id: 'f9a321c1-ec27-49fa-aacf-6a50ef6d836f', - type: 'filebeat', - ephemeral_id: '734ee3da-1a4f-4bc9-b400-e0cf0e5eeebc', - version: '8.0.0', - }, - process: { name: 'sshd', pid: 19870 }, - log: { file: { path: '/var/log/auth.log' }, offset: 984133 }, - source: { - geo: { - continent_name: 'Europe', - country_iso_code: 'HR', - location: { lon: 15.5, lat: 45.1667 }, - }, - as: { - number: 42864, - organization: { name: 'Giganet Internet Szolgaltato Kft' }, - }, - ip: '45.95.168.157', - }, - fileset: { name: 'auth' }, - input: { type: 'log' }, - '@timestamp': '2020-09-04T07:25:28.000Z', - system: { auth: { ssh: { event: 'Invalid' } } }, - ecs: { version: '1.5.0' }, - related: { ip: ['45.95.168.157'], user: ['webadmin'] }, - service: { type: 'system' }, - host: { hostname: 'bastion00', name: 'bastion00.siem.estc.dev' }, - event: { - ingested: '2020-09-04T07:25:30.236651Z', - timezone: '+00:00', - kind: 'event', - module: 'system', - action: 'ssh_login', - type: ['authentication_failure', 'info'], - category: ['authentication'], - dataset: 'system.auth', - outcome: 'failure', - }, - user: { name: 'webadmin' }, + fields: { + 'source.ip': ['45.95.168.157'], + 'host.name': ['bastion00.siem.estc.dev'], + '@timestamp': ['2020-09-04T07:25:28.000Z'], }, sort: [1599204328000], }, @@ -2163,7 +717,6 @@ export const formattedSearchStrategyResponse = { ], ignore_unavailable: true, body: { - docvalue_fields: mockOptions.docValueFields, aggregations: { stack_by_count: { cardinality: { field: 'user.name' } }, stack_by: { @@ -2179,7 +732,7 @@ export const formattedSearchStrategyResponse = { lastFailure: { top_hits: { size: 1, - _source: [], + _source: false, sort: [{ '@timestamp': { order: 'desc' } }], }, }, @@ -2191,7 +744,7 @@ export const formattedSearchStrategyResponse = { lastSuccess: { top_hits: { size: 1, - _source: [], + _source: false, sort: [{ '@timestamp': { order: 'desc' } }], }, }, @@ -2218,6 +771,16 @@ export const formattedSearchStrategyResponse = { }, }, size: 0, + _source: false, + fields: [ + 'source.ip', + 'host.id', + 'host.name', + { + field: '@timestamp', + format: 'strict_date_optional_time', + }, + ], }, track_total_hits: false, }, @@ -2238,7 +801,7 @@ export const formattedSearchStrategyResponse = { host: { id: ['ce1d3c9b-a815-4643-9641-ada0f2c00609'], name: ['siem-windows'] }, }, }, - cursor: { value: '', tiebreaker: null }, + cursor: { value: undefined, tiebreaker: null }, }, { node: { @@ -2252,13 +815,13 @@ export const formattedSearchStrategyResponse = { host: { id: ['aa7ca589f1b8220002f2fc61c64cfbf1'], name: ['siem-kibana'] }, }, }, - cursor: { value: '', tiebreaker: null }, + cursor: { value: undefined, tiebreaker: null }, }, { node: { failures: 23, successes: 0, - _id: 'admin+23', + _id: 'ZfxZWXQBc39KFIJbLN5U', stackedValue: ['admin'], lastFailure: { timestamp: ['2020-09-04T13:40:46.000Z'], @@ -2266,13 +829,13 @@ export const formattedSearchStrategyResponse = { host: { id: ['aa7ca589f1b8220002f2fc61c64cfbf1'], name: ['siem-kibana'] }, }, }, - cursor: { value: '', tiebreaker: null }, + cursor: { value: undefined, tiebreaker: null }, }, { node: { failures: 21, successes: 0, - _id: 'user+21', + _id: 'M_xLWXQBc39KFIJbY7Cb', stackedValue: ['user'], lastFailure: { timestamp: ['2020-09-04T13:25:43.000Z'], @@ -2280,13 +843,13 @@ export const formattedSearchStrategyResponse = { host: { name: ['bastion00.siem.estc.dev'] }, }, }, - cursor: { value: '', tiebreaker: null }, + cursor: { value: undefined, tiebreaker: null }, }, { node: { failures: 18, successes: 0, - _id: 'ubuntu+18', + _id: 'nPxKWXQBc39KFIJb7q4w', stackedValue: ['ubuntu'], lastFailure: { timestamp: ['2020-09-04T13:25:07.000Z'], @@ -2294,13 +857,13 @@ export const formattedSearchStrategyResponse = { host: { name: ['bastion00.siem.estc.dev'] }, }, }, - cursor: { value: '', tiebreaker: null }, + cursor: { value: undefined, tiebreaker: null }, }, { node: { failures: 17, successes: 0, - _id: 'odoo+17', + _id: 'mPsfWXQBc39KFIJbI8HI', stackedValue: ['odoo'], lastFailure: { timestamp: ['2020-09-04T12:26:36.000Z'], @@ -2308,13 +871,13 @@ export const formattedSearchStrategyResponse = { host: { id: ['aa7ca589f1b8220002f2fc61c64cfbf1'], name: ['siem-kibana'] }, }, }, - cursor: { value: '', tiebreaker: null }, + cursor: { value: undefined, tiebreaker: null }, }, { node: { failures: 17, successes: 0, - _id: 'pi+17', + _id: 'aaToWHQBA6bGZw2uR-St', stackedValue: ['pi'], lastFailure: { timestamp: ['2020-09-04T11:37:22.000Z'], @@ -2322,13 +885,13 @@ export const formattedSearchStrategyResponse = { host: { name: ['bastion00.siem.estc.dev'] }, }, }, - cursor: { value: '', tiebreaker: null }, + cursor: { value: undefined, tiebreaker: null }, }, { node: { failures: 14, successes: 0, - _id: 'demo+14', + _id: 'VaP_V3QBA6bGZw2upUbg', stackedValue: ['demo'], lastFailure: { timestamp: ['2020-09-04T07:23:22.000Z'], @@ -2336,13 +899,13 @@ export const formattedSearchStrategyResponse = { host: { name: ['bastion00.siem.estc.dev'] }, }, }, - cursor: { value: '', tiebreaker: null }, + cursor: { value: undefined, tiebreaker: null }, }, { node: { failures: 13, successes: 0, - _id: 'git+13', + _id: 'PqYfWXQBA6bGZw2uIhVU', stackedValue: ['git'], lastFailure: { timestamp: ['2020-09-04T11:20:26.000Z'], @@ -2350,13 +913,13 @@ export const formattedSearchStrategyResponse = { host: { id: ['aa7ca589f1b8220002f2fc61c64cfbf1'], name: ['siem-kibana'] }, }, }, - cursor: { value: '', tiebreaker: null }, + cursor: { value: undefined, tiebreaker: null }, }, { node: { failures: 13, successes: 0, - _id: 'webadmin+13', + _id: 'iMABWHQBB-gskclyitP-', stackedValue: ['webadmin'], lastFailure: { timestamp: ['2020-09-04T07:25:28.000Z'], @@ -2364,7 +927,7 @@ export const formattedSearchStrategyResponse = { host: { name: ['bastion00.siem.estc.dev'] }, }, }, - cursor: { value: '', tiebreaker: null }, + cursor: { value: undefined, tiebreaker: null }, }, ], totalCount: 188, @@ -2385,7 +948,6 @@ export const expectedDsl = { ], ignore_unavailable: true, body: { - docvalue_fields: mockOptions.docValueFields, aggregations: { stack_by_count: { cardinality: { field: 'user.name' } }, stack_by: { @@ -2399,7 +961,7 @@ export const expectedDsl = { filter: { term: { 'event.outcome': 'failure' } }, aggs: { lastFailure: { - top_hits: { size: 1, _source: [], sort: [{ '@timestamp': { order: 'desc' } }] }, + top_hits: { size: 1, _source: false, sort: [{ '@timestamp': { order: 'desc' } }] }, }, }, }, @@ -2407,7 +969,7 @@ export const expectedDsl = { filter: { term: { 'event.outcome': 'success' } }, aggs: { lastSuccess: { - top_hits: { size: 1, _source: [], sort: [{ '@timestamp': { order: 'desc' } }] }, + top_hits: { size: 1, _source: false, sort: [{ '@timestamp': { order: 'desc' } }] }, }, }, }, @@ -2431,6 +993,16 @@ export const expectedDsl = { ], }, }, + _source: false, + fields: [ + 'source.ip', + 'host.id', + 'host.name', + { + field: '@timestamp', + format: 'strict_date_optional_time', + }, + ], size: 0, }, track_total_hits: false, @@ -2441,7 +1013,7 @@ export const mockHit: AuthenticationHit = { _type: 'type-123', _id: 'id-123', _score: 10, - _source: { + fields: { '@timestamp': 'time-1', }, cursor: 'cursor-1', diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/dsl/query.dsl.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/dsl/query.dsl.ts index e018716d4c216..3c32ae3f85944 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/dsl/query.dsl.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/dsl/query.dsl.ts @@ -5,26 +5,10 @@ * 2.0. */ -import { isEmpty } from 'lodash/fp'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { UserAuthenticationsRequestOptions } from '../../../../../../../common/search_strategy/security_solution/users/authentications'; -import { sourceFieldsMap, hostFieldsMap } from '../../../../../../../common/ecs/ecs_fields'; - import { createQueryFilterClauses } from '../../../../../../utils/build_query'; -import { reduceFields } from '../../../../../../utils/build_query/reduce_fields'; - import { authenticationsFields } from '../helpers'; -import { extendMap } from '../../../../../../../common/ecs/ecs_fields/extend_map'; - -export const auditdFieldsMap: Readonly> = { - latest: '@timestamp', - 'lastSuccess.timestamp': 'lastSuccess.@timestamp', - 'lastFailure.timestamp': 'lastFailure.@timestamp', - ...{ ...extendMap('lastSuccess', sourceFieldsMap) }, - ...{ ...extendMap('lastSuccess', hostFieldsMap) }, - ...{ ...extendMap('lastFailure', sourceFieldsMap) }, - ...{ ...extendMap('lastFailure', hostFieldsMap) }, -}; export const buildQuery = ({ filterQuery, @@ -32,13 +16,7 @@ export const buildQuery = ({ timerange: { from, to }, pagination: { querySize }, defaultIndex, - docValueFields, }: UserAuthenticationsRequestOptions) => { - const esFields = reduceFields(authenticationsFields, { - ...hostFieldsMap, - ...sourceFieldsMap, - }) as string[]; - const filter = [ ...createQueryFilterClauses(filterQuery), { term: { 'event.category': 'authentication' } }, @@ -52,13 +30,13 @@ export const buildQuery = ({ }, }, ]; + const queryFields = authenticationsFields.filter((field) => field !== 'timestamp'); const dslQuery = { allow_no_indices: true, index: defaultIndex, ignore_unavailable: true, body: { - ...(!isEmpty(docValueFields) ? { docvalue_fields: docValueFields } : {}), aggregations: { stack_by_count: { cardinality: { @@ -85,7 +63,7 @@ export const buildQuery = ({ lastFailure: { top_hits: { size: 1, - _source: esFields, + _source: false, sort: [{ '@timestamp': { order: 'desc' as const } }], }, }, @@ -101,7 +79,7 @@ export const buildQuery = ({ lastSuccess: { top_hits: { size: 1, - _source: esFields, + _source: false, sort: [{ '@timestamp': { order: 'desc' as const } }], }, }, @@ -116,6 +94,14 @@ export const buildQuery = ({ }, }, size: 0, + _source: false, + fields: [ + ...queryFields, + { + field: '@timestamp', + format: 'strict_date_optional_time', + }, + ], }, track_total_hits: false, }; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.test.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.test.ts index 1e745ffcbf2ed..a8eea076ae1be 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.test.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.test.ts @@ -6,15 +6,12 @@ */ import { AuthenticationsEdges } from '../../../../../../common/search_strategy'; -import { auditdFieldsMap } from './dsl/query.dsl'; - import { formatAuthenticationData } from './helpers'; import { mockHit } from './__mocks__'; describe('#formatAuthenticationsData', () => { test('it formats a authentication with an empty set', () => { - const fields: readonly string[] = ['']; - const data = formatAuthenticationData(fields, mockHit, auditdFieldsMap); + const data = formatAuthenticationData(mockHit); const expected: AuthenticationsEdges = { cursor: { tiebreaker: null, @@ -32,8 +29,7 @@ describe('#formatAuthenticationsData', () => { }); test('it formats a authentications with a source ip correctly', () => { - const fields: readonly string[] = ['lastSuccess.source.ip']; - const data = formatAuthenticationData(fields, mockHit, auditdFieldsMap); + const data = formatAuthenticationData(mockHit); const expected: AuthenticationsEdges = { cursor: { tiebreaker: null, @@ -51,8 +47,7 @@ describe('#formatAuthenticationsData', () => { }); test('it formats a authentications with a host name only', () => { - const fields: readonly string[] = ['lastSuccess.host.name']; - const data = formatAuthenticationData(fields, mockHit, auditdFieldsMap); + const data = formatAuthenticationData(mockHit); const expected: AuthenticationsEdges = { cursor: { tiebreaker: null, @@ -70,8 +65,7 @@ describe('#formatAuthenticationsData', () => { }); test('it formats a authentications with a host id only', () => { - const fields: readonly string[] = ['lastSuccess.host.id']; - const data = formatAuthenticationData(fields, mockHit, auditdFieldsMap); + const data = formatAuthenticationData(mockHit); const expected: AuthenticationsEdges = { cursor: { tiebreaker: null, @@ -89,8 +83,7 @@ describe('#formatAuthenticationsData', () => { }); test('it formats a authentications with a host name and id correctly', () => { - const fields: readonly string[] = ['lastSuccess.host.name', 'lastSuccess.host.id']; - const data = formatAuthenticationData(fields, mockHit, auditdFieldsMap); + const data = formatAuthenticationData(mockHit); const expected: AuthenticationsEdges = { cursor: { tiebreaker: null, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts index 43baa4aadea14..46c0a83a3b572 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts @@ -7,8 +7,8 @@ import { get, getOr, isEmpty } from 'lodash/fp'; import { set } from '@elastic/safer-lodash-set/fp'; -import { mergeFieldsWithHit } from '../../../../../utils/build_query'; import { toObjectArrayOfStrings } from '../../../../../../common/utils/to_array'; +import { sourceFieldsMap, hostFieldsMap } from '../../../../../../common/ecs/ecs_fields'; import { AuthenticationsEdges, AuthenticationHit, @@ -17,78 +17,79 @@ import { StrategyResponseType, } from '../../../../../../common/search_strategy/security_solution'; -export const authenticationsFields = [ - '_id', - 'failures', - 'successes', - 'stackedValue', - 'lastSuccess.timestamp', - 'lastSuccess.source.ip', - 'lastSuccess.host.id', - 'lastSuccess.host.name', - 'lastFailure.timestamp', - 'lastFailure.source.ip', - 'lastFailure.host.id', - 'lastFailure.host.name', -]; +export const authenticationsFields = ['timestamp', 'source.ip', 'host.id', 'host.name']; +export const authenticationsFieldsMap: Readonly> = { + latest: '@timestamp', + lastSuccess: { + timestamp: '@timestamp', + ...sourceFieldsMap, + ...hostFieldsMap, + }, + lastFailure: { + timestamp: '@timestamp', + ...sourceFieldsMap, + ...hostFieldsMap, + }, +}; -export const formatAuthenticationData = ( - fields: readonly string[] = authenticationsFields, - hit: AuthenticationHit, - fieldMap: Readonly> -): AuthenticationsEdges => - fields.reduce( - (flattenedFields, fieldName) => { - if (hit.cursor) { - flattenedFields.cursor.value = hit.cursor; - } - flattenedFields.node = { - ...flattenedFields.node, - ...{ - _id: hit._id, - stackedValue: [hit.stackedValue], - failures: hit.failures, - successes: hit.successes, - }, - }; - const mergedResult = mergeFieldsWithHit(fieldName, flattenedFields, fieldMap, hit); - const fieldPath = `node.${fieldName}`; - const fieldValue = get(fieldPath, mergedResult); +export const formatAuthenticationData = (hit: AuthenticationHit): AuthenticationsEdges => { + let flattenedFields = { + node: { + _id: hit._id, + stackedValue: [hit.stackedValue], + failures: hit.failures, + successes: hit.successes, + }, + cursor: { + value: hit.cursor, + tiebreaker: null, + }, + }; + + const lastSuccessFields = getAuthenticationFields(authenticationsFields, hit, 'lastSuccess'); + if (Object.keys(lastSuccessFields).length > 0) { + flattenedFields = set('node.lastSuccess', lastSuccessFields, flattenedFields); + } + + const lastFailureFields = getAuthenticationFields(authenticationsFields, hit, 'lastFailure'); + if (Object.keys(lastFailureFields).length > 0) { + flattenedFields = set('node.lastFailure', lastFailureFields, flattenedFields); + } + + return flattenedFields; +}; + +const getAuthenticationFields = (fields: string[], hit: AuthenticationHit, parentField: string) => { + return fields.reduce((flattenedFields, fieldName) => { + const fieldPath = `${fieldName}`; + const esField = get(`${parentField}['${fieldName}']`, authenticationsFieldsMap); + + if (!isEmpty(esField)) { + const fieldValue = get(`${parentField}['${esField}']`, hit.fields); if (!isEmpty(fieldValue)) { return set( fieldPath, toObjectArrayOfStrings(fieldValue).map(({ str }) => str), - mergedResult + flattenedFields ); - } else { - return mergedResult; } - }, - { - node: { - failures: 0, - successes: 0, - _id: '', - stackedValue: [''], - }, - cursor: { - value: '', - tiebreaker: null, - }, } - ); + + return flattenedFields; + }, {}); +}; export const getHits = (response: StrategyResponseType) => getOr([], 'aggregations.stack_by.buckets', response.rawResponse).map( (bucket: AuthenticationBucket) => ({ _id: getOr( `${bucket.key}+${bucket.doc_count}`, - 'failures.lastFailure.hits.hits[0].id', + 'failures.lastFailure.hits.hits[0]._id', bucket ), - _source: { - lastSuccess: getOr(null, 'successes.lastSuccess.hits.hits[0]._source', bucket), - lastFailure: getOr(null, 'failures.lastFailure.hits.hits[0]._source', bucket), + fields: { + lastSuccess: getOr(null, 'successes.lastSuccess.hits.hits[0].fields', bucket), + lastFailure: getOr(null, 'failures.lastFailure.hits.hits[0].fields', bucket), }, stackedValue: bucket.key, failures: bucket.failures.doc_count, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.tsx b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.tsx index 5bb62f685ce4b..f2483b78dc3ef 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.tsx +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.tsx @@ -20,9 +20,9 @@ import { UsersQueries } from '../../../../../../common/search_strategy/security_ import { inspectStringifyObject } from '../../../../../utils/build_query'; import { SecuritySolutionFactory } from '../../types'; -import { auditdFieldsMap, buildQuery as buildAuthenticationQuery } from './dsl/query.dsl'; +import { buildQuery as buildAuthenticationQuery } from './dsl/query.dsl'; -import { authenticationsFields, formatAuthenticationData, getHits } from './helpers'; +import { formatAuthenticationData, getHits } from './helpers'; export const authentications: SecuritySolutionFactory = { buildDsl: (options: UserAuthenticationsRequestOptions) => { @@ -42,7 +42,7 @@ export const authentications: SecuritySolutionFactory - formatAuthenticationData(authenticationsFields, hit, auditdFieldsMap) + formatAuthenticationData(hit) ); const edges = authenticationEdges.splice(cursorStart, querySize - cursorStart); diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/details/__mocks__/index.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/details/__mocks__/index.ts index 33760eec4556e..5b54ffaf8dff8 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/details/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/details/__mocks__/index.ts @@ -12,12 +12,6 @@ import { UserDetailsRequestOptions } from '../../../../../../../common/search_st export const mockOptions: UserDetailsRequestOptions = { defaultIndex: ['test_indices*'], - docValueFields: [ - { - field: '@timestamp', - format: 'date_time', - }, - ], factoryQueryType: UsersQueries.details, filterQuery: '{"bool":{"must":[],"filter":[{"match_all":{}},{"match_phrase":{"user.name":{"query":"test_user"}}}],"should":[],"must_not":[]}}', From 71e926b2026c46137d7f4f05f5d41d1ab13618fb Mon Sep 17 00:00:00 2001 From: Julia Rechkunova Date: Fri, 29 Apr 2022 20:31:04 +0200 Subject: [PATCH 13/18] [Discover] Fix "shows top-level object keys" flaky test (#131241) --- test/functional/apps/discover/_field_data.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/apps/discover/_field_data.ts b/test/functional/apps/discover/_field_data.ts index 28f147eeab55f..d13baf9948171 100644 --- a/test/functional/apps/discover/_field_data.ts +++ b/test/functional/apps/discover/_field_data.ts @@ -89,10 +89,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); await retry.try(async function tryingForTime() { expect(await PageObjects.discover.getDocHeader()).to.contain('relatedContent'); - }); - const field = await PageObjects.discover.getDocTableIndex(1); - expect(field).to.contain('og:description'); + const field = await PageObjects.discover.getDocTableIndex(1); + expect(field).to.contain('og:description'); + }); const marks = await PageObjects.discover.getMarks(); expect(marks.length).to.be(0); From d3a750eb15dfdcfcf8395ca8eb545031aaf9c527 Mon Sep 17 00:00:00 2001 From: Jen Huang Date: Fri, 29 Apr 2022 12:10:25 -0700 Subject: [PATCH 14/18] Add match_only_text and wildcard types to default fields (#131262) --- .../template/default_settings.test.ts | 15 +++++++++++++++ .../elasticsearch/template/default_settings.ts | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/default_settings.test.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/default_settings.test.ts index 1ade871b27ef6..df1c87105bcf2 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/default_settings.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/default_settings.test.ts @@ -36,6 +36,18 @@ describe('buildDefaultSettings', () => { name: 'field2Boolean', type: 'boolean', }, + { + name: 'field3Text', + type: 'text', + }, + { + name: 'field4MatchOnlyText', + type: 'match_only_text', + }, + { + name: 'field5Wildcard', + type: 'wildcard', + }, ], }); @@ -49,6 +61,9 @@ describe('buildDefaultSettings', () => { "query": Object { "default_field": Array [ "field1Keyword", + "field3Text", + "field4MatchOnlyText", + "field5Wildcard", ], }, }, diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/default_settings.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/default_settings.ts index 7f8e8e8544109..5accf7b120f9e 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/default_settings.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/default_settings.ts @@ -8,7 +8,7 @@ import { appContextService } from '../../../app_context'; import type { Field, Fields } from '../../fields/field'; -const QUERY_DEFAULT_FIELD_TYPES = ['keyword', 'text']; +const QUERY_DEFAULT_FIELD_TYPES = ['keyword', 'text', 'match_only_text', 'wildcard']; const QUERY_DEFAULT_FIELD_LIMIT = 1024; const flattenFieldsToNameAndType = ( From b66ffe5346409d49c9a543f82cec3c9695a9f93a Mon Sep 17 00:00:00 2001 From: Shahzad Date: Fri, 29 Apr 2022 22:44:13 +0200 Subject: [PATCH 15/18] [Synthetics] Setup directory structure and new app (#131054) --- .../collectors/application_usage/schema.ts | 1 + src/plugins/telemetry/schema/oss_plugins.json | 131 +++++++++++++ .../synthetics/common/constants/plugin.ts | 3 + .../public/apps/synthetics/render_app.tsx | 26 +++ .../{lib/lib.ts => apps/synthetics_app.tsx} | 7 +- .../public/icons/heartbeat_white.svg | 11 -- x-pack/plugins/synthetics/public/index.ts | 2 +- .../uptime_page_template.test.tsx.snap | 0 .../app}/render_app.tsx | 4 +- .../app}/uptime_app.tsx | 2 +- .../app}/uptime_overview_fetcher.ts | 0 .../app}/uptime_page_template.test.tsx | 2 +- .../app}/uptime_page_template.tsx | 4 +- .../app}/use_no_data_config.ts | 2 +- .../__snapshots__/cert_monitors.test.tsx.snap | 0 .../__snapshots__/cert_search.test.tsx.snap | 0 .../__snapshots__/cert_status.test.tsx.snap | 0 .../certificates/cert_monitors.test.tsx | 0 .../components/certificates/cert_monitors.tsx | 2 +- .../certificates/cert_refresh_btn.tsx | 0 .../certificates/cert_search.test.tsx | 0 .../components/certificates/cert_search.tsx | 0 .../certificates/cert_status.test.tsx | 0 .../components/certificates/cert_status.tsx | 4 +- .../certificates/certificate_title.tsx | 0 .../certificates/certificates_list.test.tsx | 0 .../certificates/certificates_list.tsx | 2 +- .../certificates/fingerprint_col.test.tsx | 0 .../certificates/fingerprint_col.tsx | 2 +- .../components/certificates/index.ts | 0 .../components/certificates/translations.ts | 0 .../certificates/use_cert_search.ts | 4 +- .../__snapshots__/location_link.test.tsx.snap | 0 .../monitor_page_link.test.tsx.snap | 0 .../__snapshots__/monitor_tags.test.tsx.snap | 0 .../alerts/uptime_edit_alert_flyout.tsx | 0 .../chart_empty_state.test.tsx.snap | 0 .../__snapshots__/chart_wrapper.test.tsx.snap | 0 .../__snapshots__/donut_chart.test.tsx.snap | 0 .../donut_chart_legend_row.test.tsx.snap | 0 .../monitor_bar_series.test.tsx.snap | 0 .../common/charts/annotation_tooltip.tsx | 0 .../common/charts/chart_empty_state.test.tsx | 0 .../common/charts/chart_empty_state.tsx | 0 .../common/charts/chart_wrapper.test.tsx | 0 .../charts/chart_wrapper/chart_wrapper.tsx | 0 .../common/charts/chart_wrapper/index.ts | 0 .../common/charts/donut_chart.test.tsx | 0 .../components/common/charts/donut_chart.tsx | 0 .../common/charts/donut_chart_legend.test.tsx | 0 .../common/charts/donut_chart_legend.tsx | 0 .../charts/donut_chart_legend_row.test.tsx | 0 .../common/charts/donut_chart_legend_row.tsx | 0 .../common/charts/duration_chart.tsx | 2 +- .../common/charts/duration_charts.test.tsx | 2 +- .../common/charts/duration_line_bar_list.tsx | 0 .../charts/duration_line_series_list.tsx | 2 +- .../common/charts/get_tick_format.test.ts | 0 .../common/charts/get_tick_format.ts | 0 .../components/common/charts/index.ts | 0 .../common/charts/monitor_bar_series.test.tsx | 2 +- .../common/charts/monitor_bar_series.tsx | 2 +- .../common/charts/ping_histogram.test.tsx | 0 .../common/charts/ping_histogram.tsx | 2 +- .../components/common/charts/utils.test.ts | 0 .../components/common/charts/utils.ts | 0 .../components/common/header/action_menu.tsx | 0 .../header/action_menu_content.test.tsx | 0 .../common/header/action_menu_content.tsx | 2 +- .../common/header/inspector_header_link.tsx | 2 +- .../common/header/manage_monitors_btn.tsx | 4 +- .../common/header/page_tabs.test.tsx | 0 .../components/common/header/page_tabs.tsx | 2 +- .../components/common/higher_order/index.ts | 0 .../higher_order/responsive_wrapper.test.tsx | 0 .../higher_order/responsive_wrapper.tsx | 0 .../components/common/location_link.test.tsx | 0 .../components/common/location_link.tsx | 0 .../common/monitor_page_link.test.tsx | 0 .../components/common/monitor_page_link.tsx | 0 .../components/common/monitor_tags.test.tsx | 0 .../components/common/monitor_tags.tsx | 6 +- .../common/react_router_helpers/index.ts | 0 .../react_router_helpers/link_events.test.ts | 0 .../react_router_helpers/link_events.ts | 0 .../link_for_eui.test.tsx | 0 .../react_router_helpers/link_for_eui.tsx | 0 .../components/common/step_detail_link.tsx | 0 .../components/common/translations.ts | 0 .../common/uptime_date_picker.test.tsx | 0 .../components/common/uptime_date_picker.tsx | 2 +- .../browser/advanced_fields.test.tsx | 0 .../fleet_package/browser/advanced_fields.tsx | 0 .../fleet_package/browser/formatters.ts | 0 .../fleet_package/browser/normalizers.test.ts | 0 .../fleet_package/browser/normalizers.ts | 0 .../browser/script_recorder_fields.test.tsx | 0 .../browser/script_recorder_fields.tsx | 0 .../fleet_package/browser/simple_fields.tsx | 0 .../browser/source_field.test.tsx | 2 +- .../fleet_package/browser/source_field.tsx | 0 .../browser/throttling_fields.test.tsx | 0 .../browser/throttling_fields.tsx | 0 .../fleet_package/browser/uploader.tsx | 0 .../browser/zip_url_tls_fields.test.tsx | 0 .../browser/zip_url_tls_fields.tsx | 0 .../components/fleet_package/code_editor.tsx | 0 .../fleet_package/combo_box.test.tsx | 0 .../components/fleet_package/combo_box.tsx | 0 .../fleet_package/common/common_fields.tsx | 0 .../common/described_form_group_with_wrap.tsx | 0 .../fleet_package/common/enabled.tsx | 0 .../fleet_package/common/formatters.test.ts | 0 .../fleet_package/common/formatters.ts | 0 .../fleet_package/common/normalizers.test.ts | 0 .../fleet_package/common/normalizers.ts | 2 +- .../common/simple_fields_wrapper.tsx | 0 .../fleet_package/common/tls_options.tsx | 0 .../contexts/browser_context.tsx | 2 +- .../contexts/browser_context_advanced.tsx | 2 +- .../contexts/browser_provider.tsx | 0 .../fleet_package/contexts/http_context.tsx | 2 +- .../contexts/http_context_advanced.tsx | 2 +- .../fleet_package/contexts/http_provider.tsx | 0 .../fleet_package/contexts/icmp_context.tsx | 2 +- .../fleet_package/contexts/index.ts | 0 .../contexts/policy_config_context.tsx | 4 +- .../contexts/synthetics_context_providers.tsx | 0 .../fleet_package/contexts/tcp_context.tsx | 2 +- .../contexts/tcp_context_advanced.tsx | 2 +- .../fleet_package/contexts/tcp_provider.tsx | 0 .../contexts/tls_fields_context.tsx | 2 +- .../fleet_package/custom_fields.test.tsx | 0 .../fleet_package/custom_fields.tsx | 0 .../fleet_package/header_field.test.tsx | 0 .../components/fleet_package/header_field.tsx | 0 .../fleet_package/helpers/context_helpers.ts | 0 .../fleet_package/helpers/formatters.ts | 0 .../fleet_package/helpers/normalizers.ts | 0 .../fleet_package/hooks/use_policy.ts | 2 +- .../hooks/use_update_policy.test.tsx | 0 .../fleet_package/hooks/use_update_policy.ts | 0 .../http/advanced_fields.test.tsx | 0 .../fleet_package/http/advanced_fields.tsx | 0 .../fleet_package/http/formatters.ts | 0 .../fleet_package/http/normalizers.ts | 0 .../fleet_package/http/simple_fields.tsx | 0 .../icmp/advanced_fields.test.tsx | 0 .../fleet_package/icmp/advanced_fields.tsx | 0 .../fleet_package/icmp/formatters.ts | 0 .../fleet_package/icmp/normalizers.ts | 0 .../fleet_package/icmp/simple_fields.tsx | 0 .../components/fleet_package/index.tsx | 0 .../index_response_body_field.test.tsx | 0 .../index_response_body_field.tsx | 0 .../fleet_package/key_value_field.test.tsx | 0 .../fleet_package/key_value_field.tsx | 0 ...azy_synthetics_custom_assets_extension.tsx | 0 ...azy_synthetics_policy_create_extension.tsx | 0 .../lazy_synthetics_policy_edit_extension.tsx | 0 .../fleet_package/optional_label.tsx | 0 .../fleet_package/request_body_field.test.tsx | 0 .../fleet_package/request_body_field.tsx | 0 .../fleet_package/schedule_field.test.tsx | 0 .../fleet_package/schedule_field.tsx | 0 .../synthetics_custom_assets_extension.tsx | 4 +- .../synthetics_policy_create_extension.tsx | 2 +- ...s_policy_create_extension_wrapper.test.tsx | 0 ...hetics_policy_create_extension_wrapper.tsx | 0 .../synthetics_policy_edit_extension.tsx | 0 ...ics_policy_edit_extension_wrapper.test.tsx | 0 ...nthetics_policy_edit_extension_wrapper.tsx | 0 .../tcp/advanced_fields.test.tsx | 0 .../fleet_package/tcp/advanced_fields.tsx | 0 .../fleet_package/tcp/formatters.ts | 0 .../fleet_package/tcp/normalizers.ts | 0 .../fleet_package/tcp/simple_fields.tsx | 0 .../fleet_package/tls/formatters.ts | 0 .../fleet_package/tls/normalizers.ts | 0 .../fleet_package/tls_fields.test.tsx | 0 .../components/fleet_package/tls_fields.tsx | 0 .../components/fleet_package/types.tsx | 6 +- .../fleet_package/validation.test.ts | 2 +- .../components/fleet_package/validation.tsx | 0 .../monitor_charts.test.tsx.snap | 0 .../components/monitor/index.ts | 0 .../confirm_delete.test.tsx.snap | 0 .../ml_integerations.test.tsx.snap | 0 .../monitor/ml/confirm_alert_delete.tsx | 0 .../monitor/ml/confirm_delete.test.tsx | 0 .../components/monitor/ml/confirm_delete.tsx | 0 .../components/monitor/ml/index.ts | 0 .../monitor/ml/license_info.test.tsx | 0 .../components/monitor/ml/license_info.tsx | 0 .../components/monitor/ml/manage_ml_job.tsx | 2 +- .../components/monitor/ml/ml_flyout.test.tsx | 2 +- .../components/monitor/ml/ml_flyout.tsx | 0 .../monitor/ml/ml_flyout_container.tsx | 2 +- .../components/monitor/ml/ml_integeration.tsx | 2 +- .../monitor/ml/ml_integerations.test.tsx | 0 .../monitor/ml/ml_job_link.test.tsx | 0 .../components/monitor/ml/ml_job_link.tsx | 2 +- .../monitor/ml/ml_manage_job.test.tsx | 0 .../components/monitor/ml/translations.tsx | 0 .../monitor/ml/use_anomaly_alert.ts | 0 .../monitor/monitor_charts.test.tsx | 0 .../components/monitor/monitor_charts.tsx | 0 .../monitor/monitor_duration/index.ts | 0 .../monitor_duration/monitor_duration.tsx | 2 +- .../monitor_duration_container.tsx | 4 +- .../components/monitor/monitor_title.test.tsx | 2 +- .../components/monitor/monitor_title.tsx | 2 +- .../monitor/ping_histogram/index.ts | 0 .../ping_histogram_container.tsx | 0 .../__snapshots__/expanded_row.test.tsx.snap | 0 .../__snapshots__/ping_headers.test.tsx.snap | 0 .../ping_list/columns/expand_row.test.tsx | 4 +- .../monitor/ping_list/columns/expand_row.tsx | 2 +- .../monitor/ping_list/columns/failed_step.tsx | 2 +- .../monitor/ping_list/columns/ping_error.tsx | 2 +- .../monitor/ping_list/columns/ping_status.tsx | 4 +- .../ping_list/columns/ping_timestamp/index.ts | 0 .../no_image_available.test.tsx | 0 .../ping_timestamp/no_image_available.tsx | 0 .../ping_timestamp/no_image_display.test.tsx | 0 .../ping_timestamp/no_image_display.tsx | 0 .../ping_timestamp/ping_timestamp.test.tsx | 0 .../columns/ping_timestamp/ping_timestamp.tsx | 2 +- .../step_image_caption.test.tsx | 0 .../ping_timestamp/step_image_caption.tsx | 2 +- .../step_image_popover.test.tsx | 0 .../ping_timestamp/step_image_popover.tsx | 2 +- .../columns/ping_timestamp/translations.ts | 0 .../ping_list/columns/response_code.tsx | 0 .../monitor/ping_list/doc_link_body.test.tsx | 0 .../monitor/ping_list/doc_link_body.tsx | 0 .../monitor/ping_list/expanded_row.test.tsx | 2 +- .../monitor/ping_list/expanded_row.tsx | 2 +- .../components/monitor/ping_list/headers.tsx | 2 +- .../components/monitor/ping_list/index.tsx | 0 .../monitor/ping_list/location_name.tsx | 0 .../monitor/ping_list/ping_headers.test.tsx | 0 .../monitor/ping_list/ping_list.test.tsx | 2 +- .../monitor/ping_list/ping_list.tsx | 0 .../monitor/ping_list/ping_list_header.tsx | 0 .../monitor/ping_list/ping_list_table.tsx | 4 +- .../monitor/ping_list/ping_redirects.tsx | 2 +- .../monitor/ping_list/response_code.test.tsx | 0 .../monitor/ping_list/translations.ts | 0 .../components/monitor/ping_list/use_pings.ts | 4 +- .../monitor_status.bar.test.tsx.snap | 0 .../ssl_certificate.test.tsx.snap | 0 .../status_by_location.test.tsx.snap | 0 .../__snapshots__/tag_label.test.tsx.snap | 0 .../availability_reporting.test.tsx | 0 .../availability_reporting.tsx | 0 .../availability_reporting/index.ts | 0 .../location_status_tags.test.tsx | 2 +- .../location_status_tags.tsx | 4 +- .../availability_reporting/tag_label.test.tsx | 0 .../availability_reporting/tag_label.tsx | 2 +- .../monitor/status_details/index.ts | 0 .../location_availability.test.tsx | 2 +- .../location_availability.tsx | 2 +- .../monitor_status.bar.test.tsx | 2 +- .../status_details/ssl_certificate.test.tsx | 4 +- .../status_details/status_bar/index.ts | 0 .../status_bar/monitor_redirects.tsx | 2 +- .../status_bar/ssl_certificate.tsx | 4 +- .../status_bar/status_bar.test.ts | 0 .../status_details/status_bar/status_bar.tsx | 2 +- .../status_bar/status_by_location.tsx | 2 +- .../status_bar/use_status_bar.ts | 4 +- .../status_by_location.test.tsx | 2 +- .../monitor/status_details/status_details.tsx | 2 +- .../status_details_container.tsx | 2 +- .../monitor/status_details/translations.ts | 0 .../step_detail/step_detail_container.tsx | 0 .../synthetics/step_detail/step_page_nav.tsx | 0 .../step_detail/step_page_title.tsx | 0 .../step_detail/use_monitor_breadcrumb.tsx | 2 +- .../use_monitor_breadcrumbs.test.tsx | 4 +- .../use_step_waterfall_metrics.test.tsx | 0 .../step_detail/use_step_waterfall_metrics.ts | 0 .../waterfall/data_formatting.test.ts | 0 .../step_detail/waterfall/data_formatting.ts | 2 +- .../synthetics/step_detail/waterfall/types.ts | 2 +- .../waterfall_chart_container.test.tsx | 0 .../waterfall/waterfall_chart_container.tsx | 2 +- .../waterfall_chart_wrapper.test.tsx | 0 .../waterfall/waterfall_chart_wrapper.tsx | 2 +- .../waterfall/waterfall_filter.test.tsx | 0 .../waterfall/waterfall_filter.tsx | 0 .../waterfall/waterfall_flyout.test.tsx | 0 .../waterfall/waterfall_flyout.tsx | 0 .../waterfall/waterfall_sidebar_item.test.tsx | 0 .../waterfall/waterfall_sidebar_item.tsx | 0 .../monitor/synthetics/translations.ts | 0 .../monitor/synthetics/waterfall/README.md | 0 .../waterfall/components/constants.ts | 0 .../waterfall/components/legend.tsx | 0 .../components/middle_truncated_text.test.tsx | 0 .../components/middle_truncated_text.tsx | 0 .../network_requests_total.test.tsx | 0 .../components/network_requests_total.tsx | 0 .../waterfall/components/sidebar.tsx | 0 .../synthetics/waterfall/components/styles.ts | 0 .../waterfall/components/translations.ts | 0 .../components/use_bar_charts.test.tsx | 0 .../waterfall/components/use_bar_charts.ts | 0 .../waterfall/components/use_flyout.test.tsx | 0 .../waterfall/components/use_flyout.ts | 0 .../waterfall/components/waterfall.test.tsx | 0 .../components/waterfall_bar_chart.tsx | 0 .../waterfall/components/waterfall_chart.tsx | 0 .../components/waterfall_chart_fixed_axis.tsx | 0 .../components/waterfall_flyout_table.tsx | 0 .../components/waterfall_marker_icon.test.tsx | 0 .../components/waterfall_marker_icon.tsx | 0 .../waterfall_marker_test_helper.tsx | 2 +- .../waterfall_marker_trend.test.tsx | 2 +- .../components/waterfall_marker_trend.tsx | 0 .../components/waterfall_markers.tsx | 0 .../waterfall_tooltip_content.test.tsx | 0 .../components/waterfall_tooltip_content.tsx | 0 .../waterfall/context/waterfall_chart.tsx | 2 +- .../monitor/synthetics/waterfall/index.tsx | 0 .../monitor/synthetics/waterfall/types.ts | 0 .../action_bar/action_bar.test.tsx | 2 +- .../action_bar/action_bar.tsx | 4 +- .../action_bar/action_bar_errors.test.tsx | 2 +- .../action_bar/action_bar_portal.tsx | 0 .../monitor_management/add_monitor_btn.tsx | 2 +- .../monitor_management/content/index.ts | 0 .../edit_monitor_config.tsx | 4 +- .../hooks/use_enablement.ts | 0 .../hooks/use_format_monitor.ts | 4 +- .../hooks/use_inline_errors.test.tsx | 2 +- .../hooks/use_inline_errors.ts | 6 +- .../hooks/use_inline_errors_count.test.tsx | 2 +- .../hooks/use_inline_errors_count.ts | 2 +- .../hooks/use_invalid_monitors.tsx | 4 +- .../hooks/use_locations.test.tsx | 2 +- .../monitor_management/hooks/use_locations.ts | 0 .../hooks/use_run_once_errors.ts | 2 +- .../hooks/use_service_allowed.ts | 0 .../monitor_management/loader/loader.test.tsx | 0 .../monitor_management/loader/loader.tsx | 0 .../monitor_management/mocks/index.ts | 0 .../monitor_management/mocks/locations.ts | 0 .../monitor_config/locations.test.tsx | 0 .../monitor_config/locations.tsx | 2 +- .../monitor_advanced_fields.tsx | 4 +- .../monitor_config/monitor_config.test.tsx | 0 .../monitor_config/monitor_config.tsx | 4 +- .../monitor_config/monitor_fields.test.tsx | 2 +- .../monitor_config/monitor_fields.tsx | 2 +- .../monitor_config/monitor_name_location.tsx | 4 +- .../monitor_config/use_monitor_name.test.tsx | 0 .../monitor_config/use_monitor_name.ts | 2 +- .../monitor_list/actions.test.tsx | 0 .../monitor_list/actions.tsx | 2 +- .../monitor_list/all_monitors.tsx | 2 +- .../monitor_list/delete_monitor.test.tsx | 0 .../monitor_list/delete_monitor.tsx | 0 .../monitor_list/enablement_empty_state.tsx | 0 .../monitor_list/inline_error.test.tsx | 0 .../monitor_list/inline_error.tsx | 2 +- .../monitor_list/invalid_monitors.tsx | 2 +- .../monitor_list/list_tabs.test.tsx | 0 .../monitor_list/list_tabs.tsx | 2 +- .../monitor_list/monitor_async_error.test.tsx | 2 +- .../monitor_list/monitor_async_error.tsx | 0 .../monitor_list/monitor_enabled.test.tsx | 2 +- .../monitor_list/monitor_enabled.tsx | 2 +- .../monitor_list/monitor_list.test.tsx | 2 +- .../monitor_list/monitor_list.tsx | 2 +- .../monitor_list/monitor_list_container.tsx | 2 +- .../monitor_list/monitor_locations.tsx | 2 +- .../monitor_list/stderr_logs_popover.tsx | 0 .../monitor_management/monitor_list/tags.tsx | 0 .../monitor_management/show_sync_errors.tsx | 2 +- .../browser/browser_test_results.test.tsx | 0 .../browser/browser_test_results.tsx | 0 .../use_browser_run_once_monitors.test.tsx | 0 .../browser/use_browser_run_once_monitors.ts | 4 +- .../simple/simple_test_results.test.tsx | 2 +- .../simple/simple_test_results.tsx | 2 +- .../simple/use_simple_run_once_monitors.ts | 4 +- .../test_now_mode/test_now_mode.test.tsx | 2 +- .../test_now_mode/test_now_mode.tsx | 6 +- .../test_now_mode/test_result_header.test.tsx | 0 .../test_now_mode/test_result_header.tsx | 2 +- .../test_now_mode/test_run_results.tsx | 2 +- .../test_now_mode/use_tick_tick.ts | 0 .../monitor_management/validation.test.ts | 2 +- .../monitor_management/validation.ts | 4 +- .../snapshot_heading.test.tsx.snap | 0 .../alerts/alert_expression_popover.tsx | 0 .../alerts/alert_field_number.test.tsx | 0 .../overview/alerts/alert_field_number.tsx | 0 .../alerts/alert_query_bar/query_bar.tsx | 0 .../components/overview/alerts/alert_tls.tsx | 0 .../alert_monitor_status.tsx | 4 +- .../alerts/alerts_containers/alert_tls.tsx | 0 .../alerts/alerts_containers/index.ts | 0 .../toggle_alert_flyout_button.tsx | 0 .../uptime_alerts_flyout_wrapper.tsx | 0 .../alerts/alerts_containers/use_snap_shot.ts | 0 .../alerts/anomaly_alert/anomaly_alert.tsx | 0 .../alerts/anomaly_alert/select_severity.tsx | 0 .../alerts/anomaly_alert/translations.ts | 0 .../components/overview/alerts/index.ts | 0 .../down_number_select.test.tsx.snap | 0 .../time_expression_select.test.tsx.snap | 0 .../availability_expression_select.tsx | 0 .../down_number_select.test.tsx | 0 .../down_number_select.tsx | 0 .../filters_expression_select.test.tsx | 0 .../filters_expression_select.tsx | 2 +- .../alerts/monitor_expressions/index.ts | 0 .../status_expression_select.tsx | 0 .../time_expression_select.test.tsx | 0 .../time_expression_select.tsx | 0 .../time_unit_selectable.tsx | 0 .../monitor_expressions/translations.ts | 0 .../add_filter_btn.test.tsx | 0 .../monitor_status_alert/add_filter_btn.tsx | 0 .../alert_monitor_status.test.tsx | 0 .../alert_monitor_status.tsx | 2 +- .../old_alert_call_out.tsx | 0 .../old_alert_callout.test.tsx | 0 .../settings_message_expression_popover.tsx | 0 .../toggle_alert_flyout_button.test.tsx | 0 .../alerts/toggle_alert_flyout_button.tsx | 4 +- .../overview/alerts/translations.ts | 0 .../alerts/uptime_alerts_flyout_wrapper.tsx | 0 .../empty_state/empty_state_error.tsx | 0 .../empty_state/empty_state_loading.tsx | 0 .../overview/empty_state/use_has_data.tsx | 0 .../filter_group/filter_group.test.tsx | 0 .../overview/filter_group/filter_group.tsx | 2 +- .../filter_group/selected_filters.tsx | 0 .../overview/filter_group/translations.tsx | 0 .../components/overview/index.ts | 0 .../filter_status_button.test.tsx.snap | 0 .../__snapshots__/status_filter.test.tsx.snap | 0 .../columns/cert_status_column.tsx | 4 +- .../columns/define_connectors.test.tsx | 0 .../columns/define_connectors.tsx | 2 +- .../columns/enable_alert.test.tsx | 4 +- .../monitor_list/columns/enable_alert.tsx | 4 +- .../monitor_list/columns/monitor_name_col.tsx | 2 +- .../columns/monitor_status_column.test.tsx | 4 +- .../columns/monitor_status_column.tsx | 4 +- .../progress/browser_monitor_progress.tsx | 4 +- .../columns/progress/monitor_progress.tsx | 2 +- .../progress/simple_monitor_progress.tsx | 4 +- .../columns/progress/use_updated_monitor.ts | 0 .../columns/status_badge.test.tsx | 0 .../monitor_list/columns/status_badge.tsx | 4 +- .../monitor_list/columns/test_now_col.tsx | 0 .../monitor_list/columns/translations.ts | 0 .../filter_status_button.test.tsx | 0 .../monitor_list/filter_status_button.tsx | 0 .../components/overview/monitor_list/index.ts | 0 .../monitor_list/monitor_list.test.tsx | 2 +- .../overview/monitor_list/monitor_list.tsx | 4 +- .../monitor_list/monitor_list_container.tsx | 0 .../integration_group.test.tsx.snap | 0 .../integration_link.test.tsx.snap | 0 .../monitor_list_drawer.test.tsx.snap | 0 .../most_recent_error.test.tsx.snap | 0 .../actions_popover/actions_popover.tsx | 2 +- .../actions_popover_container.tsx | 0 .../actions_popover/integration_group.tsx | 2 +- .../actions_popover/integration_link.tsx | 0 .../monitor_list_drawer/data.json | 0 .../monitor_list_drawer/enabled_alerts.tsx | 0 .../monitor_list/monitor_list_drawer/index.ts | 0 .../integration_group.test.tsx | 2 +- .../integration_link.test.tsx | 0 .../list_drawer_container.tsx | 2 +- .../monitor_list_drawer.test.tsx | 2 +- .../monitor_list_drawer.tsx | 2 +- .../monitor_status_list.test.tsx | 2 +- .../monitor_status_list.tsx | 4 +- .../monitor_status_row.test.tsx | 0 .../monitor_status_row.tsx | 2 +- .../monitor_list_drawer/monitor_url.tsx | 0 .../most_recent_error.test.tsx | 2 +- .../monitor_list_drawer/most_recent_error.tsx | 2 +- .../monitor_list_drawer/most_recent_run.tsx | 2 +- .../monitor_list/monitor_list_header.tsx | 0 .../monitor_list_page_size_select.test.tsx | 0 .../monitor_list_page_size_select.tsx | 0 .../monitor_list/no_items_meesage.test.tsx | 0 .../monitor_list/no_items_message.tsx | 0 .../monitor_list/overview_page_link.tsx | 0 .../monitor_list/parse_timestamp.test.ts | 0 .../overview/monitor_list/parse_timestamp.ts | 0 .../monitor_list/status_filter.test.tsx | 0 .../overview/monitor_list/status_filter.tsx | 0 .../overview/monitor_list/translations.ts | 0 .../monitor_list/troubleshoot_popover.tsx | 0 .../components/overview/monitor_list/types.ts | 0 .../monitor_list/use_monitor_histogram.ts | 6 +- .../overview/query_bar/query_bar.tsx | 0 .../overview/query_bar/translations.ts | 0 .../overview/query_bar/use_query_bar.test.tsx | 0 .../overview/query_bar/use_query_bar.ts | 2 +- .../__snapshots__/snapshot.test.tsx.snap | 0 .../components/overview/snapshot/index.ts | 0 .../overview/snapshot/snapshot.test.tsx | 2 +- .../components/overview/snapshot/snapshot.tsx | 0 .../overview/snapshot/snapshot_heading.tsx | 0 .../overview/snapshot/use_snap_shot.ts | 0 .../overview/snapshot_heading.test.tsx | 0 .../components/overview/status_panel.tsx | 0 .../overview/synthetics_callout.test.tsx | 0 .../overview/synthetics_callout.tsx | 0 .../certificate_form.test.tsx.snap | 0 .../__snapshots__/indices_form.test.tsx.snap | 0 .../settings/add_connector_flyout.tsx | 0 .../settings/alert_defaults_form.tsx | 0 .../settings/certificate_form.test.tsx | 0 .../components/settings/certificate_form.tsx | 4 +- .../components/settings/default_email.tsx | 4 +- .../components/settings/indices_form.test.tsx | 0 .../components/settings/indices_form.tsx | 2 +- .../components/settings/settings_actions.tsx | 0 .../settings/settings_bottom_bar.tsx | 0 .../components/settings/translations.ts | 0 .../components/settings/types.ts | 0 .../settings/use_settings_errors.ts | 0 .../synthetics/check_steps/stderr_logs.tsx | 4 +- .../synthetics/check_steps/step_duration.tsx | 2 +- .../step_expanded_row/screenshot_link.tsx | 2 +- .../step_expanded_row/step_screenshots.tsx | 4 +- .../check_steps/step_field_trend.test.tsx | 2 +- .../check_steps/step_field_trend.tsx | 2 +- .../synthetics/check_steps/step_image.tsx | 2 +- .../check_steps/steps_list.test.tsx | 2 +- .../synthetics/check_steps/steps_list.tsx | 2 +- .../synthetics/check_steps/use_check_steps.ts | 0 .../check_steps/use_expanded_row.test.tsx | 4 +- .../check_steps/use_expanded_row.tsx | 2 +- .../check_steps/use_std_error_logs.ts | 2 +- .../synthetics/code_block_accordion.tsx | 0 .../synthetics/console_event.test.tsx | 0 .../components/synthetics/console_event.tsx | 2 +- .../console_output_event_list.test.tsx | 2 +- .../synthetics/console_output_event_list.tsx | 2 +- .../synthetics/empty_journey.test.tsx | 0 .../components/synthetics/empty_journey.tsx | 0 .../synthetics/executed_step.test.tsx | 2 +- .../components/synthetics/executed_step.tsx | 2 +- .../synthetics/status_badge.test.tsx | 0 .../components/synthetics/status_badge.tsx | 2 +- .../step_screenshot_display.test.tsx | 0 .../synthetics/step_screenshot_display.tsx | 2 +- .../components/synthetics/translations.ts | 0 .../{ => legacy_uptime}/contexts/index.ts | 0 .../contexts/uptime_data_view_context.tsx | 0 .../contexts/uptime_refresh_context.tsx | 0 .../contexts/uptime_settings_context.tsx | 4 +- .../uptime_startup_plugins_context.tsx | 2 +- .../contexts/uptime_theme_context.tsx | 2 +- .../use_url_params.test.tsx.snap | 0 .../public/{ => legacy_uptime}/hooks/index.ts | 0 .../hooks/update_kuery_string.ts | 2 +- .../hooks/use_breadcrumbs.test.tsx | 2 +- .../hooks/use_breadcrumbs.ts | 2 +- .../hooks/use_breakpoints.test.ts | 0 .../hooks/use_breakpoints.ts | 0 .../hooks/use_cert_status.ts | 2 +- .../hooks/use_chart_theme.ts | 0 .../hooks/use_composite_image.test.tsx | 2 +- .../hooks/use_composite_image.ts | 2 +- .../hooks/use_filter_update.test.ts | 0 .../hooks/use_filter_update.ts | 0 .../{ => legacy_uptime}/hooks/use_init_app.ts | 0 .../hooks/use_mapping_check.test.ts | 0 .../hooks/use_mapping_check.ts | 2 +- .../{ => legacy_uptime}/hooks/use_monitor.ts | 0 .../hooks/use_overview_filter_check.test.tsx | 0 .../hooks/use_overview_filter_check.ts | 0 .../hooks/use_search_text.ts | 0 .../hooks/use_selected_filters.test.tsx | 0 .../hooks/use_selected_filters.ts | 2 +- .../hooks/use_telemetry.ts | 2 +- .../hooks/use_url_params.test.tsx | 0 .../hooks/use_url_params.ts | 0 .../lib/__mocks__/screenshot_ref.mock.ts | 2 +- .../lib/__mocks__/uptime_plugin_start_mock.ts | 0 .../lib/__mocks__/uptime_store.mock.ts | 4 +- .../lib/__mocks__/use_composite_image.mock.ts | 2 +- .../lib/__mocks__/ut_router_history.mock.ts | 0 .../framework/capabilities_adapter.ts | 0 .../lib/alert_types/alert_messages.tsx | 0 .../lib/alert_types/common.ts | 0 .../lib/alert_types/duration_anomaly.tsx | 6 +- .../lib/alert_types/index.ts | 2 +- .../lazy_wrapper/duration_anomaly.tsx | 2 +- .../lazy_wrapper/monitor_status.tsx | 2 +- .../alert_types/lazy_wrapper/tls_alert.tsx | 2 +- .../lazy_wrapper/validate_monitor_status.ts | 2 +- .../lib/alert_types/monitor_status.test.ts | 0 .../lib/alert_types/monitor_status.tsx | 6 +- .../lib/alert_types/tls.tsx | 6 +- .../lib/alert_types/tls_legacy.tsx | 4 +- .../{ => legacy_uptime}/lib/formatting.ts | 0 .../lib/helper/charts/get_chart_date_label.ts | 2 +- .../helper/charts/get_label_format.test.ts | 0 .../lib/helper/charts/get_label_format.ts | 2 +- .../lib/helper/charts/index.ts | 0 .../charts/is_within_current_date.test.ts | 0 .../helper/charts/is_within_current_date.ts | 0 .../helper/compose_screenshot_images.test.ts | 2 +- .../lib/helper/compose_screenshot_images.ts | 2 +- .../lib/helper/convert_measurements.test.ts | 0 .../lib/helper/convert_measurements.ts | 0 .../lib/helper/enzyme_helpers.tsx | 0 .../lib/helper/get_title.ts | 0 .../lib/helper/helper_with_redux.tsx | 0 .../{ => legacy_uptime}/lib/helper/index.ts | 0 .../add_base_path.ts | 0 .../observability_integration/build_href.ts | 2 +- .../get_apm_href.test.ts | 2 +- .../observability_integration/get_apm_href.ts | 2 +- .../get_infra_href.test.ts | 2 +- .../get_infra_href.ts | 2 +- .../get_logging_href.test.ts | 2 +- .../get_logging_href.ts | 2 +- .../helper/observability_integration/index.ts | 0 .../lib/helper/parse_search.test.ts | 0 .../lib/helper/parse_search.ts | 0 .../lib/helper/rtl_helpers.tsx | 2 +- .../lib/helper/series_has_down_values.test.ts | 0 .../lib/helper/series_has_down_values.ts | 2 +- .../lib/helper/spy_use_fetcher.ts | 0 .../lib/helper/stringify_url_params.test.ts | 0 .../lib/helper/stringify_url_params.ts | 2 +- .../lib/helper/test_helpers.ts | 0 .../get_supported_url_params.test.ts.snap | 0 .../get_supported_url_params.test.ts | 2 +- .../url_params/get_supported_url_params.ts | 2 +- .../lib/helper/url_params/index.ts | 0 .../url_params/parse_absolute_date.test.ts | 0 .../helper/url_params/parse_absolute_date.ts | 0 .../helper/url_params/parse_is_paused.test.ts | 0 .../lib/helper/url_params/parse_is_paused.ts | 0 .../helper/url_params/parse_url_int.test.ts | 0 .../lib/helper/url_params/parse_url_int.ts | 0 .../public/{ => legacy_uptime}/lib/index.ts | 0 .../{badge.ts => legacy_uptime/lib/lib.ts} | 2 +- .../pages/certificates.test.tsx | 0 .../pages/certificates.tsx | 0 .../public/{ => legacy_uptime}/pages/index.ts | 0 .../pages/mapping_error.tsx | 0 .../pages/monitor.test.tsx | 0 .../{ => legacy_uptime}/pages/monitor.tsx | 0 .../action_bar_portal_node.tsx | 0 .../pages/monitor_management/add_monitor.tsx | 2 +- .../pages/monitor_management/bottom_bar.tsx | 0 .../pages/monitor_management/content.ts | 0 .../pages/monitor_management/edit_monitor.tsx | 4 +- .../monitor_management/monitor_management.tsx | 2 +- .../service_allowed_wrapper.test.tsx | 0 .../service_allowed_wrapper.tsx | 0 .../use_monitor_management_breadcrumbs.tsx | 4 +- .../pages/not_found.test.tsx | 0 .../{ => legacy_uptime}/pages/not_found.tsx | 0 .../pages/overview.test.tsx | 0 .../{ => legacy_uptime}/pages/overview.tsx | 0 .../pages/settings.test.tsx | 0 .../{ => legacy_uptime}/pages/settings.tsx | 4 +- .../pages/synthetics/checks_navigation.tsx | 2 +- .../pages/synthetics/step_detail_page.tsx | 2 +- .../synthetics/synthetics_checks.test.tsx | 2 +- .../pages/synthetics/synthetics_checks.tsx | 0 .../{ => legacy_uptime}/pages/translations.ts | 0 .../public/{ => legacy_uptime}/routes.tsx | 4 +- .../state/actions/alerts.ts | 0 .../state/actions/dynamic_settings.ts | 2 +- .../state/actions/index.ts | 0 .../state/actions/index_status.ts | 2 +- .../state/actions/journey.ts | 2 +- .../state/actions/ml_anomaly.ts | 0 .../state/actions/monitor.ts | 4 +- .../state/actions/monitor_duration.ts | 2 +- .../state/actions/monitor_list.ts | 5 +- .../state/actions/monitor_management.ts | 4 +- .../state/actions/monitor_status.ts | 2 +- .../state/actions/network_events.ts | 2 +- .../{ => legacy_uptime}/state/actions/ping.ts | 2 +- .../state/actions/selected_filters.ts | 0 .../state/actions/snapshot.ts | 2 +- .../state/actions/types.ts | 0 .../{ => legacy_uptime}/state/actions/ui.ts | 0 .../state/actions/utils.ts | 0 .../state/alerts/alerts.ts | 0 .../api/__snapshots__/snapshot.test.ts.snap | 0 .../state/api/alert_actions.test.ts | 0 .../state/api/alert_actions.ts | 8 +- .../{ => legacy_uptime}/state/api/alerts.ts | 10 +- .../state/api/dynamic_settings.ts | 4 +- .../{ => legacy_uptime}/state/api/index.ts | 0 .../state/api/index_status.ts | 4 +- .../{ => legacy_uptime}/state/api/journey.ts | 6 +- .../state/api/ml_anomaly.ts | 4 +- .../{ => legacy_uptime}/state/api/monitor.ts | 4 +- .../state/api/monitor_duration.ts | 2 +- .../state/api/monitor_list.ts | 4 +- .../state/api/monitor_management.ts | 6 +- .../state/api/monitor_status.ts | 4 +- .../state/api/network_events.ts | 4 +- .../{ => legacy_uptime}/state/api/ping.ts | 4 +- .../state/api/snapshot.test.ts | 2 +- .../{ => legacy_uptime}/state/api/snapshot.ts | 4 +- .../{ => legacy_uptime}/state/api/types.ts | 0 .../{ => legacy_uptime}/state/api/utils.ts | 0 .../state/certificates/certificates.ts | 0 .../state/effects/alerts.ts | 0 .../state/effects/dynamic_settings.ts | 2 +- .../state/effects/fetch_effect.test.ts | 2 +- .../state/effects/fetch_effect.ts | 0 .../state/effects/index.ts | 0 .../state/effects/index_status.ts | 0 .../state/effects/journey.test.ts | 0 .../state/effects/journey.ts | 2 +- .../state/effects/ml_anomaly.ts | 0 .../state/effects/monitor.ts | 0 .../state/effects/monitor_duration.ts | 0 .../state/effects/monitor_list.ts | 0 .../state/effects/monitor_management.ts | 0 .../state/effects/monitor_status.ts | 0 .../state/effects/network_events.ts | 2 +- .../{ => legacy_uptime}/state/effects/ping.ts | 0 .../state/effects/synthetic_journey_blocks.ts | 2 +- .../state/effects/test_now_runs.ts | 0 .../public/{ => legacy_uptime}/state/index.ts | 0 .../state/kibana_service.ts | 0 .../state/reducers/dynamic_settings.ts | 2 +- .../state/reducers/index.ts | 0 .../state/reducers/index_status.ts | 2 +- .../state/reducers/journey.ts | 2 +- .../state/reducers/ml_anomaly.ts | 0 .../state/reducers/monitor.ts | 2 +- .../state/reducers/monitor_duration.ts | 2 +- .../state/reducers/monitor_list.ts | 2 +- .../state/reducers/monitor_management.ts | 4 +- .../state/reducers/monitor_status.test.ts | 0 .../state/reducers/monitor_status.ts | 2 +- .../state/reducers/network_events.ts | 2 +- .../state/reducers/ping.ts | 2 +- .../state/reducers/ping_list.ts | 2 +- .../state/reducers/selected_filters.test.ts | 0 .../state/reducers/selected_filters.ts | 0 .../state/reducers/synthetics.test.ts | 0 .../state/reducers/synthetics.ts | 2 +- .../state/reducers/test_now_runs.ts | 2 +- .../state/reducers/types.ts | 0 .../state/reducers/ui.test.ts | 0 .../{ => legacy_uptime}/state/reducers/ui.ts | 0 .../state/reducers/utils.ts | 0 .../state/selectors/index.test.ts | 0 .../state/selectors/index.ts | 0 .../synthetics/public/{apps => }/plugin.ts | 66 ++++--- .../plugins/synthetics/server/kibana.index.ts | 6 +- x-pack/plugins/synthetics/tsconfig.json | 2 +- .../schema/xpack_plugins.json | 184 +++++++++--------- .../feature_controls/uptime_security.ts | 3 +- 773 files changed, 681 insertions(+), 500 deletions(-) create mode 100644 x-pack/plugins/synthetics/public/apps/synthetics/render_app.tsx rename x-pack/plugins/synthetics/public/{lib/lib.ts => apps/synthetics_app.tsx} (71%) delete mode 100644 x-pack/plugins/synthetics/public/icons/heartbeat_white.svg rename x-pack/plugins/synthetics/public/{apps => legacy_uptime/app}/__snapshots__/uptime_page_template.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{apps => legacy_uptime/app}/render_app.tsx (95%) rename x-pack/plugins/synthetics/public/{apps => legacy_uptime/app}/uptime_app.tsx (98%) rename x-pack/plugins/synthetics/public/{apps => legacy_uptime/app}/uptime_overview_fetcher.ts (100%) rename x-pack/plugins/synthetics/public/{apps => legacy_uptime/app}/uptime_page_template.test.tsx (96%) rename x-pack/plugins/synthetics/public/{apps => legacy_uptime/app}/uptime_page_template.tsx (95%) rename x-pack/plugins/synthetics/public/{apps => legacy_uptime/app}/use_no_data_config.ts (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/__snapshots__/cert_monitors.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/__snapshots__/cert_search.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/__snapshots__/cert_status.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/cert_monitors.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/cert_monitors.tsx (93%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/cert_refresh_btn.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/cert_search.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/cert_search.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/cert_status.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/cert_status.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/certificate_title.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/certificates_list.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/certificates_list.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/fingerprint_col.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/fingerprint_col.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/certificates/use_cert_search.ts (91%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/__snapshots__/location_link.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/__snapshots__/monitor_page_link.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/__snapshots__/monitor_tags.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/alerts/uptime_edit_alert_flyout.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/__snapshots__/chart_empty_state.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/__snapshots__/chart_wrapper.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/__snapshots__/donut_chart.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/__snapshots__/donut_chart_legend_row.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/__snapshots__/monitor_bar_series.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/annotation_tooltip.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/chart_empty_state.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/chart_empty_state.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/chart_wrapper.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/chart_wrapper/chart_wrapper.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/chart_wrapper/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/donut_chart.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/donut_chart.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/donut_chart_legend.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/donut_chart_legend.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/donut_chart_legend_row.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/donut_chart_legend_row.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/duration_chart.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/duration_charts.test.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/duration_line_bar_list.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/duration_line_series_list.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/get_tick_format.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/get_tick_format.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/monitor_bar_series.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/monitor_bar_series.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/ping_histogram.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/ping_histogram.tsx (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/utils.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/charts/utils.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/header/action_menu.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/header/action_menu_content.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/header/action_menu_content.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/header/inspector_header_link.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/header/manage_monitors_btn.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/header/page_tabs.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/header/page_tabs.tsx (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/higher_order/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/higher_order/responsive_wrapper.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/higher_order/responsive_wrapper.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/location_link.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/location_link.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/monitor_page_link.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/monitor_page_link.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/monitor_tags.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/monitor_tags.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/react_router_helpers/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/react_router_helpers/link_events.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/react_router_helpers/link_events.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/react_router_helpers/link_for_eui.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/react_router_helpers/link_for_eui.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/step_detail_link.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/uptime_date_picker.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/common/uptime_date_picker.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/browser/advanced_fields.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/browser/advanced_fields.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/browser/formatters.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/browser/normalizers.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/browser/normalizers.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/browser/script_recorder_fields.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/browser/script_recorder_fields.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/browser/simple_fields.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/browser/source_field.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/browser/source_field.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/browser/throttling_fields.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/browser/throttling_fields.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/browser/uploader.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/browser/zip_url_tls_fields.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/browser/zip_url_tls_fields.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/code_editor.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/combo_box.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/combo_box.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/common/common_fields.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/common/described_form_group_with_wrap.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/common/enabled.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/common/formatters.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/common/formatters.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/common/normalizers.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/common/normalizers.ts (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/common/simple_fields_wrapper.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/common/tls_options.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/contexts/browser_context.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/contexts/browser_context_advanced.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/contexts/browser_provider.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/contexts/http_context.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/contexts/http_context_advanced.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/contexts/http_provider.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/contexts/icmp_context.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/contexts/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/contexts/policy_config_context.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/contexts/synthetics_context_providers.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/contexts/tcp_context.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/contexts/tcp_context_advanced.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/contexts/tcp_provider.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/contexts/tls_fields_context.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/custom_fields.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/custom_fields.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/header_field.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/header_field.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/helpers/context_helpers.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/helpers/formatters.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/helpers/normalizers.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/hooks/use_policy.ts (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/hooks/use_update_policy.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/hooks/use_update_policy.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/http/advanced_fields.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/http/advanced_fields.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/http/formatters.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/http/normalizers.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/http/simple_fields.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/icmp/advanced_fields.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/icmp/advanced_fields.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/icmp/formatters.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/icmp/normalizers.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/icmp/simple_fields.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/index.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/index_response_body_field.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/index_response_body_field.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/key_value_field.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/key_value_field.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/lazy_synthetics_custom_assets_extension.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/lazy_synthetics_policy_create_extension.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/lazy_synthetics_policy_edit_extension.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/optional_label.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/request_body_field.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/request_body_field.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/schedule_field.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/schedule_field.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/synthetics_custom_assets_extension.tsx (90%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/synthetics_policy_create_extension.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/synthetics_policy_create_extension_wrapper.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/synthetics_policy_create_extension_wrapper.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/synthetics_policy_edit_extension.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/synthetics_policy_edit_extension_wrapper.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/synthetics_policy_edit_extension_wrapper.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/tcp/advanced_fields.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/tcp/advanced_fields.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/tcp/formatters.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/tcp/normalizers.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/tcp/simple_fields.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/tls/formatters.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/tls/normalizers.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/tls_fields.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/tls_fields.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/types.tsx (85%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/validation.test.ts (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/fleet_package/validation.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/__snapshots__/monitor_charts.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/__snapshots__/confirm_delete.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/confirm_alert_delete.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/confirm_delete.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/confirm_delete.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/license_info.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/license_info.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/manage_ml_job.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/ml_flyout.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/ml_flyout.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/ml_flyout_container.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/ml_integeration.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/ml_integerations.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/ml_job_link.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/ml_job_link.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/ml_manage_job.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/translations.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ml/use_anomaly_alert.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/monitor_charts.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/monitor_charts.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/monitor_duration/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/monitor_duration/monitor_duration.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/monitor_duration/monitor_duration_container.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/monitor_title.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/monitor_title.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_histogram/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_histogram/ping_histogram_container.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/__snapshots__/expanded_row.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/__snapshots__/ping_headers.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/expand_row.test.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/expand_row.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/failed_step.tsx (88%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/ping_error.tsx (91%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/ping_status.tsx (93%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/ping_timestamp/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/ping_timestamp/no_image_available.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/ping_timestamp/no_image_available.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/ping_timestamp/no_image_display.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/ping_timestamp/no_image_display.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/ping_timestamp/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/columns/response_code.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/doc_link_body.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/doc_link_body.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/expanded_row.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/expanded_row.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/headers.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/index.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/location_name.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/ping_headers.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/ping_list.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/ping_list.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/ping_list_header.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/ping_list_table.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/ping_redirects.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/response_code.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/ping_list/use_pings.ts (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/__snapshots__/ssl_certificate.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/__snapshots__/status_by_location.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/availability_reporting/__snapshots__/tag_label.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/availability_reporting/availability_reporting.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/availability_reporting/availability_reporting.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/availability_reporting/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/availability_reporting/location_status_tags.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/availability_reporting/location_status_tags.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/availability_reporting/tag_label.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/availability_reporting/tag_label.tsx (92%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/location_availability/location_availability.test.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/location_availability/location_availability.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/monitor_status.bar.test.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/ssl_certificate.test.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/status_bar/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/status_bar/monitor_redirects.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/status_bar/ssl_certificate.tsx (91%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/status_bar/status_bar.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/status_bar/status_bar.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/status_bar/status_by_location.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/status_bar/use_status_bar.ts (90%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/status_by_location.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/status_details.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/status_details_container.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/status_details/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/step_detail_container.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/step_page_nav.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/step_page_title.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/use_monitor_breadcrumb.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/use_monitor_breadcrumbs.test.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/waterfall/data_formatting.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/waterfall/data_formatting.ts (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/waterfall/types.ts (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/README.md (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/constants.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/legend.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/middle_truncated_text.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/middle_truncated_text.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/network_requests_total.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/network_requests_total.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/sidebar.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/styles.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/use_bar_charts.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/use_bar_charts.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/use_flyout.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/use_flyout.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/waterfall.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/waterfall_bar_chart.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/waterfall_chart.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/waterfall_chart_fixed_axis.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/waterfall_flyout_table.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/waterfall_marker_test_helper.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/waterfall_markers.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/context/waterfall_chart.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/index.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor/synthetics/waterfall/types.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/action_bar/action_bar.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/action_bar/action_bar.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/action_bar/action_bar_errors.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/action_bar/action_bar_portal.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/add_monitor_btn.tsx (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/content/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/edit_monitor_config.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/hooks/use_enablement.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/hooks/use_format_monitor.ts (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/hooks/use_inline_errors.test.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/hooks/use_inline_errors.ts (92%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/hooks/use_inline_errors_count.test.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/hooks/use_inline_errors_count.ts (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/hooks/use_invalid_monitors.tsx (90%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/hooks/use_locations.test.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/hooks/use_locations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/hooks/use_run_once_errors.ts (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/hooks/use_service_allowed.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/loader/loader.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/loader/loader.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/mocks/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/mocks/locations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_config/locations.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_config/locations.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_config/monitor_advanced_fields.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_config/monitor_config.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_config/monitor_config.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_config/monitor_fields.test.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_config/monitor_fields.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_config/monitor_name_location.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_config/use_monitor_name.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_config/use_monitor_name.ts (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/actions.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/actions.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/all_monitors.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/delete_monitor.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/delete_monitor.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/enablement_empty_state.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/inline_error.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/inline_error.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/invalid_monitors.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/list_tabs.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/list_tabs.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/monitor_async_error.test.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/monitor_async_error.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/monitor_enabled.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/monitor_enabled.tsx (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/monitor_list.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/monitor_list.tsx (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/monitor_list_container.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/monitor_locations.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/stderr_logs_popover.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/monitor_list/tags.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/show_sync_errors.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/test_now_mode/browser/browser_test_results.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/test_now_mode/browser/browser_test_results.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.ts (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/test_now_mode/simple/simple_test_results.test.tsx (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/test_now_mode/simple/simple_test_results.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/test_now_mode/simple/use_simple_run_once_monitors.ts (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/test_now_mode/test_now_mode.test.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/test_now_mode/test_now_mode.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/test_now_mode/test_result_header.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/test_now_mode/test_result_header.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/test_now_mode/test_run_results.tsx (93%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/test_now_mode/use_tick_tick.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/validation.test.ts (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/monitor_management/validation.ts (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/__snapshots__/snapshot_heading.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/alert_expression_popover.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/alert_field_number.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/alert_field_number.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/alert_query_bar/query_bar.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/alert_tls.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/alerts_containers/alert_monitor_status.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/alerts_containers/alert_tls.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/alerts_containers/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/alerts_containers/toggle_alert_flyout_button.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/alerts_containers/uptime_alerts_flyout_wrapper.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/alerts_containers/use_snap_shot.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/anomaly_alert/anomaly_alert.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/anomaly_alert/select_severity.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/anomaly_alert/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_expressions/availability_expression_select.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_expressions/down_number_select.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_expressions/down_number_select.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_expressions/filters_expression_select.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_expressions/filters_expression_select.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_expressions/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_expressions/status_expression_select.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_expressions/time_expression_select.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_expressions/time_expression_select.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_expressions/time_unit_selectable.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_expressions/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_status_alert/add_filter_btn.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_status_alert/add_filter_btn.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_status_alert/alert_monitor_status.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_status_alert/alert_monitor_status.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_status_alert/old_alert_call_out.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/monitor_status_alert/old_alert_callout.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/settings_message_expression_popover.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/toggle_alert_flyout_button.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/toggle_alert_flyout_button.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/alerts/uptime_alerts_flyout_wrapper.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/empty_state/empty_state_error.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/empty_state/empty_state_loading.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/empty_state/use_has_data.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/filter_group/filter_group.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/filter_group/filter_group.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/filter_group/selected_filters.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/filter_group/translations.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/__snapshots__/filter_status_button.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/__snapshots__/status_filter.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/cert_status_column.tsx (93%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/define_connectors.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/define_connectors.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/enable_alert.test.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/enable_alert.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/monitor_name_col.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/monitor_status_column.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/monitor_status_column.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/progress/browser_monitor_progress.tsx (93%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/progress/monitor_progress.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/progress/simple_monitor_progress.tsx (92%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/progress/use_updated_monitor.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/status_badge.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/status_badge.tsx (93%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/test_now_col.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/columns/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/filter_status_button.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/filter_status_button.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list.test.tsx (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_container.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_group.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_link.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/__snapshots__/most_recent_error.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover_container.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_link.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/data.json (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/enabled_alerts.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/integration_group.test.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/integration_link.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/monitor_url.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/most_recent_error.test.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_drawer/most_recent_run.tsx (93%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_header.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_page_size_select.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/monitor_list_page_size_select.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/no_items_meesage.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/no_items_message.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/overview_page_link.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/parse_timestamp.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/parse_timestamp.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/status_filter.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/status_filter.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/troubleshoot_popover.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/types.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/monitor_list/use_monitor_histogram.ts (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/query_bar/query_bar.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/query_bar/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/query_bar/use_query_bar.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/query_bar/use_query_bar.ts (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/snapshot/__snapshots__/snapshot.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/snapshot/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/snapshot/snapshot.test.tsx (91%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/snapshot/snapshot.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/snapshot/snapshot_heading.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/snapshot/use_snap_shot.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/snapshot_heading.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/status_panel.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/synthetics_callout.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/overview/synthetics_callout.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/settings/__snapshots__/certificate_form.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/settings/__snapshots__/indices_form.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/settings/add_connector_flyout.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/settings/alert_defaults_form.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/settings/certificate_form.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/settings/certificate_form.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/settings/default_email.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/settings/indices_form.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/settings/indices_form.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/settings/settings_actions.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/settings/settings_bottom_bar.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/settings/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/settings/types.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/settings/use_settings_errors.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/check_steps/stderr_logs.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/check_steps/step_duration.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/check_steps/step_expanded_row/screenshot_link.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/check_steps/step_field_trend.test.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/check_steps/step_field_trend.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/check_steps/step_image.tsx (92%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/check_steps/steps_list.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/check_steps/steps_list.tsx (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/check_steps/use_check_steps.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/check_steps/use_expanded_row.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/check_steps/use_expanded_row.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/check_steps/use_std_error_logs.ts (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/code_block_accordion.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/console_event.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/console_event.tsx (93%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/console_output_event_list.test.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/console_output_event_list.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/empty_journey.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/empty_journey.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/executed_step.test.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/executed_step.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/status_badge.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/status_badge.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/step_screenshot_display.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/step_screenshot_display.tsx (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/components/synthetics/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/contexts/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/contexts/uptime_data_view_context.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/contexts/uptime_refresh_context.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/contexts/uptime_settings_context.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/contexts/uptime_startup_plugins_context.tsx (92%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/contexts/uptime_theme_context.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/__snapshots__/use_url_params.test.tsx.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/update_kuery_string.ts (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_breadcrumbs.test.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_breadcrumbs.ts (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_breakpoints.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_breakpoints.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_cert_status.ts (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_chart_theme.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_composite_image.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_composite_image.ts (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_filter_update.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_filter_update.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_init_app.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_mapping_check.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_mapping_check.ts (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_monitor.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_overview_filter_check.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_overview_filter_check.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_search_text.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_selected_filters.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_selected_filters.ts (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_telemetry.ts (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_url_params.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/hooks/use_url_params.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/__mocks__/screenshot_ref.mock.ts (93%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/__mocks__/uptime_plugin_start_mock.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/__mocks__/uptime_store.mock.ts (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/__mocks__/use_composite_image.mock.ts (86%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/__mocks__/ut_router_history.mock.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/adapters/framework/capabilities_adapter.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/alert_types/alert_messages.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/alert_types/common.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/alert_types/duration_anomaly.tsx (86%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/alert_types/index.ts (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/alert_types/lazy_wrapper/duration_anomaly.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/alert_types/lazy_wrapper/monitor_status.tsx (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/alert_types/lazy_wrapper/tls_alert.tsx (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/alert_types/lazy_wrapper/validate_monitor_status.ts (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/alert_types/monitor_status.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/alert_types/monitor_status.tsx (89%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/alert_types/tls.tsx (85%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/alert_types/tls_legacy.tsx (88%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/formatting.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/charts/get_chart_date_label.ts (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/charts/get_label_format.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/charts/get_label_format.ts (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/charts/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/charts/is_within_current_date.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/charts/is_within_current_date.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/compose_screenshot_images.test.ts (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/compose_screenshot_images.ts (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/convert_measurements.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/convert_measurements.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/enzyme_helpers.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/get_title.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/helper_with_redux.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/observability_integration/add_base_path.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/observability_integration/build_href.ts (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/observability_integration/get_apm_href.test.ts (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/observability_integration/get_apm_href.ts (91%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/observability_integration/get_infra_href.test.ts (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/observability_integration/get_infra_href.ts (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/observability_integration/get_logging_href.test.ts (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/observability_integration/get_logging_href.ts (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/observability_integration/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/parse_search.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/parse_search.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/rtl_helpers.tsx (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/series_has_down_values.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/series_has_down_values.ts (85%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/spy_use_fetcher.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/stringify_url_params.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/stringify_url_params.ts (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/test_helpers.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/url_params/__snapshots__/get_supported_url_params.test.ts.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/url_params/get_supported_url_params.test.ts (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/url_params/get_supported_url_params.ts (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/url_params/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/url_params/parse_absolute_date.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/url_params/parse_absolute_date.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/url_params/parse_is_paused.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/url_params/parse_is_paused.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/url_params/parse_url_int.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/helper/url_params/parse_url_int.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/lib/index.ts (100%) rename x-pack/plugins/synthetics/public/{badge.ts => legacy_uptime/lib/lib.ts} (83%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/certificates.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/certificates.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/mapping_error.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/monitor.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/monitor.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/monitor_management/action_bar_portal_node.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/monitor_management/add_monitor.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/monitor_management/bottom_bar.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/monitor_management/content.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/monitor_management/edit_monitor.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/monitor_management/monitor_management.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/monitor_management/service_allowed_wrapper.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/monitor_management/service_allowed_wrapper.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/monitor_management/use_monitor_management_breadcrumbs.tsx (92%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/not_found.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/not_found.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/overview.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/overview.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/settings.test.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/settings.tsx (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/synthetics/checks_navigation.tsx (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/synthetics/step_detail_page.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/synthetics/synthetics_checks.test.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/synthetics/synthetics_checks.tsx (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/pages/translations.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/routes.tsx (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/alerts.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/dynamic_settings.ts (92%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/index_status.ts (84%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/journey.ts (91%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/ml_anomaly.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/monitor.ts (89%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/monitor_duration.ts (92%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/monitor_list.ts (91%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/monitor_management.ts (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/monitor_status.ts (91%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/network_events.ts (91%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/ping.ts (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/selected_filters.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/snapshot.ts (88%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/types.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/ui.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/actions/utils.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/alerts/alerts.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/__snapshots__/snapshot.test.ts.snap (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/alert_actions.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/alert_actions.ts (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/alerts.ts (93%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/dynamic_settings.ts (89%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/index_status.ts (85%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/journey.ts (92%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/ml_anomaly.ts (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/monitor.ts (92%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/monitor_duration.ts (91%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/monitor_list.ts (85%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/monitor_management.ts (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/monitor_status.ts (84%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/network_events.ts (89%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/ping.ts (90%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/snapshot.test.ts (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/snapshot.ts (85%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/types.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/api/utils.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/certificates/certificates.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/alerts.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/dynamic_settings.ts (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/fetch_effect.test.ts (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/fetch_effect.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/index_status.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/journey.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/journey.ts (93%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/ml_anomaly.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/monitor.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/monitor_duration.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/monitor_list.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/monitor_management.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/monitor_status.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/network_events.ts (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/ping.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/synthetic_journey_blocks.ts (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/effects/test_now_runs.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/kibana_service.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/dynamic_settings.ts (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/index.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/index_status.ts (92%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/journey.ts (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/ml_anomaly.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/monitor.ts (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/monitor_duration.ts (95%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/monitor_list.ts (97%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/monitor_management.ts (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/monitor_status.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/monitor_status.ts (96%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/network_events.ts (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/ping.ts (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/ping_list.ts (94%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/selected_filters.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/selected_filters.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/synthetics.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/synthetics.ts (99%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/test_now_runs.ts (98%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/types.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/ui.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/ui.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/reducers/utils.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/selectors/index.test.ts (100%) rename x-pack/plugins/synthetics/public/{ => legacy_uptime}/state/selectors/index.ts (100%) rename x-pack/plugins/synthetics/public/{apps => }/plugin.ts (83%) diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts index b99a65accd072..4683565b1134c 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/application_usage/schema.ts @@ -166,5 +166,6 @@ export const applicationUsageSchema = { siem: commonSchema, space_selector: commonSchema, uptime: commonSchema, + synthetics: commonSchema, ux: commonSchema, }; diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index 308be959ba67a..59d7ba693156d 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -5891,6 +5891,137 @@ } } }, + "synthetics": { + "properties": { + "appId": { + "type": "keyword", + "_meta": { + "description": "The application being tracked" + } + }, + "viewId": { + "type": "keyword", + "_meta": { + "description": "Always `main`" + } + }, + "clicks_total": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application since we started counting them" + } + }, + "clicks_7_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 7 days" + } + }, + "clicks_30_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 30 days" + } + }, + "clicks_90_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application over the last 90 days" + } + }, + "minutes_on_screen_total": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen since we started counting them." + } + }, + "minutes_on_screen_7_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 7 days" + } + }, + "minutes_on_screen_30_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 30 days" + } + }, + "minutes_on_screen_90_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen over the last 90 days" + } + }, + "views": { + "type": "array", + "items": { + "properties": { + "appId": { + "type": "keyword", + "_meta": { + "description": "The application being tracked" + } + }, + "viewId": { + "type": "keyword", + "_meta": { + "description": "The application view being tracked" + } + }, + "clicks_total": { + "type": "long", + "_meta": { + "description": "General number of clicks in the application sub view since we started counting them" + } + }, + "clicks_7_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 7 days" + } + }, + "clicks_30_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 30 days" + } + }, + "clicks_90_days": { + "type": "long", + "_meta": { + "description": "General number of clicks in the active application sub view over the last 90 days" + } + }, + "minutes_on_screen_total": { + "type": "float", + "_meta": { + "description": "Minutes the application sub view is active and on-screen since we started counting them." + } + }, + "minutes_on_screen_7_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 7 days" + } + }, + "minutes_on_screen_30_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 30 days" + } + }, + "minutes_on_screen_90_days": { + "type": "float", + "_meta": { + "description": "Minutes the application is active and on-screen active application sub view over the last 90 days" + } + } + } + } + } + } + }, "ux": { "properties": { "appId": { diff --git a/x-pack/plugins/synthetics/common/constants/plugin.ts b/x-pack/plugins/synthetics/common/constants/plugin.ts index 619e68b93109c..c0a6ed02477f5 100644 --- a/x-pack/plugins/synthetics/common/constants/plugin.ts +++ b/x-pack/plugins/synthetics/common/constants/plugin.ts @@ -21,4 +21,7 @@ export const PLUGIN = { TITLE: i18n.translate('xpack.synthetics.uptimeFeatureCatalogueTitle', { defaultMessage: 'Uptime', }), + SYNTHETICS: i18n.translate('xpack.synthetics.syntheticsFeatureCatalogueTitle', { + defaultMessage: 'Synthetics', + }), }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/render_app.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/render_app.tsx new file mode 100644 index 0000000000000..c4b05ea7a2e0c --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/render_app.tsx @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import ReactDOM from 'react-dom'; +import { AppMountParameters, CoreStart } from '@kbn/core/public'; +import { ClientPluginsSetup, ClientPluginsStart } from '../../plugin'; +import { SyntheticsApp } from '../synthetics_app'; + +export function renderApp( + core: CoreStart, + plugins: ClientPluginsSetup, + startPlugins: ClientPluginsStart, + appMountParameters: AppMountParameters, + isDev: boolean +) { + ReactDOM.render(, appMountParameters.element); + + return () => { + ReactDOM.unmountComponentAtNode(appMountParameters.element); + }; +} diff --git a/x-pack/plugins/synthetics/public/lib/lib.ts b/x-pack/plugins/synthetics/public/apps/synthetics_app.tsx similarity index 71% rename from x-pack/plugins/synthetics/public/lib/lib.ts rename to x-pack/plugins/synthetics/public/apps/synthetics_app.tsx index 80be43e97b82b..92531041157a7 100644 --- a/x-pack/plugins/synthetics/public/lib/lib.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics_app.tsx @@ -4,7 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import React from 'react'; -import { UMBadge } from '../badge'; - -export type UMUpdateBadge = (badge: UMBadge) => void; +export const SyntheticsApp = () => { + return
Synthetics App
; +}; diff --git a/x-pack/plugins/synthetics/public/icons/heartbeat_white.svg b/x-pack/plugins/synthetics/public/icons/heartbeat_white.svg deleted file mode 100644 index 866206f32f5a1..0000000000000 --- a/x-pack/plugins/synthetics/public/icons/heartbeat_white.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - \ No newline at end of file diff --git a/x-pack/plugins/synthetics/public/index.ts b/x-pack/plugins/synthetics/public/index.ts index 86170e9bc863a..cc0ad290e6f0a 100644 --- a/x-pack/plugins/synthetics/public/index.ts +++ b/x-pack/plugins/synthetics/public/index.ts @@ -6,7 +6,7 @@ */ import { PluginInitializerContext } from '@kbn/core/public'; -import { UptimePlugin } from './apps/plugin'; +import { UptimePlugin } from './plugin'; export const plugin = (initializerContext: PluginInitializerContext) => new UptimePlugin(initializerContext); diff --git a/x-pack/plugins/synthetics/public/apps/__snapshots__/uptime_page_template.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/app/__snapshots__/uptime_page_template.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/apps/__snapshots__/uptime_page_template.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/app/__snapshots__/uptime_page_template.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/apps/render_app.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/app/render_app.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/apps/render_app.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/app/render_app.tsx index 36ac093f23d0a..efb35813201ae 100644 --- a/x-pack/plugins/synthetics/public/apps/render_app.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/app/render_app.tsx @@ -14,9 +14,9 @@ import { DEFAULT_DARK_MODE, DEFAULT_TIMEPICKER_QUICK_RANGES, INTEGRATED_SOLUTIONS, -} from '../../common/constants'; +} from '../../../common/constants'; import { UptimeApp, UptimeAppProps } from './uptime_app'; -import { ClientPluginsSetup, ClientPluginsStart } from './plugin'; +import { ClientPluginsSetup, ClientPluginsStart } from '../../plugin'; export function renderApp( core: CoreStart, diff --git a/x-pack/plugins/synthetics/public/apps/uptime_app.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_app.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/apps/uptime_app.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_app.tsx index 9887fa81393bc..8d694bfe81aed 100644 --- a/x-pack/plugins/synthetics/public/apps/uptime_app.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_app.tsx @@ -18,7 +18,7 @@ import { } from '@kbn/kibana-react-plugin/public'; import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { InspectorContextProvider } from '@kbn/observability-plugin/public'; -import { ClientPluginsSetup, ClientPluginsStart } from './plugin'; +import { ClientPluginsSetup, ClientPluginsStart } from '../../plugin'; import { UMUpdateBadge } from '../lib/lib'; import { UptimeRefreshContextProvider, diff --git a/x-pack/plugins/synthetics/public/apps/uptime_overview_fetcher.ts b/x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_overview_fetcher.ts similarity index 100% rename from x-pack/plugins/synthetics/public/apps/uptime_overview_fetcher.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_overview_fetcher.ts diff --git a/x-pack/plugins/synthetics/public/apps/uptime_page_template.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_page_template.test.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/apps/uptime_page_template.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_page_template.test.tsx index 26a40074c7530..38105052f352e 100644 --- a/x-pack/plugins/synthetics/public/apps/uptime_page_template.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_page_template.test.tsx @@ -10,7 +10,7 @@ import React from 'react'; import 'jest-styled-components'; import { render } from '../lib/helper/rtl_helpers'; import { UptimePageTemplateComponent } from './uptime_page_template'; -import { OVERVIEW_ROUTE } from '../../common/constants'; +import { OVERVIEW_ROUTE } from '../../../common/constants'; import { useBreakpoints } from '../hooks/use_breakpoints'; jest.mock('../hooks/use_breakpoints', () => { diff --git a/x-pack/plugins/synthetics/public/apps/uptime_page_template.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_page_template.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/apps/uptime_page_template.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_page_template.tsx index e359916de1d22..08ebd5f06a69b 100644 --- a/x-pack/plugins/synthetics/public/apps/uptime_page_template.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/app/uptime_page_template.tsx @@ -10,8 +10,8 @@ import styled from 'styled-components'; import { EuiPageHeaderProps, EuiPageTemplateProps } from '@elastic/eui'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { useInspectorContext } from '@kbn/observability-plugin/public'; -import { CERTIFICATES_ROUTE, OVERVIEW_ROUTE } from '../../common/constants'; -import { ClientPluginsStart } from './plugin'; +import { CERTIFICATES_ROUTE, OVERVIEW_ROUTE } from '../../../common/constants'; +import { ClientPluginsStart } from '../../plugin'; import { useNoDataConfig } from './use_no_data_config'; import { EmptyStateLoading } from '../components/overview/empty_state/empty_state_loading'; import { EmptyStateError } from '../components/overview/empty_state/empty_state_error'; diff --git a/x-pack/plugins/synthetics/public/apps/use_no_data_config.ts b/x-pack/plugins/synthetics/public/legacy_uptime/app/use_no_data_config.ts similarity index 97% rename from x-pack/plugins/synthetics/public/apps/use_no_data_config.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/app/use_no_data_config.ts index 8898e42548748..c485c498e6fa7 100644 --- a/x-pack/plugins/synthetics/public/apps/use_no_data_config.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/app/use_no_data_config.ts @@ -10,7 +10,7 @@ import { useContext } from 'react'; import { useSelector } from 'react-redux'; import { KibanaPageTemplateProps, useKibana } from '@kbn/kibana-react-plugin/public'; import { UptimeSettingsContext } from '../contexts'; -import { ClientPluginsStart } from './plugin'; +import { ClientPluginsStart } from '../../plugin'; import { indexStatusSelector } from '../state/selectors'; export function useNoDataConfig(): KibanaPageTemplateProps['noDataConfig'] { diff --git a/x-pack/plugins/synthetics/public/components/certificates/__snapshots__/cert_monitors.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/__snapshots__/cert_monitors.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/certificates/__snapshots__/cert_monitors.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/__snapshots__/cert_monitors.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/certificates/__snapshots__/cert_search.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/__snapshots__/cert_search.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/certificates/__snapshots__/cert_search.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/__snapshots__/cert_search.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/certificates/__snapshots__/cert_status.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/__snapshots__/cert_status.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/certificates/__snapshots__/cert_status.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/__snapshots__/cert_status.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/certificates/cert_monitors.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_monitors.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/certificates/cert_monitors.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_monitors.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/certificates/cert_monitors.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_monitors.tsx similarity index 93% rename from x-pack/plugins/synthetics/public/components/certificates/cert_monitors.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_monitors.tsx index 30b8b572c783f..0688aae060fba 100644 --- a/x-pack/plugins/synthetics/public/components/certificates/cert_monitors.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_monitors.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiToolTip } from '@elastic/eui'; -import { CertMonitor } from '../../../common/runtime_types'; +import { CertMonitor } from '../../../../common/runtime_types'; import { MonitorPageLink } from '../common/monitor_page_link'; interface Props { diff --git a/x-pack/plugins/synthetics/public/components/certificates/cert_refresh_btn.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_refresh_btn.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/certificates/cert_refresh_btn.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_refresh_btn.tsx diff --git a/x-pack/plugins/synthetics/public/components/certificates/cert_search.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_search.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/certificates/cert_search.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_search.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/certificates/cert_search.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_search.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/certificates/cert_search.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_search.tsx diff --git a/x-pack/plugins/synthetics/public/components/certificates/cert_status.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_status.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/certificates/cert_status.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_status.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/certificates/cert_status.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_status.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/certificates/cert_status.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_status.tsx index 7ade37b33d622..ec11fc240d6a1 100644 --- a/x-pack/plugins/synthetics/public/components/certificates/cert_status.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/cert_status.tsx @@ -11,10 +11,10 @@ import styled from 'styled-components'; import { EuiHealth, EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { useSelector } from 'react-redux'; -import { Cert } from '../../../common/runtime_types'; +import { Cert } from '../../../../common/runtime_types'; import { useCertStatus } from '../../hooks'; import * as labels from './translations'; -import { CERT_STATUS } from '../../../common/constants'; +import { CERT_STATUS } from '../../../../common/constants'; import { selectDynamicSettings } from '../../state/selectors'; interface Props { diff --git a/x-pack/plugins/synthetics/public/components/certificates/certificate_title.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/certificate_title.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/certificates/certificate_title.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/certificate_title.tsx diff --git a/x-pack/plugins/synthetics/public/components/certificates/certificates_list.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/certificates_list.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/certificates/certificates_list.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/certificates_list.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/certificates/certificates_list.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/certificates_list.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/certificates/certificates_list.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/certificates_list.tsx index 44d314b52356f..381ee9cd5b792 100644 --- a/x-pack/plugins/synthetics/public/components/certificates/certificates_list.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/certificates_list.tsx @@ -11,7 +11,7 @@ import { Direction, EuiBasicTable } from '@elastic/eui'; import { CertStatus } from './cert_status'; import { CertMonitors } from './cert_monitors'; import * as labels from './translations'; -import { Cert, CertMonitor, CertResult } from '../../../common/runtime_types'; +import { Cert, CertMonitor, CertResult } from '../../../../common/runtime_types'; import { FingerprintCol } from './fingerprint_col'; import { LOADING_CERTIFICATES, NO_CERTS_AVAILABLE } from './translations'; diff --git a/x-pack/plugins/synthetics/public/components/certificates/fingerprint_col.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/fingerprint_col.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/certificates/fingerprint_col.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/fingerprint_col.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/certificates/fingerprint_col.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/fingerprint_col.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/certificates/fingerprint_col.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/fingerprint_col.tsx index fa29c0b7d1e43..dac9f239eb104 100644 --- a/x-pack/plugins/synthetics/public/components/certificates/fingerprint_col.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/fingerprint_col.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiButtonEmpty, EuiButtonIcon, EuiCopy, EuiToolTip } from '@elastic/eui'; import styled from 'styled-components'; -import { Cert } from '../../../common/runtime_types'; +import { Cert } from '../../../../common/runtime_types'; import { COPY_FINGERPRINT } from './translations'; const EmptyButton = styled(EuiButtonEmpty)` diff --git a/x-pack/plugins/synthetics/public/components/certificates/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/certificates/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/index.ts diff --git a/x-pack/plugins/synthetics/public/components/certificates/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/certificates/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/translations.ts diff --git a/x-pack/plugins/synthetics/public/components/certificates/use_cert_search.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/use_cert_search.ts similarity index 91% rename from x-pack/plugins/synthetics/public/components/certificates/use_cert_search.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/use_cert_search.ts index 47facebe4401f..4a13a7fc68d15 100644 --- a/x-pack/plugins/synthetics/public/components/certificates/use_cert_search.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/certificates/use_cert_search.ts @@ -9,7 +9,7 @@ import { useSelector } from 'react-redux'; import { useContext } from 'react'; import { createEsParams, useEsSearch } from '@kbn/observability-plugin/public'; -import { CertResult, GetCertsParams, Ping } from '../../../common/runtime_types'; +import { CertResult, GetCertsParams, Ping } from '../../../../common/runtime_types'; import { selectDynamicSettings } from '../../state/selectors'; import { @@ -20,7 +20,7 @@ import { DEFAULT_TO, getCertsRequestBody, processCertsResult, -} from '../../../common/requests/get_certs_request_body'; +} from '../../../../common/requests/get_certs_request_body'; import { UptimeRefreshContext } from '../../contexts'; export const useCertSearch = ({ diff --git a/x-pack/plugins/synthetics/public/components/common/__snapshots__/location_link.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/__snapshots__/location_link.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/__snapshots__/location_link.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/__snapshots__/location_link.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/common/__snapshots__/monitor_page_link.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/__snapshots__/monitor_page_link.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/__snapshots__/monitor_page_link.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/__snapshots__/monitor_page_link.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/common/__snapshots__/monitor_tags.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/__snapshots__/monitor_tags.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/__snapshots__/monitor_tags.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/__snapshots__/monitor_tags.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/common/alerts/uptime_edit_alert_flyout.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/alerts/uptime_edit_alert_flyout.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/alerts/uptime_edit_alert_flyout.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/alerts/uptime_edit_alert_flyout.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/charts/__snapshots__/chart_empty_state.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/__snapshots__/chart_empty_state.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/__snapshots__/chart_empty_state.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/__snapshots__/chart_empty_state.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/common/charts/__snapshots__/chart_wrapper.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/__snapshots__/chart_wrapper.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/__snapshots__/chart_wrapper.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/__snapshots__/chart_wrapper.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/common/charts/__snapshots__/donut_chart.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/__snapshots__/donut_chart.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/common/charts/__snapshots__/donut_chart_legend_row.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart_legend_row.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/__snapshots__/donut_chart_legend_row.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart_legend_row.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/common/charts/__snapshots__/monitor_bar_series.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/__snapshots__/monitor_bar_series.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/__snapshots__/monitor_bar_series.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/__snapshots__/monitor_bar_series.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/common/charts/annotation_tooltip.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/annotation_tooltip.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/annotation_tooltip.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/annotation_tooltip.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/charts/chart_empty_state.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/chart_empty_state.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/chart_empty_state.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/chart_empty_state.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/charts/chart_empty_state.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/chart_empty_state.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/chart_empty_state.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/chart_empty_state.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/charts/chart_wrapper.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/chart_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/chart_wrapper.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/chart_wrapper.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/charts/chart_wrapper/chart_wrapper.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/chart_wrapper/chart_wrapper.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/chart_wrapper/chart_wrapper.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/chart_wrapper/chart_wrapper.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/charts/chart_wrapper/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/chart_wrapper/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/chart_wrapper/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/chart_wrapper/index.ts diff --git a/x-pack/plugins/synthetics/public/components/common/charts/donut_chart.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/donut_chart.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/donut_chart.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/donut_chart.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/charts/donut_chart.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/donut_chart.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/donut_chart.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/donut_chart.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/charts/donut_chart_legend.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/donut_chart_legend.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/donut_chart_legend.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/donut_chart_legend.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/charts/donut_chart_legend.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/donut_chart_legend.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/donut_chart_legend.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/donut_chart_legend.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/charts/donut_chart_legend_row.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/donut_chart_legend_row.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/donut_chart_legend_row.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/donut_chart_legend_row.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/charts/donut_chart_legend_row.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/donut_chart_legend_row.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/donut_chart_legend_row.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/donut_chart_legend_row.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/charts/duration_chart.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/duration_chart.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/common/charts/duration_chart.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/duration_chart.tsx index 2d82fbf1368b8..eb591fd538d98 100644 --- a/x-pack/plugins/synthetics/public/components/common/charts/duration_chart.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/duration_chart.tsx @@ -20,7 +20,7 @@ import { } from '@elastic/charts'; import { useSelector } from 'react-redux'; import { getChartDateLabel } from '../../../lib/helper'; -import { LocationDurationLine } from '../../../../common/types'; +import { LocationDurationLine } from '../../../../../common/types'; import { DurationLineSeriesList } from './duration_line_series_list'; import { ChartWrapper } from './chart_wrapper'; import { useUrlParams } from '../../../hooks'; diff --git a/x-pack/plugins/synthetics/public/components/common/charts/duration_charts.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/duration_charts.test.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/common/charts/duration_charts.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/duration_charts.test.tsx index fee4143df11f9..fc24e723528c9 100644 --- a/x-pack/plugins/synthetics/public/components/common/charts/duration_charts.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/duration_charts.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import DateMath from '@kbn/datemath'; import { DurationChartComponent } from './duration_chart'; -import { MonitorDurationResult } from '../../../../common/types'; +import { MonitorDurationResult } from '../../../../../common/types'; import { render } from '../../../lib/helper/rtl_helpers'; describe('MonitorCharts component', () => { diff --git a/x-pack/plugins/synthetics/public/components/common/charts/duration_line_bar_list.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/duration_line_bar_list.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/duration_line_bar_list.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/duration_line_bar_list.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/charts/duration_line_series_list.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/duration_line_series_list.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/common/charts/duration_line_series_list.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/duration_line_series_list.tsx index bc744be163223..3f8c2abb9fc2c 100644 --- a/x-pack/plugins/synthetics/public/components/common/charts/duration_line_series_list.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/duration_line_series_list.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { LineSeries, CurveType, Fit, ScaleType } from '@elastic/charts'; -import { LocationDurationLine } from '../../../../common/types'; +import { LocationDurationLine } from '../../../../../common/types'; import { microToMilli, microToSec } from '../../../lib/formatting'; import { MS_LABEL, SEC_LABEL } from '../translations'; diff --git a/x-pack/plugins/synthetics/public/components/common/charts/get_tick_format.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/get_tick_format.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/get_tick_format.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/get_tick_format.test.ts diff --git a/x-pack/plugins/synthetics/public/components/common/charts/get_tick_format.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/get_tick_format.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/get_tick_format.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/get_tick_format.ts diff --git a/x-pack/plugins/synthetics/public/components/common/charts/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/index.ts diff --git a/x-pack/plugins/synthetics/public/components/common/charts/monitor_bar_series.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/monitor_bar_series.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/common/charts/monitor_bar_series.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/monitor_bar_series.test.tsx index 792b357b3baba..e8a2afbd8af23 100644 --- a/x-pack/plugins/synthetics/public/components/common/charts/monitor_bar_series.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/monitor_bar_series.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { MonitorBarSeries, MonitorBarSeriesProps } from './monitor_bar_series'; import { renderWithRouter, shallowWithRouter, MountWithReduxProvider } from '../../../lib'; -import { HistogramPoint } from '../../../../common/runtime_types'; +import { HistogramPoint } from '../../../../../common/runtime_types'; describe('MonitorBarSeries component', () => { let props: MonitorBarSeriesProps; diff --git a/x-pack/plugins/synthetics/public/components/common/charts/monitor_bar_series.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/monitor_bar_series.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/common/charts/monitor_bar_series.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/monitor_bar_series.tsx index 6bb52a025154f..35b2b830d91bd 100644 --- a/x-pack/plugins/synthetics/public/components/common/charts/monitor_bar_series.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/monitor_bar_series.tsx @@ -22,7 +22,7 @@ import React, { useContext } from 'react'; import moment from 'moment'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiToolTip } from '@elastic/eui'; -import { HistogramPoint } from '../../../../common/runtime_types'; +import { HistogramPoint } from '../../../../../common/runtime_types'; import { getChartDateLabel, seriesHasDownValues } from '../../../lib/helper'; import { useUrlParams } from '../../../hooks'; import { UptimeThemeContext } from '../../../contexts'; diff --git a/x-pack/plugins/synthetics/public/components/common/charts/ping_histogram.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/ping_histogram.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/ping_histogram.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/ping_histogram.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/charts/ping_histogram.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/ping_histogram.tsx similarity index 99% rename from x-pack/plugins/synthetics/public/components/common/charts/ping_histogram.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/ping_histogram.tsx index 95b5791bced8a..c3f9f5086ec9b 100644 --- a/x-pack/plugins/synthetics/public/components/common/charts/ping_histogram.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/ping_histogram.tsx @@ -28,7 +28,7 @@ import { createExploratoryViewUrl } from '@kbn/observability-plugin/public'; import { getChartDateLabel } from '../../../lib/helper'; import { ChartWrapper } from './chart_wrapper'; import { UptimeThemeContext } from '../../../contexts'; -import { HistogramResult } from '../../../../common/runtime_types'; +import { HistogramResult } from '../../../../../common/runtime_types'; import { useMonitorId, useUrlParams } from '../../../hooks'; import { ChartEmptyState } from './chart_empty_state'; import { getDateRangeFromChartElement } from './utils'; diff --git a/x-pack/plugins/synthetics/public/components/common/charts/utils.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/utils.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/utils.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/utils.test.ts diff --git a/x-pack/plugins/synthetics/public/components/common/charts/utils.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/utils.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/charts/utils.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/charts/utils.ts diff --git a/x-pack/plugins/synthetics/public/components/common/header/action_menu.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/action_menu.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/header/action_menu.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/action_menu.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/header/action_menu_content.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/action_menu_content.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/header/action_menu_content.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/action_menu_content.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/header/action_menu_content.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/action_menu_content.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/common/header/action_menu_content.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/action_menu_content.tsx index 311c76c87a845..1fb150bd9e70e 100644 --- a/x-pack/plugins/synthetics/public/components/common/header/action_menu_content.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/action_menu_content.tsx @@ -16,7 +16,7 @@ import { useKibana } from '@kbn/kibana-react-plugin/public'; import { useUptimeSettingsContext } from '../../../contexts/uptime_settings_context'; import { useGetUrlParams } from '../../../hooks'; import { ToggleAlertFlyoutButton } from '../../overview/alerts/alerts_containers'; -import { MONITOR_ROUTE, SETTINGS_ROUTE } from '../../../../common/constants'; +import { MONITOR_ROUTE, SETTINGS_ROUTE } from '../../../../../common/constants'; import { stringifyUrlParams } from '../../../lib/helper/stringify_url_params'; import { InspectorHeaderLink } from './inspector_header_link'; import { monitorStatusSelector } from '../../../state/selectors'; diff --git a/x-pack/plugins/synthetics/public/components/common/header/inspector_header_link.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/inspector_header_link.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/common/header/inspector_header_link.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/inspector_header_link.tsx index aa3e53be500cd..a7c8c3790a50c 100644 --- a/x-pack/plugins/synthetics/public/components/common/header/inspector_header_link.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/inspector_header_link.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { enableInspectEsQueries, useInspectorContext } from '@kbn/observability-plugin/public'; -import { ClientPluginsStart } from '../../../apps/plugin'; +import { ClientPluginsStart } from '../../../../plugin'; import { useUptimeSettingsContext } from '../../../contexts/uptime_settings_context'; export function InspectorHeaderLink() { diff --git a/x-pack/plugins/synthetics/public/components/common/header/manage_monitors_btn.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/manage_monitors_btn.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/common/header/manage_monitors_btn.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/manage_monitors_btn.tsx index 0e7215c0f5a03..2d0ac2654b71f 100644 --- a/x-pack/plugins/synthetics/public/components/common/header/manage_monitors_btn.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/manage_monitors_btn.tsx @@ -13,9 +13,9 @@ import { useHistory } from 'react-router-dom'; import useLocalStorage from 'react-use/lib/useLocalStorage'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { MONITOR_MANAGEMENT_ROUTE } from '../../../../common/constants'; +import { MONITOR_MANAGEMENT_ROUTE } from '../../../../../common/constants'; import { PUBLIC_BETA_DESCRIPTION } from '../../../pages/monitor_management/service_allowed_wrapper'; -import { ClientPluginsSetup } from '../../../apps/plugin'; +import { ClientPluginsSetup } from '../../../../plugin'; import { useUptimeSettingsContext } from '../../../contexts/uptime_settings_context'; export const ManageMonitorsBtn = () => { diff --git a/x-pack/plugins/synthetics/public/components/common/header/page_tabs.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/page_tabs.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/header/page_tabs.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/page_tabs.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/header/page_tabs.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/page_tabs.tsx similarity index 99% rename from x-pack/plugins/synthetics/public/components/common/header/page_tabs.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/page_tabs.tsx index 1210dbb0f2290..9711a9d7acb9e 100644 --- a/x-pack/plugins/synthetics/public/components/common/header/page_tabs.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/header/page_tabs.tsx @@ -10,7 +10,7 @@ import React, { useEffect, useState } from 'react'; import { EuiTabs, EuiTab } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { useHistory, useRouteMatch } from 'react-router-dom'; -import { CERTIFICATES_ROUTE, OVERVIEW_ROUTE } from '../../../../common/constants'; +import { CERTIFICATES_ROUTE, OVERVIEW_ROUTE } from '../../../../../common/constants'; import { useGetUrlParams } from '../../../hooks'; import { stringifyUrlParams } from '../../../lib/helper/stringify_url_params'; diff --git a/x-pack/plugins/synthetics/public/components/common/higher_order/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/higher_order/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/higher_order/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/higher_order/index.ts diff --git a/x-pack/plugins/synthetics/public/components/common/higher_order/responsive_wrapper.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/higher_order/responsive_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/higher_order/responsive_wrapper.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/higher_order/responsive_wrapper.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/higher_order/responsive_wrapper.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/higher_order/responsive_wrapper.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/higher_order/responsive_wrapper.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/higher_order/responsive_wrapper.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/location_link.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/location_link.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/location_link.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/location_link.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/location_link.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/location_link.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/location_link.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/location_link.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/monitor_page_link.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/monitor_page_link.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/monitor_page_link.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/monitor_page_link.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/monitor_page_link.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/monitor_page_link.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/monitor_page_link.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/monitor_page_link.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/monitor_tags.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/monitor_tags.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/monitor_tags.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/monitor_tags.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/monitor_tags.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/monitor_tags.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/components/common/monitor_tags.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/monitor_tags.tsx index e8e8a61e7b303..14e185e3e9318 100644 --- a/x-pack/plugins/synthetics/public/components/common/monitor_tags.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/monitor_tags.tsx @@ -10,13 +10,13 @@ import { EuiBadge, EuiBadgeGroup, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { useHistory } from 'react-router-dom'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { Ping } from '../../../common/runtime_types/ping'; -import { MonitorSummary } from '../../../common/runtime_types/monitor'; +import { Ping } from '../../../../common/runtime_types/ping'; +import { MonitorSummary } from '../../../../common/runtime_types/monitor'; import { useFilterUpdate } from '../../hooks/use_filter_update'; import { useGetUrlParams } from '../../hooks'; import { parseCurrentFilters } from '../overview/monitor_list/columns/monitor_name_col'; import { EXPAND_TAGS_LABEL } from '../overview/monitor_list/columns/translations'; -import { OVERVIEW_ROUTE } from '../../../common/constants'; +import { OVERVIEW_ROUTE } from '../../../../common/constants'; interface Props { ping?: Ping | null; diff --git a/x-pack/plugins/synthetics/public/components/common/react_router_helpers/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/react_router_helpers/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/react_router_helpers/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/react_router_helpers/index.ts diff --git a/x-pack/plugins/synthetics/public/components/common/react_router_helpers/link_events.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/react_router_helpers/link_events.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/react_router_helpers/link_events.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/react_router_helpers/link_events.test.ts diff --git a/x-pack/plugins/synthetics/public/components/common/react_router_helpers/link_events.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/react_router_helpers/link_events.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/react_router_helpers/link_events.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/react_router_helpers/link_events.ts diff --git a/x-pack/plugins/synthetics/public/components/common/react_router_helpers/link_for_eui.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/react_router_helpers/link_for_eui.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/react_router_helpers/link_for_eui.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/react_router_helpers/link_for_eui.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/react_router_helpers/link_for_eui.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/react_router_helpers/link_for_eui.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/react_router_helpers/link_for_eui.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/react_router_helpers/link_for_eui.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/step_detail_link.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/step_detail_link.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/step_detail_link.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/step_detail_link.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/translations.ts diff --git a/x-pack/plugins/synthetics/public/components/common/uptime_date_picker.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/uptime_date_picker.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/common/uptime_date_picker.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/uptime_date_picker.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/common/uptime_date_picker.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/uptime_date_picker.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/common/uptime_date_picker.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/common/uptime_date_picker.tsx index f509f9b53114b..ff01b9cb352ee 100644 --- a/x-pack/plugins/synthetics/public/components/common/uptime_date_picker.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/common/uptime_date_picker.tsx @@ -8,7 +8,7 @@ import React, { useContext, useEffect } from 'react'; import { EuiSuperDatePicker } from '@elastic/eui'; import { useUrlParams } from '../../hooks'; -import { CLIENT_DEFAULTS } from '../../../common/constants'; +import { CLIENT_DEFAULTS } from '../../../../common/constants'; import { UptimeRefreshContext, UptimeSettingsContext, diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/browser/advanced_fields.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/advanced_fields.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/browser/advanced_fields.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/advanced_fields.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/browser/advanced_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/advanced_fields.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/browser/advanced_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/advanced_fields.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/browser/formatters.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/formatters.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/browser/formatters.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/formatters.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/browser/normalizers.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/normalizers.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/browser/normalizers.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/normalizers.test.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/browser/normalizers.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/normalizers.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/browser/normalizers.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/normalizers.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/browser/script_recorder_fields.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/script_recorder_fields.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/browser/script_recorder_fields.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/script_recorder_fields.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/browser/script_recorder_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/script_recorder_fields.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/browser/script_recorder_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/script_recorder_fields.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/browser/simple_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/simple_fields.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/browser/simple_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/simple_fields.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/browser/source_field.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/source_field.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/fleet_package/browser/source_field.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/source_field.test.tsx index ae5db0662dd85..97001df29a69e 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/browser/source_field.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/source_field.test.tsx @@ -8,7 +8,7 @@ import 'jest-canvas-mock'; import React from 'react'; import { fireEvent, screen, waitFor } from '@testing-library/react'; -import { ConfigKey } from '../../../../common/runtime_types'; +import { ConfigKey } from '../../../../../common/runtime_types'; import { render } from '../../../lib/helper/rtl_helpers'; import { IPolicyConfigContextProvider } from '../contexts/policy_config_context'; import { SourceField, defaultValues } from './source_field'; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/browser/source_field.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/source_field.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/browser/source_field.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/source_field.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/browser/throttling_fields.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/throttling_fields.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/browser/throttling_fields.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/throttling_fields.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/browser/throttling_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/throttling_fields.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/browser/throttling_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/throttling_fields.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/browser/uploader.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/uploader.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/browser/uploader.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/uploader.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/browser/zip_url_tls_fields.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/zip_url_tls_fields.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/browser/zip_url_tls_fields.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/zip_url_tls_fields.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/browser/zip_url_tls_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/zip_url_tls_fields.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/browser/zip_url_tls_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/browser/zip_url_tls_fields.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/code_editor.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/code_editor.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/code_editor.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/code_editor.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/combo_box.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/combo_box.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/combo_box.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/combo_box.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/combo_box.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/combo_box.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/combo_box.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/combo_box.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/common/common_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/common_fields.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/common/common_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/common_fields.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/common/described_form_group_with_wrap.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/described_form_group_with_wrap.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/common/described_form_group_with_wrap.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/described_form_group_with_wrap.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/common/enabled.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/enabled.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/common/enabled.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/enabled.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/common/formatters.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/formatters.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/common/formatters.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/formatters.test.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/common/formatters.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/formatters.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/common/formatters.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/formatters.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/common/normalizers.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/normalizers.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/common/normalizers.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/normalizers.test.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/common/normalizers.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/normalizers.ts similarity index 98% rename from x-pack/plugins/synthetics/public/components/fleet_package/common/normalizers.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/normalizers.ts index 3cb312488868c..0119b415faed8 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/common/normalizers.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/normalizers.ts @@ -11,7 +11,7 @@ import { DEFAULT_COMMON_FIELDS, DEFAULT_NAMESPACE_STRING, DEFAULT_FIELDS, -} from '../../../../common/constants/monitor_defaults'; +} from '../../../../../common/constants/monitor_defaults'; // TO DO: create a standard input format that all fields resolve to export type Normalizer = (fields: NewPackagePolicyInput['vars']) => unknown; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/common/simple_fields_wrapper.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/simple_fields_wrapper.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/common/simple_fields_wrapper.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/simple_fields_wrapper.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/common/tls_options.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/tls_options.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/common/tls_options.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/common/tls_options.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_context.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/browser_context.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_context.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/browser_context.tsx index aecd9091c3276..e89e4dcd1d5bd 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_context.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/browser_context.tsx @@ -7,7 +7,7 @@ import React, { createContext, useContext, useMemo, useState } from 'react'; import { BrowserSimpleFields } from '../types'; -import { DEFAULT_BROWSER_SIMPLE_FIELDS } from '../../../../common/constants/monitor_defaults'; +import { DEFAULT_BROWSER_SIMPLE_FIELDS } from '../../../../../common/constants/monitor_defaults'; interface BrowserSimpleFieldsContext { setFields: React.Dispatch>; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_context_advanced.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/browser_context_advanced.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_context_advanced.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/browser_context_advanced.tsx index 114491d890394..d81e1dc631ee2 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_context_advanced.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/browser_context_advanced.tsx @@ -7,7 +7,7 @@ import React, { createContext, useContext, useMemo, useState } from 'react'; import { BrowserAdvancedFields } from '../types'; -import { DEFAULT_BROWSER_ADVANCED_FIELDS } from '../../../../common/constants/monitor_defaults'; +import { DEFAULT_BROWSER_ADVANCED_FIELDS } from '../../../../../common/constants/monitor_defaults'; interface BrowserAdvancedFieldsContext { setFields: React.Dispatch>; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_provider.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/browser_provider.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/contexts/browser_provider.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/browser_provider.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_context.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/http_context.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_context.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/http_context.tsx index 092c938b63f7e..d45dfc01f0de6 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_context.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/http_context.tsx @@ -7,7 +7,7 @@ import React, { createContext, useContext, useMemo, useState } from 'react'; import { HTTPSimpleFields } from '../types'; -import { DEFAULT_HTTP_SIMPLE_FIELDS } from '../../../../common/constants/monitor_defaults'; +import { DEFAULT_HTTP_SIMPLE_FIELDS } from '../../../../../common/constants/monitor_defaults'; interface HTTPSimpleFieldsContext { setFields: React.Dispatch>; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_context_advanced.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/http_context_advanced.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_context_advanced.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/http_context_advanced.tsx index 19355d38b9486..549f314bc3d3a 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_context_advanced.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/http_context_advanced.tsx @@ -7,7 +7,7 @@ import React, { createContext, useContext, useMemo, useState } from 'react'; import { HTTPAdvancedFields } from '../types'; -import { DEFAULT_HTTP_ADVANCED_FIELDS } from '../../../../common/constants/monitor_defaults'; +import { DEFAULT_HTTP_ADVANCED_FIELDS } from '../../../../../common/constants/monitor_defaults'; interface HTTPAdvancedFieldsContext { setFields: React.Dispatch>; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_provider.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/http_provider.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/contexts/http_provider.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/http_provider.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/icmp_context.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/icmp_context.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/components/fleet_package/contexts/icmp_context.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/icmp_context.tsx index 39409e4ed76a5..4e7667650ff10 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/icmp_context.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/icmp_context.tsx @@ -7,7 +7,7 @@ import React, { createContext, useContext, useMemo, useState } from 'react'; import { ICMPSimpleFields } from '../types'; -import { DEFAULT_ICMP_SIMPLE_FIELDS } from '../../../../common/constants/monitor_defaults'; +import { DEFAULT_ICMP_SIMPLE_FIELDS } from '../../../../../common/constants/monitor_defaults'; interface ICMPSimpleFieldsContext { setFields: React.Dispatch>; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/contexts/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/index.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/policy_config_context.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/policy_config_context.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/fleet_package/contexts/policy_config_context.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/policy_config_context.tsx index a9d5df172d83c..49f83d9577661 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/policy_config_context.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/policy_config_context.tsx @@ -6,13 +6,13 @@ */ import React, { createContext, useContext, useMemo, useState } from 'react'; -import { DEFAULT_NAMESPACE_STRING } from '../../../../common/constants/monitor_defaults'; +import { DEFAULT_NAMESPACE_STRING } from '../../../../../common/constants/monitor_defaults'; import { ScheduleUnit, MonitorServiceLocations, ThrottlingOptions, DEFAULT_THROTTLING, -} from '../../../../common/runtime_types'; +} from '../../../../../common/runtime_types'; import { DataStream } from '../types'; interface IPolicyConfigContext { diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/synthetics_context_providers.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/synthetics_context_providers.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/contexts/synthetics_context_providers.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/synthetics_context_providers.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_context.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/tcp_context.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_context.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/tcp_context.tsx index ca6788f380118..9b3e1052100e9 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_context.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/tcp_context.tsx @@ -7,7 +7,7 @@ import React, { createContext, useContext, useMemo, useState } from 'react'; import { TCPSimpleFields } from '../types'; -import { DEFAULT_TCP_SIMPLE_FIELDS } from '../../../../common/constants/monitor_defaults'; +import { DEFAULT_TCP_SIMPLE_FIELDS } from '../../../../../common/constants/monitor_defaults'; interface TCPSimpleFieldsContext { setFields: React.Dispatch>; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_context_advanced.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/tcp_context_advanced.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_context_advanced.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/tcp_context_advanced.tsx index 0a26cb83d9aa0..8d1174ed96bc6 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_context_advanced.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/tcp_context_advanced.tsx @@ -7,7 +7,7 @@ import React, { createContext, useContext, useMemo, useState } from 'react'; import { TCPAdvancedFields } from '../types'; -import { DEFAULT_TCP_ADVANCED_FIELDS } from '../../../../common/constants/monitor_defaults'; +import { DEFAULT_TCP_ADVANCED_FIELDS } from '../../../../../common/constants/monitor_defaults'; interface TCPAdvancedFieldsContext { setFields: React.Dispatch>; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_provider.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/tcp_provider.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/contexts/tcp_provider.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/tcp_provider.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tls_fields_context.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/tls_fields_context.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/components/fleet_package/contexts/tls_fields_context.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/tls_fields_context.tsx index 7ed41694000b9..14ec64bf640b7 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/contexts/tls_fields_context.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/contexts/tls_fields_context.tsx @@ -7,7 +7,7 @@ import React, { createContext, useContext, useMemo, useState } from 'react'; import { TLSFields } from '../types'; -import { DEFAULT_TLS_FIELDS } from '../../../../common/constants/monitor_defaults'; +import { DEFAULT_TLS_FIELDS } from '../../../../../common/constants/monitor_defaults'; interface TLSFieldsContext { setFields: React.Dispatch>; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/custom_fields.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/custom_fields.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/custom_fields.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/custom_fields.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/custom_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/custom_fields.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/custom_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/custom_fields.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/header_field.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/header_field.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/header_field.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/header_field.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/header_field.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/header_field.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/header_field.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/header_field.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/helpers/context_helpers.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/helpers/context_helpers.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/helpers/context_helpers.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/helpers/context_helpers.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/helpers/formatters.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/helpers/formatters.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/helpers/formatters.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/helpers/formatters.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/helpers/normalizers.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/helpers/normalizers.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/helpers/normalizers.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/helpers/normalizers.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/hooks/use_policy.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/hooks/use_policy.ts similarity index 97% rename from x-pack/plugins/synthetics/public/components/fleet_package/hooks/use_policy.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/hooks/use_policy.ts index 8cef83a925515..9f43cbb238a79 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/hooks/use_policy.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/hooks/use_policy.ts @@ -26,7 +26,7 @@ import { useBrowserSimpleFieldsContext, useBrowserAdvancedFieldsContext, } from '../contexts'; -import { DEFAULT_FIELDS } from '../../../../common/constants/monitor_defaults'; +import { DEFAULT_FIELDS } from '../../../../../common/constants/monitor_defaults'; export const defaultConfig: PolicyConfig = DEFAULT_FIELDS; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/hooks/use_update_policy.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/hooks/use_update_policy.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/hooks/use_update_policy.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/hooks/use_update_policy.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/hooks/use_update_policy.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/hooks/use_update_policy.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/hooks/use_update_policy.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/hooks/use_update_policy.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/http/advanced_fields.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/http/advanced_fields.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/http/advanced_fields.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/http/advanced_fields.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/http/advanced_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/http/advanced_fields.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/http/advanced_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/http/advanced_fields.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/http/formatters.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/http/formatters.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/http/formatters.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/http/formatters.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/http/normalizers.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/http/normalizers.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/http/normalizers.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/http/normalizers.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/http/simple_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/http/simple_fields.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/http/simple_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/http/simple_fields.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/icmp/advanced_fields.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/icmp/advanced_fields.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/icmp/advanced_fields.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/icmp/advanced_fields.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/icmp/advanced_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/icmp/advanced_fields.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/icmp/advanced_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/icmp/advanced_fields.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/icmp/formatters.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/icmp/formatters.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/icmp/formatters.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/icmp/formatters.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/icmp/normalizers.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/icmp/normalizers.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/icmp/normalizers.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/icmp/normalizers.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/icmp/simple_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/icmp/simple_fields.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/icmp/simple_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/icmp/simple_fields.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/index.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/index.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/index.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/index.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/index_response_body_field.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/index_response_body_field.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/index_response_body_field.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/index_response_body_field.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/index_response_body_field.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/index_response_body_field.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/index_response_body_field.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/index_response_body_field.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/key_value_field.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/key_value_field.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/key_value_field.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/key_value_field.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/key_value_field.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/key_value_field.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/key_value_field.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/key_value_field.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/lazy_synthetics_custom_assets_extension.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/lazy_synthetics_custom_assets_extension.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/lazy_synthetics_custom_assets_extension.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/lazy_synthetics_custom_assets_extension.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/lazy_synthetics_policy_create_extension.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/lazy_synthetics_policy_create_extension.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/lazy_synthetics_policy_create_extension.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/lazy_synthetics_policy_create_extension.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/lazy_synthetics_policy_edit_extension.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/lazy_synthetics_policy_edit_extension.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/lazy_synthetics_policy_edit_extension.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/lazy_synthetics_policy_edit_extension.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/optional_label.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/optional_label.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/optional_label.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/optional_label.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/request_body_field.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/request_body_field.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/request_body_field.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/request_body_field.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/request_body_field.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/request_body_field.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/request_body_field.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/request_body_field.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/schedule_field.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/schedule_field.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/schedule_field.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/schedule_field.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/schedule_field.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/schedule_field.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/schedule_field.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/schedule_field.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/synthetics_custom_assets_extension.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_custom_assets_extension.tsx similarity index 90% rename from x-pack/plugins/synthetics/public/components/fleet_package/synthetics_custom_assets_extension.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_custom_assets_extension.tsx index c21acee549986..64d1be74e71fd 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/synthetics_custom_assets_extension.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_custom_assets_extension.tsx @@ -14,8 +14,8 @@ import { CustomAssetsAccordion, } from '@kbn/fleet-plugin/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { ClientPluginsStart } from '../../apps/plugin'; -import { PLUGIN } from '../../../common/constants/plugin'; +import { ClientPluginsStart } from '../../../plugin'; +import { PLUGIN } from '../../../../common/constants/plugin'; export const SyntheticsCustomAssetsExtension: PackageAssetsComponent = () => { const { http } = useKibana().services; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_create_extension.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_create_extension.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension.tsx index ae035550a979d..6247619f6a3b6 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_create_extension.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension.tsx @@ -11,7 +11,7 @@ import { useTrackPageview } from '@kbn/observability-plugin/public'; import { DataStream } from './types'; import { PolicyConfig } from './types'; import { usePolicyConfigContext } from './contexts'; -import { DEFAULT_FIELDS } from '../../../common/constants/monitor_defaults'; +import { DEFAULT_FIELDS } from '../../../../common/constants/monitor_defaults'; import { CustomFields } from './custom_fields'; import { useUpdatePolicy } from './hooks/use_update_policy'; import { usePolicy } from './hooks/use_policy'; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_create_extension_wrapper.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_create_extension_wrapper.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension_wrapper.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_create_extension_wrapper.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension_wrapper.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_create_extension_wrapper.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension_wrapper.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_edit_extension.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_edit_extension.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_edit_extension.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_edit_extension.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_edit_extension_wrapper.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_edit_extension_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_edit_extension_wrapper.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_edit_extension_wrapper.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_edit_extension_wrapper.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_edit_extension_wrapper.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/synthetics_policy_edit_extension_wrapper.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/synthetics_policy_edit_extension_wrapper.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/tcp/advanced_fields.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tcp/advanced_fields.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/tcp/advanced_fields.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tcp/advanced_fields.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/tcp/advanced_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tcp/advanced_fields.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/tcp/advanced_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tcp/advanced_fields.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/tcp/formatters.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tcp/formatters.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/tcp/formatters.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tcp/formatters.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/tcp/normalizers.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tcp/normalizers.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/tcp/normalizers.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tcp/normalizers.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/tcp/simple_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tcp/simple_fields.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/tcp/simple_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tcp/simple_fields.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/tls/formatters.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tls/formatters.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/tls/formatters.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tls/formatters.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/tls/normalizers.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tls/normalizers.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/tls/normalizers.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tls/normalizers.ts diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/tls_fields.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tls_fields.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/tls_fields.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tls_fields.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/tls_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tls_fields.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/tls_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/tls_fields.tsx diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/types.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/types.tsx similarity index 85% rename from x-pack/plugins/synthetics/public/components/fleet_package/types.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/types.tsx index d3df3a1926887..0a5de311c5cb3 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/types.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/types.tsx @@ -16,9 +16,9 @@ import { ThrottlingConfigKey, ThrottlingSuffix, ThrottlingSuffixType, -} from '../../../common/runtime_types'; -export * from '../../../common/runtime_types/monitor_management'; -export * from '../../../common/types/monitor_validation'; +} from '../../../../common/runtime_types'; +export * from '../../../../common/runtime_types/monitor_management'; +export * from '../../../../common/types/monitor_validation'; export interface PolicyConfig { [DataStream.HTTP]: HTTPFields; diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/validation.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/validation.test.ts similarity index 98% rename from x-pack/plugins/synthetics/public/components/fleet_package/validation.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/validation.test.ts index 3495b163b9845..b2cca04b44d1b 100644 --- a/x-pack/plugins/synthetics/public/components/fleet_package/validation.test.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/validation.test.ts @@ -12,7 +12,7 @@ import { BrowserFields, MonitorFields, ScheduleUnit, -} from '../../../common/runtime_types'; +} from '../../../../common/runtime_types'; import { validate } from './validation'; describe('[Monitor Management] validation', () => { diff --git a/x-pack/plugins/synthetics/public/components/fleet_package/validation.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/validation.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/fleet_package/validation.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/fleet_package/validation.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/__snapshots__/monitor_charts.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/__snapshots__/monitor_charts.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/__snapshots__/monitor_charts.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/__snapshots__/monitor_charts.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/monitor/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/index.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/__snapshots__/confirm_delete.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/__snapshots__/confirm_delete.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ml/__snapshots__/confirm_delete.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/__snapshots__/confirm_delete.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/confirm_alert_delete.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/confirm_alert_delete.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ml/confirm_alert_delete.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/confirm_alert_delete.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/confirm_delete.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/confirm_delete.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ml/confirm_delete.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/confirm_delete.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/confirm_delete.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/confirm_delete.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ml/confirm_delete.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/confirm_delete.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ml/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/index.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/license_info.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/license_info.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ml/license_info.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/license_info.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/license_info.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/license_info.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ml/license_info.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/license_info.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/manage_ml_job.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/manage_ml_job.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/ml/manage_ml_job.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/manage_ml_job.tsx index 435eb7e4f9001..f6b8198a24699 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ml/manage_ml_job.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/manage_ml_job.tsx @@ -10,7 +10,7 @@ import React, { useCallback, useContext, useState } from 'react'; import { EuiButton, EuiContextMenu, EuiIcon, EuiPopover } from '@elastic/eui'; import { useSelector, useDispatch } from 'react-redux'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { CLIENT_ALERT_TYPES } from '../../../../common/constants/alerts'; +import { CLIENT_ALERT_TYPES } from '../../../../../common/constants/alerts'; import { canDeleteMLJobSelector, hasMLJobSelector, diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/ml_flyout.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_flyout.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/ml/ml_flyout.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_flyout.test.tsx index 8669bc180f42f..6a0bda2c5fb04 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ml/ml_flyout.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_flyout.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { MLFlyoutView } from './ml_flyout'; import { UptimeSettingsContext } from '../../../contexts'; -import { CLIENT_DEFAULTS } from '../../../../common/constants'; +import { CLIENT_DEFAULTS } from '../../../../../common/constants'; import * as redux from 'react-redux'; import { render, forNearestButton } from '../../../lib/helper/rtl_helpers'; import * as labels from './translations'; diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/ml_flyout.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_flyout.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ml/ml_flyout.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_flyout.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/ml_flyout_container.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_flyout_container.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/ml/ml_flyout_container.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_flyout_container.tsx index 482e3f70b3180..49eaef7b176ac 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ml/ml_flyout_container.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_flyout_container.tsx @@ -31,7 +31,7 @@ import { useGetUrlParams } from '../../../hooks'; import { getDynamicSettings } from '../../../state/actions/dynamic_settings'; import { useMonitorId } from '../../../hooks'; import { kibanaService } from '../../../state/kibana_service'; -import { CLIENT_ALERT_TYPES } from '../../../../common/constants/alerts'; +import { CLIENT_ALERT_TYPES } from '../../../../../common/constants/alerts'; interface Props { onClose: () => void; diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/ml_integeration.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_integeration.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/ml/ml_integeration.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_integeration.tsx index 6396f99e4d62c..675554906694b 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ml/ml_integeration.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_integeration.tsx @@ -22,7 +22,7 @@ import { UptimeRefreshContext } from '../../../contexts'; import * as labels from './translations'; import { ManageMLJobComponent } from './manage_ml_job'; import { useMonitorId } from '../../../hooks'; -import { getMLJobId } from '../../../../common/lib'; +import { getMLJobId } from '../../../../../common/lib'; export const MLIntegrationComponent = () => { const [isMlFlyoutOpen, setIsMlFlyoutOpen] = useState(false); diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/ml_integerations.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_integerations.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ml/ml_integerations.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_integerations.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/ml_job_link.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_job_link.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ml/ml_job_link.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_job_link.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/ml_job_link.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_job_link.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor/ml/ml_job_link.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_job_link.tsx index e14f37f617aac..2e9d771e11150 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ml/ml_job_link.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_job_link.tsx @@ -9,7 +9,7 @@ import React from 'react'; import url from 'url'; import { EuiButtonEmpty } from '@elastic/eui'; import rison, { RisonValue } from 'rison-node'; -import { getMLJobId } from '../../../../common/lib'; +import { getMLJobId } from '../../../../../common/lib'; interface Props { monitorId: string; diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/ml_manage_job.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_manage_job.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ml/ml_manage_job.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/ml_manage_job.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/translations.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/translations.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ml/translations.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/translations.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ml/use_anomaly_alert.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/use_anomaly_alert.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ml/use_anomaly_alert.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ml/use_anomaly_alert.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/monitor_charts.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_charts.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/monitor_charts.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_charts.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/monitor_charts.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_charts.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/monitor_charts.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_charts.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/monitor_duration/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_duration/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/monitor_duration/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_duration/index.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/monitor_duration/monitor_duration.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_duration/monitor_duration.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/monitor/monitor_duration/monitor_duration.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_duration/monitor_duration.tsx index 6d8615226f79b..822a476f5225a 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/monitor_duration/monitor_duration.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_duration/monitor_duration.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiTitle, EuiSpacer } from '@elastic/eui'; -import { LocationDurationLine } from '../../../../common/types'; +import { LocationDurationLine } from '../../../../../common/types'; import { MLIntegrationComponent } from '../ml/ml_integeration'; import { AnomalyRecords } from '../../../state/actions'; import { DurationChartComponent } from '../../common/charts'; diff --git a/x-pack/plugins/synthetics/public/components/monitor/monitor_duration/monitor_duration_container.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_duration/monitor_duration_container.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor/monitor_duration/monitor_duration_container.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_duration/monitor_duration_container.tsx index 8b88c8d59a47c..63f95fd966544 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/monitor_duration/monitor_duration_container.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_duration/monitor_duration_container.tsx @@ -23,8 +23,8 @@ import { } from '../../../state/selectors'; import { UptimeRefreshContext } from '../../../contexts'; import { MonitorDurationComponent } from './monitor_duration'; -import { MonitorIdParam } from '../../../../common/types'; -import { getMLJobId } from '../../../../common/lib'; +import { MonitorIdParam } from '../../../../../common/types'; +import { getMLJobId } from '../../../../../common/lib'; import { useUptimeSettingsContext } from '../../../contexts/uptime_settings_context'; export const MonitorDuration: React.FC = ({ monitorId }) => { diff --git a/x-pack/plugins/synthetics/public/components/monitor/monitor_title.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_title.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/monitor_title.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_title.test.tsx index 726ad235f7f49..f9e3572ead511 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/monitor_title.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_title.test.tsx @@ -10,7 +10,7 @@ import moment from 'moment'; import { screen } from '@testing-library/react'; import { render } from '../../lib/helper/rtl_helpers'; import * as reactRouterDom from 'react-router-dom'; -import { Ping } from '../../../common/runtime_types'; +import { Ping } from '../../../../common/runtime_types'; import { MonitorPageTitle, MonitorPageTitleContent } from './monitor_title'; jest.mock('react-router-dom', () => { diff --git a/x-pack/plugins/synthetics/public/components/monitor/monitor_title.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_title.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/monitor_title.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_title.tsx index 0d77179cd99ee..ce343ac1f6bd7 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/monitor_title.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/monitor_title.tsx @@ -12,7 +12,7 @@ import { useSelector } from 'react-redux'; import { useMonitorId } from '../../hooks'; import { monitorStatusSelector } from '../../state/selectors'; import { EnableMonitorAlert } from '../overview/monitor_list/columns/enable_alert'; -import { Ping } from '../../../common/runtime_types/ping'; +import { Ping } from '../../../../common/runtime_types/ping'; import { useBreadcrumbs } from '../../hooks/use_breadcrumbs'; const isAutogeneratedId = (id: string) => { diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_histogram/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_histogram/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_histogram/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_histogram/index.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_histogram/ping_histogram_container.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_histogram/ping_histogram_container.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_histogram/ping_histogram_container.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_histogram/ping_histogram_container.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/__snapshots__/expanded_row.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/__snapshots__/expanded_row.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/__snapshots__/expanded_row.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/__snapshots__/expanded_row.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/__snapshots__/ping_headers.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/__snapshots__/ping_headers.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/__snapshots__/ping_headers.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/__snapshots__/ping_headers.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/expand_row.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/expand_row.test.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/expand_row.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/expand_row.test.tsx index e3ac1f2e17125..06b43744a2ac2 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/expand_row.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/expand_row.test.tsx @@ -8,12 +8,12 @@ import React from 'react'; import { screen } from '@testing-library/react'; -import { makePing } from '../../../../../common/runtime_types'; +import { makePing } from '../../../../../../common/runtime_types'; import { render } from '../../../../lib/helper/rtl_helpers'; import { ExpandRowColumn } from './expand_row'; -import { Ping } from '../../../../../common/runtime_types/ping'; +import { Ping } from '../../../../../../common/runtime_types/ping'; describe('ExpandRowColumn', () => { const defaultPing = makePing({ diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/expand_row.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/expand_row.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/expand_row.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/expand_row.tsx index 1c18668741292..3e5104357463f 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/expand_row.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/expand_row.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { EuiButtonIcon } from '@elastic/eui'; -import { Ping } from '../../../../../common/runtime_types/ping'; +import { Ping } from '../../../../../../common/runtime_types/ping'; import { PingListExpandedRowComponent } from '../expanded_row'; export const toggleDetails = ( diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/failed_step.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/failed_step.tsx similarity index 88% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/failed_step.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/failed_step.tsx index 38f51a2bafebb..da3b93bd0e09d 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/failed_step.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/failed_step.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FailedStepsApiResponse } from '../../../../../common/runtime_types/ping/synthetics'; +import { FailedStepsApiResponse } from '../../../../../../common/runtime_types/ping/synthetics'; interface Props { checkGroup?: string; diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_error.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_error.tsx similarity index 91% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_error.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_error.tsx index db7dc46fc9043..beb29b4201438 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_error.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_error.tsx @@ -7,7 +7,7 @@ import React from 'react'; import styled from 'styled-components'; -import { Ping } from '../../../../../common/runtime_types/ping'; +import { Ping } from '../../../../../../common/runtime_types/ping'; const StyledSpan = styled.span` display: -webkit-box; diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_status.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_status.tsx similarity index 93% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_status.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_status.tsx index 6c33018126983..6d46803da22fd 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_status.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_status.tsx @@ -9,8 +9,8 @@ import React, { useContext } from 'react'; import { i18n } from '@kbn/i18n'; import moment from 'moment'; import { EuiBadge, EuiSpacer, EuiText } from '@elastic/eui'; -import { Ping } from '../../../../../common/runtime_types/ping'; -import { MONITOR_TYPES, STATUS } from '../../../../../common/constants'; +import { Ping } from '../../../../../../common/runtime_types/ping'; +import { MONITOR_TYPES, STATUS } from '../../../../../../common/constants'; import { UptimeThemeContext } from '../../../../contexts'; import { STATUS_COMPLETE_LABEL, diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/index.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/no_image_available.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_available.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/no_image_available.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_available.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/no_image_available.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_available.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/no_image_available.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_available.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/no_image_display.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_display.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/no_image_display.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_display.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/no_image_display.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_display.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/no_image_display.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_display.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.tsx index 4083df8c98a1a..3bc443426d523 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.tsx @@ -16,7 +16,7 @@ import { isScreenshotRef, ScreenshotImageBlob, ScreenshotRefImageData, -} from '../../../../../../common/runtime_types'; +} from '../../../../../../../common/runtime_types'; import { getJourneyScreenshot } from '../../../../../state/api/journey'; import { UptimeSettingsContext } from '../../../../../contexts'; diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.tsx index eb0d8c30ae53d..1003b51319136 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.tsx @@ -9,7 +9,7 @@ import React, { MouseEvent, useEffect } from 'react'; import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText, useEuiTheme } from '@elastic/eui'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { ScreenshotRefImageData } from '../../../../../../common/runtime_types'; +import { ScreenshotRefImageData } from '../../../../../../../common/runtime_types'; import { useBreakpoints } from '../../../../../hooks'; import { nextAriaLabel, prevAriaLabel } from './translations'; diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.tsx index 73c43da98bfc4..1d97e3e4e248a 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.tsx @@ -8,7 +8,7 @@ import { EuiImage, EuiLoadingSpinner, EuiPopover } from '@elastic/eui'; import React from 'react'; import styled from 'styled-components'; -import { ScreenshotRefImageData } from '../../../../../../common/runtime_types/ping/synthetics'; +import { ScreenshotRefImageData } from '../../../../../../../common/runtime_types/ping/synthetics'; import { fullSizeImageAlt } from './translations'; import { useCompositeImage } from '../../../../../hooks/use_composite_image'; diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/ping_timestamp/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/translations.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/response_code.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/response_code.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/columns/response_code.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/columns/response_code.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/doc_link_body.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/doc_link_body.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/doc_link_body.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/doc_link_body.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/doc_link_body.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/doc_link_body.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/doc_link_body.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/doc_link_body.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/expanded_row.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/expanded_row.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/expanded_row.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/expanded_row.test.tsx index f87501a79e964..d65536bf75c4a 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ping_list/expanded_row.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/expanded_row.test.tsx @@ -8,7 +8,7 @@ import { mountWithIntl, renderWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; import { PingListExpandedRowComponent } from './expanded_row'; -import { Ping } from '../../../../common/runtime_types'; +import { Ping } from '../../../../../common/runtime_types'; import { DocLinkForBody } from './doc_link_body'; describe('PingListExpandedRow', () => { diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/expanded_row.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/expanded_row.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/expanded_row.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/expanded_row.tsx index 3e14136ac3533..0d27d7cbb92b9 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ping_list/expanded_row.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/expanded_row.tsx @@ -18,7 +18,7 @@ import { } from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { Ping, HttpResponseBody } from '../../../../common/runtime_types'; +import { Ping, HttpResponseBody } from '../../../../../common/runtime_types'; import { DocLinkForBody } from './doc_link_body'; import { PingRedirects } from './ping_redirects'; import { PingHeaders } from './headers'; diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/headers.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/headers.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/headers.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/headers.tsx index edc8119dd59d3..bff0e91f2cd05 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ping_list/headers.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/headers.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiAccordion, EuiDescriptionList, EuiSpacer, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { PingHeaders as HeadersProp } from '../../../../common/runtime_types'; +import { PingHeaders as HeadersProp } from '../../../../../common/runtime_types'; interface Props { headers: HeadersProp; diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/index.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/index.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/index.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/index.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/location_name.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/location_name.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/location_name.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/location_name.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/ping_headers.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_headers.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/ping_headers.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_headers.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/ping_list.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/ping_list.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list.test.tsx index bfcf359ac0525..ddb33e4dd5fea 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ping_list/ping_list.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { formatDuration, PingList } from './ping_list'; -import { Ping, PingsResponse } from '../../../../common/runtime_types'; +import { Ping, PingsResponse } from '../../../../../common/runtime_types'; import { ExpandedRowMap } from '../../overview/monitor_list/types'; import { rowShouldExpand, toggleDetails } from './columns/expand_row'; import * as pingListHook from './use_pings'; diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/ping_list.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/ping_list.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/ping_list_header.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list_header.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/ping_list_header.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list_header.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/ping_list_table.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list_table.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/ping_list_table.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list_table.tsx index da464b7e1a083..1dbda32925161 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ping_list/ping_list_table.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_list_table.tsx @@ -12,11 +12,11 @@ import moment from 'moment'; import { useHistory } from 'react-router-dom'; import { useDispatch } from 'react-redux'; import * as I18LABELS from './translations'; -import { FailedStepsApiResponse, Ping } from '../../../../common/runtime_types'; +import { FailedStepsApiResponse, Ping } from '../../../../../common/runtime_types'; import { PingStatusColumn } from './columns/ping_status'; import { ERROR_LABEL, LOCATION_LABEL, RES_CODE_LABEL, TIMESTAMP_LABEL } from './translations'; import { LocationName } from './location_name'; -import { MONITOR_TYPES } from '../../../../common/constants'; +import { MONITOR_TYPES } from '../../../../../common/constants'; import { PingTimestamp } from './columns/ping_timestamp'; import { getShortTimeStamp } from '../../overview/monitor_list/columns/monitor_status_column'; import { PingErrorCol } from './columns/ping_error'; diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/ping_redirects.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_redirects.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/ping_redirects.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_redirects.tsx index 37e5961305a60..365a52e8f54fe 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ping_list/ping_redirects.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/ping_redirects.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import styled from 'styled-components'; import { EuiListGroup, EuiListGroupItemProps, EuiPanel, EuiSpacer, EuiText } from '@elastic/eui'; -import { Ping } from '../../../../common/runtime_types/ping'; +import { Ping } from '../../../../../common/runtime_types/ping'; const ListGroup = styled(EuiListGroup)` &&& { diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/response_code.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/response_code.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/response_code.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/response_code.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/translations.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/ping_list/use_pings.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/use_pings.ts similarity index 94% rename from x-pack/plugins/synthetics/public/components/monitor/ping_list/use_pings.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/use_pings.ts index 94669b4aeb8e8..6306e8357018c 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/ping_list/use_pings.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/ping_list/use_pings.ts @@ -9,13 +9,13 @@ import { useDispatch, useSelector } from 'react-redux'; import { useCallback, useContext, useEffect } from 'react'; import { useFetcher } from '@kbn/observability-plugin/public'; import { selectPingList } from '../../../state/selectors'; -import { GetPingsParams, Ping } from '../../../../common/runtime_types/ping'; +import { GetPingsParams, Ping } from '../../../../../common/runtime_types/ping'; import { getPings as getPingsAction } from '../../../state/actions'; import { useGetUrlParams, useMonitorId } from '../../../hooks'; import { UptimeRefreshContext, UptimeSettingsContext } from '../../../contexts'; import { fetchJourneysFailedSteps } from '../../../state/api/journey'; import { useSelectedFilters } from '../../../hooks/use_selected_filters'; -import { MONITOR_TYPES } from '../../../../common/constants'; +import { MONITOR_TYPES } from '../../../../../common/constants'; interface Props { pageSize: number; diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/__snapshots__/ssl_certificate.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/__snapshots__/ssl_certificate.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/__snapshots__/ssl_certificate.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/__snapshots__/ssl_certificate.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/__snapshots__/status_by_location.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/__snapshots__/status_by_location.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/__snapshots__/status_by_location.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/__snapshots__/status_by_location.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/__snapshots__/tag_label.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/__snapshots__/tag_label.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/__snapshots__/tag_label.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/__snapshots__/tag_label.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/availability_reporting.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/availability_reporting.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/availability_reporting.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/availability_reporting.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/availability_reporting.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/availability_reporting.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/availability_reporting.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/availability_reporting.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/index.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/location_status_tags.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/location_status_tags.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.test.tsx index e43df25779ab9..48862695b2089 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/location_status_tags.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { MonitorLocation } from '../../../../../common/runtime_types/monitor'; +import { MonitorLocation } from '../../../../../../common/runtime_types/monitor'; import { LocationStatusTags } from '.'; import { mockMoment } from '../../../../lib/helper/test_helpers'; import { render } from '../../../../lib/helper/rtl_helpers'; diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/location_status_tags.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/location_status_tags.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.tsx index 53be56d16b9fe..b50b84235dad7 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/location_status_tags.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.tsx @@ -9,8 +9,8 @@ import React, { useContext } from 'react'; import moment from 'moment'; import styled from 'styled-components'; import { UptimeThemeContext } from '../../../../contexts'; -import { MonitorLocation } from '../../../../../common/runtime_types'; -import { SHORT_TIMESPAN_LOCALE, SHORT_TS_LOCALE } from '../../../../../common/constants'; +import { MonitorLocation } from '../../../../../../common/runtime_types'; +import { SHORT_TIMESPAN_LOCALE, SHORT_TS_LOCALE } from '../../../../../../common/constants'; import { AvailabilityReporting } from '..'; import { getShortTimeStamp } from '../../../overview/monitor_list/columns/monitor_status_column'; diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/tag_label.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/tag_label.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/tag_label.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/tag_label.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/tag_label.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/tag_label.tsx similarity index 92% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/tag_label.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/tag_label.tsx index 6bf73b9609e58..8b920848cdc53 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/status_details/availability_reporting/tag_label.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/availability_reporting/tag_label.tsx @@ -9,7 +9,7 @@ import React from 'react'; import styled from 'styled-components'; import { EuiBadge } from '@elastic/eui'; import { StatusTag } from './location_status_tags'; -import { STATUS } from '../../../../../common/constants'; +import { STATUS } from '../../../../../../common/constants'; const BadgeItem = styled.div` white-space: nowrap; diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/index.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/location_availability/location_availability.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/location_availability/location_availability.test.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/location_availability/location_availability.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/location_availability/location_availability.test.tsx index 855b8ef0c9767..a09e3530d5081 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/status_details/location_availability/location_availability.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/location_availability/location_availability.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { screen } from '@testing-library/react'; import { render } from '../../../../lib/helper/rtl_helpers'; import { LocationAvailability } from './location_availability'; -import { MonitorLocations } from '../../../../../common/runtime_types'; +import { MonitorLocations } from '../../../../../../common/runtime_types'; // Note For shallow test, we need absolute time strings describe('LocationAvailability component', () => { diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/location_availability/location_availability.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/location_availability/location_availability.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/location_availability/location_availability.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/location_availability/location_availability.tsx index c851369d63e9e..f7634c77eb017 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/status_details/location_availability/location_availability.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/location_availability/location_availability.tsx @@ -9,7 +9,7 @@ import React from 'react'; import styled from 'styled-components'; import { EuiFlexGroup, EuiFlexItem, EuiErrorBoundary, EuiTitle } from '@elastic/eui'; import { LocationStatusTags } from '../availability_reporting'; -import { MonitorLocations } from '../../../../../common/runtime_types'; +import { MonitorLocations } from '../../../../../../common/runtime_types'; import { MonitoringFrom } from '../translations'; const EuiFlexItemTags = styled(EuiFlexItem)` diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/monitor_status.bar.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/monitor_status.bar.test.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/monitor_status.bar.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/monitor_status.bar.test.tsx index af3c47b9caf30..640d207fbb138 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/status_details/monitor_status.bar.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/monitor_status.bar.test.tsx @@ -8,7 +8,7 @@ import moment from 'moment'; import React from 'react'; import { MonitorStatusBar } from './status_bar'; -import { Ping } from '../../../../common/runtime_types'; +import { Ping } from '../../../../../common/runtime_types'; import * as redux from 'react-redux'; import { renderWithRouter } from '../../../lib'; import { createMemoryHistory } from 'history'; diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/ssl_certificate.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/ssl_certificate.test.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/ssl_certificate.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/ssl_certificate.test.tsx index 03ce292e63621..3951ced34c0f9 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/status_details/ssl_certificate.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/ssl_certificate.test.tsx @@ -8,11 +8,11 @@ import React from 'react'; import moment from 'moment'; import { EuiIcon } from '@elastic/eui'; -import { Tls } from '../../../../common/runtime_types'; +import { Tls } from '../../../../../common/runtime_types'; import { MonitorSSLCertificate } from './status_bar'; import * as redux from 'react-redux'; import { mountWithRouter, renderWithRouter, shallowWithRouter } from '../../../lib'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../../common/constants'; describe('SSL Certificate component', () => { let monitorTls: Tls; diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/index.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/monitor_redirects.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/monitor_redirects.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/monitor_redirects.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/monitor_redirects.tsx index f59f01e6aef33..2f1dba51bb933 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/monitor_redirects.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/monitor_redirects.tsx @@ -9,7 +9,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiPopover } from '@elastic/eui'; import styled from 'styled-components'; -import { Ping } from '../../../../../common/runtime_types'; +import { Ping } from '../../../../../../common/runtime_types'; import { PingRedirects } from '../../ping_list/ping_redirects'; import { MonListDescription, MonListTitle } from './status_bar'; diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/ssl_certificate.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/ssl_certificate.tsx similarity index 91% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/ssl_certificate.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/ssl_certificate.tsx index 13be917075aca..5d421cbd4a448 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/ssl_certificate.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/ssl_certificate.tsx @@ -9,8 +9,8 @@ import React from 'react'; import { Link } from 'react-router-dom'; import { EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import { Tls, X509Expiry } from '../../../../../common/runtime_types'; -import { CERTIFICATES_ROUTE } from '../../../../../common/constants'; +import { Tls, X509Expiry } from '../../../../../../common/runtime_types'; +import { CERTIFICATES_ROUTE } from '../../../../../../common/constants'; import { MonListDescription, MonListTitle } from './status_bar'; import { CertStatusColumn } from '../../../overview/monitor_list/columns/cert_status_column'; diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/status_bar.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/status_bar.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/status_bar.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/status_bar.test.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/status_bar.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/status_bar.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/status_bar.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/status_bar.tsx index 9746a6c676ab5..7ca855bc0a697 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/status_bar.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/status_bar.tsx @@ -22,7 +22,7 @@ import { StatusByLocations } from './status_by_location'; import { useStatusBar } from './use_status_bar'; import { MonitorIDLabel, OverallAvailability } from '../translations'; import { TAGS_LABEL, URL_LABEL } from '../../../common/translations'; -import { MonitorLocations } from '../../../../../common/runtime_types/monitor'; +import { MonitorLocations } from '../../../../../../common/runtime_types/monitor'; import { formatAvailabilityValue } from '../availability_reporting/availability_reporting'; import { MonitorRedirects } from './monitor_redirects'; import { MonitorTags } from '../../../common/monitor_tags'; diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/status_by_location.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/status_by_location.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/status_by_location.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/status_by_location.tsx index 60cd231a401c0..3296e784d621a 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/status_by_location.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/status_by_location.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiTitle } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import { MonitorLocation } from '../../../../../common/runtime_types'; +import { MonitorLocation } from '../../../../../../common/runtime_types'; interface StatusByLocationsProps { locations: MonitorLocation[]; diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/use_status_bar.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/use_status_bar.ts similarity index 90% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/use_status_bar.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/use_status_bar.ts index 058227d1db1eb..57de00af67081 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_bar/use_status_bar.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_bar/use_status_bar.ts @@ -12,8 +12,8 @@ import { useGetUrlParams, useMonitorId } from '../../../../hooks'; import { monitorLocationsSelector, monitorStatusSelector } from '../../../../state/selectors'; import { AppState } from '../../../../state'; import { getMonitorStatusAction } from '../../../../state/actions'; -import { Ping } from '../../../../../common/runtime_types/ping'; -import { MonitorLocations } from '../../../../../common/runtime_types/monitor'; +import { Ping } from '../../../../../../common/runtime_types/ping'; +import { MonitorLocations } from '../../../../../../common/runtime_types/monitor'; interface MonitorStatusBarProps { monitorId: string; diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_by_location.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_by_location.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/status_by_location.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_by_location.test.tsx index 9b58b0deb8ecc..0b3b08cba8343 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_by_location.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_by_location.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { renderWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; -import { MonitorLocation } from '../../../../common/runtime_types'; +import { MonitorLocation } from '../../../../../common/runtime_types'; import { StatusByLocations } from '.'; describe('StatusByLocation component', () => { diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_details.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_details.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/status_details.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_details.tsx index 5b20e83f0ec85..0c9c347fc8c80 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_details.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_details.tsx @@ -10,7 +10,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui'; import styled from 'styled-components'; import { LocationAvailability } from './location_availability/location_availability'; import { UptimeRefreshContext } from '../../../contexts'; -import { MonitorLocations } from '../../../../common/runtime_types'; +import { MonitorLocations } from '../../../../../common/runtime_types'; import { MonitorStatusBar } from './status_bar'; interface MonitorStatusDetailsProps { diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_details_container.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_details_container.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/status_details_container.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_details_container.tsx index 1fb138da9e84b..7affbde63ba02 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/status_details/status_details_container.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/status_details_container.tsx @@ -13,7 +13,7 @@ import { getMonitorLocationsAction } from '../../../state/actions/monitor'; import { MonitorStatusDetailsComponent } from '.'; import { UptimeRefreshContext } from '../../../contexts'; import { AppState } from '../../../state'; -import { MonitorIdParam } from '../../../../common/types'; +import { MonitorIdParam } from '../../../../../common/types'; export const MonitorStatusDetails: React.FC = ({ monitorId }) => { const { lastRefresh } = useContext(UptimeRefreshContext); diff --git a/x-pack/plugins/synthetics/public/components/monitor/status_details/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/status_details/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/status_details/translations.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/step_detail_container.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/step_detail_container.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/step_detail_container.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/step_detail_container.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/step_page_nav.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/step_page_nav.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/step_page_nav.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/step_page_nav.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/step_page_title.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/step_page_title.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/step_page_title.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/step_page_title.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/use_monitor_breadcrumb.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumb.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/use_monitor_breadcrumb.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumb.tsx index 0d7b5894799c7..013516bb754bf 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/use_monitor_breadcrumb.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumb.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { useBreadcrumbs } from '../../../../hooks/use_breadcrumbs'; import { JourneyState } from '../../../../state/reducers/journey'; -import { PLUGIN } from '../../../../../common/constants/plugin'; +import { PLUGIN } from '../../../../../../common/constants/plugin'; import { getShortTimeStamp } from '../../../overview/monitor_list/columns/monitor_status_column'; interface ActiveStep { diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/use_monitor_breadcrumbs.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumbs.test.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/use_monitor_breadcrumbs.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumbs.test.tsx index a46fad2733bb2..2ae975803b524 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/use_monitor_breadcrumbs.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumbs.test.tsx @@ -11,8 +11,8 @@ import { Route } from 'react-router-dom'; import { of } from 'rxjs'; import { render } from '../../../../lib/helper/rtl_helpers'; import { useMonitorBreadcrumb } from './use_monitor_breadcrumb'; -import { OVERVIEW_ROUTE } from '../../../../../common/constants'; -import { Ping } from '../../../../../common/runtime_types/ping'; +import { OVERVIEW_ROUTE } from '../../../../../../common/constants'; +import { Ping } from '../../../../../../common/runtime_types/ping'; import { JourneyState } from '../../../../state/reducers/journey'; import { chromeServiceMock, uiSettingsServiceMock } from '@kbn/core/public/mocks'; diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/data_formatting.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/data_formatting.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/data_formatting.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/data_formatting.test.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/data_formatting.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/data_formatting.ts similarity index 99% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/data_formatting.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/data_formatting.ts index fa3db4d01fe9b..7323668dc3d52 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/data_formatting.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/data_formatting.ts @@ -23,7 +23,7 @@ import { LegendItems, } from './types'; import { WaterfallData, WaterfallMetadata } from '../../waterfall'; -import { NetworkEvent } from '../../../../../../common/runtime_types'; +import { NetworkEvent } from '../../../../../../../common/runtime_types'; export const extractItems = (data: NetworkEvent[]): NetworkItems => { // NOTE: This happens client side as the "payload" property is mapped diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/types.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/types.ts similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/types.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/types.ts index 19ae847ee3adb..c396bec47e0e6 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/types.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/types.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { NetworkEvent } from '../../../../../../common/runtime_types'; +import { NetworkEvent } from '../../../../../../../common/runtime_types'; export enum Timings { Blocked = 'blocked', diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.tsx index b31af8e31d33a..95c42d505fbf2 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.tsx @@ -15,7 +15,7 @@ import { networkEventsSelector } from '../../../../../state/selectors'; import { WaterfallChartWrapper } from './waterfall_chart_wrapper'; import { extractItems } from './data_formatting'; import { useStepWaterfallMetrics } from '../use_step_waterfall_metrics'; -import { JourneyStep } from '../../../../../../common/runtime_types'; +import { JourneyStep } from '../../../../../../../common/runtime_types'; export const NO_DATA_TEXT = i18n.translate( 'xpack.synthetics.synthetics.stepDetail.waterfallNoData', diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.tsx index 4b50f86e6ee3b..0849832107aeb 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.tsx @@ -15,7 +15,7 @@ import { WaterfallFilter } from './waterfall_filter'; import { WaterfallFlyout } from './waterfall_flyout'; import { WaterfallSidebarItem } from './waterfall_sidebar_item'; import { MarkerItems } from '../../waterfall/context/waterfall_chart'; -import { JourneyStep } from '../../../../../../common/runtime_types'; +import { JourneyStep } from '../../../../../../../common/runtime_types'; export const renderLegendItem: RenderItem = (item) => { return ( diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/translations.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/README.md b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/README.md similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/README.md rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/README.md diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/constants.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/constants.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/constants.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/constants.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/legend.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/legend.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/legend.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/legend.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/middle_truncated_text.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/middle_truncated_text.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/middle_truncated_text.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/middle_truncated_text.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/middle_truncated_text.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/middle_truncated_text.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/middle_truncated_text.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/middle_truncated_text.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/network_requests_total.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/network_requests_total.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/network_requests_total.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/network_requests_total.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/network_requests_total.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/network_requests_total.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/network_requests_total.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/network_requests_total.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/sidebar.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/sidebar.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/sidebar.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/sidebar.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/styles.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/styles.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/styles.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/styles.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/translations.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/use_bar_charts.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_bar_charts.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/use_bar_charts.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_bar_charts.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/use_bar_charts.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_bar_charts.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/use_bar_charts.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_bar_charts.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/use_flyout.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_flyout.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/use_flyout.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_flyout.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/use_flyout.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_flyout.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/use_flyout.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_flyout.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_bar_chart.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_bar_chart.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_bar_chart.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_bar_chart.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_chart.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_chart.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_chart.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_chart.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_chart_fixed_axis.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_chart_fixed_axis.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_chart_fixed_axis.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_chart_fixed_axis.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_flyout_table.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_flyout_table.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_flyout_table.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_flyout_table.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_marker_test_helper.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_test_helper.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_marker_test_helper.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_test_helper.tsx index 696e6d4fa022f..691a74361d074 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_marker_test_helper.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_test_helper.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { UptimeStartupPluginsContext } from '../../../../../contexts'; import { WaterfallContext } from '../context/waterfall_chart'; -import { JourneyStep } from '../../../../../../common/runtime_types'; +import { JourneyStep } from '../../../../../../../common/runtime_types'; const EmbeddableMock = ({ title, diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.test.tsx index b797cf1f3b63e..aeca7940ef773 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { render } from '../../../../../lib/helper/rtl_helpers'; import { WaterfallMarkerTrend } from './waterfall_marker_trend'; import moment from 'moment'; -import { JourneyStep } from '../../../../../../common/runtime_types'; +import { JourneyStep } from '../../../../../../../common/runtime_types'; import { TestWrapper } from './waterfall_marker_test_helper'; describe('', () => { diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_markers.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_markers.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_markers.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_markers.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/context/waterfall_chart.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/context/waterfall_chart.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/context/waterfall_chart.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/context/waterfall_chart.tsx index d495b7432bce7..fd38fbbfb6bb6 100644 --- a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/context/waterfall_chart.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/context/waterfall_chart.tsx @@ -9,7 +9,7 @@ import React, { createContext, useContext, Context } from 'react'; import { WaterfallData, WaterfallDataEntry, WaterfallMetadata } from '../types'; import { OnSidebarClick, OnElementClick, OnProjectionClick } from '../components/use_flyout'; import { SidebarItems } from '../../step_detail/waterfall/types'; -import { JourneyStep } from '../../../../../../common/runtime_types'; +import { JourneyStep } from '../../../../../../../common/runtime_types'; export type MarkerItems = Array<{ id: diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/index.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/index.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/index.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/index.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/types.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/types.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor/synthetics/waterfall/types.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor/synthetics/waterfall/types.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/action_bar/action_bar.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/action_bar/action_bar.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor_management/action_bar/action_bar.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/action_bar/action_bar.test.tsx index 64b7984b00b40..e903f4d23424b 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/action_bar/action_bar.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/action_bar/action_bar.test.tsx @@ -15,7 +15,7 @@ import { HTTPFields, ScheduleUnit, SyntheticsMonitor, -} from '../../../../common/runtime_types'; +} from '../../../../../common/runtime_types'; import { ActionBar } from './action_bar'; describe('', () => { diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/action_bar/action_bar.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/action_bar/action_bar.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor_management/action_bar/action_bar.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/action_bar/action_bar.tsx index a3eec01438876..3bd6be5eb9750 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/action_bar/action_bar.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/action_bar/action_bar.tsx @@ -21,11 +21,11 @@ import { useSelector } from 'react-redux'; import { FETCH_STATUS, useFetcher } from '@kbn/observability-plugin/public'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { MONITOR_MANAGEMENT_ROUTE } from '../../../../common/constants'; +import { MONITOR_MANAGEMENT_ROUTE } from '../../../../../common/constants'; import { UptimeSettingsContext } from '../../../contexts'; import { setMonitor } from '../../../state/api'; -import { SyntheticsMonitor } from '../../../../common/runtime_types'; +import { SyntheticsMonitor } from '../../../../../common/runtime_types'; import { TestRun } from '../test_now_mode/test_now_mode'; import { monitorManagementListSelector } from '../../../state/selectors'; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/action_bar/action_bar_errors.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/action_bar/action_bar_errors.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor_management/action_bar/action_bar_errors.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/action_bar/action_bar_errors.test.tsx index b92357f3ecc14..bb40077dab78d 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/action_bar/action_bar_errors.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/action_bar/action_bar_errors.test.tsx @@ -15,7 +15,7 @@ import { HTTPFields, ScheduleUnit, SyntheticsMonitor, -} from '../../../../common/runtime_types'; +} from '../../../../../common/runtime_types'; import { spyOnUseFetcher } from '../../../lib/helper/spy_use_fetcher'; import * as kibana from '../../../state/kibana_service'; import { ActionBar } from './action_bar'; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/action_bar/action_bar_portal.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/action_bar/action_bar_portal.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/action_bar/action_bar_portal.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/action_bar/action_bar_portal.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/add_monitor_btn.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/add_monitor_btn.tsx similarity index 99% rename from x-pack/plugins/synthetics/public/components/monitor_management/add_monitor_btn.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/add_monitor_btn.tsx index 3532659f04af2..90bec2d28f988 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/add_monitor_btn.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/add_monitor_btn.tsx @@ -11,7 +11,7 @@ import { EuiButton, EuiFlexItem, EuiFlexGroup, EuiToolTip, EuiSwitch } from '@el import { useHistory } from 'react-router-dom'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { kibanaService } from '../../state/kibana_service'; -import { MONITOR_ADD_ROUTE } from '../../../common/constants'; +import { MONITOR_ADD_ROUTE } from '../../../../common/constants'; import { useEnablement } from './hooks/use_enablement'; import { useSyntheticsServiceAllowed } from './hooks/use_service_allowed'; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/content/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/content/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/content/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/content/index.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/edit_monitor_config.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/edit_monitor_config.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor_management/edit_monitor_config.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/edit_monitor_config.tsx index 6c8056c246071..245f058c48d94 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/edit_monitor_config.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/edit_monitor_config.tsx @@ -14,11 +14,11 @@ import { DataStream, ScheduleUnit, ThrottlingOptions, -} from '../../../common/runtime_types'; +} from '../../../../common/runtime_types'; import { SyntheticsProviders } from '../fleet_package/contexts'; import { PolicyConfig } from '../fleet_package/types'; import { MonitorConfig } from './monitor_config/monitor_config'; -import { DEFAULT_NAMESPACE_STRING } from '../../../common/constants/monitor_defaults'; +import { DEFAULT_NAMESPACE_STRING } from '../../../../common/constants/monitor_defaults'; interface Props { monitor: MonitorFields; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_enablement.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_enablement.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_enablement.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_enablement.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_format_monitor.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_format_monitor.ts similarity index 94% rename from x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_format_monitor.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_format_monitor.ts index 49d467d7b8799..5d600a10daf39 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_format_monitor.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_format_monitor.ts @@ -6,8 +6,8 @@ */ import { useEffect, useRef, useState } from 'react'; -import { ConfigKey, DataStream, MonitorFields } from '../../../../common/runtime_types'; -import { Validation } from '../../../../common/types'; +import { ConfigKey, DataStream, MonitorFields } from '../../../../../common/runtime_types'; +import { Validation } from '../../../../../common/types'; interface Props { monitorType: DataStream; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_inline_errors.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_inline_errors.test.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_inline_errors.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_inline_errors.test.tsx index fe20dc3ea6c9d..ebc9b55556d40 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_inline_errors.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_inline_errors.test.tsx @@ -8,7 +8,7 @@ import { renderHook } from '@testing-library/react-hooks'; import { MockRedux } from '../../../lib/helper/rtl_helpers'; import { useInlineErrors } from './use_inline_errors'; -import { DEFAULT_THROTTLING } from '../../../../common/runtime_types'; +import { DEFAULT_THROTTLING } from '../../../../../common/runtime_types'; import * as obsvPlugin from '@kbn/observability-plugin/public/hooks/use_es_search'; function mockNow(date: string | number | Date) { diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_inline_errors.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_inline_errors.ts similarity index 92% rename from x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_inline_errors.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_inline_errors.ts index adc07853a93cd..9970622ca416b 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_inline_errors.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_inline_errors.ts @@ -10,11 +10,11 @@ import moment from 'moment'; import { useMemo } from 'react'; import { useEsSearch } from '@kbn/observability-plugin/public'; import { monitorManagementListSelector } from '../../../state/selectors'; -import { Ping } from '../../../../common/runtime_types'; -import { EXCLUDE_RUN_ONCE_FILTER } from '../../../../common/constants/client_defaults'; +import { Ping } from '../../../../../common/runtime_types'; +import { EXCLUDE_RUN_ONCE_FILTER } from '../../../../../common/constants/client_defaults'; import { useUptimeRefreshContext } from '../../../contexts/uptime_refresh_context'; import { useInlineErrorsCount } from './use_inline_errors_count'; -import { SYNTHETICS_INDEX_PATTERN } from '../../../../common/constants'; +import { SYNTHETICS_INDEX_PATTERN } from '../../../../../common/constants'; const sortFieldMap: Record = { ['name.keyword']: 'monitor.name', diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_inline_errors_count.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_inline_errors_count.test.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_inline_errors_count.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_inline_errors_count.test.tsx index 7ad0d58488e99..b1dbb41880e65 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_inline_errors_count.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_inline_errors_count.test.tsx @@ -9,7 +9,7 @@ import { renderHook } from '@testing-library/react-hooks'; import { MockRedux } from '../../../lib/helper/rtl_helpers'; import { useInlineErrorsCount } from './use_inline_errors_count'; import * as obsvPlugin from '@kbn/observability-plugin/public/hooks/use_es_search'; -import { DEFAULT_THROTTLING } from '../../../../common/runtime_types'; +import { DEFAULT_THROTTLING } from '../../../../../common/runtime_types'; function mockNow(date: string | number | Date) { const fakeNow = new Date(date).getTime(); diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_inline_errors_count.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_inline_errors_count.ts similarity index 94% rename from x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_inline_errors_count.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_inline_errors_count.ts index 64b37d371cac5..dc69346e6c9a5 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_inline_errors_count.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_inline_errors_count.ts @@ -11,7 +11,7 @@ import { useEsSearch } from '@kbn/observability-plugin/public'; import { monitorManagementListSelector } from '../../../state/selectors'; import { useUptimeRefreshContext } from '../../../contexts/uptime_refresh_context'; import { getInlineErrorFilters } from './use_inline_errors'; -import { SYNTHETICS_INDEX_PATTERN } from '../../../../common/constants'; +import { SYNTHETICS_INDEX_PATTERN } from '../../../../../common/constants'; export function useInlineErrorsCount() { const monitorList = useSelector(monitorManagementListSelector); diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_invalid_monitors.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_invalid_monitors.tsx similarity index 90% rename from x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_invalid_monitors.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_invalid_monitors.tsx index cf63e7c4cd9e6..38e45e9a839d3 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_invalid_monitors.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_invalid_monitors.tsx @@ -8,8 +8,8 @@ import moment from 'moment'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { useFetcher } from '@kbn/observability-plugin/public'; -import { Ping, SyntheticsMonitor } from '../../../../common/runtime_types'; -import { syntheticsMonitorType } from '../../../../common/types/saved_objects'; +import { Ping, SyntheticsMonitor } from '../../../../../common/runtime_types'; +import { syntheticsMonitorType } from '../../../../../common/types/saved_objects'; export const useInvalidMonitors = (errorSummaries?: Ping[]) => { const { savedObjects } = useKibana().services; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_locations.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_locations.test.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_locations.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_locations.test.tsx index 46b8981b74a0f..020dea1209dff 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_locations.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_locations.test.tsx @@ -14,7 +14,7 @@ import { useLocations } from './use_locations'; import * as reactRedux from 'react-redux'; import { getServiceLocations } from '../../../state/actions'; -import { DEFAULT_THROTTLING } from '../../../../common/runtime_types'; +import { DEFAULT_THROTTLING } from '../../../../../common/runtime_types'; describe('useExpViewTimeRange', function () { const dispatch = jest.fn(); diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_locations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_locations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_locations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_locations.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_run_once_errors.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_run_once_errors.ts similarity index 97% rename from x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_run_once_errors.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_run_once_errors.ts index 204096f7e0181..916ca8c00b972 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_run_once_errors.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_run_once_errors.ts @@ -7,7 +7,7 @@ import { useEffect, useMemo, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { Locations, ServiceLocationErrors } from '../../../../common/runtime_types'; +import { Locations, ServiceLocationErrors } from '../../../../../common/runtime_types'; export function useRunOnceErrors({ testRunId, diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_service_allowed.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_service_allowed.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/hooks/use_service_allowed.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/hooks/use_service_allowed.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/loader/loader.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/loader/loader.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/loader/loader.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/loader/loader.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/loader/loader.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/loader/loader.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/loader/loader.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/loader/loader.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/mocks/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/mocks/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/mocks/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/mocks/index.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/mocks/locations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/mocks/locations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/mocks/locations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/mocks/locations.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/locations.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/locations.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/locations.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/locations.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/locations.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/locations.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/locations.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/locations.tsx index fff6e11890f11..029503196b6a3 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/locations.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/locations.tsx @@ -10,7 +10,7 @@ import { useSelector } from 'react-redux'; import { i18n } from '@kbn/i18n'; import { EuiCheckboxGroup, EuiFormRow } from '@elastic/eui'; import { monitorManagementListSelector } from '../../../state/selectors'; -import { MonitorServiceLocations } from '../../../../common/runtime_types'; +import { MonitorServiceLocations } from '../../../../../common/runtime_types'; interface Props { selectedLocations: MonitorServiceLocations; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_advanced_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_advanced_fields.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_advanced_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_advanced_fields.tsx index 086efe36ff113..c4b57f66c227d 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_advanced_fields.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_advanced_fields.tsx @@ -8,8 +8,8 @@ import { EuiFieldText, EuiFormRow, EuiLink, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import React, { memo } from 'react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { ConfigKey } from '../../../../common/runtime_types'; -import type { Validation } from '../../../../common/types'; +import { ConfigKey } from '../../../../../common/runtime_types'; +import type { Validation } from '../../../../../common/types'; import { DescribedFormGroupWithWrap } from '../../fleet_package/common/described_form_group_with_wrap'; import { usePolicyConfigContext } from '../../fleet_package/contexts'; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_config.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_config.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_config.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_config.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_config.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_config.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_config.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_config.tsx index f151d31e3fd98..3e85c932bf700 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_config.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_config.tsx @@ -25,8 +25,8 @@ import { ActionBarPortal } from '../action_bar/action_bar_portal'; import { useFormatMonitor } from '../hooks/use_format_monitor'; import { MonitorFields } from './monitor_fields'; import { TestNowMode, TestRun } from '../test_now_mode/test_now_mode'; -import { MonitorFields as MonitorFieldsType } from '../../../../common/runtime_types'; -import { DEFAULT_FIELDS } from '../../../../common/constants/monitor_defaults'; +import { MonitorFields as MonitorFieldsType } from '../../../../../common/runtime_types'; +import { DEFAULT_FIELDS } from '../../../../../common/constants/monitor_defaults'; export const MonitorConfig = ({ isEdit = false }: { isEdit: boolean }) => { const { monitorType } = usePolicyConfigContext(); diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_fields.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_fields.test.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_fields.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_fields.test.tsx index 7320410ae52eb..b4e97ba724393 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_fields.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_fields.test.tsx @@ -9,7 +9,7 @@ import { fireEvent } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import React from 'react'; -import { ConfigKey, DataStream, HTTPFields } from '../../../../common/runtime_types'; +import { ConfigKey, DataStream, HTTPFields } from '../../../../../common/runtime_types'; import { render } from '../../../lib/helper/rtl_helpers'; import { BrowserContextProvider, diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_fields.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_fields.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_fields.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_fields.tsx index 655bb5cecac85..eb109dd5d1063 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_fields.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_fields.tsx @@ -7,7 +7,7 @@ import React, { useMemo, useState } from 'react'; import { EuiForm } from '@elastic/eui'; -import { ConfigKey, DataStream } from '../../../../common/runtime_types'; +import { ConfigKey, DataStream } from '../../../../../common/runtime_types'; import { usePolicyConfigContext } from '../../fleet_package/contexts'; import { CustomFields } from '../../fleet_package/custom_fields'; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_name_location.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_name_location.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_name_location.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_name_location.tsx index e49a9b3e04833..0f7206f65992f 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/monitor_name_location.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/monitor_name_location.tsx @@ -9,8 +9,8 @@ import React, { useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormRow, EuiFieldText } from '@elastic/eui'; -import { ConfigKey } from '../../../../common/runtime_types'; -import { Validation } from '../../../../common/types'; +import { ConfigKey } from '../../../../../common/runtime_types'; +import { Validation } from '../../../../../common/types'; import { usePolicyConfigContext } from '../../fleet_package/contexts'; import { ServiceLocations } from './locations'; import { useMonitorName } from './use_monitor_name'; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/use_monitor_name.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/use_monitor_name.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/use_monitor_name.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/use_monitor_name.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/use_monitor_name.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/use_monitor_name.ts similarity index 95% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/use_monitor_name.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/use_monitor_name.ts index 200a9599b405e..c72c266bb6939 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_config/use_monitor_name.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_config/use_monitor_name.ts @@ -8,7 +8,7 @@ import { useEffect, useState } from 'react'; import { useFetcher } from '@kbn/observability-plugin/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { syntheticsMonitorType } from '../../../../common/types/saved_objects'; +import { syntheticsMonitorType } from '../../../../../common/types/saved_objects'; import { useMonitorId } from '../../../hooks'; interface AggsResponse { diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/actions.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/actions.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/actions.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/actions.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/actions.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/actions.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/actions.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/actions.tsx index c290e58dc6225..a6fa489be89ca 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/actions.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/actions.tsx @@ -12,7 +12,7 @@ import moment from 'moment'; import { UptimeSettingsContext } from '../../../contexts'; import { DeleteMonitor } from './delete_monitor'; import { InlineError } from './inline_error'; -import { MonitorManagementListResult, Ping } from '../../../../common/runtime_types'; +import { MonitorManagementListResult, Ping } from '../../../../../common/runtime_types'; interface Props { id: string; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/all_monitors.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/all_monitors.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/all_monitors.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/all_monitors.tsx index 550d3b487a4ae..ac6fab66bbb1e 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/all_monitors.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/all_monitors.tsx @@ -10,7 +10,7 @@ import { useSelector } from 'react-redux'; import { MonitorManagementList, MonitorManagementListPageState } from './monitor_list'; import { monitorManagementListSelector } from '../../../state/selectors'; import { MonitorManagementList as MonitorManagementListState } from '../../../state/reducers/monitor_management'; -import { Ping } from '../../../../common/runtime_types'; +import { Ping } from '../../../../../common/runtime_types'; interface Props { pageState: MonitorManagementListPageState; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/delete_monitor.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/delete_monitor.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/delete_monitor.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/delete_monitor.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/delete_monitor.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/delete_monitor.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/delete_monitor.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/delete_monitor.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/enablement_empty_state.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/enablement_empty_state.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/enablement_empty_state.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/enablement_empty_state.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/inline_error.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/inline_error.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/inline_error.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/inline_error.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/inline_error.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/inline_error.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/inline_error.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/inline_error.tsx index d9f47802e6c28..7ba74def660c9 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/inline_error.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/inline_error.tsx @@ -8,7 +8,7 @@ import React, { useState } from 'react'; import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { Ping } from '../../../../common/runtime_types'; +import { Ping } from '../../../../../common/runtime_types'; import { StdErrorPopover } from './stderr_logs_popover'; export const InlineError = ({ errorSummary }: { errorSummary: Ping }) => { diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/invalid_monitors.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/invalid_monitors.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/invalid_monitors.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/invalid_monitors.tsx index 342b9c6547b1b..5dea7b7ee06fd 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/invalid_monitors.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/invalid_monitors.tsx @@ -13,7 +13,7 @@ import { MonitorManagementListResult, Ping, DEFAULT_THROTTLING, -} from '../../../../common/runtime_types'; +} from '../../../../../common/runtime_types'; interface Props { loading: boolean; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/list_tabs.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/list_tabs.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/list_tabs.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/list_tabs.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/list_tabs.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/list_tabs.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/list_tabs.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/list_tabs.tsx index 15012751af3e5..e2da72effa560 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/list_tabs.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/list_tabs.tsx @@ -18,7 +18,7 @@ import React, { useState, Fragment, useEffect } from 'react'; import { useHistory, useParams } from 'react-router-dom'; import { useUptimeRefreshContext } from '../../../contexts/uptime_refresh_context'; import { MonitorManagementListPageState } from './monitor_list'; -import { ConfigKey } from '../../../../common/runtime_types'; +import { ConfigKey } from '../../../../../common/runtime_types'; export const MonitorListTabs = ({ invalidTotal, diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_async_error.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_async_error.test.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_async_error.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_async_error.test.tsx index da89876cc9b0b..2592aabf9eb09 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_async_error.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_async_error.test.tsx @@ -7,7 +7,7 @@ import { screen } from '@testing-library/react'; import React from 'react'; -import { DEFAULT_THROTTLING } from '../../../../common/runtime_types'; +import { DEFAULT_THROTTLING } from '../../../../../common/runtime_types'; import { render } from '../../../lib/helper/rtl_helpers'; import { MonitorManagementList as MonitorManagementListState } from '../../../state/reducers/monitor_management'; import { MonitorAsyncError } from './monitor_async_error'; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_async_error.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_async_error.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_async_error.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_async_error.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_enabled.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_enabled.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_enabled.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_enabled.test.tsx index d7e04f0e6140f..9d30d985f09d9 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_enabled.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_enabled.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { ConfigKey, DataStream, SyntheticsMonitor } from '../../../../common/runtime_types'; +import { ConfigKey, DataStream, SyntheticsMonitor } from '../../../../../common/runtime_types'; import { render } from '../../../lib/helper/rtl_helpers'; import { FETCH_STATUS } from '@kbn/observability-plugin/public'; import { spyOnUseFetcher } from '../../../lib/helper/spy_use_fetcher'; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_enabled.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_enabled.tsx similarity index 99% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_enabled.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_enabled.tsx index 6bbad58767b20..4b00f96077548 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_enabled.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_enabled.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import React, { useEffect, useState } from 'react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { FETCH_STATUS, useFetcher } from '@kbn/observability-plugin/public'; -import { ConfigKey, EncryptedSyntheticsMonitor } from '../../../../common/runtime_types'; +import { ConfigKey, EncryptedSyntheticsMonitor } from '../../../../../common/runtime_types'; import { setMonitor } from '../../../state/api'; interface Props { diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_list.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_list.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_list.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_list.test.tsx index a641f7a76f3a7..5c13b34366d59 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_list.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_list.test.tsx @@ -14,7 +14,7 @@ import { HTTPFields, ScheduleUnit, DEFAULT_THROTTLING, -} from '../../../../common/runtime_types'; +} from '../../../../../common/runtime_types'; import { render } from '../../../lib/helper/rtl_helpers'; import { MonitorManagementList as MonitorManagementListState } from '../../../state/reducers/monitor_management'; import { MonitorManagementList, MonitorManagementListPageState } from './monitor_list'; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_list.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_list.tsx similarity index 99% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_list.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_list.tsx index 6dade5a1e4186..37a23bdcff83b 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_list.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_list.tsx @@ -25,7 +25,7 @@ import { ServiceLocations, EncryptedSyntheticsMonitorWithId, TCPSimpleFields, -} from '../../../../common/runtime_types'; +} from '../../../../../common/runtime_types'; import { UptimeSettingsContext } from '../../../contexts'; import { useBreakpoints } from '../../../hooks'; import { MonitorManagementList as MonitorManagementListState } from '../../../state/reducers/monitor_management'; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_list_container.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_list_container.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_list_container.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_list_container.tsx index 92b61cf1d744d..7191cd71b0a36 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_list_container.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_list_container.tsx @@ -9,7 +9,7 @@ import React, { useEffect, useReducer, useCallback, Reducer } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { useParams } from 'react-router-dom'; import { useTrackPageview } from '@kbn/observability-plugin/public'; -import { ConfigKey } from '../../../../common/runtime_types'; +import { ConfigKey } from '../../../../../common/runtime_types'; import { getMonitors } from '../../../state/actions'; import { monitorManagementListSelector } from '../../../state/selectors'; import { MonitorManagementListPageState } from './monitor_list'; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_locations.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_locations.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_locations.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_locations.tsx index 940e6260d864c..5f9ad96bca464 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/monitor_locations.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/monitor_locations.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { EuiBadge, EuiBadgeGroup } from '@elastic/eui'; -import { ServiceLocations, ServiceLocation } from '../../../../common/runtime_types'; +import { ServiceLocations, ServiceLocation } from '../../../../../common/runtime_types'; import { EXPAND_LOCATIONS_LABEL } from '../../overview/monitor_list/columns/translations'; import { useLocations } from '../hooks/use_locations'; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/stderr_logs_popover.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/stderr_logs_popover.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/stderr_logs_popover.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/stderr_logs_popover.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/tags.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/tags.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/tags.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/monitor_list/tags.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/show_sync_errors.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/show_sync_errors.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor_management/show_sync_errors.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/show_sync_errors.tsx index 0ce1fdd0d768e..0fde06c764c08 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/show_sync_errors.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/show_sync_errors.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; import { kibanaService } from '../../state/kibana_service'; -import { ServiceLocationErrors, ServiceLocations } from '../../../common/runtime_types'; +import { ServiceLocationErrors, ServiceLocations } from '../../../../common/runtime_types'; export const showSyncErrors = (errors: ServiceLocationErrors, locations: ServiceLocations) => { Object.values(errors).forEach((location) => { diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/browser/browser_test_results.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/browser/browser_test_results.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/browser/browser_test_results.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/browser/browser_test_results.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/browser/browser_test_results.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/browser/browser_test_results.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/browser/browser_test_results.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/browser/browser_test_results.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.ts similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.ts index 68f96b5d7b487..034fad5b9a8d0 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/browser/use_browser_run_once_monitors.ts @@ -6,11 +6,11 @@ */ import { useEffect, useState, useRef } from 'react'; import { createEsParams, useEsSearch, useFetcher } from '@kbn/observability-plugin/public'; -import { JourneyStep } from '../../../../../common/runtime_types'; +import { JourneyStep } from '../../../../../../common/runtime_types'; import { useTickTick } from '../use_tick_tick'; import { fetchJourneySteps } from '../../../../state/api/journey'; import { isStepEnd } from '../../../synthetics/check_steps/steps_list'; -import { SYNTHETICS_INDEX_PATTERN } from '../../../../../common/constants'; +import { SYNTHETICS_INDEX_PATTERN } from '../../../../../../common/constants'; export interface CheckGroupResult { checkGroupId: string; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/simple/simple_test_results.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/simple/simple_test_results.test.tsx similarity index 99% rename from x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/simple/simple_test_results.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/simple/simple_test_results.test.tsx index 6ef4daf9fbdf3..c0bab63b1c11d 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/simple/simple_test_results.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/simple/simple_test_results.test.tsx @@ -11,7 +11,7 @@ import { render } from '../../../../lib/helper/rtl_helpers'; import { SimpleTestResults } from './simple_test_results'; import { kibanaService } from '../../../../state/kibana_service'; import * as runOnceHooks from './use_simple_run_once_monitors'; -import { Ping } from '../../../../../common/runtime_types'; +import { Ping } from '../../../../../../common/runtime_types'; describe('SimpleTestResults', function () { const onDone = jest.fn(); diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/simple/simple_test_results.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/simple/simple_test_results.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/simple/simple_test_results.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/simple/simple_test_results.tsx index b1ac899a8951e..580c936272b59 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/simple/simple_test_results.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/simple/simple_test_results.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useState } from 'react'; import { useSimpleRunOnceMonitors } from './use_simple_run_once_monitors'; -import { Ping } from '../../../../../common/runtime_types'; +import { Ping } from '../../../../../../common/runtime_types'; import { PingListTable } from '../../../monitor/ping_list/ping_list_table'; import { TestResultHeader } from '../test_result_header'; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/simple/use_simple_run_once_monitors.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/simple/use_simple_run_once_monitors.ts similarity index 94% rename from x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/simple/use_simple_run_once_monitors.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/simple/use_simple_run_once_monitors.ts index 3ca3691aef22c..f0282aaad47a2 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/simple/use_simple_run_once_monitors.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/simple/use_simple_run_once_monitors.ts @@ -7,9 +7,9 @@ import { useMemo, useRef } from 'react'; import { createEsParams, useEsSearch } from '@kbn/observability-plugin/public'; -import { Ping } from '../../../../../common/runtime_types'; +import { Ping } from '../../../../../../common/runtime_types'; import { useTickTick } from '../use_tick_tick'; -import { SYNTHETICS_INDEX_PATTERN } from '../../../../../common/constants'; +import { SYNTHETICS_INDEX_PATTERN } from '../../../../../../common/constants'; export const useSimpleRunOnceMonitors = ({ configId, diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/test_now_mode.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/test_now_mode.test.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/test_now_mode.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/test_now_mode.test.tsx index da06b41d16530..b040f7a27da33 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/test_now_mode.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/test_now_mode.test.tsx @@ -10,7 +10,7 @@ import { screen } from '@testing-library/react'; import { render } from '../../../lib/helper/rtl_helpers'; import { TestNowMode } from './test_now_mode'; import { kibanaService } from '../../../state/kibana_service'; -import { Locations, MonitorFields } from '../../../../common/runtime_types'; +import { Locations, MonitorFields } from '../../../../../common/runtime_types'; import * as runOnceErrorHooks from '../hooks/use_run_once_errors'; describe('TestNowMode', function () { diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/test_now_mode.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/test_now_mode.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/test_now_mode.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/test_now_mode.tsx index e89298c9aa46b..25a2f7d02a5fe 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/test_now_mode.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/test_now_mode.tsx @@ -18,7 +18,11 @@ import { import { useFetcher } from '@kbn/observability-plugin/public'; import { useRunOnceErrors } from '../hooks/use_run_once_errors'; import { TestRunResult } from './test_run_results'; -import { Locations, MonitorFields, ServiceLocationErrors } from '../../../../common/runtime_types'; +import { + Locations, + MonitorFields, + ServiceLocationErrors, +} from '../../../../../common/runtime_types'; import { runOnceMonitor } from '../../../state/api'; import { kibanaService } from '../../../state/kibana_service'; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/test_result_header.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/test_result_header.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/test_result_header.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/test_result_header.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/test_result_header.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/test_result_header.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/test_result_header.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/test_result_header.tsx index 62c1971d87ed1..4cd4df567882d 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/test_result_header.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/test_result_header.tsx @@ -17,7 +17,7 @@ import { import { i18n } from '@kbn/i18n'; import * as React from 'react'; import { formatDuration } from '../../monitor/ping_list/ping_list'; -import { JourneyStep, Ping } from '../../../../common/runtime_types'; +import { JourneyStep, Ping } from '../../../../../common/runtime_types'; import { useUptimeSettingsContext } from '../../../contexts/uptime_settings_context'; interface Props { diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/test_run_results.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/test_run_results.tsx similarity index 93% rename from x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/test_run_results.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/test_run_results.tsx index b1a6d0aba8cfc..6e9ef292ad6b2 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/test_run_results.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/test_run_results.tsx @@ -6,7 +6,7 @@ */ import * as React from 'react'; -import { SyntheticsMonitor } from '../../../../common/runtime_types'; +import { SyntheticsMonitor } from '../../../../../common/runtime_types'; import { BrowserTestRunResult } from './browser/browser_test_results'; import { SimpleTestResults } from './simple/simple_test_results'; diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/use_tick_tick.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/use_tick_tick.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/monitor_management/test_now_mode/use_tick_tick.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/test_now_mode/use_tick_tick.ts diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/validation.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/validation.test.ts similarity index 99% rename from x-pack/plugins/synthetics/public/components/monitor_management/validation.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/validation.test.ts index 6fa57eb5cd964..ce7c08a45dbaf 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/validation.test.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/validation.test.ts @@ -13,7 +13,7 @@ import { MonitorFields, ScheduleUnit, ServiceLocations, -} from '../../../common/runtime_types'; +} from '../../../../common/runtime_types'; import { validate, validateCommon } from './validation'; describe('[Monitor Management] validation', () => { diff --git a/x-pack/plugins/synthetics/public/components/monitor_management/validation.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/validation.ts similarity index 98% rename from x-pack/plugins/synthetics/public/components/monitor_management/validation.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/validation.ts index 78b0b8ba82b68..0975d00b38098 100644 --- a/x-pack/plugins/synthetics/public/components/monitor_management/validation.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/validation.ts @@ -11,8 +11,8 @@ import { ScheduleUnit, MonitorFields, isServiceLocationInvalid, -} from '../../../common/runtime_types'; -import { Validation } from '../../../common/types'; +} from '../../../../common/runtime_types'; +import { Validation } from '../../../../common/types'; export const digitsOnly = /^[0-9]*$/g; export const includesValidPort = /[^\:]+:[0-9]{1,5}$/g; diff --git a/x-pack/plugins/synthetics/public/components/overview/__snapshots__/snapshot_heading.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/__snapshots__/snapshot_heading.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/__snapshots__/snapshot_heading.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/__snapshots__/snapshot_heading.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/alert_expression_popover.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alert_expression_popover.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/alert_expression_popover.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alert_expression_popover.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/alert_field_number.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alert_field_number.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/alert_field_number.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alert_field_number.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/alert_field_number.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alert_field_number.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/alert_field_number.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alert_field_number.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/alert_query_bar/query_bar.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alert_query_bar/query_bar.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/alert_query_bar/query_bar.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alert_query_bar/query_bar.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/alert_tls.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alert_tls.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/alert_tls.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alert_tls.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/alerts_containers/alert_monitor_status.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alerts_containers/alert_monitor_status.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/overview/alerts/alerts_containers/alert_monitor_status.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alerts_containers/alert_monitor_status.tsx index 09b116c5bbc45..54a8010e30a1c 100644 --- a/x-pack/plugins/synthetics/public/components/overview/alerts/alerts_containers/alert_monitor_status.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alerts_containers/alert_monitor_status.tsx @@ -14,10 +14,10 @@ import { setSearchTextAction } from '../../../../state/actions'; import { AtomicStatusCheckParamsType, GetMonitorAvailabilityParamsType, -} from '../../../../../common/runtime_types'; +} from '../../../../../../common/runtime_types'; import { useSnapShotCount } from './use_snap_shot'; -import { FILTER_FIELDS } from '../../../../../common/constants'; +import { FILTER_FIELDS } from '../../../../../../common/constants'; const { TYPE, TAGS, LOCATION, PORT } = FILTER_FIELDS; diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/alerts_containers/alert_tls.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alerts_containers/alert_tls.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/alerts_containers/alert_tls.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alerts_containers/alert_tls.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/alerts_containers/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alerts_containers/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/alerts_containers/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alerts_containers/index.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/alerts_containers/toggle_alert_flyout_button.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alerts_containers/toggle_alert_flyout_button.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/alerts_containers/toggle_alert_flyout_button.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alerts_containers/toggle_alert_flyout_button.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/alerts_containers/uptime_alerts_flyout_wrapper.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alerts_containers/uptime_alerts_flyout_wrapper.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/alerts_containers/uptime_alerts_flyout_wrapper.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alerts_containers/uptime_alerts_flyout_wrapper.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/alerts_containers/use_snap_shot.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alerts_containers/use_snap_shot.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/alerts_containers/use_snap_shot.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/alerts_containers/use_snap_shot.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/anomaly_alert/anomaly_alert.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/anomaly_alert/anomaly_alert.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/anomaly_alert/anomaly_alert.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/anomaly_alert/anomaly_alert.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/anomaly_alert/select_severity.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/anomaly_alert/select_severity.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/anomaly_alert/select_severity.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/anomaly_alert/select_severity.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/anomaly_alert/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/anomaly_alert/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/anomaly_alert/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/anomaly_alert/translations.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/index.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/availability_expression_select.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/availability_expression_select.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/availability_expression_select.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/availability_expression_select.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/down_number_select.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/down_number_select.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/down_number_select.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/down_number_select.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/down_number_select.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/down_number_select.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/down_number_select.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/down_number_select.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/filters_expression_select.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/filters_expression_select.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/filters_expression_select.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/filters_expression_select.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx index 3720179838899..12b28352a503e 100644 --- a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/filters_expression_select.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx @@ -11,7 +11,7 @@ import { FieldValueSuggestions } from '@kbn/observability-plugin/public'; import { filterLabels } from '../../filter_group/translations'; import { alertFilterLabels, filterAriaLabels } from './translations'; import { useUptimeDataView } from '../../../../contexts/uptime_data_view_context'; -import { FILTER_FIELDS } from '../../../../../common/constants'; +import { FILTER_FIELDS } from '../../../../../../common/constants'; import { useGetUrlParams } from '../../../../hooks'; export interface FilterExpressionsSelectProps { diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/index.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/status_expression_select.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/status_expression_select.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/status_expression_select.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/status_expression_select.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/time_expression_select.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_expression_select.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/time_expression_select.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_expression_select.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/time_expression_select.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_expression_select.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/time_expression_select.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_expression_select.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/time_unit_selectable.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_unit_selectable.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/time_unit_selectable.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_unit_selectable.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_expressions/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/translations.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_status_alert/add_filter_btn.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_status_alert/add_filter_btn.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_status_alert/add_filter_btn.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_status_alert/add_filter_btn.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_status_alert/add_filter_btn.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_status_alert/add_filter_btn.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_status_alert/add_filter_btn.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_status_alert/add_filter_btn.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_status_alert/alert_monitor_status.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_status_alert/alert_monitor_status.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_status_alert/alert_monitor_status.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_status_alert/alert_monitor_status.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_status_alert/alert_monitor_status.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_status_alert/alert_monitor_status.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_status_alert/alert_monitor_status.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_status_alert/alert_monitor_status.tsx index 1fa06458e3a8b..80958e3bdd767 100644 --- a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_status_alert/alert_monitor_status.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_status_alert/alert_monitor_status.tsx @@ -14,7 +14,7 @@ import { OldAlertCallOut } from './old_alert_call_out'; import { AvailabilityExpressionSelect } from '../monitor_expressions/availability_expression_select'; import { AlertQueryBar } from '../alert_query_bar/query_bar'; import { useGetUrlParams } from '../../../../hooks'; -import { FILTER_FIELDS } from '../../../../../common/constants'; +import { FILTER_FIELDS } from '../../../../../../common/constants'; export interface AlertMonitorStatusProps { ruleParams: { [key: string]: any }; diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_status_alert/old_alert_call_out.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_status_alert/old_alert_call_out.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_status_alert/old_alert_call_out.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_status_alert/old_alert_call_out.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/monitor_status_alert/old_alert_callout.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_status_alert/old_alert_callout.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/monitor_status_alert/old_alert_callout.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_status_alert/old_alert_callout.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/settings_message_expression_popover.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/settings_message_expression_popover.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/settings_message_expression_popover.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/settings_message_expression_popover.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/toggle_alert_flyout_button.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/toggle_alert_flyout_button.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/toggle_alert_flyout_button.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/toggle_alert_flyout_button.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/toggle_alert_flyout_button.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/toggle_alert_flyout_button.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/overview/alerts/toggle_alert_flyout_button.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/toggle_alert_flyout_button.tsx index 894c3df70a405..86b745c7d227f 100644 --- a/x-pack/plugins/synthetics/public/components/overview/alerts/toggle_alert_flyout_button.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/toggle_alert_flyout_button.tsx @@ -17,8 +17,8 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { CLIENT_ALERT_TYPES } from '../../../../common/constants/alerts'; -import { ClientPluginsStart } from '../../../apps/plugin'; +import { CLIENT_ALERT_TYPES } from '../../../../../common/constants/alerts'; +import { ClientPluginsStart } from '../../../../plugin'; import { ToggleFlyoutTranslations } from './translations'; import { ToggleAlertFlyoutButtonProps } from './alerts_containers'; diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/translations.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/alerts/uptime_alerts_flyout_wrapper.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/uptime_alerts_flyout_wrapper.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/alerts/uptime_alerts_flyout_wrapper.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/uptime_alerts_flyout_wrapper.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/empty_state/empty_state_error.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/empty_state/empty_state_error.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/empty_state/empty_state_error.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/empty_state/empty_state_error.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/empty_state/empty_state_loading.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/empty_state/empty_state_loading.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/empty_state/empty_state_loading.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/empty_state/empty_state_loading.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/empty_state/use_has_data.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/empty_state/use_has_data.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/empty_state/use_has_data.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/empty_state/use_has_data.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/filter_group/filter_group.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/filter_group/filter_group.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/filter_group/filter_group.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/filter_group/filter_group.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/filter_group/filter_group.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/filter_group/filter_group.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/overview/filter_group/filter_group.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/filter_group/filter_group.tsx index 8a0ac4cbe81b1..16ab92a6862c2 100644 --- a/x-pack/plugins/synthetics/public/components/overview/filter_group/filter_group.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/filter_group/filter_group.tsx @@ -15,7 +15,7 @@ import { useSelectedFilters } from '../../../hooks/use_selected_filters'; import { SelectedFilters } from './selected_filters'; import { useUptimeDataView } from '../../../contexts/uptime_data_view_context'; import { useGetUrlParams } from '../../../hooks'; -import { EXCLUDE_RUN_ONCE_FILTER } from '../../../../common/constants/client_defaults'; +import { EXCLUDE_RUN_ONCE_FILTER } from '../../../../../common/constants/client_defaults'; const Container = styled(EuiFilterGroup)` margin-bottom: 10px; diff --git a/x-pack/plugins/synthetics/public/components/overview/filter_group/selected_filters.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/filter_group/selected_filters.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/filter_group/selected_filters.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/filter_group/selected_filters.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/filter_group/translations.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/filter_group/translations.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/filter_group/translations.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/filter_group/translations.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/index.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/__snapshots__/filter_status_button.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/__snapshots__/filter_status_button.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/__snapshots__/filter_status_button.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/__snapshots__/filter_status_button.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/__snapshots__/status_filter.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/__snapshots__/status_filter.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/__snapshots__/status_filter.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/__snapshots__/status_filter.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/cert_status_column.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/cert_status_column.tsx similarity index 93% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/cert_status_column.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/cert_status_column.tsx index 790342b593398..5d24b7d969984 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/cert_status_column.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/cert_status_column.tsx @@ -9,10 +9,10 @@ import React from 'react'; import moment from 'moment'; import styled from 'styled-components'; import { EuiIcon, EuiText, EuiToolTip } from '@elastic/eui'; -import { X509Expiry } from '../../../../../common/runtime_types'; +import { X509Expiry } from '../../../../../../common/runtime_types'; import { useCertStatus } from '../../../../hooks'; import { EXPIRED, EXPIRES, EXPIRES_SOON } from '../../../certificates/translations'; -import { CERT_STATUS } from '../../../../../common/constants'; +import { CERT_STATUS } from '../../../../../../common/constants'; interface Props { expiry: X509Expiry; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/define_connectors.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/define_connectors.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/define_connectors.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/define_connectors.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/define_connectors.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/define_connectors.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/define_connectors.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/define_connectors.tsx index f5ac702d5060b..5bb676178d9a7 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/define_connectors.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/define_connectors.tsx @@ -9,7 +9,7 @@ import React, { useState } from 'react'; import { EuiSwitch, EuiPopover, EuiText, EuiFormRow } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { ReactRouterEuiLink } from '../../../common/react_router_helpers'; -import { SETTINGS_ROUTE } from '../../../../../common/constants'; +import { SETTINGS_ROUTE } from '../../../../../../common/constants'; import { ENABLE_STATUS_ALERT } from './translations'; interface Props { diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/enable_alert.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/enable_alert.test.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/enable_alert.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/enable_alert.test.tsx index c5dff902cfb14..416dd8e963e9b 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/enable_alert.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/enable_alert.test.tsx @@ -9,8 +9,8 @@ import React from 'react'; import { EnableMonitorAlert } from './enable_alert'; import { fireEvent } from '@testing-library/dom'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../../common/constants'; -import { makePing } from '../../../../../common/runtime_types/ping'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../../../common/constants'; +import { makePing } from '../../../../../../common/runtime_types/ping'; import { render } from '../../../../lib/helper/rtl_helpers'; import { DISABLE_STATUS_ALERT, ENABLE_STATUS_ALERT } from './translations'; import { mockState } from '../../../../lib/__mocks__/uptime_store.mock'; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/enable_alert.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/enable_alert.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/enable_alert.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/enable_alert.tsx index 3bc23592c4e64..b52aacd5abb6e 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/enable_alert.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/enable_alert.tsx @@ -18,10 +18,10 @@ import { isAlertDeletedSelector, newAlertSelector, } from '../../../../state/alerts/alerts'; -import { MONITOR_ROUTE } from '../../../../../common/constants'; +import { MONITOR_ROUTE } from '../../../../../../common/constants'; import { DefineAlertConnectors } from './define_connectors'; import { DISABLE_STATUS_ALERT, ENABLE_STATUS_ALERT } from './translations'; -import { Ping } from '../../../../../common/runtime_types/ping'; +import { Ping } from '../../../../../../common/runtime_types/ping'; interface Props { monitorId: string; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/monitor_name_col.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_name_col.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/monitor_name_col.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_name_col.tsx index 130ccbd7081c3..00590f46b51f1 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/monitor_name_col.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_name_col.tsx @@ -11,7 +11,7 @@ import { EuiButtonEmpty, EuiText } from '@elastic/eui'; import { MonitorPageLink } from '../../../common/monitor_page_link'; import { useGetUrlParams } from '../../../../hooks'; import { stringifyUrlParams } from '../../../../lib/helper/stringify_url_params'; -import { MonitorSummary } from '../../../../../common/runtime_types/monitor'; +import { MonitorSummary } from '../../../../../../common/runtime_types/monitor'; import { useFilterUpdate } from '../../../../hooks/use_filter_update'; interface Props { diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/monitor_status_column.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/monitor_status_column.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.test.tsx index a6c837ca13a7f..a69ebb3d349fd 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/monitor_status_column.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.test.tsx @@ -7,8 +7,8 @@ import React from 'react'; import { getLocationStatus, MonitorListStatusColumn } from './monitor_status_column'; -import { Ping } from '../../../../../common/runtime_types'; -import { STATUS } from '../../../../../common/constants'; +import { Ping } from '../../../../../../common/runtime_types'; +import { STATUS } from '../../../../../../common/constants'; import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { mockDate, mockMoment } from '../../../../lib/helper/test_helpers'; import { render } from '../../../../lib/helper/rtl_helpers'; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/monitor_status_column.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/monitor_status_column.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.tsx index 6fb3a463ebf77..7f64c1199c2b0 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/monitor_status_column.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.tsx @@ -23,13 +23,13 @@ import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { kibanaService } from '../../../../state/kibana_service'; import { useRunOnceErrors } from '../../../monitor_management/hooks/use_run_once_errors'; import { parseTimestamp } from '../parse_timestamp'; -import { DataStream, Ping, PingError } from '../../../../../common/runtime_types'; +import { DataStream, Ping, PingError } from '../../../../../../common/runtime_types'; import { STATUS, SHORT_TIMESPAN_LOCALE, UNNAMED_LOCATION, SHORT_TS_LOCALE, -} from '../../../../../common/constants'; +} from '../../../../../../common/constants'; import { STATUS_DOWN_LABEL, STATUS_UP_LABEL } from '../../../common/translations'; import { MonitorProgress } from './progress/monitor_progress'; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/progress/browser_monitor_progress.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/progress/browser_monitor_progress.tsx similarity index 93% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/progress/browser_monitor_progress.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/progress/browser_monitor_progress.tsx index b92916bd7b72b..0692af54b9bf4 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/progress/browser_monitor_progress.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/progress/browser_monitor_progress.tsx @@ -7,8 +7,8 @@ import { EuiBadge, EuiProgress } from '@elastic/eui'; import React, { useEffect, useRef, useState } from 'react'; -import { scheduleToMilli } from '../../../../../../common/lib/schedule_to_time'; -import { SyntheticsMonitorSchedule } from '../../../../../../common/runtime_types'; +import { scheduleToMilli } from '../../../../../../../common/lib/schedule_to_time'; +import { SyntheticsMonitorSchedule } from '../../../../../../../common/runtime_types'; import { useBrowserRunOnceMonitors } from '../../../../monitor_management/test_now_mode/browser/use_browser_run_once_monitors'; import { IN_PROGRESS_LABEL, diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/progress/monitor_progress.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/progress/monitor_progress.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/progress/monitor_progress.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/progress/monitor_progress.tsx index b03d278f09d45..ebc28310930ad 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/progress/monitor_progress.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/progress/monitor_progress.tsx @@ -9,7 +9,7 @@ import React, { useEffect } from 'react'; import { useSelector } from 'react-redux'; import { SimpleMonitorProgress } from './simple_monitor_progress'; import { BrowserMonitorProgress } from './browser_monitor_progress'; -import { DataStream, SyntheticsMonitorSchedule } from '../../../../../../common/runtime_types'; +import { DataStream, SyntheticsMonitorSchedule } from '../../../../../../../common/runtime_types'; import { useUpdatedMonitor } from './use_updated_monitor'; import { refreshedMonitorSelector } from '../../../../../state/reducers/monitor_list'; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/progress/simple_monitor_progress.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/progress/simple_monitor_progress.tsx similarity index 92% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/progress/simple_monitor_progress.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/progress/simple_monitor_progress.tsx index f93bcadd58519..bbc96eeda397b 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/progress/simple_monitor_progress.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/progress/simple_monitor_progress.tsx @@ -7,8 +7,8 @@ import { EuiBadge, EuiProgress } from '@elastic/eui'; import React, { useEffect, useRef, useState } from 'react'; -import { scheduleToMilli } from '../../../../../../common/lib/schedule_to_time'; -import { SyntheticsMonitorSchedule } from '../../../../../../common/runtime_types'; +import { scheduleToMilli } from '../../../../../../../common/lib/schedule_to_time'; +import { SyntheticsMonitorSchedule } from '../../../../../../../common/runtime_types'; import { useSimpleRunOnceMonitors } from '../../../../monitor_management/test_now_mode/simple/use_simple_run_once_monitors'; import { IN_PROGRESS_LABEL } from '../../../../monitor_management/test_now_mode/test_result_header'; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/progress/use_updated_monitor.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/progress/use_updated_monitor.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/progress/use_updated_monitor.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/progress/use_updated_monitor.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/status_badge.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/status_badge.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/status_badge.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.tsx similarity index 93% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/status_badge.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.tsx index fe2c7730275db..0328242ffc036 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/status_badge.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.tsx @@ -7,10 +7,10 @@ import { EuiBadge, EuiToolTip } from '@elastic/eui'; import React, { useContext, useState } from 'react'; -import { STATUS } from '../../../../../common/constants'; +import { STATUS } from '../../../../../../common/constants'; import { getHealthMessage } from './monitor_status_column'; import { UptimeThemeContext } from '../../../../contexts'; -import { PingError } from '../../../../../common/runtime_types'; +import { PingError } from '../../../../../../common/runtime_types'; import { getInlineErrorLabel } from '../../../monitor_management/monitor_list/inline_error'; import { StdErrorPopover } from '../../../monitor_management/monitor_list/stderr_logs_popover'; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/test_now_col.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/test_now_col.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/test_now_col.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/test_now_col.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/columns/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/columns/translations.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/filter_status_button.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/filter_status_button.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/filter_status_button.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/filter_status_button.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/filter_status_button.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/filter_status_button.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/filter_status_button.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/filter_status_button.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/index.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list.test.tsx similarity index 99% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list.test.tsx index 495facf9c2cc8..d0026b1c5f0ba 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list.test.tsx @@ -14,7 +14,7 @@ import { makePing, Ping, MonitorSummary, -} from '../../../../common/runtime_types'; +} from '../../../../../common/runtime_types'; import { MonitorListComponent } from './monitor_list'; import moment from 'moment'; import { IHttpFetchError, ResponseErrorBody } from '@kbn/core/public'; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list.tsx index bf33bc52ffb68..c5a38067965c3 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list.tsx @@ -18,8 +18,8 @@ import { getBreakpoint, } from '@elastic/eui'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { X509Expiry } from '../../../../common/runtime_types'; -import { MonitorSummary } from '../../../../common/runtime_types'; +import { X509Expiry } from '../../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../../common/runtime_types'; import { MonitorListStatusColumn } from './columns/monitor_status_column'; import { ExpandedRowMap } from './types'; import { MonitorBarSeries } from '../../common/charts'; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_container.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_container.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_container.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_container.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_group.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_group.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_group.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_group.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_link.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_link.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_link.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_link.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/__snapshots__/most_recent_error.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/most_recent_error.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/__snapshots__/most_recent_error.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/most_recent_error.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx index eee1c461fb1cb..9a8b660cb41bb 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; import { EuiPopover, EuiButton } from '@elastic/eui'; import { IntegrationGroup } from './integration_group'; -import { MonitorSummary } from '../../../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../../../../common/runtime_types'; import { toggleIntegrationsPopover, PopoverState } from '../../../../../state/actions'; export interface ActionsPopoverProps { diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover_container.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover_container.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover_container.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover_container.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx similarity index 99% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx index 97d1e8da61a7f..51d24978026e4 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx @@ -19,7 +19,7 @@ import { getLoggingIpHref, getLoggingKubernetesHref, } from '../../../../../lib/helper'; -import { MonitorSummary } from '../../../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../../../../common/runtime_types'; import { UptimeSettingsContext } from '../../../../../contexts'; interface IntegrationGroupProps { diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_link.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_link.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_link.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_link.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/data.json b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/data.json similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/data.json rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/data.json diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/enabled_alerts.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/enabled_alerts.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/enabled_alerts.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/enabled_alerts.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/index.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/integration_group.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/integration_group.test.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/integration_group.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/integration_group.test.tsx index 5f50285063541..ee58d2f78d31a 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/integration_group.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/integration_group.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { MonitorSummary, makePing } from '../../../../../common/runtime_types'; +import { MonitorSummary, makePing } from '../../../../../../common/runtime_types'; import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { IntegrationGroup, extractSummaryValues } from './actions_popover/integration_group'; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/integration_link.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/integration_link.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/integration_link.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/integration_link.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx index 2b97f53f21356..a0708712c8cd3 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx @@ -12,7 +12,7 @@ import { monitorDetailsLoadingSelector, monitorDetailsSelector } from '../../../ import { getMonitorDetailsAction } from '../../../../state/actions/monitor'; import { MonitorListDrawerComponent } from './monitor_list_drawer'; import { useGetUrlParams } from '../../../../hooks'; -import { MonitorSummary } from '../../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../../../common/runtime_types'; import { alertsSelector } from '../../../../state/alerts/alerts'; import { UptimeRefreshContext } from '../../../../contexts'; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx index 240697af470b0..78a70d14fa271 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { MonitorListDrawerComponent } from './monitor_list_drawer'; -import { MonitorDetails, MonitorSummary, makePing } from '../../../../../common/runtime_types'; +import { MonitorDetails, MonitorSummary, makePing } from '../../../../../../common/runtime_types'; import { shallowWithRouter } from '../../../../lib'; describe('MonitorListDrawer component', () => { diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx index 092614b870bda..81648bee153cd 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx @@ -11,7 +11,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import { Rule } from '@kbn/triggers-actions-ui-plugin/public'; import { MostRecentError } from './most_recent_error'; import { MonitorStatusList } from './monitor_status_list'; -import { MonitorDetails, MonitorSummary } from '../../../../../common/runtime_types'; +import { MonitorDetails, MonitorSummary } from '../../../../../../common/runtime_types'; import { ActionsPopover } from './actions_popover/actions_popover_container'; import { EnabledAlerts } from './enabled_alerts'; import { MonitorUrl } from './monitor_url'; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx index ad9347ab84763..f1a9d1b2629a6 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { MonitorStatusList } from './monitor_status_list'; -import { Ping } from '../../../../../common/runtime_types'; +import { Ping } from '../../../../../../common/runtime_types'; import { mockMoment } from '../../../../lib/helper/test_helpers'; import { render } from '../../../../lib/helper/rtl_helpers'; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx index 1207798a34023..753ae0b1390db 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx @@ -10,8 +10,8 @@ import { EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { LocationLink } from '../../../common/location_link'; import { MonitorStatusRow } from './monitor_status_row'; -import { Ping } from '../../../../../common/runtime_types'; -import { STATUS, UNNAMED_LOCATION } from '../../../../../common/constants'; +import { Ping } from '../../../../../../common/runtime_types'; +import { STATUS, UNNAMED_LOCATION } from '../../../../../../common/constants'; interface MonitorStatusListProps { /** diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx index 4bfe079e73a3f..7804b9bc94b5e 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { EuiBadge, EuiSpacer } from '@elastic/eui'; -import { UNNAMED_LOCATION, STATUS } from '../../../../../common/constants'; +import { UNNAMED_LOCATION, STATUS } from '../../../../../../common/constants'; import { getHealthMessage } from '../columns/monitor_status_column'; interface MonitorStatusRowProps { diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_url.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_url.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/monitor_url.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_url.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_error.test.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_error.test.tsx index 111a8a18ccad5..e3b36645ba7f3 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_error.test.tsx @@ -10,7 +10,7 @@ import React from 'react'; import moment from 'moment'; import { BrowserRouter as Router } from 'react-router-dom'; import { MostRecentError } from './most_recent_error'; -import { MonitorDetails, PingError } from '../../../../../common/runtime_types'; +import { MonitorDetails, PingError } from '../../../../../../common/runtime_types'; describe('MostRecentError component', () => { let monitorDetails: MonitorDetails; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx index 0b7c270c1b636..00484b8c40070 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx @@ -16,7 +16,7 @@ import { i18n } from '@kbn/i18n'; import { MonitorPageLink } from '../../../common/monitor_page_link'; import { useGetUrlParams } from '../../../../hooks'; import { stringifyUrlParams } from '../../../../lib/helper/stringify_url_params'; -import { PingError } from '../../../../../common/runtime_types'; +import { PingError } from '../../../../../../common/runtime_types'; interface MostRecentErrorProps { /** diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/most_recent_run.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_run.tsx similarity index 93% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/most_recent_run.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_run.tsx index 32fff166a228e..06bb51c959404 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_drawer/most_recent_run.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_run.tsx @@ -14,7 +14,7 @@ import { } from '@elastic/eui'; import moment from 'moment'; import { i18n } from '@kbn/i18n'; -import { MonitorSummary } from '../../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../../../common/runtime_types'; interface Props { summary: MonitorSummary; diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_header.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_header.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_header.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_header.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_page_size_select.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_page_size_select.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_page_size_select.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_page_size_select.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_page_size_select.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_page_size_select.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/monitor_list_page_size_select.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/monitor_list_page_size_select.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/no_items_meesage.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/no_items_meesage.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/no_items_meesage.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/no_items_meesage.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/no_items_message.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/no_items_message.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/no_items_message.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/no_items_message.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/overview_page_link.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/overview_page_link.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/overview_page_link.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/overview_page_link.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/parse_timestamp.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/parse_timestamp.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/parse_timestamp.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/parse_timestamp.test.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/parse_timestamp.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/parse_timestamp.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/parse_timestamp.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/parse_timestamp.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/status_filter.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/status_filter.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/status_filter.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/status_filter.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/status_filter.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/status_filter.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/status_filter.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/status_filter.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/translations.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/troubleshoot_popover.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/troubleshoot_popover.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/troubleshoot_popover.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/troubleshoot_popover.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/types.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/types.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/types.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/types.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/monitor_list/use_monitor_histogram.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/use_monitor_histogram.ts similarity index 94% rename from x-pack/plugins/synthetics/public/components/overview/monitor_list/use_monitor_histogram.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/use_monitor_histogram.ts index 8a6fb5a174856..1a9b7b73732af 100644 --- a/x-pack/plugins/synthetics/public/components/overview/monitor_list/use_monitor_histogram.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/monitor_list/use_monitor_histogram.ts @@ -13,12 +13,12 @@ import { Histogram, HistogramPoint, MonitorSummary, -} from '../../../../common/runtime_types/monitor'; +} from '../../../../../common/runtime_types/monitor'; import { useGetUrlParams } from '../../../hooks'; import { UptimeRefreshContext } from '../../../contexts'; import { esKuerySelector } from '../../../state/selectors'; -import { getHistogramInterval } from '../../../../common/lib/get_histogram_interval'; -import { Ping } from '../../../../common/runtime_types'; +import { getHistogramInterval } from '../../../../../common/lib/get_histogram_interval'; +import { Ping } from '../../../../../common/runtime_types'; export const useMonitorHistogram = ({ items }: { items: MonitorSummary[] }) => { const { dateRangeStart, dateRangeEnd, statusFilter } = useGetUrlParams(); diff --git a/x-pack/plugins/synthetics/public/components/overview/query_bar/query_bar.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/query_bar/query_bar.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/query_bar/query_bar.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/query_bar/query_bar.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/query_bar/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/query_bar/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/query_bar/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/query_bar/translations.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/query_bar/use_query_bar.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/query_bar/use_query_bar.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/query_bar/use_query_bar.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/query_bar/use_query_bar.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/query_bar/use_query_bar.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/query_bar/use_query_bar.ts similarity index 98% rename from x-pack/plugins/synthetics/public/components/overview/query_bar/use_query_bar.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/query_bar/use_query_bar.ts index 30658081183d5..75351e5872f35 100644 --- a/x-pack/plugins/synthetics/public/components/overview/query_bar/use_query_bar.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/query_bar/use_query_bar.ts @@ -17,7 +17,7 @@ import { useUrlParams, } from '../../../hooks'; import { setEsKueryString } from '../../../state/actions'; -import { UptimePluginServices } from '../../../apps/plugin'; +import { UptimePluginServices } from '../../../../plugin'; export enum SyntaxType { text = 'text', diff --git a/x-pack/plugins/synthetics/public/components/overview/snapshot/__snapshots__/snapshot.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/snapshot/__snapshots__/snapshot.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/snapshot/__snapshots__/snapshot.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/snapshot/__snapshots__/snapshot.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/overview/snapshot/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/snapshot/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/snapshot/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/snapshot/index.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/snapshot/snapshot.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/snapshot/snapshot.test.tsx similarity index 91% rename from x-pack/plugins/synthetics/public/components/overview/snapshot/snapshot.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/snapshot/snapshot.test.tsx index 3cea8199544d4..322db8908cca7 100644 --- a/x-pack/plugins/synthetics/public/components/overview/snapshot/snapshot.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/snapshot/snapshot.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { SnapshotComponent } from './snapshot'; -import { Snapshot } from '../../../../common/runtime_types/snapshot'; +import { Snapshot } from '../../../../../common/runtime_types/snapshot'; import * as hook from './use_snap_shot'; describe('Snapshot component', () => { diff --git a/x-pack/plugins/synthetics/public/components/overview/snapshot/snapshot.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/snapshot/snapshot.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/snapshot/snapshot.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/snapshot/snapshot.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/snapshot/snapshot_heading.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/snapshot/snapshot_heading.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/snapshot/snapshot_heading.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/snapshot/snapshot_heading.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/snapshot/use_snap_shot.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/snapshot/use_snap_shot.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/snapshot/use_snap_shot.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/snapshot/use_snap_shot.ts diff --git a/x-pack/plugins/synthetics/public/components/overview/snapshot_heading.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/snapshot_heading.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/snapshot_heading.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/snapshot_heading.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/status_panel.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/status_panel.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/status_panel.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/status_panel.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/synthetics_callout.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/synthetics_callout.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/synthetics_callout.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/synthetics_callout.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/overview/synthetics_callout.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/overview/synthetics_callout.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/overview/synthetics_callout.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/overview/synthetics_callout.tsx diff --git a/x-pack/plugins/synthetics/public/components/settings/__snapshots__/certificate_form.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/__snapshots__/certificate_form.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/settings/__snapshots__/certificate_form.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/settings/__snapshots__/certificate_form.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/settings/__snapshots__/indices_form.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/__snapshots__/indices_form.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/components/settings/__snapshots__/indices_form.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/components/settings/__snapshots__/indices_form.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/components/settings/add_connector_flyout.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/add_connector_flyout.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/settings/add_connector_flyout.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/settings/add_connector_flyout.tsx diff --git a/x-pack/plugins/synthetics/public/components/settings/alert_defaults_form.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/alert_defaults_form.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/settings/alert_defaults_form.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/settings/alert_defaults_form.tsx diff --git a/x-pack/plugins/synthetics/public/components/settings/certificate_form.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/certificate_form.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/settings/certificate_form.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/settings/certificate_form.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/settings/certificate_form.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/certificate_form.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/settings/certificate_form.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/settings/certificate_form.tsx index 2deecc8809074..dc44a7074c33f 100644 --- a/x-pack/plugins/synthetics/public/components/settings/certificate_form.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/certificate_form.tsx @@ -18,8 +18,8 @@ import { EuiFlexGroup, EuiFlexItem, } from '@elastic/eui'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../common/constants'; -import { DefaultEmail, DynamicSettings } from '../../../common/runtime_types'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; +import { DefaultEmail, DynamicSettings } from '../../../../common/runtime_types'; import { SettingsFormProps } from '../../pages/settings'; import { certificateFormTranslations } from './translations'; diff --git a/x-pack/plugins/synthetics/public/components/settings/default_email.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/default_email.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/settings/default_email.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/settings/default_email.tsx index 5a777fa644f82..5ba6278664c61 100644 --- a/x-pack/plugins/synthetics/public/components/settings/default_email.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/default_email.tsx @@ -12,8 +12,8 @@ import { EuiDescribedFormGroup } from '@elastic/eui'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { OnFieldChangeType } from './certificate_form'; import { connectorsSelector } from '../../state/alerts/alerts'; -import { DefaultEmail as DefaultEmailType } from '../../../common/runtime_types'; -import { UptimePluginServices } from '../../apps/plugin'; +import { DefaultEmail as DefaultEmailType } from '../../../../common/runtime_types'; +import { UptimePluginServices } from '../../../plugin'; import { SettingsPageFieldErrors } from '../../pages/settings'; export function DefaultEmail({ diff --git a/x-pack/plugins/synthetics/public/components/settings/indices_form.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/indices_form.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/settings/indices_form.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/settings/indices_form.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/settings/indices_form.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/indices_form.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/settings/indices_form.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/settings/indices_form.tsx index f11626f231eae..4fe2917fbd357 100644 --- a/x-pack/plugins/synthetics/public/components/settings/indices_form.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/indices_form.tsx @@ -15,7 +15,7 @@ import { EuiTitle, EuiSpacer, } from '@elastic/eui'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../common/constants'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; import { SettingsFormProps } from '../../pages/settings'; export const IndicesForm: React.FC = ({ diff --git a/x-pack/plugins/synthetics/public/components/settings/settings_actions.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/settings_actions.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/settings/settings_actions.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/settings/settings_actions.tsx diff --git a/x-pack/plugins/synthetics/public/components/settings/settings_bottom_bar.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/settings_bottom_bar.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/settings/settings_bottom_bar.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/settings/settings_bottom_bar.tsx diff --git a/x-pack/plugins/synthetics/public/components/settings/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/settings/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/settings/translations.ts diff --git a/x-pack/plugins/synthetics/public/components/settings/types.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/types.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/settings/types.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/settings/types.ts diff --git a/x-pack/plugins/synthetics/public/components/settings/use_settings_errors.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/use_settings_errors.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/settings/use_settings_errors.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/settings/use_settings_errors.ts diff --git a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/stderr_logs.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/stderr_logs.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/synthetics/check_steps/stderr_logs.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/stderr_logs.tsx index 6192ee3866913..d127b67efc8e6 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/stderr_logs.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/stderr_logs.tsx @@ -26,9 +26,9 @@ import { useSelector } from 'react-redux'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { useFetcher } from '@kbn/observability-plugin/public'; import { useStdErrorLogs } from './use_std_error_logs'; -import { ClientPluginsStart } from '../../../apps/plugin'; +import { ClientPluginsStart } from '../../../../plugin'; import { selectDynamicSettings } from '../../../state/selectors'; -import { Ping } from '../../../../common/runtime_types'; +import { Ping } from '../../../../../common/runtime_types'; export const StdErrorLogs = ({ configId, diff --git a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_duration.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_duration.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_duration.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_duration.tsx index 92a4ab24433f8..f0e05c2072782 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_duration.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_duration.tsx @@ -11,7 +11,7 @@ import * as React from 'react'; import { EuiButtonEmpty, EuiPopover, EuiText } from '@elastic/eui'; import { useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { JourneyStep } from '../../../../common/runtime_types'; +import { JourneyStep } from '../../../../../common/runtime_types'; import { StepFieldTrend } from './step_field_trend'; import { microToSec } from '../../../lib/formatting'; diff --git a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_expanded_row/screenshot_link.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/screenshot_link.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_expanded_row/screenshot_link.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/screenshot_link.tsx index d4d2536e47851..2ef6c7718f7bc 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_expanded_row/screenshot_link.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/screenshot_link.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { ReactRouterEuiLink } from '../../../common/react_router_helpers'; -import { Ping } from '../../../../../common/runtime_types/ping/ping'; +import { Ping } from '../../../../../../common/runtime_types/ping/ping'; const LabelLink = euiStyled.div` margin-bottom: ${(props) => props.theme.eui.paddingSizes.xs}; diff --git a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx index 0277a47804fc6..d0db4a99a495e 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx @@ -12,8 +12,8 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { useFetcher } from '@kbn/observability-plugin/public'; import { StepScreenshotDisplay } from '../../step_screenshot_display'; -import { JourneyStep } from '../../../../../common/runtime_types/ping/synthetics'; -import { Ping } from '../../../../../common/runtime_types/ping/ping'; +import { JourneyStep } from '../../../../../../common/runtime_types/ping/synthetics'; +import { Ping } from '../../../../../../common/runtime_types/ping/ping'; import { fetchLastSuccessfulCheck } from '../../../../state/api/journey'; import { ScreenshotLink } from './screenshot_link'; import { getShortTimeStamp } from '../../../overview/monitor_list/columns/monitor_status_column'; diff --git a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_field_trend.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_field_trend.test.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_field_trend.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_field_trend.test.tsx index 165208c032705..741d00fcc072d 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_field_trend.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_field_trend.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { getLast48Intervals, StepFieldTrend } from './step_field_trend'; import { render } from '../../../lib/helper/rtl_helpers'; -import { JourneyStep } from '../../../../common/runtime_types'; +import { JourneyStep } from '../../../../../common/runtime_types'; const step: JourneyStep = { _id: 'docID', diff --git a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_field_trend.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_field_trend.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_field_trend.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_field_trend.tsx index cd1b9df222e58..e03656ed562dc 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_field_trend.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_field_trend.tsx @@ -13,7 +13,7 @@ import { useSelector } from 'react-redux'; import { AllSeries, createExploratoryViewUrl } from '@kbn/observability-plugin/public'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { JourneyStep } from '../../../../common/runtime_types'; +import { JourneyStep } from '../../../../../common/runtime_types'; import { useUptimeStartPlugins } from '../../../contexts/uptime_startup_plugins_context'; import { selectDynamicSettings } from '../../../state/selectors'; diff --git a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_image.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_image.tsx similarity index 92% rename from x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_image.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_image.tsx index 06410e79a22a2..f1280cfe368b1 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/step_image.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/step_image.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; -import { JourneyStep } from '../../../../common/runtime_types/ping/synthetics'; +import { JourneyStep } from '../../../../../common/runtime_types/ping/synthetics'; import { PingTimestamp } from '../../monitor/ping_list/columns/ping_timestamp'; interface Props { diff --git a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/steps_list.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/steps_list.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/synthetics/check_steps/steps_list.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/steps_list.test.tsx index 61535833822da..1a792dfa9f8d3 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/steps_list.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/steps_list.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { JourneyStep } from '../../../../common/runtime_types/ping'; +import { JourneyStep } from '../../../../../common/runtime_types/ping'; import { StepsList } from './steps_list'; import { render, forDesktopOnly, forMobileOnly } from '../../../lib/helper/rtl_helpers'; import { VIEW_PERFORMANCE } from '../../monitor/synthetics/translations'; diff --git a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/steps_list.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/steps_list.tsx similarity index 99% rename from x-pack/plugins/synthetics/public/components/synthetics/check_steps/steps_list.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/steps_list.tsx index 957c25225a614..d02b7ac0e51da 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/steps_list.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/steps_list.tsx @@ -17,7 +17,7 @@ import { import { i18n } from '@kbn/i18n'; import React, { MouseEvent, useState } from 'react'; import styled from 'styled-components'; -import { JourneyStep } from '../../../../common/runtime_types'; +import { JourneyStep } from '../../../../../common/runtime_types'; import { STATUS_LABEL } from '../../monitor/ping_list/translations'; import { COLLAPSE_LABEL, EXPAND_LABEL, STEP_NAME_LABEL } from '../translations'; import { StatusBadge } from '../status_badge'; diff --git a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/use_check_steps.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/use_check_steps.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/synthetics/check_steps/use_check_steps.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/use_check_steps.ts diff --git a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/use_expanded_row.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/use_expanded_row.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/synthetics/check_steps/use_expanded_row.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/use_expanded_row.test.tsx index c16522804eed6..6d1dc3f80fe60 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/use_expanded_row.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/use_expanded_row.test.tsx @@ -13,8 +13,8 @@ import { createMemoryHistory } from 'history'; import { EuiButtonIcon } from '@elastic/eui'; import { getExpandedStepCallback, useExpandedRow } from './use_expanded_row'; import { render } from '../../../lib/helper/rtl_helpers'; -import { JourneyStep } from '../../../../common/runtime_types'; -import { SYNTHETIC_CHECK_STEPS_ROUTE } from '../../../../common/constants'; +import { JourneyStep } from '../../../../../common/runtime_types'; +import { SYNTHETIC_CHECK_STEPS_ROUTE } from '../../../../../common/constants'; import { COLLAPSE_LABEL, EXPAND_LABEL } from '../translations'; import { act } from 'react-dom/test-utils'; diff --git a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/use_expanded_row.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/use_expanded_row.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/synthetics/check_steps/use_expanded_row.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/use_expanded_row.tsx index 1b3a641033dd7..51fe965c55fbc 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/use_expanded_row.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/use_expanded_row.tsx @@ -8,7 +8,7 @@ import React, { useEffect, useState, useCallback } from 'react'; import { useParams } from 'react-router-dom'; import { ExecutedStep } from '../executed_step'; -import { JourneyStep } from '../../../../common/runtime_types/ping'; +import { JourneyStep } from '../../../../../common/runtime_types/ping'; interface HookProps { loading: boolean; diff --git a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/use_std_error_logs.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/use_std_error_logs.ts similarity index 96% rename from x-pack/plugins/synthetics/public/components/synthetics/check_steps/use_std_error_logs.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/use_std_error_logs.ts index 11dfdcdcc434e..d6abd2445a9a7 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/check_steps/use_std_error_logs.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/check_steps/use_std_error_logs.ts @@ -8,7 +8,7 @@ import { useSelector } from 'react-redux'; import { createEsParams, useEsSearch } from '@kbn/observability-plugin/public'; import { selectDynamicSettings } from '../../../state/selectors'; -import { Ping } from '../../../../common/runtime_types'; +import { Ping } from '../../../../../common/runtime_types'; export const useStdErrorLogs = ({ configId, diff --git a/x-pack/plugins/synthetics/public/components/synthetics/code_block_accordion.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/code_block_accordion.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/synthetics/code_block_accordion.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/code_block_accordion.tsx diff --git a/x-pack/plugins/synthetics/public/components/synthetics/console_event.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/console_event.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/synthetics/console_event.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/console_event.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/synthetics/console_event.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/console_event.tsx similarity index 93% rename from x-pack/plugins/synthetics/public/components/synthetics/console_event.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/console_event.tsx index a9cde922e8926..aeceef2477e28 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/console_event.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/console_event.tsx @@ -8,7 +8,7 @@ import { EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; import React, { useContext, FC } from 'react'; import { UptimeThemeContext } from '../../contexts'; -import { JourneyStep } from '../../../common/runtime_types/ping'; +import { JourneyStep } from '../../../../common/runtime_types/ping'; interface Props { event: JourneyStep; diff --git a/x-pack/plugins/synthetics/public/components/synthetics/console_output_event_list.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/console_output_event_list.test.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/components/synthetics/console_output_event_list.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/console_output_event_list.test.tsx index d35e526208ae9..9e63ff070c752 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/console_output_event_list.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/console_output_event_list.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { JourneyStep } from '../../../common/runtime_types/ping/synthetics'; +import { JourneyStep } from '../../../../common/runtime_types/ping/synthetics'; import { render } from '../../lib/helper/rtl_helpers'; import { ConsoleOutputEventList } from './console_output_event_list'; diff --git a/x-pack/plugins/synthetics/public/components/synthetics/console_output_event_list.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/console_output_event_list.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/components/synthetics/console_output_event_list.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/console_output_event_list.tsx index 4bf33663d920a..1019532e0a610 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/console_output_event_list.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/console_output_event_list.tsx @@ -9,7 +9,7 @@ import { EuiCodeBlock, EuiSpacer, EuiTitle } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { ConsoleEvent } from './console_event'; -import { JourneyStep } from '../../../common/runtime_types/ping'; +import { JourneyStep } from '../../../../common/runtime_types/ping'; import { JourneyState } from '../../state/reducers/journey'; interface Props { diff --git a/x-pack/plugins/synthetics/public/components/synthetics/empty_journey.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/empty_journey.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/synthetics/empty_journey.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/empty_journey.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/synthetics/empty_journey.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/empty_journey.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/synthetics/empty_journey.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/empty_journey.tsx diff --git a/x-pack/plugins/synthetics/public/components/synthetics/executed_step.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/executed_step.test.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/synthetics/executed_step.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/executed_step.test.tsx index 81d506bd05413..8231fc5808506 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/executed_step.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/executed_step.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { ExecutedStep } from './executed_step'; import { render } from '../../lib/helper/rtl_helpers'; -import { JourneyStep } from '../../../common/runtime_types/ping'; +import { JourneyStep } from '../../../../common/runtime_types/ping'; describe('ExecutedStep', () => { let step: JourneyStep; diff --git a/x-pack/plugins/synthetics/public/components/synthetics/executed_step.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/executed_step.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/components/synthetics/executed_step.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/executed_step.tsx index f3021894ec5ff..063dd9db0eae3 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/executed_step.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/executed_step.tsx @@ -10,7 +10,7 @@ import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { CodeBlockAccordion } from './code_block_accordion'; -import { JourneyStep } from '../../../common/runtime_types/ping'; +import { JourneyStep } from '../../../../common/runtime_types/ping'; import { StepScreenshots } from './check_steps/step_expanded_row/step_screenshots'; const CODE_BLOCK_OVERFLOW_HEIGHT = 360; diff --git a/x-pack/plugins/synthetics/public/components/synthetics/status_badge.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/status_badge.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/synthetics/status_badge.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/status_badge.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/synthetics/status_badge.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/status_badge.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/components/synthetics/status_badge.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/status_badge.tsx index be9eb6178deae..4eba0f4b6a288 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/status_badge.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/status_badge.tsx @@ -8,7 +8,7 @@ import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useContext, FC } from 'react'; -import { UptimeAppColors } from '../../apps/uptime_app'; +import { UptimeAppColors } from '../../app/uptime_app'; import { UptimeThemeContext } from '../../contexts'; interface StatusBadgeProps { diff --git a/x-pack/plugins/synthetics/public/components/synthetics/step_screenshot_display.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/step_screenshot_display.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/components/synthetics/step_screenshot_display.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/step_screenshot_display.test.tsx diff --git a/x-pack/plugins/synthetics/public/components/synthetics/step_screenshot_display.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/step_screenshot_display.tsx similarity index 99% rename from x-pack/plugins/synthetics/public/components/synthetics/step_screenshot_display.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/step_screenshot_display.tsx index bc3cda6cd93bc..b5a82eac7bad1 100644 --- a/x-pack/plugins/synthetics/public/components/synthetics/step_screenshot_display.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/step_screenshot_display.tsx @@ -22,7 +22,7 @@ import { useFetcher } from '@kbn/observability-plugin/public'; import { isScreenshotRef as isAScreenshotRef, ScreenshotRefImageData, -} from '../../../common/runtime_types'; +} from '../../../../common/runtime_types'; import { UptimeRefreshContext, UptimeSettingsContext, UptimeThemeContext } from '../../contexts'; import { getJourneyScreenshot } from '../../state/api/journey'; import { useCompositeImage } from '../../hooks'; diff --git a/x-pack/plugins/synthetics/public/components/synthetics/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/components/synthetics/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/components/synthetics/translations.ts diff --git a/x-pack/plugins/synthetics/public/contexts/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/contexts/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/contexts/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/contexts/index.ts diff --git a/x-pack/plugins/synthetics/public/contexts/uptime_data_view_context.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/contexts/uptime_data_view_context.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/contexts/uptime_data_view_context.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/contexts/uptime_data_view_context.tsx diff --git a/x-pack/plugins/synthetics/public/contexts/uptime_refresh_context.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/contexts/uptime_refresh_context.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/contexts/uptime_refresh_context.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/contexts/uptime_refresh_context.tsx diff --git a/x-pack/plugins/synthetics/public/contexts/uptime_settings_context.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/contexts/uptime_settings_context.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/contexts/uptime_settings_context.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/contexts/uptime_settings_context.tsx index 4fda00db57bd7..d192f7327879c 100644 --- a/x-pack/plugins/synthetics/public/contexts/uptime_settings_context.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/contexts/uptime_settings_context.tsx @@ -6,8 +6,8 @@ */ import React, { createContext, useContext, useMemo } from 'react'; -import { UptimeAppProps } from '../apps/uptime_app'; -import { CLIENT_DEFAULTS, CONTEXT_DEFAULTS } from '../../common/constants'; +import { UptimeAppProps } from '../app/uptime_app'; +import { CLIENT_DEFAULTS, CONTEXT_DEFAULTS } from '../../../common/constants'; import { CommonlyUsedRange } from '../components/common/uptime_date_picker'; import { useGetUrlParams } from '../hooks'; diff --git a/x-pack/plugins/synthetics/public/contexts/uptime_startup_plugins_context.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/contexts/uptime_startup_plugins_context.tsx similarity index 92% rename from x-pack/plugins/synthetics/public/contexts/uptime_startup_plugins_context.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/contexts/uptime_startup_plugins_context.tsx index 8fbc8ae749c81..76754a52a3dfb 100644 --- a/x-pack/plugins/synthetics/public/contexts/uptime_startup_plugins_context.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/contexts/uptime_startup_plugins_context.tsx @@ -6,7 +6,7 @@ */ import React, { createContext, useContext } from 'react'; -import { ClientPluginsStart } from '../apps/plugin'; +import { ClientPluginsStart } from '../../plugin'; export const UptimeStartupPluginsContext = createContext>({}); diff --git a/x-pack/plugins/synthetics/public/contexts/uptime_theme_context.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/contexts/uptime_theme_context.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/contexts/uptime_theme_context.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/contexts/uptime_theme_context.tsx index 2d25cf6e84e1b..b37856b03e87e 100644 --- a/x-pack/plugins/synthetics/public/contexts/uptime_theme_context.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/contexts/uptime_theme_context.tsx @@ -9,7 +9,7 @@ import { euiLightVars, euiDarkVars } from '@kbn/ui-theme'; import React, { createContext, useMemo } from 'react'; import { EUI_CHARTS_THEME_DARK, EUI_CHARTS_THEME_LIGHT } from '@elastic/eui/dist/eui_charts_theme'; import { DARK_THEME, LIGHT_THEME, PartialTheme, Theme } from '@elastic/charts'; -import { UptimeAppColors } from '../apps/uptime_app'; +import { UptimeAppColors } from '../app/uptime_app'; export interface UptimeThemeContextValues { colors: UptimeAppColors; diff --git a/x-pack/plugins/synthetics/public/hooks/__snapshots__/use_url_params.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/__snapshots__/use_url_params.test.tsx.snap similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/__snapshots__/use_url_params.test.tsx.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/__snapshots__/use_url_params.test.tsx.snap diff --git a/x-pack/plugins/synthetics/public/hooks/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/index.ts diff --git a/x-pack/plugins/synthetics/public/hooks/update_kuery_string.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/update_kuery_string.ts similarity index 99% rename from x-pack/plugins/synthetics/public/hooks/update_kuery_string.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/update_kuery_string.ts index a8884279f49ba..007dfd12427f3 100644 --- a/x-pack/plugins/synthetics/public/hooks/update_kuery_string.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/update_kuery_string.ts @@ -7,7 +7,7 @@ import { fromKueryExpression, toElasticsearchQuery } from '@kbn/es-query'; import { DataView } from '@kbn/data-views-plugin/public'; -import { combineFiltersAndUserSearch, stringifyKueries } from '../../common/lib'; +import { combineFiltersAndUserSearch, stringifyKueries } from '../../../common/lib'; const getKueryString = (urlFilters: string, excludedFilters?: string): string => { let kueryString = ''; diff --git a/x-pack/plugins/synthetics/public/hooks/use_breadcrumbs.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_breadcrumbs.test.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/hooks/use_breadcrumbs.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_breadcrumbs.test.tsx index e5b1a28ba72c6..35b5a1aa0994c 100644 --- a/x-pack/plugins/synthetics/public/hooks/use_breadcrumbs.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_breadcrumbs.test.tsx @@ -9,7 +9,7 @@ import { ChromeBreadcrumb } from '@kbn/core/public'; import React from 'react'; import { Route } from 'react-router-dom'; import { mountWithRouter } from '../lib'; -import { OVERVIEW_ROUTE } from '../../common/constants'; +import { OVERVIEW_ROUTE } from '../../../common/constants'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { UptimeUrlParams, getSupportedUrlParams, MountWithReduxProvider } from '../lib/helper'; import { makeBaseBreadcrumb, useBreadcrumbs } from './use_breadcrumbs'; diff --git a/x-pack/plugins/synthetics/public/hooks/use_breadcrumbs.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_breadcrumbs.ts similarity index 97% rename from x-pack/plugins/synthetics/public/hooks/use_breadcrumbs.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_breadcrumbs.ts index cac62a79d92bf..26e9d2d0fd285 100644 --- a/x-pack/plugins/synthetics/public/hooks/use_breadcrumbs.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_breadcrumbs.ts @@ -13,7 +13,7 @@ import { useKibana } from '@kbn/kibana-react-plugin/public'; import { UptimeUrlParams } from '../lib/helper'; import { stringifyUrlParams } from '../lib/helper/stringify_url_params'; import { useUrlParams } from '.'; -import { PLUGIN } from '../../common/constants/plugin'; +import { PLUGIN } from '../../../common/constants/plugin'; const EMPTY_QUERY = '?'; diff --git a/x-pack/plugins/synthetics/public/hooks/use_breakpoints.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_breakpoints.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/use_breakpoints.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_breakpoints.test.ts diff --git a/x-pack/plugins/synthetics/public/hooks/use_breakpoints.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_breakpoints.ts similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/use_breakpoints.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_breakpoints.ts diff --git a/x-pack/plugins/synthetics/public/hooks/use_cert_status.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_cert_status.ts similarity index 95% rename from x-pack/plugins/synthetics/public/hooks/use_cert_status.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_cert_status.ts index d82948632543b..934d72b71de6e 100644 --- a/x-pack/plugins/synthetics/public/hooks/use_cert_status.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_cert_status.ts @@ -8,7 +8,7 @@ import moment from 'moment'; import { useSelector } from 'react-redux'; import { selectDynamicSettings } from '../state/selectors'; -import { CERT_STATUS } from '../../common/constants'; +import { CERT_STATUS } from '../../../common/constants'; export const useCertStatus = (expiryDate?: string, issueDate?: string) => { const dss = useSelector(selectDynamicSettings); diff --git a/x-pack/plugins/synthetics/public/hooks/use_chart_theme.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_chart_theme.ts similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/use_chart_theme.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_chart_theme.ts diff --git a/x-pack/plugins/synthetics/public/hooks/use_composite_image.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_composite_image.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/hooks/use_composite_image.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_composite_image.test.tsx index 9e2cb1e498b73..50fc366f50dbe 100644 --- a/x-pack/plugins/synthetics/public/hooks/use_composite_image.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_composite_image.test.tsx @@ -7,7 +7,7 @@ import * as redux from 'react-redux'; import { renderHook } from '@testing-library/react-hooks'; -import { ScreenshotRefImageData } from '../../common/runtime_types'; +import { ScreenshotRefImageData } from '../../../common/runtime_types'; import { ScreenshotBlockCache } from '../state/reducers/synthetics'; import { shouldCompose, useCompositeImage } from './use_composite_image'; import * as compose from '../lib/helper/compose_screenshot_images'; diff --git a/x-pack/plugins/synthetics/public/hooks/use_composite_image.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_composite_image.ts similarity index 97% rename from x-pack/plugins/synthetics/public/hooks/use_composite_image.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_composite_image.ts index 3af1e798d43e1..ca783bdd290c4 100644 --- a/x-pack/plugins/synthetics/public/hooks/use_composite_image.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_composite_image.ts @@ -8,7 +8,7 @@ import { useDispatch, useSelector } from 'react-redux'; import React from 'react'; import { composeScreenshotRef } from '../lib/helper/compose_screenshot_images'; -import { ScreenshotRefImageData } from '../../common/runtime_types/ping/synthetics'; +import { ScreenshotRefImageData } from '../../../common/runtime_types/ping/synthetics'; import { fetchBlocksAction, isPendingBlock, diff --git a/x-pack/plugins/synthetics/public/hooks/use_filter_update.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_filter_update.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/use_filter_update.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_filter_update.test.ts diff --git a/x-pack/plugins/synthetics/public/hooks/use_filter_update.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_filter_update.ts similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/use_filter_update.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_filter_update.ts diff --git a/x-pack/plugins/synthetics/public/hooks/use_init_app.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_init_app.ts similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/use_init_app.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_init_app.ts diff --git a/x-pack/plugins/synthetics/public/hooks/use_mapping_check.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_mapping_check.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/use_mapping_check.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_mapping_check.test.ts diff --git a/x-pack/plugins/synthetics/public/hooks/use_mapping_check.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_mapping_check.ts similarity index 94% rename from x-pack/plugins/synthetics/public/hooks/use_mapping_check.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_mapping_check.ts index d8a7e0fac4065..dfda2900c7904 100644 --- a/x-pack/plugins/synthetics/public/hooks/use_mapping_check.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_mapping_check.ts @@ -7,7 +7,7 @@ import { useEffect } from 'react'; import { useHistory } from 'react-router-dom'; -import { MAPPING_ERROR_ROUTE } from '../../common/constants'; +import { MAPPING_ERROR_ROUTE } from '../../../common/constants'; interface EsBadRequestError { body?: { diff --git a/x-pack/plugins/synthetics/public/hooks/use_monitor.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_monitor.ts similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/use_monitor.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_monitor.ts diff --git a/x-pack/plugins/synthetics/public/hooks/use_overview_filter_check.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_overview_filter_check.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/use_overview_filter_check.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_overview_filter_check.test.tsx diff --git a/x-pack/plugins/synthetics/public/hooks/use_overview_filter_check.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_overview_filter_check.ts similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/use_overview_filter_check.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_overview_filter_check.ts diff --git a/x-pack/plugins/synthetics/public/hooks/use_search_text.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_search_text.ts similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/use_search_text.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_search_text.ts diff --git a/x-pack/plugins/synthetics/public/hooks/use_selected_filters.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_selected_filters.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/use_selected_filters.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_selected_filters.test.tsx diff --git a/x-pack/plugins/synthetics/public/hooks/use_selected_filters.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_selected_filters.ts similarity index 97% rename from x-pack/plugins/synthetics/public/hooks/use_selected_filters.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_selected_filters.ts index b10760aa85ed3..03904a2d67421 100644 --- a/x-pack/plugins/synthetics/public/hooks/use_selected_filters.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_selected_filters.ts @@ -9,7 +9,7 @@ import { useMemo } from 'react'; import { useRouteMatch } from 'react-router-dom'; import { useGetUrlParams } from './use_url_params'; import { filterLabels } from '../components/overview/filter_group/translations'; -import { FILTER_FIELDS, MONITOR_ROUTE } from '../../common/constants'; +import { FILTER_FIELDS, MONITOR_ROUTE } from '../../../common/constants'; import { parseFiltersMap } from './use_filter_update'; type FilterType = string[]; diff --git a/x-pack/plugins/synthetics/public/hooks/use_telemetry.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_telemetry.ts similarity index 96% rename from x-pack/plugins/synthetics/public/hooks/use_telemetry.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_telemetry.ts index d6e1a3ae28516..78062bb1ff7eb 100644 --- a/x-pack/plugins/synthetics/public/hooks/use_telemetry.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_telemetry.ts @@ -8,7 +8,7 @@ import { useEffect } from 'react'; import { useGetUrlParams } from './use_url_params'; import { apiService } from '../state/api/utils'; -import { API_URLS } from '../../common/constants'; +import { API_URLS } from '../../../common/constants'; export enum UptimePage { Overview = 'Overview', diff --git a/x-pack/plugins/synthetics/public/hooks/use_url_params.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_url_params.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/use_url_params.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_url_params.test.tsx diff --git a/x-pack/plugins/synthetics/public/hooks/use_url_params.ts b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_url_params.ts similarity index 100% rename from x-pack/plugins/synthetics/public/hooks/use_url_params.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/hooks/use_url_params.ts diff --git a/x-pack/plugins/synthetics/public/lib/__mocks__/screenshot_ref.mock.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/__mocks__/screenshot_ref.mock.ts similarity index 93% rename from x-pack/plugins/synthetics/public/lib/__mocks__/screenshot_ref.mock.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/__mocks__/screenshot_ref.mock.ts index a95aa77371b23..c812a9c67b38d 100644 --- a/x-pack/plugins/synthetics/public/lib/__mocks__/screenshot_ref.mock.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/__mocks__/screenshot_ref.mock.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ScreenshotRefImageData } from '../../../common/runtime_types'; +import { ScreenshotRefImageData } from '../../../../common/runtime_types'; export const mockRef: ScreenshotRefImageData = { maxSteps: 1, diff --git a/x-pack/plugins/synthetics/public/lib/__mocks__/uptime_plugin_start_mock.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/__mocks__/uptime_plugin_start_mock.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/__mocks__/uptime_plugin_start_mock.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/__mocks__/uptime_plugin_start_mock.ts diff --git a/x-pack/plugins/synthetics/public/lib/__mocks__/uptime_store.mock.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/__mocks__/uptime_store.mock.ts similarity index 94% rename from x-pack/plugins/synthetics/public/lib/__mocks__/uptime_store.mock.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/__mocks__/uptime_store.mock.ts index 01a11fd809fe8..18a8885b1dcdb 100644 --- a/x-pack/plugins/synthetics/public/lib/__mocks__/uptime_store.mock.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/__mocks__/uptime_store.mock.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../common/constants'; -import { DEFAULT_THROTTLING } from '../../../common/runtime_types'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; +import { DEFAULT_THROTTLING } from '../../../../common/runtime_types'; import { AppState } from '../../state'; /** diff --git a/x-pack/plugins/synthetics/public/lib/__mocks__/use_composite_image.mock.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/__mocks__/use_composite_image.mock.ts similarity index 86% rename from x-pack/plugins/synthetics/public/lib/__mocks__/use_composite_image.mock.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/__mocks__/use_composite_image.mock.ts index c4ab83ae6ee5d..64bc0776b8207 100644 --- a/x-pack/plugins/synthetics/public/lib/__mocks__/use_composite_image.mock.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/__mocks__/use_composite_image.mock.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ScreenshotRefImageData } from '../../../common/runtime_types/ping/synthetics'; +import { ScreenshotRefImageData } from '../../../../common/runtime_types/ping/synthetics'; import * as composeScreenshotImages from '../../hooks/use_composite_image'; jest diff --git a/x-pack/plugins/synthetics/public/lib/__mocks__/ut_router_history.mock.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/__mocks__/ut_router_history.mock.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/__mocks__/ut_router_history.mock.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/__mocks__/ut_router_history.mock.ts diff --git a/x-pack/plugins/synthetics/public/lib/adapters/framework/capabilities_adapter.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/adapters/framework/capabilities_adapter.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/adapters/framework/capabilities_adapter.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/adapters/framework/capabilities_adapter.ts diff --git a/x-pack/plugins/synthetics/public/lib/alert_types/alert_messages.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/alert_messages.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/lib/alert_types/alert_messages.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/alert_messages.tsx diff --git a/x-pack/plugins/synthetics/public/lib/alert_types/common.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/common.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/alert_types/common.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/common.ts diff --git a/x-pack/plugins/synthetics/public/lib/alert_types/duration_anomaly.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/duration_anomaly.tsx similarity index 86% rename from x-pack/plugins/synthetics/public/lib/alert_types/duration_anomaly.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/duration_anomaly.tsx index 79b2b28652497..c866ca4c76956 100644 --- a/x-pack/plugins/synthetics/public/lib/alert_types/duration_anomaly.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/duration_anomaly.tsx @@ -12,9 +12,9 @@ import { ALERT_END, ALERT_STATUS, ALERT_STATUS_ACTIVE, ALERT_REASON } from '@kbn import { ObservabilityRuleTypeModel } from '@kbn/observability-plugin/public'; import { AlertTypeInitializer } from '.'; -import { getMonitorRouteFromMonitorId } from '../../../common/utils/get_monitor_url'; -import { CLIENT_ALERT_TYPES } from '../../../common/constants/alerts'; -import { DurationAnomalyTranslations } from '../../../common/translations'; +import { getMonitorRouteFromMonitorId } from '../../../../common/utils/get_monitor_url'; +import { CLIENT_ALERT_TYPES } from '../../../../common/constants/alerts'; +import { DurationAnomalyTranslations } from '../../../../common/translations'; const { defaultActionMessage, description } = DurationAnomalyTranslations; const DurationAnomalyAlert = React.lazy(() => import('./lazy_wrapper/duration_anomaly')); diff --git a/x-pack/plugins/synthetics/public/lib/alert_types/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/index.ts similarity index 95% rename from x-pack/plugins/synthetics/public/lib/alert_types/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/index.ts index 7217e0a083e6b..a4eef4c4b19b2 100644 --- a/x-pack/plugins/synthetics/public/lib/alert_types/index.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/index.ts @@ -11,7 +11,7 @@ import { RuleTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; import { initMonitorStatusAlertType } from './monitor_status'; import { initTlsAlertType } from './tls'; import { initTlsLegacyAlertType } from './tls_legacy'; -import { ClientPluginsStart } from '../../apps/plugin'; +import { ClientPluginsStart } from '../../../plugin'; import { initDurationAnomalyAlertType } from './duration_anomaly'; export type AlertTypeInitializer = (dependenies: { diff --git a/x-pack/plugins/synthetics/public/lib/alert_types/lazy_wrapper/duration_anomaly.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/lazy_wrapper/duration_anomaly.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/lib/alert_types/lazy_wrapper/duration_anomaly.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/lazy_wrapper/duration_anomaly.tsx index bb1f84a45114d..44c10f615543e 100644 --- a/x-pack/plugins/synthetics/public/lib/alert_types/lazy_wrapper/duration_anomaly.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/lazy_wrapper/duration_anomaly.tsx @@ -11,7 +11,7 @@ import { CoreStart } from '@kbn/core/public'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { store } from '../../../state'; import { AnomalyAlertComponent } from '../../../components/overview/alerts/anomaly_alert/anomaly_alert'; -import { ClientPluginsStart } from '../../../apps/plugin'; +import { ClientPluginsStart } from '../../../../plugin'; import { kibanaService } from '../../../state/kibana_service'; interface Props { diff --git a/x-pack/plugins/synthetics/public/lib/alert_types/lazy_wrapper/monitor_status.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/lazy_wrapper/monitor_status.tsx similarity index 95% rename from x-pack/plugins/synthetics/public/lib/alert_types/lazy_wrapper/monitor_status.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/lazy_wrapper/monitor_status.tsx index 10aa71fa533e3..dd41ab29ed080 100644 --- a/x-pack/plugins/synthetics/public/lib/alert_types/lazy_wrapper/monitor_status.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/lazy_wrapper/monitor_status.tsx @@ -10,7 +10,7 @@ import { Provider as ReduxProvider } from 'react-redux'; import { CoreStart } from '@kbn/core/public'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { store } from '../../../state'; -import { ClientPluginsStart } from '../../../apps/plugin'; +import { ClientPluginsStart } from '../../../../plugin'; import { kibanaService } from '../../../state/kibana_service'; import { AlertMonitorStatus } from '../../../components/overview/alerts/alerts_containers/alert_monitor_status'; import { UptimeDataViewContextProvider } from '../../../contexts/uptime_data_view_context'; diff --git a/x-pack/plugins/synthetics/public/lib/alert_types/lazy_wrapper/tls_alert.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/lazy_wrapper/tls_alert.tsx similarity index 94% rename from x-pack/plugins/synthetics/public/lib/alert_types/lazy_wrapper/tls_alert.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/lazy_wrapper/tls_alert.tsx index f4136a079c8b0..2d1b8c9898475 100644 --- a/x-pack/plugins/synthetics/public/lib/alert_types/lazy_wrapper/tls_alert.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/lazy_wrapper/tls_alert.tsx @@ -10,7 +10,7 @@ import { Provider as ReduxProvider } from 'react-redux'; import { CoreStart } from '@kbn/core/public'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { store } from '../../../state'; -import { ClientPluginsStart } from '../../../apps/plugin'; +import { ClientPluginsStart } from '../../../../plugin'; import { AlertTls } from '../../../components/overview/alerts/alerts_containers/alert_tls'; import { kibanaService } from '../../../state/kibana_service'; diff --git a/x-pack/plugins/synthetics/public/lib/alert_types/lazy_wrapper/validate_monitor_status.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/lazy_wrapper/validate_monitor_status.ts similarity index 97% rename from x-pack/plugins/synthetics/public/lib/alert_types/lazy_wrapper/validate_monitor_status.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/lazy_wrapper/validate_monitor_status.ts index 881afb0d8eb52..68e88fdd8bf86 100644 --- a/x-pack/plugins/synthetics/public/lib/alert_types/lazy_wrapper/validate_monitor_status.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/lazy_wrapper/validate_monitor_status.ts @@ -12,7 +12,7 @@ import { AtomicStatusCheckParamsType, MonitorAvailabilityType, StatusCheckParamsType, -} from '../../../../common/runtime_types/alerts'; +} from '../../../../../common/runtime_types/alerts'; export function validateMonitorStatusParams(ruleParams: any): ValidationResult { const errors: Record = {}; diff --git a/x-pack/plugins/synthetics/public/lib/alert_types/monitor_status.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/monitor_status.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/alert_types/monitor_status.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/monitor_status.test.ts diff --git a/x-pack/plugins/synthetics/public/lib/alert_types/monitor_status.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/monitor_status.tsx similarity index 89% rename from x-pack/plugins/synthetics/public/lib/alert_types/monitor_status.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/monitor_status.tsx index 99d8e22f11cdb..0361e6408e43b 100644 --- a/x-pack/plugins/synthetics/public/lib/alert_types/monitor_status.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/monitor_status.tsx @@ -19,9 +19,9 @@ import { import { ObservabilityRuleTypeModel } from '@kbn/observability-plugin/public'; import { ValidationResult } from '@kbn/triggers-actions-ui-plugin/public'; import { AlertTypeInitializer } from '.'; -import { getMonitorRouteFromMonitorId } from '../../../common/utils/get_monitor_url'; -import { MonitorStatusTranslations } from '../../../common/translations'; -import { CLIENT_ALERT_TYPES } from '../../../common/constants/alerts'; +import { getMonitorRouteFromMonitorId } from '../../../../common/utils/get_monitor_url'; +import { MonitorStatusTranslations } from '../../../../common/translations'; +import { CLIENT_ALERT_TYPES } from '../../../../common/constants/alerts'; const { defaultActionMessage, description } = MonitorStatusTranslations; diff --git a/x-pack/plugins/synthetics/public/lib/alert_types/tls.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/tls.tsx similarity index 85% rename from x-pack/plugins/synthetics/public/lib/alert_types/tls.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/tls.tsx index 1ecfaefaa1797..2c1238028ccf5 100644 --- a/x-pack/plugins/synthetics/public/lib/alert_types/tls.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/tls.tsx @@ -8,11 +8,11 @@ import React from 'react'; import { ALERT_REASON } from '@kbn/rule-data-utils'; import { ObservabilityRuleTypeModel } from '@kbn/observability-plugin/public'; -import { CLIENT_ALERT_TYPES } from '../../../common/constants/alerts'; -import { TlsTranslations } from '../../../common/translations'; +import { CLIENT_ALERT_TYPES } from '../../../../common/constants/alerts'; +import { TlsTranslations } from '../../../../common/translations'; import { AlertTypeInitializer } from '.'; -import { CERTIFICATES_ROUTE } from '../../../common/constants/ui'; +import { CERTIFICATES_ROUTE } from '../../../../common/constants/ui'; const { defaultActionMessage, description } = TlsTranslations; const TLSAlert = React.lazy(() => import('./lazy_wrapper/tls_alert')); diff --git a/x-pack/plugins/synthetics/public/lib/alert_types/tls_legacy.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/tls_legacy.tsx similarity index 88% rename from x-pack/plugins/synthetics/public/lib/alert_types/tls_legacy.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/tls_legacy.tsx index cce2e3d011bfa..221bfaeb3375c 100644 --- a/x-pack/plugins/synthetics/public/lib/alert_types/tls_legacy.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/alert_types/tls_legacy.tsx @@ -7,8 +7,8 @@ import React from 'react'; import { RuleTypeModel } from '@kbn/triggers-actions-ui-plugin/public'; -import { CLIENT_ALERT_TYPES } from '../../../common/constants/alerts'; -import { TlsTranslationsLegacy } from '../../../common/translations'; +import { CLIENT_ALERT_TYPES } from '../../../../common/constants/alerts'; +import { TlsTranslationsLegacy } from '../../../../common/translations'; import { AlertTypeInitializer } from '.'; const { defaultActionMessage, description } = TlsTranslationsLegacy; diff --git a/x-pack/plugins/synthetics/public/lib/formatting.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/formatting.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/formatting.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/formatting.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/charts/get_chart_date_label.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/charts/get_chart_date_label.ts similarity index 95% rename from x-pack/plugins/synthetics/public/lib/helper/charts/get_chart_date_label.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/charts/get_chart_date_label.ts index 4852e6ceade11..f7b8d315577f9 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/charts/get_chart_date_label.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/charts/get_chart_date_label.ts @@ -7,7 +7,7 @@ import { isWithinCurrentDate } from './is_within_current_date'; import { getLabelFormat } from './get_label_format'; -import { CHART_FORMAT_LIMITS } from '../../../../common/constants'; +import { CHART_FORMAT_LIMITS } from '../../../../../common/constants'; /** * Generates an appropriate date formatting string intended for the y-axis diff --git a/x-pack/plugins/synthetics/public/lib/helper/charts/get_label_format.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/charts/get_label_format.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/charts/get_label_format.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/charts/get_label_format.test.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/charts/get_label_format.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/charts/get_label_format.ts similarity index 95% rename from x-pack/plugins/synthetics/public/lib/helper/charts/get_label_format.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/charts/get_label_format.ts index 3444e05b59127..298786cebaeb8 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/charts/get_label_format.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/charts/get_label_format.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { CHART_FORMAT_LIMITS } from '../../../../common/constants'; +import { CHART_FORMAT_LIMITS } from '../../../../../common/constants'; const { EIGHT_MINUTES, FOUR_YEARS, THIRTY_SIX_HOURS, THREE_WEEKS, SIX_MONTHS, NINE_DAYS } = CHART_FORMAT_LIMITS; diff --git a/x-pack/plugins/synthetics/public/lib/helper/charts/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/charts/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/charts/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/charts/index.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/charts/is_within_current_date.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/charts/is_within_current_date.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/charts/is_within_current_date.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/charts/is_within_current_date.test.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/charts/is_within_current_date.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/charts/is_within_current_date.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/charts/is_within_current_date.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/charts/is_within_current_date.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/compose_screenshot_images.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/compose_screenshot_images.test.ts similarity index 96% rename from x-pack/plugins/synthetics/public/lib/helper/compose_screenshot_images.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/compose_screenshot_images.test.ts index 0bf809d4e7a40..c749433bb84e0 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/compose_screenshot_images.test.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/compose_screenshot_images.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ScreenshotRefImageData } from '../../../common/runtime_types/ping/synthetics'; +import { ScreenshotRefImageData } from '../../../../common/runtime_types/ping/synthetics'; import { composeScreenshotRef } from './compose_screenshot_images'; describe('composeScreenshotRef', () => { diff --git a/x-pack/plugins/synthetics/public/lib/helper/compose_screenshot_images.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/compose_screenshot_images.ts similarity index 97% rename from x-pack/plugins/synthetics/public/lib/helper/compose_screenshot_images.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/compose_screenshot_images.ts index 60cd248c1487a..86c7a001b95ab 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/compose_screenshot_images.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/compose_screenshot_images.ts @@ -8,7 +8,7 @@ import { isScreenshotBlockDoc, ScreenshotRefImageData, -} from '../../../common/runtime_types/ping/synthetics'; +} from '../../../../common/runtime_types/ping/synthetics'; import { ScreenshotBlockCache } from '../../state/reducers/synthetics'; /** diff --git a/x-pack/plugins/synthetics/public/lib/helper/convert_measurements.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/convert_measurements.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/convert_measurements.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/convert_measurements.test.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/convert_measurements.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/convert_measurements.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/convert_measurements.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/convert_measurements.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/enzyme_helpers.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/enzyme_helpers.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/enzyme_helpers.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/enzyme_helpers.tsx diff --git a/x-pack/plugins/synthetics/public/lib/helper/get_title.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/get_title.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/get_title.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/get_title.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/helper_with_redux.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/helper_with_redux.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/helper_with_redux.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/helper_with_redux.tsx diff --git a/x-pack/plugins/synthetics/public/lib/helper/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/index.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/add_base_path.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/add_base_path.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/observability_integration/add_base_path.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/add_base_path.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/build_href.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/build_href.ts similarity index 95% rename from x-pack/plugins/synthetics/public/lib/helper/observability_integration/build_href.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/build_href.ts index 491219bae5152..93e08b92fbafc 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/build_href.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/build_href.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Ping } from '../../../../common/runtime_types'; +import { Ping } from '../../../../../common/runtime_types'; /** * Builds URLs to the designated features by extracting values from the provided diff --git a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_apm_href.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_apm_href.test.ts similarity index 96% rename from x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_apm_href.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_apm_href.test.ts index db946fb246964..146fc498b3dcc 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_apm_href.test.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_apm_href.test.ts @@ -6,7 +6,7 @@ */ import { getLegacyApmHref } from './get_apm_href'; -import { MonitorSummary, makePing } from '../../../../common/runtime_types'; +import { MonitorSummary, makePing } from '../../../../../common/runtime_types'; describe('getLegacyApmHref', () => { let summary: MonitorSummary; diff --git a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_apm_href.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_apm_href.ts similarity index 91% rename from x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_apm_href.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_apm_href.ts index fc5785ceecba1..f05f1ccb2de4f 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_apm_href.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_apm_href.ts @@ -6,7 +6,7 @@ */ import { addBasePath } from './add_base_path'; -import { MonitorSummary } from '../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../../common/runtime_types'; export const getLegacyApmHref = ( summary: MonitorSummary, diff --git a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_infra_href.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_infra_href.test.ts similarity index 98% rename from x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_infra_href.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_infra_href.test.ts index 9a7cc6e7940ed..970ac86f3777d 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_infra_href.test.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_infra_href.test.ts @@ -6,7 +6,7 @@ */ import { getInfraContainerHref, getInfraKubernetesHref, getInfraIpHref } from './get_infra_href'; -import { MonitorSummary, makePing, Ping } from '../../../../common/runtime_types'; +import { MonitorSummary, makePing, Ping } from '../../../../../common/runtime_types'; describe('getInfraHref', () => { let summary: MonitorSummary; diff --git a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_infra_href.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_infra_href.ts similarity index 96% rename from x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_infra_href.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_infra_href.ts index 1603ef9cf170a..e1cf922983d21 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_infra_href.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_infra_href.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { MonitorSummary, Ping } from '../../../../common/runtime_types'; +import { MonitorSummary, Ping } from '../../../../../common/runtime_types'; import { addBasePath } from './add_base_path'; import { buildHref } from './build_href'; diff --git a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_logging_href.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_logging_href.test.ts similarity index 98% rename from x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_logging_href.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_logging_href.test.ts index 3c778400fae71..791d19a7949c2 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_logging_href.test.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_logging_href.test.ts @@ -10,7 +10,7 @@ import { getLoggingKubernetesHref, getLoggingIpHref, } from './get_logging_href'; -import { MonitorSummary, makePing } from '../../../../common/runtime_types'; +import { MonitorSummary, makePing } from '../../../../../common/runtime_types'; describe('getLoggingHref', () => { let summary: MonitorSummary; diff --git a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_logging_href.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_logging_href.ts similarity index 96% rename from x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_logging_href.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_logging_href.ts index a3e6108b7efe8..947c50f1f0320 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/get_logging_href.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/get_logging_href.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { MonitorSummary, Ping } from '../../../../common/runtime_types'; +import { MonitorSummary, Ping } from '../../../../../common/runtime_types'; import { addBasePath } from './add_base_path'; import { buildHref } from './build_href'; diff --git a/x-pack/plugins/synthetics/public/lib/helper/observability_integration/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/observability_integration/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/observability_integration/index.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/parse_search.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/parse_search.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/parse_search.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/parse_search.test.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/parse_search.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/parse_search.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/parse_search.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/parse_search.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/rtl_helpers.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/rtl_helpers.tsx similarity index 99% rename from x-pack/plugins/synthetics/public/lib/helper/rtl_helpers.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/rtl_helpers.tsx index 913f5e249c688..db55ee3805ef1 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/rtl_helpers.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/rtl_helpers.tsx @@ -31,7 +31,7 @@ import { mockState } from '../__mocks__/uptime_store.mock'; import { MountWithReduxProvider } from './helper_with_redux'; import { AppState } from '../../state'; import { stringifyUrlParams } from './stringify_url_params'; -import { ClientPluginsStart } from '../../apps/plugin'; +import { ClientPluginsStart } from '../../../plugin'; import { UptimeRefreshContextProvider, UptimeStartupPluginsContextProvider } from '../../contexts'; import { kibanaService } from '../../state/kibana_service'; diff --git a/x-pack/plugins/synthetics/public/lib/helper/series_has_down_values.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/series_has_down_values.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/series_has_down_values.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/series_has_down_values.test.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/series_has_down_values.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/series_has_down_values.ts similarity index 85% rename from x-pack/plugins/synthetics/public/lib/helper/series_has_down_values.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/series_has_down_values.ts index 7090da1430bc5..d5ff1fc4e0715 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/series_has_down_values.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/series_has_down_values.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { HistogramPoint } from '../../../common/runtime_types'; +import { HistogramPoint } from '../../../../common/runtime_types'; export const seriesHasDownValues = (series: HistogramPoint[] | null): boolean => { return series ? series.some((point) => !!point.down) : false; diff --git a/x-pack/plugins/synthetics/public/lib/helper/spy_use_fetcher.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/spy_use_fetcher.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/spy_use_fetcher.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/spy_use_fetcher.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/stringify_url_params.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/stringify_url_params.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/stringify_url_params.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/stringify_url_params.test.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/stringify_url_params.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/stringify_url_params.ts similarity index 96% rename from x-pack/plugins/synthetics/public/lib/helper/stringify_url_params.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/stringify_url_params.ts index edfa8e62d6137..2bb5f9a3c13e3 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/stringify_url_params.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/stringify_url_params.ts @@ -7,7 +7,7 @@ import { stringify } from 'query-string'; import { UptimeUrlParams } from './url_params'; -import { CLIENT_DEFAULTS } from '../../../common/constants'; +import { CLIENT_DEFAULTS } from '../../../../common/constants'; const { AUTOREFRESH_INTERVAL, diff --git a/x-pack/plugins/synthetics/public/lib/helper/test_helpers.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/test_helpers.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/test_helpers.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/test_helpers.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/url_params/__snapshots__/get_supported_url_params.test.ts.snap b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/__snapshots__/get_supported_url_params.test.ts.snap similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/url_params/__snapshots__/get_supported_url_params.test.ts.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/__snapshots__/get_supported_url_params.test.ts.snap diff --git a/x-pack/plugins/synthetics/public/lib/helper/url_params/get_supported_url_params.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/get_supported_url_params.test.ts similarity index 97% rename from x-pack/plugins/synthetics/public/lib/helper/url_params/get_supported_url_params.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/get_supported_url_params.test.ts index 4771d864e0bf8..14b1ce22f9bee 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/url_params/get_supported_url_params.test.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/get_supported_url_params.test.ts @@ -7,7 +7,7 @@ import DateMath from '@kbn/datemath'; import { getSupportedUrlParams } from './get_supported_url_params'; -import { CLIENT_DEFAULTS } from '../../../../common/constants'; +import { CLIENT_DEFAULTS } from '../../../../../common/constants'; describe('getSupportedUrlParams', () => { let dateMathSpy: any; diff --git a/x-pack/plugins/synthetics/public/lib/helper/url_params/get_supported_url_params.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/get_supported_url_params.ts similarity index 97% rename from x-pack/plugins/synthetics/public/lib/helper/url_params/get_supported_url_params.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/get_supported_url_params.ts index 727f18b39c764..703b2257ee176 100644 --- a/x-pack/plugins/synthetics/public/lib/helper/url_params/get_supported_url_params.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/get_supported_url_params.ts @@ -7,7 +7,7 @@ import { parseIsPaused } from './parse_is_paused'; import { parseUrlInt } from './parse_url_int'; -import { CLIENT_DEFAULTS } from '../../../../common/constants'; +import { CLIENT_DEFAULTS } from '../../../../../common/constants'; import { parseAbsoluteDate } from './parse_absolute_date'; export interface UptimeUrlParams { diff --git a/x-pack/plugins/synthetics/public/lib/helper/url_params/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/url_params/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/index.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/url_params/parse_absolute_date.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/parse_absolute_date.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/url_params/parse_absolute_date.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/parse_absolute_date.test.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/url_params/parse_absolute_date.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/parse_absolute_date.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/url_params/parse_absolute_date.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/parse_absolute_date.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/url_params/parse_is_paused.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/parse_is_paused.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/url_params/parse_is_paused.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/parse_is_paused.test.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/url_params/parse_is_paused.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/parse_is_paused.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/url_params/parse_is_paused.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/parse_is_paused.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/url_params/parse_url_int.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/parse_url_int.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/url_params/parse_url_int.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/parse_url_int.test.ts diff --git a/x-pack/plugins/synthetics/public/lib/helper/url_params/parse_url_int.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/parse_url_int.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/helper/url_params/parse_url_int.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/helper/url_params/parse_url_int.ts diff --git a/x-pack/plugins/synthetics/public/lib/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/lib/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/index.ts diff --git a/x-pack/plugins/synthetics/public/badge.ts b/x-pack/plugins/synthetics/public/legacy_uptime/lib/lib.ts similarity index 83% rename from x-pack/plugins/synthetics/public/badge.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/lib/lib.ts index a42eaa58a7943..a846cdeb99fb6 100644 --- a/x-pack/plugins/synthetics/public/badge.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/lib/lib.ts @@ -6,4 +6,4 @@ */ import { ChromeBadge } from '@kbn/core/public'; -export type UMBadge = ChromeBadge | undefined; +export type UMUpdateBadge = (badge?: ChromeBadge) => void; diff --git a/x-pack/plugins/synthetics/public/pages/certificates.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/certificates.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/pages/certificates.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/certificates.test.tsx diff --git a/x-pack/plugins/synthetics/public/pages/certificates.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/certificates.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/pages/certificates.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/certificates.tsx diff --git a/x-pack/plugins/synthetics/public/pages/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/pages/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/pages/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/index.ts diff --git a/x-pack/plugins/synthetics/public/pages/mapping_error.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/mapping_error.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/pages/mapping_error.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/mapping_error.tsx diff --git a/x-pack/plugins/synthetics/public/pages/monitor.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/pages/monitor.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor.test.tsx diff --git a/x-pack/plugins/synthetics/public/pages/monitor.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/pages/monitor.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor.tsx diff --git a/x-pack/plugins/synthetics/public/pages/monitor_management/action_bar_portal_node.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/action_bar_portal_node.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/pages/monitor_management/action_bar_portal_node.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/action_bar_portal_node.tsx diff --git a/x-pack/plugins/synthetics/public/pages/monitor_management/add_monitor.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/add_monitor.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/pages/monitor_management/add_monitor.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/add_monitor.tsx index 40283f1331086..5979c7ed4767a 100644 --- a/x-pack/plugins/synthetics/public/pages/monitor_management/add_monitor.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/add_monitor.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { useTrackPageview } from '@kbn/observability-plugin/public'; -import { ScheduleUnit } from '../../../common/runtime_types'; +import { ScheduleUnit } from '../../../../common/runtime_types'; import { SyntheticsProviders } from '../../components/fleet_package/contexts'; import { Loader } from '../../components/monitor_management/loader/loader'; import { MonitorConfig } from '../../components/monitor_management/monitor_config/monitor_config'; diff --git a/x-pack/plugins/synthetics/public/pages/monitor_management/bottom_bar.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/bottom_bar.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/pages/monitor_management/bottom_bar.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/bottom_bar.tsx diff --git a/x-pack/plugins/synthetics/public/pages/monitor_management/content.ts b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/content.ts similarity index 100% rename from x-pack/plugins/synthetics/public/pages/monitor_management/content.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/content.ts diff --git a/x-pack/plugins/synthetics/public/pages/monitor_management/edit_monitor.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/edit_monitor.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/pages/monitor_management/edit_monitor.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/edit_monitor.tsx index 5c8c85d7c616d..cb92de595d378 100644 --- a/x-pack/plugins/synthetics/public/pages/monitor_management/edit_monitor.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/edit_monitor.tsx @@ -8,11 +8,11 @@ import React from 'react'; import { useParams } from 'react-router-dom'; import { useTrackPageview, FETCH_STATUS, useFetcher } from '@kbn/observability-plugin/public'; -import { MonitorFields } from '../../../common/runtime_types'; +import { MonitorFields } from '../../../../common/runtime_types'; import { EditMonitorConfig } from '../../components/monitor_management/edit_monitor_config'; import { Loader } from '../../components/monitor_management/loader/loader'; import { getMonitor } from '../../state/api'; -import { DecryptedSyntheticsMonitorSavedObject } from '../../../common/types'; +import { DecryptedSyntheticsMonitorSavedObject } from '../../../../common/types'; import { useLocations } from '../../components/monitor_management/hooks/use_locations'; import { useMonitorManagementBreadcrumbs } from './use_monitor_management_breadcrumbs'; import { diff --git a/x-pack/plugins/synthetics/public/pages/monitor_management/monitor_management.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/monitor_management.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/pages/monitor_management/monitor_management.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/monitor_management.tsx index 52453e66d858a..97013b9905187 100644 --- a/x-pack/plugins/synthetics/public/pages/monitor_management/monitor_management.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/monitor_management.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { useDispatch, useSelector } from 'react-redux'; import { EuiCallOut, EuiButton, EuiSpacer, EuiLink } from '@elastic/eui'; import { useTrackPageview } from '@kbn/observability-plugin/public'; -import { ConfigKey } from '../../../common/runtime_types'; +import { ConfigKey } from '../../../../common/runtime_types'; import { getMonitors } from '../../state/actions'; import { monitorManagementListSelector } from '../../state/selectors'; import { useMonitorManagementBreadcrumbs } from './use_monitor_management_breadcrumbs'; diff --git a/x-pack/plugins/synthetics/public/pages/monitor_management/service_allowed_wrapper.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/service_allowed_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/pages/monitor_management/service_allowed_wrapper.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/service_allowed_wrapper.test.tsx diff --git a/x-pack/plugins/synthetics/public/pages/monitor_management/service_allowed_wrapper.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/service_allowed_wrapper.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/pages/monitor_management/service_allowed_wrapper.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/service_allowed_wrapper.tsx diff --git a/x-pack/plugins/synthetics/public/pages/monitor_management/use_monitor_management_breadcrumbs.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/use_monitor_management_breadcrumbs.tsx similarity index 92% rename from x-pack/plugins/synthetics/public/pages/monitor_management/use_monitor_management_breadcrumbs.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/use_monitor_management_breadcrumbs.tsx index 03d07a122c730..2c7a4fe7a8259 100644 --- a/x-pack/plugins/synthetics/public/pages/monitor_management/use_monitor_management_breadcrumbs.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/use_monitor_management_breadcrumbs.tsx @@ -7,8 +7,8 @@ import { i18n } from '@kbn/i18n'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { useBreadcrumbs } from '../../hooks/use_breadcrumbs'; -import { MONITOR_MANAGEMENT_ROUTE } from '../../../common/constants'; -import { PLUGIN } from '../../../common/constants/plugin'; +import { MONITOR_MANAGEMENT_ROUTE } from '../../../../common/constants'; +import { PLUGIN } from '../../../../common/constants/plugin'; export const useMonitorManagementBreadcrumbs = ({ isAddMonitor, diff --git a/x-pack/plugins/synthetics/public/pages/not_found.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/not_found.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/pages/not_found.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/not_found.test.tsx diff --git a/x-pack/plugins/synthetics/public/pages/not_found.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/not_found.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/pages/not_found.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/not_found.tsx diff --git a/x-pack/plugins/synthetics/public/pages/overview.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/overview.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/pages/overview.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/overview.test.tsx diff --git a/x-pack/plugins/synthetics/public/pages/overview.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/overview.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/pages/overview.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/overview.tsx diff --git a/x-pack/plugins/synthetics/public/pages/settings.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/settings.test.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/pages/settings.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/settings.test.tsx diff --git a/x-pack/plugins/synthetics/public/pages/settings.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/settings.tsx similarity index 97% rename from x-pack/plugins/synthetics/public/pages/settings.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/settings.tsx index a12b615bb703d..6726a10ab8747 100644 --- a/x-pack/plugins/synthetics/public/pages/settings.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/settings.tsx @@ -11,7 +11,7 @@ import { useDispatch, useSelector } from 'react-redux'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { selectDynamicSettings } from '../state/selectors'; import { getDynamicSettings, setDynamicSettings } from '../state/actions/dynamic_settings'; -import { DynamicSettings } from '../../common/runtime_types'; +import { DynamicSettings } from '../../../common/runtime_types'; import { useBreadcrumbs } from '../hooks/use_breadcrumbs'; import { IndicesForm } from '../components/settings/indices_form'; import { @@ -23,7 +23,7 @@ import * as Translations from './translations'; import { VALUE_MUST_BE_GREATER_THAN_ZERO, VALUE_MUST_BE_AN_INTEGER, -} from '../../common/translations'; +} from '../../../common/translations'; import { AlertDefaultsForm } from '../components/settings/alert_defaults_form'; import { SettingsActionBarPortal } from '../components/settings/settings_bottom_bar'; import { useSettingsErrors } from '../components/settings/use_settings_errors'; diff --git a/x-pack/plugins/synthetics/public/pages/synthetics/checks_navigation.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/checks_navigation.tsx similarity index 96% rename from x-pack/plugins/synthetics/public/pages/synthetics/checks_navigation.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/checks_navigation.tsx index 6dcef302506e4..ee33191c3799e 100644 --- a/x-pack/plugins/synthetics/public/pages/synthetics/checks_navigation.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/checks_navigation.tsx @@ -10,7 +10,7 @@ import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui import { FormattedMessage } from '@kbn/i18n-react'; import { useHistory } from 'react-router-dom'; import moment from 'moment'; -import { SyntheticsJourneyApiResponse } from '../../../common/runtime_types/ping'; +import { SyntheticsJourneyApiResponse } from '../../../../common/runtime_types/ping'; import { getShortTimeStamp } from '../../components/overview/monitor_list/columns/monitor_status_column'; import { useBreakpoints } from '../../hooks/use_breakpoints'; diff --git a/x-pack/plugins/synthetics/public/pages/synthetics/step_detail_page.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/step_detail_page.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/pages/synthetics/step_detail_page.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/step_detail_page.tsx index 2ded527f7bb57..7caa521e434f4 100644 --- a/x-pack/plugins/synthetics/public/pages/synthetics/step_detail_page.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/step_detail_page.tsx @@ -14,7 +14,7 @@ import { useInitApp } from '../../hooks/use_init_app'; import { StepDetailContainer } from '../../components/monitor/synthetics/step_detail/step_detail_container'; import { journeySelector } from '../../state/selectors'; import { JourneyState } from '../../state/reducers/journey'; -import { JourneyStep } from '../../../common/runtime_types/ping/synthetics'; +import { JourneyStep } from '../../../../common/runtime_types/ping/synthetics'; import { StepPageNavigation } from '../../components/monitor/synthetics/step_detail/step_page_nav'; import { StepPageTitleContent } from '../../components/monitor/synthetics/step_detail/step_page_title'; import { getJourneySteps } from '../../state/actions/journey'; diff --git a/x-pack/plugins/synthetics/public/pages/synthetics/synthetics_checks.test.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/synthetics_checks.test.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/pages/synthetics/synthetics_checks.test.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/synthetics_checks.test.tsx index 290cdd453bd3c..312c10886c572 100644 --- a/x-pack/plugins/synthetics/public/pages/synthetics/synthetics_checks.test.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/synthetics_checks.test.tsx @@ -14,7 +14,7 @@ import { } from './synthetics_checks'; import { fetchJourneySteps } from '../../state/api/journey'; import { createMemoryHistory } from 'history'; -import { SYNTHETIC_CHECK_STEPS_ROUTE } from '../../../common/constants'; +import { SYNTHETIC_CHECK_STEPS_ROUTE } from '../../../../common/constants'; jest.mock('../../state/api/journey', () => ({ fetchJourneySteps: jest.fn(), diff --git a/x-pack/plugins/synthetics/public/pages/synthetics/synthetics_checks.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/synthetics_checks.tsx similarity index 100% rename from x-pack/plugins/synthetics/public/pages/synthetics/synthetics_checks.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/synthetics/synthetics_checks.tsx diff --git a/x-pack/plugins/synthetics/public/pages/translations.ts b/x-pack/plugins/synthetics/public/legacy_uptime/pages/translations.ts similarity index 100% rename from x-pack/plugins/synthetics/public/pages/translations.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/pages/translations.ts diff --git a/x-pack/plugins/synthetics/public/routes.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/routes.tsx similarity index 98% rename from x-pack/plugins/synthetics/public/routes.tsx rename to x-pack/plugins/synthetics/public/legacy_uptime/routes.tsx index 0c43b99467f3b..1b8706ad4cb00 100644 --- a/x-pack/plugins/synthetics/public/routes.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/routes.tsx @@ -23,7 +23,7 @@ import { SETTINGS_ROUTE, STEP_DETAIL_ROUTE, SYNTHETIC_CHECK_STEPS_ROUTE, -} from '../common/constants'; +} from '../../common/constants'; import { MappingErrorPage, MonitorPage, @@ -53,7 +53,7 @@ import { StepDetailPageHeader, StepDetailPageRightSideItem, } from './pages/synthetics/step_detail_page'; -import { UptimePageTemplateComponent } from './apps/uptime_page_template'; +import { UptimePageTemplateComponent } from './app/uptime_page_template'; import { apiService } from './state/api/utils'; import { AddMonitorBtn } from './components/monitor_management/add_monitor_btn'; import { SettingsBottomBar } from './components/settings/settings_bottom_bar'; diff --git a/x-pack/plugins/synthetics/public/state/actions/alerts.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/alerts.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/actions/alerts.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/alerts.ts diff --git a/x-pack/plugins/synthetics/public/state/actions/dynamic_settings.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/dynamic_settings.ts similarity index 92% rename from x-pack/plugins/synthetics/public/state/actions/dynamic_settings.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/dynamic_settings.ts index 7b7939688010f..6be8cc4547559 100644 --- a/x-pack/plugins/synthetics/public/state/actions/dynamic_settings.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/dynamic_settings.ts @@ -6,7 +6,7 @@ */ import { createAction } from 'redux-actions'; -import { DynamicSettings } from '../../../common/runtime_types'; +import { DynamicSettings } from '../../../../common/runtime_types'; export const getDynamicSettings = createAction('GET_DYNAMIC_SETTINGS'); export const getDynamicSettingsSuccess = createAction( diff --git a/x-pack/plugins/synthetics/public/state/actions/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/actions/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/index.ts diff --git a/x-pack/plugins/synthetics/public/state/actions/index_status.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/index_status.ts similarity index 84% rename from x-pack/plugins/synthetics/public/state/actions/index_status.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/index_status.ts index 306565c1f507f..2de91a82c6762 100644 --- a/x-pack/plugins/synthetics/public/state/actions/index_status.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/index_status.ts @@ -6,6 +6,6 @@ */ import { createAsyncAction } from './utils'; -import { StatesIndexStatus } from '../../../common/runtime_types'; +import { StatesIndexStatus } from '../../../../common/runtime_types'; export const indexStatusAction = createAsyncAction('GET INDEX STATUS'); diff --git a/x-pack/plugins/synthetics/public/state/actions/journey.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/journey.ts similarity index 91% rename from x-pack/plugins/synthetics/public/state/actions/journey.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/journey.ts index bc03c443331c1..c9833ee25f95d 100644 --- a/x-pack/plugins/synthetics/public/state/actions/journey.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/journey.ts @@ -6,7 +6,7 @@ */ import { createAction } from 'redux-actions'; -import { SyntheticsJourneyApiResponse } from '../../../common/runtime_types'; +import { SyntheticsJourneyApiResponse } from '../../../../common/runtime_types'; export interface FetchJourneyStepsParams { checkGroup: string; diff --git a/x-pack/plugins/synthetics/public/state/actions/ml_anomaly.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/ml_anomaly.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/actions/ml_anomaly.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/ml_anomaly.ts diff --git a/x-pack/plugins/synthetics/public/state/actions/monitor.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/monitor.ts similarity index 89% rename from x-pack/plugins/synthetics/public/state/actions/monitor.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/monitor.ts index f9dcd4bd57538..5fd74737d96a7 100644 --- a/x-pack/plugins/synthetics/public/state/actions/monitor.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/monitor.ts @@ -7,8 +7,8 @@ import { createAction } from 'redux-actions'; import { MonitorDetailsActionPayload } from './types'; -import { PingError } from '../../../common/runtime_types'; -import { MonitorLocations } from '../../../common/runtime_types'; +import { PingError } from '../../../../common/runtime_types'; +import { MonitorLocations } from '../../../../common/runtime_types'; import { QueryParams } from './types'; import { createAsyncAction } from './utils'; diff --git a/x-pack/plugins/synthetics/public/state/actions/monitor_duration.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/monitor_duration.ts similarity index 92% rename from x-pack/plugins/synthetics/public/state/actions/monitor_duration.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/monitor_duration.ts index 1dd88c663cec5..52583e79f9ec3 100644 --- a/x-pack/plugins/synthetics/public/state/actions/monitor_duration.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/monitor_duration.ts @@ -8,7 +8,7 @@ import { createAction } from 'redux-actions'; import { IHttpFetchError } from '@kbn/core/public'; import { QueryParams } from './types'; -import { MonitorDurationResult } from '../../../common/types'; +import { MonitorDurationResult } from '../../../../common/types'; type MonitorQueryParams = QueryParams & { monitorId: string }; diff --git a/x-pack/plugins/synthetics/public/state/actions/monitor_list.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/monitor_list.ts similarity index 91% rename from x-pack/plugins/synthetics/public/state/actions/monitor_list.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/monitor_list.ts index b86853dcfbefe..c123ca95a5acd 100644 --- a/x-pack/plugins/synthetics/public/state/actions/monitor_list.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/monitor_list.ts @@ -6,7 +6,10 @@ */ import { createAction } from 'redux-actions'; -import { FetchMonitorStatesQueryArgs, MonitorSummariesResult } from '../../../common/runtime_types'; +import { + FetchMonitorStatesQueryArgs, + MonitorSummariesResult, +} from '../../../../common/runtime_types'; import { createAsyncAction } from './utils'; import { TestNowResponse } from '../api'; diff --git a/x-pack/plugins/synthetics/public/state/actions/monitor_management.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/monitor_management.ts similarity index 94% rename from x-pack/plugins/synthetics/public/state/actions/monitor_management.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/monitor_management.ts index 278f8fe9a4b99..79bec6f3e1b65 100644 --- a/x-pack/plugins/synthetics/public/state/actions/monitor_management.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/monitor_management.ts @@ -11,9 +11,9 @@ import { ServiceLocations, ThrottlingOptions, FetchMonitorManagementListQueryArgs, -} from '../../../common/runtime_types'; +} from '../../../../common/runtime_types'; import { createAsyncAction } from './utils'; -import { SyntheticsServiceAllowed } from '../../../common/types'; +import { SyntheticsServiceAllowed } from '../../../../common/types'; export const getMonitors = createAction( 'GET_MONITOR_MANAGEMENT_LIST' diff --git a/x-pack/plugins/synthetics/public/state/actions/monitor_status.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/monitor_status.ts similarity index 91% rename from x-pack/plugins/synthetics/public/state/actions/monitor_status.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/monitor_status.ts index 3928cd539a5c0..e9fcf67a7b678 100644 --- a/x-pack/plugins/synthetics/public/state/actions/monitor_status.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/monitor_status.ts @@ -7,7 +7,7 @@ import { createAction } from 'redux-actions'; import { QueryParams } from './types'; -import { Ping } from '../../../common/runtime_types'; +import { Ping } from '../../../../common/runtime_types'; export const getMonitorStatusAction = createAction('GET_MONITOR_STATUS'); export const getMonitorStatusActionSuccess = createAction('GET_MONITOR_STATUS_SUCCESS'); diff --git a/x-pack/plugins/synthetics/public/state/actions/network_events.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/network_events.ts similarity index 91% rename from x-pack/plugins/synthetics/public/state/actions/network_events.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/network_events.ts index f078888d6eae8..1467289abe1e8 100644 --- a/x-pack/plugins/synthetics/public/state/actions/network_events.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/network_events.ts @@ -6,7 +6,7 @@ */ import { createAction } from 'redux-actions'; -import { SyntheticsNetworkEventsApiResponse } from '../../../common/runtime_types'; +import { SyntheticsNetworkEventsApiResponse } from '../../../../common/runtime_types'; export interface FetchNetworkEventsParams { checkGroup: string; diff --git a/x-pack/plugins/synthetics/public/state/actions/ping.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/ping.ts similarity index 95% rename from x-pack/plugins/synthetics/public/state/actions/ping.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/ping.ts index 6b997ba184b0b..73be085a86e03 100644 --- a/x-pack/plugins/synthetics/public/state/actions/ping.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/ping.ts @@ -11,7 +11,7 @@ import { HistogramResult, PingsResponse, GetPingsParams, -} from '../../../common/runtime_types'; +} from '../../../../common/runtime_types'; import { createAsyncAction } from './utils'; export const clearPings = createAction('CLEAR PINGS'); diff --git a/x-pack/plugins/synthetics/public/state/actions/selected_filters.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/selected_filters.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/actions/selected_filters.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/selected_filters.ts diff --git a/x-pack/plugins/synthetics/public/state/actions/snapshot.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/snapshot.ts similarity index 88% rename from x-pack/plugins/synthetics/public/state/actions/snapshot.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/snapshot.ts index b1ff299600943..a495c917223a2 100644 --- a/x-pack/plugins/synthetics/public/state/actions/snapshot.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/snapshot.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { Snapshot } from '../../../common/runtime_types'; +import { Snapshot } from '../../../../common/runtime_types'; import { createAsyncAction } from './utils'; import { SnapShotQueryParams } from '../api'; diff --git a/x-pack/plugins/synthetics/public/state/actions/types.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/types.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/actions/types.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/types.ts diff --git a/x-pack/plugins/synthetics/public/state/actions/ui.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/ui.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/actions/ui.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/ui.ts diff --git a/x-pack/plugins/synthetics/public/state/actions/utils.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/actions/utils.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/actions/utils.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/actions/utils.ts diff --git a/x-pack/plugins/synthetics/public/state/alerts/alerts.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/alerts/alerts.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/alerts/alerts.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/alerts/alerts.ts diff --git a/x-pack/plugins/synthetics/public/state/api/__snapshots__/snapshot.test.ts.snap b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/__snapshots__/snapshot.test.ts.snap similarity index 100% rename from x-pack/plugins/synthetics/public/state/api/__snapshots__/snapshot.test.ts.snap rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/__snapshots__/snapshot.test.ts.snap diff --git a/x-pack/plugins/synthetics/public/state/api/alert_actions.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/alert_actions.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/api/alert_actions.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/alert_actions.test.ts diff --git a/x-pack/plugins/synthetics/public/state/api/alert_actions.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/alert_actions.ts similarity index 96% rename from x-pack/plugins/synthetics/public/state/api/alert_actions.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/alert_actions.ts index 2a76239ce183a..eabfe42691e8d 100644 --- a/x-pack/plugins/synthetics/public/state/api/alert_actions.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/alert_actions.ts @@ -18,11 +18,11 @@ import { // eslint-disable-next-line @kbn/eslint/no-restricted-paths } from '@kbn/actions-plugin/server'; import { NewAlertParams } from './alerts'; -import { ACTION_GROUP_DEFINITIONS } from '../../../common/constants/alerts'; -import { MonitorStatusTranslations } from '../../../common/translations'; +import { ACTION_GROUP_DEFINITIONS } from '../../../../common/constants/alerts'; +import { MonitorStatusTranslations } from '../../../../common/translations'; import { ActionTypeId } from '../../components/settings/types'; -import { Ping } from '../../../common/runtime_types/ping'; -import { DefaultEmail } from '../../../common/runtime_types'; +import { Ping } from '../../../../common/runtime_types/ping'; +import { DefaultEmail } from '../../../../common/runtime_types'; export const SLACK_ACTION_ID: ActionTypeId = '.slack'; export const PAGER_DUTY_ACTION_ID: ActionTypeId = '.pagerduty'; diff --git a/x-pack/plugins/synthetics/public/state/api/alerts.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/alerts.ts similarity index 93% rename from x-pack/plugins/synthetics/public/state/api/alerts.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/alerts.ts index 1b97422cc67a5..2d5d47578a57b 100644 --- a/x-pack/plugins/synthetics/public/state/api/alerts.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/alerts.ts @@ -7,17 +7,17 @@ import type { ActionType, AsApiContract, Rule } from '@kbn/triggers-actions-ui-plugin/public'; import { RuleTypeParams } from '@kbn/alerting-plugin/common'; -import { CLIENT_ALERT_TYPES } from '../../../common/constants/alerts'; +import { CLIENT_ALERT_TYPES } from '../../../../common/constants/alerts'; import { apiService } from './utils'; import { ActionConnector } from '../alerts/alerts'; import { AlertsResult, MonitorIdParam } from '../actions/types'; -import { API_URLS } from '../../../common/constants'; -import { AtomicStatusCheckParams } from '../../../common/runtime_types/alerts'; +import { API_URLS } from '../../../../common/constants'; +import { AtomicStatusCheckParams } from '../../../../common/runtime_types/alerts'; import { populateAlertActions, RuleAction } from './alert_actions'; -import { Ping } from '../../../common/runtime_types/ping'; -import { DefaultEmail } from '../../../common/runtime_types'; +import { Ping } from '../../../../common/runtime_types/ping'; +import { DefaultEmail } from '../../../../common/runtime_types'; const UPTIME_AUTO_ALERT = 'UPTIME_AUTO'; diff --git a/x-pack/plugins/synthetics/public/state/api/dynamic_settings.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/dynamic_settings.ts similarity index 89% rename from x-pack/plugins/synthetics/public/state/api/dynamic_settings.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/dynamic_settings.ts index a7bacfbba3462..e3c14adf1de74 100644 --- a/x-pack/plugins/synthetics/public/state/api/dynamic_settings.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/dynamic_settings.ts @@ -10,9 +10,9 @@ import { DynamicSettings, DynamicSettingsSaveResponse, DynamicSettingsSaveType, -} from '../../../common/runtime_types'; +} from '../../../../common/runtime_types'; import { apiService } from './utils'; -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../../common/constants'; const apiPath = API_URLS.DYNAMIC_SETTINGS; diff --git a/x-pack/plugins/synthetics/public/state/api/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/api/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/index.ts diff --git a/x-pack/plugins/synthetics/public/state/api/index_status.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/index_status.ts similarity index 85% rename from x-pack/plugins/synthetics/public/state/api/index_status.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/index_status.ts index c6d8f96403eeb..857915deb9023 100644 --- a/x-pack/plugins/synthetics/public/state/api/index_status.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/index_status.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { API_URLS } from '../../../common/constants'; -import { StatesIndexStatus, StatesIndexStatusType } from '../../../common/runtime_types'; +import { API_URLS } from '../../../../common/constants'; +import { StatesIndexStatus, StatesIndexStatusType } from '../../../../common/runtime_types'; import { apiService } from './utils'; export const fetchIndexStatus = async (): Promise => { diff --git a/x-pack/plugins/synthetics/public/state/api/journey.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/journey.ts similarity index 92% rename from x-pack/plugins/synthetics/public/state/api/journey.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/journey.ts index 958ef5e474fee..64a156eb26ed5 100644 --- a/x-pack/plugins/synthetics/public/state/api/journey.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/journey.ts @@ -7,7 +7,7 @@ import { apiService } from './utils'; import { FetchJourneyStepsParams } from '../actions/journey'; -import { Ping, PingType } from '../../../common/runtime_types/ping/ping'; +import { Ping, PingType } from '../../../../common/runtime_types/ping/ping'; import { FailedStepsApiResponse, FailedStepsApiResponseType, @@ -16,8 +16,8 @@ import { ScreenshotRefImageData, SyntheticsJourneyApiResponse, SyntheticsJourneyApiResponseType, -} from '../../../common/runtime_types/ping/synthetics'; -import { API_URLS } from '../../../common/constants'; +} from '../../../../common/runtime_types/ping/synthetics'; +import { API_URLS } from '../../../../common/constants'; export async function fetchScreenshotBlockSet(params: string[]): Promise { return apiService.post(API_URLS.JOURNEY_SCREENSHOT_BLOCKS, { diff --git a/x-pack/plugins/synthetics/public/state/api/ml_anomaly.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/ml_anomaly.ts similarity index 95% rename from x-pack/plugins/synthetics/public/state/api/ml_anomaly.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/ml_anomaly.ts index e7655f37d3f01..18ce74d9823bb 100644 --- a/x-pack/plugins/synthetics/public/state/api/ml_anomaly.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/ml_anomaly.ts @@ -14,14 +14,14 @@ import { import { extractErrorMessage } from '@kbn/ml-plugin/common'; import { apiService } from './utils'; import { AnomalyRecords, AnomalyRecordsParams } from '../actions'; -import { API_URLS, ML_MODULE_ID } from '../../../common/constants'; +import { API_URLS, ML_MODULE_ID } from '../../../../common/constants'; import { CreateMLJobSuccess, DeleteJobResults, HeartbeatIndicesParam, MonitorIdParam, } from '../actions/types'; -import { getJobPrefix, getMLJobId } from '../../../common/lib/ml'; +import { getJobPrefix, getMLJobId } from '../../../../common/lib/ml'; export const getMLCapabilities = async (): Promise => { return await apiService.get(API_URLS.ML_CAPABILITIES); diff --git a/x-pack/plugins/synthetics/public/state/api/monitor.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/monitor.ts similarity index 92% rename from x-pack/plugins/synthetics/public/state/api/monitor.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/monitor.ts index ef04b38f37469..5dfb200444134 100644 --- a/x-pack/plugins/synthetics/public/state/api/monitor.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/monitor.ts @@ -6,10 +6,10 @@ */ import { BaseParams } from './types'; -import { MonitorDetailsType, MonitorLocationsType } from '../../../common/runtime_types'; +import { MonitorDetailsType, MonitorLocationsType } from '../../../../common/runtime_types'; import { QueryParams } from '../actions/types'; import { apiService } from './utils'; -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../../common/constants'; interface ApiRequest { monitorId: string; diff --git a/x-pack/plugins/synthetics/public/state/api/monitor_duration.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/monitor_duration.ts similarity index 91% rename from x-pack/plugins/synthetics/public/state/api/monitor_duration.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/monitor_duration.ts index c8010e18d0868..3fc046170757c 100644 --- a/x-pack/plugins/synthetics/public/state/api/monitor_duration.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/monitor_duration.ts @@ -7,7 +7,7 @@ import { BaseParams } from './types'; import { apiService } from './utils'; -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../../common/constants'; export const fetchMonitorDuration = async ({ monitorId, dateStart, dateEnd }: BaseParams) => { const queryParams = { diff --git a/x-pack/plugins/synthetics/public/state/api/monitor_list.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/monitor_list.ts similarity index 85% rename from x-pack/plugins/synthetics/public/state/api/monitor_list.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/monitor_list.ts index 860a46d3e3abc..e328132abe465 100644 --- a/x-pack/plugins/synthetics/public/state/api/monitor_list.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/monitor_list.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../../common/constants'; import { apiService } from './utils'; import { FetchMonitorStatesQueryArgs, MonitorSummariesResult, MonitorSummariesResultType, -} from '../../../common/runtime_types'; +} from '../../../../common/runtime_types'; export const fetchMonitorList = async ( params: FetchMonitorStatesQueryArgs diff --git a/x-pack/plugins/synthetics/public/state/api/monitor_management.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/monitor_management.ts similarity index 96% rename from x-pack/plugins/synthetics/public/state/api/monitor_management.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/monitor_management.ts index a776d33b8147b..c38fff649048b 100644 --- a/x-pack/plugins/synthetics/public/state/api/monitor_management.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/monitor_management.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../../common/constants'; import { FetchMonitorManagementListQueryArgs, MonitorManagementListResultCodec, @@ -20,11 +20,11 @@ import { ThrottlingOptions, Locations, SyntheticsMonitorSchedule, -} from '../../../common/runtime_types'; +} from '../../../../common/runtime_types'; import { DecryptedSyntheticsMonitorSavedObject, SyntheticsServiceAllowed, -} from '../../../common/types'; +} from '../../../../common/types'; import { apiService } from './utils'; export const setMonitor = async ({ diff --git a/x-pack/plugins/synthetics/public/state/api/monitor_status.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/monitor_status.ts similarity index 84% rename from x-pack/plugins/synthetics/public/state/api/monitor_status.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/monitor_status.ts index 9c4e7e3eaf5d3..10534c18b7d38 100644 --- a/x-pack/plugins/synthetics/public/state/api/monitor_status.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/monitor_status.ts @@ -6,8 +6,8 @@ */ import { QueryParams } from '../actions/types'; -import { Ping } from '../../../common/runtime_types'; -import { API_URLS } from '../../../common/constants'; +import { Ping } from '../../../../common/runtime_types'; +import { API_URLS } from '../../../../common/constants'; import { apiService } from './utils'; export const fetchMonitorStatus = async ({ diff --git a/x-pack/plugins/synthetics/public/state/api/network_events.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/network_events.ts similarity index 89% rename from x-pack/plugins/synthetics/public/state/api/network_events.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/network_events.ts index d9b3d518444a3..82dcd572ad624 100644 --- a/x-pack/plugins/synthetics/public/state/api/network_events.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/network_events.ts @@ -10,8 +10,8 @@ import { FetchNetworkEventsParams } from '../actions/network_events'; import { SyntheticsNetworkEventsApiResponse, SyntheticsNetworkEventsApiResponseType, -} from '../../../common/runtime_types'; -import { API_URLS } from '../../../common/constants'; +} from '../../../../common/runtime_types'; +import { API_URLS } from '../../../../common/constants'; export async function fetchNetworkEvents( params: FetchNetworkEventsParams diff --git a/x-pack/plugins/synthetics/public/state/api/ping.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/ping.ts similarity index 90% rename from x-pack/plugins/synthetics/public/state/api/ping.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/ping.ts index e4fc5cc620b55..969102a8d77c6 100644 --- a/x-pack/plugins/synthetics/public/state/api/ping.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/ping.ts @@ -12,9 +12,9 @@ import { GetPingsParams, GetPingHistogramParams, HistogramResult, -} from '../../../common/runtime_types'; +} from '../../../../common/runtime_types'; import { apiService } from './utils'; -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../../common/constants'; export const fetchPings: APIFn = async ({ dateRange: { from, to }, diff --git a/x-pack/plugins/synthetics/public/state/api/snapshot.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/snapshot.test.ts similarity index 97% rename from x-pack/plugins/synthetics/public/state/api/snapshot.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/snapshot.test.ts index 20a0a0d7a477c..97578deeb6fb7 100644 --- a/x-pack/plugins/synthetics/public/state/api/snapshot.test.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/snapshot.test.ts @@ -8,7 +8,7 @@ import { HttpFetchError } from '@kbn/core/public'; import { fetchSnapshotCount } from './snapshot'; import { apiService } from './utils'; -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../../common/constants'; describe('snapshot API', () => { let fetchMock: jest.SpyInstance>; diff --git a/x-pack/plugins/synthetics/public/state/api/snapshot.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/snapshot.ts similarity index 85% rename from x-pack/plugins/synthetics/public/state/api/snapshot.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/snapshot.ts index d8f38128e3202..7734a0cec79b2 100644 --- a/x-pack/plugins/synthetics/public/state/api/snapshot.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/snapshot.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { SnapshotType, Snapshot } from '../../../common/runtime_types'; +import { SnapshotType, Snapshot } from '../../../../common/runtime_types'; import { apiService } from './utils'; -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../../common/constants'; export interface SnapShotQueryParams { dateRangeStart: string; diff --git a/x-pack/plugins/synthetics/public/state/api/types.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/types.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/api/types.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/types.ts diff --git a/x-pack/plugins/synthetics/public/state/api/utils.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/api/utils.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/api/utils.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/api/utils.ts diff --git a/x-pack/plugins/synthetics/public/state/certificates/certificates.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/certificates/certificates.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/certificates/certificates.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/certificates/certificates.ts diff --git a/x-pack/plugins/synthetics/public/state/effects/alerts.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/alerts.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/effects/alerts.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/alerts.ts diff --git a/x-pack/plugins/synthetics/public/state/effects/dynamic_settings.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/dynamic_settings.ts similarity index 96% rename from x-pack/plugins/synthetics/public/state/effects/dynamic_settings.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/dynamic_settings.ts index 04cdb13f5612c..1200633976c6f 100644 --- a/x-pack/plugins/synthetics/public/state/effects/dynamic_settings.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/dynamic_settings.ts @@ -21,7 +21,7 @@ import { getDynamicSettings as getDynamicSettingsAPI, setDynamicSettings as setDynamicSettingsAPI, } from '../api'; -import { DynamicSettings } from '../../../common/runtime_types'; +import { DynamicSettings } from '../../../../common/runtime_types'; import { kibanaService } from '../kibana_service'; export function* fetchDynamicSettingsEffect() { diff --git a/x-pack/plugins/synthetics/public/state/effects/fetch_effect.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/fetch_effect.test.ts similarity index 97% rename from x-pack/plugins/synthetics/public/state/effects/fetch_effect.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/fetch_effect.test.ts index 5216260714cc8..4a19cfae58f6a 100644 --- a/x-pack/plugins/synthetics/public/state/effects/fetch_effect.test.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/fetch_effect.test.ts @@ -9,7 +9,7 @@ import { call, put } from 'redux-saga/effects'; import { fetchEffectFactory } from './fetch_effect'; import { indexStatusAction } from '../actions'; import { HttpFetchError } from '@kbn/core/public'; -import { StatesIndexStatus } from '../../../common/runtime_types'; +import { StatesIndexStatus } from '../../../../common/runtime_types'; import { fetchIndexStatus } from '../api'; describe('fetch saga effect factory', () => { diff --git a/x-pack/plugins/synthetics/public/state/effects/fetch_effect.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/fetch_effect.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/effects/fetch_effect.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/fetch_effect.ts diff --git a/x-pack/plugins/synthetics/public/state/effects/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/effects/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/index.ts diff --git a/x-pack/plugins/synthetics/public/state/effects/index_status.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/index_status.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/effects/index_status.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/index_status.ts diff --git a/x-pack/plugins/synthetics/public/state/effects/journey.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/journey.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/effects/journey.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/journey.test.ts diff --git a/x-pack/plugins/synthetics/public/state/effects/journey.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/journey.ts similarity index 93% rename from x-pack/plugins/synthetics/public/state/effects/journey.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/journey.ts index f7c1e23742e69..14d3ce91a32de 100644 --- a/x-pack/plugins/synthetics/public/state/effects/journey.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/journey.ts @@ -14,7 +14,7 @@ import { FetchJourneyStepsParams, } from '../actions/journey'; import { fetchJourneySteps } from '../api/journey'; -import type { SyntheticsJourneyApiResponse } from '../../../common/runtime_types'; +import type { SyntheticsJourneyApiResponse } from '../../../../common/runtime_types'; const inFlightStepRequests: Record = {}; diff --git a/x-pack/plugins/synthetics/public/state/effects/ml_anomaly.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/ml_anomaly.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/effects/ml_anomaly.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/ml_anomaly.ts diff --git a/x-pack/plugins/synthetics/public/state/effects/monitor.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/monitor.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/effects/monitor.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/monitor.ts diff --git a/x-pack/plugins/synthetics/public/state/effects/monitor_duration.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/monitor_duration.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/effects/monitor_duration.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/monitor_duration.ts diff --git a/x-pack/plugins/synthetics/public/state/effects/monitor_list.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/monitor_list.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/effects/monitor_list.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/monitor_list.ts diff --git a/x-pack/plugins/synthetics/public/state/effects/monitor_management.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/monitor_management.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/effects/monitor_management.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/monitor_management.ts diff --git a/x-pack/plugins/synthetics/public/state/effects/monitor_status.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/monitor_status.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/effects/monitor_status.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/monitor_status.ts diff --git a/x-pack/plugins/synthetics/public/state/effects/network_events.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/network_events.ts similarity index 98% rename from x-pack/plugins/synthetics/public/state/effects/network_events.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/network_events.ts index 75ea3d4467eb4..8c74e753c162c 100644 --- a/x-pack/plugins/synthetics/public/state/effects/network_events.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/network_events.ts @@ -14,7 +14,7 @@ import { FetchNetworkEventsParams, } from '../actions/network_events'; import { fetchNetworkEvents } from '../api/network_events'; -import type { SyntheticsNetworkEventsApiResponse } from '../../../common/runtime_types'; +import type { SyntheticsNetworkEventsApiResponse } from '../../../../common/runtime_types'; export function* fetchNetworkEventsEffect() { yield takeLatest( diff --git a/x-pack/plugins/synthetics/public/state/effects/ping.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/ping.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/effects/ping.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/ping.ts diff --git a/x-pack/plugins/synthetics/public/state/effects/synthetic_journey_blocks.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/synthetic_journey_blocks.ts similarity index 96% rename from x-pack/plugins/synthetics/public/state/effects/synthetic_journey_blocks.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/synthetic_journey_blocks.ts index 829048747ddf7..6ffbeb6978f75 100644 --- a/x-pack/plugins/synthetics/public/state/effects/synthetic_journey_blocks.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/synthetic_journey_blocks.ts @@ -7,7 +7,7 @@ import { Action } from 'redux-actions'; import { call, fork, put, select, takeEvery, throttle } from 'redux-saga/effects'; -import { ScreenshotBlockDoc } from '../../../common/runtime_types/ping/synthetics'; +import { ScreenshotBlockDoc } from '../../../../common/runtime_types/ping/synthetics'; import { fetchScreenshotBlockSet } from '../api/journey'; import { fetchBlocksAction, diff --git a/x-pack/plugins/synthetics/public/state/effects/test_now_runs.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/effects/test_now_runs.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/effects/test_now_runs.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/effects/test_now_runs.ts diff --git a/x-pack/plugins/synthetics/public/state/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/index.ts diff --git a/x-pack/plugins/synthetics/public/state/kibana_service.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/kibana_service.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/kibana_service.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/kibana_service.ts diff --git a/x-pack/plugins/synthetics/public/state/reducers/dynamic_settings.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/dynamic_settings.ts similarity index 96% rename from x-pack/plugins/synthetics/public/state/reducers/dynamic_settings.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/dynamic_settings.ts index 93f30c77f5536..d7c20b8edf7a3 100644 --- a/x-pack/plugins/synthetics/public/state/reducers/dynamic_settings.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/dynamic_settings.ts @@ -14,7 +14,7 @@ import { setDynamicSettingsSuccess, setDynamicSettingsFail, } from '../actions/dynamic_settings'; -import { DynamicSettings } from '../../../common/runtime_types'; +import { DynamicSettings } from '../../../../common/runtime_types'; export interface DynamicSettingsState { settings?: DynamicSettings; diff --git a/x-pack/plugins/synthetics/public/state/reducers/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/reducers/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/index.ts diff --git a/x-pack/plugins/synthetics/public/state/reducers/index_status.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/index_status.ts similarity index 92% rename from x-pack/plugins/synthetics/public/state/reducers/index_status.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/index_status.ts index 7c3aecd98f706..29ea59cabb9e5 100644 --- a/x-pack/plugins/synthetics/public/state/reducers/index_status.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/index_status.ts @@ -9,7 +9,7 @@ import { handleActions } from 'redux-actions'; import { indexStatusAction } from '../actions'; import { asyncInitState, handleAsyncAction } from './utils'; import { AsyncInitState } from './types'; -import { StatesIndexStatus } from '../../../common/runtime_types'; +import { StatesIndexStatus } from '../../../../common/runtime_types'; export interface IndexStatusState { indexStatus: AsyncInitState; diff --git a/x-pack/plugins/synthetics/public/state/reducers/journey.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/journey.ts similarity index 98% rename from x-pack/plugins/synthetics/public/state/reducers/journey.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/journey.ts index 98bbd93a24e0c..ae781b5839593 100644 --- a/x-pack/plugins/synthetics/public/state/reducers/journey.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/journey.ts @@ -6,7 +6,7 @@ */ import { handleActions, Action } from 'redux-actions'; -import { JourneyStep, SyntheticsJourneyApiResponse } from '../../../common/runtime_types'; +import { JourneyStep, SyntheticsJourneyApiResponse } from '../../../../common/runtime_types'; import { pruneJourneyState } from '../actions/journey'; import { FetchJourneyStepsParams, diff --git a/x-pack/plugins/synthetics/public/state/reducers/ml_anomaly.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/ml_anomaly.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/reducers/ml_anomaly.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/ml_anomaly.ts diff --git a/x-pack/plugins/synthetics/public/state/reducers/monitor.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor.ts similarity index 96% rename from x-pack/plugins/synthetics/public/state/reducers/monitor.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor.ts index 3c5be59ea9dda..23f2aac045b29 100644 --- a/x-pack/plugins/synthetics/public/state/reducers/monitor.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor.ts @@ -13,7 +13,7 @@ import { getMonitorLocationsActionSuccess, getMonitorLocationsActionFail, } from '../actions/monitor'; -import { MonitorLocations } from '../../../common/runtime_types'; +import { MonitorLocations } from '../../../../common/runtime_types'; type MonitorLocationsList = Map; diff --git a/x-pack/plugins/synthetics/public/state/reducers/monitor_duration.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_duration.ts similarity index 95% rename from x-pack/plugins/synthetics/public/state/reducers/monitor_duration.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_duration.ts index 51eae6049b309..71fa50b75f5d6 100644 --- a/x-pack/plugins/synthetics/public/state/reducers/monitor_duration.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_duration.ts @@ -11,7 +11,7 @@ import { getMonitorDurationActionSuccess, getMonitorDurationActionFail, } from '../actions'; -import { MonitorDurationResult } from '../../../common/types'; +import { MonitorDurationResult } from '../../../../common/types'; export interface MonitorDuration { durationLines: MonitorDurationResult | null; diff --git a/x-pack/plugins/synthetics/public/state/reducers/monitor_list.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_list.ts similarity index 97% rename from x-pack/plugins/synthetics/public/state/reducers/monitor_list.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_list.ts index 3630842cb9f8f..6e325a699a114 100644 --- a/x-pack/plugins/synthetics/public/state/reducers/monitor_list.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_list.ts @@ -15,7 +15,7 @@ import { clearRefreshedMonitorId, setUpdatingMonitorId, } from '../actions'; -import { MonitorSummariesResult } from '../../../common/runtime_types'; +import { MonitorSummariesResult } from '../../../../common/runtime_types'; import { AppState } from '..'; import { TestNowResponse } from '../api'; diff --git a/x-pack/plugins/synthetics/public/state/reducers/monitor_management.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_management.ts similarity index 98% rename from x-pack/plugins/synthetics/public/state/reducers/monitor_management.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_management.ts index d60de74c1f54c..18c247a655275 100644 --- a/x-pack/plugins/synthetics/public/state/reducers/monitor_management.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_management.ts @@ -31,8 +31,8 @@ import { ServiceLocations, ThrottlingOptions, DEFAULT_THROTTLING, -} from '../../../common/runtime_types'; -import { SyntheticsServiceAllowed } from '../../../common/types'; +} from '../../../../common/runtime_types'; +import { SyntheticsServiceAllowed } from '../../../../common/types'; export interface MonitorManagementList { error: Record<'monitorList' | 'serviceLocations' | 'enablement', Error | null>; diff --git a/x-pack/plugins/synthetics/public/state/reducers/monitor_status.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_status.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/reducers/monitor_status.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_status.test.ts diff --git a/x-pack/plugins/synthetics/public/state/reducers/monitor_status.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_status.ts similarity index 96% rename from x-pack/plugins/synthetics/public/state/reducers/monitor_status.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_status.ts index b27de0d944a8e..cd32a410503a3 100644 --- a/x-pack/plugins/synthetics/public/state/reducers/monitor_status.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/monitor_status.ts @@ -11,7 +11,7 @@ import { getMonitorStatusActionSuccess, getMonitorStatusActionFail, } from '../actions'; -import { Ping } from '../../../common/runtime_types'; +import { Ping } from '../../../../common/runtime_types'; import { QueryParams } from '../actions/types'; export interface MonitorStatusState { diff --git a/x-pack/plugins/synthetics/public/state/reducers/network_events.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/network_events.ts similarity index 99% rename from x-pack/plugins/synthetics/public/state/reducers/network_events.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/network_events.ts index e58a8f75c7fa3..0abe4aeb2c7be 100644 --- a/x-pack/plugins/synthetics/public/state/reducers/network_events.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/network_events.ts @@ -6,7 +6,7 @@ */ import { handleActions, Action } from 'redux-actions'; -import { NetworkEvent, SyntheticsNetworkEventsApiResponse } from '../../../common/runtime_types'; +import { NetworkEvent, SyntheticsNetworkEventsApiResponse } from '../../../../common/runtime_types'; import { FetchNetworkEventsParams, FetchNetworkEventsFailPayload, diff --git a/x-pack/plugins/synthetics/public/state/reducers/ping.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/ping.ts similarity index 94% rename from x-pack/plugins/synthetics/public/state/reducers/ping.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/ping.ts index a91734d77b4ab..f156a5596a84e 100644 --- a/x-pack/plugins/synthetics/public/state/reducers/ping.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/ping.ts @@ -7,7 +7,7 @@ import { handleActions, Action } from 'redux-actions'; import { getPingHistogram } from '../actions'; -import { HistogramResult } from '../../../common/runtime_types'; +import { HistogramResult } from '../../../../common/runtime_types'; export interface PingState { pingHistogram: HistogramResult | null; diff --git a/x-pack/plugins/synthetics/public/state/reducers/ping_list.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/ping_list.ts similarity index 94% rename from x-pack/plugins/synthetics/public/state/reducers/ping_list.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/ping_list.ts index 09d9347cedd3b..4403c2484dedb 100644 --- a/x-pack/plugins/synthetics/public/state/reducers/ping_list.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/ping_list.ts @@ -6,7 +6,7 @@ */ import { handleActions, Action } from 'redux-actions'; -import { PingsResponse } from '../../../common/runtime_types'; +import { PingsResponse } from '../../../../common/runtime_types'; import { clearPings, getPings, getPingsSuccess, getPingsFail } from '../actions'; export interface PingListState { diff --git a/x-pack/plugins/synthetics/public/state/reducers/selected_filters.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/selected_filters.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/reducers/selected_filters.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/selected_filters.test.ts diff --git a/x-pack/plugins/synthetics/public/state/reducers/selected_filters.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/selected_filters.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/reducers/selected_filters.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/selected_filters.ts diff --git a/x-pack/plugins/synthetics/public/state/reducers/synthetics.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/synthetics.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/reducers/synthetics.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/synthetics.test.ts diff --git a/x-pack/plugins/synthetics/public/state/reducers/synthetics.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/synthetics.ts similarity index 99% rename from x-pack/plugins/synthetics/public/state/reducers/synthetics.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/synthetics.ts index 1e97c3972444b..2a0cf7188a9e8 100644 --- a/x-pack/plugins/synthetics/public/state/reducers/synthetics.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/synthetics.ts @@ -9,7 +9,7 @@ import { createAction, handleActions, Action } from 'redux-actions'; import { isScreenshotBlockDoc, ScreenshotBlockDoc, -} from '../../../common/runtime_types/ping/synthetics'; +} from '../../../../common/runtime_types/ping/synthetics'; export interface PendingBlock { status: 'pending' | 'loading'; diff --git a/x-pack/plugins/synthetics/public/state/reducers/test_now_runs.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/test_now_runs.ts similarity index 98% rename from x-pack/plugins/synthetics/public/state/reducers/test_now_runs.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/test_now_runs.ts index d081039e4d901..ffe49ff017259 100644 --- a/x-pack/plugins/synthetics/public/state/reducers/test_now_runs.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/test_now_runs.ts @@ -13,7 +13,7 @@ import { ScheduleUnit, ServiceLocationErrors, SyntheticsMonitorSchedule, -} from '../../../common/runtime_types'; +} from '../../../../common/runtime_types'; import { clearTestNowMonitorAction, testNowMonitorAction } from '../actions'; import { TestNowResponse } from '../api'; import { AppState } from '..'; diff --git a/x-pack/plugins/synthetics/public/state/reducers/types.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/types.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/reducers/types.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/types.ts diff --git a/x-pack/plugins/synthetics/public/state/reducers/ui.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/ui.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/reducers/ui.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/ui.test.ts diff --git a/x-pack/plugins/synthetics/public/state/reducers/ui.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/ui.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/reducers/ui.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/ui.ts diff --git a/x-pack/plugins/synthetics/public/state/reducers/utils.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/utils.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/reducers/utils.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/reducers/utils.ts diff --git a/x-pack/plugins/synthetics/public/state/selectors/index.test.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/selectors/index.test.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/selectors/index.test.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/selectors/index.test.ts diff --git a/x-pack/plugins/synthetics/public/state/selectors/index.ts b/x-pack/plugins/synthetics/public/legacy_uptime/state/selectors/index.ts similarity index 100% rename from x-pack/plugins/synthetics/public/state/selectors/index.ts rename to x-pack/plugins/synthetics/public/legacy_uptime/state/selectors/index.ts diff --git a/x-pack/plugins/synthetics/public/apps/plugin.ts b/x-pack/plugins/synthetics/public/plugin.ts similarity index 83% rename from x-pack/plugins/synthetics/public/apps/plugin.ts rename to x-pack/plugins/synthetics/public/plugin.ts index 7f1a773376688..88238b1bfbf37 100644 --- a/x-pack/plugins/synthetics/public/apps/plugin.ts +++ b/x-pack/plugins/synthetics/public/plugin.ts @@ -39,14 +39,17 @@ import { Start as InspectorPluginStart } from '@kbn/inspector-plugin/public'; import { CasesUiStart } from '@kbn/cases-plugin/public'; import { CloudSetup } from '@kbn/cloud-plugin/public'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; -import { PLUGIN } from '../../common/constants/plugin'; +import { PLUGIN } from '../common/constants/plugin'; import { LazySyntheticsPolicyCreateExtension, LazySyntheticsPolicyEditExtension, -} from '../components/fleet_package'; -import { LazySyntheticsCustomAssetsExtension } from '../components/fleet_package/lazy_synthetics_custom_assets_extension'; -import { uptimeOverviewNavigatorParams } from './locators/overview'; -import { alertTypeInitializers, legacyAlertTypeInitializers } from '../lib/alert_types'; +} from './legacy_uptime/components/fleet_package'; +import { LazySyntheticsCustomAssetsExtension } from './legacy_uptime/components/fleet_package/lazy_synthetics_custom_assets_extension'; +import { uptimeOverviewNavigatorParams } from './apps/locators/overview'; +import { + alertTypeInitializers, + legacyAlertTypeInitializers, +} from './legacy_uptime/lib/alert_types'; export interface ClientPluginsSetup { home?: HomePublicPluginSetup; @@ -100,7 +103,7 @@ export class UptimePlugin } const getUptimeDataHelper = async () => { const [coreStart] = await core.getStartServices(); - const { UptimeDataHelper } = await import('./uptime_overview_fetcher'); + const { UptimeDataHelper } = await import('./legacy_uptime/app/uptime_overview_fetcher'); return UptimeDataHelper(coreStart); }; @@ -186,27 +189,29 @@ export class UptimePlugin }); }); + const appKeywords = [ + 'Synthetics', + 'pings', + 'checks', + 'availability', + 'response duration', + 'response time', + 'outside in', + 'reachability', + 'reachable', + 'digital', + 'performance', + 'web performance', + 'web perf', + ]; + core.application.register({ id: PLUGIN.ID, euiIconType: 'logoObservability', order: 8400, title: PLUGIN.TITLE, category: DEFAULT_APP_CATEGORIES.observability, - keywords: [ - 'Synthetics', - 'pings', - 'checks', - 'availability', - 'response duration', - 'response time', - 'outside in', - 'reachability', - 'reachable', - 'digital', - 'performance', - 'web performance', - 'web perf', - ], + keywords: appKeywords, deepLinks: [ { id: 'Down monitors', title: 'Down monitors', path: '/?statusFilter=down' }, { id: 'Certificates', title: 'TLS Certificates', path: '/certificates' }, @@ -215,7 +220,24 @@ export class UptimePlugin mount: async (params: AppMountParameters) => { const [coreStart, corePlugins] = await core.getStartServices(); - const { renderApp } = await import('./render_app'); + const { renderApp } = await import('./legacy_uptime/app/render_app'); + return renderApp(coreStart, plugins, corePlugins, params, this.initContext.env.mode.dev); + }, + }); + + // Register the Synthetics UI plugin + core.application.register({ + id: 'synthetics', + euiIconType: 'logoObservability', + order: 8400, + title: PLUGIN.SYNTHETICS, + category: DEFAULT_APP_CATEGORIES.observability, + keywords: appKeywords, + deepLinks: [], + mount: async (params: AppMountParameters) => { + const [coreStart, corePlugins] = await core.getStartServices(); + + const { renderApp } = await import('./apps/synthetics/render_app'); return renderApp(coreStart, plugins, corePlugins, params, this.initContext.env.mode.dev); }, }); diff --git a/x-pack/plugins/synthetics/server/kibana.index.ts b/x-pack/plugins/synthetics/server/kibana.index.ts index 2791640115469..14ac9edd5ff2f 100644 --- a/x-pack/plugins/synthetics/server/kibana.index.ts +++ b/x-pack/plugins/synthetics/server/kibana.index.ts @@ -44,7 +44,7 @@ export const initServerWithKibana = ( name: PLUGIN.NAME, order: 1000, category: DEFAULT_APP_CATEGORIES.observability, - app: ['uptime', 'kibana'], + app: ['uptime', 'kibana', 'synthetics'], catalogue: ['uptime'], management: { insightsAndAlerting: ['triggersActions'], @@ -52,7 +52,7 @@ export const initServerWithKibana = ( alerting: UPTIME_RULE_TYPES, privileges: { all: { - app: ['uptime', 'kibana'], + app: ['uptime', 'kibana', 'synthetics'], catalogue: ['uptime'], api: ['uptime-read', 'uptime-write', 'lists-all'], savedObject: { @@ -73,7 +73,7 @@ export const initServerWithKibana = ( ui: ['save', 'configureSettings', 'show', 'alerting:save'], }, read: { - app: ['uptime', 'kibana'], + app: ['uptime', 'kibana', 'synthetics'], catalogue: ['uptime'], api: ['uptime-read', 'lists-read'], savedObject: { diff --git a/x-pack/plugins/synthetics/tsconfig.json b/x-pack/plugins/synthetics/tsconfig.json index 17088fe6f1fd9..023c98c66a4a5 100644 --- a/x-pack/plugins/synthetics/tsconfig.json +++ b/x-pack/plugins/synthetics/tsconfig.json @@ -10,7 +10,7 @@ "common/**/*", "scripts/**/*", "public/**/*", - "public/components/monitor/status_details/location_map/embeddables/low_poly_layer.json", + "public/legacy_uptime/components/monitor/status_details/location_map/embeddables/low_poly_layer.json", "server/**/*", "server/lib/requests/__fixtures__/monitor_charts_mock.json", "../../../typings/**/*" diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json index a361c5fef7a40..aac8d2e40f650 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -12812,98 +12812,6 @@ } } }, - "task_manager": { - "properties": { - "ephemeral_tasks_enabled": { - "type": "boolean" - }, - "ephemeral_request_capacity": { - "type": "short" - }, - "ephemeral_stats": { - "properties": { - "status": { - "type": "keyword" - }, - "queued_tasks": { - "properties": { - "p50": { - "type": "long" - }, - "p90": { - "type": "long" - }, - "p95": { - "type": "long" - }, - "p99": { - "type": "long" - } - } - }, - "load": { - "properties": { - "p50": { - "type": "long" - }, - "p90": { - "type": "long" - }, - "p95": { - "type": "long" - }, - "p99": { - "type": "long" - } - } - }, - "executions_per_cycle": { - "properties": { - "p50": { - "type": "long" - }, - "p90": { - "type": "long" - }, - "p95": { - "type": "long" - }, - "p99": { - "type": "long" - } - } - } - } - }, - "task_type_exclusion": { - "type": "array", - "items": { - "type": "keyword" - } - }, - "failed_tasks": { - "type": "long" - } - } - }, - "upgrade-assistant-telemetry": { - "properties": { - "features": { - "properties": { - "deprecation_logging": { - "properties": { - "enabled": { - "type": "boolean", - "_meta": { - "description": "Whether user has enabled Elasticsearch deprecation logging" - } - } - } - } - } - } - } - }, "uptime": { "properties": { "last_24_hours": { @@ -13044,6 +12952,98 @@ } } } + }, + "task_manager": { + "properties": { + "ephemeral_tasks_enabled": { + "type": "boolean" + }, + "ephemeral_request_capacity": { + "type": "short" + }, + "ephemeral_stats": { + "properties": { + "status": { + "type": "keyword" + }, + "queued_tasks": { + "properties": { + "p50": { + "type": "long" + }, + "p90": { + "type": "long" + }, + "p95": { + "type": "long" + }, + "p99": { + "type": "long" + } + } + }, + "load": { + "properties": { + "p50": { + "type": "long" + }, + "p90": { + "type": "long" + }, + "p95": { + "type": "long" + }, + "p99": { + "type": "long" + } + } + }, + "executions_per_cycle": { + "properties": { + "p50": { + "type": "long" + }, + "p90": { + "type": "long" + }, + "p95": { + "type": "long" + }, + "p99": { + "type": "long" + } + } + } + } + }, + "task_type_exclusion": { + "type": "array", + "items": { + "type": "keyword" + } + }, + "failed_tasks": { + "type": "long" + } + } + }, + "upgrade-assistant-telemetry": { + "properties": { + "features": { + "properties": { + "deprecation_logging": { + "properties": { + "enabled": { + "type": "boolean", + "_meta": { + "description": "Whether user has enabled Elasticsearch deprecation logging" + } + } + } + } + } + } + } } } } diff --git a/x-pack/test/functional/apps/uptime/feature_controls/uptime_security.ts b/x-pack/test/functional/apps/uptime/feature_controls/uptime_security.ts index 4d4acbe6242ba..b90337c3648b2 100644 --- a/x-pack/test/functional/apps/uptime/feature_controls/uptime_security.ts +++ b/x-pack/test/functional/apps/uptime/feature_controls/uptime_security.ts @@ -71,6 +71,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { 'Overview', 'Alerts', 'Uptime', + 'Synthetics', 'Stack Management', ]); }); @@ -123,7 +124,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('shows uptime navlink', async () => { const navLinks = (await appsMenu.readLinks()).map((link) => link.text); - expect(navLinks).to.eql(['Overview', 'Alerts', 'Uptime', 'Stack Management']); + expect(navLinks).to.eql(['Overview', 'Alerts', 'Uptime', 'Synthetics', 'Stack Management']); }); it('can navigate to Uptime app', async () => { From 578364c76712e7997b860b9e7fa6c80a6a443aac Mon Sep 17 00:00:00 2001 From: Paul Tavares <56442535+paul-tavares@users.noreply.github.com> Date: Fri, 29 Apr 2022 17:19:03 -0400 Subject: [PATCH 16/18] [Security Solution][Endpoint] Fix error while checking `agent.version` compatibility for host Isolation that causes Security Solution app to crash (#131272) * Only parse version for Endpoint Alerts * isVersionSupported(): catch exceptions, log it and return false if version checking fails --- .../service/host_isolation/utils.test.ts | 3 +++ .../endpoint/service/host_isolation/utils.ts | 16 ++++++++++++++-- .../host_isolation/use_host_isolation_action.tsx | 14 +++++++++----- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/security_solution/common/endpoint/service/host_isolation/utils.test.ts b/x-pack/plugins/security_solution/common/endpoint/service/host_isolation/utils.test.ts index 8b72fe5deb8f6..48928fb435fec 100644 --- a/x-pack/plugins/security_solution/common/endpoint/service/host_isolation/utils.test.ts +++ b/x-pack/plugins/security_solution/common/endpoint/service/host_isolation/utils.test.ts @@ -8,6 +8,7 @@ import { isVersionSupported, isOsSupported, isIsolationSupported } from './utils'; describe('Host Isolation utils isVersionSupported', () => { + // NOTE: the `7.15.0.8295.0` and the text current versions are invalid. test.each` currentVersion | minVersionRequired | expected ${'8.14.0'} | ${'7.13.0'} | ${true} @@ -22,6 +23,8 @@ describe('Host Isolation utils isVersionSupported', () => { ${'7.14.0-alpha'} | ${'7.14.0'} | ${true} ${'8.0.0-SNAPSHOT'} | ${'7.14.0'} | ${true} ${'8.0.0'} | ${'7.14.0'} | ${true} + ${'7.15.0.8295.0'} | ${'7.14.0'} | ${false} + ${'NOT_SEMVER'} | ${'7.14.0'} | ${false} `( 'should validate that version $a is compatible($expected) to $b', ({ currentVersion, minVersionRequired, expected }) => { diff --git a/x-pack/plugins/security_solution/common/endpoint/service/host_isolation/utils.ts b/x-pack/plugins/security_solution/common/endpoint/service/host_isolation/utils.ts index d012ddfda15ba..0e9404f250786 100644 --- a/x-pack/plugins/security_solution/common/endpoint/service/host_isolation/utils.ts +++ b/x-pack/plugins/security_solution/common/endpoint/service/host_isolation/utils.ts @@ -26,8 +26,20 @@ export const isVersionSupported = ({ currentVersion: string; minVersionRequired?: string; }) => { - const parsedCurrentVersion = parseSemver(currentVersion); - return semverLte(minVersionRequired, parsedCurrentVersion); + // `parseSemver()` will throw if the version provided is not a valid semver value. + // If that happens, then just return false from this function + try { + const parsedCurrentVersion = parseSemver(currentVersion); + return semverLte(minVersionRequired, parsedCurrentVersion); + } catch (e) { + // If running in the browser, log to console + if (window && window.console) { + window.console.warn( + `SecuritySolution: isVersionSupported(): Unable to determine if current version [${currentVersion}] meets minimum version [${minVersionRequired}]. Error: ${e.message}` + ); + } + return false; + } }; export const isOsSupported = ({ diff --git a/x-pack/plugins/security_solution/public/detections/components/host_isolation/use_host_isolation_action.tsx b/x-pack/plugins/security_solution/public/detections/components/host_isolation/use_host_isolation_action.tsx index 57d81d48fca05..62debf400a387 100644 --- a/x-pack/plugins/security_solution/public/detections/components/host_isolation/use_host_isolation_action.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/host_isolation/use_host_isolation_action.tsx @@ -56,11 +56,15 @@ export const useHostIsolationAction = ({ agentId, }); - const isolationSupported = isIsolationSupported({ - osName: hostOsFamily, - version: agentVersion, - capabilities, - }); + const isolationSupported = useMemo(() => { + return isEndpointAlert + ? isIsolationSupported({ + osName: hostOsFamily, + version: agentVersion, + capabilities, + }) + : false; + }, [agentVersion, capabilities, hostOsFamily, isEndpointAlert]); const isIsolationAllowed = useUserPrivileges().endpointPrivileges.canIsolateHost; From 7cc364a2f1ecf8f45938bdbab9ecc46f691f3397 Mon Sep 17 00:00:00 2001 From: Candace Park <56409205+parkiino@users.noreply.github.com> Date: Sat, 30 Apr 2022 01:40:06 -0400 Subject: [PATCH 17/18] [Security Solution][Admin][Endpoint Generator] Endpoint generator uses correct merge to preserve array values (#131273) --- .../endpoint/data_loaders/index_endpoint_hosts.ts | 14 +++++++------- .../common/endpoint/data_loaders/utils.ts | 12 ++++++++++++ .../common/endpoint/index_data.ts | 4 ++-- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hosts.ts b/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hosts.ts index 7d9d08021fe54..2f304351dc435 100644 --- a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hosts.ts +++ b/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hosts.ts @@ -6,7 +6,7 @@ */ import { Client } from '@elastic/elasticsearch'; -import { cloneDeep, merge } from 'lodash'; +import { cloneDeep } from 'lodash'; import { AxiosResponse } from 'axios'; import uuid from 'uuid'; // eslint-disable-next-line import/no-extraneous-dependencies @@ -35,7 +35,7 @@ import { indexFleetEndpointPolicy, } from './index_fleet_endpoint_policy'; import { metadataCurrentIndexPattern } from '../constants'; -import { EndpointDataLoadingError, wrapErrorAndRejectPromise } from './utils'; +import { EndpointDataLoadingError, mergeAndAppendArrays, wrapErrorAndRejectPromise } from './utils'; export interface IndexedHostsResponse extends IndexedFleetAgentResponse, @@ -141,7 +141,7 @@ export async function indexEndpointHostDocs({ epmEndpointPackage.version ); - merge(response, createdPolicies); + mergeAndAppendArrays(response, createdPolicies); // eslint-disable-next-line require-atomic-updates realPolicies[appliedPolicyId] = createdPolicies.integrationPolicies[0]; @@ -160,7 +160,7 @@ export async function indexEndpointHostDocs({ ); enrolledAgent = indexedAgentResponse.agents[0]; - merge(response, indexedAgentResponse); + mergeAndAppendArrays(response, indexedAgentResponse); } // Update the Host metadata record with the ID of the "real" policy along with the enrolled agent id hostMetadata = { @@ -317,9 +317,9 @@ export const deleteIndexedEndpointHosts = async ( .catch(wrapErrorAndRejectPromise); } - merge(response, await deleteIndexedFleetAgents(esClient, indexedData)); - merge(response, await deleteIndexedEndpointAndFleetActions(esClient, indexedData)); - merge(response, await deleteIndexedFleetEndpointPolicies(kbnClient, indexedData)); + mergeAndAppendArrays(response, await deleteIndexedFleetAgents(esClient, indexedData)); + mergeAndAppendArrays(response, await deleteIndexedEndpointAndFleetActions(esClient, indexedData)); + mergeAndAppendArrays(response, await deleteIndexedFleetEndpointPolicies(kbnClient, indexedData)); return response; }; diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/utils.ts b/x-pack/plugins/security_solution/common/endpoint/data_loaders/utils.ts index 80a7699e51cf8..fcba3a522a522 100644 --- a/x-pack/plugins/security_solution/common/endpoint/data_loaders/utils.ts +++ b/x-pack/plugins/security_solution/common/endpoint/data_loaders/utils.ts @@ -5,6 +5,8 @@ * 2.0. */ +import { mergeWith } from 'lodash'; + export class EndpointDataLoadingError extends Error { constructor(message: string, public meta?: unknown) { super(message); @@ -18,3 +20,13 @@ export const wrapErrorIfNeeded = (error: Error): EndpointDataLoadingError => // Use it in Promise's `.catch()` as `.catch(wrapErrorAndRejectPromise)` export const wrapErrorAndRejectPromise = (error: Error) => Promise.reject(wrapErrorIfNeeded(error)); + +export const mergeAndAppendArrays = (destinationObj: T, srcObj: S): T => { + const customizer = (objValue: T[keyof T], srcValue: S[keyof S]) => { + if (Array.isArray(objValue)) { + return objValue.concat(srcValue); + } + }; + + return mergeWith(destinationObj, srcObj, customizer); +}; diff --git a/x-pack/plugins/security_solution/common/endpoint/index_data.ts b/x-pack/plugins/security_solution/common/endpoint/index_data.ts index a783c523f07b0..e063f9695e7ed 100644 --- a/x-pack/plugins/security_solution/common/endpoint/index_data.ts +++ b/x-pack/plugins/security_solution/common/endpoint/index_data.ts @@ -10,7 +10,6 @@ import seedrandom from 'seedrandom'; // eslint-disable-next-line import/no-extraneous-dependencies import { KbnClient } from '@kbn/test'; import { AxiosResponse } from 'axios'; -import { merge } from 'lodash'; import { CreatePackagePolicyResponse, EPM_API_ROUTES, @@ -26,6 +25,7 @@ import { import { enableFleetServerIfNecessary } from './data_loaders/index_fleet_server'; import { indexAlerts } from './data_loaders/index_alerts'; import { setupFleetForEndpoint } from './data_loaders/setup_fleet_for_endpoint'; +import { mergeAndAppendArrays } from './data_loaders/utils'; export type IndexedHostsAndAlertsResponse = IndexedHostsResponse; @@ -105,7 +105,7 @@ export async function indexHostsAndAlerts( generator, }); - merge(response, indexedHosts); + mergeAndAppendArrays(response, indexedHosts); await indexAlerts({ client, From 0716332459c3760bd7f8d57e8b25f4b4108862db Mon Sep 17 00:00:00 2001 From: CohenIdo <90558359+CohenIdo@users.noreply.github.com> Date: Sun, 1 May 2022 18:07:44 +0300 Subject: [PATCH 18/18] [Cloud Security]Update package name (#131137) --- .../common/constants.ts | 20 +++++++++---------- .../api/use_cis_kubernetes_integration.tsx | 4 ++-- .../create_transforms_indices.ts | 10 +++++----- .../benchmark_score_transform.ts | 8 ++++---- .../latest_findings_transform.ts | 4 ++-- .../fleet_integration.test.ts | 4 ++-- .../fleet_integration/fleet_integration.ts | 4 ++-- .../server/plugin.test.ts | 4 ++-- .../cloud_security_posture/server/plugin.ts | 8 ++++---- .../server/routes/benchmarks/benchmarks.ts | 7 +++++-- .../compliance_dashboard.ts | 4 ++-- .../routes/compliance_dashboard/get_trends.ts | 4 ++-- .../update_rules_configuration.ts | 4 ++-- 13 files changed, 43 insertions(+), 42 deletions(-) diff --git a/x-pack/plugins/cloud_security_posture/common/constants.ts b/x-pack/plugins/cloud_security_posture/common/constants.ts index cbb283d73137b..a64a2604609ff 100644 --- a/x-pack/plugins/cloud_security_posture/common/constants.ts +++ b/x-pack/plugins/cloud_security_posture/common/constants.ts @@ -11,19 +11,17 @@ export const BENCHMARKS_ROUTE_PATH = '/internal/cloud_security_posture/benchmark export const UPDATE_RULES_CONFIG_ROUTE_PATH = '/internal/cloud_security_posture/update_rules_config'; -export const CSP_FINDINGS_INDEX_NAME = 'findings'; -export const CIS_KUBERNETES_PACKAGE_NAME = 'cis_kubernetes_benchmark'; -export const FINDINGS_DATA_STREAM_NAME = - // Currently 'cis_kubernetes_benchmark.findings', To be refactored to 'cloud_security_posture.findings' - CIS_KUBERNETES_PACKAGE_NAME + '.' + CSP_FINDINGS_INDEX_NAME; -export const LATEST_FINDINGS_INDEX_NAME = 'cloud_security_posture.findings_latest'; -export const BENCHMARK_SCORE_INDEX_NAME = 'cloud_security_posture.scores'; +export const CLOUD_SECURITY_POSTURE_PACKAGE_NAME = 'cloud_security_posture'; -export const AGENT_LOGS_INDEX_PATTERN = '.logs-cis_kubernetes_benchmark.metadata*'; +export const AGENT_LOGS_INDEX_PATTERN = '.logs-cloud_security_posture.metadata*'; export const CSP_LATEST_FINDINGS_DATA_VIEW = 'logs-cloud_security_posture.findings_latest-*'; -export const FINDINGS_INDEX_PATTERN = 'logs-' + FINDINGS_DATA_STREAM_NAME + '-default*'; -export const LATEST_FINDINGS_INDEX_PATTERN = 'logs-' + LATEST_FINDINGS_INDEX_NAME + '-default'; -export const BENCHMARK_SCORE_INDEX_PATTERN = 'logs-' + BENCHMARK_SCORE_INDEX_NAME + '-default'; +export const FINDINGS_INDEX_PATTERN = 'logs-cloud_security_posture.findings-default*'; + +export const LATEST_FINDINGS_INDEX_NAME = 'cloud_security_posture.findings_latest'; +export const LATEST_FINDINGS_INDEX_DEFAULT_NS = 'logs-' + LATEST_FINDINGS_INDEX_NAME + '-default'; + +export const BENCHMARK_SCORE_INDEX_NAME = 'cloud_security_posture.scores'; +export const BENCHMARK_SCORE_INDEX_DEFAULT_NS = 'logs-' + BENCHMARK_SCORE_INDEX_NAME + '-default'; export const RULE_PASSED = `passed`; export const RULE_FAILED = `failed`; diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx b/x-pack/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx index 0a9f2c2134a6e..5660080cb0a43 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx +++ b/x-pack/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx @@ -11,7 +11,7 @@ import { type GetInfoResponse, type DefaultPackagesInstallationError, } from '@kbn/fleet-plugin/common'; -import { CIS_KUBERNETES_PACKAGE_NAME } from '../../../common/constants'; +import { CLOUD_SECURITY_POSTURE_PACKAGE_NAME } from '../../../common/constants'; import { useKibana } from '../hooks/use_kibana'; /** @@ -21,7 +21,7 @@ export const useCisKubernetesIntegration = () => { const { http } = useKibana().services; return useQuery(['integrations'], () => - http.get(epmRouteService.getInfoPath(CIS_KUBERNETES_PACKAGE_NAME), { + http.get(epmRouteService.getInfoPath(CLOUD_SECURITY_POSTURE_PACKAGE_NAME), { query: { experimental: true }, }) ); diff --git a/x-pack/plugins/cloud_security_posture/server/create_indices/create_transforms_indices.ts b/x-pack/plugins/cloud_security_posture/server/create_indices/create_transforms_indices.ts index c30bf09a60e0f..32d53b0a89695 100644 --- a/x-pack/plugins/cloud_security_posture/server/create_indices/create_transforms_indices.ts +++ b/x-pack/plugins/cloud_security_posture/server/create_indices/create_transforms_indices.ts @@ -10,9 +10,9 @@ import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import { benchmarkScoreMapping } from './benchmark_score_mapping'; import { latestFindingsMapping } from './latest_findings_mapping'; import { - LATEST_FINDINGS_INDEX_PATTERN, + LATEST_FINDINGS_INDEX_DEFAULT_NS, LATEST_FINDINGS_INDEX_NAME, - BENCHMARK_SCORE_INDEX_PATTERN, + BENCHMARK_SCORE_INDEX_DEFAULT_NS, BENCHMARK_SCORE_INDEX_NAME, } from '../../common/constants'; @@ -25,14 +25,14 @@ export const initializeCspTransformsIndices = async ( createIndexIfNotExists( esClient, LATEST_FINDINGS_INDEX_NAME, - LATEST_FINDINGS_INDEX_PATTERN, + LATEST_FINDINGS_INDEX_DEFAULT_NS, latestFindingsMapping, logger ), createIndexIfNotExists( esClient, BENCHMARK_SCORE_INDEX_NAME, - BENCHMARK_SCORE_INDEX_PATTERN, + BENCHMARK_SCORE_INDEX_DEFAULT_NS, benchmarkScoreMapping, logger ), @@ -65,7 +65,7 @@ export const createIndexIfNotExists = async ( } } catch (err) { const error = transformError(err); - logger.error(`Failed to create ${LATEST_FINDINGS_INDEX_PATTERN}`); + logger.error(`Failed to create ${LATEST_FINDINGS_INDEX_DEFAULT_NS}`); logger.error(error.message); } }; diff --git a/x-pack/plugins/cloud_security_posture/server/create_transforms/benchmark_score_transform.ts b/x-pack/plugins/cloud_security_posture/server/create_transforms/benchmark_score_transform.ts index 8837fea0fa183..19528d42f09af 100644 --- a/x-pack/plugins/cloud_security_posture/server/create_transforms/benchmark_score_transform.ts +++ b/x-pack/plugins/cloud_security_posture/server/create_transforms/benchmark_score_transform.ts @@ -7,18 +7,18 @@ import type { TransformPutTransformRequest } from '@elastic/elasticsearch/lib/api/types'; import { - LATEST_FINDINGS_INDEX_PATTERN, - BENCHMARK_SCORE_INDEX_PATTERN, + LATEST_FINDINGS_INDEX_DEFAULT_NS, + BENCHMARK_SCORE_INDEX_DEFAULT_NS, } from '../../common/constants'; export const benchmarkScoreTransform: TransformPutTransformRequest = { transform_id: 'cloud_security_posture.score-default-0.0.1', description: 'Calculate latest findings score', source: { - index: LATEST_FINDINGS_INDEX_PATTERN, + index: LATEST_FINDINGS_INDEX_DEFAULT_NS, }, dest: { - index: BENCHMARK_SCORE_INDEX_PATTERN, + index: BENCHMARK_SCORE_INDEX_DEFAULT_NS, }, frequency: '30m', sync: { diff --git a/x-pack/plugins/cloud_security_posture/server/create_transforms/latest_findings_transform.ts b/x-pack/plugins/cloud_security_posture/server/create_transforms/latest_findings_transform.ts index fc042149f3193..fb8027a7675d2 100644 --- a/x-pack/plugins/cloud_security_posture/server/create_transforms/latest_findings_transform.ts +++ b/x-pack/plugins/cloud_security_posture/server/create_transforms/latest_findings_transform.ts @@ -5,7 +5,7 @@ * 2.0. */ import type { TransformPutTransformRequest } from '@elastic/elasticsearch/lib/api/types'; -import { FINDINGS_INDEX_PATTERN, LATEST_FINDINGS_INDEX_PATTERN } from '../../common/constants'; +import { FINDINGS_INDEX_PATTERN, LATEST_FINDINGS_INDEX_DEFAULT_NS } from '../../common/constants'; export const latestFindingsTransform: TransformPutTransformRequest = { transform_id: 'cloud_security_posture.findings_latest-default-0.0.1', @@ -14,7 +14,7 @@ export const latestFindingsTransform: TransformPutTransformRequest = { index: FINDINGS_INDEX_PATTERN, }, dest: { - index: LATEST_FINDINGS_INDEX_PATTERN, + index: LATEST_FINDINGS_INDEX_DEFAULT_NS, }, frequency: '5m', sync: { diff --git a/x-pack/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.test.ts b/x-pack/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.test.ts index 8872c359fc770..69e13ab8c5065 100644 --- a/x-pack/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.test.ts +++ b/x-pack/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.test.ts @@ -8,7 +8,7 @@ import { loggingSystemMock, savedObjectsClientMock } from '@kbn/core/server/mocks'; import { SavedObjectsClientContract, SavedObjectsFindResponse } from '@kbn/core/server'; import { createPackagePolicyMock } from '@kbn/fleet-plugin/common/mocks'; -import { CIS_KUBERNETES_PACKAGE_NAME } from '../../common/constants'; +import { CLOUD_SECURITY_POSTURE_PACKAGE_NAME } from '../../common/constants'; import { onPackagePolicyPostCreateCallback } from './fleet_integration'; describe('create CSP rules with post package create callback', () => { @@ -40,7 +40,7 @@ describe('create CSP rules with post package create callback', () => { }); it('should create stateful rules based on rule template', async () => { const mockPackagePolicy = createPackagePolicyMock(); - mockPackagePolicy.package!.name = CIS_KUBERNETES_PACKAGE_NAME; + mockPackagePolicy.package!.name = CLOUD_SECURITY_POSTURE_PACKAGE_NAME; mockSoClient.find.mockResolvedValueOnce({ saved_objects: [ { diff --git a/x-pack/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.ts b/x-pack/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.ts index 4693a3e55337b..da45a53256bde 100644 --- a/x-pack/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.ts +++ b/x-pack/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.ts @@ -17,7 +17,7 @@ import { cloudSecurityPostureRuleTemplateSavedObjectType, CloudSecurityPostureRuleTemplateSchema, } from '../../common/schemas/csp_rule_template'; -import { CIS_KUBERNETES_PACKAGE_NAME } from '../../common/constants'; +import { CLOUD_SECURITY_POSTURE_PACKAGE_NAME } from '../../common/constants'; import { CspRuleSchema, cspRuleAssetSavedObjectType } from '../../common/schemas/csp_rule'; type ArrayElement = ArrayType extends ReadonlyArray< @@ -29,7 +29,7 @@ type ArrayElement = ArrayType extends Read const isCspPackagePolicy = ( packagePolicy: T ): boolean => { - return packagePolicy.package?.name === CIS_KUBERNETES_PACKAGE_NAME; + return packagePolicy.package?.name === CLOUD_SECURITY_POSTURE_PACKAGE_NAME; }; /** diff --git a/x-pack/plugins/cloud_security_posture/server/plugin.test.ts b/x-pack/plugins/cloud_security_posture/server/plugin.test.ts index 79ff710fd5c2c..43dc550a677a9 100644 --- a/x-pack/plugins/cloud_security_posture/server/plugin.test.ts +++ b/x-pack/plugins/cloud_security_posture/server/plugin.test.ts @@ -24,7 +24,7 @@ import { FleetStartContract, PostPackagePolicyPostCreateCallback, } from '@kbn/fleet-plugin/server'; -import { CIS_KUBERNETES_PACKAGE_NAME } from '../common/constants'; +import { CLOUD_SECURITY_POSTURE_PACKAGE_NAME } from '../common/constants'; import Chance from 'chance'; import type { AwaitedProperties } from '@kbn/utility-types'; import type { DeeplyMockedKeys } from '@kbn/utility-types/jest'; @@ -131,7 +131,7 @@ describe('Cloud Security Posture Plugin', () => { ); const packageMock = createPackagePolicyMock(); - packageMock.package!.name = CIS_KUBERNETES_PACKAGE_NAME; + packageMock.package!.name = CLOUD_SECURITY_POSTURE_PACKAGE_NAME; const packagePolicyPostCreateCallbacks: PostPackagePolicyPostCreateCallback[] = []; fleetMock.registerExternalCallback.mockImplementation((...args) => { diff --git a/x-pack/plugins/cloud_security_posture/server/plugin.ts b/x-pack/plugins/cloud_security_posture/server/plugin.ts index 5647a9adcd0cc..d9fdea9488036 100755 --- a/x-pack/plugins/cloud_security_posture/server/plugin.ts +++ b/x-pack/plugins/cloud_security_posture/server/plugin.ts @@ -33,7 +33,7 @@ import { onPackagePolicyPostCreateCallback, onPackagePolicyDeleteCallback, } from './fleet_integration/fleet_integration'; -import { CIS_KUBERNETES_PACKAGE_NAME } from '../common/constants'; +import { CLOUD_SECURITY_POSTURE_PACKAGE_NAME } from '../common/constants'; export interface CspAppContext { logger: Logger; @@ -84,7 +84,7 @@ export class CspPlugin plugins.fleet.fleetSetupCompleted().then(async () => { const packageInfo = await plugins.fleet.packageService.asInternalUser.getInstallation( - CIS_KUBERNETES_PACKAGE_NAME + CLOUD_SECURITY_POSTURE_PACKAGE_NAME ); // If package is installed we want to make sure all needed assets are installed @@ -100,7 +100,7 @@ export class CspPlugin context: RequestHandlerContext, _: KibanaRequest ): Promise => { - if (packagePolicy.package?.name === CIS_KUBERNETES_PACKAGE_NAME) { + if (packagePolicy.package?.name === CLOUD_SECURITY_POSTURE_PACKAGE_NAME) { await this.initialize(core); const soClient = (await context.core).savedObjects.client; await onPackagePolicyPostCreateCallback(this.logger, packagePolicy, soClient); @@ -114,7 +114,7 @@ export class CspPlugin 'postPackagePolicyDelete', async (deletedPackagePolicies: DeepReadonly) => { for (const deletedPackagePolicy of deletedPackagePolicies) { - if (deletedPackagePolicy.package?.name === CIS_KUBERNETES_PACKAGE_NAME) { + if (deletedPackagePolicy.package?.name === CLOUD_SECURITY_POSTURE_PACKAGE_NAME) { await onPackagePolicyDeleteCallback( this.logger, deletedPackagePolicy, diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts index 2112701f42d4a..a2cb7d06f1f58 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts @@ -19,7 +19,10 @@ import type { AgentPolicy, ListResult, } from '@kbn/fleet-plugin/common'; -import { BENCHMARKS_ROUTE_PATH, CIS_KUBERNETES_PACKAGE_NAME } from '../../../common/constants'; +import { + BENCHMARKS_ROUTE_PATH, + CLOUD_SECURITY_POSTURE_PACKAGE_NAME, +} from '../../../common/constants'; import { BENCHMARK_PACKAGE_POLICY_PREFIX, benchmarksInputSchema, @@ -165,7 +168,7 @@ export const defineGetBenchmarksRoute = (router: CspRouter, cspContext: CspAppCo const packagePolicies = await getPackagePolicies( soClient, packagePolicyService, - CIS_KUBERNETES_PACKAGE_NAME, + CLOUD_SECURITY_POSTURE_PACKAGE_NAME, query ); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts index 9fdea8e97938f..1a95737df0ad9 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts @@ -8,7 +8,7 @@ import { transformError } from '@kbn/securitysolution-es-utils'; import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; import type { ComplianceDashboardData } from '../../../common/types'; -import { LATEST_FINDINGS_INDEX_PATTERN, STATS_ROUTE_PATH } from '../../../common/constants'; +import { LATEST_FINDINGS_INDEX_DEFAULT_NS, STATS_ROUTE_PATH } from '../../../common/constants'; import { CspAppContext } from '../../plugin'; import { getGroupedFindingsEvaluation } from './get_grouped_findings_evaluation'; import { ClusterWithoutTrend, getClusters } from './get_clusters'; @@ -47,7 +47,7 @@ export const defineGetComplianceDashboardRoute = ( const esClient = (await context.core).elasticsearch.client.asCurrentUser; const { id: pitId } = await esClient.openPointInTime({ - index: LATEST_FINDINGS_INDEX_PATTERN, + index: LATEST_FINDINGS_INDEX_DEFAULT_NS, keep_alive: '30s', }); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.ts b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.ts index eba14cb8215c2..08d8cd3553fe2 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.ts @@ -6,7 +6,7 @@ */ import { ElasticsearchClient } from '@kbn/core/server'; -import { BENCHMARK_SCORE_INDEX_PATTERN } from '../../../common/constants'; +import { BENCHMARK_SCORE_INDEX_DEFAULT_NS } from '../../../common/constants'; import { Stats } from '../../../common/types'; import { calculatePostureScore } from './get_stats'; @@ -26,7 +26,7 @@ export interface ScoreTrendDoc { } export const getTrendsQuery = () => ({ - index: BENCHMARK_SCORE_INDEX_PATTERN, + index: BENCHMARK_SCORE_INDEX_DEFAULT_NS, size: 5, sort: '@timestamp:desc', }); diff --git a/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts b/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts index 7b9e63f8bd69e..ae43443f1571b 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts @@ -22,7 +22,7 @@ import { CspAppContext } from '../../plugin'; import { CspRulesConfigSchema } from '../../../common/schemas/csp_configuration'; import { CspRuleSchema, cspRuleAssetSavedObjectType } from '../../../common/schemas/csp_rule'; import { UPDATE_RULES_CONFIG_ROUTE_PATH } from '../../../common/constants'; -import { CIS_KUBERNETES_PACKAGE_NAME } from '../../../common/constants'; +import { CLOUD_SECURITY_POSTURE_PACKAGE_NAME } from '../../../common/constants'; import { CspRouter } from '../../types'; export const getPackagePolicy = async ( @@ -36,7 +36,7 @@ export const getPackagePolicy = async ( if (!packagePolicies || !packagePolicies[0].version) { throw new Error(`package policy Id '${packagePolicyId}' is not exist`); } - if (packagePolicies[0].package?.name !== CIS_KUBERNETES_PACKAGE_NAME) { + if (packagePolicies[0].package?.name !== CLOUD_SECURITY_POSTURE_PACKAGE_NAME) { // TODO: improve this validator to support any future CSP package throw new Error(`Package Policy Id '${packagePolicyId}' is not CSP package`); }