diff --git a/docs/getting-started/tutorial-dashboard.asciidoc b/docs/getting-started/tutorial-dashboard.asciidoc index aab93eb51ca232..87a1e38efcfe0c 100644 --- a/docs/getting-started/tutorial-dashboard.asciidoc +++ b/docs/getting-started/tutorial-dashboard.asciidoc @@ -2,11 +2,12 @@ === Add visualizations to a dashboard A dashboard is a collection of visualizations that you can arrange and share. -You'll build a dashboard that contains the visualizations you saved during +You'll build a dashboard that contains the visualizations and map that you saved during this tutorial. . Open *Dashboard*. . On the Dashboard overview page, click *Create new dashboard*. +. Set the time filter to May 18, 2015 to May 20, 2015. . Click *Add* in the menu bar. . Add *Bar Example*, *Map Example*, *Markdown Example*, and *Pie Example*. + @@ -26,12 +27,12 @@ is on the lower right. ==== Inspect the data -Seeing visualizations of your data is great, +Seeing visualizations of your data is great, but sometimes you need to look at the actual data to understand what's really going on. You can inspect the data behind any visualization and view the {es} query used to retrieve it. -. In the dashboard, hover the pointer over the pie chart, and then click the icon in the upper right. +. In the dashboard, hover the pointer over the pie chart, and then click the icon in the upper right. . From the *Options* menu, select *Inspect*. + [role="screenshot"] diff --git a/docs/getting-started/tutorial-visualizing.asciidoc b/docs/getting-started/tutorial-visualizing.asciidoc index 5e61475cf2839d..a16343aa4850a2 100644 --- a/docs/getting-started/tutorial-visualizing.asciidoc +++ b/docs/getting-started/tutorial-visualizing.asciidoc @@ -3,11 +3,11 @@ In the Visualize application, you can shape your data using a variety of charts, tables, and maps, and more. In this tutorial, you'll create four -visualizations: +visualizations: * <> * <> -* <> +* <> * <> [float] @@ -25,7 +25,7 @@ types in Kibana. image::images/tutorial-visualize-wizard-step-1.png[] . Click *Pie*. -. In *Choose a source*, select the `ba*` index pattern. +. In *Choose a source*, select the `ba*` index pattern. + Initially, the pie contains a single "slice." That's because the default search matched all documents. @@ -76,7 +76,7 @@ in a ring around the balance ranges. [role="screenshot"] image::images/tutorial-visualize-pie-3.png[] -. To save this chart so you can use it later, click *Save* in +. To save this chart so you can use it later, click *Save* in the top menu bar and enter `Pie Example`. [float] @@ -123,14 +123,36 @@ you did at the beginning of the tutorial, when you marked the `play_name` field as `not analyzed`. [float] -[[tutorial-visualize-map]] -=== Coordinate map +[[tutorial-visualize-markdown]] +=== Markdown -Using a coordinate map, you can visualize geographic information in the log file sample data. +Create a Markdown widget to add formatted text to your dashboard. + +. Create a *Markdown* visualization. +. Copy the following text into the text box. ++ +[source,markdown] +# This is a tutorial dashboard! +The Markdown widget uses **markdown** syntax. +> Blockquotes in Markdown use the > character. -. Create a *Coordinate map* and set the search source to `logstash*`. +. Click *Apply changes* image:images/apply-changes-button.png[]. + -You haven't defined any buckets yet, so the visualization is a map of the world. +The Markdown renders in the preview pane. ++ +[role="screenshot"] +image::images/tutorial-visualize-md-2.png[] + +. *Save* this visualization with the name `Markdown Example`. + +[float] +[[tutorial-visualize-map]] +=== Map + +Using <>, you can visualize geographic information in the log file sample data. + +. Click *Maps* in the New Visualization +menu to create a Map. . Set the time. .. In the time filter, click *Show dates*. @@ -138,14 +160,19 @@ You haven't defined any buckets yet, so the visualization is a map of the world. .. Set the *Start date* to May 18, 2015. .. In the time filter, click *now*, then *Absolute*. .. Set the *End date* to May 20, 2015. +.. Click *Update* . Map the geo coordinates from the log files. -.. In the *Buckets* pane, click *Add > Geo coordinates*. -.. Set *Aggregation* to *Geohash*. -.. Set *Field* to *geo.coordinates*. +.. Click *Add layer*. +.. Click the *Grid aggregation* data source. +.. Set *Index pattern* to *logstash*. +.. Click the *Add layer* button. -. Click *Apply changes* image:images/apply-changes-button.png[]. +. Set the layer style. +.. For *Fill color*, select the yellow to red color ramp. +.. For *Border color*, select white. +.. Click *Save & close*. + The map now looks like this: + @@ -155,26 +182,3 @@ image::images/tutorial-visualize-map-2.png[] . Navigate the map by clicking and dragging. Use the controls on the left to zoom the map and set filters. . *Save* this map with the name `Map Example`. - -[float] -[[tutorial-visualize-markdown]] -=== Markdown - -The final visualization is a Markdown widget that renders formatted text. - -. Create a *Markdown* visualization. -. Copy the following text into the text box. -+ -[source,markdown] -# This is a tutorial dashboard! -The Markdown widget uses **markdown** syntax. -> Blockquotes in Markdown use the > character. - -. Click *Apply changes* image:images/apply-changes-button.png[]. -+ -The Markdown renders in the preview pane. -+ -[role="screenshot"] -image::images/tutorial-visualize-md-2.png[] - -. *Save* this visualization with the name `Markdown Example`. diff --git a/docs/images/tutorial-visualize-map-2.png b/docs/images/tutorial-visualize-map-2.png index db9f0d56bc963d..f4d1d0e47fe6ad 100644 Binary files a/docs/images/tutorial-visualize-map-2.png and b/docs/images/tutorial-visualize-map-2.png differ diff --git a/docs/maps/maps-getting-started.asciidoc b/docs/maps/maps-getting-started.asciidoc index 88ad6a26d36970..3ff44b97de6356 100644 --- a/docs/maps/maps-getting-started.asciidoc +++ b/docs/maps/maps-getting-started.asciidoc @@ -84,7 +84,7 @@ the {es} index `kibana_sample_data_logs` on the shared key iso2 = geo.src. . Set *Right source* to *kibana_sample_data_logs*. . Set *Right field* to *geo.src*. -===== Set the vector style +===== Set the layer style All of the world countries are still a single color because the layer is using <>. To shade the world countries based on which country is sending the most requests, you'll need to use <>. @@ -161,9 +161,9 @@ image::maps/images/grid_metrics_both.png[] . Select *Sum* in the aggregation select. . Select *bytes* in the field select. -===== Set the vector style +===== Set the layer style -. In *Vector style*, change *Symbol size*: +. In *Layer style*, change *Symbol size*: .. Set *Min size* to 1. .. Set *Max size* to 25. .. In the field select, select *sum of bytes*. diff --git a/packages/kbn-es/src/custom_snapshots.js b/packages/kbn-es/src/custom_snapshots.js index 0af89b8e9b68c1..be6bbeca538ffa 100644 --- a/packages/kbn-es/src/custom_snapshots.js +++ b/packages/kbn-es/src/custom_snapshots.js @@ -26,7 +26,8 @@ function isVersionFlag(a) { function getCustomSnapshotUrl() { // force use of manually created snapshots until live ones are available if (!process.env.KBN_ES_SNAPSHOT_URL && !process.argv.some(isVersionFlag)) { - return 'https://storage.googleapis.com/kibana-ci-tmp-artifacts/{name}-{version}-{os}-x86_64.{ext}'; + // return 'https://storage.googleapis.com/kibana-ci-tmp-artifacts/{name}-{version}-{os}-x86_64.{ext}'; + return; } if (process.env.KBN_ES_SNAPSHOT_URL && process.env.KBN_ES_SNAPSHOT_URL !== 'false') { diff --git a/packages/kbn-spec-to-console/README.md b/packages/kbn-spec-to-console/README.md index fc068b7ba65d6f..6729f03b3d4db8 100644 --- a/packages/kbn-spec-to-console/README.md +++ b/packages/kbn-spec-to-console/README.md @@ -23,14 +23,10 @@ At the root of the Kibana repository, run the following commands: ```sh # OSS -yarn spec_to_console \ - -g "/rest-api-spec/src/main/resources/rest-api-spec/api/*" \ - -d "src/legacy/core_plugins/console/api_server/spec/generated" +yarn spec_to_console -g "/rest-api-spec/src/main/resources/rest-api-spec/api/*" -d "src/legacy/core_plugins/console/server/api_server/spec/generated" # X-pack -yarn spec_to_console \ - -g "/x-pack/plugin/src/test/resources/rest-api-spec/api/*" \ - -d "x-pack/plugins/console_extensions/spec/generated" +yarn spec_to_console -g "/x-pack/plugin/src/test/resources/rest-api-spec/api/*" -d "x-pack/legacy/plugins/console_extensions/spec/generated" ``` ### Information used in Console that is not available in the REST spec diff --git a/src/core/public/chrome/chrome_service.tsx b/src/core/public/chrome/chrome_service.tsx index 87389d2c10f033..a5532faec19ede 100644 --- a/src/core/public/chrome/chrome_service.tsx +++ b/src/core/public/chrome/chrome_service.tsx @@ -129,6 +129,7 @@ export class ChromeService {
void; + isCloudEnabled: boolean; } interface State { @@ -296,6 +297,7 @@ class HeaderUI extends Component { kibanaVersion, onIsLockedUpdate, legacyMode, + isCloudEnabled, } = this.props; const { appTitle, @@ -394,7 +396,9 @@ class HeaderUI extends Component { - + diff --git a/src/core/public/chrome/ui/header/header_help_menu.tsx b/src/core/public/chrome/ui/header/header_help_menu.tsx index 688d76c9d75d9c..c04fbaa07ba712 100644 --- a/src/core/public/chrome/ui/header/header_help_menu.tsx +++ b/src/core/public/chrome/ui/header/header_help_menu.tsx @@ -17,30 +17,29 @@ * under the License. */ +import * as Rx from 'rxjs'; import { FormattedMessage } from '@kbn/i18n/react'; import React, { Component, Fragment } from 'react'; -import * as Rx from 'rxjs'; - +import { InjectedIntl, injectI18n } from '@kbn/i18n/react'; import { - // TODO: add type annotations - // @ts-ignore - EuiButton, - // @ts-ignore + EuiButtonEmpty, EuiFlexGroup, - // @ts-ignore EuiFlexItem, - // @ts-ignore EuiHeaderSectionItemButton, EuiIcon, EuiPopover, EuiPopoverTitle, EuiSpacer, - EuiText, } from '@elastic/eui'; -import { InjectedIntl, injectI18n } from '@kbn/i18n/react'; import { HeaderExtension } from './header_extension'; import { ChromeHelpExtension } from '../../chrome_service'; +import { + ELASTIC_SUPPORT_LINK, + GITHUB_CREATE_ISSUE_LINK, + KIBANA_ASK_ELASTIC_LINK, + KIBANA_FEEDBACK_LINK, +} from '../../constants'; interface Props { helpExtension$: Rx.Observable; @@ -48,6 +47,7 @@ interface Props { kibanaVersion: string; useDefaultContent?: boolean; kibanaDocLink: string; + isCloudEnabled: boolean; } interface State { @@ -90,23 +90,50 @@ class HeaderHelpMenuUI extends Component { const defaultContent = useDefaultContent ? ( - -

- -

-
- - - - + + + + + + + + + + + + + + + + + + + - +
) : null; diff --git a/src/core/server/saved_objects/service/lib/repository.test.js b/src/core/server/saved_objects/service/lib/repository.test.js index 6525590ee96c5b..79a3e573ab98c9 100644 --- a/src/core/server/saved_objects/service/lib/repository.test.js +++ b/src/core/server/saved_objects/service/lib/repository.test.js @@ -49,7 +49,6 @@ describe('SavedObjectsRepository', () => { hits: [ { _index: '.kibana', - _type: '_doc', _id: 'index-pattern:logstash-*', _score: 1, ...mockVersionProps, @@ -65,7 +64,6 @@ describe('SavedObjectsRepository', () => { }, { _index: '.kibana', - _type: '_doc', _id: 'config:6.0.0-alpha1', _score: 1, ...mockVersionProps, @@ -80,7 +78,6 @@ describe('SavedObjectsRepository', () => { }, { _index: '.kibana', - _type: '_doc', _id: 'index-pattern:stocks-*', _score: 1, ...mockVersionProps, @@ -96,7 +93,6 @@ describe('SavedObjectsRepository', () => { }, { _index: '.kibana', - _type: '_doc', _id: 'globaltype:something', _score: 1, ...mockVersionProps, @@ -118,7 +114,6 @@ describe('SavedObjectsRepository', () => { hits: [ { _index: '.kibana', - _type: '_doc', _id: 'foo-namespace:index-pattern:logstash-*', _score: 1, ...mockVersionProps, @@ -135,7 +130,6 @@ describe('SavedObjectsRepository', () => { }, { _index: '.kibana', - _type: '_doc', _id: 'foo-namespace:config:6.0.0-alpha1', _score: 1, ...mockVersionProps, @@ -151,7 +145,6 @@ describe('SavedObjectsRepository', () => { }, { _index: '.kibana', - _type: '_doc', _id: 'foo-namespace:index-pattern:stocks-*', _score: 1, ...mockVersionProps, @@ -168,7 +161,6 @@ describe('SavedObjectsRepository', () => { }, { _index: '.kibana', - _type: '_doc', _id: 'globaltype:something', _score: 1, ...mockVersionProps, @@ -290,7 +282,6 @@ describe('SavedObjectsRepository', () => { describe('#create', () => { beforeEach(() => { callAdminCluster.mockImplementation((method, params) => ({ - _type: '_doc', _id: params.id, ...mockVersionProps, })); @@ -863,7 +854,6 @@ describe('SavedObjectsRepository', () => { items: [ { create: { - _type: '_doc', _id: 'config:one', error: { reason: 'type[config] missing', @@ -872,7 +862,6 @@ describe('SavedObjectsRepository', () => { }, { create: { - _type: '_doc', _id: 'index-pattern:two', ...mockVersionProps, }, @@ -910,14 +899,12 @@ describe('SavedObjectsRepository', () => { items: [ { create: { - _type: '_doc', _id: 'config:one', ...mockVersionProps, }, }, { create: { - _type: '_doc', _id: 'index-pattern:two', ...mockVersionProps, }, @@ -962,7 +949,6 @@ describe('SavedObjectsRepository', () => { items: [ { create: { - _type: '_doc', _id: 'foo-namespace:config:one', _index: '.kibana-test', _primary_term: 1, @@ -971,7 +957,6 @@ describe('SavedObjectsRepository', () => { }, { create: { - _type: '_doc', _id: 'foo-namespace:index-pattern:two', _primary_term: 1, _seq_no: 2, @@ -1021,14 +1006,12 @@ describe('SavedObjectsRepository', () => { items: [ { create: { - _type: '_doc', _id: 'config:one', ...mockVersionProps, }, }, { create: { - _type: '_doc', _id: 'index-pattern:two', ...mockVersionProps, }, @@ -1092,7 +1075,7 @@ describe('SavedObjectsRepository', () => { expect(onBeforeWrite).toHaveBeenCalledTimes(1); }); - it('should return objects in the same order regardless of type', () => {}); + it('should return objects in the same order regardless of type', () => { }); }); describe('#delete', () => { @@ -1496,7 +1479,6 @@ describe('SavedObjectsRepository', () => { describe('#get', () => { const noNamespaceResult = { _id: 'index-pattern:logstash-*', - _type: '_doc', ...mockVersionProps, _source: { type: 'index-pattern', @@ -1509,7 +1491,6 @@ describe('SavedObjectsRepository', () => { }; const namespacedResult = { _id: 'foo-namespace:index-pattern:logstash-*', - _type: '_doc', ...mockVersionProps, _source: { namespace: 'foo-namespace', @@ -1699,14 +1680,12 @@ describe('SavedObjectsRepository', () => { callAdminCluster.mockResolvedValue({ docs: [ { - _type: '_doc', _id: 'config:good', found: true, ...mockVersionProps, _source: { ...mockTimestampFields, config: { title: 'Test' } }, }, { - _type: '_doc', _id: 'config:bad', found: false, }, @@ -1728,14 +1707,12 @@ describe('SavedObjectsRepository', () => { callAdminCluster.mockResolvedValue({ docs: [ { - _type: '_doc', _id: 'config:good', found: true, ...mockVersionProps, _source: { ...mockTimestampFields, config: { title: 'Test' } }, }, { - _type: '_doc', _id: 'config:bad', found: false, }, @@ -1770,21 +1747,18 @@ describe('SavedObjectsRepository', () => { callAdminCluster.mockResolvedValue({ docs: [ { - _type: '_doc', _id: 'one', found: true, ...mockVersionProps, _source: { ...mockTimestampFields, config: { title: 'Test1' } }, }, { - _type: '_doc', _id: 'three', found: true, ...mockVersionProps, _source: { ...mockTimestampFields, config: { title: 'Test3' } }, }, { - _type: '_doc', _id: 'five', found: true, ...mockVersionProps, @@ -1859,7 +1833,6 @@ describe('SavedObjectsRepository', () => { beforeEach(() => { callAdminCluster.mockResolvedValue({ _id: `${type}:${id}`, - _type: '_doc', ...mockVersionProps, result: 'updated', }); @@ -2177,7 +2150,6 @@ describe('SavedObjectsRepository', () => { items: objects.map(items => ({ update: { _id: `${items.type}:${items.id}`, - _type: '_doc', ...mockVersionProps, result: 'updated', } @@ -2244,15 +2216,14 @@ describe('SavedObjectsRepository', () => { callAdminCluster.mockReturnValue({ items: objects - // remove invalid from mocks + // remove invalid from mocks .filter(item => item.id !== 'invalid') .map(items => { - switch(items.id) { + switch (items.id) { case 'version_clash': return ({ update: { _id: `${items.type}:${items.id}`, - _type: '_doc', error: { type: 'version_conflict_engine_exception' } @@ -2262,7 +2233,6 @@ describe('SavedObjectsRepository', () => { return ({ update: { _id: `${items.type}:${items.id}`, - _type: '_doc', ...mockVersionProps, result: 'updated', } @@ -2353,7 +2323,7 @@ describe('SavedObjectsRepository', () => { expect(callAdminCluster).toHaveBeenCalledTimes(1); - const [, { body: [{ update: firstUpdate },, { update: secondUpdate }] }] = callAdminCluster.mock.calls[0]; + const [, { body: [{ update: firstUpdate }, , { update: secondUpdate }] }] = callAdminCluster.mock.calls[0]; expect(firstUpdate).toMatchObject({ if_seq_no: 100, @@ -2407,7 +2377,7 @@ describe('SavedObjectsRepository', () => { expect(callAdminCluster).toHaveBeenCalledTimes(1); - const [, { body: [, { doc }] } ] = callAdminCluster.mock.calls[0]; + const [, { body: [, { doc }] }] = callAdminCluster.mock.calls[0]; expect(doc).toMatchObject({ references: [{ @@ -2434,7 +2404,7 @@ describe('SavedObjectsRepository', () => { expect(callAdminCluster).toHaveBeenCalledTimes(1); - const [, { body: [, { doc }] } ] = callAdminCluster.mock.calls[0]; + const [, { body: [, { doc }] }] = callAdminCluster.mock.calls[0]; expect(doc).toMatchObject({ references: [], @@ -2637,7 +2607,6 @@ describe('SavedObjectsRepository', () => { describe('#incrementCounter', () => { beforeEach(() => { callAdminCluster.mockImplementation((method, params) => ({ - _type: '_doc', _id: params.id, ...mockVersionProps, _index: '.kibana', @@ -2657,7 +2626,6 @@ describe('SavedObjectsRepository', () => { it('formats Elasticsearch response', async () => { callAdminCluster.mockImplementation((method, params) => ({ - _type: '_doc', _id: params.id, ...mockVersionProps, _index: '.kibana', @@ -2776,7 +2744,6 @@ describe('SavedObjectsRepository', () => { it(`doesn't prepend namespace to the id or add namespace property when providing namespace for namespace agnostic type`, async () => { callAdminCluster.mockImplementation((method, params) => ({ - _type: '_doc', _id: params.id, ...mockVersionProps, _index: '.kibana', diff --git a/src/es_archiver/lib/docs/__tests__/index_doc_records_stream.js b/src/es_archiver/lib/docs/__tests__/index_doc_records_stream.js index e48af1f60509bf..4a5d048637fccf 100644 --- a/src/es_archiver/lib/docs/__tests__/index_doc_records_stream.js +++ b/src/es_archiver/lib/docs/__tests__/index_doc_records_stream.js @@ -35,11 +35,11 @@ import { const recordsToBulkBody = records => { return records.reduce((acc, record) => { - const { index, type, id, source } = record.value; + const { index, id, source } = record.value; return [ ...acc, - { index: { _index: index, _type: type, _id: id } }, + { index: { _index: index, _id: id } }, source ]; }, []); diff --git a/src/es_archiver/lib/docs/index_doc_records_stream.js b/src/es_archiver/lib/docs/index_doc_records_stream.js index 943b1e6e2f329e..3e88f10387f9e5 100644 --- a/src/es_archiver/lib/docs/index_doc_records_stream.js +++ b/src/es_archiver/lib/docs/index_doc_records_stream.js @@ -30,7 +30,6 @@ export function createIndexDocRecordsStream(client, stats, progress) { { index: { _index: doc.index, - _type: doc.type, _id: doc.id, } }, diff --git a/src/es_archiver/lib/indices/kibana_index.js b/src/es_archiver/lib/indices/kibana_index.js index dc916e11d698c0..6f491783829a8c 100644 --- a/src/es_archiver/lib/indices/kibana_index.js +++ b/src/es_archiver/lib/indices/kibana_index.js @@ -176,7 +176,6 @@ export async function cleanKibanaIndices({ client, stats, log, kibanaPluginIds } export async function createDefaultSpace({ index, client }) { await client.create({ index, - type: '_doc', id: 'space:default', ignore: 409, body: { diff --git a/src/fixtures/fake_row.js b/src/fixtures/fake_row.js index 5bc752de299b27..747c6e06be4278 100644 --- a/src/fixtures/fake_row.js +++ b/src/fixtures/fake_row.js @@ -31,7 +31,6 @@ export function getFakeRow(id, mapping) { _id: id, _index: 'test', _source: getFakeRowVals('original', id, mapping), - _type: 'doc', sort: [id], }; } diff --git a/src/fixtures/hits.js b/src/fixtures/hits.js index 413501a3599ed1..e8da3e8ee285bc 100644 --- a/src/fixtures/hits.js +++ b/src/fixtures/hits.js @@ -37,7 +37,6 @@ export default function fitsFixture() { return { _score: 1, _id: 1000 + i, - _type: 'test', _index: 'test-index', _source: { '@timestamp': row[0], diff --git a/src/legacy/core_plugins/console/np_ready/public/application/constants/help_example.txt b/src/legacy/core_plugins/console/np_ready/public/application/constants/help_example.txt index 9bc22ecd2d6301..fd37c413670337 100644 --- a/src/legacy/core_plugins/console/np_ready/public/application/constants/help_example.txt +++ b/src/legacy/core_plugins/console/np_ready/public/application/constants/help_example.txt @@ -1,8 +1,8 @@ # index a doc -PUT index/type/1 +PUT index/1 { "body": "here" } # and get it ... -GET index/type/1 +GET index/1 diff --git a/src/legacy/core_plugins/console/public/quarantined/tests/src/input_tokenization.test.js b/src/legacy/core_plugins/console/public/quarantined/tests/src/input_tokenization.test.js index cfb0f1b8c24dbb..01f30f826ab269 100644 --- a/src/legacy/core_plugins/console/public/quarantined/tests/src/input_tokenization.test.js +++ b/src/legacy/core_plugins/console/public/quarantined/tests/src/input_tokenization.test.js @@ -251,10 +251,10 @@ describe('Input Tokenization', () => { 'paren.lparen', '{', 'paren.rparen', '}', 'paren.rparen', '}' ], 'POST _search\n' + - '{\n' + - ' "q": {}\n' + - ' \n' + - '}' + '{\n' + + ' "q": {}\n' + + ' \n' + + '}' ); tokenTest( @@ -263,10 +263,10 @@ describe('Input Tokenization', () => { 'paren.rparen', '}', 'paren.rparen', '}' ], 'POST _search\n' + - '{\n' + - ' "q": { "s": {}}\n' + - ' \n' + - '}' + '{\n' + + ' "q": { "s": {}}\n' + + ' \n' + + '}' ); function statesAsList() { @@ -305,44 +305,44 @@ describe('Input Tokenization', () => { statesTest( ['start', 'json', 'json', 'start'], 'POST _search\n' + - '{\n' + - ' "query": { "match_all": {} }\n' + - '}' + '{\n' + + ' "query": { "match_all": {} }\n' + + '}' ); statesTest( ['start', 'json', ['json', 'json'], ['json', 'json'], 'json', 'start'], 'POST _search\n' + - '{\n' + - ' "query": { \n' + - ' "match_all": {} \n' + - ' }\n' + - '}' + '{\n' + + ' "query": { \n' + + ' "match_all": {} \n' + + ' }\n' + + '}' ); statesTest( ['start', 'json', 'json', 'start'], 'POST _search\n' + - '{\n' + - ' "script": { "source": "" }\n' + - '}' + '{\n' + + ' "script": { "source": "" }\n' + + '}' ); statesTest( ['start', 'json', 'json', 'start'], 'POST _search\n' + - '{\n' + - ' "script": ""\n' + - '}' + '{\n' + + ' "script": ""\n' + + '}' ); statesTest( ['start', 'json', ['json', 'json'], 'json', 'start'], 'POST _search\n' + - '{\n' + - ' "script": {\n' + - ' }\n' + - '}' + '{\n' + + ' "script": {\n' + + ' }\n' + + '}' ); @@ -350,41 +350,41 @@ describe('Input Tokenization', () => { ['start', 'json', ['script-start', 'json', 'json', 'json'], ['script-start', 'json', 'json', 'json'], ['json', 'json'], 'json', 'start'], 'POST _search\n' + - '{\n' + - ' "test": { "script": """\n' + - ' test script\n' + - ' """\n' + - ' }\n' + - '}' + '{\n' + + ' "test": { "script": """\n' + + ' test script\n' + + ' """\n' + + ' }\n' + + '}' ); statesTest( ['start', 'json', ['script-start', 'json'], ['script-start', 'json'], 'json', 'start'], 'POST _search\n' + - '{\n' + - ' "script": """\n' + - ' test script\n' + - ' """,\n' + - '}' + '{\n' + + ' "script": """\n' + + ' test script\n' + + ' """,\n' + + '}' ); statesTest( ['start', 'json', 'json', 'start'], 'POST _search\n' + - '{\n' + - ' "script": """test script""",\n' + - '}' + '{\n' + + ' "script": """test script""",\n' + + '}' ); statesTest( ['start', 'json', ['string_literal', 'json'], ['string_literal', 'json'], 'json', 'start'], 'POST _search\n' + - '{\n' + - ' "something": """\n' + - ' test script\n' + - ' """,\n' + - '}' + '{\n' + + ' "something": """\n' + + ' test script\n' + + ' """,\n' + + '}' ); statesTest( @@ -392,21 +392,21 @@ describe('Input Tokenization', () => { ['json', 'json'], ['json', 'json'], 'json', 'start'], 'POST _search\n' + - '{\n' + - ' "something": { "f" : """\n' + - ' test script\n' + - ' """,\n' + - ' "g": 1\n' + - ' }\n' + - '}' + '{\n' + + ' "something": { "f" : """\n' + + ' test script\n' + + ' """,\n' + + ' "g": 1\n' + + ' }\n' + + '}' ); statesTest( ['start', 'json', 'json', 'start'], 'POST _search\n' + - '{\n' + - ' "something": """test script""",\n' + - '}' + '{\n' + + ' "something": """test script""",\n' + + '}' ); }); diff --git a/src/legacy/core_plugins/console/server/__tests__/proxy_route/params.js b/src/legacy/core_plugins/console/server/__tests__/proxy_route/params.js index 7c6e221d9ce818..aa7b764f84fc78 100644 --- a/src/legacy/core_plugins/console/server/__tests__/proxy_route/params.js +++ b/src/legacy/core_plugins/console/server/__tests__/proxy_route/params.js @@ -61,7 +61,7 @@ describe('Console Proxy Route', () => { const { statusCode } = await server.inject({ method: 'POST', - url: '/api/console/proxy?method=GET&path=/baz/type/id', + url: '/api/console/proxy?method=GET&path=/baz/id', }); expect(statusCode).to.be(403); @@ -79,7 +79,7 @@ describe('Console Proxy Route', () => { const { statusCode } = await server.inject({ method: 'POST', - url: '/api/console/proxy?method=GET&path=/foo/type/id', + url: '/api/console/proxy?method=GET&path=/foo/id', }); expect(statusCode).to.be(200); @@ -98,7 +98,7 @@ describe('Console Proxy Route', () => { const { statusCode } = await server.inject({ method: 'POST', - url: '/api/console/proxy?method=GET&path=/foo/type/id', + url: '/api/console/proxy?method=GET&path=/foo/id', }); expect(statusCode).to.be(200); @@ -116,7 +116,7 @@ describe('Console Proxy Route', () => { server.route(createProxyRoute({ baseUrl: 'http://localhost:9200', getConfigForReq })); await server.inject({ method: 'POST', - url: '/api/console/proxy?method=HEAD&path=/index/type/id', + url: '/api/console/proxy?method=HEAD&path=/index/id', }); sinon.assert.calledOnce(getConfigForReq); @@ -125,8 +125,8 @@ describe('Console Proxy Route', () => { expect(args[0]).to.have.property('method', 'post'); expect(args[0]) .to.have.property('query') - .eql({ method: 'HEAD', path: '/index/type/id' }); - expect(args[1]).to.be('http://localhost:9200/index/type/id?pretty=true'); + .eql({ method: 'HEAD', path: '/index/id' }); + expect(args[1]).to.be('http://localhost:9200/index/id?pretty=true'); }); it('sends the returned timeout, agent, and base headers to request', async () => { @@ -154,7 +154,7 @@ describe('Console Proxy Route', () => { await server.inject({ method: 'POST', - url: '/api/console/proxy?method=HEAD&path=/index/type/id', + url: '/api/console/proxy?method=HEAD&path=/index/id', }); sinon.assert.calledOnce(requestModule.sendRequest); diff --git a/src/legacy/core_plugins/console/server/__tests__/proxy_route/query_string.js b/src/legacy/core_plugins/console/server/__tests__/proxy_route/query_string.js index 7cabe891771646..f20adb897be658 100644 --- a/src/legacy/core_plugins/console/server/__tests__/proxy_route/query_string.js +++ b/src/legacy/core_plugins/console/server/__tests__/proxy_route/query_string.js @@ -85,19 +85,19 @@ describe('Console Proxy Route', () => { }); describe('starts with a slash', () => { it('combines well with the base url', async () => { - await request('GET', '/index/type/id'); + await request('GET', '/index/id'); sinon.assert.calledOnce(requestModule.sendRequest); expect(requestModule.sendRequest.getCall(0).args[0].uri.href).to.be( - 'http://localhost:9200/index/type/id?pretty=true' + 'http://localhost:9200/index/id?pretty=true' ); }); }); describe(`doesn't start with a slash`, () => { it('combines well with the base url', async () => { - await request('GET', 'index/type/id'); + await request('GET', 'index/id'); sinon.assert.calledOnce(requestModule.sendRequest); expect(requestModule.sendRequest.getCall(0).args[0].uri.href).to.be( - 'http://localhost:9200/index/type/id?pretty=true' + 'http://localhost:9200/index/id?pretty=true' ); }); }); diff --git a/src/legacy/core_plugins/console/server/__tests__/wildcard_matcher.js b/src/legacy/core_plugins/console/server/__tests__/wildcard_matcher.js index 4eb0de4e5ebec4..9999c98701ffc7 100644 --- a/src/legacy/core_plugins/console/server/__tests__/wildcard_matcher.js +++ b/src/legacy/core_plugins/console/server/__tests__/wildcard_matcher.js @@ -40,7 +40,7 @@ describe('WildcardMatcher', function () { it('matches nothing', () => should('', '*')); it('does not match /', () => shouldNot('/', '*')); it('matches localhost', () => should('localhost', '*')); - it('matches a path', () => should('/index/type/_search', '*')); + it('matches a path', () => should('/index/_search', '*')); describe('defaultValue = /', function () { it('matches /', () => should('/', '*', '/')); @@ -52,7 +52,7 @@ describe('WildcardMatcher', function () { it('does not match https', () => shouldNot('https', 'http')); it('does not match nothing', () => shouldNot('', 'http')); it('does not match localhost', () => shouldNot('localhost', 'http')); - it('does not match a path', () => shouldNot('/index/type/_search', 'http')); + it('does not match a path', () => shouldNot('/index/_search', 'http')); }); describe('pattern = 560{1..9}', function () { diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/count.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/count.json index a657440f1fe4a2..bd69fd0c77ec84 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/count.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/count.json @@ -30,8 +30,7 @@ ], "patterns": [ "_count", - "{indices}/_count", - "{indices}/{type}/_count" + "{indices}/_count" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/delete_by_query.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/delete_by_query.json index 12735f2d4b6933..3867efd814238c 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/delete_by_query.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/delete_by_query.json @@ -1,6 +1,7 @@ { "delete_by_query": { "url_params": { + "analyzer": "", "analyze_wildcard": "__flag__", "default_operator": [ "AND", @@ -30,7 +31,6 @@ "dfs_query_then_fetch" ], "search_timeout": "", - "size": "", "max_docs": "all documents", "sort": [], "_source": [], @@ -52,8 +52,7 @@ "POST" ], "patterns": [ - "{indices}/_delete_by_query", - "{indices}/{type}/_delete_by_query" + "{indices}/_delete_by_query" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/exists.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/exists.json index 4b7b18b9fe1b38..a6799b9e361cde 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/exists.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/exists.json @@ -21,8 +21,7 @@ "HEAD" ], "patterns": [ - "{indices}/_doc/{id}", - "{indices}/{type}/{id}" + "{indices}/_doc/{id}" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/explain.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/explain.json index be01e462878db1..e4654a99a76eac 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/explain.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/explain.json @@ -22,8 +22,7 @@ "POST" ], "patterns": [ - "{indices}/_explain/{id}", - "{indices}/{type}/{id}/_explain" + "{indices}/_explain/{id}" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/get.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/get.json index a0b70545baff99..5a72761c7c32e1 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/get.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/get.json @@ -21,8 +21,7 @@ "GET" ], "patterns": [ - "{indices}/_doc/{id}", - "{indices}/{type}/{id}" + "{indices}/_doc/{id}" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/get_script_context.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/get_script_context.json new file mode 100644 index 00000000000000..528c261df77078 --- /dev/null +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/get_script_context.json @@ -0,0 +1,10 @@ +{ + "get_script_context": { + "methods": [ + "GET" + ], + "patterns": [ + "_script_context" + ] + } +} diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/get_source.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/get_source.json index 420e03a1bdcf1d..8201960363a784 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/get_source.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/get_source.json @@ -20,8 +20,7 @@ "GET" ], "patterns": [ - "{indices}/_source/{id}", - "{indices}/{type}/{id}/_source" + "{indices}/_source/{id}" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/index.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/index.json index 7b5551727d6451..25977806776a7a 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/index.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/index.json @@ -29,9 +29,7 @@ ], "patterns": [ "{indices}/_doc/{id}", - "{indices}/_doc", - "{indices}/{type}", - "{indices}/{type}/{id}" + "{indices}/_doc" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.get_field_mapping.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.get_field_mapping.json index ae82696434cedb..362b266ecb1831 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.get_field_mapping.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.get_field_mapping.json @@ -18,9 +18,7 @@ ], "patterns": [ "_mapping/field/{fields}", - "{indices}/_mapping/field/{fields}", - "_mapping/{type}/field/{fields}", - "{indices}/_mapping/{type}/field/{fields}" + "{indices}/_mapping/field/{fields}" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.get_mapping.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.get_mapping.json index 03f5de56ea3514..73f4e42262bf26 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.get_mapping.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.get_mapping.json @@ -1,7 +1,6 @@ { "indices.get_mapping": { "url_params": { - "include_type_name": "__flag__", "ignore_unavailable": "__flag__", "allow_no_indices": "__flag__", "expand_wildcards": [ @@ -18,9 +17,7 @@ ], "patterns": [ "_mapping", - "{indices}/_mapping", - "_mapping/{type}", - "{indices}/_mapping/{type}" + "{indices}/_mapping" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.put_mapping.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.put_mapping.json index 3b833117be499c..07a62a64b64e15 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.put_mapping.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.put_mapping.json @@ -1,7 +1,6 @@ { "indices.put_mapping": { "url_params": { - "include_type_name": "__flag__", "timeout": "", "master_timeout": "", "ignore_unavailable": "__flag__", @@ -18,14 +17,7 @@ "POST" ], "patterns": [ - "{indices}/_mapping", - "{indices}/{type}/_mapping", - "{indices}/_mapping/{type}", - "{indices}/{type}/_mappings", - "{indices}/_mappings/{type}", - "_mappings/{type}", - "{indices}/_mappings", - "_mapping/{type}" + "{indices}/_mapping" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.shrink.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.shrink.json index 6fbdea0f1244bf..31acc86a2fa560 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.shrink.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.shrink.json @@ -1,7 +1,6 @@ { "indices.shrink": { "url_params": { - "copy_settings": "__flag__", "timeout": "", "master_timeout": "", "wait_for_active_shards": "" diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.split.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.split.json index 68f2e338cd2013..1bfbaa078b7967 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.split.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/indices.split.json @@ -1,7 +1,6 @@ { "indices.split": { "url_params": { - "copy_settings": "__flag__", "timeout": "", "master_timeout": "", "wait_for_active_shards": "" diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/mget.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/mget.json index f84b46a379cf4d..612bef571fe3f9 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/mget.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/mget.json @@ -16,8 +16,7 @@ ], "patterns": [ "_mget", - "{indices}/_mget", - "{indices}/{type}/_mget" + "{indices}/_mget" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/msearch.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/msearch.json index 502d3e25686dfa..ecb71e9ba23c0c 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/msearch.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/msearch.json @@ -20,8 +20,7 @@ ], "patterns": [ "_msearch", - "{indices}/_msearch", - "{indices}/{type}/_msearch" + "{indices}/_msearch" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/msearch_template.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/msearch_template.json index 02077dd91439b2..0b0ca087b1819f 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/msearch_template.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/msearch_template.json @@ -9,7 +9,8 @@ ], "typed_keys": "__flag__", "max_concurrent_searches": "", - "rest_total_hits_as_int": "__flag__" + "rest_total_hits_as_int": "__flag__", + "ccs_minimize_roundtrips": "__flag__" }, "methods": [ "GET", @@ -17,8 +18,7 @@ ], "patterns": [ "_msearch/template", - "{indices}/_msearch/template", - "{indices}/{type}/_msearch/template" + "{indices}/_msearch/template" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/mtermvectors.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/mtermvectors.json index f5c8cbe76bbc44..72a134eca4d2e9 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/mtermvectors.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/mtermvectors.json @@ -25,8 +25,7 @@ ], "patterns": [ "_mtermvectors", - "{indices}/_mtermvectors", - "{indices}/{type}/_mtermvectors" + "{indices}/_mtermvectors" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/search.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/search.json index 24bda08dd5dbf3..eb21b43644d777 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/search.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/search.json @@ -65,8 +65,7 @@ ], "patterns": [ "_search", - "{indices}/_search", - "{indices}/{type}/_search" + "{indices}/_search" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/search_template.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/search_template.json index 6b73e939843a46..582ecab1dd614b 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/search_template.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/search_template.json @@ -22,7 +22,8 @@ "explain": "__flag__", "profile": "__flag__", "typed_keys": "__flag__", - "rest_total_hits_as_int": "__flag__" + "rest_total_hits_as_int": "__flag__", + "ccs_minimize_roundtrips": "__flag__" }, "methods": [ "GET", @@ -30,8 +31,7 @@ ], "patterns": [ "_search/template", - "{indices}/_search/template", - "{indices}/{type}/_search/template" + "{indices}/_search/template" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/termvectors.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/termvectors.json index 80373d903aad84..d94cffc38b7afc 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/termvectors.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/termvectors.json @@ -24,9 +24,7 @@ ], "patterns": [ "{indices}/_termvectors/{id}", - "{indices}/_termvectors", - "{indices}/{type}/{id}/_termvectors", - "{indices}/{type}/_termvectors" + "{indices}/_termvectors" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html" } diff --git a/src/legacy/core_plugins/console/server/api_server/spec/generated/update_by_query.json b/src/legacy/core_plugins/console/server/api_server/spec/generated/update_by_query.json index e5857f219af460..739ea16888146a 100644 --- a/src/legacy/core_plugins/console/server/api_server/spec/generated/update_by_query.json +++ b/src/legacy/core_plugins/console/server/api_server/spec/generated/update_by_query.json @@ -32,7 +32,6 @@ "dfs_query_then_fetch" ], "search_timeout": "", - "size": "", "max_docs": "all documents", "sort": [], "_source": [], @@ -55,8 +54,7 @@ "POST" ], "patterns": [ - "{indices}/_update_by_query", - "{indices}/{type}/_update_by_query" + "{indices}/_update_by_query" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html" } diff --git a/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/__jest__/objects_table.test.js b/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/__jest__/objects_table.test.js index 39a9f7cd98a574..5956b6c306b0e5 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/__jest__/objects_table.test.js +++ b/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/__jest__/objects_table.test.js @@ -106,10 +106,10 @@ const allSavedObjects = [ }, ]; -const $http = () => {}; +const $http = () => { }; $http.post = jest.fn().mockImplementation(() => []); const defaultProps = { - goInspectObject: () => {}, + goInspectObject: () => { }, confirmModalPromise: jest.fn(), savedObjectsClient: { find: jest.fn(), @@ -256,7 +256,6 @@ describe('ObjectsTable', () => { const mockSavedObjects = mockSelectedSavedObjects.map(obj => ({ _id: obj.id, - _type: obj._type, _source: {}, })); @@ -297,7 +296,6 @@ describe('ObjectsTable', () => { const mockSavedObjects = mockSelectedSavedObjects.map(obj => ({ _id: obj.id, - _type: obj._type, _source: {}, })); diff --git a/src/legacy/core_plugins/kibana/server/lib/kql_usage_collector/fetch.test.js b/src/legacy/core_plugins/kibana/server/lib/kql_usage_collector/fetch.test.js index e8e95fd92dd110..a5db4602872ee4 100644 --- a/src/legacy/core_plugins/kibana/server/lib/kql_usage_collector/fetch.test.js +++ b/src/legacy/core_plugins/kibana/server/lib/kql_usage_collector/fetch.test.js @@ -32,7 +32,6 @@ function setupMockCallCluster(optCount, language) { if (optCount === null) { return Promise.resolve({ _index: '.kibana_1', - _type: 'doc', _id: 'kql-telemetry:kql-telemetry', found: false, }); diff --git a/src/legacy/core_plugins/kibana/server/routes/api/management/saved_objects/scroll.js b/src/legacy/core_plugins/kibana/server/routes/api/management/saved_objects/scroll.js index a2cc63b4b8679b..6926fa72b0ae22 100644 --- a/src/legacy/core_plugins/kibana/server/routes/api/management/saved_objects/scroll.js +++ b/src/legacy/core_plugins/kibana/server/routes/api/management/saved_objects/scroll.js @@ -53,10 +53,8 @@ export function registerScrollForExportRoute(server) { }); return objects.map(hit => { - const type = hit.type; return { _id: hit.id, - _type: type, _source: hit.attributes, _meta: { savedObjectVersion: 2 diff --git a/src/legacy/core_plugins/telemetry/index.ts b/src/legacy/core_plugins/telemetry/index.ts index 4b6566415f3e18..50a25423b5eb82 100644 --- a/src/legacy/core_plugins/telemetry/index.ts +++ b/src/legacy/core_plugins/telemetry/index.ts @@ -17,6 +17,7 @@ * under the License. */ +import * as Rx from 'rxjs'; import { resolve } from 'path'; import JoiNamespace from 'joi'; import { Server } from 'hapi'; @@ -45,6 +46,14 @@ const telemetry = (kibana: any) => { config(Joi: typeof JoiNamespace) { return Joi.object({ enabled: Joi.boolean().default(true), + optIn: Joi.when('allowChangingOptInStatus', { + is: false, + then: Joi.valid(true), + otherwise: Joi.boolean() + .allow(null) + .default(null), + }), + allowChangingOptInStatus: Joi.boolean().default(true), // `config` is used internally and not intended to be set config: Joi.string().default(Joi.ref('$defaultConfigPath')), banner: Joi.boolean().default(true), @@ -80,8 +89,25 @@ const telemetry = (kibana: any) => { }, }, async replaceInjectedVars(originalInjectedVars: any, request: any) { + const config = request.server.config(); + const optIn = config.get('telemetry.optIn'); + const allowChangingOptInStatus = config.get('telemetry.allowChangingOptInStatus'); const currentKibanaVersion = getCurrentKibanaVersion(request.server); - const telemetryOptedIn = await getTelemetryOptIn({ request, currentKibanaVersion }); + let telemetryOptedIn: boolean | null; + + if (typeof optIn === 'boolean' && !allowChangingOptInStatus) { + // When not allowed to change optIn status and an optIn value is set, we'll overwrite with that + telemetryOptedIn = optIn; + } else { + telemetryOptedIn = await getTelemetryOptIn({ + request, + currentKibanaVersion, + }); + if (telemetryOptedIn === null) { + // In the senario there's no value set in telemetryOptedIn, we'll return optIn value + telemetryOptedIn = optIn; + } + } return { ...originalInjectedVars, @@ -93,20 +119,36 @@ const telemetry = (kibana: any) => { return { telemetryEnabled: getXpackConfigWithDeprecated(config, 'telemetry.enabled'), telemetryUrl: getXpackConfigWithDeprecated(config, 'telemetry.url'), - telemetryBanner: getXpackConfigWithDeprecated(config, 'telemetry.banner'), - telemetryOptedIn: null, + telemetryBanner: + config.get('telemetry.allowChangingOptInStatus') !== false && + getXpackConfigWithDeprecated(config, 'telemetry.banner'), + telemetryOptedIn: config.get('telemetry.optIn'), + allowChangingOptInStatus: config.get('telemetry.allowChangingOptInStatus'), }; }, hacks: ['plugins/telemetry/hacks/telemetry_init', 'plugins/telemetry/hacks/telemetry_opt_in'], mappings, }, - init(server: Server) { + async init(server: Server) { const initializerContext = { env: { packageInfo: { version: getCurrentKibanaVersion(server), }, }, + config: { + create() { + const config = server.config(); + return Rx.of({ + enabled: config.get('telemetry.enabled'), + optIn: config.get('telemetry.optIn'), + config: config.get('telemetry.config'), + banner: config.get('telemetry.banner'), + url: config.get('telemetry.url'), + allowChangingOptInStatus: config.get('telemetry.allowChangingOptInStatus'), + }); + }, + }, } as PluginInitializerContext; const coreSetup = ({ @@ -114,7 +156,7 @@ const telemetry = (kibana: any) => { log: server.log, } as any) as CoreSetup; - telemetryPlugin(initializerContext).setup(coreSetup); + await telemetryPlugin(initializerContext).setup(coreSetup); // register collectors server.usage.collectorSet.register(createLocalizationUsageCollector(server)); diff --git a/src/legacy/core_plugins/telemetry/public/components/__snapshots__/telemetry_form.test.js.snap b/src/legacy/core_plugins/telemetry/public/components/__snapshots__/telemetry_form.test.js.snap index c1ad6276aee250..e1aead3798de7a 100644 --- a/src/legacy/core_plugins/telemetry/public/components/__snapshots__/telemetry_form.test.js.snap +++ b/src/legacy/core_plugins/telemetry/public/components/__snapshots__/telemetry_form.test.js.snap @@ -1,6 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`TelemetryForm renders as expected 1`] = ` +exports[`TelemetryForm doesn't render form when not allowed to change optIn status 1`] = `""`; + +exports[`TelemetryForm renders as expected when allows to change optIn status 1`] = ` { switch (key) { case '$http': return mockHttp; + case 'allowChangingOptInStatus': + return true; default: return null; } @@ -47,7 +49,23 @@ const buildTelemetryOptInProvider = () => { }; describe('TelemetryForm', () => { - it('renders as expected', () => { + it('renders as expected when allows to change optIn status', () => { + mockInjectedMetadata({ telemetryOptedIn: null, allowChangingOptInStatus: true }); + + expect(shallowWithIntl( + ) + ).toMatchSnapshot(); + }); + + it(`doesn't render form when not allowed to change optIn status`, () => { + mockInjectedMetadata({ telemetryOptedIn: null, allowChangingOptInStatus: false }); + expect(shallowWithIntl( { const optIn = true; const bannerId = 'bruce-banner'; - mockInjectedMetadata({ telemetryOptedIn: optIn }); + mockInjectedMetadata({ telemetryOptedIn: optIn, allowChangingOptInStatus: true }); const telemetryOptInProvider = getTelemetryOptInProvider(); telemetryOptInProvider.setBannerId(bannerId); @@ -92,7 +92,7 @@ describe('click_banner', () => { remove: sinon.spy() }; const optIn = true; - mockInjectedMetadata({ telemetryOptedIn: null }); + mockInjectedMetadata({ telemetryOptedIn: null, allowChangingOptInStatus: true }); const telemetryOptInProvider = getTelemetryOptInProvider({ simulateFailure: true }); await clickBanner(telemetryOptInProvider, optIn, { _banners: banners, _toastNotifications: toastNotifications }); @@ -110,7 +110,7 @@ describe('click_banner', () => { remove: sinon.spy() }; const optIn = false; - mockInjectedMetadata({ telemetryOptedIn: null }); + mockInjectedMetadata({ telemetryOptedIn: null, allowChangingOptInStatus: true }); const telemetryOptInProvider = getTelemetryOptInProvider({ simulateError: true }); await clickBanner(telemetryOptInProvider, optIn, { _banners: banners, _toastNotifications: toastNotifications }); diff --git a/src/legacy/core_plugins/telemetry/public/hacks/welcome_banner/handle_old_settings.test.js b/src/legacy/core_plugins/telemetry/public/hacks/welcome_banner/handle_old_settings.test.js index fd21a5122b5946..f26ca0ca0e3c51 100644 --- a/src/legacy/core_plugins/telemetry/public/hacks/welcome_banner/handle_old_settings.test.js +++ b/src/legacy/core_plugins/telemetry/public/hacks/welcome_banner/handle_old_settings.test.js @@ -38,7 +38,7 @@ const getTelemetryOptInProvider = (enabled, { simulateFailure = false } = {}) => const chrome = { addBasePath: url => url }; - mockInjectedMetadata({ telemetryOptedIn: enabled }); + mockInjectedMetadata({ telemetryOptedIn: enabled, allowChangingOptInStatus: true }); const $injector = { get: (key) => { diff --git a/src/legacy/core_plugins/telemetry/public/hacks/welcome_banner/should_show_banner.test.js b/src/legacy/core_plugins/telemetry/public/hacks/welcome_banner/should_show_banner.test.js index 19e7ccbe618661..240c991a75b646 100644 --- a/src/legacy/core_plugins/telemetry/public/hacks/welcome_banner/should_show_banner.test.js +++ b/src/legacy/core_plugins/telemetry/public/hacks/welcome_banner/should_show_banner.test.js @@ -38,7 +38,7 @@ const getMockInjector = () => { }; const getTelemetryOptInProvider = ({ telemetryOptedIn = null } = {}) => { - mockInjectedMetadata({ telemetryOptedIn }); + mockInjectedMetadata({ telemetryOptedIn, allowChangingOptInStatus: true }); const injector = getMockInjector(); const chrome = { addBasePath: (url) => url diff --git a/src/legacy/core_plugins/telemetry/public/services/telemetry_opt_in.test.js b/src/legacy/core_plugins/telemetry/public/services/telemetry_opt_in.test.js index 0034fa4438238a..26f14fc87d937c 100644 --- a/src/legacy/core_plugins/telemetry/public/services/telemetry_opt_in.test.js +++ b/src/legacy/core_plugins/telemetry/public/services/telemetry_opt_in.test.js @@ -34,7 +34,7 @@ describe('TelemetryOptInProvider', () => { addBasePath: (url) => url }; - mockInjectedMetadata({ telemetryOptedIn: optedIn }); + mockInjectedMetadata({ telemetryOptedIn: optedIn, allowChangingOptInStatus: true }); const mockInjector = { get: (key) => { diff --git a/src/legacy/core_plugins/telemetry/public/services/telemetry_opt_in.test.mocks.js b/src/legacy/core_plugins/telemetry/public/services/telemetry_opt_in.test.mocks.js index f98f5e16e00c3b..012f8de6400420 100644 --- a/src/legacy/core_plugins/telemetry/public/services/telemetry_opt_in.test.mocks.js +++ b/src/legacy/core_plugins/telemetry/public/services/telemetry_opt_in.test.mocks.js @@ -24,10 +24,11 @@ import { } from '../../../../../core/public/mocks'; const injectedMetadataMock = injectedMetadataServiceMock.createStartContract(); -export function mockInjectedMetadata({ telemetryOptedIn }) { +export function mockInjectedMetadata({ telemetryOptedIn, allowChangingOptInStatus }) { const mockGetInjectedVar = jest.fn().mockImplementation((key) => { switch (key) { case 'telemetryOptedIn': return telemetryOptedIn; + case 'allowChangingOptInStatus': return allowChangingOptInStatus; default: throw new Error(`unexpected injectedVar ${key}`); } }); diff --git a/src/legacy/core_plugins/telemetry/public/services/telemetry_opt_in.ts b/src/legacy/core_plugins/telemetry/public/services/telemetry_opt_in.ts index f4462ffea7a337..4d27bad352cd4d 100644 --- a/src/legacy/core_plugins/telemetry/public/services/telemetry_opt_in.ts +++ b/src/legacy/core_plugins/telemetry/public/services/telemetry_opt_in.ts @@ -28,11 +28,15 @@ let currentOptInStatus = false; export function TelemetryOptInProvider($injector: any, chrome: any) { currentOptInStatus = npStart.core.injectedMetadata.getInjectedVar('telemetryOptedIn') as boolean; + const allowChangingOptInStatus = npStart.core.injectedMetadata.getInjectedVar( + 'allowChangingOptInStatus' + ) as boolean; setCanTrackUiMetrics(currentOptInStatus); const provider = { getBannerId: () => bannerId, getOptIn: () => currentOptInStatus, + canChangeOptInStatus: () => allowChangingOptInStatus, setBannerId(id: string) { bannerId = id; }, diff --git a/src/legacy/core_plugins/telemetry/server/plugin.ts b/src/legacy/core_plugins/telemetry/server/plugin.ts index a5f0f1234799a4..813aa0df09e8c8 100644 --- a/src/legacy/core_plugins/telemetry/server/plugin.ts +++ b/src/legacy/core_plugins/telemetry/server/plugin.ts @@ -29,7 +29,7 @@ export class TelemetryPlugin { this.currentKibanaVersion = initializerContext.env.packageInfo.version; } - public setup(core: CoreSetup) { + public async setup(core: CoreSetup) { const currentKibanaVersion = this.currentKibanaVersion; telemetryCollectionManager.setStatsGetter(getStats, 'local'); registerRoutes({ core, currentKibanaVersion }); diff --git a/src/legacy/core_plugins/telemetry/server/routes/index.ts b/src/legacy/core_plugins/telemetry/server/routes/index.ts index 2eb6bf95b4f45e..549b3ef6068ec4 100644 --- a/src/legacy/core_plugins/telemetry/server/routes/index.ts +++ b/src/legacy/core_plugins/telemetry/server/routes/index.ts @@ -27,6 +27,6 @@ interface RegisterRoutesParams { } export function registerRoutes({ core, currentKibanaVersion }: RegisterRoutesParams) { - registerOptInRoutes({ core, currentKibanaVersion }); registerTelemetryDataRoutes(core); + registerOptInRoutes({ core, currentKibanaVersion }); } diff --git a/test/api_integration/apis/index_patterns/es_errors/lib/get_es_errors.js b/test/api_integration/apis/index_patterns/es_errors/lib/get_es_errors.js index f303bca0da5743..df221a09a661c9 100644 --- a/test/api_integration/apis/index_patterns/es_errors/lib/get_es_errors.js +++ b/test/api_integration/apis/index_patterns/es_errors/lib/get_es_errors.js @@ -36,7 +36,6 @@ export async function getDocNotFoundError(es) { try { await es.get({ index: 'basic_index', - type: 'type', id: '1234' }); } catch (err) { diff --git a/test/functional/apps/management/_handle_version_conflict.js b/test/functional/apps/management/_handle_version_conflict.js index ce5f968a37115e..217e6d4c1a8d38 100644 --- a/test/functional/apps/management/_handle_version_conflict.js +++ b/test/functional/apps/management/_handle_version_conflict.js @@ -56,7 +56,6 @@ export default function ({ getService, getPageObjects }) { await PageObjects.settings.setScriptedFieldScript(`doc['bytes'].value`); const response = await es.update({ index: '.kibana', - type: '_doc', id: 'index-pattern:logstash-*', body: { 'doc': { 'index-pattern': { 'fieldFormatMap': '{"geo.src":{"id":"number"}}' } } @@ -83,7 +82,6 @@ export default function ({ getService, getPageObjects }) { await PageObjects.settings.setFieldFormat('url'); const response = await es.update({ index: '.kibana', - type: '_doc', id: 'index-pattern:logstash-*', body: { 'doc': { 'index-pattern': { 'fieldFormatMap': '{"geo.dest":{"id":"number"}}' } } diff --git a/x-pack/legacy/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/__test__/esResponse.ts b/x-pack/legacy/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/__test__/esResponse.ts index f9c160f4031df3..1a15be1f65dec6 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/__test__/esResponse.ts +++ b/x-pack/legacy/plugins/apm/public/components/app/ServiceDetails/ServiceIntegrations/__test__/esResponse.ts @@ -33,7 +33,6 @@ export const esResponse = { hits: [ { _index: 'apm-7.0.0-alpha1-error-2018.04.25', - _type: 'doc', _id: 'qH7C_WIBcmGuKeCHJvvT', _score: null, _source: { @@ -61,7 +60,6 @@ export const esResponse = { hits: [ { _index: 'apm-7.0.0-alpha1-error-2018.04.25', - _type: 'doc', _id: '_3_D_WIBcmGuKeCHFwOW', _score: null, _source: { @@ -93,7 +91,6 @@ export const esResponse = { hits: [ { _index: 'apm-7.0.0-alpha1-error-2018.04.25', - _type: 'doc', _id: 'dn_D_WIBcmGuKeCHQgXJ', _score: null, _source: { @@ -125,7 +122,6 @@ export const esResponse = { hits: [ { _index: 'apm-7.0.0-alpha1-error-2018.04.25', - _type: 'doc', _id: 'dX_D_WIBcmGuKeCHQgXJ', _score: null, _source: { diff --git a/x-pack/legacy/plugins/apm/server/lib/settings/agent_configuration/search.mocks.ts b/x-pack/legacy/plugins/apm/server/lib/settings/agent_configuration/search.mocks.ts index 982077e2e66655..1ed7f56e0b10d3 100644 --- a/x-pack/legacy/plugins/apm/server/lib/settings/agent_configuration/search.mocks.ts +++ b/x-pack/legacy/plugins/apm/server/lib/settings/agent_configuration/search.mocks.ts @@ -22,7 +22,6 @@ export const searchMocks = { hits: [ { _index: '.apm-agent-configuration', - _type: '_doc', _id: '-aQHsm0BxZLczArvNQYW', _score: 0.9808292, _source: { @@ -39,7 +38,6 @@ export const searchMocks = { }, { _index: '.apm-agent-configuration', - _type: '_doc', _id: '-KQHsm0BxZLczArvNAb0', _score: 0.18232156, _source: { @@ -56,7 +54,6 @@ export const searchMocks = { }, { _index: '.apm-agent-configuration', - _type: '_doc', _id: '96QHsm0BxZLczArvNAbD', _score: 0.0, _source: { diff --git a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/mock-responses/mlBucketSpanResponse.ts b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/mock-responses/mlBucketSpanResponse.ts index a4e54d240f2047..4c329fa9d1035f 100644 --- a/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/mock-responses/mlBucketSpanResponse.ts +++ b/x-pack/legacy/plugins/apm/server/lib/transactions/charts/get_anomaly_data/mock-responses/mlBucketSpanResponse.ts @@ -19,7 +19,6 @@ export const mlBucketSpanResponse = { hits: [ { _index: '.ml-anomalies-shared', - _type: 'doc', _id: 'opbeans-go-request-high_mean_response_time_model_plot_1542636000000_900_0_29791_0', _score: 1.0, diff --git a/x-pack/legacy/plugins/console_extensions/spec/generated/ccr.forget_follower.json b/x-pack/legacy/plugins/console_extensions/spec/generated/ccr.forget_follower.json index f2aabe9ef4257e..aa9a42c54dff43 100644 --- a/x-pack/legacy/plugins/console_extensions/spec/generated/ccr.forget_follower.json +++ b/x-pack/legacy/plugins/console_extensions/spec/generated/ccr.forget_follower.json @@ -6,6 +6,6 @@ "patterns": [ "{indices}/_ccr/forget_follower" ], - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-forget-follower.html" + "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/current" } } diff --git a/x-pack/legacy/plugins/console_extensions/spec/generated/graph.explore.json b/x-pack/legacy/plugins/console_extensions/spec/generated/graph.explore.json index d886f663fd42c2..d4a81c03255f92 100644 --- a/x-pack/legacy/plugins/console_extensions/spec/generated/graph.explore.json +++ b/x-pack/legacy/plugins/console_extensions/spec/generated/graph.explore.json @@ -9,8 +9,7 @@ "POST" ], "patterns": [ - "{indices}/_graph/explore", - "{indices}/{type}/_graph/explore" + "{indices}/_graph/explore" ], "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html" } diff --git a/x-pack/legacy/plugins/console_extensions/spec/generated/security.delete_privileges.json b/x-pack/legacy/plugins/console_extensions/spec/generated/security.delete_privileges.json index a7b56aa904bb22..b44798013fe592 100644 --- a/x-pack/legacy/plugins/console_extensions/spec/generated/security.delete_privileges.json +++ b/x-pack/legacy/plugins/console_extensions/spec/generated/security.delete_privileges.json @@ -13,6 +13,6 @@ "patterns": [ "_security/privilege/{application}/{name}" ], - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html" + "documentation": "TODO" } } diff --git a/x-pack/legacy/plugins/console_extensions/spec/generated/security.put_privileges.json b/x-pack/legacy/plugins/console_extensions/spec/generated/security.put_privileges.json index 4dbe88c526f0e6..7ecffc780c0662 100644 --- a/x-pack/legacy/plugins/console_extensions/spec/generated/security.put_privileges.json +++ b/x-pack/legacy/plugins/console_extensions/spec/generated/security.put_privileges.json @@ -14,6 +14,6 @@ "patterns": [ "_security/privilege/" ], - "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html" + "documentation": "TODO" } } diff --git a/x-pack/legacy/plugins/console_extensions/spec/overrides/security.delete_privileges.json b/x-pack/legacy/plugins/console_extensions/spec/overrides/security.delete_privileges.json new file mode 100644 index 00000000000000..35fb78c532c12b --- /dev/null +++ b/x-pack/legacy/plugins/console_extensions/spec/overrides/security.delete_privileges.json @@ -0,0 +1,3 @@ +{ + "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html" +} diff --git a/x-pack/legacy/plugins/console_extensions/spec/overrides/security.put_privileges.json b/x-pack/legacy/plugins/console_extensions/spec/overrides/security.put_privileges.json new file mode 100644 index 00000000000000..ae37d9a889543d --- /dev/null +++ b/x-pack/legacy/plugins/console_extensions/spec/overrides/security.put_privileges.json @@ -0,0 +1,3 @@ +{ + "documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html" +} diff --git a/x-pack/legacy/plugins/grokdebugger/server/models/grokdebugger_request/grokdebugger_request.js b/x-pack/legacy/plugins/grokdebugger/server/models/grokdebugger_request/grokdebugger_request.js index 5a86ae56da37b6..35c7825dddfc24 100644 --- a/x-pack/legacy/plugins/grokdebugger/server/models/grokdebugger_request/grokdebugger_request.js +++ b/x-pack/legacy/plugins/grokdebugger/server/models/grokdebugger_request/grokdebugger_request.js @@ -35,7 +35,6 @@ export class GrokdebuggerRequest { docs: [ { _index: 'grokdebugger', - _type: 'grokdebugger', _id: 'grokdebugger', _source: { rawEvent: this.rawEvent.toString() diff --git a/x-pack/legacy/plugins/grokdebugger/server/models/grokdebugger_response/__tests__/grokdebugger_response.js b/x-pack/legacy/plugins/grokdebugger/server/models/grokdebugger_response/__tests__/grokdebugger_response.js index b4e7eb0814bf18..c131ea7e1fd549 100644 --- a/x-pack/legacy/plugins/grokdebugger/server/models/grokdebugger_response/__tests__/grokdebugger_response.js +++ b/x-pack/legacy/plugins/grokdebugger/server/models/grokdebugger_response/__tests__/grokdebugger_response.js @@ -19,7 +19,6 @@ describe('grokdebugger_response', () => { { doc: { _index: 'grokdebugger', - _type: 'grokdebugger', _id: 'grokdebugger', _source: { 'request': '/index.html', diff --git a/x-pack/legacy/plugins/license_management/__jest__/__snapshots__/telemetry_opt_in.test.js.snap b/x-pack/legacy/plugins/license_management/__jest__/__snapshots__/telemetry_opt_in.test.js.snap index 642b8399ff6d18..f82e8b03527c04 100644 --- a/x-pack/legacy/plugins/license_management/__jest__/__snapshots__/telemetry_opt_in.test.js.snap +++ b/x-pack/legacy/plugins/license_management/__jest__/__snapshots__/telemetry_opt_in.test.js.snap @@ -104,7 +104,261 @@ exports[`TelemetryOptIn should display when telemetry not opted in 1`] = ` "timeZone": null, } } -/> +> + +
+ + +

+ + Help Elastic support provide better service + +

+
+ +
+ + + + + + } + className="eui-AlignBaseline" + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="readMorePopover" + isOpen={false} + ownFocus={true} + panelPaddingSize="m" + > + +

+ + + , + "telemetryPrivacyStatementLink": + + , + } + } + /> +

+
+ , + } + } + /> + + } + onChange={[Function]} + > +
+ +
+ +
+ + `; exports[`TelemetryOptIn should not display when telemetry is opted in 1`] = ` @@ -213,3 +467,110 @@ exports[`TelemetryOptIn should not display when telemetry is opted in 1`] = ` } /> `; + +exports[`TelemetryOptIn shouldn't display when telemetry optIn status can't change 1`] = ` + +`; diff --git a/x-pack/legacy/plugins/license_management/__jest__/telemetry_opt_in.test.js b/x-pack/legacy/plugins/license_management/__jest__/telemetry_opt_in.test.js index 4e94657e03deeb..a92ca384e8a371 100644 --- a/x-pack/legacy/plugins/license_management/__jest__/telemetry_opt_in.test.js +++ b/x-pack/legacy/plugins/license_management/__jest__/telemetry_opt_in.test.js @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import React from 'react'; +import { setTelemetryEnabled, setTelemetryOptInService } from '../public/lib/telemetry'; import { TelemetryOptIn } from '../public/components/telemetry_opt_in'; import { mountWithIntl } from '../../../../test_utils/enzyme_helpers'; @@ -11,16 +12,30 @@ jest.mock('ui/capabilities', () => ({ get: jest.fn(), })); +setTelemetryEnabled(true); + describe('TelemetryOptIn', () => { test('should display when telemetry not opted in', () => { - const telemetry = require('../public/lib/telemetry'); - telemetry.showTelemetryOptIn = () => { return true; }; + setTelemetryOptInService({ + getOptIn: () => false, + canChangeOptInStatus: () => true, + }); const rendered = mountWithIntl(); expect(rendered).toMatchSnapshot(); }); test('should not display when telemetry is opted in', () => { - const telemetry = require('../public/lib/telemetry'); - telemetry.showTelemetryOptIn = () => { return false; }; + setTelemetryOptInService({ + getOptIn: () => true, + canChangeOptInStatus: () => true, + }); + const rendered = mountWithIntl(); + expect(rendered).toMatchSnapshot(); + }); + test(`shouldn't display when telemetry optIn status can't change`, () => { + setTelemetryOptInService({ + getOptIn: () => false, + canChangeOptInStatus: () => false, + }); const rendered = mountWithIntl(); expect(rendered).toMatchSnapshot(); }); diff --git a/x-pack/legacy/plugins/license_management/public/lib/telemetry.js b/x-pack/legacy/plugins/license_management/public/lib/telemetry.js index bf8bed05aabed3..61d0322227d8ef 100644 --- a/x-pack/legacy/plugins/license_management/public/lib/telemetry.js +++ b/x-pack/legacy/plugins/license_management/public/lib/telemetry.js @@ -25,7 +25,7 @@ export const optInToTelemetry = async (enableTelemetry) => { await telemetryOptInService.setOptIn(enableTelemetry); }; export const shouldShowTelemetryOptIn = () => { - return telemetryEnabled && !telemetryOptInService.getOptIn(); + return telemetryEnabled && !telemetryOptInService.getOptIn() && telemetryOptInService.canChangeOptInStatus(); }; export const getTelemetryFetcher = () => { return fetchTelemetry(httpClient, { unencrypted: true }); diff --git a/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/bottom_bar/bottom_bar.js b/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/bottom_bar/bottom_bar.js deleted file mode 100644 index 75736d44219cad..00000000000000 --- a/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/bottom_bar/bottom_bar.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - - -import { FormattedMessage } from '@kbn/i18n/react'; -import React from 'react'; - -import { - EuiButton, - EuiButtonEmpty, - EuiFlexGroup, - EuiFlexItem, - EuiBottomBar, -} from '@elastic/eui'; - -import { MODE as DATAVISUALIZER_MODE } from '../file_datavisualizer_view'; - -export function BottomBar({ showBar, mode, changeMode, onCancel, disableImport }) { - if (showBar) { - if (mode === DATAVISUALIZER_MODE.READ) { - return ( - - - - changeMode(DATAVISUALIZER_MODE.IMPORT)} - > - - - - - onCancel()} - > - - - - - - - ); - } else { - return ( - - - - changeMode(DATAVISUALIZER_MODE.READ)} - > - - - - - onCancel()} - > - - - - - - ); - } - } - return null; -} diff --git a/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/bottom_bar/bottom_bar.tsx b/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/bottom_bar/bottom_bar.tsx new file mode 100644 index 00000000000000..72e4f88062789f --- /dev/null +++ b/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/bottom_bar/bottom_bar.tsx @@ -0,0 +1,94 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React, { FC } from 'react'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { + EuiBottomBar, + EuiButton, + EuiButtonEmpty, + EuiFlexGroup, + EuiFlexItem, + EuiToolTip, +} from '@elastic/eui'; + +import { MODE as DATAVISUALIZER_MODE } from '../file_datavisualizer_view/constants'; + +interface BottomBarProps { + mode: DATAVISUALIZER_MODE; + onChangeMode: (mode: DATAVISUALIZER_MODE) => void; + onCancel: () => void; + disableImport?: boolean; +} + +/** + * Bottom bar component for Data Visualizer page. + */ +export const BottomBar: FC = ({ mode, onChangeMode, onCancel, disableImport }) => { + if (mode === DATAVISUALIZER_MODE.READ) { + return ( + + + + + ) : null + } + > + onChangeMode(DATAVISUALIZER_MODE.IMPORT)} + > + + + + + + onCancel()}> + + + + + + ); + } else { + return ( + + + + onChangeMode(DATAVISUALIZER_MODE.READ)}> + + + + + onCancel()}> + + + + + + ); + } +}; diff --git a/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/bottom_bar/index.js b/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/bottom_bar/index.ts similarity index 99% rename from x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/bottom_bar/index.js rename to x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/bottom_bar/index.ts index 236a5aa577f28d..24202d7c746b8b 100644 --- a/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/bottom_bar/index.js +++ b/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/bottom_bar/index.ts @@ -4,5 +4,4 @@ * you may not use this file except in compliance with the Elastic License. */ - export { BottomBar } from './bottom_bar'; diff --git a/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/file_datavisualizer_view/constants.ts b/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/file_datavisualizer_view/constants.ts new file mode 100644 index 00000000000000..7c463d58c607c1 --- /dev/null +++ b/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/file_datavisualizer_view/constants.ts @@ -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; + * you may not use this file except in compliance with the Elastic License. + */ + +/** + * File data visualizer modes. + */ +export enum MODE { + READ, + IMPORT, +} diff --git a/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/file_datavisualizer_view/file_datavisualizer_view.js b/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/file_datavisualizer_view/file_datavisualizer_view.js index fee0c423f023d7..94e9c2c2ac5846 100644 --- a/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/file_datavisualizer_view/file_datavisualizer_view.js +++ b/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/file_datavisualizer_view/file_datavisualizer_view.js @@ -31,11 +31,7 @@ import { reduceData, hasImportPermission, } from '../utils'; - -export const MODE = { - READ: 0, - IMPORT: 1, -}; +import { MODE } from './constants'; const UPLOAD_SIZE_MB = 5; @@ -306,13 +302,12 @@ export class FileDataVisualizerView extends Component { fields={fields} /> - + />} @@ -329,12 +324,11 @@ export class FileDataVisualizerView extends Component { hideBottomBar={this.hideBottomBar} /> - + />} diff --git a/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/file_datavisualizer_view/index.js b/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/file_datavisualizer_view/index.js index 5721b35045434c..cc9714d2b4c458 100644 --- a/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/file_datavisualizer_view/index.js +++ b/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/file_datavisualizer_view/index.js @@ -5,4 +5,4 @@ */ -export { FileDataVisualizerView, MODE } from './file_datavisualizer_view'; +export { FileDataVisualizerView } from './file_datavisualizer_view'; diff --git a/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/utils/utils.js b/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/utils/utils.js index f9148da5ed8262..2707e3f5510dbb 100644 --- a/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/utils/utils.js +++ b/x-pack/legacy/plugins/ml/public/datavisualizer/file_based/components/utils/utils.js @@ -116,8 +116,12 @@ export function processResults(results) { }; } -// a check for the minimum privileges needed to create and ingest data into an index. -// if called with no indexName, the check will just look for the minimum cluster privileges. +/** + * A check for the minimum privileges needed to create and ingest data into an index. + * If called with no indexName, the check will just look for the minimum cluster privileges. + * @param {string} indexName + * @returns {Promise} + */ export async function hasImportPermission(indexName) { const priv = { cluster: [ diff --git a/x-pack/legacy/plugins/reporting/public/components/report_listing.test.tsx b/x-pack/legacy/plugins/reporting/public/components/report_listing.test.tsx index 87360efe04e8bf..d78eb5c409c1f6 100644 --- a/x-pack/legacy/plugins/reporting/public/components/report_listing.test.tsx +++ b/x-pack/legacy/plugins/reporting/public/components/report_listing.test.tsx @@ -39,15 +39,15 @@ jest.mock('ui/kfetch', () => ({ if (pathname === '/api/reporting/jobs/list') { return Promise.resolve([ { _index: '.reporting-2019.08.18', _id: 'jzoik8dh1q2i89fb5f19znm6', _source: { payload: { layout: { id: 'preserve_layout', dimensions: { width: 1635, height: 792 } }, type: 'dashboard', title: 'Names', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:24.869Z', jobtype: 'printable_pdf', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore - { _index: '.reporting-2019.08.18', _type: '_doc', _id: 'jzoik7tn1q2i89fb5f60e5ve', _score: null, _source: { payload: { layout: { id: 'preserve_layout', dimensions: { width: 1635, height: 792 } }, type: 'dashboard', title: 'Names', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:24.155Z', jobtype: 'printable_pdf', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore - { _index: '.reporting-2019.08.18', _type: '_doc', _id: 'jzoik5tb1q2i89fb5fckchny', _score: null, _source: { payload: { layout: { id: 'png', dimensions: { width: 1898, height: 876 } }, title: 'cool dashboard', type: 'dashboard', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:21.551Z', jobtype: 'PNG', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore - { _index: '.reporting-2019.08.18', _type: '_doc', _id: 'jzoik5a11q2i89fb5f130t2m', _score: null, _source: { payload: { layout: { id: 'png', dimensions: { width: 1898, height: 876 } }, title: 'cool dashboard', type: 'dashboard', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:20.857Z', jobtype: 'PNG', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore - { _index: '.reporting-2019.08.18', _type: '_doc', _id: 'jzoik3ka1q2i89fb5fdx93g7', _score: null, _source: { payload: { layout: { id: 'preserve_layout', dimensions: { width: 1898, height: 876 } }, type: 'dashboard', title: 'cool dashboard', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:18.634Z', jobtype: 'printable_pdf', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore - { _index: '.reporting-2019.08.18', _type: '_doc', _id: 'jzoik2vt1q2i89fb5ffw723n', _score: null, _source: { payload: { layout: { id: 'preserve_layout', dimensions: { width: 1898, height: 876 } }, type: 'dashboard', title: 'cool dashboard', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:17.753Z', jobtype: 'printable_pdf', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore - { _index: '.reporting-2019.08.18', _type: '_doc', _id: 'jzoik1851q2i89fb5fdge6e7', _score: null, _source: { payload: { layout: { id: 'preserve_layout', dimensions: { width: 1080, height: 720 } }, type: 'canvas workpad', title: 'My Canvas Workpad - Dark', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:15.605Z', jobtype: 'printable_pdf', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore - { _index: '.reporting-2019.08.18', _type: '_doc', _id: 'jzoijyre1q2i89fb5fa7xzvi', _score: null, _source: { payload: { type: 'dashboard', title: 'tests-panels', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:12.410Z', jobtype: 'printable_pdf', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore - { _index: '.reporting-2019.08.18', _type: '_doc', _id: 'jzoijv5h1q2i89fb5ffklnhx', _score: null, _source: { payload: { type: 'dashboard', title: 'tests-panels', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:07.733Z', jobtype: 'printable_pdf', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore - { _index: '.reporting-2019.08.18', _type: '_doc', _id: 'jznhgk7r1bx789fb5f6hxok7', _score: null, _source: { kibana_name: 'spicy.local', browser_type: 'chromium', created_at: '2019-08-23T02:15:47.799Z', jobtype: 'printable_pdf', created_by: 'elastic', kibana_id: 'ca75e26c-2b7d-464f-aef0-babb67c735a0', output: { content_type: 'application/pdf', size: 877114 }, completed_at: '2019-08-23T02:15:57.707Z', payload: { type: 'dashboard (legacy)', title: 'tests-panels', }, max_attempts: 3, started_at: '2019-08-23T02:15:48.794Z', attempts: 1, status: 'completed', }, }, // prettier-ignore + { _index: '.reporting-2019.08.18', _id: 'jzoik7tn1q2i89fb5f60e5ve', _score: null, _source: { payload: { layout: { id: 'preserve_layout', dimensions: { width: 1635, height: 792 } }, type: 'dashboard', title: 'Names', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:24.155Z', jobtype: 'printable_pdf', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore + { _index: '.reporting-2019.08.18', _id: 'jzoik5tb1q2i89fb5fckchny', _score: null, _source: { payload: { layout: { id: 'png', dimensions: { width: 1898, height: 876 } }, title: 'cool dashboard', type: 'dashboard', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:21.551Z', jobtype: 'PNG', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore + { _index: '.reporting-2019.08.18', _id: 'jzoik5a11q2i89fb5f130t2m', _score: null, _source: { payload: { layout: { id: 'png', dimensions: { width: 1898, height: 876 } }, title: 'cool dashboard', type: 'dashboard', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:20.857Z', jobtype: 'PNG', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore + { _index: '.reporting-2019.08.18', _id: 'jzoik3ka1q2i89fb5fdx93g7', _score: null, _source: { payload: { layout: { id: 'preserve_layout', dimensions: { width: 1898, height: 876 } }, type: 'dashboard', title: 'cool dashboard', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:18.634Z', jobtype: 'printable_pdf', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore + { _index: '.reporting-2019.08.18', _id: 'jzoik2vt1q2i89fb5ffw723n', _score: null, _source: { payload: { layout: { id: 'preserve_layout', dimensions: { width: 1898, height: 876 } }, type: 'dashboard', title: 'cool dashboard', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:17.753Z', jobtype: 'printable_pdf', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore + { _index: '.reporting-2019.08.18', _id: 'jzoik1851q2i89fb5fdge6e7', _score: null, _source: { payload: { layout: { id: 'preserve_layout', dimensions: { width: 1080, height: 720 } }, type: 'canvas workpad', title: 'My Canvas Workpad - Dark', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:15.605Z', jobtype: 'printable_pdf', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore + { _index: '.reporting-2019.08.18', _id: 'jzoijyre1q2i89fb5fa7xzvi', _score: null, _source: { payload: { type: 'dashboard', title: 'tests-panels', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:12.410Z', jobtype: 'printable_pdf', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore + { _index: '.reporting-2019.08.18', _id: 'jzoijv5h1q2i89fb5ffklnhx', _score: null, _source: { payload: { type: 'dashboard', title: 'tests-panels', }, max_attempts: 3, browser_type: 'chromium', created_at: '2019-08-23T19:34:07.733Z', jobtype: 'printable_pdf', created_by: 'elastic', attempts: 0, status: 'pending', }, }, // prettier-ignore + { _index: '.reporting-2019.08.18', _id: 'jznhgk7r1bx789fb5f6hxok7', _score: null, _source: { kibana_name: 'spicy.local', browser_type: 'chromium', created_at: '2019-08-23T02:15:47.799Z', jobtype: 'printable_pdf', created_by: 'elastic', kibana_id: 'ca75e26c-2b7d-464f-aef0-babb67c735a0', output: { content_type: 'application/pdf', size: 877114 }, completed_at: '2019-08-23T02:15:57.707Z', payload: { type: 'dashboard (legacy)', title: 'tests-panels', }, max_attempts: 3, started_at: '2019-08-23T02:15:48.794Z', attempts: 1, status: 'completed', }, }, // prettier-ignore ]); } diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/worker.js b/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/worker.js index 9f638670a6b599..84549d0680ff36 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/worker.js +++ b/x-pack/legacy/plugins/reporting/server/lib/esqueue/__tests__/worker.js @@ -1072,7 +1072,6 @@ describe('Get Doc Path from ES Response', () => { it('returns a formatted string after response of an update', function () { const responseMock = { _index: 'foo', - _type: '_doc', _id: 'booId', }; expect(getUpdatedDocPath(responseMock)).equal('/foo/_doc/booId'); diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/worker.js b/x-pack/legacy/plugins/reporting/server/lib/esqueue/worker.js index 61af0437575e9c..fe2e578f83cc5e 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/esqueue/worker.js +++ b/x-pack/legacy/plugins/reporting/server/lib/esqueue/worker.js @@ -22,8 +22,8 @@ export function formatJobObject(job) { } export function getUpdatedDocPath(response) { - const { _index: ind, _type: type = '_doc', _id: id } = response; - return `/${ind}/${type}/${id}`; + const { _index: ind, _id: id } = response; + return `/${ind}/${id}`; } const MAX_PARTIAL_ERROR_LENGTH = 1000; // 1000 of beginning, 1000 of end diff --git a/x-pack/legacy/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts b/x-pack/legacy/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts index eea3ec6bb79d8b..1216a8d2c4c24e 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts +++ b/x-pack/legacy/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts @@ -915,7 +915,6 @@ describe('reindexService', () => { expect(updatedOp.attributes.reindexTaskPercComplete).toEqual(1); expect(callCluster).toHaveBeenCalledWith('delete', { index: '.tasks', - type: 'task', id: 'xyz', }); }); @@ -950,7 +949,6 @@ describe('reindexService', () => { expect(updatedOp.attributes.status).toEqual(ReindexStatus.cancelled); expect(callCluster).toHaveBeenCalledWith('delete', { index: '.tasks', - type: 'task', id: 'xyz', }); }); diff --git a/x-pack/legacy/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts b/x-pack/legacy/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts index 21f45c401e2d46..6fe4d72db3f16b 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts +++ b/x-pack/legacy/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts @@ -376,7 +376,6 @@ export const reindexServiceFactory = ( // Delete the task from ES .tasks index const deleteTaskResp = await callCluster('delete', { index: '.tasks', - type: 'task', id: taskId, }); diff --git a/x-pack/legacy/plugins/uptime/common/constants/plugin.ts b/x-pack/legacy/plugins/uptime/common/constants/plugin.ts index eeb0683fc9bbb8..93c3f00a0a45c1 100644 --- a/x-pack/legacy/plugins/uptime/common/constants/plugin.ts +++ b/x-pack/legacy/plugins/uptime/common/constants/plugin.ts @@ -7,6 +7,6 @@ export const PLUGIN = { APP_ROOT_ID: 'react-uptime-root', ID: 'uptime', - ROUTER_BASE_NAME: '/app/uptime', + ROUTER_BASE_NAME: '/app/uptime#', LOCAL_STORAGE_KEY: 'xpack.uptime', }; diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 057ae6e2ce9946..f5727b48343676 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -581,8 +581,6 @@ "core.ui.overlays.banner.closeButtonLabel": "閉じる", "core.ui.chrome.headerGlobalNav.goHomePageIconAriaLabel": "ホームページに移動", "core.ui.chrome.headerGlobalNav.helpMenuButtonAriaLabel": "ヘルプメニュー", - "core.ui.chrome.headerGlobalNav.helpMenuGoToDocumentation": "ドキュメントに移動", - "core.ui.chrome.headerGlobalNav.helpMenuHelpDescription": "不明な点、アップデートなどの情報はドキュメントをご覧ください。", "core.ui.chrome.headerGlobalNav.helpMenuTitle": "ヘルプ", "core.ui.chrome.headerGlobalNav.helpMenuVersion": "v {version}", "core.ui.chrome.sideGlobalNav.viewRecentItemsFlyoutTitle": "最近のアイテム", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 8a0e3d78139b18..04f00d945b67c9 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -582,8 +582,6 @@ "core.ui.overlays.banner.closeButtonLabel": "关闭", "core.ui.chrome.headerGlobalNav.goHomePageIconAriaLabel": "前往主页", "core.ui.chrome.headerGlobalNav.helpMenuButtonAriaLabel": "帮助菜单", - "core.ui.chrome.headerGlobalNav.helpMenuGoToDocumentation": "前往文档", - "core.ui.chrome.headerGlobalNav.helpMenuHelpDescription": "在我们的文档中获取更新、信息以及答案。", "core.ui.chrome.headerGlobalNav.helpMenuTitle": "帮助", "core.ui.chrome.headerGlobalNav.helpMenuVersion": "v {version}", "core.ui.chrome.sideGlobalNav.viewRecentItemsFlyoutTitle": "最近项", diff --git a/x-pack/test/api_integration/apis/infra/log_entry_highlights.ts b/x-pack/test/api_integration/apis/infra/log_entry_highlights.ts index 53ece86b924835..88d7d8716d0f54 100644 --- a/x-pack/test/api_integration/apis/infra/log_entry_highlights.ts +++ b/x-pack/test/api_integration/apis/infra/log_entry_highlights.ts @@ -88,7 +88,8 @@ export default function({ getService }: FtrProviderContext) { } }); - it('should return log highlights in a field column', async () => { + // https://github.com/elastic/kibana/issues/49959 + it.skip('should return log highlights in a field column', async () => { const { data: { source: { logEntryHighlights }, diff --git a/x-pack/test/api_integration/apis/lens/telemetry.ts b/x-pack/test/api_integration/apis/lens/telemetry.ts index 5bba8848fe1d9c..6428ef9f478d4a 100644 --- a/x-pack/test/api_integration/apis/lens/telemetry.ts +++ b/x-pack/test/api_integration/apis/lens/telemetry.ts @@ -95,9 +95,10 @@ export default ({ getService }: FtrProviderContext) => { const olderDate = moment() .subtract(100, 'days') .valueOf(); + + // @ts-ignore optional type: string await es.index({ index: '.kibana', - type: '_doc', body: { type: 'lens-ui-telemetry', 'lens-ui-telemetry': { diff --git a/x-pack/test/api_integration/apis/management/index_management/settings.js b/x-pack/test/api_integration/apis/management/index_management/settings.js index 7d9e1732f19d65..bed71c0a621669 100644 --- a/x-pack/test/api_integration/apis/management/index_management/settings.js +++ b/x-pack/test/api_integration/apis/management/index_management/settings.js @@ -57,7 +57,6 @@ export default function ({ getService }) { 'priority', 'codec', 'max_rescore_window', - 'max_adjacency_matrix_filters', 'analyze', 'gc_deletes', 'max_ngram_diff', diff --git a/x-pack/test/api_integration/apis/siem/timeline_details.ts b/x-pack/test/api_integration/apis/siem/timeline_details.ts index b702adfc1d35eb..5d1e645bcf80be 100644 --- a/x-pack/test/api_integration/apis/siem/timeline_details.ts +++ b/x-pack/test/api_integration/apis/siem/timeline_details.ts @@ -289,7 +289,6 @@ const EXPECTED_DATA: DetailItem[] = [ values: ['filebeat-7.0.0-iot-2019.06'], originalValue: 'filebeat-7.0.0-iot-2019.06', }, - { field: '_type', values: ['_doc'], originalValue: '_doc' }, { field: '_id', values: ['QRhG1WgBqd-n62SwZYDT'], diff --git a/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js b/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js index 90d4da02e3ed7b..4aa8e1767818c4 100644 --- a/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js +++ b/x-pack/test/functional/apps/maps/documents_source/docvalue_fields.js @@ -31,7 +31,7 @@ export default function ({ getPageObjects, getService }) { await PageObjects.maps.loadSavedMap('document example'); const response = await getResponse(); const firstHit = response.hits.hits[0]; - expect(Object.keys(firstHit).join(',')).to.equal('_index,_type,_id,_score,fields'); + expect(Object.keys(firstHit).join(',')).to.equal('_index,_id,_score,fields'); expect(Object.keys(firstHit.fields).join(',')).to.equal('geo.coordinates'); }); @@ -39,7 +39,7 @@ export default function ({ getPageObjects, getService }) { await PageObjects.maps.loadSavedMap('document example with data driven styles'); const response = await getResponse(); const firstHit = response.hits.hits[0]; - expect(Object.keys(firstHit).join(',')).to.equal('_index,_type,_id,_score,fields'); + expect(Object.keys(firstHit).join(',')).to.equal('_index,_id,_score,fields'); expect(Object.keys(firstHit.fields).join(',')).to.equal('geo.coordinates,bytes,hour_of_day'); }); @@ -47,7 +47,7 @@ export default function ({ getPageObjects, getService }) { await PageObjects.maps.loadSavedMap('document example with data driven styles on date field'); const response = await getResponse(); const firstHit = response.hits.hits[0]; - expect(Object.keys(firstHit).join(',')).to.equal('_index,_type,_id,_score,fields'); + expect(Object.keys(firstHit).join(',')).to.equal('_index,_id,_score,fields'); expect(Object.keys(firstHit.fields).join(',')).to.equal('geo.coordinates,bytes,@timestamp'); expect(firstHit.fields['@timestamp']).to.be.an('array'); expect(firstHit.fields['@timestamp'][0]).to.equal('1442709321445'); diff --git a/x-pack/test/functional/apps/security/doc_level_security_roles.js b/x-pack/test/functional/apps/security/doc_level_security_roles.js index 0766a1e2b15f1d..9dac150b9a0e6b 100644 --- a/x-pack/test/functional/apps/security/doc_level_security_roles.js +++ b/x-pack/test/functional/apps/security/doc_level_security_roles.js @@ -74,7 +74,7 @@ export default function ({ getService, getPageObjects }) { expect(hitCount).to.be('1'); }); const rowData = await PageObjects.discover.getDocTableIndex(1); - expect(rowData).to.be('name:ABC Company region:EAST _id:doc1 _type:_doc _index:dlstest _score:0'); + expect(rowData).to.be('name:ABC Company region:EAST _id:doc1 _type: - _index:dlstest _score:0'); }); after('logout', async () => { await PageObjects.security.logout(); diff --git a/x-pack/test/functional/apps/security/field_level_security.js b/x-pack/test/functional/apps/security/field_level_security.js index 640289fd119b6f..2939805d708598 100644 --- a/x-pack/test/functional/apps/security/field_level_security.js +++ b/x-pack/test/functional/apps/security/field_level_security.js @@ -98,7 +98,7 @@ export default function ({ getService, getPageObjects }) { }); const rowData = await PageObjects.discover.getDocTableIndex(1); expect(rowData).to - .be('customer_ssn:444.555.6666 customer_name:ABC Company customer_region:WEST _id:2 _type:_doc _index:flstest _score:0'); + .be('customer_ssn:444.555.6666 customer_name:ABC Company customer_region:WEST _id:2 _type: - _index:flstest _score:0'); }); it('user customer2 should not see ssn', async function () { @@ -110,7 +110,7 @@ export default function ({ getService, getPageObjects }) { expect(hitCount).to.be('2'); }); const rowData = await PageObjects.discover.getDocTableIndex(1); - expect(rowData).to.be('customer_name:ABC Company customer_region:WEST _id:2 _type:_doc _index:flstest _score:0'); + expect(rowData).to.be('customer_name:ABC Company customer_region:WEST _id:2 _type: - _index:flstest _score:0'); }); after(async function () { diff --git a/x-pack/test/plugin_api_integration/test_suites/encrypted_saved_objects/encrypted_saved_objects_api.ts b/x-pack/test/plugin_api_integration/test_suites/encrypted_saved_objects/encrypted_saved_objects_api.ts index 7be9816f40de3f..1c7be6def614d1 100644 --- a/x-pack/test/plugin_api_integration/test_suites/encrypted_saved_objects/encrypted_saved_objects_api.ts +++ b/x-pack/test/plugin_api_integration/test_suites/encrypted_saved_objects/encrypted_saved_objects_api.ts @@ -21,7 +21,6 @@ export default function({ getService }: FtrProviderContext) { _source: { [SAVED_OBJECT_WITH_SECRET_TYPE]: savedObject }, } = await es.get({ id: generateRawID(id), - type: '_doc', index: '.kibana', }); diff --git a/x-pack/test/saved_object_api_integration/common/suites/bulk_create.ts b/x-pack/test/saved_object_api_integration/common/suites/bulk_create.ts index e2ec45151418d8..d719543fa3807a 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/bulk_create.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/bulk_create.ts @@ -119,7 +119,6 @@ export function bulkCreateTestSuiteFactory(es: any, esArchiver: any, supertest: // query ES directory to ensure namespace was or wasn't specified const { _source } = await es.get({ id: `${expectedSpacePrefix}${savedObject.type}:${savedObject.id}`, - type: '_doc', index: '.kibana', }); diff --git a/x-pack/test/saved_object_api_integration/common/suites/create.ts b/x-pack/test/saved_object_api_integration/common/suites/create.ts index a6af4b7ad24693..3ee0548b707bc4 100644 --- a/x-pack/test/saved_object_api_integration/common/suites/create.ts +++ b/x-pack/test/saved_object_api_integration/common/suites/create.ts @@ -82,7 +82,6 @@ export function createTestSuiteFactory(es: any, esArchiver: any, supertest: Supe // query ES directory to ensure namespace was or wasn't specified const { _source } = await es.get({ id: `${expectedSpacePrefix}${spaceAwareType}:${resp.body.id}`, - type: '_doc', index: '.kibana', }); @@ -121,7 +120,6 @@ export function createTestSuiteFactory(es: any, esArchiver: any, supertest: Supe // query ES directory to ensure namespace wasn't specified const { _source } = await es.get({ id: `${notSpaceAwareType}:${resp.body.id}`, - type: '_doc', index: '.kibana', });