Skip to content

Commit

Permalink
Merge branch 'main' into mget-ech
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Oct 15, 2024
2 parents e4543b6 + d9cd17b commit 10b40bf
Show file tree
Hide file tree
Showing 57 changed files with 1,219 additions and 186 deletions.
3 changes: 1 addition & 2 deletions src/cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const program = new Command('bin/kibana');
program
.version(pkg.version)
.description(
'Kibana is an open and free, browser ' +
'based analytics and search dashboard for Elasticsearch.'
'Kibana is an open source, browser based analytics and search dashboard for Elasticsearch.'
);

// attach commands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"action_task_params": "b50cb5c8a493881474918e8d4985e61374ca4c30",
"ad_hoc_run_params": "d4e3c5c794151d0a4f5c71e886b2aa638da73ad2",
"alert": "05b07040b12ff45ab642f47464e8a6c903cf7b86",
"api_key_pending_invalidation": "1399e87ca37b3d3a65d269c924eda70726cfe886",
"api_key_pending_invalidation": "8f5554d1984854011b8392d9a6f7ef985bcac03c",
"apm-custom-dashboards": "b67128f78160c288bd7efe25b2da6e2afd5e82fc",
"apm-indices": "8a2d68d415a4b542b26b0d292034a28ffac6fed4",
"apm-server-schema": "58a8c6468edae3d1dc520f0134f59cf3f4fd7eff",
Expand All @@ -83,7 +83,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"cloud-security-posture-settings": "e0f61c68bbb5e4cfa46ce8994fa001e417df51ca",
"config": "179b3e2bc672626aafce3cf92093a113f456af38",
"config-global": "8e8a134a2952df700d7d4ec51abb794bbd4cf6da",
"connector_token": "5a9ac29fe9c740eb114e9c40517245c71706b005",
"connector_token": "79977ea2cb1530ba7e315b95c1b5a524b622a6b3",
"core-usage-stats": "b3c04da317c957741ebcdedfea4524049fdc79ff",
"csp-rule-template": "c151324d5f85178169395eecb12bac6b96064654",
"dashboard": "211e9ca30f5a95d5f3c27b1bf2b58e6cfa0c9ae9",
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"lens": "5cfa2c52b979b4f8df56dd13c477e152183468b9",
"lens-ui-telemetry": "8c47a9e393861f76e268345ecbadfc8a5fb1e0bd",
"links": "1dd432cc94619a513b75cec43660a50be7aadc90",
"maintenance-window": "d893544460abad56ff7a0e25b78f78776dfe10d1",
"maintenance-window": "bf36863f5577c2d22625258bdad906eeb4cccccc",
"map": "76c71023bd198fb6b1163b31bafd926fe2ceb9da",
"metrics-data-source": "81b69dc9830699d9ead5ac8dcb9264612e2a3c89",
"metrics-explorer-view": "98cf395d0e87b89ab63f173eae16735584a8ff42",
Expand All @@ -147,7 +147,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"policy-settings-protection-updates-note": "33924bb246f9e5bcb876109cc83e3c7a28308352",
"query": "501bece68f26fe561286a488eabb1a8ab12f1137",
"risk-engine-configuration": "bab237d09c2e7189dddddcb1b28f19af69755efb",
"rules-settings": "892a2918ebaeba809a612b8d97cec0b07c800b5f",
"rules-settings": "ba57ef1881b3dcbf48fbfb28902d8f74442190b2",
"sample-data-telemetry": "37441b12f5b0159c2d6d5138a494c9f440e950b5",
"search": "0aa6eefb37edd3145be340a8b67779c2ca578b22",
"search-session": "b2fcd840e12a45039ada50b1355faeafa39876d1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,12 @@ const DatasetQualityLink = React.memo(
urlService: BrowserUrlService;
dataStream: string | undefined;
}) => {
if (!dataStream) {
return null;
}
const locator = urlService.locators.get<DataQualityDetailsLocatorParams>(
DATA_QUALITY_DETAILS_LOCATOR_ID
);

if (!locator || !dataStream) return null;

const datasetQualityUrl = locator?.getRedirectUrl({ dataStream });

const navigateToDatasetQuality = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ export const OptionsListPopover = ({
}: OptionsListPopoverProps) => {
const { populatedFields } = useFieldStatsFlyoutContext();

const [showEmptyFields, setShowEmptyFields] = useState(false);
const [showEmptyFields, setShowEmptyFields] = useState(
populatedFields ? !(populatedFields.size > 0) : true
);
const id = useMemo(() => htmlIdGenerator()(), []);

const filteredOptions = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@

import type { FC } from 'react';
import React, { useMemo, useState } from 'react';
import type { EuiComboBoxOptionOption, EuiComboBoxSingleSelectionShape } from '@elastic/eui';
import type {
EuiComboBoxOptionOption,
EuiComboBoxSingleSelectionShape,
EuiFormControlLayoutProps,
} from '@elastic/eui';
import { EuiInputPopover, htmlIdGenerator, EuiFormControlLayout, EuiFieldText } from '@elastic/eui';
import { css } from '@emotion/react';
import { i18n } from '@kbn/i18n';
Expand All @@ -18,8 +22,6 @@ import type { DropDownLabel } from './types';
const MIN_POPOVER_WIDTH = 400;

export const optionCss = css`
display: flex;
align-items: center;
.euiComboBoxOption__enterBadge {
display: none;
}
Expand All @@ -31,7 +33,8 @@ export const optionCss = css`
}
`;

interface OptionListWithFieldStatsProps {
interface OptionListWithFieldStatsProps
extends Pick<EuiFormControlLayoutProps, 'prepend' | 'compressed'> {
options: DropDownLabel[];
placeholder?: string;
'aria-label'?: string;
Expand All @@ -58,6 +61,8 @@ export const OptionListWithFieldStats: FC<OptionListWithFieldStatsProps> = ({
isDisabled,
isLoading,
isClearable = true,
prepend,
compressed,
'aria-label': ariaLabel,
'data-test-subj': dataTestSubj,
}) => {
Expand All @@ -68,13 +73,12 @@ export const OptionListWithFieldStats: FC<OptionListWithFieldStatsProps> = ({
const comboBoxOptions: DropDownLabel[] = useMemo(
() =>
Array.isArray(options)
? options.map(({ isEmpty, hideTrigger: hideInspectButton, ...o }) => ({
? options.map(({ isEmpty, ...o }) => ({
...o,
css: optionCss,
// Change data-is-empty- because EUI is passing all props to dom element
// so isEmpty is invalid, but we need this info to render option correctly
'data-is-empty': isEmpty,
'data-hide-inspect': hideInspectButton,
}))
: [],
[options]
Expand All @@ -89,6 +93,8 @@ export const OptionListWithFieldStats: FC<OptionListWithFieldStatsProps> = ({
id={popoverId}
input={
<EuiFormControlLayout
prepend={prepend}
compressed={compressed}
fullWidth={fullWidth}
// Adding classname to make functional tests similar to EuiComboBox
className={singleSelection ? 'euiComboBox__inputWrap--plainText' : ''}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import type { EuiComboBoxOptionOption, EuiSelectableOption } from '@elastic/eui'
import type { Aggregation, Field } from '@kbn/ml-anomaly-utils';

interface BaseOption<T> {
key?: string;
label: string | React.ReactNode;
key?: string;
value?: string | number | string[];
isEmpty?: boolean;
hideTrigger?: boolean;
'data-is-empty'?: boolean;
Expand Down
8 changes: 6 additions & 2 deletions x-pack/plugins/actions/server/saved_objects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import type {
import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server';
import { getOldestIdleActionTask } from '@kbn/task-manager-plugin/server';
import { ALERTING_CASES_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server';
import { actionTaskParamsModelVersions } from './model_versions';
import { actionMappings, actionTaskParamsMappings, connectorTokenMappings } from './mappings';
import { getActionsMigrations } from './actions_migrations';
import { getActionTaskParamsMigrations } from './action_task_params_migrations';
Expand All @@ -26,7 +25,11 @@ import {
ACTION_TASK_PARAMS_SAVED_OBJECT_TYPE,
CONNECTOR_TOKEN_SAVED_OBJECT_TYPE,
} from '../constants/saved_objects';
import { connectorModelVersions } from './model_versions';
import {
actionTaskParamsModelVersions,
connectorModelVersions,
connectorTokenModelVersions,
} from './model_versions';

export function setupSavedObjects(
savedObjects: SavedObjectsServiceSetup,
Expand Down Expand Up @@ -121,6 +124,7 @@ export function setupSavedObjects(
management: {
importableAndExportable: false,
},
modelVersions: connectorTokenModelVersions,
});

encryptedSavedObjects.registerType({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server';
import { rawConnectorTokenSchemaV1 } from '../schemas/raw_connector_token';

export const connectorTokenModelVersions: SavedObjectsModelVersionMap = {
'1': {
changes: [],
schemas: {
forwardCompatibility: rawConnectorTokenSchemaV1.extends({}, { unknowns: 'ignore' }),
create: rawConnectorTokenSchemaV1,
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
*/

export { connectorModelVersions } from './connector_model_versions';
export { connectorTokenModelVersions } from './connector_token_model_versions';
export { actionTaskParamsModelVersions } from './action_task_params_model_versions';
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export { rawConnectorTokenSchema as rawConnectorTokenSchemaV1 } from './v1';
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { schema } from '@kbn/config-schema';

export const rawConnectorTokenSchema = schema.object({
createdAt: schema.string(),
connectorId: schema.string(),
expiresAt: schema.string(),
token: schema.string(),
tokenType: schema.string(),
updatedAt: schema.string(),
});
11 changes: 10 additions & 1 deletion x-pack/plugins/alerting/server/saved_objects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ import {
RULES_SETTINGS_SAVED_OBJECT_TYPE,
MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE,
} from '../../common';
import { ruleModelVersions, adHocRunParamsModelVersions } from './model_versions';
import {
adHocRunParamsModelVersions,
apiKeyPendingInvalidationModelVersions,
maintenanceWindowModelVersions,
ruleModelVersions,
rulesSettingsModelVersions,
} from './model_versions';

export const RULE_SAVED_OBJECT_TYPE = 'alert';
export const AD_HOC_RUN_SAVED_OBJECT_TYPE = 'ad_hoc_run_params';
Expand Down Expand Up @@ -145,6 +151,7 @@ export function setupSavedObjects(
},
},
},
modelVersions: apiKeyPendingInvalidationModelVersions,
});

savedObjects.registerType({
Expand All @@ -153,6 +160,7 @@ export function setupSavedObjects(
hidden: true,
namespaceType: 'single',
mappings: rulesSettingsMappings,
modelVersions: rulesSettingsModelVersions,
});

savedObjects.registerType({
Expand All @@ -161,6 +169,7 @@ export function setupSavedObjects(
hidden: true,
namespaceType: 'multiple-isolated',
mappings: maintenanceWindowMappings,
modelVersions: maintenanceWindowModelVersions,
});

savedObjects.registerType({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server';
import { rawApiKeyPendingInvalidationSchemaV1 } from '../schemas/raw_api_key_pending_invalidation';

export const apiKeyPendingInvalidationModelVersions: SavedObjectsModelVersionMap = {
'1': {
changes: [],
schemas: {
forwardCompatibility: rawApiKeyPendingInvalidationSchemaV1.extends(
{},
{ unknowns: 'ignore' }
),
create: rawApiKeyPendingInvalidationSchemaV1,
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
*/

export { adHocRunParamsModelVersions } from './ad_hoc_run_params_model_versions';
export { apiKeyPendingInvalidationModelVersions } from './api_key_pending_invalidation_model_versions';
export { maintenanceWindowModelVersions } from './maintenance_window_model_versions';
export { ruleModelVersions } from './rule_model_versions';
export { rulesSettingsModelVersions } from './rules_settings_model_versions';
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server';
import { rawMaintenanceWindowSchemaV1 } from '../schemas/raw_maintenance_window';

export const maintenanceWindowModelVersions: SavedObjectsModelVersionMap = {
'1': {
changes: [],
schemas: {
forwardCompatibility: rawMaintenanceWindowSchemaV1.extends({}, { unknowns: 'ignore' }),
create: rawMaintenanceWindowSchemaV1,
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server';
import { rawRulesSettingsSchemaV1 } from '../schemas/raw_rules_settings';

export const rulesSettingsModelVersions: SavedObjectsModelVersionMap = {
'1': {
changes: [],
schemas: {
forwardCompatibility: rawRulesSettingsSchemaV1.extends({}, { unknowns: 'ignore' }),
create: rawRulesSettingsSchemaV1,
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export { rawApiKeyPendingInvalidationSchema as rawApiKeyPendingInvalidationSchemaV1 } from './v1';
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { schema } from '@kbn/config-schema';

export const rawApiKeyPendingInvalidationSchema = schema.object({
apiKeyId: schema.string(),
createdAt: schema.string(),
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export { rawMaintenanceWindowSchema as rawMaintenanceWindowSchemaV1 } from './v1';
Loading

0 comments on commit 10b40bf

Please sign in to comment.