Skip to content

Commit

Permalink
Merge remote-tracking branch 'elastic/7.x' into backport/7.x/pr-114768
Browse files Browse the repository at this point in the history
  • Loading branch information
sebelga committed Oct 19, 2021
2 parents 21046ff + 361ba92 commit 7bb4b63
Show file tree
Hide file tree
Showing 163 changed files with 2,301 additions and 1,411 deletions.
2 changes: 1 addition & 1 deletion src/core/public/chrome/ui/header/collapsible_nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ export function CollapsibleNav({
iconType="plusInCircleFilled"
>
{i18n.translate('core.ui.primaryNav.addData', {
defaultMessage: 'Add data',
defaultMessage: 'Add integrations',
})}
</EuiButton>
</EuiCollapsibleNavGroup>
Expand Down
93 changes: 58 additions & 35 deletions src/core/server/config/deprecation/core_deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const kibanaPathConf: ConfigDeprecation = (settings, fromPath, addDeprecation) =
if (process.env?.KIBANA_PATH_CONF) {
addDeprecation({
configPath: 'env.KIBANA_PATH_CONF',
level: 'critical',
message: `Environment variable "KIBANA_PATH_CONF" is deprecated. It has been replaced with "KBN_PATH_CONF" pointing to a config folder`,
correctiveActions: {
manualSteps: [
Expand All @@ -27,6 +28,7 @@ const configPathDeprecation: ConfigDeprecation = (settings, fromPath, addDepreca
if (process.env?.CONFIG_PATH) {
addDeprecation({
configPath: 'env.CONFIG_PATH',
level: 'critical',
message: `Environment variable "CONFIG_PATH" is deprecated. It has been replaced with "KBN_PATH_CONF" pointing to a config folder`,
correctiveActions: {
manualSteps: ['Use "KBN_PATH_CONF" instead of "CONFIG_PATH" to point to a config folder.'],
Expand All @@ -39,6 +41,7 @@ const dataPathDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecati
if (process.env?.DATA_PATH) {
addDeprecation({
configPath: 'env.DATA_PATH',
level: 'critical',
message: `Environment variable "DATA_PATH" will be removed. It has been replaced with kibana.yml setting "path.data"`,
correctiveActions: {
manualSteps: [
Expand All @@ -53,13 +56,13 @@ const rewriteBasePathDeprecation: ConfigDeprecation = (settings, fromPath, addDe
if (settings.server?.basePath && !settings.server?.rewriteBasePath) {
addDeprecation({
configPath: 'server.basePath',
level: 'warning',
title: 'Setting "server.rewriteBasePath" should be set when using "server.basePath"',
message:
'You should set server.basePath along with server.rewriteBasePath. Starting in 7.0, Kibana ' +
'will expect that all requests start with server.basePath rather than expecting you to rewrite ' +
'the requests in your reverse proxy. Set server.rewriteBasePath to false to preserve the ' +
'current behavior and silence this warning.',
level: 'warning',
correctiveActions: {
manualSteps: [
`Set 'server.rewriteBasePath' in the config file, CLI flag, or environment variable (in Docker only).`,
Expand All @@ -75,6 +78,7 @@ const rewriteCorsSettings: ConfigDeprecation = (settings, fromPath, addDeprecati
if (typeof corsSettings === 'boolean') {
addDeprecation({
configPath: 'server.cors',
level: 'warning',
title: 'Setting "server.cors" is deprecated',
message: '"server.cors" is deprecated and has been replaced by "server.cors.enabled"',
correctiveActions: {
Expand Down Expand Up @@ -113,6 +117,7 @@ const cspRulesDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecati
if (sourceList.find((source) => source.includes(NONCE_STRING))) {
addDeprecation({
configPath: 'csp.rules',
level: 'critical',
message: `csp.rules no longer supports the {nonce} syntax. Replacing with 'self' in ${policy}`,
correctiveActions: {
manualSteps: [`Replace {nonce} syntax with 'self' in ${policy}`],
Expand All @@ -132,6 +137,7 @@ const cspRulesDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecati
) {
addDeprecation({
configPath: 'csp.rules',
level: 'critical',
message: `csp.rules must contain the 'self' source. Automatically adding to ${policy}.`,
correctiveActions: {
manualSteps: [`Add 'self' source to ${policy}.`],
Expand All @@ -156,6 +162,7 @@ const mapManifestServiceUrlDeprecation: ConfigDeprecation = (
if (settings.map?.manifestServiceUrl) {
addDeprecation({
configPath: 'map.manifestServiceUrl',
level: 'critical',
message:
'You should no longer use the map.manifestServiceUrl setting in kibana.yml to configure the location ' +
'of the Elastic Maps Service settings. These settings have moved to the "map.emsTileApiUrl" and ' +
Expand All @@ -175,6 +182,7 @@ const serverHostZeroDeprecation: ConfigDeprecation = (settings, fromPath, addDep
if (settings.server?.host === '0') {
addDeprecation({
configPath: 'server.host',
level: 'critical',
message:
'Support for setting server.host to "0" in kibana.yml is deprecated and will be removed in Kibana version 8.0.0. ' +
'Instead use "0.0.0.0" to bind to all interfaces.',
Expand Down Expand Up @@ -206,6 +214,7 @@ const opsLoggingEventDeprecation: ConfigDeprecation = (
if (settings.logging?.events?.ops) {
addDeprecation({
configPath: 'logging.events.ops',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingevents`,
title: i18n.translate('core.deprecations.loggingEventsOps.deprecationTitle', {
defaultMessage: `Setting "logging.events.ops" is deprecated`,
Expand Down Expand Up @@ -237,6 +246,7 @@ const requestLoggingEventDeprecation: ConfigDeprecation = (
if (settings.logging?.events?.request) {
addDeprecation({
configPath: 'logging.events.request',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingevents`,
title: i18n.translate('core.deprecations.loggingEventsRequest.deprecationTitle', {
defaultMessage: `Setting "logging.events.request" is deprecated`,
Expand Down Expand Up @@ -268,6 +278,7 @@ const responseLoggingEventDeprecation: ConfigDeprecation = (
if (settings.logging?.events?.response) {
addDeprecation({
configPath: 'logging.events.response',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingevents`,
title: i18n.translate('core.deprecations.loggingEventsResponse.deprecationTitle', {
defaultMessage: `Setting "logging.events.response" is deprecated`,
Expand Down Expand Up @@ -299,6 +310,7 @@ const timezoneLoggingDeprecation: ConfigDeprecation = (
if (settings.logging?.timezone) {
addDeprecation({
configPath: 'logging.timezone',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingtimezone`,
title: i18n.translate('core.deprecations.loggingTimezone.deprecationTitle', {
defaultMessage: `Setting "logging.timezone" is deprecated`,
Expand Down Expand Up @@ -330,6 +342,7 @@ const destLoggingDeprecation: ConfigDeprecation = (
if (settings.logging?.dest) {
addDeprecation({
configPath: 'logging.dest',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingdest`,
title: i18n.translate('core.deprecations.loggingDest.deprecationTitle', {
defaultMessage: `Setting "logging.dest" is deprecated`,
Expand Down Expand Up @@ -361,6 +374,7 @@ const quietLoggingDeprecation: ConfigDeprecation = (
if (settings.logging?.quiet) {
addDeprecation({
configPath: 'logging.quiet',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingquiet`,
title: i18n.translate('core.deprecations.loggingQuiet.deprecationTitle', {
defaultMessage: `Setting "logging.quiet" is deprecated`,
Expand Down Expand Up @@ -391,6 +405,7 @@ const silentLoggingDeprecation: ConfigDeprecation = (
if (settings.logging?.silent) {
addDeprecation({
configPath: 'logging.silent',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingsilent`,
title: i18n.translate('core.deprecations.loggingSilent.deprecationTitle', {
defaultMessage: `Setting "logging.silent" is deprecated`,
Expand Down Expand Up @@ -421,6 +436,7 @@ const verboseLoggingDeprecation: ConfigDeprecation = (
if (settings.logging?.verbose) {
addDeprecation({
configPath: 'logging.verbose',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingverbose`,
title: i18n.translate('core.deprecations.loggingVerbose.deprecationTitle', {
defaultMessage: `Setting "logging.verbose" is deprecated`,
Expand Down Expand Up @@ -455,6 +471,7 @@ const jsonLoggingDeprecation: ConfigDeprecation = (
if (settings.logging?.json && settings.env !== 'development') {
addDeprecation({
configPath: 'logging.json',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx`,
title: i18n.translate('core.deprecations.loggingJson.deprecationTitle', {
defaultMessage: `Setting "logging.json" is deprecated`,
Expand Down Expand Up @@ -487,6 +504,7 @@ const logRotateDeprecation: ConfigDeprecation = (
if (settings.logging?.rotate) {
addDeprecation({
configPath: 'logging.rotate',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#rolling-file-appender`,
title: i18n.translate('core.deprecations.loggingRotate.deprecationTitle', {
defaultMessage: `Setting "logging.rotate" is deprecated`,
Expand Down Expand Up @@ -518,6 +536,7 @@ const logEventsLogDeprecation: ConfigDeprecation = (
if (settings.logging?.events?.log) {
addDeprecation({
configPath: 'logging.events.log',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingevents`,
title: i18n.translate('core.deprecations.loggingEventsLog.deprecationTitle', {
defaultMessage: `Setting "logging.events.log" is deprecated`,
Expand Down Expand Up @@ -548,6 +567,7 @@ const logEventsErrorDeprecation: ConfigDeprecation = (
if (settings.logging?.events?.error) {
addDeprecation({
configPath: 'logging.events.error',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingevents`,
title: i18n.translate('core.deprecations.loggingEventsError.deprecationTitle', {
defaultMessage: `Setting "logging.events.error" is deprecated`,
Expand Down Expand Up @@ -578,6 +598,7 @@ const logFilterDeprecation: ConfigDeprecation = (
if (settings.logging?.filter) {
addDeprecation({
configPath: 'logging.filter',
level: 'critical',
documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingfilter`,
title: i18n.translate('core.deprecations.loggingFilter.deprecationTitle', {
defaultMessage: `Setting "logging.filter" is deprecated`,
Expand All @@ -596,40 +617,42 @@ export const coreDeprecationProvider: ConfigDeprecationProvider = ({
unusedFromRoot,
renameFromRoot,
}) => [
unusedFromRoot('savedObjects.indexCheckTimeout'),
unusedFromRoot('server.xsrf.token'),
unusedFromRoot('maps.manifestServiceUrl'),
unusedFromRoot('optimize.lazy'),
unusedFromRoot('optimize.lazyPort'),
unusedFromRoot('optimize.lazyHost'),
unusedFromRoot('optimize.lazyPrebuild'),
unusedFromRoot('optimize.lazyProxyTimeout'),
unusedFromRoot('optimize.enabled'),
unusedFromRoot('optimize.bundleFilter'),
unusedFromRoot('optimize.bundleDir'),
unusedFromRoot('optimize.viewCaching'),
unusedFromRoot('optimize.watch'),
unusedFromRoot('optimize.watchPort'),
unusedFromRoot('optimize.watchHost'),
unusedFromRoot('optimize.watchPrebuild'),
unusedFromRoot('optimize.watchProxyTimeout'),
unusedFromRoot('optimize.useBundleCache'),
unusedFromRoot('optimize.sourceMaps'),
unusedFromRoot('optimize.workers'),
unusedFromRoot('optimize.profile'),
unusedFromRoot('optimize.validateSyntaxOfNodeModules'),
renameFromRoot('xpack.xpack_main.telemetry.config', 'telemetry.config'),
renameFromRoot('xpack.xpack_main.telemetry.url', 'telemetry.url'),
renameFromRoot('xpack.xpack_main.telemetry.enabled', 'telemetry.enabled'),
renameFromRoot('xpack.telemetry.enabled', 'telemetry.enabled'),
renameFromRoot('xpack.telemetry.config', 'telemetry.config'),
renameFromRoot('xpack.telemetry.banner', 'telemetry.banner'),
renameFromRoot('xpack.telemetry.url', 'telemetry.url'),
renameFromRoot('cpu.cgroup.path.override', 'ops.cGroupOverrides.cpuPath'),
renameFromRoot('cpuacct.cgroup.path.override', 'ops.cGroupOverrides.cpuAcctPath'),
renameFromRoot('server.xsrf.whitelist', 'server.xsrf.allowlist'),
unusedFromRoot('elasticsearch.preserveHost'),
unusedFromRoot('elasticsearch.startupTimeout'),
unusedFromRoot('savedObjects.indexCheckTimeout', { level: 'critical' }),
unusedFromRoot('server.xsrf.token', { level: 'critical' }),
unusedFromRoot('maps.manifestServiceUrl', { level: 'critical' }),
unusedFromRoot('optimize.lazy', { level: 'critical' }),
unusedFromRoot('optimize.lazyPort', { level: 'critical' }),
unusedFromRoot('optimize.lazyHost', { level: 'critical' }),
unusedFromRoot('optimize.lazyPrebuild', { level: 'critical' }),
unusedFromRoot('optimize.lazyProxyTimeout', { level: 'critical' }),
unusedFromRoot('optimize.enabled', { level: 'critical' }),
unusedFromRoot('optimize.bundleFilter', { level: 'critical' }),
unusedFromRoot('optimize.bundleDir', { level: 'critical' }),
unusedFromRoot('optimize.viewCaching', { level: 'critical' }),
unusedFromRoot('optimize.watch', { level: 'critical' }),
unusedFromRoot('optimize.watchPort', { level: 'critical' }),
unusedFromRoot('optimize.watchHost', { level: 'critical' }),
unusedFromRoot('optimize.watchPrebuild', { level: 'critical' }),
unusedFromRoot('optimize.watchProxyTimeout', { level: 'critical' }),
unusedFromRoot('optimize.useBundleCache', { level: 'critical' }),
unusedFromRoot('optimize.sourceMaps', { level: 'critical' }),
unusedFromRoot('optimize.workers', { level: 'critical' }),
unusedFromRoot('optimize.profile', { level: 'critical' }),
unusedFromRoot('optimize.validateSyntaxOfNodeModules', { level: 'critical' }),
renameFromRoot('xpack.xpack_main.telemetry.config', 'telemetry.config', { level: 'critical' }),
renameFromRoot('xpack.xpack_main.telemetry.url', 'telemetry.url', { level: 'critical' }),
renameFromRoot('xpack.xpack_main.telemetry.enabled', 'telemetry.enabled', { level: 'critical' }),
renameFromRoot('xpack.telemetry.enabled', 'telemetry.enabled', { level: 'critical' }),
renameFromRoot('xpack.telemetry.config', 'telemetry.config', { level: 'critical' }),
renameFromRoot('xpack.telemetry.banner', 'telemetry.banner', { level: 'critical' }),
renameFromRoot('xpack.telemetry.url', 'telemetry.url', { level: 'critical' }),
renameFromRoot('cpu.cgroup.path.override', 'ops.cGroupOverrides.cpuPath', { level: 'critical' }),
renameFromRoot('cpuacct.cgroup.path.override', 'ops.cGroupOverrides.cpuAcctPath', {
level: 'critical',
}),
renameFromRoot('server.xsrf.whitelist', 'server.xsrf.allowlist', { level: 'critical' }),
unusedFromRoot('elasticsearch.preserveHost', { level: 'critical' }),
unusedFromRoot('elasticsearch.startupTimeout', { level: 'critical' }),
rewriteCorsSettings,
configPathDeprecation,
kibanaPathConf,
Expand Down
1 change: 1 addition & 0 deletions src/core/server/kibana_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const deprecations: ConfigDeprecationProvider = () => [
if (kibana?.index) {
addDeprecation({
configPath: 'kibana.index',
level: 'critical',
title: i18n.translate('core.kibana.index.deprecationTitle', {
defaultMessage: `Setting "kibana.index" is deprecated`,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Discover topnav component', () => {
const props = getProps(true);
const component = shallowWithIntl(<DiscoverTopNav {...props} />);
const topMenuConfig = component.props().config.map((obj: TopNavMenuData) => obj.id);
expect(topMenuConfig).toEqual(['options', 'new', 'save', 'open', 'share', 'inspect']);
expect(topMenuConfig).toEqual(['options', 'new', 'open', 'share', 'inspect', 'save']);
});

test('generated config of TopNavMenu config is correct when no discover save permissions are assigned', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ test('getTopNavLinks result', () => {
"run": [Function],
"testId": "discoverNewButton",
},
Object {
"description": "Save Search",
"id": "save",
"label": "Save",
"run": [Function],
"testId": "discoverSaveButton",
},
Object {
"description": "Open Saved Search",
"id": "open",
Expand All @@ -81,6 +74,15 @@ test('getTopNavLinks result', () => {
"run": [Function],
"testId": "openInspectorButton",
},
Object {
"description": "Save Search",
"emphasize": true,
"iconType": "save",
"id": "save",
"label": "Save",
"run": [Function],
"testId": "discoverSaveButton",
},
]
`);
});
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ export const getTopNavLinks = ({
defaultMessage: 'Save Search',
}),
testId: 'discoverSaveButton',
iconType: 'save',
emphasize: true,
run: () => onSaveSearch({ savedSearch, services, indexPattern, navigateTo, state }),
};

Expand Down Expand Up @@ -153,9 +155,9 @@ export const getTopNavLinks = ({
return [
...(services.capabilities.advancedSettings.save ? [options] : []),
newSearch,
...(services.capabilities.discover.save ? [saveSearch] : []),
openSearch,
shareSearch,
inspectSearch,
...(services.capabilities.discover.save ? [saveSearch] : []),
];
};
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,19 @@ export async function onSaveSearch({
const onSave = async ({
newTitle,
newCopyOnSave,
newDescription,
isTitleDuplicateConfirmed,
onTitleDuplicate,
}: {
newTitle: string;
newCopyOnSave: boolean;
newDescription: string;
isTitleDuplicateConfirmed: boolean;
onTitleDuplicate: () => void;
}) => {
const currentTitle = savedSearch.title;
savedSearch.title = newTitle;
savedSearch.description = newDescription;
const saveOptions: SaveSavedSearchOptions = {
onTitleDuplicate,
copyOnSave: newCopyOnSave,
Expand Down Expand Up @@ -136,14 +139,11 @@ export async function onSaveSearch({
onClose={() => {}}
title={savedSearch.title ?? ''}
showCopyOnSave={!!savedSearch.id}
description={savedSearch.description}
objectType={i18n.translate('discover.localMenu.saveSaveSearchObjectType', {
defaultMessage: 'search',
})}
description={i18n.translate('discover.localMenu.saveSaveSearchDescription', {
defaultMessage:
'Save your Discover search so you can use it in visualizations and dashboards',
})}
showDescription={false}
showDescription={true}
/>
);
showSaveModal(saveModal, services.core.i18n.Context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ export class SavedSearchEmbeddable
return this.inspectorAdapters;
}

public getDescription() {
return this.savedSearch.description;
}

public destroy() {
super.destroy();
if (this.searchProps) {
Expand Down
Loading

0 comments on commit 7bb4b63

Please sign in to comment.