{icon}
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.tsx
index 896b8f8f5b4c7..818d06c55dd12 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/source_row/source_row.tsx
@@ -23,7 +23,7 @@ import {
EuiToolTip,
} from '@elastic/eui';
-import { EuiLink } from '../../../../shared/react_router_helpers';
+import { EuiLinkTo } from '../../../../shared/react_router_helpers';
import { SOURCE_STATUSES as statuses } from '../../../constants';
import { ContentSourceDetails } from '../../../types';
import { ADD_SOURCE_PATH, SOURCE_DETAILS_PATH, getContentSourcePath } from '../../../routes';
@@ -77,9 +77,9 @@ export const SourceRow: React.FC
= ({
const imageClass = classNames('source-row__icon', { 'source-row__icon--loading': isIndexing });
const fixLink = (
-
+
Fix
-
+
);
const remoteTooltip = (
@@ -159,13 +159,13 @@ export const SourceRow: React.FC = ({
{showFix && {fixLink}}
{showDetails && (
-
Details
-
+
)}
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_manager_modal.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_manager_modal.tsx
index 11c0430a8b429..c0f8bf57989ca 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_manager_modal.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_manager_modal.tsx
@@ -26,7 +26,7 @@ import {
EuiSpacer,
} from '@elastic/eui';
-import { EuiButton as EuiLinkButton } from '../../../../shared/react_router_helpers';
+import { EuiButtonTo } from '../../../../shared/react_router_helpers';
import { Group } from '../../../types';
import { ORG_SOURCES_PATH } from '../../../routes';
@@ -96,9 +96,9 @@ export const GroupManagerModal: React.FC = ({
const handleSelectAll = () => selectAll(allSelected ? [] : allItems);
const sourcesButton = (
-
+
{ADD_SOURCE_BUTTON_TEXT}
-
+
);
const emptyState = (
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row.tsx
index 5cebb96d00eb9..9d33f810edae6 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/components/group_row.tsx
@@ -13,7 +13,7 @@ import { i18n } from '@kbn/i18n';
import { EuiTableRow, EuiTableRowCell, EuiIcon } from '@elastic/eui';
import { TruncatedContent } from '../../../../shared/truncate';
-import { EuiLink } from '../../../../shared/react_router_helpers';
+import { EuiLinkTo } from '../../../../shared/react_router_helpers';
import { Group } from '../../../types';
@@ -64,9 +64,9 @@ export const GroupRow: React.FC = ({
-
+
-
+
{GROUP_UPDATED_TEXT}
@@ -93,9 +93,9 @@ export const GroupRow: React.FC = ({
)}
-
+
-
+
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups.test.tsx
index cc50c4d0af5c4..85175d156f886 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups.test.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups.test.tsx
@@ -27,7 +27,7 @@ import { TableFilters } from './components/table_filters';
import { DEFAULT_META } from '../../../shared/constants';
import { EuiFieldSearch, EuiLoadingSpinner } from '@elastic/eui';
-import { EuiButton as EuiLinkButton } from '../../../shared/react_router_helpers';
+import { EuiButtonTo } from '../../../shared/react_router_helpers';
const getSearchResults = jest.fn();
const openNewGroupModal = jest.fn();
@@ -138,7 +138,7 @@ describe('GroupOverview', () => {
const action = shallow();
expect(action.find('[data-test-subj="InviteUsersButton"]')).toHaveLength(1);
- expect(action.find(EuiLinkButton)).toHaveLength(1);
+ expect(action.find(EuiButtonTo)).toHaveLength(1);
});
it('does not render inviteUsersButton when federated auth', () => {
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups.tsx
index 4064391c09893..97647f149bc9b 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/groups/groups.tsx
@@ -10,7 +10,7 @@ import { useActions, useValues } from 'kea';
import { i18n } from '@kbn/i18n';
import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, EuiSpacer } from '@elastic/eui';
-import { EuiButton as EuiLinkButton } from '../../../shared/react_router_helpers';
+import { EuiButtonTo } from '../../../shared/react_router_helpers';
import { AppLogic } from '../../app_logic';
@@ -61,7 +61,7 @@ export const Groups: React.FC = () => {
if (newGroup && hasMessages) {
messages[0].description = (
- {
{i18n.translate('xpack.enterpriseSearch.workplaceSearch.groups.newGroup.action', {
defaultMessage: 'Manage Group',
})}
-
+
);
}
const clearFilters = hasFiltersSet && ;
const inviteUsersButton = !isFederatedAuth ? (
-
+
{i18n.translate('xpack.enterpriseSearch.workplaceSearch.groups.inviteUsers.action', {
defaultMessage: 'Invite users',
})}
-
+
) : null;
const headerAction = (
diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_steps.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_steps.tsx
index 7251461b848a4..ed5136a6f7a4e 100644
--- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_steps.tsx
+++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_steps.tsx
@@ -21,7 +21,7 @@ import {
EuiButtonEmptyProps,
EuiLinkProps,
} from '@elastic/eui';
-import sharedSourcesIcon from '../../components/shared/assets/share_circle.svg';
+import sharedSourcesIcon from '../../components/shared/assets/source_icons/share_circle.svg';
import { TelemetryLogic } from '../../../shared/telemetry';
import { getWorkplaceSearchUrl } from '../../../shared/enterprise_search_url';
import { ORG_SOURCES_PATH, USERS_PATH, ORG_SETTINGS_PATH } from '../../routes';
diff --git a/x-pack/plugins/fleet/server/routes/epm/handlers.ts b/x-pack/plugins/fleet/server/routes/epm/handlers.ts
index 1d221b8b1eead..ce03d0eeb3826 100644
--- a/x-pack/plugins/fleet/server/routes/epm/handlers.ts
+++ b/x-pack/plugins/fleet/server/routes/epm/handlers.ts
@@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { TypeOf } from '@kbn/config-schema';
-import { RequestHandler, CustomHttpResponseOptions } from 'src/core/server';
+import { RequestHandler, ResponseHeaders, KnownHeaders } from 'src/core/server';
import {
GetInfoResponse,
InstallPackageResponse,
@@ -103,15 +103,21 @@ export const getFileHandler: RequestHandler = {
+
+ const headersToProxy: KnownHeaders[] = ['content-type', 'cache-control'];
+ const proxiedHeaders = headersToProxy.reduce((headers, knownHeader) => {
+ const value = registryResponse.headers.get(knownHeader);
+ if (value !== null) {
+ headers[knownHeader] = value;
+ }
+ return headers;
+ }, {} as ResponseHeaders);
+
+ return response.custom({
body: registryResponse.body,
statusCode: registryResponse.status,
- };
- if (contentType !== null) {
- customResponseObj.headers = { 'Content-Type': contentType };
- }
- return response.custom(customResponseObj);
+ headers: proxiedHeaders,
+ });
} catch (error) {
return defaultIngestErrorHandler({ error, response });
}
diff --git a/x-pack/plugins/infra/common/http_api/inventory_meta_api.ts b/x-pack/plugins/infra/common/http_api/inventory_meta_api.ts
index 77de515c9cc46..43f3b2037e381 100644
--- a/x-pack/plugins/infra/common/http_api/inventory_meta_api.ts
+++ b/x-pack/plugins/infra/common/http_api/inventory_meta_api.ts
@@ -21,6 +21,7 @@ export const InventoryMetaResponseRT = rt.type({
export const InventoryMetaRequestRT = rt.type({
sourceId: rt.string,
nodeType: ItemTypeRT,
+ currentTime: rt.number,
});
export type InventoryMetaRequest = rt.TypeOf;
diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/layout.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/layout.tsx
index 92aa015113b2a..2e5ddab77d374 100644
--- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/layout.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/layout.tsx
@@ -124,7 +124,7 @@ export const Layout = () => {
<>
-
+
diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx
index e9ffc56d8c47f..7bcb1270c30a5 100644
--- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx
+++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx
@@ -54,11 +54,12 @@ const wrapToolbarItems = (
interface Props {
nodeType: InventoryItemType;
+ currentTime: number;
}
-export const Toolbar = ({ nodeType }: Props) => {
+export const Toolbar = ({ nodeType, currentTime }: Props) => {
const { sourceId } = useSourceContext();
- const { accounts, regions } = useInventoryMeta(sourceId, nodeType);
+ const { accounts, regions } = useInventoryMeta(sourceId, nodeType, currentTime);
const ToolbarItems = findToolbar(nodeType);
return wrapToolbarItems(ToolbarItems, accounts, regions);
};
diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_inventory_meta.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_inventory_meta.ts
index b038491690a13..01811eb21a110 100644
--- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_inventory_meta.ts
+++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_inventory_meta.ts
@@ -15,7 +15,11 @@ import {
} from '../../../../../common/http_api/inventory_meta_api';
import { InventoryItemType } from '../../../../../common/inventory_models/types';
-export function useInventoryMeta(sourceId: string, nodeType: InventoryItemType) {
+export function useInventoryMeta(
+ sourceId: string,
+ nodeType: InventoryItemType,
+ currentTime: number
+) {
const decodeResponse = (response: any) => {
return pipe(
InventoryMetaResponseRT.decode(response),
@@ -29,6 +33,7 @@ export function useInventoryMeta(sourceId: string, nodeType: InventoryItemType)
JSON.stringify({
sourceId,
nodeType,
+ currentTime,
}),
decodeResponse
);
diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_snaphot.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_snaphot.ts
index 0412b1b0defbf..4cfa8871b0dcc 100644
--- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_snaphot.ts
+++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_snaphot.ts
@@ -45,7 +45,7 @@ export function useSnapshot(
interval: '1m',
to: currentTime,
from: currentTime - 1200 * 1000,
- lookbackSize: 20,
+ lookbackSize: 5,
};
const { error, loading, response, makeRequest } = useHTTPRequest(
diff --git a/x-pack/plugins/infra/server/routes/inventory_metadata/index.ts b/x-pack/plugins/infra/server/routes/inventory_metadata/index.ts
index 8b5271cb960c1..c784aa0f7d20b 100644
--- a/x-pack/plugins/infra/server/routes/inventory_metadata/index.ts
+++ b/x-pack/plugins/infra/server/routes/inventory_metadata/index.ts
@@ -33,7 +33,7 @@ export const initInventoryMetaRoute = (libs: InfraBackendLibs) => {
},
async (requestContext, request, response) => {
try {
- const { sourceId, nodeType } = pipe(
+ const { sourceId, nodeType, currentTime } = pipe(
InventoryMetaRequestRT.decode(request.body),
fold(throwErrors(Boom.badRequest), identity)
);
@@ -42,11 +42,13 @@ export const initInventoryMetaRoute = (libs: InfraBackendLibs) => {
requestContext.core.savedObjects.client,
sourceId
);
+
const awsMetadata = await getCloudMetadata(
framework,
requestContext,
configuration,
- nodeType
+ nodeType,
+ currentTime
);
return response.ok({
diff --git a/x-pack/plugins/infra/server/routes/inventory_metadata/lib/get_cloud_metadata.ts b/x-pack/plugins/infra/server/routes/inventory_metadata/lib/get_cloud_metadata.ts
index b4288dae0c221..af9e9c5f57c5b 100644
--- a/x-pack/plugins/infra/server/routes/inventory_metadata/lib/get_cloud_metadata.ts
+++ b/x-pack/plugins/infra/server/routes/inventory_metadata/lib/get_cloud_metadata.ts
@@ -25,9 +25,18 @@ export const getCloudMetadata = async (
framework: KibanaFramework,
req: RequestHandlerContext,
sourceConfiguration: InfraSourceConfiguration,
- nodeType: InventoryItemType
+ nodeType: InventoryItemType,
+ currentTime: number
): Promise => {
const model = findInventoryModel(nodeType);
+ // Only run this for AWS modules, eventually we might have more.
+ if (model.requiredModule !== 'aws') {
+ return {
+ accounts: [],
+ projects: [],
+ regions: [],
+ };
+ }
const metricQuery = {
allowNoIndices: true,
@@ -36,7 +45,18 @@ export const getCloudMetadata = async (
body: {
query: {
bool: {
- must: [{ match: { 'event.module': model.requiredModule } }],
+ must: [
+ {
+ range: {
+ [sourceConfiguration.fields.timestamp]: {
+ gte: currentTime - 86400000, // 24 hours ago
+ lte: currentTime,
+ format: 'epoch_millis',
+ },
+ },
+ },
+ { match: { 'event.module': model.requiredModule } },
+ ],
},
},
size: 0,
diff --git a/x-pack/plugins/infra/server/routes/metrics_explorer/lib/find_interval_for_metrics.ts b/x-pack/plugins/infra/server/routes/metrics_explorer/lib/find_interval_for_metrics.ts
index 8ab0f4a44c85d..b3d960e30404f 100644
--- a/x-pack/plugins/infra/server/routes/metrics_explorer/lib/find_interval_for_metrics.ts
+++ b/x-pack/plugins/infra/server/routes/metrics_explorer/lib/find_interval_for_metrics.ts
@@ -34,7 +34,8 @@ export const findIntervalForMetrics = async (
const modules = await Promise.all(
fields.map(
- async (field) => await getDatasetForField(client, field as string, options.indexPattern)
+ async (field) =>
+ await getDatasetForField(client, field as string, options.indexPattern, options.timerange)
)
);
diff --git a/x-pack/plugins/infra/server/routes/metrics_explorer/lib/get_dataset_for_field.ts b/x-pack/plugins/infra/server/routes/metrics_explorer/lib/get_dataset_for_field.ts
index 85bb5b106c87c..15e6f7ba86d01 100644
--- a/x-pack/plugins/infra/server/routes/metrics_explorer/lib/get_dataset_for_field.ts
+++ b/x-pack/plugins/infra/server/routes/metrics_explorer/lib/get_dataset_for_field.ts
@@ -17,7 +17,8 @@ interface EventDatasetHit {
export const getDatasetForField = async (
client: ESSearchClient,
field: string,
- indexPattern: string
+ indexPattern: string,
+ timerange: { field: string; to: number; from: number }
) => {
const params = {
allowNoIndices: true,
@@ -25,9 +26,25 @@ export const getDatasetForField = async (
terminateAfter: 1,
index: indexPattern,
body: {
- query: { exists: { field } },
+ query: {
+ bool: {
+ filter: [
+ { exists: { field } },
+ {
+ range: {
+ [timerange.field]: {
+ gte: timerange.from,
+ lte: timerange.to,
+ format: 'epoch_millis',
+ },
+ },
+ },
+ ],
+ },
+ },
size: 1,
_source: ['event.dataset'],
+ sort: [{ [timerange.field]: { order: 'desc' } }],
},
};
diff --git a/x-pack/plugins/infra/server/routes/snapshot/lib/create_timerange_with_interval.ts b/x-pack/plugins/infra/server/routes/snapshot/lib/create_timerange_with_interval.ts
index 827e0901c1c01..833b5349f4b56 100644
--- a/x-pack/plugins/infra/server/routes/snapshot/lib/create_timerange_with_interval.ts
+++ b/x-pack/plugins/infra/server/routes/snapshot/lib/create_timerange_with_interval.ts
@@ -75,7 +75,10 @@ const aggregationsToModules = async (
const fields = await Promise.all(
uniqueFields.map(
async (field) =>
- await getDatasetForField(client, field as string, options.sourceConfiguration.metricAlias)
+ await getDatasetForField(client, field as string, options.sourceConfiguration.metricAlias, {
+ ...options.timerange,
+ field: options.sourceConfiguration.fields.timestamp,
+ })
)
);
return fields.filter((f) => f) as string[];
diff --git a/x-pack/plugins/infra/server/routes/snapshot/lib/get_nodes.ts b/x-pack/plugins/infra/server/routes/snapshot/lib/get_nodes.ts
index 9332d5aee1f52..7a2985188dccf 100644
--- a/x-pack/plugins/infra/server/routes/snapshot/lib/get_nodes.ts
+++ b/x-pack/plugins/infra/server/routes/snapshot/lib/get_nodes.ts
@@ -23,12 +23,11 @@ export const getNodes = async (
snapshotRequest
);
const metricsApiResponse = await queryAllData(client, metricsApiRequest);
- return copyMissingMetrics(
- transformMetricsApiResponseToSnapshotResponse(
- metricsApiRequest,
- snapshotRequest,
- source,
- metricsApiResponse
- )
+ const snapshotResponse = transformMetricsApiResponseToSnapshotResponse(
+ metricsApiRequest,
+ snapshotRequest,
+ source,
+ metricsApiResponse
);
+ return copyMissingMetrics(snapshotResponse);
};
diff --git a/x-pack/plugins/maps/common/descriptor_types/style_property_descriptor_types.ts b/x-pack/plugins/maps/common/descriptor_types/style_property_descriptor_types.ts
index 5aba9b06a6ccf..d52afebcaa254 100644
--- a/x-pack/plugins/maps/common/descriptor_types/style_property_descriptor_types.ts
+++ b/x-pack/plugins/maps/common/descriptor_types/style_property_descriptor_types.ts
@@ -174,18 +174,18 @@ export type SizeStylePropertyDescriptor =
};
export type VectorStylePropertiesDescriptor = {
- [VECTOR_STYLES.SYMBOLIZE_AS]?: SymbolizeAsStylePropertyDescriptor;
- [VECTOR_STYLES.FILL_COLOR]?: ColorStylePropertyDescriptor;
- [VECTOR_STYLES.LINE_COLOR]?: ColorStylePropertyDescriptor;
- [VECTOR_STYLES.LINE_WIDTH]?: SizeStylePropertyDescriptor;
- [VECTOR_STYLES.ICON]?: IconStylePropertyDescriptor;
- [VECTOR_STYLES.ICON_SIZE]?: SizeStylePropertyDescriptor;
- [VECTOR_STYLES.ICON_ORIENTATION]?: OrientationStylePropertyDescriptor;
- [VECTOR_STYLES.LABEL_TEXT]?: LabelStylePropertyDescriptor;
- [VECTOR_STYLES.LABEL_COLOR]?: ColorStylePropertyDescriptor;
- [VECTOR_STYLES.LABEL_SIZE]?: SizeStylePropertyDescriptor;
- [VECTOR_STYLES.LABEL_BORDER_COLOR]?: ColorStylePropertyDescriptor;
- [VECTOR_STYLES.LABEL_BORDER_SIZE]?: LabelBorderSizeStylePropertyDescriptor;
+ [VECTOR_STYLES.SYMBOLIZE_AS]: SymbolizeAsStylePropertyDescriptor;
+ [VECTOR_STYLES.FILL_COLOR]: ColorStylePropertyDescriptor;
+ [VECTOR_STYLES.LINE_COLOR]: ColorStylePropertyDescriptor;
+ [VECTOR_STYLES.LINE_WIDTH]: SizeStylePropertyDescriptor;
+ [VECTOR_STYLES.ICON]: IconStylePropertyDescriptor;
+ [VECTOR_STYLES.ICON_SIZE]: SizeStylePropertyDescriptor;
+ [VECTOR_STYLES.ICON_ORIENTATION]: OrientationStylePropertyDescriptor;
+ [VECTOR_STYLES.LABEL_TEXT]: LabelStylePropertyDescriptor;
+ [VECTOR_STYLES.LABEL_COLOR]: ColorStylePropertyDescriptor;
+ [VECTOR_STYLES.LABEL_SIZE]: SizeStylePropertyDescriptor;
+ [VECTOR_STYLES.LABEL_BORDER_COLOR]: ColorStylePropertyDescriptor;
+ [VECTOR_STYLES.LABEL_BORDER_SIZE]: LabelBorderSizeStylePropertyDescriptor;
};
export type StyleDescriptor = {
diff --git a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts
index 2ab8a70f2e4df..85391ea82cbf2 100644
--- a/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts
+++ b/x-pack/plugins/maps/public/classes/layers/blended_vector_layer/blended_vector_layer.ts
@@ -36,6 +36,7 @@ import {
LayerDescriptor,
VectorLayerDescriptor,
VectorSourceRequestMeta,
+ VectorStylePropertiesDescriptor,
} from '../../../../common/descriptor_types';
import { IVectorSource } from '../../sources/vector_source';
import { LICENSED_FEATURES } from '../../../licensed_features';
@@ -79,13 +80,15 @@ function getClusterStyleDescriptor(
clusterSource: ESGeoGridSource
): VectorStyleDescriptor {
const defaultDynamicProperties = getDefaultDynamicProperties();
- const clusterStyleDescriptor: VectorStyleDescriptor = {
+ const clusterStyleDescriptor: Omit & {
+ properties: Partial;
+ } = {
type: LAYER_STYLE_TYPE.VECTOR,
properties: {
[VECTOR_STYLES.LABEL_TEXT]: {
type: STYLE_TYPE.DYNAMIC,
options: {
- ...defaultDynamicProperties[VECTOR_STYLES.LABEL_TEXT]!.options,
+ ...defaultDynamicProperties[VECTOR_STYLES.LABEL_TEXT].options,
field: {
name: COUNT_PROP_NAME,
origin: FIELD_ORIGIN.SOURCE,
@@ -95,7 +98,7 @@ function getClusterStyleDescriptor(
[VECTOR_STYLES.ICON_SIZE]: {
type: STYLE_TYPE.DYNAMIC,
options: {
- ...(defaultDynamicProperties[VECTOR_STYLES.ICON_SIZE]!.options as SizeDynamicOptions),
+ ...(defaultDynamicProperties[VECTOR_STYLES.ICON_SIZE].options as SizeDynamicOptions),
field: {
name: COUNT_PROP_NAME,
origin: FIELD_ORIGIN.SOURCE,
@@ -157,7 +160,7 @@ function getClusterStyleDescriptor(
}
});
- return clusterStyleDescriptor;
+ return clusterStyleDescriptor as VectorStyleDescriptor;
}
export interface BlendedVectorLayerArguments {
diff --git a/x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts b/x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts
index cdfe60946f5f9..fa82b9dc3b542 100644
--- a/x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts
+++ b/x-pack/plugins/maps/public/classes/layers/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts
@@ -71,7 +71,7 @@ function createChoroplethLayerDescriptor({
[VECTOR_STYLES.FILL_COLOR]: {
type: STYLE_TYPE.DYNAMIC,
options: {
- ...(defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR]!.options as ColorDynamicOptions),
+ ...(defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR].options as ColorDynamicOptions),
field: {
name: joinKey,
origin: FIELD_ORIGIN.JOIN,
diff --git a/x-pack/plugins/maps/public/classes/layers/create_region_map_layer_descriptor.ts b/x-pack/plugins/maps/public/classes/layers/create_region_map_layer_descriptor.ts
index 6f9bb686459b5..5fa2524b1b790 100644
--- a/x-pack/plugins/maps/public/classes/layers/create_region_map_layer_descriptor.ts
+++ b/x-pack/plugins/maps/public/classes/layers/create_region_map_layer_descriptor.ts
@@ -100,7 +100,7 @@ export function createRegionMapLayerDescriptor({
[VECTOR_STYLES.FILL_COLOR]: {
type: STYLE_TYPE.DYNAMIC,
options: {
- ...(defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR]!.options as ColorDynamicOptions),
+ ...(defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR].options as ColorDynamicOptions),
field: {
name: joinKey,
origin: FIELD_ORIGIN.JOIN,
@@ -108,7 +108,7 @@ export function createRegionMapLayerDescriptor({
color: colorPallette ? colorPallette.value : 'Yellow to Red',
type: COLOR_MAP_TYPE.ORDINAL,
fieldMetaOptions: {
- ...(defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR]!.options as ColorDynamicOptions)
+ ...(defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR].options as ColorDynamicOptions)
.fieldMetaOptions,
isEnabled: false,
},
diff --git a/x-pack/plugins/maps/public/classes/layers/create_tile_map_layer_descriptor.ts b/x-pack/plugins/maps/public/classes/layers/create_tile_map_layer_descriptor.ts
index 5b89373f2db48..05616f6916f62 100644
--- a/x-pack/plugins/maps/public/classes/layers/create_tile_map_layer_descriptor.ts
+++ b/x-pack/plugins/maps/public/classes/layers/create_tile_map_layer_descriptor.ts
@@ -113,16 +113,16 @@ export function createTileMapLayerDescriptor({
const colorPallette = NUMERICAL_COLOR_PALETTES.find((pallette) => {
return pallette.value.toLowerCase() === colorSchema.toLowerCase();
});
- const styleProperties: VectorStylePropertiesDescriptor = {
+ const styleProperties: Partial = {
[VECTOR_STYLES.FILL_COLOR]: {
type: STYLE_TYPE.DYNAMIC,
options: {
- ...(defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR]!.options as ColorDynamicOptions),
+ ...(defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR].options as ColorDynamicOptions),
field: metricStyleField,
color: colorPallette ? colorPallette.value : 'Yellow to Red',
type: COLOR_MAP_TYPE.ORDINAL,
fieldMetaOptions: {
- ...(defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR]!.options as ColorDynamicOptions)
+ ...(defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR].options as ColorDynamicOptions)
.fieldMetaOptions,
isEnabled: false,
},
@@ -139,11 +139,11 @@ export function createTileMapLayerDescriptor({
styleProperties[VECTOR_STYLES.ICON_SIZE] = {
type: STYLE_TYPE.DYNAMIC,
options: {
- ...(defaultDynamicProperties[VECTOR_STYLES.ICON_SIZE]!.options as SizeDynamicOptions),
+ ...(defaultDynamicProperties[VECTOR_STYLES.ICON_SIZE].options as SizeDynamicOptions),
maxSize: 18,
field: metricStyleField,
fieldMetaOptions: {
- ...(defaultDynamicProperties[VECTOR_STYLES.ICON_SIZE]!.options as SizeDynamicOptions)
+ ...(defaultDynamicProperties[VECTOR_STYLES.ICON_SIZE].options as SizeDynamicOptions)
.fieldMetaOptions,
isEnabled: false,
},
diff --git a/x-pack/plugins/maps/public/classes/layers/layer.tsx b/x-pack/plugins/maps/public/classes/layers/layer.tsx
index b982e6452e8cb..060ff4d46fa2a 100644
--- a/x-pack/plugins/maps/public/classes/layers/layer.tsx
+++ b/x-pack/plugins/maps/public/classes/layers/layer.tsx
@@ -76,11 +76,9 @@ export interface ILayer {
getType(): string | undefined;
isVisible(): boolean;
cloneDescriptor(): Promise;
- renderStyleEditor({
- onStyleDescriptorChange,
- }: {
- onStyleDescriptorChange: (styleDescriptor: StyleDescriptor) => void;
- }): ReactElement | null;
+ renderStyleEditor(
+ onStyleDescriptorChange: (styleDescriptor: StyleDescriptor) => void
+ ): ReactElement | null;
getInFlightRequestTokens(): symbol[];
getPrevRequestToken(dataId: string): symbol | undefined;
destroy: () => void;
@@ -437,16 +435,14 @@ export class AbstractLayer implements ILayer {
return null;
}
- renderStyleEditor({
- onStyleDescriptorChange,
- }: {
- onStyleDescriptorChange: (styleDescriptor: StyleDescriptor) => void;
- }): ReactElement | null {
+ renderStyleEditor(
+ onStyleDescriptorChange: (styleDescriptor: StyleDescriptor) => void
+ ): ReactElement | null {
const style = this.getStyleForEditing();
if (!style) {
return null;
}
- return style.renderEditor({ layer: this, onStyleDescriptorChange });
+ return style.renderEditor(onStyleDescriptorChange);
}
getIndexPatternIds(): string[] {
diff --git a/x-pack/plugins/maps/public/classes/layers/solution_layers/observability/create_layer_descriptor.ts b/x-pack/plugins/maps/public/classes/layers/solution_layers/observability/create_layer_descriptor.ts
index dea551866f4a9..7e8a216685bbd 100644
--- a/x-pack/plugins/maps/public/classes/layers/solution_layers/observability/create_layer_descriptor.ts
+++ b/x-pack/plugins/maps/public/classes/layers/solution_layers/observability/create_layer_descriptor.ts
@@ -50,7 +50,7 @@ function createDynamicFillColorDescriptor(
return {
type: STYLE_TYPE.DYNAMIC,
options: {
- ...(defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR]!.options as ColorDynamicOptions),
+ ...(defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR].options as ColorDynamicOptions),
field,
color:
layer === OBSERVABILITY_LAYER_TYPE.APM_RUM_PERFORMANCE ? 'Green to Red' : 'Yellow to Red',
@@ -226,12 +226,12 @@ export function createLayerDescriptor({
origin: FIELD_ORIGIN.SOURCE,
};
- const styleProperties: VectorStylePropertiesDescriptor = {
+ const styleProperties: Partial = {
[VECTOR_STYLES.FILL_COLOR]: createDynamicFillColorDescriptor(layer, metricStyleField),
[VECTOR_STYLES.ICON_SIZE]: {
type: STYLE_TYPE.DYNAMIC,
options: {
- ...(defaultDynamicProperties[VECTOR_STYLES.ICON_SIZE]!.options as SizeDynamicOptions),
+ ...(defaultDynamicProperties[VECTOR_STYLES.ICON_SIZE].options as SizeDynamicOptions),
field: metricStyleField,
},
},
diff --git a/x-pack/plugins/maps/public/classes/layers/solution_layers/security/create_layer_descriptors.ts b/x-pack/plugins/maps/public/classes/layers/solution_layers/security/create_layer_descriptors.ts
index 909cd93b3df7a..b52ce02acb5f0 100644
--- a/x-pack/plugins/maps/public/classes/layers/solution_layers/security/create_layer_descriptors.ts
+++ b/x-pack/plugins/maps/public/classes/layers/solution_layers/security/create_layer_descriptors.ts
@@ -68,7 +68,7 @@ function createSourceLayerDescriptor(indexPatternId: string, indexPatternTitle:
],
});
- const styleProperties: VectorStylePropertiesDescriptor = {
+ const styleProperties: Partial = {
[VECTOR_STYLES.FILL_COLOR]: {
type: STYLE_TYPE.STATIC,
options: { color: euiVisColorPalette[1] },
@@ -121,7 +121,7 @@ function createDestinationLayerDescriptor(indexPatternId: string, indexPatternTi
],
});
- const styleProperties: VectorStylePropertiesDescriptor = {
+ const styleProperties: Partial = {
[VECTOR_STYLES.FILL_COLOR]: {
type: STYLE_TYPE.STATIC,
options: { color: euiVisColorPalette[2] },
@@ -168,7 +168,7 @@ function createLineLayerDescriptor(indexPatternId: string, indexPatternTitle: st
],
});
- const styleProperties: VectorStylePropertiesDescriptor = {
+ const styleProperties: Partial = {
[VECTOR_STYLES.LINE_COLOR]: {
type: STYLE_TYPE.STATIC,
options: { color: euiVisColorPalette[1] },
@@ -176,7 +176,7 @@ function createLineLayerDescriptor(indexPatternId: string, indexPatternTitle: st
[VECTOR_STYLES.LINE_WIDTH]: {
type: STYLE_TYPE.DYNAMIC,
options: {
- ...(defaultDynamicProperties[VECTOR_STYLES.LINE_WIDTH]!.options as SizeDynamicOptions),
+ ...(defaultDynamicProperties[VECTOR_STYLES.LINE_WIDTH].options as SizeDynamicOptions),
field: {
name: COUNT_PROP_NAME,
origin: FIELD_ORIGIN.SOURCE,
diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/clusters_layer_wizard.tsx b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/clusters_layer_wizard.tsx
index 0f596c47fc9b6..1fd6a9c9ecc8e 100644
--- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/clusters_layer_wizard.tsx
+++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/clusters_layer_wizard.tsx
@@ -77,7 +77,7 @@ export const clustersLayerWizardConfig: LayerWizard = {
[VECTOR_STYLES.ICON_SIZE]: {
type: STYLE_TYPE.DYNAMIC,
options: {
- ...(defaultDynamicProperties[VECTOR_STYLES.ICON_SIZE]!.options as SizeDynamicOptions),
+ ...(defaultDynamicProperties[VECTOR_STYLES.ICON_SIZE].options as SizeDynamicOptions),
field: {
name: COUNT_PROP_NAME,
origin: FIELD_ORIGIN.SOURCE,
@@ -87,7 +87,7 @@ export const clustersLayerWizardConfig: LayerWizard = {
[VECTOR_STYLES.LABEL_TEXT]: {
type: STYLE_TYPE.DYNAMIC,
options: {
- ...defaultDynamicProperties[VECTOR_STYLES.LABEL_TEXT]!.options,
+ ...defaultDynamicProperties[VECTOR_STYLES.LABEL_TEXT].options,
field: {
name: COUNT_PROP_NAME,
origin: FIELD_ORIGIN.SOURCE,
diff --git a/x-pack/plugins/maps/public/classes/styles/heatmap/heatmap_style.tsx b/x-pack/plugins/maps/public/classes/styles/heatmap/heatmap_style.tsx
index c75698805225f..599f3b2dfbb02 100644
--- a/x-pack/plugins/maps/public/classes/styles/heatmap/heatmap_style.tsx
+++ b/x-pack/plugins/maps/public/classes/styles/heatmap/heatmap_style.tsx
@@ -41,11 +41,7 @@ export class HeatmapStyle implements IStyle {
return LAYER_STYLE_TYPE.HEATMAP;
}
- renderEditor({
- onStyleDescriptorChange,
- }: {
- onStyleDescriptorChange: (styleDescriptor: StyleDescriptor) => void;
- }) {
+ renderEditor(onStyleDescriptorChange: (styleDescriptor: StyleDescriptor) => void) {
const onHeatmapColorChange = ({ colorRampName }: { colorRampName: string }) => {
const styleDescriptor = HeatmapStyle.createDescriptor(colorRampName);
onStyleDescriptorChange(styleDescriptor);
diff --git a/x-pack/plugins/maps/public/classes/styles/style.ts b/x-pack/plugins/maps/public/classes/styles/style.ts
index abaa6184b0ca4..de14ab990fa23 100644
--- a/x-pack/plugins/maps/public/classes/styles/style.ts
+++ b/x-pack/plugins/maps/public/classes/styles/style.ts
@@ -6,15 +6,10 @@
import { ReactElement } from 'react';
import { StyleDescriptor } from '../../../common/descriptor_types';
-import { ILayer } from '../layers/layer';
export interface IStyle {
getType(): string;
- renderEditor({
- layer,
- onStyleDescriptorChange,
- }: {
- layer: ILayer;
- onStyleDescriptorChange: (styleDescriptor: StyleDescriptor) => void;
- }): ReactElement | null;
+ renderEditor(
+ onStyleDescriptorChange: (styleDescriptor: StyleDescriptor) => void
+ ): ReactElement | null;
}
diff --git a/x-pack/plugins/maps/public/classes/styles/tile/tile_style.ts b/x-pack/plugins/maps/public/classes/styles/tile/tile_style.ts
index cac3913d3149d..dad26d4172e0a 100644
--- a/x-pack/plugins/maps/public/classes/styles/tile/tile_style.ts
+++ b/x-pack/plugins/maps/public/classes/styles/tile/tile_style.ts
@@ -21,7 +21,7 @@ export class TileStyle implements IStyle {
return LAYER_STYLE_TYPE.TILE;
}
- renderEditor(/* { layer, onStyleDescriptorChange } */) {
+ renderEditor(/* onStyleDescriptorChange */) {
return null;
}
}
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/components/color/vector_style_color_editor.tsx b/x-pack/plugins/maps/public/classes/styles/vector/components/color/vector_style_color_editor.tsx
index 4527f56c04d2e..d45c33bbc3f57 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/components/color/vector_style_color_editor.tsx
+++ b/x-pack/plugins/maps/public/classes/styles/vector/components/color/vector_style_color_editor.tsx
@@ -14,7 +14,11 @@ import { DynamicColorForm } from './dynamic_color_form';
import { StaticColorForm } from './static_color_form';
import { ColorDynamicOptions, ColorStaticOptions } from '../../../../../../common/descriptor_types';
-export function VectorStyleColorEditor(props: Props) {
+type ColorEditorProps = Omit, 'children'> & {
+ swatches: string[];
+};
+
+export function VectorStyleColorEditor(props: ColorEditorProps) {
const colorForm = props.styleProperty.isDynamic() ? (
) : (
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/components/label/vector_style_label_editor.js b/x-pack/plugins/maps/public/classes/styles/vector/components/label/vector_style_label_editor.tsx
similarity index 62%
rename from x-pack/plugins/maps/public/classes/styles/vector/components/label/vector_style_label_editor.js
rename to x-pack/plugins/maps/public/classes/styles/vector/components/label/vector_style_label_editor.tsx
index aaa21ea315f36..586d4fc0576ad 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/components/label/vector_style_label_editor.js
+++ b/x-pack/plugins/maps/public/classes/styles/vector/components/label/vector_style_label_editor.tsx
@@ -6,11 +6,16 @@
import React from 'react';
-import { StylePropEditor } from '../style_prop_editor';
+import { Props, StylePropEditor } from '../style_prop_editor';
+// @ts-expect-error
import { DynamicLabelForm } from './dynamic_label_form';
+// @ts-expect-error
import { StaticLabelForm } from './static_label_form';
+import { LabelDynamicOptions, LabelStaticOptions } from '../../../../../../common/descriptor_types';
-export function VectorStyleLabelEditor(props) {
+type LabelEditorProps = Omit, 'children'>;
+
+export function VectorStyleLabelEditor(props: LabelEditorProps) {
const labelForm = props.styleProperty.isDynamic() ? (
) : (
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/components/size/vector_style_size_editor.js b/x-pack/plugins/maps/public/classes/styles/vector/components/size/vector_style_size_editor.tsx
similarity index 62%
rename from x-pack/plugins/maps/public/classes/styles/vector/components/size/vector_style_size_editor.js
rename to x-pack/plugins/maps/public/classes/styles/vector/components/size/vector_style_size_editor.tsx
index e344f72bd429a..c492f24661e71 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/components/size/vector_style_size_editor.js
+++ b/x-pack/plugins/maps/public/classes/styles/vector/components/size/vector_style_size_editor.tsx
@@ -6,11 +6,16 @@
import React from 'react';
-import { StylePropEditor } from '../style_prop_editor';
+import { Props, StylePropEditor } from '../style_prop_editor';
+// @ts-expect-error
import { DynamicSizeForm } from './dynamic_size_form';
+// @ts-expect-error
import { StaticSizeForm } from './static_size_form';
+import { SizeDynamicOptions, SizeStaticOptions } from '../../../../../../common/descriptor_types';
-export function VectorStyleSizeEditor(props) {
+type SizeEditorProps = Omit, 'children'>;
+
+export function VectorStyleSizeEditor(props: SizeEditorProps) {
const sizeForm = props.styleProperty.isDynamic() ? (
) : (
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/components/style_prop_editor.tsx b/x-pack/plugins/maps/public/classes/styles/vector/components/style_prop_editor.tsx
index 43b088074a30e..f3363a9443cfd 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/components/style_prop_editor.tsx
+++ b/x-pack/plugins/maps/public/classes/styles/vector/components/style_prop_editor.tsx
@@ -25,12 +25,12 @@ export interface Props {
customStaticOptionLabel?: string;
defaultStaticStyleOptions: StaticOptions;
defaultDynamicStyleOptions: DynamicOptions;
- disabled: boolean;
+ disabled?: boolean;
disabledBy?: VECTOR_STYLES;
fields: StyleField[];
onDynamicStyleChange: (propertyName: VECTOR_STYLES, options: DynamicOptions) => void;
onStaticStyleChange: (propertyName: VECTOR_STYLES, options: StaticOptions) => void;
- styleProperty: IStyleProperty;
+ styleProperty: IStyleProperty;
}
export class StylePropEditor extends Component<
@@ -42,7 +42,7 @@ export class StylePropEditor extends Component<
_onTypeToggle = () => {
if (this.props.styleProperty.isDynamic()) {
// preserve current dynmaic style
- this._prevDynamicStyleOptions = this.props.styleProperty.getOptions();
+ this._prevDynamicStyleOptions = this.props.styleProperty.getOptions() as DynamicOptions;
// toggle to static style
this.props.onStaticStyleChange(
this.props.styleProperty.getStyleName(),
@@ -50,7 +50,7 @@ export class StylePropEditor extends Component<
);
} else {
// preserve current static style
- this._prevStaticStyleOptions = this.props.styleProperty.getOptions();
+ this._prevStaticStyleOptions = this.props.styleProperty.getOptions() as StaticOptions;
// toggle to dynamic style
this.props.onDynamicStyleChange(
this.props.styleProperty.getStyleName(),
@@ -61,7 +61,7 @@ export class StylePropEditor extends Component<
_onFieldMetaOptionsChange = (fieldMetaOptions: FieldMetaOptions) => {
const options = {
- ...this.props.styleProperty.getOptions(),
+ ...(this.props.styleProperty.getOptions() as DynamicOptions),
fieldMetaOptions,
};
this.props.onDynamicStyleChange(this.props.styleProperty.getStyleName(), options);
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/components/symbol/vector_style_icon_editor.js b/x-pack/plugins/maps/public/classes/styles/vector/components/symbol/vector_style_icon_editor.tsx
similarity index 62%
rename from x-pack/plugins/maps/public/classes/styles/vector/components/symbol/vector_style_icon_editor.js
rename to x-pack/plugins/maps/public/classes/styles/vector/components/symbol/vector_style_icon_editor.tsx
index 2a983a32f0d82..bd6cda0b57f8d 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/components/symbol/vector_style_icon_editor.js
+++ b/x-pack/plugins/maps/public/classes/styles/vector/components/symbol/vector_style_icon_editor.tsx
@@ -6,11 +6,16 @@
import React from 'react';
-import { StylePropEditor } from '../style_prop_editor';
+import { Props, StylePropEditor } from '../style_prop_editor';
+// @ts-expect-error
import { DynamicIconForm } from './dynamic_icon_form';
+// @ts-expect-error
import { StaticIconForm } from './static_icon_form';
+import { IconDynamicOptions, IconStaticOptions } from '../../../../../../common/descriptor_types';
-export function VectorStyleIconEditor(props) {
+type IconEditorProps = Omit, 'children'>;
+
+export function VectorStyleIconEditor(props: IconEditorProps) {
const iconForm = props.styleProperty.isDynamic() ? (
) : (
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/components/vector_style_editor.js b/x-pack/plugins/maps/public/classes/styles/vector/components/vector_style_editor.tsx
similarity index 64%
rename from x-pack/plugins/maps/public/classes/styles/vector/components/vector_style_editor.js
rename to x-pack/plugins/maps/public/classes/styles/vector/components/vector_style_editor.tsx
index d577912efb830..95e32f0e9969b 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/components/vector_style_editor.js
+++ b/x-pack/plugins/maps/public/classes/styles/vector/components/vector_style_editor.tsx
@@ -7,34 +7,95 @@
import _ from 'lodash';
import React, { Component, Fragment } from 'react';
+import { i18n } from '@kbn/i18n';
+import { EuiSpacer, EuiButtonGroup, EuiFormRow, EuiSwitch, EuiSwitchEvent } from '@elastic/eui';
import { VectorStyleColorEditor } from './color/vector_style_color_editor';
import { VectorStyleSizeEditor } from './size/vector_style_size_editor';
+// @ts-expect-error
import { VectorStyleSymbolizeAsEditor } from './symbol/vector_style_symbolize_as_editor';
import { VectorStyleIconEditor } from './symbol/vector_style_icon_editor';
import { VectorStyleLabelEditor } from './label/vector_style_label_editor';
+// @ts-expect-error
import { VectorStyleLabelBorderSizeEditor } from './label/vector_style_label_border_size_editor';
+// @ts-expect-error
import { OrientationEditor } from './orientation/orientation_editor';
import { getDefaultDynamicProperties, getDefaultStaticProperties } from '../vector_style_defaults';
import { DEFAULT_FILL_COLORS, DEFAULT_LINE_COLORS } from '../../color_palettes';
-import { i18n } from '@kbn/i18n';
-import { EuiSpacer, EuiButtonGroup, EuiFormRow, EuiSwitch } from '@elastic/eui';
import {
LABEL_BORDER_SIZES,
VECTOR_STYLES,
STYLE_TYPE,
VECTOR_SHAPE_TYPE,
} from '../../../../../common/constants';
-import { createStyleFieldsHelper } from '../style_fields_helper';
-
-export class VectorStyleEditor extends Component {
- state = {
- styleFields: [],
- defaultDynamicProperties: getDefaultDynamicProperties(),
- defaultStaticProperties: getDefaultStaticProperties(),
- supportedFeatures: undefined,
- selectedFeature: null,
- };
+import { createStyleFieldsHelper, StyleField, StyleFieldsHelper } from '../style_fields_helper';
+import {
+ ColorDynamicOptions,
+ ColorStaticOptions,
+ DynamicStylePropertyOptions,
+ IconDynamicOptions,
+ IconStaticOptions,
+ LabelDynamicOptions,
+ LabelStaticOptions,
+ SizeDynamicOptions,
+ SizeStaticOptions,
+ StaticStylePropertyOptions,
+ StylePropertyOptions,
+ VectorStylePropertiesDescriptor,
+} from '../../../../../common/descriptor_types';
+import { IStyleProperty } from '../properties/style_property';
+import { SymbolizeAsProperty } from '../properties/symbolize_as_property';
+import { LabelBorderSizeProperty } from '../properties/label_border_size_property';
+import { StaticTextProperty } from '../properties/static_text_property';
+import { StaticSizeProperty } from '../properties/static_size_property';
+import { IVectorLayer } from '../../../layers/vector_layer/vector_layer';
+
+export interface StyleProperties {
+ [key: string]: IStyleProperty;
+}
+
+interface Props {
+ layer: IVectorLayer;
+ isPointsOnly: boolean;
+ isLinesOnly: boolean;
+ onIsTimeAwareChange: (isTimeAware: boolean) => void;
+ handlePropertyChange: (propertyName: VECTOR_STYLES, stylePropertyDescriptor: unknown) => void;
+ hasBorder: boolean;
+ styleProperties: StyleProperties;
+ isTimeAware: boolean;
+ showIsTimeAware: boolean;
+}
+
+interface State {
+ styleFields: StyleField[];
+ defaultDynamicProperties: VectorStylePropertiesDescriptor;
+ defaultStaticProperties: VectorStylePropertiesDescriptor;
+ supportedFeatures: VECTOR_SHAPE_TYPE[];
+ selectedFeature: VECTOR_SHAPE_TYPE;
+ styleFieldsHelper?: StyleFieldsHelper;
+}
+
+export class VectorStyleEditor extends Component {
+ private _isMounted: boolean = false;
+
+ constructor(props: Props) {
+ super(props);
+
+ let selectedFeature = VECTOR_SHAPE_TYPE.POLYGON;
+ if (props.isPointsOnly) {
+ selectedFeature = VECTOR_SHAPE_TYPE.POINT;
+ } else if (props.isLinesOnly) {
+ selectedFeature = VECTOR_SHAPE_TYPE.LINE;
+ }
+
+ this.state = {
+ styleFields: [],
+ defaultDynamicProperties: getDefaultDynamicProperties(),
+ defaultStaticProperties: getDefaultStaticProperties(),
+ supportedFeatures: [],
+ selectedFeature,
+ };
+ }
componentWillUnmount() {
this._isMounted = false;
@@ -68,36 +129,20 @@ export class VectorStyleEditor extends Component {
async _loadSupportedFeatures() {
const supportedFeatures = await this.props.layer.getSource().getSupportedShapeTypes();
- if (!this._isMounted) {
- return;
- }
-
- if (!_.isEqual(supportedFeatures, this.state.supportedFeatures)) {
+ if (this._isMounted && !_.isEqual(supportedFeatures, this.state.supportedFeatures)) {
this.setState({ supportedFeatures });
}
-
- if (this.state.selectedFeature === null) {
- let selectedFeature = VECTOR_SHAPE_TYPE.POLYGON;
- if (this.props.isPointsOnly) {
- selectedFeature = VECTOR_SHAPE_TYPE.POINT;
- } else if (this.props.isLinesOnly) {
- selectedFeature = VECTOR_SHAPE_TYPE.LINE;
- }
- this.setState({
- selectedFeature: selectedFeature,
- });
- }
}
- _handleSelectedFeatureChange = (selectedFeature) => {
- this.setState({ selectedFeature });
+ _handleSelectedFeatureChange = (selectedFeature: string) => {
+ this.setState({ selectedFeature: selectedFeature as VECTOR_SHAPE_TYPE });
};
- _onIsTimeAwareChange = (event) => {
+ _onIsTimeAwareChange = (event: EuiSwitchEvent) => {
this.props.onIsTimeAwareChange(event.target.checked);
};
- _onStaticStyleChange = (propertyName, options) => {
+ _onStaticStyleChange = (propertyName: VECTOR_STYLES, options: StaticStylePropertyOptions) => {
const styleDescriptor = {
type: STYLE_TYPE.STATIC,
options,
@@ -105,7 +150,7 @@ export class VectorStyleEditor extends Component {
this.props.handlePropertyChange(propertyName, styleDescriptor);
};
- _onDynamicStyleChange = (propertyName, options) => {
+ _onDynamicStyleChange = (propertyName: VECTOR_STYLES, options: DynamicStylePropertyOptions) => {
const styleDescriptor = {
type: STYLE_TYPE.DYNAMIC,
options,
@@ -115,18 +160,21 @@ export class VectorStyleEditor extends Component {
_hasMarkerOrIcon() {
const iconSize = this.props.styleProperties[VECTOR_STYLES.ICON_SIZE];
- return iconSize.isDynamic() || iconSize.getOptions().size > 0;
+ return iconSize.isDynamic() || (iconSize as StaticSizeProperty).getOptions().size > 0;
}
_hasLabel() {
const label = this.props.styleProperties[VECTOR_STYLES.LABEL_TEXT];
return label.isDynamic()
? label.isComplete()
- : label.getOptions().value != null && label.getOptions().value.length;
+ : (label as StaticTextProperty).getOptions().value != null &&
+ (label as StaticTextProperty).getOptions().value.length;
}
_hasLabelBorder() {
- const labelBorderSize = this.props.styleProperties[VECTOR_STYLES.LABEL_BORDER_SIZE];
+ const labelBorderSize = this.props.styleProperties[
+ VECTOR_STYLES.LABEL_BORDER_SIZE
+ ] as LabelBorderSizeProperty;
return labelBorderSize.getOptions().size !== LABEL_BORDER_SIZES.NONE;
}
@@ -138,13 +186,18 @@ export class VectorStyleEditor extends Component {
swatches={DEFAULT_FILL_COLORS}
onStaticStyleChange={this._onStaticStyleChange}
onDynamicStyleChange={this._onDynamicStyleChange}
- styleProperty={this.props.styleProperties[VECTOR_STYLES.FILL_COLOR]}
- fields={this.state.styleFieldsHelper.getFieldsForStyle(VECTOR_STYLES.FILL_COLOR)}
+ styleProperty={
+ this.props.styleProperties[VECTOR_STYLES.FILL_COLOR] as IStyleProperty<
+ ColorDynamicOptions | ColorStaticOptions
+ >
+ }
+ fields={this.state.styleFieldsHelper!.getFieldsForStyle(VECTOR_STYLES.FILL_COLOR)}
defaultStaticStyleOptions={
- this.state.defaultStaticProperties[VECTOR_STYLES.FILL_COLOR].options
+ this.state.defaultStaticProperties[VECTOR_STYLES.FILL_COLOR].options as ColorStaticOptions
}
defaultDynamicStyleOptions={
- this.state.defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR].options
+ this.state.defaultDynamicProperties[VECTOR_STYLES.FILL_COLOR]
+ .options as ColorDynamicOptions
}
/>
);
@@ -159,13 +212,18 @@ export class VectorStyleEditor extends Component {
swatches={DEFAULT_LINE_COLORS}
onStaticStyleChange={this._onStaticStyleChange}
onDynamicStyleChange={this._onDynamicStyleChange}
- styleProperty={this.props.styleProperties[VECTOR_STYLES.LINE_COLOR]}
- fields={this.state.styleFieldsHelper.getFieldsForStyle(VECTOR_STYLES.LINE_COLOR)}
+ styleProperty={
+ this.props.styleProperties[VECTOR_STYLES.LINE_COLOR] as IStyleProperty<
+ ColorDynamicOptions | ColorStaticOptions
+ >
+ }
+ fields={this.state.styleFieldsHelper!.getFieldsForStyle(VECTOR_STYLES.LINE_COLOR)}
defaultStaticStyleOptions={
- this.state.defaultStaticProperties[VECTOR_STYLES.LINE_COLOR].options
+ this.state.defaultStaticProperties[VECTOR_STYLES.LINE_COLOR].options as ColorStaticOptions
}
defaultDynamicStyleOptions={
- this.state.defaultDynamicProperties[VECTOR_STYLES.LINE_COLOR].options
+ this.state.defaultDynamicProperties[VECTOR_STYLES.LINE_COLOR]
+ .options as ColorDynamicOptions
}
/>
);
@@ -178,13 +236,18 @@ export class VectorStyleEditor extends Component {
disabledBy={VECTOR_STYLES.ICON_SIZE}
onStaticStyleChange={this._onStaticStyleChange}
onDynamicStyleChange={this._onDynamicStyleChange}
- styleProperty={this.props.styleProperties[VECTOR_STYLES.LINE_WIDTH]}
- fields={this.state.styleFieldsHelper.getFieldsForStyle(VECTOR_STYLES.LINE_WIDTH)}
+ styleProperty={
+ this.props.styleProperties[VECTOR_STYLES.LINE_WIDTH] as IStyleProperty<
+ SizeDynamicOptions | SizeStaticOptions
+ >
+ }
+ fields={this.state.styleFieldsHelper!.getFieldsForStyle(VECTOR_STYLES.LINE_WIDTH)}
defaultStaticStyleOptions={
- this.state.defaultStaticProperties[VECTOR_STYLES.LINE_WIDTH].options
+ this.state.defaultStaticProperties[VECTOR_STYLES.LINE_WIDTH].options as SizeStaticOptions
}
defaultDynamicStyleOptions={
- this.state.defaultDynamicProperties[VECTOR_STYLES.LINE_WIDTH].options
+ this.state.defaultDynamicProperties[VECTOR_STYLES.LINE_WIDTH]
+ .options as SizeDynamicOptions
}
/>
);
@@ -198,13 +261,19 @@ export class VectorStyleEditor extends Component {
+ }
+ fields={this.state.styleFieldsHelper!.getFieldsForStyle(VECTOR_STYLES.LABEL_TEXT)}
defaultStaticStyleOptions={
- this.state.defaultStaticProperties[VECTOR_STYLES.LABEL_TEXT].options
+ this.state.defaultStaticProperties[VECTOR_STYLES.LABEL_TEXT]
+ .options as LabelStaticOptions
}
defaultDynamicStyleOptions={
- this.state.defaultDynamicProperties[VECTOR_STYLES.LABEL_TEXT].options
+ this.state.defaultDynamicProperties[VECTOR_STYLES.LABEL_TEXT]
+ .options as LabelDynamicOptions
}
/>
@@ -215,13 +284,19 @@ export class VectorStyleEditor extends Component {
swatches={DEFAULT_LINE_COLORS}
onStaticStyleChange={this._onStaticStyleChange}
onDynamicStyleChange={this._onDynamicStyleChange}
- styleProperty={this.props.styleProperties[VECTOR_STYLES.LABEL_COLOR]}
- fields={this.state.styleFieldsHelper.getFieldsForStyle(VECTOR_STYLES.LABEL_COLOR)}
+ styleProperty={
+ this.props.styleProperties[VECTOR_STYLES.LABEL_COLOR] as IStyleProperty<
+ ColorDynamicOptions | ColorStaticOptions
+ >
+ }
+ fields={this.state.styleFieldsHelper!.getFieldsForStyle(VECTOR_STYLES.LABEL_COLOR)}
defaultStaticStyleOptions={
- this.state.defaultStaticProperties[VECTOR_STYLES.LABEL_COLOR].options
+ this.state.defaultStaticProperties[VECTOR_STYLES.LABEL_COLOR]
+ .options as ColorStaticOptions
}
defaultDynamicStyleOptions={
- this.state.defaultDynamicProperties[VECTOR_STYLES.LABEL_COLOR].options
+ this.state.defaultDynamicProperties[VECTOR_STYLES.LABEL_COLOR]
+ .options as ColorDynamicOptions
}
/>
@@ -231,13 +306,19 @@ export class VectorStyleEditor extends Component {
disabledBy={VECTOR_STYLES.LABEL_TEXT}
onStaticStyleChange={this._onStaticStyleChange}
onDynamicStyleChange={this._onDynamicStyleChange}
- styleProperty={this.props.styleProperties[VECTOR_STYLES.LABEL_SIZE]}
- fields={this.state.styleFieldsHelper.getFieldsForStyle(VECTOR_STYLES.LABEL_SIZE)}
+ styleProperty={
+ this.props.styleProperties[VECTOR_STYLES.LABEL_SIZE] as IStyleProperty<
+ SizeDynamicOptions | SizeStaticOptions
+ >
+ }
+ fields={this.state.styleFieldsHelper!.getFieldsForStyle(VECTOR_STYLES.LABEL_SIZE)}
defaultStaticStyleOptions={
- this.state.defaultStaticProperties[VECTOR_STYLES.LABEL_SIZE].options
+ this.state.defaultStaticProperties[VECTOR_STYLES.LABEL_SIZE]
+ .options as SizeStaticOptions
}
defaultDynamicStyleOptions={
- this.state.defaultDynamicProperties[VECTOR_STYLES.LABEL_SIZE].options
+ this.state.defaultDynamicProperties[VECTOR_STYLES.LABEL_SIZE]
+ .options as SizeDynamicOptions
}
/>
@@ -248,13 +329,19 @@ export class VectorStyleEditor extends Component {
swatches={DEFAULT_LINE_COLORS}
onStaticStyleChange={this._onStaticStyleChange}
onDynamicStyleChange={this._onDynamicStyleChange}
- styleProperty={this.props.styleProperties[VECTOR_STYLES.LABEL_BORDER_COLOR]}
- fields={this.state.styleFieldsHelper.getFieldsForStyle(VECTOR_STYLES.LABEL_BORDER_COLOR)}
+ styleProperty={
+ this.props.styleProperties[VECTOR_STYLES.LABEL_BORDER_COLOR] as IStyleProperty<
+ ColorDynamicOptions | ColorStaticOptions
+ >
+ }
+ fields={this.state.styleFieldsHelper!.getFieldsForStyle(VECTOR_STYLES.LABEL_BORDER_COLOR)}
defaultStaticStyleOptions={
- this.state.defaultStaticProperties[VECTOR_STYLES.LABEL_BORDER_COLOR].options
+ this.state.defaultStaticProperties[VECTOR_STYLES.LABEL_BORDER_COLOR]
+ .options as ColorStaticOptions
}
defaultDynamicStyleOptions={
- this.state.defaultDynamicProperties[VECTOR_STYLES.LABEL_BORDER_COLOR].options
+ this.state.defaultDynamicProperties[VECTOR_STYLES.LABEL_BORDER_COLOR]
+ .options as ColorDynamicOptions
}
/>
@@ -274,7 +361,11 @@ export class VectorStyleEditor extends Component {
const hasMarkerOrIcon = this._hasMarkerOrIcon();
let iconOrientationEditor;
let iconEditor;
- if (this.props.styleProperties[VECTOR_STYLES.SYMBOLIZE_AS].isSymbolizedAsIcon()) {
+ if (
+ (this.props.styleProperties[
+ VECTOR_STYLES.SYMBOLIZE_AS
+ ] as SymbolizeAsProperty).isSymbolizedAsIcon()
+ ) {
iconOrientationEditor = (
+ }
+ fields={this.state.styleFieldsHelper!.getFieldsForStyle(VECTOR_STYLES.ICON)}
defaultStaticStyleOptions={
- this.state.defaultStaticProperties[VECTOR_STYLES.ICON].options
+ this.state.defaultStaticProperties[VECTOR_STYLES.ICON].options as IconStaticOptions
}
defaultDynamicStyleOptions={
- this.state.defaultDynamicProperties[VECTOR_STYLES.ICON].options
+ this.state.defaultDynamicProperties[VECTOR_STYLES.ICON].options as IconDynamicOptions
}
/>
@@ -341,13 +436,18 @@ export class VectorStyleEditor extends Component {
+ }
+ fields={this.state.styleFieldsHelper!.getFieldsForStyle(VECTOR_STYLES.ICON_SIZE)}
defaultStaticStyleOptions={
- this.state.defaultStaticProperties[VECTOR_STYLES.ICON_SIZE].options
+ this.state.defaultStaticProperties[VECTOR_STYLES.ICON_SIZE].options as SizeStaticOptions
}
defaultDynamicStyleOptions={
- this.state.defaultDynamicProperties[VECTOR_STYLES.ICON_SIZE].options
+ this.state.defaultDynamicProperties[VECTOR_STYLES.ICON_SIZE]
+ .options as SizeDynamicOptions
}
/>
@@ -385,7 +485,7 @@ export class VectorStyleEditor extends Component {
_renderProperties() {
const { supportedFeatures, selectedFeature, styleFieldsHelper } = this.state;
- if (!supportedFeatures || !styleFieldsHelper) {
+ if (supportedFeatures.length === 0 || !styleFieldsHelper) {
return null;
}
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/style_fields_helper.ts b/x-pack/plugins/maps/public/classes/styles/vector/style_fields_helper.ts
index 8613f9e1e946f..fbe643a401484 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/style_fields_helper.ts
+++ b/x-pack/plugins/maps/public/classes/styles/vector/style_fields_helper.ts
@@ -34,7 +34,7 @@ export async function createStyleFieldsHelper(fields: IField[]): Promise = {},
+ isTimeAware = true
+ ) {
return {
type: LAYER_STYLE_TYPE.VECTOR,
- properties: { ...getDefaultProperties(), ...properties },
+ properties: { ...getDefaultStaticProperties(), ...properties },
isTimeAware,
};
}
static createDefaultStyleProperties(mapColors: string[]) {
- return getDefaultProperties(mapColors);
+ return getDefaultStaticProperties(mapColors);
}
constructor(
@@ -192,7 +188,7 @@ export class VectorStyle implements IVectorStyle {
this._styleMeta = new StyleMeta(this._descriptor.__styleMeta);
this._symbolizeAsStyleProperty = new SymbolizeAsProperty(
- this._descriptor.properties[VECTOR_STYLES.SYMBOLIZE_AS]!.options,
+ this._descriptor.properties[VECTOR_STYLES.SYMBOLIZE_AS].options,
VECTOR_STYLES.SYMBOLIZE_AS
);
this._lineColorStyleProperty = this._makeColorProperty(
@@ -237,7 +233,7 @@ export class VectorStyle implements IVectorStyle {
VECTOR_STYLES.LABEL_BORDER_COLOR
);
this._labelBorderSizeStyleProperty = new LabelBorderSizeProperty(
- this._descriptor.properties[VECTOR_STYLES.LABEL_BORDER_SIZE]!.options,
+ this._descriptor.properties[VECTOR_STYLES.LABEL_BORDER_SIZE].options,
VECTOR_STYLES.LABEL_BORDER_SIZE,
this._labelSizeStyleProperty
);
@@ -270,16 +266,10 @@ export class VectorStyle implements IVectorStyle {
: (this._lineWidthStyleProperty as StaticSizeProperty).getOptions().size !== 0;
}
- renderEditor({
- layer,
- onStyleDescriptorChange,
- }: {
- layer: ILayer;
- onStyleDescriptorChange: (styleDescriptor: StyleDescriptor) => void;
- }) {
+ renderEditor(onStyleDescriptorChange: (styleDescriptor: StyleDescriptor) => void) {
const rawProperties = this.getRawProperties();
- const handlePropertyChange = (propertyName: VECTOR_STYLES, settings: any) => {
- rawProperties[propertyName] = settings; // override single property, but preserve the rest
+ const handlePropertyChange = (propertyName: VECTOR_STYLES, stylePropertyDescriptor: any) => {
+ rawProperties[propertyName] = stylePropertyDescriptor; // override single property, but preserve the rest
const vectorStyleDescriptor = VectorStyle.createDescriptor(rawProperties, this.isTimeAware());
onStyleDescriptorChange(vectorStyleDescriptor);
};
@@ -293,9 +283,8 @@ export class VectorStyle implements IVectorStyle {
return dynamicStyleProp.isFieldMetaEnabled();
});
- const styleProperties: VectorStylePropertiesDescriptor = {};
+ const styleProperties: StyleProperties = {};
this.getAllStyleProperties().forEach((styleProperty) => {
- // @ts-expect-error
styleProperties[styleProperty.getStyleName()] = styleProperty;
});
@@ -303,7 +292,7 @@ export class VectorStyle implements IVectorStyle {
{
test('Should use first color in DEFAULT_*_COLORS when no colors are used on the map', () => {
const styleProperties = getDefaultStaticProperties([]);
- expect(styleProperties[VECTOR_STYLES.FILL_COLOR]!.options.color).toBe('#54B399');
- expect(styleProperties[VECTOR_STYLES.LINE_COLOR]!.options.color).toBe('#41937c');
+ expect(styleProperties[VECTOR_STYLES.FILL_COLOR].options.color).toBe('#54B399');
+ expect(styleProperties[VECTOR_STYLES.LINE_COLOR].options.color).toBe('#41937c');
});
test('Should next color in DEFAULT_*_COLORS when colors are used on the map', () => {
const styleProperties = getDefaultStaticProperties(['#54B399']);
- expect(styleProperties[VECTOR_STYLES.FILL_COLOR]!.options.color).toBe('#6092C0');
- expect(styleProperties[VECTOR_STYLES.LINE_COLOR]!.options.color).toBe('#4379aa');
+ expect(styleProperties[VECTOR_STYLES.FILL_COLOR].options.color).toBe('#6092C0');
+ expect(styleProperties[VECTOR_STYLES.LINE_COLOR].options.color).toBe('#4379aa');
});
});
diff --git a/x-pack/plugins/maps/public/classes/styles/vector/vector_style_defaults.ts b/x-pack/plugins/maps/public/classes/styles/vector/vector_style_defaults.ts
index 50321510c2ba8..fc152b9e5a974 100644
--- a/x-pack/plugins/maps/public/classes/styles/vector/vector_style_defaults.ts
+++ b/x-pack/plugins/maps/public/classes/styles/vector/vector_style_defaults.ts
@@ -37,22 +37,6 @@ export const POLYGON_STYLES = [
VECTOR_STYLES.LINE_WIDTH,
];
-export function getDefaultProperties(mapColors: string[] = []): VectorStylePropertiesDescriptor {
- return {
- ...getDefaultStaticProperties(mapColors),
- [VECTOR_STYLES.SYMBOLIZE_AS]: {
- options: {
- value: SYMBOLIZE_AS_TYPES.CIRCLE,
- },
- },
- [VECTOR_STYLES.LABEL_BORDER_SIZE]: {
- options: {
- size: LABEL_BORDER_SIZES.SMALL,
- },
- },
- };
-}
-
export function getDefaultStaticProperties(
mapColors: string[] = []
): VectorStylePropertiesDescriptor {
@@ -129,6 +113,16 @@ export function getDefaultStaticProperties(
color: isDarkMode ? '#000000' : '#FFFFFF',
},
},
+ [VECTOR_STYLES.SYMBOLIZE_AS]: {
+ options: {
+ value: SYMBOLIZE_AS_TYPES.CIRCLE,
+ },
+ },
+ [VECTOR_STYLES.LABEL_BORDER_SIZE]: {
+ options: {
+ size: LABEL_BORDER_SIZES.SMALL,
+ },
+ },
};
}
@@ -244,5 +238,15 @@ export function getDefaultDynamicProperties(): VectorStylePropertiesDescriptor {
},
},
},
+ [VECTOR_STYLES.SYMBOLIZE_AS]: {
+ options: {
+ value: SYMBOLIZE_AS_TYPES.CIRCLE,
+ },
+ },
+ [VECTOR_STYLES.LABEL_BORDER_SIZE]: {
+ options: {
+ size: LABEL_BORDER_SIZES.SMALL,
+ },
+ },
};
}
diff --git a/x-pack/plugins/maps/public/connected_components/layer_panel/style_settings/style_settings.js b/x-pack/plugins/maps/public/connected_components/layer_panel/style_settings/style_settings.js
index 69cf51fb29c0d..e460d7728a319 100644
--- a/x-pack/plugins/maps/public/connected_components/layer_panel/style_settings/style_settings.js
+++ b/x-pack/plugins/maps/public/connected_components/layer_panel/style_settings/style_settings.js
@@ -11,9 +11,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiPanel, EuiSpacer } from '@elast
import { FormattedMessage } from '@kbn/i18n/react';
export function StyleSettings({ layer, updateStyleDescriptor }) {
- const settingsEditor = layer.renderStyleEditor({
- onStyleDescriptorChange: updateStyleDescriptor,
- });
+ const settingsEditor = layer.renderStyleEditor(updateStyleDescriptor);
if (!settingsEditor) {
return null;
diff --git a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_custom.spec.ts b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_custom.spec.ts
index fb1f2920aaceb..d14e09d9384a2 100644
--- a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_custom.spec.ts
+++ b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_custom.spec.ts
@@ -114,7 +114,8 @@ const expectedEditedtags = editedRule.tags.join('');
const expectedEditedIndexPatterns =
editedRule.index && editedRule.index.length ? editedRule.index : indexPatterns;
-describe('Custom detection rules creation', () => {
+// SKIP: https://github.com/elastic/kibana/issues/83769
+describe.skip('Custom detection rules creation', () => {
before(() => {
esArchiverLoad('timeline');
});
diff --git a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_export.spec.ts b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_export.spec.ts
index eb8448233c624..6f995045dfc6a 100644
--- a/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_export.spec.ts
+++ b/x-pack/plugins/security_solution/cypress/integration/alerts_detection_rules_export.spec.ts
@@ -17,7 +17,8 @@ import { DETECTIONS_URL } from '../urls/navigation';
const EXPECTED_EXPORTED_RULE_FILE_PATH = 'cypress/test_files/expected_rules_export.ndjson';
-describe('Export rules', () => {
+// SKIP: https://github.com/elastic/kibana/issues/83769
+describe.skip('Export rules', () => {
before(() => {
esArchiverLoad('export_rule');
cy.server();
diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.test.tsx
index cce6c72ca4cc5..65e25b788b3d9 100644
--- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.test.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.test.tsx
@@ -31,13 +31,20 @@ describe('RuleActionsField', () => {
},
},
});
+
+ const messageVariables = {
+ context: [],
+ state: [],
+ params: [],
+ };
+
const Component = () => {
const field = useFormFieldMock();
const { form } = useForm();
return (
);
};
diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx
index 4ff1b4e4f20f3..0211788509db3 100644
--- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx
@@ -12,17 +12,21 @@ import ReactMarkdown from 'react-markdown';
import styled from 'styled-components';
import { NOTIFICATION_SUPPORTED_ACTION_TYPES_IDS } from '../../../../../common/constants';
-import { SelectField, useFormContext } from '../../../../shared_imports';
+import { FieldHook, useFormContext } from '../../../../shared_imports';
import {
ActionForm,
ActionType,
loadActionTypes,
+ ActionVariables,
} from '../../../../../../triggers_actions_ui/public';
import { AlertAction } from '../../../../../../alerts/common';
import { useKibana } from '../../../../common/lib/kibana';
import { FORM_ERRORS_TITLE } from './translations';
-type ThrottleSelectField = typeof SelectField;
+interface Props {
+ field: FieldHook;
+ messageVariables: ActionVariables;
+}
const DEFAULT_ACTION_GROUP_ID = 'default';
const DEFAULT_ACTION_MESSAGE =
@@ -34,7 +38,7 @@ const FieldErrorsContainer = styled.div`
}
`;
-export const RuleActionsField: ThrottleSelectField = ({ field, messageVariables }) => {
+export const RuleActionsField: React.FC = ({ field, messageVariables }) => {
const [fieldErrors, setFieldErrors] = useState(null);
const [supportedActionTypes, setSupportedActionTypes] = useState();
const form = useFormContext();
diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.test.tsx
index a1d7e69b7a60f..565998806033c 100644
--- a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.test.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.test.tsx
@@ -30,10 +30,20 @@ jest.mock('../../../../common/lib/kibana', () => ({
}),
}));
+const actionMessageParams = {
+ context: [],
+ state: [],
+ params: [],
+};
+
describe('StepRuleActions', () => {
it('renders correctly', () => {
const wrapper = shallow(
-
+
);
expect(wrapper.find('[data-test-subj="stepRuleActions"]')).toHaveLength(1);
diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.tsx
index dd1d92e7e72a3..daf4e3c01bbb3 100644
--- a/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.tsx
+++ b/x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.tsx
@@ -16,7 +16,7 @@ import {
import { findIndex } from 'lodash/fp';
import React, { FC, memo, useCallback, useEffect, useMemo } from 'react';
-import { ActionVariable } from '../../../../../../triggers_actions_ui/public';
+import { ActionVariables } from '../../../../../../triggers_actions_ui/public';
import {
RuleStep,
RuleStepProps,
@@ -38,7 +38,7 @@ import { APP_ID } from '../../../../../common/constants';
interface StepRuleActionsProps extends RuleStepProps {
defaultValues?: ActionsStepRule | null;
- actionMessageParams: ActionVariable[];
+ actionMessageParams: ActionVariables;
}
const stepActionsDefaultValue: ActionsStepRule = {
diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx
index ffcf25d253798..513982f099c61 100644
--- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx
+++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx
@@ -11,7 +11,7 @@ import { useLocation } from 'react-router-dom';
import styled from 'styled-components';
import { EuiFlexItem } from '@elastic/eui';
-import { ActionVariable } from '../../../../../../triggers_actions_ui/public';
+import { ActionVariables } from '../../../../../../triggers_actions_ui/public';
import { RuleAlertAction } from '../../../../../common/detection_engine/types';
import { assertUnreachable } from '../../../../../common/utility_types';
import { transformRuleToAlertAction } from '../../../../../common/detection_engine/transform_actions';
@@ -366,21 +366,26 @@ export const getActionMessageRuleParams = (ruleType: Type): string[] => {
return ruleParamsKeys;
};
-export const getActionMessageParams = memoizeOne((ruleType: Type | undefined): ActionVariable[] => {
- if (!ruleType) {
- return [];
+export const getActionMessageParams = memoizeOne(
+ (ruleType: Type | undefined): ActionVariables => {
+ if (!ruleType) {
+ return { state: [], params: [] };
+ }
+ const actionMessageRuleParams = getActionMessageRuleParams(ruleType);
+ // Prefixes are being added automatically by the ActionTypeForm
+ return {
+ state: [{ name: 'signals_count', description: 'state.signals_count' }],
+ params: [],
+ context: [
+ { name: 'results_link', description: 'context.results_link' },
+ ...actionMessageRuleParams.map((param) => {
+ const extendedParam = `rule.${param}`;
+ return { name: extendedParam, description: `context.${extendedParam}` };
+ }),
+ ],
+ };
}
- const actionMessageRuleParams = getActionMessageRuleParams(ruleType);
-
- return [
- { name: 'state.signals_count', description: 'state.signals_count' },
- { name: '{context.results_link}', description: 'context.results_link' },
- ...actionMessageRuleParams.map((param) => {
- const extendedParam = `context.rule.${param}`;
- return { name: extendedParam, description: extendedParam };
- }),
- ];
-});
+);
// typed as null not undefined as the initial state for this value is null.
export const userHasNoPermissions = (canUserCRUD: boolean | null): boolean =>
diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.test.tsx
index 71e1c60a92aed..226b9de8b677f 100644
--- a/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.test.tsx
+++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.test.tsx
@@ -16,6 +16,8 @@ import { chartPluginMock } from '../../../../../../../../src/plugins/charts/publ
import { dataPluginMock } from '../../../../../../../../src/plugins/data/public/mocks';
import { alertingPluginMock } from '../../../../../../alerts/public/mocks';
import { featuresPluginMock } from '../../../../../../features/public/mocks';
+import { ActionConnector } from '../../../../types';
+import { times } from 'lodash';
jest.mock('../../../lib/action_connector_api', () => ({
loadAllActions: jest.fn(),
@@ -109,36 +111,38 @@ describe('actions_connectors_list component empty', () => {
describe('actions_connectors_list component with items', () => {
let wrapper: ReactWrapper;
- async function setup() {
+ async function setup(actionConnectors?: ActionConnector[]) {
const { loadAllActions, loadActionTypes } = jest.requireMock(
'../../../lib/action_connector_api'
);
- loadAllActions.mockResolvedValueOnce([
- {
- id: '1',
- actionTypeId: 'test',
- description: 'My test',
- isPreconfigured: false,
- referencedByCount: 1,
- config: {},
- },
- {
- id: '2',
- actionTypeId: 'test2',
- description: 'My test 2',
- referencedByCount: 1,
- isPreconfigured: false,
- config: {},
- },
- {
- id: '3',
- actionTypeId: 'test2',
- description: 'My preconfigured test 2',
- referencedByCount: 1,
- isPreconfigured: true,
- config: {},
- },
- ]);
+ loadAllActions.mockResolvedValueOnce(
+ actionConnectors ?? [
+ {
+ id: '1',
+ actionTypeId: 'test',
+ description: 'My test',
+ isPreconfigured: false,
+ referencedByCount: 1,
+ config: {},
+ },
+ {
+ id: '2',
+ actionTypeId: 'test2',
+ description: 'My test 2',
+ referencedByCount: 1,
+ isPreconfigured: false,
+ config: {},
+ },
+ {
+ id: '3',
+ actionTypeId: 'test2',
+ description: 'My preconfigured test 2',
+ referencedByCount: 1,
+ isPreconfigured: true,
+ config: {},
+ },
+ ]
+ );
loadActionTypes.mockResolvedValueOnce([
{
id: 'test',
@@ -217,6 +221,36 @@ describe('actions_connectors_list component with items', () => {
expect(wrapper.find('[data-test-subj="preConfiguredTitleMessage"]')).toHaveLength(2);
});
+ it('supports pagination', async () => {
+ await setup(
+ times(15, (index) => ({
+ id: `connector${index}`,
+ actionTypeId: 'test',
+ name: `My test ${index}`,
+ secrets: {},
+ description: `My test ${index}`,
+ isPreconfigured: false,
+ referencedByCount: 1,
+ config: {},
+ }))
+ );
+ expect(wrapper.find('[data-test-subj="actionsTable"]').first().prop('pagination'))
+ .toMatchInlineSnapshot(`
+ Object {
+ "initialPageIndex": 0,
+ "pageIndex": 0,
+ }
+ `);
+ wrapper.find('[data-test-subj="pagination-button-1"]').first().simulate('click');
+ expect(wrapper.find('[data-test-subj="actionsTable"]').first().prop('pagination'))
+ .toMatchInlineSnapshot(`
+ Object {
+ "initialPageIndex": 0,
+ "pageIndex": 1,
+ }
+ `);
+ });
+
test('if select item for edit should render ConnectorEditFlyout', async () => {
await setup();
await wrapper.find('[data-test-subj="edit1"]').first().simulate('click');
diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx
index ff5585cf04dbe..c5d0a6aae54fc 100644
--- a/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx
+++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx
@@ -18,6 +18,7 @@ import {
EuiToolTip,
EuiButtonIcon,
EuiEmptyPrompt,
+ Criteria,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { omit } from 'lodash';
@@ -54,6 +55,7 @@ export const ActionsConnectorsList: React.FunctionComponent = () => {
const [actionTypesIndex, setActionTypesIndex] = useState(undefined);
const [actions, setActions] = useState([]);
+ const [pageIndex, setPageIndex] = useState(0);
const [selectedItems, setSelectedItems] = useState([]);
const [isLoadingActionTypes, setIsLoadingActionTypes] = useState(false);
const [isLoadingActions, setIsLoadingActions] = useState(false);
@@ -233,7 +235,15 @@ export const ActionsConnectorsList: React.FunctionComponent = () => {
: '',
})}
data-test-subj="actionsTable"
- pagination={true}
+ pagination={{
+ initialPageIndex: 0,
+ pageIndex,
+ }}
+ onTableChange={({ page }: Criteria) => {
+ if (page) {
+ setPageIndex(page.index);
+ }
+ }}
selection={
canDelete
? {
diff --git a/x-pack/plugins/triggers_actions_ui/public/index.ts b/x-pack/plugins/triggers_actions_ui/public/index.ts
index 3187451d2600e..c479359ff7e6e 100644
--- a/x-pack/plugins/triggers_actions_ui/public/index.ts
+++ b/x-pack/plugins/triggers_actions_ui/public/index.ts
@@ -21,6 +21,7 @@ export {
AlertTypeParamsExpressionProps,
ValidationResult,
ActionVariable,
+ ActionVariables,
ActionConnector,
IErrorObject,
} from './types';
diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/create.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/create.ts
index cf7fc9edd9529..41f6b66c30aaf 100644
--- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/create.ts
+++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/create.ts
@@ -91,7 +91,6 @@ export default function createAlertTests({ getService }: FtrProviderContext) {
});
expect(Date.parse(response.body.createdAt)).to.be.greaterThan(0);
expect(Date.parse(response.body.updatedAt)).to.be.greaterThan(0);
- expect(Date.parse(response.body.updatedAt)).to.eql(Date.parse(response.body.createdAt));
expect(typeof response.body.scheduledTaskId).to.be('string');
const { _source: taskRecord } = await getScheduledTask(response.body.scheduledTaskId);
diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/execution_status.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/execution_status.ts
index 642173a7c2c6c..5ebce8edf6fb7 100644
--- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/execution_status.ts
+++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/execution_status.ts
@@ -63,7 +63,6 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon
);
expect(response.status).to.eql(200);
const alertId = response.body.id;
- const alertUpdatedAt = response.body.updatedAt;
dates.push(response.body.executionStatus.lastExecutionDate);
objectRemover.add(Spaces.space1.id, alertId, 'alert', 'alerts');
@@ -71,7 +70,6 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon
dates.push(executionStatus.lastExecutionDate);
dates.push(Date.now());
ensureDatetimesAreOrdered(dates);
- ensureAlertUpdatedAtHasNotChanged(alertId, alertUpdatedAt);
// Ensure AAD isn't broken
await checkAAD({
@@ -99,7 +97,6 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon
);
expect(response.status).to.eql(200);
const alertId = response.body.id;
- const alertUpdatedAt = response.body.updatedAt;
dates.push(response.body.executionStatus.lastExecutionDate);
objectRemover.add(Spaces.space1.id, alertId, 'alert', 'alerts');
@@ -107,7 +104,6 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon
dates.push(executionStatus.lastExecutionDate);
dates.push(Date.now());
ensureDatetimesAreOrdered(dates);
- ensureAlertUpdatedAtHasNotChanged(alertId, alertUpdatedAt);
// Ensure AAD isn't broken
await checkAAD({
@@ -132,7 +128,6 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon
);
expect(response.status).to.eql(200);
const alertId = response.body.id;
- const alertUpdatedAt = response.body.updatedAt;
dates.push(response.body.executionStatus.lastExecutionDate);
objectRemover.add(Spaces.space1.id, alertId, 'alert', 'alerts');
@@ -140,7 +135,6 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon
dates.push(executionStatus.lastExecutionDate);
dates.push(Date.now());
ensureDatetimesAreOrdered(dates);
- ensureAlertUpdatedAtHasNotChanged(alertId, alertUpdatedAt);
// Ensure AAD isn't broken
await checkAAD({
@@ -168,14 +162,12 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon
);
expect(response.status).to.eql(200);
const alertId = response.body.id;
- const alertUpdatedAt = response.body.updatedAt;
objectRemover.add(Spaces.space1.id, alertId, 'alert', 'alerts');
const executionStatus = await waitForStatus(alertId, new Set(['error']));
expect(executionStatus.error).to.be.ok();
expect(executionStatus.error.reason).to.be('execute');
expect(executionStatus.error.message).to.be('this alert is intended to fail');
- ensureAlertUpdatedAtHasNotChanged(alertId, alertUpdatedAt);
});
it('should eventually have error reason "unknown" when appropriate', async () => {
@@ -191,7 +183,6 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon
);
expect(response.status).to.eql(200);
const alertId = response.body.id;
- const alertUpdatedAt = response.body.updatedAt;
objectRemover.add(Spaces.space1.id, alertId, 'alert', 'alerts');
let executionStatus = await waitForStatus(alertId, new Set(['ok']));
@@ -210,7 +201,6 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon
executionStatus = await waitForStatus(alertId, new Set(['error']));
expect(executionStatus.error).to.be.ok();
expect(executionStatus.error.reason).to.be('unknown');
- ensureAlertUpdatedAtHasNotChanged(alertId, alertUpdatedAt);
const message = 'params invalid: [param1]: expected value of type [string] but got [number]';
expect(executionStatus.error.message).to.be(message);
@@ -316,18 +306,6 @@ export default function executionStatusAlertTests({ getService }: FtrProviderCon
await delay(WaitForStatusIncrement);
return await waitForStatus(id, statuses, waitMillis - WaitForStatusIncrement);
}
-
- async function ensureAlertUpdatedAtHasNotChanged(alertId: string, originalUpdatedAt: string) {
- const response = await supertest.get(
- `${getUrlPrefix(Spaces.space1.id)}/api/alerts/alert/${alertId}`
- );
- const { updatedAt, executionStatus } = response.body;
- expect(Date.parse(updatedAt)).to.be.greaterThan(0);
- expect(Date.parse(updatedAt)).to.eql(Date.parse(originalUpdatedAt));
- expect(Date.parse(executionStatus.lastExecutionDate)).to.be.greaterThan(
- Date.parse(originalUpdatedAt)
- );
- }
}
function expectErrorExecutionStatus(executionStatus: Record, startDate: number) {
diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/migrations.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/migrations.ts
index bd6afacf206d9..17070a14069ce 100644
--- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/migrations.ts
+++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/migrations.ts
@@ -82,14 +82,5 @@ export default function createGetTests({ getService }: FtrProviderContext) {
},
]);
});
-
- it('7.11.0 migrates alerts to contain `updatedAt` field', async () => {
- const response = await supertest.get(
- `${getUrlPrefix(``)}/api/alerts/alert/74f3e6d7-b7bb-477d-ac28-92ee22728e6e`
- );
-
- expect(response.status).to.eql(200);
- expect(response.body.updatedAt).to.eql('2020-06-17T15:35:39.839Z');
- });
});
}
diff --git a/x-pack/test/api_integration/apis/uptime/rest/index.ts b/x-pack/test/api_integration/apis/uptime/rest/index.ts
index 6f410add0fa4d..f59b79a6b7bfc 100644
--- a/x-pack/test/api_integration/apis/uptime/rest/index.ts
+++ b/x-pack/test/api_integration/apis/uptime/rest/index.ts
@@ -9,15 +9,12 @@ import {
settingsObjectId,
settingsObjectType,
} from '../../../../../plugins/uptime/server/lib/saved_objects';
-import { registerMochaHooksForSnapshots } from '../../../../apm_api_integration/common/match_snapshot';
export default function ({ getService, loadTestFile }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const server = getService('kibanaServer');
describe('uptime REST endpoints', () => {
- registerMochaHooksForSnapshots();
-
beforeEach('clear settings', async () => {
try {
await server.savedObjects.delete({
diff --git a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts
index 08a339ed59326..bdc18ac831d27 100644
--- a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts
+++ b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts
@@ -9,7 +9,6 @@ import { isRight } from 'fp-ts/lib/Either';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { MonitorSummariesResultType } from '../../../../../plugins/uptime/common/runtime_types';
import { API_URLS } from '../../../../../plugins/uptime/common/constants';
-import { expectSnapshot } from '../../../../apm_api_integration/common/match_snapshot';
interface ExpectedMonitorStatesPage {
response: any;
diff --git a/x-pack/test/apm_api_integration/basic/tests/correlations/ranges.ts b/x-pack/test/apm_api_integration/basic/tests/correlations/ranges.ts
index 0a730217e53f5..751ee8753c449 100644
--- a/x-pack/test/apm_api_integration/basic/tests/correlations/ranges.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/correlations/ranges.ts
@@ -9,7 +9,6 @@ import { format } from 'url';
import { PromiseReturnType } from '../../../../../plugins/observability/typings/common';
import archives_metadata from '../../../common/archives_metadata';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
-import { expectSnapshot } from '../../../common/match_snapshot';
export default function ApiTest({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
diff --git a/x-pack/test/apm_api_integration/basic/tests/correlations/slow_durations.ts b/x-pack/test/apm_api_integration/basic/tests/correlations/slow_durations.ts
index 0cfdf3ec474d5..3cf1c2cecb42b 100644
--- a/x-pack/test/apm_api_integration/basic/tests/correlations/slow_durations.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/correlations/slow_durations.ts
@@ -9,7 +9,6 @@ import { format } from 'url';
import { PromiseReturnType } from '../../../../../plugins/observability/typings/common';
import archives_metadata from '../../../common/archives_metadata';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
-import { expectSnapshot } from '../../../common/match_snapshot';
export default function ApiTest({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
diff --git a/x-pack/test/apm_api_integration/basic/tests/index.ts b/x-pack/test/apm_api_integration/basic/tests/index.ts
index 39dd721c7067e..0381e5f51bb9b 100644
--- a/x-pack/test/apm_api_integration/basic/tests/index.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/index.ts
@@ -4,12 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { FtrProviderContext } from '../../common/ftr_provider_context';
-import { registerMochaHooksForSnapshots } from '../../common/match_snapshot';
export default function apmApiIntegrationTests({ loadTestFile }: FtrProviderContext) {
describe('APM specs (basic)', function () {
- registerMochaHooksForSnapshots();
-
this.tags('ciGroup1');
loadTestFile(require.resolve('./feature_controls'));
diff --git a/x-pack/test/apm_api_integration/basic/tests/metrics_charts/metrics_charts.ts b/x-pack/test/apm_api_integration/basic/tests/metrics_charts/metrics_charts.ts
index cae562b3f5dc5..d52aa2727d651 100644
--- a/x-pack/test/apm_api_integration/basic/tests/metrics_charts/metrics_charts.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/metrics_charts/metrics_charts.ts
@@ -8,7 +8,6 @@ import { first } from 'lodash';
import { MetricsChartsByAgentAPIResponse } from '../../../../../plugins/apm/server/lib/metrics/get_metrics_chart_data_by_agent';
import { GenericMetricsChart } from '../../../../../plugins/apm/server/lib/metrics/transform_metrics_chart';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
-import { expectSnapshot } from '../../../common/match_snapshot';
interface ChartResponse {
body: MetricsChartsByAgentAPIResponse;
diff --git a/x-pack/test/apm_api_integration/basic/tests/observability_overview/observability_overview.ts b/x-pack/test/apm_api_integration/basic/tests/observability_overview/observability_overview.ts
index 01fa09630e85a..cdeab9ecbdc49 100644
--- a/x-pack/test/apm_api_integration/basic/tests/observability_overview/observability_overview.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/observability_overview/observability_overview.ts
@@ -5,7 +5,6 @@
*/
import expect from '@kbn/expect';
import archives_metadata from '../../../common/archives_metadata';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
export default function ApiTest({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/basic/tests/service_maps/service_maps.ts b/x-pack/test/apm_api_integration/basic/tests/service_maps/service_maps.ts
index d729680154c1d..3820a76651053 100644
--- a/x-pack/test/apm_api_integration/basic/tests/service_maps/service_maps.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/service_maps/service_maps.ts
@@ -5,7 +5,6 @@
*/
import expect from '@kbn/expect';
-import { expectSnapshot } from '../../../common/match_snapshot';
import archives_metadata from '../../../common/archives_metadata';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
diff --git a/x-pack/test/apm_api_integration/basic/tests/service_overview/error_groups.ts b/x-pack/test/apm_api_integration/basic/tests/service_overview/error_groups.ts
index b699a30d40418..088b7cb8bb568 100644
--- a/x-pack/test/apm_api_integration/basic/tests/service_overview/error_groups.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/service_overview/error_groups.ts
@@ -7,7 +7,6 @@
import expect from '@kbn/expect';
import qs from 'querystring';
import { pick, uniqBy } from 'lodash';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
import archives from '../../../common/archives_metadata';
diff --git a/x-pack/test/apm_api_integration/basic/tests/services/top_services.ts b/x-pack/test/apm_api_integration/basic/tests/services/top_services.ts
index cd2bdb7fde19e..4d70c4e949433 100644
--- a/x-pack/test/apm_api_integration/basic/tests/services/top_services.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/services/top_services.ts
@@ -7,7 +7,6 @@
import expect from '@kbn/expect';
import { isEmpty, pick } from 'lodash';
import { PromiseReturnType } from '../../../../../plugins/observability/typings/common';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
import archives_metadata from '../../../common/archives_metadata';
diff --git a/x-pack/test/apm_api_integration/basic/tests/services/transaction_types.ts b/x-pack/test/apm_api_integration/basic/tests/services/transaction_types.ts
index 1221ce0198d82..40b6db6997f8a 100644
--- a/x-pack/test/apm_api_integration/basic/tests/services/transaction_types.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/services/transaction_types.ts
@@ -6,7 +6,6 @@
import expect from '@kbn/expect';
import archives_metadata from '../../../common/archives_metadata';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
export default function ApiTest({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/basic/tests/settings/agent_configuration.ts b/x-pack/test/apm_api_integration/basic/tests/settings/agent_configuration.ts
index 32a06b8fb880e..bde9364efc685 100644
--- a/x-pack/test/apm_api_integration/basic/tests/settings/agent_configuration.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/settings/agent_configuration.ts
@@ -6,7 +6,6 @@
import expect from '@kbn/expect';
import { omit, orderBy } from 'lodash';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { AgentConfigurationIntake } from '../../../../../plugins/apm/common/agent_configuration/configuration_types';
import { AgentConfigSearchParams } from '../../../../../plugins/apm/server/routes/settings/agent_configuration';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
diff --git a/x-pack/test/apm_api_integration/basic/tests/settings/anomaly_detection/read_user.ts b/x-pack/test/apm_api_integration/basic/tests/settings/anomaly_detection/read_user.ts
index 2c8f13ce79f76..a9e6eae8bed88 100644
--- a/x-pack/test/apm_api_integration/basic/tests/settings/anomaly_detection/read_user.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/settings/anomaly_detection/read_user.ts
@@ -5,7 +5,6 @@
*/
import expect from '@kbn/expect';
-import { expectSnapshot } from '../../../../common/match_snapshot';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
export default function apiTest({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/basic/tests/settings/anomaly_detection/write_user.ts b/x-pack/test/apm_api_integration/basic/tests/settings/anomaly_detection/write_user.ts
index d1dbd15f4dced..4fa3e46430e91 100644
--- a/x-pack/test/apm_api_integration/basic/tests/settings/anomaly_detection/write_user.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/settings/anomaly_detection/write_user.ts
@@ -5,7 +5,6 @@
*/
import expect from '@kbn/expect';
-import { expectSnapshot } from '../../../../common/match_snapshot';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
export default function apiTest({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/basic/tests/settings/custom_link.ts b/x-pack/test/apm_api_integration/basic/tests/settings/custom_link.ts
index 60b4020e73dce..8ac5566fc2c49 100644
--- a/x-pack/test/apm_api_integration/basic/tests/settings/custom_link.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/settings/custom_link.ts
@@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
import expect from '@kbn/expect';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { CustomLink } from '../../../../../plugins/apm/common/custom_link/custom_link_types';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
diff --git a/x-pack/test/apm_api_integration/basic/tests/traces/top_traces.ts b/x-pack/test/apm_api_integration/basic/tests/traces/top_traces.ts
index 6a3a1ddd0f6ae..4dbd6cc4cd6f7 100644
--- a/x-pack/test/apm_api_integration/basic/tests/traces/top_traces.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/traces/top_traces.ts
@@ -6,7 +6,6 @@
import expect from '@kbn/expect';
import { sortBy } from 'lodash';
import archives_metadata from '../../../common/archives_metadata';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
export default function ApiTest({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/basic/tests/transaction_groups/breakdown.ts b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/breakdown.ts
index f2e58718870bf..24f542c222d6e 100644
--- a/x-pack/test/apm_api_integration/basic/tests/transaction_groups/breakdown.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/breakdown.ts
@@ -5,7 +5,6 @@
*/
import expect from '@kbn/expect';
import archives_metadata from '../../../common/archives_metadata';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
export default function ApiTest({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/basic/tests/transaction_groups/distribution.ts b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/distribution.ts
index e0b03e1a91f40..a93aff5c8cf32 100644
--- a/x-pack/test/apm_api_integration/basic/tests/transaction_groups/distribution.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/distribution.ts
@@ -7,7 +7,6 @@ import expect from '@kbn/expect';
import qs from 'querystring';
import { isEmpty } from 'lodash';
import archives_metadata from '../../../common/archives_metadata';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
export default function ApiTest({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/basic/tests/transaction_groups/error_rate.ts b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/error_rate.ts
index 86309c91b0bc2..da3d07a0e83a3 100644
--- a/x-pack/test/apm_api_integration/basic/tests/transaction_groups/error_rate.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/error_rate.ts
@@ -6,7 +6,6 @@
import expect from '@kbn/expect';
import { first, last } from 'lodash';
import archives_metadata from '../../../common/archives_metadata';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
export default function ApiTest({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/basic/tests/transaction_groups/top_transaction_groups.ts b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/top_transaction_groups.ts
index 2e802957a95e3..d4fdfe6d0fc76 100644
--- a/x-pack/test/apm_api_integration/basic/tests/transaction_groups/top_transaction_groups.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/top_transaction_groups.ts
@@ -6,7 +6,6 @@
import expect from '@kbn/expect';
import { sortBy } from 'lodash';
import archives_metadata from '../../../common/archives_metadata';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
function sortTransactionGroups(items: any[]) {
diff --git a/x-pack/test/apm_api_integration/basic/tests/transaction_groups/transaction_charts.ts b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/transaction_charts.ts
index c3b969d765664..5ebbdfa16d9a8 100644
--- a/x-pack/test/apm_api_integration/basic/tests/transaction_groups/transaction_charts.ts
+++ b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/transaction_charts.ts
@@ -6,7 +6,6 @@
import expect from '@kbn/expect';
import archives_metadata from '../../../common/archives_metadata';
import { PromiseReturnType } from '../../../../../plugins/observability/typings/common';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
export default function ApiTest({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/trial/tests/csm/csm_services.ts b/x-pack/test/apm_api_integration/trial/tests/csm/csm_services.ts
index 6235e7abd37ec..05c6439508ece 100644
--- a/x-pack/test/apm_api_integration/trial/tests/csm/csm_services.ts
+++ b/x-pack/test/apm_api_integration/trial/tests/csm/csm_services.ts
@@ -5,7 +5,6 @@
*/
import expect from '@kbn/expect';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
export default function rumServicesApiTests({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/trial/tests/csm/has_rum_data.ts b/x-pack/test/apm_api_integration/trial/tests/csm/has_rum_data.ts
index 12fdb5ba9704e..f2033e03f5821 100644
--- a/x-pack/test/apm_api_integration/trial/tests/csm/has_rum_data.ts
+++ b/x-pack/test/apm_api_integration/trial/tests/csm/has_rum_data.ts
@@ -5,7 +5,6 @@
*/
import expect from '@kbn/expect';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
export default function rumHasDataApiTests({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/trial/tests/csm/js_errors.ts b/x-pack/test/apm_api_integration/trial/tests/csm/js_errors.ts
index 0edffe7999a65..6fc8cb4c1d4e1 100644
--- a/x-pack/test/apm_api_integration/trial/tests/csm/js_errors.ts
+++ b/x-pack/test/apm_api_integration/trial/tests/csm/js_errors.ts
@@ -5,7 +5,6 @@
*/
import expect from '@kbn/expect';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
export default function rumJsErrorsApiTests({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/trial/tests/csm/long_task_metrics.ts b/x-pack/test/apm_api_integration/trial/tests/csm/long_task_metrics.ts
index 518c4ef8a81a7..6db5de24baa99 100644
--- a/x-pack/test/apm_api_integration/trial/tests/csm/long_task_metrics.ts
+++ b/x-pack/test/apm_api_integration/trial/tests/csm/long_task_metrics.ts
@@ -5,7 +5,6 @@
*/
import expect from '@kbn/expect';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
export default function rumServicesApiTests({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/trial/tests/csm/page_views.ts b/x-pack/test/apm_api_integration/trial/tests/csm/page_views.ts
index ca5670d41d8ee..5d910862843d5 100644
--- a/x-pack/test/apm_api_integration/trial/tests/csm/page_views.ts
+++ b/x-pack/test/apm_api_integration/trial/tests/csm/page_views.ts
@@ -5,7 +5,6 @@
*/
import expect from '@kbn/expect';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
export default function rumServicesApiTests({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/trial/tests/csm/url_search.ts b/x-pack/test/apm_api_integration/trial/tests/csm/url_search.ts
index c887fa3e77648..961c783434639 100644
--- a/x-pack/test/apm_api_integration/trial/tests/csm/url_search.ts
+++ b/x-pack/test/apm_api_integration/trial/tests/csm/url_search.ts
@@ -5,7 +5,6 @@
*/
import expect from '@kbn/expect';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
export default function rumServicesApiTests({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/trial/tests/csm/web_core_vitals.ts b/x-pack/test/apm_api_integration/trial/tests/csm/web_core_vitals.ts
index 5dbe266deeb81..7e970493eb611 100644
--- a/x-pack/test/apm_api_integration/trial/tests/csm/web_core_vitals.ts
+++ b/x-pack/test/apm_api_integration/trial/tests/csm/web_core_vitals.ts
@@ -5,7 +5,6 @@
*/
import expect from '@kbn/expect';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
export default function rumServicesApiTests({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/trial/tests/index.ts b/x-pack/test/apm_api_integration/trial/tests/index.ts
index a67dd1bcbd7a8..97ab662313c7c 100644
--- a/x-pack/test/apm_api_integration/trial/tests/index.ts
+++ b/x-pack/test/apm_api_integration/trial/tests/index.ts
@@ -5,14 +5,11 @@
*/
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
-import { registerMochaHooksForSnapshots } from '../../common/match_snapshot';
export default function observabilityApiIntegrationTests({ loadTestFile }: FtrProviderContext) {
describe('APM specs (trial)', function () {
this.tags('ciGroup1');
- registerMochaHooksForSnapshots();
-
describe('Services', function () {
loadTestFile(require.resolve('./services/annotations'));
loadTestFile(require.resolve('./services/top_services.ts'));
diff --git a/x-pack/test/apm_api_integration/trial/tests/service_maps/service_maps.ts b/x-pack/test/apm_api_integration/trial/tests/service_maps/service_maps.ts
index 9c01833f78e5d..b1e29b220dd5c 100644
--- a/x-pack/test/apm_api_integration/trial/tests/service_maps/service_maps.ts
+++ b/x-pack/test/apm_api_integration/trial/tests/service_maps/service_maps.ts
@@ -9,7 +9,6 @@ import expect from '@kbn/expect';
import { isEmpty, uniq } from 'lodash';
import archives_metadata from '../../../common/archives_metadata';
import { PromiseReturnType } from '../../../../../plugins/observability/typings/common';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
export default function serviceMapsApiTests({ getService }: FtrProviderContext) {
diff --git a/x-pack/test/apm_api_integration/trial/tests/services/top_services.ts b/x-pack/test/apm_api_integration/trial/tests/services/top_services.ts
index bb611013351d7..90cad966ba102 100644
--- a/x-pack/test/apm_api_integration/trial/tests/services/top_services.ts
+++ b/x-pack/test/apm_api_integration/trial/tests/services/top_services.ts
@@ -5,7 +5,6 @@
*/
import expect from '@kbn/expect';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { PromiseReturnType } from '../../../../../plugins/observability/typings/common';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
import archives_metadata from '../../../common/archives_metadata';
diff --git a/x-pack/test/apm_api_integration/trial/tests/services/transaction_groups_charts.ts b/x-pack/test/apm_api_integration/trial/tests/services/transaction_groups_charts.ts
index 47e465596e0d7..99e90b8433c84 100644
--- a/x-pack/test/apm_api_integration/trial/tests/services/transaction_groups_charts.ts
+++ b/x-pack/test/apm_api_integration/trial/tests/services/transaction_groups_charts.ts
@@ -5,7 +5,6 @@
*/
import expect from '@kbn/expect';
-import { expectSnapshot } from '../../../common/match_snapshot';
import { PromiseReturnType } from '../../../../../plugins/observability/typings/common';
import { FtrProviderContext } from '../../../common/ftr_provider_context';
import archives_metadata from '../../../common/archives_metadata';
diff --git a/x-pack/test/mocha_decorations.d.ts b/x-pack/test/mocha_decorations.d.ts
deleted file mode 100644
index 44f43a22de1f9..0000000000000
--- a/x-pack/test/mocha_decorations.d.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;
- * you may not use this file except in compliance with the Elastic License.
- */
-
-import { Suite } from 'mocha';
-
-// We need to use the namespace here to match the Mocha definition
-declare module 'mocha' {
- interface Suite {
- /**
- * Assign tags to the test suite to determine in which CI job it should be run.
- */
- tags(tags: string[] | string): void;
- }
-}
diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json
index e041292ebf3c9..3ac7026d16a17 100644
--- a/x-pack/test/tsconfig.json
+++ b/x-pack/test/tsconfig.json
@@ -5,7 +5,7 @@
"incremental": false,
"types": ["mocha", "node", "flot"]
},
- "include": ["**/*", "../typings/**/*"],
+ "include": ["**/*", "../typings/**/*", "../../packages/kbn-test/types/ftr_globals/**/*"],
"exclude": ["../typings/jest.d.ts"],
"references": [
{ "path": "../../src/core/tsconfig.json" },
diff --git a/yarn.lock b/yarn.lock
index 2a82e7024a895..9be39ea18e3d1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -18798,24 +18798,24 @@ livereload-js@^2.3.0:
resolved "https://registry.yarnpkg.com/livereload-js/-/livereload-js-2.4.0.tgz#447c31cf1ea9ab52fc20db615c5ddf678f78009c"
integrity sha512-XPQH8Z2GDP/Hwz2PCDrh2mth4yFejwA1OZ/81Ti3LgKyhDcEjsSsqFWZojHG0va/duGd+WyosY7eXLDoOyqcPw==
-lmdb-store-0.9@0.7.2:
- version "0.7.2"
- resolved "https://registry.yarnpkg.com/lmdb-store-0.9/-/lmdb-store-0.9-0.7.2.tgz#45b907a46d0a676fee955629bd2f70f06efb26bb"
- integrity sha512-/MO8G6p4l7ku1ltCCdE/2ZOtSQBSM0B02vIemMHjoKgjE/fooanJYXIFwtZYM5r/hBDxmO+L3q5ASAXbfHQ6pQ==
+lmdb-store-0.9@0.7.3:
+ version "0.7.3"
+ resolved "https://registry.yarnpkg.com/lmdb-store-0.9/-/lmdb-store-0.9-0.7.3.tgz#c2cb27dfa916ab966cceed692c67e4236813104a"
+ integrity sha512-t8iCnN6T3NZPFelPmjYIjCg+nhGbOdc0xcHCG40v01AWRTN49OINSt2k/u+16/2/HrI+b6Ssb8WByXUhbyHz6w==
dependencies:
fs-extra "^9.0.1"
msgpackr "^0.5.3"
nan "^2.14.1"
node-gyp-build "^4.2.3"
- weak-lru-cache "^0.2.0"
+ weak-lru-cache "^0.3.9"
-lmdb-store@^0.8.11:
- version "0.8.11"
- resolved "https://registry.yarnpkg.com/lmdb-store/-/lmdb-store-0.8.11.tgz#7f7c756a115ceab32c51c0948444bfd5d1716ab3"
- integrity sha512-CFgxh2/TL1NXyJ8FQPXY50O/gADxih7Gx0RjKRScGlyxihqSLd/fGzMkbvDdeAOAS8bsnYpLojAMTSeNiwN8dQ==
+lmdb-store@^0.8.15:
+ version "0.8.15"
+ resolved "https://registry.yarnpkg.com/lmdb-store/-/lmdb-store-0.8.15.tgz#4efb0341c2df505dd6f3a7f26f834f0a142a80a2"
+ integrity sha512-4Q0WZh2FmcJC6esZRUWMfkCmNiz0WU9cOgrxt97ZMTnVfHyOdZhtrt0oOF5EQPfetxxJf/BorKY28aX92R6G6g==
dependencies:
fs-extra "^9.0.1"
- lmdb-store-0.9 "0.7.2"
+ lmdb-store-0.9 "0.7.3"
msgpackr "^0.5.4"
nan "^2.14.1"
node-gyp-build "^4.2.3"
@@ -29141,11 +29141,6 @@ wcwidth@^1.0.1:
dependencies:
defaults "^1.0.3"
-weak-lru-cache@^0.2.0:
- version "0.2.0"
- resolved "https://registry.yarnpkg.com/weak-lru-cache/-/weak-lru-cache-0.2.0.tgz#447379ccff6dfda1b7a9566c9ef168260be859d1"
- integrity sha512-M1l5CzKvM7maa7tCbtL0NW6sOnp8gqup853+9Aq7GL0XNWKNnFOkeE3v3Z5X2IeMzedPwQyPbi4RlFvD6rxs7A==
-
weak-lru-cache@^0.3.9:
version "0.3.9"
resolved "https://registry.yarnpkg.com/weak-lru-cache/-/weak-lru-cache-0.3.9.tgz#9e56920d4115e8542625d8ef8cc278cbd97f7624"