= {
+ 'MY_UI_SETTING': { type: 'keyword' },
+}
+```
+
+2. Update the [UsageStats interface](./types.ts) with the setting name and typescript type.
+```
+export interface UsageStats {
+ 'MY_UI_SETTING': string;
+}
+```
+3. Run the telemetry checker with `--fix` flag to automatically fix the mappings
+
+```
+node scripts/telemetry_check --fix
+```
+
+If you forget any of the steps our telemetry tools and tests will help you through the process!
+
+## Sensitive fields
+
+If the configured UI setting might contain user sensitive information simply add the property `sensitive: true` to the ui setting registration config.
+
+```
+uiSettings.register({
+ [NEWS_FEED_URL_SETTING]: {
+ name: i18n.translate('xpack.securitySolution.uiSettings.newsFeedUrl', {
+ defaultMessage: 'News feed URL',
+ }),
+ value: NEWS_FEED_URL_SETTING_DEFAULT,
+ sensitive: true,
+ description: i18n.translate('xpack.securitySolution.uiSettings.newsFeedUrlDescription', {
+ defaultMessage: 'News feed content will be retrieved from this URL
',
+ }),
+ category: [APP_ID],
+ requiresPageReload: true,
+ schema: schema.string(),
+ },
+}),
+```
+
+The value of any UI setting marked as `sensitive` will be reported as a keyword `[REDACTED]` instead of the actual value. This hides the actual sensitive information while giving us some intelligence over which fields the users are interactive with the most.
diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/__snapshots__/index.test.ts.snap b/src/plugins/kibana_usage_collection/server/collectors/management/__snapshots__/index.test.ts.snap
deleted file mode 100644
index def230dea8d70..0000000000000
--- a/src/plugins/kibana_usage_collection/server/collectors/management/__snapshots__/index.test.ts.snap
+++ /dev/null
@@ -1,7 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`telemetry_application_usage_collector fetch() 1`] = `
-Object {
- "my-key": "my-value",
-}
-`;
diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/index.test.ts b/src/plugins/kibana_usage_collection/server/collectors/management/index.test.ts
deleted file mode 100644
index 38baf02d6fe1b..0000000000000
--- a/src/plugins/kibana_usage_collection/server/collectors/management/index.test.ts
+++ /dev/null
@@ -1,61 +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
- * and the Server Side Public License, v 1; you may not use this file except in
- * compliance with, at your election, the Elastic License or the Server Side
- * Public License, v 1.
- */
-
-import { loggingSystemMock, uiSettingsServiceMock } from '../../../../../core/server/mocks';
-import {
- Collector,
- createUsageCollectionSetupMock,
- createCollectorFetchContextMock,
-} from '../../../../usage_collection/server/usage_collection.mock';
-
-import { registerManagementUsageCollector } from './';
-
-const logger = loggingSystemMock.createLogger();
-
-describe('telemetry_application_usage_collector', () => {
- let collector: Collector;
-
- const usageCollectionMock = createUsageCollectionSetupMock();
- usageCollectionMock.makeUsageCollector.mockImplementation((config) => {
- collector = new Collector(logger, config);
- return createUsageCollectionSetupMock().makeUsageCollector(config);
- });
-
- const uiSettingsClient = uiSettingsServiceMock.createClient();
- const getUiSettingsClient = jest.fn(() => uiSettingsClient);
- const mockedFetchContext = createCollectorFetchContextMock();
-
- beforeAll(() => {
- registerManagementUsageCollector(usageCollectionMock, getUiSettingsClient);
- });
-
- test('registered collector is set', () => {
- expect(collector).not.toBeUndefined();
- });
-
- test('isReady() => false if no client', () => {
- getUiSettingsClient.mockImplementationOnce(() => undefined as any);
- expect(collector.isReady()).toBe(false);
- });
-
- test('isReady() => true', () => {
- expect(collector.isReady()).toBe(true);
- });
-
- test('fetch()', async () => {
- uiSettingsClient.getUserProvided.mockImplementationOnce(async () => ({
- 'my-key': { userValue: 'my-value' },
- }));
- await expect(collector.fetch(mockedFetchContext)).resolves.toMatchSnapshot();
- });
-
- test('fetch() should not fail if invoked when not ready', async () => {
- getUiSettingsClient.mockImplementationOnce(() => undefined as any);
- await expect(collector.fetch(mockedFetchContext)).resolves.toBe(undefined);
- });
-});
diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts
index d75b2981035f4..b644f282c1f36 100644
--- a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts
+++ b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts
@@ -7,18 +7,25 @@
*/
import { MakeSchemaFrom } from 'src/plugins/usage_collection/server';
-import { UsageStats } from './telemetry_management_collector';
+import { UsageStats } from './types';
-// Retrieved by changing all the current settings in Kibana (we'll need to revisit it in the future).
-// I would suggest we use flattened type for the mappings of this collector.
export const stackManagementSchema: MakeSchemaFrom = {
+ // sensitive
+ 'timelion:quandl.key': { type: 'keyword' },
+ 'securitySolution:defaultIndex': { type: 'keyword' },
+ 'securitySolution:newsFeedUrl': { type: 'keyword' },
+ 'xpackReporting:customPdfLogo': { type: 'keyword' },
+ 'notifications:banner': { type: 'keyword' },
+ 'timelion:graphite.url': { type: 'keyword' },
+ 'xpackDashboardMode:roles': { type: 'keyword' },
+ 'securitySolution:ipReputationLinks': { type: 'keyword' },
+ // non-sensitive
'visualize:enableLabs': { type: 'boolean' },
'visualization:heatmap:maxBuckets': { type: 'long' },
'visualization:colorMapping': { type: 'text' },
'visualization:regionmap:showWarnings': { type: 'boolean' },
'visualization:dimmingOpacity': { type: 'float' },
'visualization:tileMap:maxPrecision': { type: 'long' },
- 'securitySolution:ipReputationLinks': { type: 'text' },
'csv:separator': { type: 'keyword' },
'visualization:tileMap:WMSdefaults': { type: 'text' },
'timelion:target_buckets': { type: 'long' },
@@ -27,14 +34,11 @@ export const stackManagementSchema: MakeSchemaFrom = {
'timelion:min_interval': { type: 'keyword' },
'timelion:default_rows': { type: 'long' },
'timelion:default_columns': { type: 'long' },
- 'timelion:quandl.key': { type: 'keyword' },
'timelion:es.default_index': { type: 'keyword' },
'timelion:showTutorial': { type: 'boolean' },
'securitySolution:timeDefaults': { type: 'keyword' },
'securitySolution:defaultAnomalyScore': { type: 'long' },
- 'securitySolution:defaultIndex': { type: 'keyword' }, // it's an array
'securitySolution:refreshIntervalDefaults': { type: 'keyword' },
- 'securitySolution:newsFeedUrl': { type: 'keyword' },
'securitySolution:enableNewsFeed': { type: 'boolean' },
'search:includeFrozen': { type: 'boolean' },
'courier:maxConcurrentShardRequests': { type: 'long' },
@@ -43,21 +47,29 @@ export const stackManagementSchema: MakeSchemaFrom = {
'courier:customRequestPreference': { type: 'keyword' },
'courier:ignoreFilterIfFieldNotInIndex': { type: 'boolean' },
'rollups:enableIndexPatterns': { type: 'boolean' },
- 'xpackReporting:customPdfLogo': { type: 'text' },
'notifications:lifetime:warning': { type: 'long' },
'notifications:lifetime:banner': { type: 'long' },
'notifications:lifetime:info': { type: 'long' },
- 'notifications:banner': { type: 'text' },
'notifications:lifetime:error': { type: 'long' },
'doc_table:highlight': { type: 'boolean' },
'discover:searchOnPageLoad': { type: 'boolean' },
// eslint-disable-next-line @typescript-eslint/naming-convention
'doc_table:hideTimeColumn': { type: 'boolean' },
'discover:sampleSize': { type: 'long' },
- defaultColumns: { type: 'keyword' }, // it's an array
+ defaultColumns: {
+ type: 'array',
+ items: {
+ type: 'keyword',
+ },
+ },
'context:defaultSize': { type: 'long' },
'discover:aggs:terms:size': { type: 'long' },
- 'context:tieBreakerFields': { type: 'keyword' }, // it's an array
+ 'context:tieBreakerFields': {
+ type: 'array',
+ items: {
+ type: 'keyword',
+ },
+ },
'discover:sort:defaultOrder': { type: 'keyword' },
'context:step': { type: 'long' },
'accessibility:disableAnimations': { type: 'boolean' },
@@ -77,10 +89,14 @@ export const stackManagementSchema: MakeSchemaFrom = {
'sort:options': { type: 'keyword' },
'savedObjects:listingLimit': { type: 'long' },
'query:queryString:options': { type: 'keyword' },
- pageNavigation: { type: 'keyword' },
'metrics:max_buckets': { type: 'long' },
'query:allowLeadingWildcards': { type: 'boolean' },
- metaFields: { type: 'keyword' }, // it's an array
+ metaFields: {
+ type: 'array',
+ items: {
+ type: 'keyword',
+ },
+ },
'indexPattern:placeholder': { type: 'keyword' },
'histogram:barTarget': { type: 'long' },
'histogram:maxBars': { type: 'long' },
@@ -102,4 +118,14 @@ export const stackManagementSchema: MakeSchemaFrom = {
'csv:quoteValues': { type: 'boolean' },
'dateFormat:dow': { type: 'keyword' },
dateFormat: { type: 'keyword' },
+ 'autocomplete:useTimeRange': { type: 'boolean' },
+ 'search:timeout': { type: 'long' },
+ 'visualization:visualize:legacyChartsLibrary': { type: 'boolean' },
+ 'doc_table:legacy': { type: 'boolean' },
+ 'discover:modifyColumnsOnSwitch': { type: 'boolean' },
+ 'discover:searchFieldsFromSource': { type: 'boolean' },
+ 'securitySolution:rulesTableRefresh': { type: 'text' },
+ 'apm:enableSignificantTerms': { type: 'boolean' },
+ 'apm:enableServiceOverview': { type: 'boolean' },
+ 'apm:enableCorrelations': { type: 'boolean' },
};
diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/telemetry_management_collector.test.ts b/src/plugins/kibana_usage_collection/server/collectors/management/telemetry_management_collector.test.ts
new file mode 100644
index 0000000000000..4bcd98f894e2a
--- /dev/null
+++ b/src/plugins/kibana_usage_collection/server/collectors/management/telemetry_management_collector.test.ts
@@ -0,0 +1,140 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * and the Server Side Public License, v 1; you may not use this file except in
+ * compliance with, at your election, the Elastic License or the Server Side
+ * Public License, v 1.
+ */
+
+import { loggingSystemMock, uiSettingsServiceMock } from '../../../../../core/server/mocks';
+import {
+ Collector,
+ createUsageCollectionSetupMock,
+ createCollectorFetchContextMock,
+} from '../../../../usage_collection/server/usage_collection.mock';
+
+import {
+ registerManagementUsageCollector,
+ createCollectorFetch,
+} from './telemetry_management_collector';
+
+const logger = loggingSystemMock.createLogger();
+
+describe('telemetry_application_usage_collector', () => {
+ let collector: Collector;
+
+ const usageCollectionMock = createUsageCollectionSetupMock();
+ usageCollectionMock.makeUsageCollector.mockImplementation((config) => {
+ collector = new Collector(logger, config);
+ return createUsageCollectionSetupMock().makeUsageCollector(config);
+ });
+
+ const uiSettingsClient = uiSettingsServiceMock.createClient();
+ const getUiSettingsClient = jest.fn(() => uiSettingsClient);
+ const mockedFetchContext = createCollectorFetchContextMock();
+
+ beforeAll(() => {
+ registerManagementUsageCollector(usageCollectionMock, getUiSettingsClient);
+ });
+
+ test('registered collector is set', () => {
+ expect(collector).not.toBeUndefined();
+ });
+
+ test('isReady() => false if no client', () => {
+ getUiSettingsClient.mockImplementationOnce(() => undefined as any);
+ expect(collector.isReady()).toBe(false);
+ });
+
+ test('isReady() => true', () => {
+ expect(collector.isReady()).toBe(true);
+ });
+
+ test('fetch()', async () => {
+ uiSettingsClient.getUserProvided.mockImplementationOnce(async () => ({
+ 'visualization:colorMapping': { userValue: 'red' },
+ }));
+ await expect(collector.fetch(mockedFetchContext)).resolves.toEqual({
+ 'visualization:colorMapping': 'red',
+ });
+ });
+
+ test('fetch() should not fail if invoked when not ready', async () => {
+ getUiSettingsClient.mockImplementationOnce(() => undefined as any);
+ await expect(collector.fetch(mockedFetchContext)).resolves.toBe(undefined);
+ });
+});
+
+describe('createCollectorFetch', () => {
+ const mockUserSettings = {
+ item1: { userValue: 'test' },
+ item2: { userValue: 123 },
+ item3: { userValue: false },
+ };
+
+ const mockIsSensitive = (key: string) => {
+ switch (key) {
+ case 'item1':
+ case 'item2':
+ return false;
+ case 'item3':
+ return true;
+ default:
+ throw new Error(`Unexpected ui setting: ${key}`);
+ }
+ };
+
+ it('returns #fetchUsageStats function', () => {
+ const getUiSettingsClient = jest.fn(() => undefined);
+ const fetchFunction = createCollectorFetch(getUiSettingsClient);
+ expect(typeof fetchFunction).toBe('function');
+ });
+
+ describe('#fetchUsageStats', () => {
+ it('returns undefined if no uiSettingsClient returned from getUiSettingsClient', async () => {
+ const getUiSettingsClient = jest.fn(() => undefined);
+ const fetchFunction = createCollectorFetch(getUiSettingsClient);
+ const result = await fetchFunction();
+ expect(result).toBe(undefined);
+ expect(getUiSettingsClient).toBeCalledTimes(1);
+ });
+
+ it('returns all user changed settings', async () => {
+ const uiSettingsClient = uiSettingsServiceMock.createClient();
+ const getUiSettingsClient = jest.fn(() => uiSettingsClient);
+ uiSettingsClient.getUserProvided.mockResolvedValue(mockUserSettings);
+ uiSettingsClient.isSensitive.mockImplementation(mockIsSensitive);
+ const fetchFunction = createCollectorFetch(getUiSettingsClient);
+ const result = await fetchFunction();
+ expect(typeof result).toBe('object');
+ expect(Object.keys(result!)).toEqual(Object.keys(mockUserSettings));
+ });
+
+ it('returns the actual values of non-sensitive settings', async () => {
+ const uiSettingsClient = uiSettingsServiceMock.createClient();
+ const getUiSettingsClient = jest.fn(() => uiSettingsClient);
+ uiSettingsClient.getUserProvided.mockResolvedValue(mockUserSettings);
+ uiSettingsClient.isSensitive.mockImplementation(mockIsSensitive);
+ const fetchFunction = createCollectorFetch(getUiSettingsClient);
+ const result = await fetchFunction();
+ expect(typeof result).toBe('object');
+ expect(result!).toMatchObject({
+ item1: 'test',
+ item2: 123,
+ });
+ });
+
+ it('returns [REDACTED] as a value for sensitive settings', async () => {
+ const uiSettingsClient = uiSettingsServiceMock.createClient();
+ const getUiSettingsClient = jest.fn(() => uiSettingsClient);
+ uiSettingsClient.getUserProvided.mockResolvedValue(mockUserSettings);
+ uiSettingsClient.isSensitive.mockImplementation(mockIsSensitive);
+ const fetchFunction = createCollectorFetch(getUiSettingsClient);
+ const result = await fetchFunction();
+ expect(typeof result).toBe('object');
+ expect(result!).toMatchObject({
+ item3: '[REDACTED]',
+ });
+ });
+ });
+});
diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/telemetry_management_collector.ts b/src/plugins/kibana_usage_collection/server/collectors/management/telemetry_management_collector.ts
index c45f3d6139d95..651fbbd5a897a 100644
--- a/src/plugins/kibana_usage_collection/server/collectors/management/telemetry_management_collector.ts
+++ b/src/plugins/kibana_usage_collection/server/collectors/management/telemetry_management_collector.ts
@@ -9,12 +9,8 @@
import { IUiSettingsClient } from 'kibana/server';
import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
import { stackManagementSchema } from './schema';
-
-export interface UsageStats extends Record {
- // We don't support `type` yet. Only interfaces. So I added at least 1 known key to the generic
- // Record extension to avoid eslint reverting it back to a `type`
- 'visualize:enableLabs': boolean;
-}
+import { UsageStats } from './types';
+import { REDACTED_KEYWORD } from '../../../common/constants';
export function createCollectorFetch(getUiSettingsClient: () => IUiSettingsClient | undefined) {
return async function fetchUsageStats(): Promise {
@@ -23,11 +19,12 @@ export function createCollectorFetch(getUiSettingsClient: () => IUiSettingsClien
return;
}
- const user = await uiSettingsClient.getUserProvided();
- const modifiedEntries = Object.keys(user)
- .filter((key: string) => key !== 'buildNum')
- .reduce((obj: any, key: string) => {
- obj[key] = user[key].userValue;
+ const userProvided = await uiSettingsClient.getUserProvided();
+ const modifiedEntries = Object.entries(userProvided)
+ .filter(([key]) => key !== 'buildNum')
+ .reduce((obj: any, [key, { userValue }]) => {
+ const sensitive = uiSettingsClient.isSensitive(key);
+ obj[key] = sensitive ? REDACTED_KEYWORD : userValue;
return obj;
}, {});
diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/types.ts b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts
new file mode 100644
index 0000000000000..417841ee89569
--- /dev/null
+++ b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts
@@ -0,0 +1,117 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * and the Server Side Public License, v 1; you may not use this file except in
+ * compliance with, at your election, the Elastic License or the Server Side
+ * Public License, v 1.
+ */
+
+export interface UsageStats {
+ /**
+ * sensitive settings
+ */
+ 'timelion:quandl.key': string;
+ 'securitySolution:defaultIndex': string;
+ 'securitySolution:newsFeedUrl': string;
+ 'xpackReporting:customPdfLogo': string;
+ 'notifications:banner': string;
+ 'timelion:graphite.url': string;
+ 'xpackDashboardMode:roles': string;
+ 'securitySolution:ipReputationLinks': string;
+ /**
+ * non-sensitive settings
+ */
+ 'autocomplete:useTimeRange': boolean;
+ 'search:timeout': number;
+ 'visualization:visualize:legacyChartsLibrary': boolean;
+ 'doc_table:legacy': boolean;
+ 'discover:modifyColumnsOnSwitch': boolean;
+ 'discover:searchFieldsFromSource': boolean;
+ 'securitySolution:rulesTableRefresh': string;
+ 'apm:enableSignificantTerms': boolean;
+ 'apm:enableServiceOverview': boolean;
+ 'apm:enableCorrelations': boolean;
+ 'visualize:enableLabs': boolean;
+ 'visualization:heatmap:maxBuckets': number;
+ 'visualization:colorMapping': string;
+ 'visualization:regionmap:showWarnings': boolean;
+ 'visualization:dimmingOpacity': number;
+ 'visualization:tileMap:maxPrecision': number;
+ 'csv:separator': string;
+ 'visualization:tileMap:WMSdefaults': string;
+ 'timelion:target_buckets': number;
+ 'timelion:max_buckets': number;
+ 'timelion:es.timefield': string;
+ 'timelion:min_interval': string;
+ 'timelion:default_rows': number;
+ 'timelion:default_columns': number;
+ 'timelion:es.default_index': string;
+ 'timelion:showTutorial': boolean;
+ 'securitySolution:timeDefaults': string;
+ 'securitySolution:defaultAnomalyScore': number;
+ 'securitySolution:refreshIntervalDefaults': string;
+ 'securitySolution:enableNewsFeed': boolean;
+ 'search:includeFrozen': boolean;
+ 'courier:maxConcurrentShardRequests': number;
+ 'courier:batchSearches': boolean;
+ 'courier:setRequestPreference': string;
+ 'courier:customRequestPreference': string;
+ 'courier:ignoreFilterIfFieldNotInIndex': boolean;
+ 'rollups:enableIndexPatterns': boolean;
+ 'notifications:lifetime:warning': number;
+ 'notifications:lifetime:banner': number;
+ 'notifications:lifetime:info': number;
+ 'notifications:lifetime:error': number;
+ 'doc_table:highlight': boolean;
+ 'discover:searchOnPageLoad': boolean;
+ // eslint-disable-next-line @typescript-eslint/naming-convention
+ 'doc_table:hideTimeColumn': boolean;
+ 'discover:sampleSize': number;
+ defaultColumns: string[];
+ 'context:defaultSize': number;
+ 'discover:aggs:terms:size': number;
+ 'context:tieBreakerFields': string[];
+ 'discover:sort:defaultOrder': string;
+ 'context:step': number;
+ 'accessibility:disableAnimations': boolean;
+ 'ml:fileDataVisualizerMaxFileSize': string;
+ 'ml:anomalyDetection:results:enableTimeDefaults': boolean;
+ 'ml:anomalyDetection:results:timeDefaults': string;
+ 'truncate:maxHeight': number;
+ 'timepicker:timeDefaults': string;
+ 'timepicker:refreshIntervalDefaults': string;
+ 'timepicker:quickRanges': string;
+ 'theme:version': string;
+ 'theme:darkMode': boolean;
+ 'state:storeInSessionStorage': boolean;
+ 'savedObjects:perPage': number;
+ 'search:queryLanguage': string;
+ 'shortDots:enable': boolean;
+ 'sort:options': string;
+ 'savedObjects:listingLimit': number;
+ 'query:queryString:options': string;
+ 'metrics:max_buckets': number;
+ 'query:allowLeadingWildcards': boolean;
+ metaFields: string[];
+ 'indexPattern:placeholder': string;
+ 'histogram:barTarget': number;
+ 'histogram:maxBars': number;
+ 'format:number:defaultLocale': string;
+ 'format:percent:defaultPattern': string;
+ 'format:number:defaultPattern': string;
+ 'history:limit': number;
+ 'format:defaultTypeMap': string;
+ 'format:currency:defaultPattern': string;
+ defaultIndex: string;
+ 'format:bytes:defaultPattern': string;
+ 'filters:pinnedByDefault': boolean;
+ 'filterEditor:suggestValues': boolean;
+ 'fields:popularLimit': number;
+ dateNanosFormat: string;
+ defaultRoute: string;
+ 'dateFormat:tz': string;
+ 'dateFormat:scaled': string;
+ 'csv:quoteValues': boolean;
+ 'dateFormat:dow': string;
+ dateFormat: string;
+}
diff --git a/src/plugins/lens_oss/README.md b/src/plugins/lens_oss/README.md
deleted file mode 100644
index 187da2497026e..0000000000000
--- a/src/plugins/lens_oss/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# lens_oss
-
-The lens_oss plugin registers the lens visualization on OSS.
-It is registered as disabled. The x-pack plugin should unregister this.
-
-`visualizations.unregisterAlias('lensOss')`
\ No newline at end of file
diff --git a/src/plugins/lens_oss/common/constants.ts b/src/plugins/lens_oss/common/constants.ts
deleted file mode 100644
index 0ff5cdd78bb1b..0000000000000
--- a/src/plugins/lens_oss/common/constants.ts
+++ /dev/null
@@ -1,12 +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
- * and the Server Side Public License, v 1; you may not use this file except in
- * compliance with, at your election, the Elastic License or the Server Side
- * Public License, v 1.
- */
-
-export const APP_NAME = 'lens';
-export const PLUGIN_ID_OSS = 'lensOss';
-export const APP_PATH = '#/';
-export const APP_ICON = 'lensApp';
diff --git a/src/plugins/lens_oss/kibana.json b/src/plugins/lens_oss/kibana.json
deleted file mode 100644
index 3e3d3585f37fb..0000000000000
--- a/src/plugins/lens_oss/kibana.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "id": "lensOss",
- "version": "kibana",
- "ui": true,
- "server": true,
- "requiredPlugins": [
- "visualizations"
- ],
- "extraPublicDirs": ["common/constants"]
-}
diff --git a/src/plugins/lens_oss/public/plugin.ts b/src/plugins/lens_oss/public/plugin.ts
deleted file mode 100644
index 5a441614b7e24..0000000000000
--- a/src/plugins/lens_oss/public/plugin.ts
+++ /dev/null
@@ -1,32 +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
- * and the Server Side Public License, v 1; you may not use this file except in
- * compliance with, at your election, the Elastic License or the Server Side
- * Public License, v 1.
- */
-
-import { DocLinksStart, CoreSetup } from 'src/core/public';
-import { VisualizationsSetup } from '../../visualizations/public';
-import { getLensAliasConfig } from './vis_type_alias';
-
-export interface LensPluginSetupDependencies {
- visualizations: VisualizationsSetup;
-}
-
-export interface LensPluginStartDependencies {
- docLinks: DocLinksStart;
-}
-
-export class LensOSSPlugin {
- setup(
- core: CoreSetup,
- { visualizations }: LensPluginSetupDependencies
- ) {
- core.getStartServices().then(([coreStart]) => {
- visualizations.registerAlias(getLensAliasConfig(coreStart.docLinks));
- });
- }
-
- start() {}
-}
diff --git a/src/plugins/lens_oss/public/vis_type_alias.ts b/src/plugins/lens_oss/public/vis_type_alias.ts
deleted file mode 100644
index b9806bbf3b4e5..0000000000000
--- a/src/plugins/lens_oss/public/vis_type_alias.ts
+++ /dev/null
@@ -1,37 +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
- * and the Server Side Public License, v 1; you may not use this file except in
- * compliance with, at your election, the Elastic License or the Server Side
- * Public License, v 1.
- */
-
-import { i18n } from '@kbn/i18n';
-import { VisTypeAlias } from 'src/plugins/visualizations/public';
-import { DocLinksStart } from 'src/core/public';
-import { APP_NAME, PLUGIN_ID_OSS, APP_PATH, APP_ICON } from '../common';
-
-export const getLensAliasConfig = ({ links }: DocLinksStart): VisTypeAlias => ({
- aliasPath: APP_PATH,
- aliasApp: APP_NAME,
- name: PLUGIN_ID_OSS,
- title: i18n.translate('lensOss.visTypeAlias.title', {
- defaultMessage: 'Lens',
- }),
- description: i18n.translate('lensOss.visTypeAlias.description', {
- defaultMessage:
- 'Create visualizations with our drag-and-drop editor. Switch between visualization types at any time. Best for most visualizations.',
- }),
- icon: APP_ICON,
- stage: 'production',
- disabled: true,
- note: i18n.translate('lensOss.visTypeAlias.note', {
- defaultMessage: 'Recommended for most users.',
- }),
- promoTooltip: {
- description: i18n.translate('lensOss.visTypeAlias.promoTooltip.description', {
- defaultMessage: 'Try Lens for free with Elastic. Learn more.',
- }),
- link: `${links.visualize.lens}?blade=kibanaossvizwizard`,
- },
-});
diff --git a/src/plugins/lens_oss/server/index.ts b/src/plugins/lens_oss/server/index.ts
deleted file mode 100644
index d13a9b2caaeb2..0000000000000
--- a/src/plugins/lens_oss/server/index.ts
+++ /dev/null
@@ -1,21 +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
- * and the Server Side Public License, v 1; you may not use this file except in
- * compliance with, at your election, the Elastic License or the Server Side
- * Public License, v 1.
- */
-
-import { PluginConfigDescriptor } from 'kibana/server';
-import { copyFromRoot } from '@kbn/config';
-import { configSchema, ConfigSchema } from '../config';
-
-export const config: PluginConfigDescriptor = {
- schema: configSchema,
- deprecations: () => [copyFromRoot('xpack.lens.enabled', 'lens_oss.enabled')],
-};
-
-export const plugin = () => ({
- setup() {},
- start() {},
-});
diff --git a/src/plugins/maps_legacy/public/index.ts b/src/plugins/maps_legacy/public/index.ts
index 95550fab1ba17..9268f14995f44 100644
--- a/src/plugins/maps_legacy/public/index.ts
+++ b/src/plugins/maps_legacy/public/index.ts
@@ -8,9 +8,7 @@
import { PluginInitializerContext } from 'kibana/public';
import { MapsLegacyPlugin } from './plugin';
-// @ts-ignore
import * as colorUtil from './map/color_util';
-// @ts-ignore
import { KibanaMapLayer } from './map/kibana_map_layer';
import {
VectorLayer,
@@ -19,7 +17,6 @@ import {
TmsLayer,
IServiceSettings,
} from './map/service_settings_types';
-// @ts-ignore
import { mapTooltipProvider } from './tooltip_provider';
import './map/index.scss';
diff --git a/src/plugins/maps_oss/public/index.ts b/src/plugins/maps_legacy/public/map/color_util.d.ts
similarity index 69%
rename from src/plugins/maps_oss/public/index.ts
rename to src/plugins/maps_legacy/public/map/color_util.d.ts
index 1d27dc4b6d996..9ec6b3c1fb007 100644
--- a/src/plugins/maps_oss/public/index.ts
+++ b/src/plugins/maps_legacy/public/map/color_util.d.ts
@@ -6,6 +6,6 @@
* Public License, v 1.
*/
-import { MapsOSSPlugin } from './plugin';
+export function getLegendColors(colorRamp: unknown, numLegendColors?: number): string[];
-export const plugin = () => new MapsOSSPlugin();
+export function getColor(colorRamp: unknown, i: number): string;
diff --git a/src/plugins/lens_oss/config.ts b/src/plugins/maps_legacy/public/map/kibana_map_layer.d.ts
similarity index 54%
rename from src/plugins/lens_oss/config.ts
rename to src/plugins/maps_legacy/public/map/kibana_map_layer.d.ts
index 58c50f0104f46..222cb6b215f9a 100644
--- a/src/plugins/lens_oss/config.ts
+++ b/src/plugins/maps_legacy/public/map/kibana_map_layer.d.ts
@@ -6,10 +6,20 @@
* Public License, v 1.
*/
-import { schema, TypeOf } from '@kbn/config-schema';
+export class KibanaMapLayer {
+ constructor();
-export const configSchema = schema.object({
- enabled: schema.boolean({ defaultValue: true }),
-});
+ getBounds(): Promise;
-export type ConfigSchema = TypeOf;
+ addToLeafletMap(leafletMap: unknown): void;
+
+ removeFromLeafletMap(leafletMap: unknown): void;
+
+ appendLegendContents(): void;
+
+ updateExtent(): void;
+
+ movePointer(): void;
+
+ getAttributions(): unknown;
+}
diff --git a/typings/@elastic/eui/lib/services.d.ts b/src/plugins/maps_legacy/public/tooltip_provider.d.ts
similarity index 79%
rename from typings/@elastic/eui/lib/services.d.ts
rename to src/plugins/maps_legacy/public/tooltip_provider.d.ts
index a667d111ceb72..4082a6ef83c4d 100644
--- a/typings/@elastic/eui/lib/services.d.ts
+++ b/src/plugins/maps_legacy/public/tooltip_provider.d.ts
@@ -6,4 +6,4 @@
* Public License, v 1.
*/
-export const RIGHT_ALIGNMENT: any;
+export function mapTooltipProvider(element: unknown, formatter: unknown): () => unknown;
diff --git a/src/plugins/lens_oss/tsconfig.json b/src/plugins/maps_legacy/tsconfig.json
similarity index 56%
rename from src/plugins/lens_oss/tsconfig.json
rename to src/plugins/maps_legacy/tsconfig.json
index d7bbc593fa87b..e7ea06706b64f 100644
--- a/src/plugins/lens_oss/tsconfig.json
+++ b/src/plugins/maps_legacy/tsconfig.json
@@ -7,14 +7,8 @@
"declaration": true,
"declarationMap": true
},
- "include": [
- "common/**/*",
- "public/**/*",
- "server/**/*",
- "*.ts"
- ],
+ "include": ["common/**/*", "public/**/*", "server/**/*", "config.ts"],
"references": [
- { "path": "../../core/tsconfig.json" },
- { "path": "../visualizations/tsconfig.json" }
+ { "path": "../vis_default_editor/tsconfig.json" },
]
}
diff --git a/src/plugins/maps_oss/README.md b/src/plugins/maps_oss/README.md
deleted file mode 100644
index ed91de500fbfb..0000000000000
--- a/src/plugins/maps_oss/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# maps_oss
-
-The maps_oss plugin registers the maps visualization on OSS.
-It is registered as disabled. The x-pack plugin should unregister this.
-
-`visualizations.unregisterAlias('mapsOss')`
\ No newline at end of file
diff --git a/src/plugins/maps_oss/common/constants.ts b/src/plugins/maps_oss/common/constants.ts
deleted file mode 100644
index db29f541a03df..0000000000000
--- a/src/plugins/maps_oss/common/constants.ts
+++ /dev/null
@@ -1,12 +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
- * and the Server Side Public License, v 1; you may not use this file except in
- * compliance with, at your election, the Elastic License or the Server Side
- * Public License, v 1.
- */
-
-export const APP_NAME = 'maps';
-export const PLUGIN_ID_OSS = 'mapsOss';
-export const APP_PATH = '/map';
-export const APP_ICON = 'gisApp';
diff --git a/src/plugins/maps_oss/config.ts b/src/plugins/maps_oss/config.ts
deleted file mode 100644
index 58c50f0104f46..0000000000000
--- a/src/plugins/maps_oss/config.ts
+++ /dev/null
@@ -1,15 +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
- * and the Server Side Public License, v 1; you may not use this file except in
- * compliance with, at your election, the Elastic License or the Server Side
- * Public License, v 1.
- */
-
-import { schema, TypeOf } from '@kbn/config-schema';
-
-export const configSchema = schema.object({
- enabled: schema.boolean({ defaultValue: true }),
-});
-
-export type ConfigSchema = TypeOf;
diff --git a/src/plugins/maps_oss/kibana.json b/src/plugins/maps_oss/kibana.json
deleted file mode 100644
index 19770dcffaadd..0000000000000
--- a/src/plugins/maps_oss/kibana.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "id": "mapsOss",
- "version": "kibana",
- "ui": true,
- "server": true,
- "requiredPlugins": [
- "visualizations"
- ],
- "extraPublicDirs": ["common/constants"]
-}
diff --git a/src/plugins/maps_oss/public/plugin.ts b/src/plugins/maps_oss/public/plugin.ts
deleted file mode 100644
index 5e27ae34257bf..0000000000000
--- a/src/plugins/maps_oss/public/plugin.ts
+++ /dev/null
@@ -1,32 +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
- * and the Server Side Public License, v 1; you may not use this file except in
- * compliance with, at your election, the Elastic License or the Server Side
- * Public License, v 1.
- */
-
-import { DocLinksStart, CoreSetup } from 'src/core/public';
-import { VisualizationsSetup } from '../../visualizations/public';
-import { getMapsAliasConfig } from './vis_type_alias';
-
-export interface MapsPluginSetupDependencies {
- visualizations: VisualizationsSetup;
-}
-
-export interface MapsPluginStartDependencies {
- docLinks: DocLinksStart;
-}
-
-export class MapsOSSPlugin {
- setup(
- core: CoreSetup,
- { visualizations }: MapsPluginSetupDependencies
- ) {
- core.getStartServices().then(([coreStart]) => {
- visualizations.registerAlias(getMapsAliasConfig(coreStart.docLinks));
- });
- }
-
- start() {}
-}
diff --git a/src/plugins/maps_oss/public/vis_type_alias.ts b/src/plugins/maps_oss/public/vis_type_alias.ts
deleted file mode 100644
index a27c628755cf6..0000000000000
--- a/src/plugins/maps_oss/public/vis_type_alias.ts
+++ /dev/null
@@ -1,33 +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
- * and the Server Side Public License, v 1; you may not use this file except in
- * compliance with, at your election, the Elastic License or the Server Side
- * Public License, v 1.
- */
-
-import { i18n } from '@kbn/i18n';
-import { VisTypeAlias } from 'src/plugins/visualizations/public';
-import { DocLinksStart } from 'src/core/public';
-import { APP_NAME, PLUGIN_ID_OSS, APP_PATH, APP_ICON } from '../common';
-
-export const getMapsAliasConfig = ({ links }: DocLinksStart): VisTypeAlias => ({
- aliasPath: APP_PATH,
- aliasApp: APP_NAME,
- name: PLUGIN_ID_OSS,
- title: i18n.translate('mapsOss.visTypeAlias.title', {
- defaultMessage: 'Maps',
- }),
- description: i18n.translate('mapsOss.visTypeAlias.description', {
- defaultMessage: 'Plot and style your geo data in a multi layer map.',
- }),
- icon: APP_ICON,
- stage: 'production',
- disabled: true,
- promoTooltip: {
- description: i18n.translate('mapsOss.visTypeAlias.promoTooltip.description', {
- defaultMessage: 'Try maps for free with Elastic. Learn more.',
- }),
- link: `${links.visualize.maps}?blade=kibanaossvizwizard`,
- },
-});
diff --git a/src/plugins/maps_oss/server/index.ts b/src/plugins/maps_oss/server/index.ts
deleted file mode 100644
index 8f07beee705a6..0000000000000
--- a/src/plugins/maps_oss/server/index.ts
+++ /dev/null
@@ -1,21 +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
- * and the Server Side Public License, v 1; you may not use this file except in
- * compliance with, at your election, the Elastic License or the Server Side
- * Public License, v 1.
- */
-
-import { PluginConfigDescriptor } from 'kibana/server';
-import { copyFromRoot } from '@kbn/config';
-import { configSchema, ConfigSchema } from '../config';
-
-export const config: PluginConfigDescriptor = {
- schema: configSchema,
- deprecations: () => [copyFromRoot('xpack.maps.enabled', 'maps_oss.enabled')],
-};
-
-export const plugin = () => ({
- setup() {},
- start() {},
-});
diff --git a/src/plugins/maps_oss/tsconfig.json b/src/plugins/maps_oss/tsconfig.json
new file mode 100644
index 0000000000000..03c30c3c49fd3
--- /dev/null
+++ b/src/plugins/maps_oss/tsconfig.json
@@ -0,0 +1,14 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "compilerOptions": {
+ "composite": true,
+ "outDir": "./target/types",
+ "emitDeclarationOnly": true,
+ "declaration": true,
+ "declarationMap": true
+ },
+ "include": ["common/**/*", "public/**/*", "server/**/*", "config.ts"],
+ "references": [
+ { "path": "../visualizations/tsconfig.json" },
+ ]
+}
diff --git a/src/plugins/region_map/public/components/index.tsx b/src/plugins/region_map/public/components/index.tsx
index 2ad3c0ffec3f4..187c36f9cc46d 100644
--- a/src/plugins/region_map/public/components/index.tsx
+++ b/src/plugins/region_map/public/components/index.tsx
@@ -8,11 +8,11 @@
import React, { lazy } from 'react';
import { IServiceSettings } from 'src/plugins/maps_legacy/public';
-import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
+import { VisEditorOptionsProps } from 'src/plugins/visualizations/public';
import { RegionMapVisParams } from '../region_map_types';
const RegionMapOptions = lazy(() => import('./region_map_options'));
export const createRegionMapOptions = (getServiceSettings: () => Promise) => (
- props: VisOptionsProps
+ props: VisEditorOptionsProps
) => ;
diff --git a/src/plugins/region_map/public/components/region_map_options.tsx b/src/plugins/region_map/public/components/region_map_options.tsx
index 0b11e1c5164d3..43bb15a547435 100644
--- a/src/plugins/region_map/public/components/region_map_options.tsx
+++ b/src/plugins/region_map/public/components/region_map_options.tsx
@@ -10,7 +10,7 @@ import React, { useCallback, useMemo } from 'react';
import { EuiIcon, EuiLink, EuiPanel, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
-import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
+import { VisEditorOptionsProps } from 'src/plugins/visualizations/public';
import { FileLayerField, VectorLayer, IServiceSettings } from '../../../maps_legacy/public';
import { SelectOption, SwitchOption, NumberInputOption } from '../../../vis_default_editor/public';
import { WmsOptions } from '../../../maps_legacy/public';
@@ -28,7 +28,7 @@ const mapFieldForOption = ({ description, name }: FileLayerField) => ({
export type RegionMapOptionsProps = {
getServiceSettings: () => Promise;
-} & VisOptionsProps;
+} & VisEditorOptionsProps;
function RegionMapOptions(props: RegionMapOptionsProps) {
const { getServiceSettings, stateParams, vis, setValue } = props;
diff --git a/src/plugins/region_map/public/region_map_type.ts b/src/plugins/region_map/public/region_map_type.ts
index bda478389faa1..c1d46cd603f0b 100644
--- a/src/plugins/region_map/public/region_map_type.ts
+++ b/src/plugins/region_map/public/region_map_type.ts
@@ -8,7 +8,7 @@
import { i18n } from '@kbn/i18n';
-import { BaseVisTypeOptions } from '../../visualizations/public';
+import { VisTypeDefinition } from '../../visualizations/public';
import { truncatedColorSchemas } from '../../charts/public';
import { ORIGIN } from '../../maps_legacy/public';
@@ -23,7 +23,7 @@ export function createRegionMapTypeDefinition({
uiSettings,
regionmapsConfig,
getServiceSettings,
-}: RegionMapVisualizationDependencies): BaseVisTypeOptions {
+}: RegionMapVisualizationDependencies): VisTypeDefinition {
return {
name: 'region_map',
getInfoMessage: getDeprecationMessage,
@@ -139,5 +139,6 @@ provided base maps, or add your own. Darker colors represent higher values.',
return vis;
},
+ requiresSearch: true,
};
}
diff --git a/src/plugins/region_map/public/to_ast.ts b/src/plugins/region_map/public/to_ast.ts
index 7c81b8fa9ecbb..77aaf18f0f697 100644
--- a/src/plugins/region_map/public/to_ast.ts
+++ b/src/plugins/region_map/public/to_ast.ts
@@ -11,11 +11,11 @@ import {
IndexPatternLoadExpressionFunctionDefinition,
} from '../../data/public';
import { buildExpression, buildExpressionFunction } from '../../expressions/public';
-import { getVisSchemas, Vis, BuildPipelineParams } from '../../visualizations/public';
+import { getVisSchemas, VisToExpressionAst } from '../../visualizations/public';
import { RegionMapExpressionFunctionDefinition } from './region_map_fn';
import { RegionMapVisConfig, RegionMapVisParams } from './region_map_types';
-export const toExpressionAst = (vis: Vis, params: BuildPipelineParams) => {
+export const toExpressionAst: VisToExpressionAst = (vis, params) => {
const esaggs = buildExpressionFunction('esaggs', {
index: buildExpression([
buildExpressionFunction('indexPatternLoad', {
diff --git a/src/plugins/region_map/tsconfig.json b/src/plugins/region_map/tsconfig.json
new file mode 100644
index 0000000000000..40f76ece2a6ff
--- /dev/null
+++ b/src/plugins/region_map/tsconfig.json
@@ -0,0 +1,15 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "compilerOptions": {
+ "composite": true,
+ "outDir": "./target/types",
+ "emitDeclarationOnly": true,
+ "declaration": true,
+ "declarationMap": true
+ },
+ "include": ["public/**/*", "server/**/*"],
+ "references": [
+ { "path": "../maps_legacy/tsconfig.json" },
+ { "path": "../vis_default_editor/tsconfig.json" },
+ ]
+}
diff --git a/src/plugins/share/public/components/__snapshots__/share_context_menu.test.tsx.snap b/src/plugins/share/public/components/__snapshots__/share_context_menu.test.tsx.snap
index fc3fa3e72b9c0..95d3026f66d37 100644
--- a/src/plugins/share/public/components/__snapshots__/share_context_menu.test.tsx.snap
+++ b/src/plugins/share/public/components/__snapshots__/share_context_menu.test.tsx.snap
@@ -55,6 +55,7 @@ exports[`shareContextMenuExtensions should sort ascending on sort order first an
},
]
}
+ size="m"
/>
`;
@@ -78,6 +79,7 @@ exports[`should only render permalink panel when there are no other panels 1`] =
},
]
}
+ size="m"
/>
`;
@@ -130,6 +132,7 @@ exports[`should render context menu panel when there are more than one panel 1`]
},
]
}
+ size="m"
/>
`;
diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json
index 27d9b5ce83203..950fdf9405b75 100644
--- a/src/plugins/telemetry/schema/oss_plugins.json
+++ b/src/plugins/telemetry/schema/oss_plugins.json
@@ -4076,6 +4076,27 @@
},
"stack_management": {
"properties": {
+ "timelion:quandl.key": {
+ "type": "keyword"
+ },
+ "securitySolution:defaultIndex": {
+ "type": "keyword"
+ },
+ "securitySolution:newsFeedUrl": {
+ "type": "keyword"
+ },
+ "xpackReporting:customPdfLogo": {
+ "type": "keyword"
+ },
+ "notifications:banner": {
+ "type": "keyword"
+ },
+ "timelion:graphite.url": {
+ "type": "keyword"
+ },
+ "xpackDashboardMode:roles": {
+ "type": "keyword"
+ },
"visualize:enableLabs": {
"type": "boolean"
},
@@ -4095,7 +4116,7 @@
"type": "long"
},
"securitySolution:ipReputationLinks": {
- "type": "text"
+ "type": "keyword"
},
"csv:separator": {
"type": "keyword"
@@ -4121,9 +4142,6 @@
"timelion:default_columns": {
"type": "long"
},
- "timelion:quandl.key": {
- "type": "keyword"
- },
"timelion:es.default_index": {
"type": "keyword"
},
@@ -4136,15 +4154,9 @@
"securitySolution:defaultAnomalyScore": {
"type": "long"
},
- "securitySolution:defaultIndex": {
- "type": "keyword"
- },
"securitySolution:refreshIntervalDefaults": {
"type": "keyword"
},
- "securitySolution:newsFeedUrl": {
- "type": "keyword"
- },
"securitySolution:enableNewsFeed": {
"type": "boolean"
},
@@ -4169,9 +4181,6 @@
"rollups:enableIndexPatterns": {
"type": "boolean"
},
- "xpackReporting:customPdfLogo": {
- "type": "text"
- },
"notifications:lifetime:warning": {
"type": "long"
},
@@ -4181,9 +4190,6 @@
"notifications:lifetime:info": {
"type": "long"
},
- "notifications:banner": {
- "type": "text"
- },
"notifications:lifetime:error": {
"type": "long"
},
@@ -4200,7 +4206,10 @@
"type": "long"
},
"defaultColumns": {
- "type": "keyword"
+ "type": "array",
+ "items": {
+ "type": "keyword"
+ }
},
"context:defaultSize": {
"type": "long"
@@ -4209,7 +4218,10 @@
"type": "long"
},
"context:tieBreakerFields": {
- "type": "keyword"
+ "type": "array",
+ "items": {
+ "type": "keyword"
+ }
},
"discover:sort:defaultOrder": {
"type": "keyword"
@@ -4268,9 +4280,6 @@
"query:queryString:options": {
"type": "keyword"
},
- "pageNavigation": {
- "type": "keyword"
- },
"metrics:max_buckets": {
"type": "long"
},
@@ -4278,7 +4287,10 @@
"type": "boolean"
},
"metaFields": {
- "type": "keyword"
+ "type": "array",
+ "items": {
+ "type": "keyword"
+ }
},
"indexPattern:placeholder": {
"type": "keyword"
@@ -4342,6 +4354,36 @@
},
"dateFormat": {
"type": "keyword"
+ },
+ "autocomplete:useTimeRange": {
+ "type": "boolean"
+ },
+ "search:timeout": {
+ "type": "long"
+ },
+ "visualization:visualize:legacyChartsLibrary": {
+ "type": "boolean"
+ },
+ "doc_table:legacy": {
+ "type": "boolean"
+ },
+ "discover:modifyColumnsOnSwitch": {
+ "type": "boolean"
+ },
+ "discover:searchFieldsFromSource": {
+ "type": "boolean"
+ },
+ "securitySolution:rulesTableRefresh": {
+ "type": "text"
+ },
+ "apm:enableSignificantTerms": {
+ "type": "boolean"
+ },
+ "apm:enableServiceOverview": {
+ "type": "boolean"
+ },
+ "apm:enableCorrelations": {
+ "type": "boolean"
}
}
},
diff --git a/src/plugins/tile_map/public/components/tile_map_options.tsx b/src/plugins/tile_map/public/components/tile_map_options.tsx
index c30d314d166bb..d6155dbfec877 100644
--- a/src/plugins/tile_map/public/components/tile_map_options.tsx
+++ b/src/plugins/tile_map/public/components/tile_map_options.tsx
@@ -10,8 +10,8 @@ import React, { useEffect } from 'react';
import { EuiPanel, EuiSpacer } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
+import { VisEditorOptionsProps } from 'src/plugins/visualizations/public';
import {
- VisOptionsProps,
BasicOptions,
SelectOption,
SwitchOption,
@@ -21,7 +21,7 @@ import { WmsOptions } from '../../../maps_legacy/public';
import { TileMapVisParams } from '../types';
import { MapTypes } from '../utils/map_types';
-export type TileMapOptionsProps = VisOptionsProps;
+export type TileMapOptionsProps = VisEditorOptionsProps;
function TileMapOptions(props: TileMapOptionsProps) {
const { stateParams, setValue, vis } = props;
diff --git a/src/plugins/tile_map/public/tile_map_type.ts b/src/plugins/tile_map/public/tile_map_type.ts
index 7356da0cf8bcb..ceb9c138f043c 100644
--- a/src/plugins/tile_map/public/tile_map_type.ts
+++ b/src/plugins/tile_map/public/tile_map_type.ts
@@ -7,7 +7,7 @@
*/
import { i18n } from '@kbn/i18n';
-import { BaseVisTypeOptions } from 'src/plugins/visualizations/public';
+import { VisTypeDefinition } from 'src/plugins/visualizations/public';
import { truncatedColorSchemas } from '../../charts/public';
// @ts-expect-error
@@ -21,7 +21,7 @@ import { MapTypes } from './utils/map_types';
export function createTileMapTypeDefinition(
dependencies: TileMapVisualizationDependencies
-): BaseVisTypeOptions {
+): VisTypeDefinition {
const { uiSettings, getServiceSettings } = dependencies;
return {
@@ -147,5 +147,6 @@ export function createTileMapTypeDefinition(
}
return vis;
},
+ requiresSearch: true,
};
}
diff --git a/src/plugins/tile_map/public/to_ast.ts b/src/plugins/tile_map/public/to_ast.ts
index f5a964d257431..8130b7df25276 100644
--- a/src/plugins/tile_map/public/to_ast.ts
+++ b/src/plugins/tile_map/public/to_ast.ts
@@ -11,11 +11,11 @@ import {
IndexPatternLoadExpressionFunctionDefinition,
} from '../../data/public';
import { buildExpression, buildExpressionFunction } from '../../expressions/public';
-import { getVisSchemas, Vis, BuildPipelineParams } from '../../visualizations/public';
+import { getVisSchemas, VisToExpressionAst } from '../../visualizations/public';
import { TileMapExpressionFunctionDefinition } from './tile_map_fn';
import { TileMapVisConfig, TileMapVisParams } from './types';
-export const toExpressionAst = (vis: Vis, params: BuildPipelineParams) => {
+export const toExpressionAst: VisToExpressionAst = (vis, params) => {
const esaggs = buildExpressionFunction('esaggs', {
index: buildExpression([
buildExpressionFunction('indexPatternLoad', {
diff --git a/src/plugins/tile_map/tsconfig.json b/src/plugins/tile_map/tsconfig.json
new file mode 100644
index 0000000000000..40f76ece2a6ff
--- /dev/null
+++ b/src/plugins/tile_map/tsconfig.json
@@ -0,0 +1,15 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "compilerOptions": {
+ "composite": true,
+ "outDir": "./target/types",
+ "emitDeclarationOnly": true,
+ "declaration": true,
+ "declarationMap": true
+ },
+ "include": ["public/**/*", "server/**/*"],
+ "references": [
+ { "path": "../maps_legacy/tsconfig.json" },
+ { "path": "../vis_default_editor/tsconfig.json" },
+ ]
+}
diff --git a/src/plugins/usage_collection/server/collector/collector.ts b/src/plugins/usage_collection/server/collector/collector.ts
index ccc17ea1c5967..8e8a74902d479 100644
--- a/src/plugins/usage_collection/server/collector/collector.ts
+++ b/src/plugins/usage_collection/server/collector/collector.ts
@@ -14,17 +14,38 @@ import {
KibanaRequest,
} from 'src/core/server';
-export type AllowedSchemaNumberTypes = 'long' | 'integer' | 'short' | 'byte' | 'double' | 'float';
+export type AllowedSchemaNumberTypes =
+ | 'long'
+ | 'integer'
+ | 'short'
+ | 'byte'
+ | 'double'
+ | 'float'
+ | 'date';
+export type AllowedSchemaStringTypes = 'keyword' | 'text' | 'date';
+export type AllowedSchemaBooleanTypes = 'boolean';
-export type AllowedSchemaTypes = AllowedSchemaNumberTypes | 'keyword' | 'text' | 'boolean' | 'date';
+export type AllowedSchemaTypes =
+ | AllowedSchemaNumberTypes
+ | AllowedSchemaStringTypes
+ | AllowedSchemaBooleanTypes;
export interface SchemaField {
type: string;
}
+export type PossibleSchemaTypes = U extends string
+ ? AllowedSchemaStringTypes
+ : U extends number
+ ? AllowedSchemaNumberTypes
+ : U extends boolean
+ ? AllowedSchemaBooleanTypes
+ : // allow any schema type from the union if typescript is unable to resolve the exact U type
+ AllowedSchemaTypes;
+
export type RecursiveMakeSchemaFrom = U extends object
? MakeSchemaFrom
- : { type: AllowedSchemaTypes };
+ : { type: PossibleSchemaTypes };
// Using Required to enforce all optional keys in the object
export type MakeSchemaFrom = {
diff --git a/src/plugins/vis_default_editor/public/components/agg_group_helper.test.ts b/src/plugins/vis_default_editor/public/components/agg_group_helper.test.ts
index 131edb4601546..fb41d610d2175 100644
--- a/src/plugins/vis_default_editor/public/components/agg_group_helper.test.ts
+++ b/src/plugins/vis_default_editor/public/components/agg_group_helper.test.ts
@@ -50,7 +50,6 @@ describe('DefaultEditorGroup helpers', () => {
min: 0,
max: 3,
aggFilter: [],
- editor: false,
params: [],
defaults: null,
mustBeFirst: true,
@@ -62,7 +61,6 @@ describe('DefaultEditorGroup helpers', () => {
min: 2,
max: 3,
aggFilter: [],
- editor: false,
params: [],
defaults: null,
},
diff --git a/src/plugins/vis_default_editor/public/components/options/basic_options.tsx b/src/plugins/vis_default_editor/public/components/options/basic_options.tsx
index 4edfd9982ffbd..85a94e1228a3e 100644
--- a/src/plugins/vis_default_editor/public/components/options/basic_options.tsx
+++ b/src/plugins/vis_default_editor/public/components/options/basic_options.tsx
@@ -10,7 +10,7 @@ import React from 'react';
import { i18n } from '@kbn/i18n';
-import { VisOptionsProps } from '../../vis_options_props';
+import { VisEditorOptionsProps } from '../../../../visualizations/public';
import { SwitchOption } from './switch';
import { SelectOption } from './select';
@@ -23,7 +23,7 @@ function BasicOptions({
stateParams,
setValue,
vis,
-}: VisOptionsProps) {
+}: VisEditorOptionsProps) {
return (
<>
(
interface ColorSchemaOptionsProps extends ColorSchemaParams {
disabled?: boolean;
colorSchemas: ColorSchema[];
- uiState: VisOptionsProps['uiState'];
+ uiState: VisEditorOptionsProps['uiState'];
setValue: SetColorSchemaOptionsValue;
showHelpText?: boolean;
}
diff --git a/src/plugins/vis_default_editor/public/components/sidebar/use_option_tabs.ts b/src/plugins/vis_default_editor/public/components/sidebar/use_option_tabs.ts
index fbec23fd199f5..be0e4dd9a8c20 100644
--- a/src/plugins/vis_default_editor/public/components/sidebar/use_option_tabs.ts
+++ b/src/plugins/vis_default_editor/public/components/sidebar/use_option_tabs.ts
@@ -9,13 +9,12 @@
import { useCallback, useState } from 'react';
import { i18n } from '@kbn/i18n';
-import { Vis } from '../../../../visualizations/public';
+import { Vis, VisEditorOptionsProps } from '../../../../visualizations/public';
-import { VisOptionsProps } from '../../vis_options_props';
import { DefaultEditorDataTab, DefaultEditorDataTabProps } from './data_tab';
export interface OptionTab {
- editor: React.ComponentType;
+ editor: React.ComponentType;
name: string;
title: string;
isSelected?: boolean;
diff --git a/src/plugins/vis_default_editor/public/index.ts b/src/plugins/vis_default_editor/public/index.ts
index a4c94dd664968..9d315f1a94ce7 100644
--- a/src/plugins/vis_default_editor/public/index.ts
+++ b/src/plugins/vis_default_editor/public/index.ts
@@ -16,7 +16,6 @@ export { PalettePicker } from './components/controls/palette_picker';
export * from './components/options';
export { RangesParamEditor, RangeValues } from './components/controls/ranges';
export * from './editor_size';
-export * from './vis_options_props';
export * from './utils';
export const plugin = (context: PluginInitializerContext) => {
diff --git a/src/plugins/vis_default_editor/public/vis_options_props.tsx b/src/plugins/vis_default_editor/public/vis_options_props.tsx
deleted file mode 100644
index 6180686b6996d..0000000000000
--- a/src/plugins/vis_default_editor/public/vis_options_props.tsx
+++ /dev/null
@@ -1,22 +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
- * and the Server Side Public License, v 1; you may not use this file except in
- * compliance with, at your election, the Elastic License or the Server Side
- * Public License, v 1.
- */
-
-import { Vis, PersistedState } from 'src/plugins/visualizations/public';
-import { IAggConfigs } from 'src/plugins/data/public';
-
-export interface VisOptionsProps {
- aggs: IAggConfigs;
- hasHistogramAgg: boolean;
- isTabSelected: boolean;
- stateParams: VisParamType;
- vis: Vis;
- uiState: PersistedState;
- setValue(paramName: T, value: VisParamType[T]): void;
- setValidity(isValid: boolean): void;
- setTouched(isTouched: boolean): void;
-}
diff --git a/src/plugins/vis_type_markdown/public/markdown_options.test.tsx b/src/plugins/vis_type_markdown/public/markdown_options.test.tsx
index cf27118ac71e4..9d464cf9e2063 100644
--- a/src/plugins/vis_type_markdown/public/markdown_options.test.tsx
+++ b/src/plugins/vis_type_markdown/public/markdown_options.test.tsx
@@ -9,7 +9,7 @@
import React from 'react';
import { shallow } from 'enzyme';
-import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
+import { VisEditorOptionsProps } from 'src/plugins/visualizations/public';
import { MarkdownVisParams } from './types';
import { MarkdownOptions } from './markdown_options';
@@ -21,7 +21,7 @@ describe('MarkdownOptions', () => {
openLinksInNewTab: false,
},
setValue: jest.fn(),
- } as unknown) as VisOptionsProps;
+ } as unknown) as VisEditorOptionsProps;
it('should match snapshot', () => {
const comp = shallow();
diff --git a/src/plugins/vis_type_markdown/public/markdown_options.tsx b/src/plugins/vis_type_markdown/public/markdown_options.tsx
index 72e4aaf8758b2..79d850b8c1fd8 100644
--- a/src/plugins/vis_type_markdown/public/markdown_options.tsx
+++ b/src/plugins/vis_type_markdown/public/markdown_options.tsx
@@ -18,10 +18,10 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
-import { VisOptionsProps } from 'src/plugins/vis_default_editor/public';
+import { VisEditorOptionsProps } from 'src/plugins/visualizations/public';
import { MarkdownVisParams } from './types';
-function MarkdownOptions({ stateParams, setValue }: VisOptionsProps) {
+function MarkdownOptions({ stateParams, setValue }: VisEditorOptionsProps) {
const onMarkdownUpdate = useCallback(
({ target: { value } }: React.ChangeEvent) => setValue('markdown', value),
[setValue]
diff --git a/src/plugins/vis_type_markdown/public/markdown_vis.ts b/src/plugins/vis_type_markdown/public/markdown_vis.ts
index e698316dc8e70..adfdb811cc28c 100644
--- a/src/plugins/vis_type_markdown/public/markdown_vis.ts
+++ b/src/plugins/vis_type_markdown/public/markdown_vis.ts
@@ -11,10 +11,11 @@ import { i18n } from '@kbn/i18n';
import { MarkdownOptions } from './markdown_options';
import { SettingsOptions } from './settings_options_lazy';
import { DefaultEditorSize } from '../../vis_default_editor/public';
-import { VisGroups } from '../../visualizations/public';
+import { VisGroups, VisTypeDefinition } from '../../visualizations/public';
import { toExpressionAst } from './to_ast';
+import { MarkdownVisParams } from './types';
-export const markdownVisDefinition = {
+export const markdownVisDefinition: VisTypeDefinition = {
name: 'markdown',
title: 'Markdown',
isAccessible: true,
@@ -58,7 +59,5 @@ export const markdownVisDefinition = {
showTimePicker: false,
showFilterBar: false,
},
- requestHandler: 'none',
- responseHandler: 'none',
inspectorAdapters: {},
};
diff --git a/src/plugins/vis_type_markdown/public/settings_options.tsx b/src/plugins/vis_type_markdown/public/settings_options.tsx
index 4ebcc88a8c04f..c18f1305d778a 100644
--- a/src/plugins/vis_type_markdown/public/settings_options.tsx
+++ b/src/plugins/vis_type_markdown/public/settings_options.tsx
@@ -10,10 +10,11 @@ import React from 'react';
import { EuiPanel } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
-import { VisOptionsProps, SwitchOption, RangeOption } from '../../vis_default_editor/public';
+import { VisEditorOptionsProps } from 'src/plugins/visualizations/public';
+import { SwitchOption, RangeOption } from '../../vis_default_editor/public';
import { MarkdownVisParams } from './types';
-function SettingsOptions({ stateParams, setValue }: VisOptionsProps) {
+function SettingsOptions({ stateParams, setValue }: VisEditorOptionsProps) {
return (
{
+export const toExpressionAst: VisToExpressionAst = (vis) => {
const { markdown, fontSize, openLinksInNewTab } = vis.params;
const markdownVis = buildExpressionFunction(
diff --git a/src/plugins/vis_type_metric/public/__snapshots__/metric_vis_fn.test.ts.snap b/src/plugins/vis_type_metric/public/__snapshots__/metric_vis_fn.test.ts.snap
index fd8f3a712d8ae..a212cec2d8827 100644
--- a/src/plugins/vis_type_metric/public/__snapshots__/metric_vis_fn.test.ts.snap
+++ b/src/plugins/vis_type_metric/public/__snapshots__/metric_vis_fn.test.ts.snap
@@ -5,9 +5,6 @@ Object {
"as": "metric_vis",
"type": "render",
"value": Object {
- "params": Object {
- "listenOnChange": true,
- },
"visConfig": Object {
"dimensions": Object {
"metrics": undefined,
diff --git a/src/plugins/vis_type_metric/public/__snapshots__/to_ast.test.ts.snap b/src/plugins/vis_type_metric/public/__snapshots__/to_ast.test.ts.snap
index a89f41737d7bc..46e86c4c25de1 100644
--- a/src/plugins/vis_type_metric/public/__snapshots__/to_ast.test.ts.snap
+++ b/src/plugins/vis_type_metric/public/__snapshots__/to_ast.test.ts.snap
@@ -37,6 +37,9 @@ Object {
"percentageMode": Array [
true,
],
+ "showLabels": Array [
+ false,
+ ],
},
"function": "metricVis",
"type": "function",
@@ -79,7 +82,11 @@ Object {
"type": "function",
},
Object {
- "arguments": Object {},
+ "arguments": Object {
+ "showLabels": Array [
+ false,
+ ],
+ },
"function": "metricVis",
"type": "function",
},
diff --git a/src/plugins/vis_type_metric/public/components/metric_vis_options.tsx b/src/plugins/vis_type_metric/public/components/metric_vis_options.tsx
index c8448ae68c074..069690b58e2a0 100644
--- a/src/plugins/vis_type_metric/public/components/metric_vis_options.tsx
+++ b/src/plugins/vis_type_metric/public/components/metric_vis_options.tsx
@@ -18,10 +18,10 @@ import {
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
+import { VisEditorOptionsProps } from 'src/plugins/visualizations/public';
import {
ColorRanges,
SetColorRangeValue,
- VisOptionsProps,
SwitchOption,
SetColorSchemaOptionsValue,
ColorSchemaOptions,
@@ -37,7 +37,7 @@ function MetricVisOptions({
setTouched,
vis,
uiState,
-}: VisOptionsProps) {
+}: VisEditorOptionsProps) {
const setMetricValue: