diff --git a/.github/paths-labeller.yml b/.github/paths-labeller.yml index d9d99fc1416e4..039b520561d65 100644 --- a/.github/paths-labeller.yml +++ b/.github/paths-labeller.yml @@ -10,6 +10,9 @@ - "src/plugins/bfetch/**/*.*" - "Team:apm": - "x-pack/plugins/apm/**/*.*" - - "x-pack/plugins/apm/**/*.*" + - "Team:Ingest Management": + - "x-pack/plugins/ingest_manager/**/*.*" + - "x-pack/test/api_integration/apis/fleet/**/*.*" + - "x-pack/test/epm_api_integration/**/*.*" - "Team:uptime": - "x-pack/plugins/uptime/**/*.*" diff --git a/examples/alerting_example/kibana.json b/examples/alerting_example/kibana.json index bcdb7c2f14a9c..76c549adc7970 100644 --- a/examples/alerting_example/kibana.json +++ b/examples/alerting_example/kibana.json @@ -2,7 +2,6 @@ "id": "alertingExample", "version": "0.0.1", "kibanaVersion": "kibana", - "configPath": ["alerting_example"], "server": true, "ui": true, "requiredPlugins": ["triggers_actions_ui", "charts", "data", "alerting", "actions"], diff --git a/examples/bfetch_explorer/kibana.json b/examples/bfetch_explorer/kibana.json index cbdd9be0e658c..e2a6d3ebd7d47 100644 --- a/examples/bfetch_explorer/kibana.json +++ b/examples/bfetch_explorer/kibana.json @@ -2,7 +2,6 @@ "id": "bfetchExplorer", "version": "0.0.1", "kibanaVersion": "kibana", - "configPath": ["bfetch_explorer"], "server": true, "ui": true, "requiredPlugins": ["bfetch"], diff --git a/examples/demo_search/kibana.json b/examples/demo_search/kibana.json index cb73274ed23f7..cdf74121ea2db 100644 --- a/examples/demo_search/kibana.json +++ b/examples/demo_search/kibana.json @@ -2,7 +2,6 @@ "id": "demoSearch", "version": "0.0.1", "kibanaVersion": "kibana", - "configPath": ["demoSearch"], "server": true, "ui": true, "requiredPlugins": ["data"], diff --git a/examples/embeddable_examples/kibana.json b/examples/embeddable_examples/kibana.json index f446e7f31ac8e..489f768552b28 100644 --- a/examples/embeddable_examples/kibana.json +++ b/examples/embeddable_examples/kibana.json @@ -2,7 +2,6 @@ "id": "embeddableExamples", "version": "0.0.1", "kibanaVersion": "kibana", - "configPath": ["embeddable_examples"], "server": true, "ui": true, "requiredPlugins": ["embeddable"], diff --git a/examples/embeddable_explorer/kibana.json b/examples/embeddable_explorer/kibana.json index 6c27bcd39f12d..3e4b074fb6b12 100644 --- a/examples/embeddable_explorer/kibana.json +++ b/examples/embeddable_explorer/kibana.json @@ -2,7 +2,6 @@ "id": "embeddableExplorer", "version": "0.0.1", "kibanaVersion": "kibana", - "configPath": ["embeddable_explorer"], "server": false, "ui": true, "requiredPlugins": ["uiActions", "inspector", "embeddable", "embeddableExamples"], diff --git a/examples/search_explorer/kibana.json b/examples/search_explorer/kibana.json index ca8c6a5b24243..a8538d6b67961 100644 --- a/examples/search_explorer/kibana.json +++ b/examples/search_explorer/kibana.json @@ -2,7 +2,6 @@ "id": "searchExplorer", "version": "0.0.1", "kibanaVersion": "kibana", - "configPath": ["search_explorer"], "server": false, "ui": true, "requiredPlugins": ["data", "demoSearch"], diff --git a/examples/state_containers_examples/kibana.json b/examples/state_containers_examples/kibana.json index 437e9a4fac63c..581b399e3ffba 100644 --- a/examples/state_containers_examples/kibana.json +++ b/examples/state_containers_examples/kibana.json @@ -2,7 +2,6 @@ "id": "stateContainersExamples", "version": "0.0.1", "kibanaVersion": "kibana", - "configPath": ["state_containers_examples"], "server": true, "ui": true, "requiredPlugins": ["navigation", "data"], diff --git a/examples/ui_action_examples/kibana.json b/examples/ui_action_examples/kibana.json index d5c3f0f2ec33a..cd12442daf61c 100644 --- a/examples/ui_action_examples/kibana.json +++ b/examples/ui_action_examples/kibana.json @@ -2,7 +2,6 @@ "id": "uiActionsExamples", "version": "0.0.1", "kibanaVersion": "kibana", - "configPath": ["ui_actions_examples"], "server": false, "ui": true, "requiredPlugins": ["uiActions"], diff --git a/examples/ui_actions_explorer/kibana.json b/examples/ui_actions_explorer/kibana.json index 126e79eb35757..e88739a9e44d6 100644 --- a/examples/ui_actions_explorer/kibana.json +++ b/examples/ui_actions_explorer/kibana.json @@ -2,7 +2,6 @@ "id": "uiActionsExplorer", "version": "0.0.1", "kibanaVersion": "kibana", - "configPath": ["ui_actions_explorer"], "server": false, "ui": true, "requiredPlugins": ["uiActions", "uiActionsExamples"], diff --git a/examples/url_generators_examples/kibana.json b/examples/url_generators_examples/kibana.json index 0767018e3bb98..cdb2127fdd26f 100644 --- a/examples/url_generators_examples/kibana.json +++ b/examples/url_generators_examples/kibana.json @@ -2,7 +2,6 @@ "id": "urlGeneratorsExamples", "version": "0.0.1", "kibanaVersion": "kibana", - "configPath": ["url_generators_examples"], "server": false, "ui": true, "requiredPlugins": ["share"], diff --git a/examples/url_generators_explorer/kibana.json b/examples/url_generators_explorer/kibana.json index 94ab75b338889..fe514859bf3d5 100644 --- a/examples/url_generators_explorer/kibana.json +++ b/examples/url_generators_explorer/kibana.json @@ -2,7 +2,6 @@ "id": "urlGeneratorsExplorer", "version": "0.0.1", "kibanaVersion": "kibana", - "configPath": ["url_generators_explorer"], "server": false, "ui": true, "requiredPlugins": ["share", "urlGeneratorsExamples"], diff --git a/src/core/server/core_app/core_app.ts b/src/core/server/core_app/core_app.ts index 009debd928d43..5e1a3794632ee 100644 --- a/src/core/server/core_app/core_app.ts +++ b/src/core/server/core_app/core_app.ts @@ -52,17 +52,6 @@ export class CoreApp { router.get({ path: '/core', validate: false }, async (context, req, res) => res.ok({ body: { version: '0.0.1' } }) ); - - coreSetup.savedObjects.registerType({ - name: 'server', - hidden: false, - namespaceType: 'single', - mappings: { - properties: { - uuid: { type: 'keyword' }, - }, - }, - }); } private registerStaticDirs(coreSetup: InternalCoreSetup) { coreSetup.http.registerStaticDir('/ui/{path*}', Path.resolve(__dirname, './assets')); diff --git a/src/dev/code_coverage/ingest_coverage/__tests__/transforms.test.js b/src/dev/code_coverage/ingest_coverage/__tests__/transforms.test.js index 23b4f83d4b8e7..c62a28a2956e1 100644 --- a/src/dev/code_coverage/ingest_coverage/__tests__/transforms.test.js +++ b/src/dev/code_coverage/ingest_coverage/__tests__/transforms.test.js @@ -18,7 +18,7 @@ */ import expect from '@kbn/expect'; -import { ciRunUrl } from '../transforms'; +import { ciRunUrl, coveredFilePath, itemizeVcs } from '../transforms'; describe(`Transform fn`, () => { describe(`ciRunUrl`, () => { @@ -31,4 +31,32 @@ describe(`Transform fn`, () => { expect(ciRunUrl({ a: 'a' })).not.to.have.property('ciRunUrl'); }); }); + describe(`coveredFilePath`, () => { + it(`should remove the jenkins workspace path`, () => { + const obj = { + staticSiteUrl: + '/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/x-pack/legacy/plugins/reporting/server/browsers/extract/unzip.js', + COVERAGE_INGESTION_KIBANA_ROOT: + '/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana', + }; + expect(coveredFilePath(obj)).to.have.property( + 'coveredFilePath', + 'x-pack/legacy/plugins/reporting/server/browsers/extract/unzip.js' + ); + }); + }); + describe(`itemizeVcs`, () => { + it(`should return a sha url`, () => { + const vcsInfo = [ + 'origin/ingest-code-coverage', + 'f07b34f6206', + `Tre' Seymour`, + `Lorem :) ipsum Tre' λ dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.`, + ]; + expect(itemizeVcs(vcsInfo)({}).vcs).to.have.property( + 'vcsUrl', + `https://github.com/elastic/kibana/commit/${vcsInfo[1]}` + ); + }); + }); }); diff --git a/src/dev/code_coverage/ingest_coverage/constants.js b/src/dev/code_coverage/ingest_coverage/constants.js index c2f831b83b83d..a7303f0778d1c 100644 --- a/src/dev/code_coverage/ingest_coverage/constants.js +++ b/src/dev/code_coverage/ingest_coverage/constants.js @@ -17,6 +17,5 @@ * under the License. */ -export const STATIC_SITE_URL_PROP_NAME = 'staticSiteUrl'; export const COVERAGE_INDEX = process.env.COVERAGE_INDEX || 'kibana_code_coverage'; export const TOTALS_INDEX = process.env.TOTALS_INDEX || `kibana_total_code_coverage`; diff --git a/src/dev/code_coverage/ingest_coverage/ingest.js b/src/dev/code_coverage/ingest_coverage/ingest.js index 52b1306c9683b..769fe250a8e18 100644 --- a/src/dev/code_coverage/ingest_coverage/ingest.js +++ b/src/dev/code_coverage/ingest_coverage/ingest.js @@ -20,7 +20,7 @@ const { Client } = require('@elastic/elasticsearch'); import { createFailError } from '@kbn/dev-utils'; import chalk from 'chalk'; -import { green, always } from './utils'; +import { green, always, pretty } from './utils'; import { fromNullable } from './either'; import { COVERAGE_INDEX, TOTALS_INDEX } from './constants'; @@ -98,6 +98,3 @@ function color(whichColor) { return chalk[whichColor].bgWhiteBright(x); }; } -function pretty(x) { - return JSON.stringify(x, null, 2); -} diff --git a/src/dev/code_coverage/ingest_coverage/integration_tests/ingest_coverage.test.js b/src/dev/code_coverage/ingest_coverage/integration_tests/ingest_coverage.test.js index 930b52f549f99..2ffb005993619 100644 --- a/src/dev/code_coverage/ingest_coverage/integration_tests/ingest_coverage.test.js +++ b/src/dev/code_coverage/ingest_coverage/integration_tests/ingest_coverage.test.js @@ -17,13 +17,10 @@ * under the License. */ -import expect from '@kbn/expect'; import { spawn } from 'child_process'; import { resolve } from 'path'; import { green, always } from '../utils'; -import { STATIC_SITE_URL_PROP_NAME, COVERAGE_INDEX } from '../constants'; - const ROOT_DIR = resolve(__dirname, '../../../../..'); const MOCKS_DIR = resolve(__dirname, './mocks'); const staticSiteUrlRegexes = { @@ -40,110 +37,43 @@ const env = { NODE_ENV: 'integration_test', COVERAGE_INGESTION_KIBANA_ROOT: '/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana', }; -const includesSiteUrlPredicate = x => x.includes(STATIC_SITE_URL_PROP_NAME); +const includesSiteUrlPredicate = x => x.includes('staticSiteUrl'); const siteUrlLines = specificLinesOnly(includesSiteUrlPredicate); const splitByNewLine = x => x.split('\n'); const siteUrlsSplitByNewLine = siteUrlLines(splitByNewLine); const siteUrlsSplitByNewLineWithoutBlanks = siteUrlsSplitByNewLine(notBlankLines); - -describe('Ingesting Coverage to Cluster', () => { - const verboseArgs = [ - 'scripts/ingest_coverage.js', - '--verbose', - '--vcsInfoPath', - 'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO.txt', - '--path', - ]; - - const noTotalsPath = 'jest-combined/coverage-summary-NO-total.json'; +const verboseArgs = [ + 'scripts/ingest_coverage.js', + '--verbose', + '--vcsInfoPath', + 'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/VCS_INFO.txt', + '--path', +]; + +describe('Ingesting coverage', () => { const bothIndexesPath = 'jest-combined/coverage-summary-manual-mix.json'; - describe('with NODE_ENV set to "integration_test"', () => { - describe(`and debug || verbose turned on`, () => { - describe(`to the [${COVERAGE_INDEX}] index`, () => { - const mutableCoverageIndexChunks = []; - - beforeAll(done => { - const ingestAndMutateAsync = ingestAndMutate(done); - const ingestAndMutateAsyncWithPath = ingestAndMutateAsync(noTotalsPath); - const verboseIngestAndMutateAsyncWithPath = ingestAndMutateAsyncWithPath(verboseArgs); - verboseIngestAndMutateAsyncWithPath(mutableCoverageIndexChunks); - }); - - it( - 'should result in every posted item having a site url that meets all regex assertions', - always( - siteUrlsSplitByNewLineWithoutBlanks(mutableCoverageIndexChunks).forEach( - expectAllRegexesToPass({ - ...staticSiteUrlRegexes, - endsInDotJsDotHtml: /.js.html$/, - }) - ) - ) - ); - }); - describe(`to both indexes in the same push`, () => { - const mutableBothIndexesChunks = []; - - beforeAll(done => { - const ingestAndMutateAsync = ingestAndMutate(done); - const ingestAndMutateAsyncWithPath = ingestAndMutateAsync(bothIndexesPath); - const verboseIngestAndMutateAsyncWithPath = ingestAndMutateAsyncWithPath(verboseArgs); - verboseIngestAndMutateAsyncWithPath(mutableBothIndexesChunks); - }); + describe(`to the coverage index`, () => { + const mutableCoverageIndexChunks = []; - it( - 'should result in every posted item having a site url that meets all regex assertions', - always( - siteUrlsSplitByNewLineWithoutBlanks(mutableBothIndexesChunks).forEach( - expectAllRegexesToPass(staticSiteUrlRegexes) - ) - ) - ); - - it('should result in the "just logging" message being present in the log', () => { - expect(mutableBothIndexesChunks.some(x => x.includes('Just Logging'))).to.be(true); - }); - it('should result in the "actually sending" message NOT being present in the log', () => { - expect(mutableBothIndexesChunks.every(x => !x.includes('Actually sending...'))).to.be( - true - ); - }); - describe(`with provided vcs info file`, () => { - const filterZero = xs => included => xs.filter(x => x.includes(included))[0]; - const filteredWith = filterZero(mutableBothIndexesChunks); - it('should have a vcs block', () => { - const vcs = 'vcs'; - const portion = filteredWith(vcs); - expect(portion).to.contain(vcs); - }); - it(`should have a branch`, () => { - const branch = `"branch":`; - const portion = filteredWith(branch); - expect(portion).to.contain(branch); - expect(portion).to.contain(`"origin/ingest-code-coverage"`); - }); - it(`should have a sha`, () => { - const sha = `"sha":`; - const portion = filteredWith(sha); - expect(portion).to.contain(sha); - expect(portion).to.contain(`"f07b34f6206"`); - }); - it(`should have an author`, () => { - const author = `"author":`; - const portion = filteredWith(author); - expect(portion).to.contain(author); - expect(portion).to.contain(`"Tre' Seymour"`); - }); - it(`should have a commit msg, truncated`, () => { - const commitMsg = `"commitMsg":`; - const portion = filteredWith(commitMsg); - expect(portion).to.contain(commitMsg); - expect(portion).to.contain(`"Lorem :) ipsum Tre' λ dolor sit amet, consectetur ..."`); - }); - }); - }); + beforeAll(done => { + const ingestAndMutateAsync = ingestAndMutate(done); + const ingestAndMutateAsyncWithPath = ingestAndMutateAsync(bothIndexesPath); + const verboseIngestAndMutateAsyncWithPath = ingestAndMutateAsyncWithPath(verboseArgs); + verboseIngestAndMutateAsyncWithPath(mutableCoverageIndexChunks); }); + + it( + 'should result in every posted item having a site url that meets all regex assertions', + always( + siteUrlsSplitByNewLineWithoutBlanks(mutableCoverageIndexChunks).forEach( + expectAllRegexesToPass({ + ...staticSiteUrlRegexes, + endsInDotJsDotHtml: /.js.html$/, + }) + ) + ) + ); }); }); diff --git a/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-NO-total.json b/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-NO-total.json index f6d5ac2a4c898..e69de29bb2d1d 100644 --- a/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-NO-total.json +++ b/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-NO-total.json @@ -1,13340 +0,0 @@ -{ - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/bar/bar.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/bar/bar_section.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/button/button.js": { - "lines": { - "total": 33, - "covered": 28, - "skipped": 0, - "pct": 84.85 - }, - "functions": { - "total": 7, - "covered": 6, - "skipped": 0, - "pct": 85.71 - }, - "statements": { - "total": 33, - "covered": 28, - "skipped": 0, - "pct": 84.85 - }, - "branches": { - "total": 21, - "covered": 16, - "skipped": 0, - "pct": 76.19 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/button/button_group/button_group.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/button/button_icon/button_icon.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/collapse_button/collapse_button.js": { - "lines": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/empty_table_prompt/empty_table_prompt.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/empty_table_prompt/empty_table_prompt_actions.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/empty_table_prompt/empty_table_prompt_message.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/empty_table_prompt/empty_table_prompt_panel.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form/check_box/check_box.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form/check_box/check_box_label.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form/label/label.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form/select/select.js": { - "lines": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form/text_area/text_area.js": { - "lines": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form/text_input/text_input.js": { - "lines": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form_layout/field_group.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form_layout/field_group_section.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/local_nav/local_nav.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/local_nav/local_nav_row.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/local_nav/local_nav_row_section.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/local_nav/local_tab.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/local_nav/local_tabs.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/local_nav/local_title.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/pager/pager.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 3, - "skipped": 0, - "pct": 75 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/pager/pager_button_group.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/controlled_table.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_body.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_header.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_header_cell.js": { - "lines": { - "total": 12, - "covered": 6, - "skipped": 0, - "pct": 50 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 12, - "covered": 6, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 6, - "covered": 1, - "skipped": 0, - "pct": 16.67 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_header_check_box_cell.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_info.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_row.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_row_cell.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_row_check_box_cell.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table.js": { - "lines": { - "total": 20, - "covered": 16, - "skipped": 0, - "pct": 80 - }, - "functions": { - "total": 11, - "covered": 8, - "skipped": 0, - "pct": 72.73 - }, - "statements": { - "total": 22, - "covered": 16, - "skipped": 0, - "pct": 72.73 - }, - "branches": { - "total": 14, - "covered": 9, - "skipped": 0, - "pct": 64.29 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table_create_button.js": { - "lines": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table_delete_button.js": { - "lines": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table_loading_prompt.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table_no_matches_prompt.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table_row.js": { - "lines": { - "total": 11, - "covered": 10, - "skipped": 0, - "pct": 90.91 - }, - "functions": { - "total": 4, - "covered": 3, - "skipped": 0, - "pct": 75 - }, - "statements": { - "total": 11, - "covered": 10, - "skipped": 0, - "pct": 90.91 - }, - "branches": { - "total": 6, - "covered": 5, - "skipped": 0, - "pct": 83.33 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table_tool_bar.js": { - "lines": { - "total": 6, - "covered": 4, - "skipped": 0, - "pct": 66.67 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 4, - "skipped": 0, - "pct": 66.67 - }, - "branches": { - "total": 4, - "covered": 2, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table_tool_bar_footer.js": { - "lines": { - "total": 8, - "covered": 6, - "skipped": 0, - "pct": 75 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 8, - "covered": 6, - "skipped": 0, - "pct": 75 - }, - "branches": { - "total": 4, - "covered": 2, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tabs/tab.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tabs/tabs.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tool_bar/tool_bar.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tool_bar/tool_bar_footer.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tool_bar/tool_bar_footer_section.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tool_bar/tool_bar_search_box.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tool_bar/tool_bar_section.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tool_bar/tool_bar_text.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/typography/typography.js": { - "lines": { - "total": 12, - "covered": 12, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 12, - "covered": 12, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/services/alignment.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/services/key_codes.js": { - "lines": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/services/accessibility/accessible_click_keys.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/services/accessibility/cascading_menu_key_codes.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/services/accessibility/combo_box_key_codes.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/services/accessibility/html_id_generator.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/services/sort/sortable_properties.js": { - "lines": { - "total": 17, - "covered": 17, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 18, - "covered": 18, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 10, - "covered": 8, - "skipped": 0, - "pct": 80 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/apm_oss/index.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/data/public/actions/filters/create_filters_from_event.js": { - "lines": { - "total": 39, - "covered": 3, - "skipped": 0, - "pct": 7.69 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 41, - "covered": 3, - "skipped": 0, - "pct": 7.32 - }, - "branches": { - "total": 30, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/data/public/search/aggs/buckets/_terms_other_bucket_helper.js": { - "lines": { - "total": 100, - "covered": 7, - "skipped": 0, - "pct": 7 - }, - "functions": { - "total": 24, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 110, - "covered": 7, - "skipped": 0, - "pct": 6.36 - }, - "branches": { - "total": 42, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/data/public/search/expressions/create_filter.js": { - "lines": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 26, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/elasticsearch/index.js": { - "lines": { - "total": 28, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/elasticsearch/lib/version_health_check.js": { - "lines": { - "total": 10, - "covered": 9, - "skipped": 0, - "pct": 90 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 10, - "covered": 9, - "skipped": 0, - "pct": 90 - }, - "branches": { - "total": 4, - "covered": 3, - "skipped": 0, - "pct": 75 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/elasticsearch/server/lib/abortable_request_handler.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/elasticsearch/server/lib/create_proxy.js": { - "lines": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/elasticsearch/server/lib/handle_es_error.js": { - "lines": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/index.js": { - "lines": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 33, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/inject_vars.js": { - "lines": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/ui_setting_defaults.js": { - "lines": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/common/utils/no_white_space.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/common/utils/shorten_dotted_string.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/migrations/migrations.js": { - "lines": { - "total": 264, - "covered": 250, - "skipped": 0, - "pct": 94.7 - }, - "functions": { - "total": 37, - "covered": 35, - "skipped": 0, - "pct": 94.59 - }, - "statements": { - "total": 269, - "covered": 252, - "skipped": 0, - "pct": 93.68 - }, - "branches": { - "total": 190, - "covered": 149, - "skipped": 0, - "pct": 78.42 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/kibana.js": { - "lines": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/dashboard/np_ready/legacy_app.js": { - "lines": { - "total": 64, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 66, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing.js": { - "lines": { - "total": 11, - "covered": 10, - "skipped": 0, - "pct": 90.91 - }, - "functions": { - "total": 5, - "covered": 4, - "skipped": 0, - "pct": 80 - }, - "statements": { - "total": 11, - "covered": 10, - "skipped": 0, - "pct": 90.91 - }, - "branches": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context.js": { - "lines": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context_app.js": { - "lines": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 26, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js": { - "lines": { - "total": 313, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 86, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 325, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 137, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/response_handler.js": { - "lines": { - "total": 44, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 45, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/anchor.js": { - "lines": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/helpers/call_after_bindings_workaround.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/actions.js": { - "lines": { - "total": 57, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 30, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 68, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/constants.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/state.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query_parameters/actions.js": { - "lines": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query_parameters/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/field_name.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/fixed_scroll.js": { - "lines": { - "total": 42, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 44, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/index.js": { - "lines": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/no_results.js": { - "lines": { - "total": 11, - "covered": 11, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 11, - "covered": 11, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/unsupported_index_pattern.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/debounce/debounce.js": { - "lines": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/debounce/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/doc_table_strings.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/pager/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/pager/pager.js": { - "lines": { - "total": 24, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 24, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/components/fetch_error/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field.js": { - "lines": { - "total": 41, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 41, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/field_chooser.js": { - "lines": { - "total": 96, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 102, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 88, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/lib/field_calculator.js": { - "lines": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/components/help_menu/help_menu_util.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/components/top_nav/open_search_panel.js": { - "lines": { - "total": 7, - "covered": 4, - "skipped": 0, - "pct": 57.14 - }, - "functions": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "statements": { - "total": 7, - "covered": 4, - "skipped": 0, - "pct": 57.14 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/components/top_nav/show_open_search_panel.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/load_tutorials.js": { - "lines": { - "total": 23, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 23, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/sample_data_client.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/add_data.js": { - "lines": { - "total": 14, - "covered": 14, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 14, - "covered": 14, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/feature_directory.js": { - "lines": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/home.js": { - "lines": { - "total": 34, - "covered": 31, - "skipped": 0, - "pct": 91.18 - }, - "functions": { - "total": 14, - "covered": 12, - "skipped": 0, - "pct": 85.71 - }, - "statements": { - "total": 34, - "covered": 31, - "skipped": 0, - "pct": 91.18 - }, - "branches": { - "total": 17, - "covered": 14, - "skipped": 0, - "pct": 82.35 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/home_app.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/recently_accessed.js": { - "lines": { - "total": 37, - "covered": 35, - "skipped": 0, - "pct": 94.59 - }, - "functions": { - "total": 8, - "covered": 7, - "skipped": 0, - "pct": 87.5 - }, - "statements": { - "total": 39, - "covered": 37, - "skipped": 0, - "pct": 94.87 - }, - "branches": { - "total": 15, - "covered": 12, - "skipped": 0, - "pct": 80 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_set_card.js": { - "lines": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_set_cards.js": { - "lines": { - "total": 48, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 54, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_view_data_button.js": { - "lines": { - "total": 13, - "covered": 11, - "skipped": 0, - "pct": 84.62 - }, - "functions": { - "total": 5, - "covered": 2, - "skipped": 0, - "pct": 40 - }, - "statements": { - "total": 14, - "covered": 11, - "skipped": 0, - "pct": 78.57 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/synopsis.js": { - "lines": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial_directory.js": { - "lines": { - "total": 41, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 41, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/content.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/footer.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction.js": { - "lines": { - "total": 12, - "covered": 5, - "skipped": 0, - "pct": 41.67 - }, - "functions": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "statements": { - "total": 12, - "covered": 5, - "skipped": 0, - "pct": 41.67 - }, - "branches": { - "total": 6, - "covered": 3, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction_set.js": { - "lines": { - "total": 54, - "covered": 45, - "skipped": 0, - "pct": 83.33 - }, - "functions": { - "total": 17, - "covered": 13, - "skipped": 0, - "pct": 76.47 - }, - "statements": { - "total": 55, - "covered": 45, - "skipped": 0, - "pct": 81.82 - }, - "branches": { - "total": 36, - "covered": 20, - "skipped": 0, - "pct": 55.56 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/introduction.js": { - "lines": { - "total": 12, - "covered": 12, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 12, - "covered": 12, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/number_parameter.js": { - "lines": { - "total": 4, - "covered": 1, - "skipped": 0, - "pct": 25 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 1, - "skipped": 0, - "pct": 25 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/parameter_form.js": { - "lines": { - "total": 8, - "covered": 2, - "skipped": 0, - "pct": 25 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 2, - "skipped": 0, - "pct": 25 - }, - "branches": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/replace_template_strings.js": { - "lines": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/saved_objects_installer.js": { - "lines": { - "total": 31, - "covered": 25, - "skipped": 0, - "pct": 80.65 - }, - "functions": { - "total": 8, - "covered": 6, - "skipped": 0, - "pct": 75 - }, - "statements": { - "total": 31, - "covered": 25, - "skipped": 0, - "pct": 80.65 - }, - "branches": { - "total": 18, - "covered": 13, - "skipped": 0, - "pct": 72.22 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/status_check_states.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/string_parameter.js": { - "lines": { - "total": 4, - "covered": 1, - "skipped": 0, - "pct": 25 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 1, - "skipped": 0, - "pct": 25 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/tutorial.js": { - "lines": { - "total": 92, - "covered": 51, - "skipped": 0, - "pct": 55.43 - }, - "functions": { - "total": 24, - "covered": 12, - "skipped": 0, - "pct": 50 - }, - "statements": { - "total": 93, - "covered": 51, - "skipped": 0, - "pct": 54.84 - }, - "branches": { - "total": 50, - "covered": 27, - "skipped": 0, - "pct": 54 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/index.js": { - "lines": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 37, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/breadcrumbs.js": { - "lines": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/index.js": { - "lines": { - "total": 40, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 42, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.js": { - "lines": { - "total": 54, - "covered": 40, - "skipped": 0, - "pct": 74.07 - }, - "functions": { - "total": 19, - "covered": 10, - "skipped": 0, - "pct": 52.63 - }, - "statements": { - "total": 58, - "covered": 41, - "skipped": 0, - "pct": 70.69 - }, - "branches": { - "total": 19, - "covered": 14, - "skipped": 0, - "pct": 73.68 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/index.js": { - "lines": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/render.js": { - "lines": { - "total": 7, - "covered": 6, - "skipped": 0, - "pct": 85.71 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 6, - "skipped": 0, - "pct": 85.71 - }, - "branches": { - "total": 4, - "covered": 3, - "skipped": 0, - "pct": 75 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.js": { - "lines": { - "total": 131, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 40, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 132, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 39, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_sections.js": { - "lines": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/create_edit_field/create_edit_field.js": { - "lines": { - "total": 42, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 43, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/create_edit_field/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index_header/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index_header/index_header.js": { - "lines": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/indexed_fields_table.js": { - "lines": { - "total": 22, - "covered": 20, - "skipped": 0, - "pct": 90.91 - }, - "functions": { - "total": 13, - "covered": 11, - "skipped": 0, - "pct": 84.62 - }, - "statements": { - "total": 25, - "covered": 22, - "skipped": 0, - "pct": 88 - }, - "branches": { - "total": 17, - "covered": 12, - "skipped": 0, - "pct": 70.59 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/components/table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/components/table/table.js": { - "lines": { - "total": 19, - "covered": 16, - "skipped": 0, - "pct": 84.21 - }, - "functions": { - "total": 10, - "covered": 7, - "skipped": 0, - "pct": 70 - }, - "statements": { - "total": 19, - "covered": 16, - "skipped": 0, - "pct": 84.21 - }, - "branches": { - "total": 10, - "covered": 9, - "skipped": 0, - "pct": 90 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/lib/get_field_format.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/lib/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/scripted_fields_table.js": { - "lines": { - "total": 44, - "covered": 43, - "skipped": 0, - "pct": 97.73 - }, - "functions": { - "total": 13, - "covered": 12, - "skipped": 0, - "pct": 92.31 - }, - "statements": { - "total": 44, - "covered": 43, - "skipped": 0, - "pct": 97.73 - }, - "branches": { - "total": 12, - "covered": 11, - "skipped": 0, - "pct": 91.67 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/call_outs/call_outs.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/call_outs/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/header/header.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/header/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/table/table.js": { - "lines": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 3, - "skipped": 0, - "pct": 75 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/source_filters_table.js": { - "lines": { - "total": 51, - "covered": 50, - "skipped": 0, - "pct": 98.04 - }, - "functions": { - "total": 17, - "covered": 17, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 52, - "covered": 51, - "skipped": 0, - "pct": 98.08 - }, - "branches": { - "total": 14, - "covered": 9, - "skipped": 0, - "pct": 64.29 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/add_filter/add_filter.js": { - "lines": { - "total": 8, - "covered": 7, - "skipped": 0, - "pct": 87.5 - }, - "functions": { - "total": 4, - "covered": 3, - "skipped": 0, - "pct": 75 - }, - "statements": { - "total": 8, - "covered": 7, - "skipped": 0, - "pct": 87.5 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/add_filter/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/header/header.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/header/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/table/table.js": { - "lines": { - "total": 34, - "covered": 30, - "skipped": 0, - "pct": 88.24 - }, - "functions": { - "total": 15, - "covered": 13, - "skipped": 0, - "pct": 86.67 - }, - "statements": { - "total": 34, - "covered": 30, - "skipped": 0, - "pct": 88.24 - }, - "branches": { - "total": 12, - "covered": 10, - "skipped": 0, - "pct": 83.33 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/index_pattern_table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/_objects.js": { - "lines": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 26, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/_view.js": { - "lines": { - "total": 107, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 23, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 111, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 44, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/breadcrumbs.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/index.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/objects_table.js": { - "lines": { - "total": 130, - "covered": 108, - "skipped": 0, - "pct": 83.08 - }, - "functions": { - "total": 46, - "covered": 35, - "skipped": 0, - "pct": 76.09 - }, - "statements": { - "total": 135, - "covered": 112, - "skipped": 0, - "pct": 82.96 - }, - "branches": { - "total": 48, - "covered": 34, - "skipped": 0, - "pct": 70.83 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/flyout.js": { - "lines": { - "total": 146, - "covered": 119, - "skipped": 0, - "pct": 81.51 - }, - "functions": { - "total": 43, - "covered": 31, - "skipped": 0, - "pct": 72.09 - }, - "statements": { - "total": 148, - "covered": 120, - "skipped": 0, - "pct": 81.08 - }, - "branches": { - "total": 77, - "covered": 66, - "skipped": 0, - "pct": 85.71 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/header/header.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/header/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/relationships.js": { - "lines": { - "total": 40, - "covered": 25, - "skipped": 0, - "pct": 62.5 - }, - "functions": { - "total": 13, - "covered": 7, - "skipped": 0, - "pct": 53.85 - }, - "statements": { - "total": 40, - "covered": 25, - "skipped": 0, - "pct": 62.5 - }, - "branches": { - "total": 28, - "covered": 8, - "skipped": 0, - "pct": 28.57 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/table/table.js": { - "lines": { - "total": 38, - "covered": 23, - "skipped": 0, - "pct": 60.53 - }, - "functions": { - "total": 17, - "covered": 6, - "skipped": 0, - "pct": 35.29 - }, - "statements": { - "total": 40, - "covered": 23, - "skipped": 0, - "pct": 57.5 - }, - "branches": { - "total": 20, - "covered": 13, - "skipped": 0, - "pct": 65 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/fetch_export_by_type_and_search.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/fetch_export_objects.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/find_objects.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/get_default_title.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/get_relationships.js": { - "lines": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 7, - "covered": 5, - "skipped": 0, - "pct": 71.43 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/get_saved_object_counts.js": { - "lines": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/get_saved_object_label.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/import_file.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/import_legacy_file.js": { - "lines": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/in_app_url.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/is_same_query.js": { - "lines": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/log_legacy_import.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/parse_query.js": { - "lines": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 6, - "covered": 5, - "skipped": 0, - "pct": 83.33 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/resolve_import_errors.js": { - "lines": { - "total": 59, - "covered": 59, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 13, - "covered": 13, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 62, - "covered": 62, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 38, - "covered": 36, - "skipped": 0, - "pct": 94.74 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/resolve_saved_objects.js": { - "lines": { - "total": 110, - "covered": 69, - "skipped": 0, - "pct": 62.73 - }, - "functions": { - "total": 23, - "covered": 20, - "skipped": 0, - "pct": 86.96 - }, - "statements": { - "total": 114, - "covered": 73, - "skipped": 0, - "pct": 64.04 - }, - "branches": { - "total": 57, - "covered": 29, - "skipped": 0, - "pct": 50.88 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/visualize/np_ready/legacy_app.js": { - "lines": { - "total": 35, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 37, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/editor.js": { - "lines": { - "total": 212, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 54, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 216, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 74, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/visualization.js": { - "lines": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/visualization_editor.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/visualize/np_ready/help_menu/help_menu_util.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/visualize_listing.js": { - "lines": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/visualize_listing_table.js": { - "lines": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/lib/export/export_dashboards.js": { - "lines": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/lib/import/import_dashboards.js": { - "lines": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/lib/management/saved_objects/inject_meta_attributes.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/lib/management/saved_objects/relationships.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/routes/api/export/index.js": { - "lines": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/routes/api/import/index.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/routes/api/management/index.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/routes/api/management/saved_objects/find.js": { - "lines": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/routes/api/management/saved_objects/relationships.js": { - "lines": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/routes/api/management/saved_objects/scroll.js": { - "lines": { - "total": 26, - "covered": 8, - "skipped": 0, - "pct": 30.77 - }, - "functions": { - "total": 7, - "covered": 3, - "skipped": 0, - "pct": 42.86 - }, - "statements": { - "total": 26, - "covered": 8, - "skipped": 0, - "pct": 30.77 - }, - "branches": { - "total": 12, - "covered": 3, - "skipped": 0, - "pct": 25 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/region_map/public/choropleth_layer.js": { - "lines": { - "total": 206, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 47, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 211, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 90, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/region_map/public/region_map_fn.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/region_map/public/region_map_type.js": { - "lines": { - "total": 28, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/region_map/public/region_map_visualization.js": { - "lines": { - "total": 59, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 60, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 48, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/region_map/public/tooltip_formatter.js": { - "lines": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/index.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/status_page.js": { - "lines": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/components/metric_tiles.js": { - "lines": { - "total": 10, - "covered": 8, - "skipped": 0, - "pct": 80 - }, - "functions": { - "total": 5, - "covered": 3, - "skipped": 0, - "pct": 60 - }, - "statements": { - "total": 10, - "covered": 8, - "skipped": 0, - "pct": 80 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/components/render.js": { - "lines": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/components/server_status.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/components/status_app.js": { - "lines": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/components/status_table.js": { - "lines": { - "total": 7, - "covered": 4, - "skipped": 0, - "pct": 57.14 - }, - "functions": { - "total": 4, - "covered": 1, - "skipped": 0, - "pct": 25 - }, - "statements": { - "total": 7, - "covered": 4, - "skipped": 0, - "pct": 57.14 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/lib/format_number.js": { - "lines": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/lib/load_status.js": { - "lines": { - "total": 19, - "covered": 9, - "skipped": 0, - "pct": 47.37 - }, - "functions": { - "total": 4, - "covered": 3, - "skipped": 0, - "pct": 75 - }, - "statements": { - "total": 19, - "covered": 9, - "skipped": 0, - "pct": 47.37 - }, - "branches": { - "total": 7, - "covered": 3, - "skipped": 0, - "pct": 42.86 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/lib/load_status.test.mocks.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/lib/prop_types.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/testbed/index.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/testbed/public/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/testbed/public/testbed.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tests_bundle/find_source_files.js": { - "lines": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tests_bundle/index.js": { - "lines": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 36, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tests_bundle/tests_entry_template.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tests_bundle/webpackShims/angular-mocks.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/base_maps_visualization.js": { - "lines": { - "total": 102, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 103, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 38, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/css_filters.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/geohash_layer.js": { - "lines": { - "total": 55, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 57, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/tile_map_fn.js": { - "lines": { - "total": 7, - "covered": 6, - "skipped": 0, - "pct": 85.71 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 8, - "covered": 7, - "skipped": 0, - "pct": 87.5 - }, - "branches": { - "total": 4, - "covered": 2, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/tile_map_type.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/tile_map_visualization.js": { - "lines": { - "total": 93, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 94, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 52, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/editors/_tooltip_formatter.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/markers/geohash_grid.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/markers/heatmap.js": { - "lines": { - "total": 62, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 63, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 28, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/markers/scaled_circles.js": { - "lines": { - "total": 80, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 24, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 80, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/markers/shaded_circles.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/app.js": { - "lines": { - "total": 151, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 54, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 159, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/breadcrumbs.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/components/timelionhelp_tabs.js": { - "lines": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/components/timelionhelp_tabs_directive.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/fixed_element.js": { - "lines": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/saved_object_finder.js": { - "lines": { - "total": 120, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 134, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 67, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/saved_object_save_as_checkbox.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_expression_input.js": { - "lines": { - "total": 95, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 95, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 36, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_expression_input_helpers.js": { - "lines": { - "total": 88, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 26, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 92, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 49, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_grid.js": { - "lines": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_load_sheet.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_options_sheet.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_save_sheet.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/cells/cells.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/chart/chart.js": { - "lines": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/fullscreen/fullscreen.js": { - "lines": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_expression_suggestions/timelion_expression_suggestions.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_help/timelion_help.js": { - "lines": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_interval/timelion_interval.js": { - "lines": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/lib/observe_resize.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_table/public/table_vis_controller.js": { - "lines": { - "total": 18, - "covered": 18, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 19, - "covered": 18, - "skipped": 0, - "pct": 94.74 - }, - "branches": { - "total": 8, - "covered": 6, - "skipped": 0, - "pct": 75 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_table/public/agg_table/agg_table.js": { - "lines": { - "total": 104, - "covered": 1, - "skipped": 0, - "pct": 0.96 - }, - "functions": { - "total": 22, - "covered": 1, - "skipped": 0, - "pct": 4.55 - }, - "statements": { - "total": 113, - "covered": 1, - "skipped": 0, - "pct": 0.88 - }, - "branches": { - "total": 61, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_table/public/agg_table/agg_table_group.js": { - "lines": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_table/public/paginated_table/paginated_table.js": { - "lines": { - "total": 32, - "covered": 27, - "skipped": 0, - "pct": 84.38 - }, - "functions": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 35, - "covered": 29, - "skipped": 0, - "pct": 82.86 - }, - "branches": { - "total": 27, - "covered": 18, - "skipped": 0, - "pct": 66.67 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_table/public/paginated_table/rows.js": { - "lines": { - "total": 47, - "covered": 21, - "skipped": 0, - "pct": 44.68 - }, - "functions": { - "total": 12, - "covered": 7, - "skipped": 0, - "pct": 58.33 - }, - "statements": { - "total": 48, - "covered": 22, - "skipped": 0, - "pct": 45.83 - }, - "branches": { - "total": 28, - "covered": 12, - "skipped": 0, - "pct": 42.86 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_tagcloud/public/components/feedback_message.js": { - "lines": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_tagcloud/public/components/label.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_tagcloud/public/components/tag_cloud.js": { - "lines": { - "total": 200, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 53, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 208, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 68, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_tagcloud/public/components/tag_cloud_visualization.js": { - "lines": { - "total": 64, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 65, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/flot.js": { - "lines": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/_generated_/chain.js": { - "lines": { - "total": 1070, - "covered": 612, - "skipped": 0, - "pct": 57.2 - }, - "functions": { - "total": 72, - "covered": 46, - "skipped": 0, - "pct": 63.89 - }, - "statements": { - "total": 1136, - "covered": 623, - "skipped": 0, - "pct": 54.84 - }, - "branches": { - "total": 559, - "covered": 237, - "skipped": 0, - "pct": 42.4 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.axislabels.js": { - "lines": { - "total": 238, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 238, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 123, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.crosshair.js": { - "lines": { - "total": 63, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 63, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 26, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.js": { - "lines": { - "total": 1526, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 123, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1653, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 1142, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.selection.js": { - "lines": { - "total": 138, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 145, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 83, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.stack.js": { - "lines": { - "total": 85, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 87, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 60, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.symbol.js": { - "lines": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.time.js": { - "lines": { - "total": 189, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 208, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 155, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/editor_controller.js": { - "lines": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/request_handler.js": { - "lines": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/add_delete_buttons.js": { - "lines": { - "total": 28, - "covered": 28, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 28, - "covered": 28, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 14, - "covered": 12, - "skipped": 0, - "pct": 85.71 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/annotations_editor.js": { - "lines": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/color_picker.js": { - "lines": { - "total": 20, - "covered": 16, - "skipped": 0, - "pct": 80 - }, - "functions": { - "total": 7, - "covered": 6, - "skipped": 0, - "pct": 85.71 - }, - "statements": { - "total": 21, - "covered": 16, - "skipped": 0, - "pct": 76.19 - }, - "branches": { - "total": 10, - "covered": 8, - "skipped": 0, - "pct": 80 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/color_rules.js": { - "lines": { - "total": 32, - "covered": 24, - "skipped": 0, - "pct": 75 - }, - "functions": { - "total": 7, - "covered": 5, - "skipped": 0, - "pct": 71.43 - }, - "statements": { - "total": 35, - "covered": 25, - "skipped": 0, - "pct": 71.43 - }, - "branches": { - "total": 11, - "covered": 5, - "skipped": 0, - "pct": 45.45 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/custom_color_picker.js": { - "lines": { - "total": 15, - "covered": 11, - "skipped": 0, - "pct": 73.33 - }, - "functions": { - "total": 5, - "covered": 3, - "skipped": 0, - "pct": 60 - }, - "statements": { - "total": 15, - "covered": 11, - "skipped": 0, - "pct": 73.33 - }, - "branches": { - "total": 12, - "covered": 4, - "skipped": 0, - "pct": 33.33 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/data_format_picker.js": { - "lines": { - "total": 47, - "covered": 4, - "skipped": 0, - "pct": 8.51 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 49, - "covered": 4, - "skipped": 0, - "pct": 8.16 - }, - "branches": { - "total": 42, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/error.js": { - "lines": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/index_pattern.js": { - "lines": { - "total": 30, - "covered": 7, - "skipped": 0, - "pct": 23.33 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 30, - "covered": 7, - "skipped": 0, - "pct": 23.33 - }, - "branches": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/markdown_editor.js": { - "lines": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/no_data.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/panel_config.js": { - "lines": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/query_bar_wrapper.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/series.js": { - "lines": { - "total": 22, - "covered": 3, - "skipped": 0, - "pct": 13.64 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 22, - "covered": 3, - "skipped": 0, - "pct": 13.64 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/series_config.js": { - "lines": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/series_drag_handler.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/series_editor.js": { - "lines": { - "total": 28, - "covered": 3, - "skipped": 0, - "pct": 10.71 - }, - "functions": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 31, - "covered": 3, - "skipped": 0, - "pct": 9.68 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/split.js": { - "lines": { - "total": 17, - "covered": 2, - "skipped": 0, - "pct": 11.76 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 17, - "covered": 2, - "skipped": 0, - "pct": 11.76 - }, - "branches": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_editor.js": { - "lines": { - "total": 53, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 53, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 26, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_editor_visualization.js": { - "lines": { - "total": 57, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 58, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 39, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_picker.js": { - "lines": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_with_splits.js": { - "lines": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 35, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/visualization.js": { - "lines": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/yes_no.js": { - "lines": { - "total": 11, - "covered": 11, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 11, - "covered": 11, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/agg.js": { - "lines": { - "total": 9, - "covered": 1, - "skipped": 0, - "pct": 11.11 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 9, - "covered": 1, - "skipped": 0, - "pct": 11.11 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/agg_row.js": { - "lines": { - "total": 8, - "covered": 1, - "skipped": 0, - "pct": 12.5 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 1, - "skipped": 0, - "pct": 12.5 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/agg_select.js": { - "lines": { - "total": 24, - "covered": 7, - "skipped": 0, - "pct": 29.17 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 30, - "covered": 7, - "skipped": 0, - "pct": 23.33 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/aggs.js": { - "lines": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/calculation.js": { - "lines": { - "total": 11, - "covered": 2, - "skipped": 0, - "pct": 18.18 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 2, - "skipped": 0, - "pct": 16.67 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/cumulative_sum.js": { - "lines": { - "total": 6, - "covered": 1, - "skipped": 0, - "pct": 16.67 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 1, - "skipped": 0, - "pct": 16.67 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/derivative.js": { - "lines": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/field_select.js": { - "lines": { - "total": 20, - "covered": 4, - "skipped": 0, - "pct": 20 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 20, - "covered": 4, - "skipped": 0, - "pct": 20 - }, - "branches": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/filter_ratio.js": { - "lines": { - "total": 12, - "covered": 2, - "skipped": 0, - "pct": 16.67 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 2, - "skipped": 0, - "pct": 16.67 - }, - "branches": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/math.js": { - "lines": { - "total": 11, - "covered": 2, - "skipped": 0, - "pct": 18.18 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 2, - "skipped": 0, - "pct": 16.67 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/metric_select.js": { - "lines": { - "total": 35, - "covered": 3, - "skipped": 0, - "pct": 8.57 - }, - "functions": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 36, - "covered": 3, - "skipped": 0, - "pct": 8.33 - }, - "branches": { - "total": 23, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/moving_average.js": { - "lines": { - "total": 17, - "covered": 4, - "skipped": 0, - "pct": 23.53 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 4, - "skipped": 0, - "pct": 22.22 - }, - "branches": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/percentile.js": { - "lines": { - "total": 12, - "covered": 3, - "skipped": 0, - "pct": 25 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 13, - "covered": 3, - "skipped": 0, - "pct": 23.08 - }, - "branches": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/percentile_ui.js": { - "lines": { - "total": 33, - "covered": 4, - "skipped": 0, - "pct": 12.12 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 34, - "covered": 4, - "skipped": 0, - "pct": 11.76 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/positive_only.js": { - "lines": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/serial_diff.js": { - "lines": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/series_agg.js": { - "lines": { - "total": 12, - "covered": 2, - "skipped": 0, - "pct": 16.67 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 2, - "skipped": 0, - "pct": 16.67 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/static.js": { - "lines": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/std_agg.js": { - "lines": { - "total": 8, - "covered": 1, - "skipped": 0, - "pct": 12.5 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 1, - "skipped": 0, - "pct": 12.5 - }, - "branches": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/std_deviation.js": { - "lines": { - "total": 18, - "covered": 4, - "skipped": 0, - "pct": 22.22 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 4, - "skipped": 0, - "pct": 22.22 - }, - "branches": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/std_sibling.js": { - "lines": { - "total": 18, - "covered": 3, - "skipped": 0, - "pct": 16.67 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 3, - "skipped": 0, - "pct": 16.67 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/temporary_unsupported_agg.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/top_hit.js": { - "lines": { - "total": 29, - "covered": 6, - "skipped": 0, - "pct": 20.69 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 31, - "covered": 6, - "skipped": 0, - "pct": 19.35 - }, - "branches": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/unsupported_agg.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/vars.js": { - "lines": { - "total": 17, - "covered": 3, - "skipped": 0, - "pct": 17.65 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 19, - "covered": 3, - "skipped": 0, - "pct": 15.79 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/percentile_rank/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/percentile_rank/multi_value_row.js": { - "lines": { - "total": 8, - "covered": 3, - "skipped": 0, - "pct": 37.5 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 3, - "skipped": 0, - "pct": 37.5 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/percentile_rank/percentile_rank.js": { - "lines": { - "total": 14, - "covered": 3, - "skipped": 0, - "pct": 21.43 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 14, - "covered": 3, - "skipped": 0, - "pct": 21.43 - }, - "branches": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/percentile_rank/percentile_rank_values.js": { - "lines": { - "total": 14, - "covered": 2, - "skipped": 0, - "pct": 14.29 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 16, - "covered": 2, - "skipped": 0, - "pct": 12.5 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/icon_select/icon_select.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/agg_to_component.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/calculate_siblings.js": { - "lines": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 5, - "covered": 4, - "skipped": 0, - "pct": 80 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/charts.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/collection_actions.js": { - "lines": { - "total": 23, - "covered": 22, - "skipped": 0, - "pct": 95.65 - }, - "functions": { - "total": 6, - "covered": 5, - "skipped": 0, - "pct": 83.33 - }, - "statements": { - "total": 27, - "covered": 24, - "skipped": 0, - "pct": 88.89 - }, - "branches": { - "total": 17, - "covered": 8, - "skipped": 0, - "pct": 47.06 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/convert_series_to_vars.js": { - "lines": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/create_change_handler.js": { - "lines": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 1, - "skipped": 0, - "pct": 25 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/create_number_handler.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 6, - "covered": 3, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/create_select_handler.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/create_text_handler.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 6, - "covered": 3, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/create_xaxis_formatter.js": { - "lines": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/detect_ie.js": { - "lines": { - "total": 12, - "covered": 8, - "skipped": 0, - "pct": 66.67 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 12, - "covered": 8, - "skipped": 0, - "pct": 66.67 - }, - "branches": { - "total": 6, - "covered": 3, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/durations.js": { - "lines": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/get_axis_label_string.js": { - "lines": { - "total": 5, - "covered": 4, - "skipped": 0, - "pct": 80 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 4, - "skipped": 0, - "pct": 80 - }, - "branches": { - "total": 4, - "covered": 2, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/get_default_query_language.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/get_display_name.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/get_interval.js": { - "lines": { - "total": 27, - "covered": 13, - "skipped": 0, - "pct": 48.15 - }, - "functions": { - "total": 6, - "covered": 1, - "skipped": 0, - "pct": 16.67 - }, - "statements": { - "total": 31, - "covered": 14, - "skipped": 0, - "pct": 45.16 - }, - "branches": { - "total": 17, - "covered": 4, - "skipped": 0, - "pct": 23.53 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/new_metric_agg_fn.js": { - "lines": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/new_series_fn.js": { - "lines": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/re_id_series.js": { - "lines": { - "total": 16, - "covered": 16, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 20, - "covered": 20, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/reorder.js": { - "lines": { - "total": 5, - "covered": 1, - "skipped": 0, - "pct": 20 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 5, - "covered": 1, - "skipped": 0, - "pct": 20 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/replace_vars.js": { - "lines": { - "total": 11, - "covered": 6, - "skipped": 0, - "pct": 54.55 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 11, - "covered": 6, - "skipped": 0, - "pct": 54.55 - }, - "branches": { - "total": 6, - "covered": 1, - "skipped": 0, - "pct": 16.67 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/series_change_handler.js": { - "lines": { - "total": 9, - "covered": 1, - "skipped": 0, - "pct": 11.11 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 1, - "skipped": 0, - "pct": 9.09 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/stacked.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/tick_formatter.js": { - "lines": { - "total": 22, - "covered": 18, - "skipped": 0, - "pct": 81.82 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 23, - "covered": 19, - "skipped": 0, - "pct": 82.61 - }, - "branches": { - "total": 10, - "covered": 9, - "skipped": 0, - "pct": 90 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/panel_config/gauge.js": { - "lines": { - "total": 30, - "covered": 25, - "skipped": 0, - "pct": 83.33 - }, - "functions": { - "total": 8, - "covered": 4, - "skipped": 0, - "pct": 50 - }, - "statements": { - "total": 33, - "covered": 28, - "skipped": 0, - "pct": 84.85 - }, - "branches": { - "total": 21, - "covered": 6, - "skipped": 0, - "pct": 28.57 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/panel_config/markdown.js": { - "lines": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/panel_config/metric.js": { - "lines": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/panel_config/table.js": { - "lines": { - "total": 26, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/panel_config/timeseries.js": { - "lines": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/panel_config/top_n.js": { - "lines": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/everything.js": { - "lines": { - "total": 6, - "covered": 2, - "skipped": 0, - "pct": 33.33 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 2, - "skipped": 0, - "pct": 33.33 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/filter.js": { - "lines": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/filter_items.js": { - "lines": { - "total": 25, - "covered": 2, - "skipped": 0, - "pct": 8 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 27, - "covered": 2, - "skipped": 0, - "pct": 7.41 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/filters.js": { - "lines": { - "total": 6, - "covered": 2, - "skipped": 0, - "pct": 33.33 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 2, - "skipped": 0, - "pct": 33.33 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/group_by_select.js": { - "lines": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/terms.js": { - "lines": { - "total": 19, - "covered": 18, - "skipped": 0, - "pct": 94.74 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 20, - "covered": 19, - "skipped": 0, - "pct": 95 - }, - "branches": { - "total": 9, - "covered": 6, - "skipped": 0, - "pct": 66.67 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/unsupported_split.js": { - "lines": { - "total": 6, - "covered": 2, - "skipped": 0, - "pct": 33.33 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 2, - "skipped": 0, - "pct": 33.33 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/svg/bomb_icon.js": { - "lines": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/svg/fire_icon.js": { - "lines": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/gauge/series.js": { - "lines": { - "total": 18, - "covered": 12, - "skipped": 0, - "pct": 66.67 - }, - "functions": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "statements": { - "total": 19, - "covered": 13, - "skipped": 0, - "pct": 68.42 - }, - "branches": { - "total": 6, - "covered": 2, - "skipped": 0, - "pct": 33.33 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/gauge/vis.js": { - "lines": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 39, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/markdown/series.js": { - "lines": { - "total": 17, - "covered": 2, - "skipped": 0, - "pct": 11.76 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 2, - "skipped": 0, - "pct": 11.11 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/markdown/vis.js": { - "lines": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/metric/series.js": { - "lines": { - "total": 19, - "covered": 12, - "skipped": 0, - "pct": 63.16 - }, - "functions": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "statements": { - "total": 20, - "covered": 13, - "skipped": 0, - "pct": 65 - }, - "branches": { - "total": 8, - "covered": 3, - "skipped": 0, - "pct": 37.5 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/metric/vis.js": { - "lines": { - "total": 28, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/config.js": { - "lines": { - "total": 16, - "covered": 2, - "skipped": 0, - "pct": 12.5 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 16, - "covered": 2, - "skipped": 0, - "pct": 12.5 - }, - "branches": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/is_sortable.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/series.js": { - "lines": { - "total": 15, - "covered": 2, - "skipped": 0, - "pct": 13.33 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 16, - "covered": 2, - "skipped": 0, - "pct": 12.5 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/vis.js": { - "lines": { - "total": 75, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 79, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 58, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/timeseries/config.js": { - "lines": { - "total": 28, - "covered": 2, - "skipped": 0, - "pct": 7.14 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 28, - "covered": 2, - "skipped": 0, - "pct": 7.14 - }, - "branches": { - "total": 30, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/timeseries/series.js": { - "lines": { - "total": 19, - "covered": 3, - "skipped": 0, - "pct": 15.79 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 20, - "covered": 3, - "skipped": 0, - "pct": 15 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/timeseries/vis.js": { - "lines": { - "total": 80, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 84, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 48, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/top_n/series.js": { - "lines": { - "total": 16, - "covered": 2, - "skipped": 0, - "pct": 12.5 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 17, - "covered": 2, - "skipped": 0, - "pct": 11.76 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/top_n/vis.js": { - "lines": { - "total": 35, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 38, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 23, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/contexts/form_validation_context.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/contexts/vis_data_context.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/lib/check_ui_restrictions.js": { - "lines": { - "total": 13, - "covered": 5, - "skipped": 0, - "pct": 38.46 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 13, - "covered": 5, - "skipped": 0, - "pct": 38.46 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/lib/create_brush_handler.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/lib/fetch_fields.js": { - "lines": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/lib/set_is_reversed.js": { - "lines": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/lib/validate_interval.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/constants/chart.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/constants/icons.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/constants/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/lib/active_cursor.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/lib/calc_dimensions.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/lib/calculate_coordinates.js": { - "lines": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/lib/get_value_by.js": { - "lines": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/annotation.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/gauge.js": { - "lines": { - "total": 35, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 35, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/gauge_vis.js": { - "lines": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/metric.js": { - "lines": { - "total": 41, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 46, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 40, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/top_n.js": { - "lines": { - "total": 48, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 49, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/timeseries/index.js": { - "lines": { - "total": 33, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 37, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/timeseries/decorators/area_decorator.js": { - "lines": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/timeseries/decorators/bar_decorator.js": { - "lines": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/timeseries/model/charts.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/timeseries/utils/series_styles.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 23, - "covered": 23, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/timeseries/utils/stack_format.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/vega_visualization.js": { - "lines": { - "total": 38, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 38, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/data_model/ems_file_parser.js": { - "lines": { - "total": 14, - "covered": 12, - "skipped": 0, - "pct": 85.71 - }, - "functions": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 16, - "covered": 13, - "skipped": 0, - "pct": 81.25 - }, - "branches": { - "total": 8, - "covered": 4, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/data_model/es_query_parser.js": { - "lines": { - "total": 142, - "covered": 115, - "skipped": 0, - "pct": 80.99 - }, - "functions": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 145, - "covered": 117, - "skipped": 0, - "pct": 80.69 - }, - "branches": { - "total": 104, - "covered": 75, - "skipped": 0, - "pct": 72.12 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/data_model/search_cache.js": { - "lines": { - "total": 11, - "covered": 11, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 11, - "covered": 11, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/data_model/time_cache.js": { - "lines": { - "total": 21, - "covered": 19, - "skipped": 0, - "pct": 90.48 - }, - "functions": { - "total": 5, - "covered": 3, - "skipped": 0, - "pct": 60 - }, - "statements": { - "total": 21, - "covered": 19, - "skipped": 0, - "pct": 90.48 - }, - "branches": { - "total": 12, - "covered": 11, - "skipped": 0, - "pct": 91.67 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/data_model/url_parser.js": { - "lines": { - "total": 9, - "covered": 1, - "skipped": 0, - "pct": 11.11 - }, - "functions": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "statements": { - "total": 9, - "covered": 1, - "skipped": 0, - "pct": 11.11 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/data_model/utils.js": { - "lines": { - "total": 11, - "covered": 2, - "skipped": 0, - "pct": 18.18 - }, - "functions": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "statements": { - "total": 11, - "covered": 2, - "skipped": 0, - "pct": 18.18 - }, - "branches": { - "total": 8, - "covered": 1, - "skipped": 0, - "pct": 12.5 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/data_model/vega_parser.js": { - "lines": { - "total": 209, - "covered": 154, - "skipped": 0, - "pct": 73.68 - }, - "functions": { - "total": 20, - "covered": 16, - "skipped": 0, - "pct": 80 - }, - "statements": { - "total": 214, - "covered": 156, - "skipped": 0, - "pct": 72.9 - }, - "branches": { - "total": 193, - "covered": 120, - "skipped": 0, - "pct": 62.18 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/vega_view/vega_base_view.js": { - "lines": { - "total": 145, - "covered": 7, - "skipped": 0, - "pct": 4.83 - }, - "functions": { - "total": 26, - "covered": 1, - "skipped": 0, - "pct": 3.85 - }, - "statements": { - "total": 150, - "covered": 7, - "skipped": 0, - "pct": 4.67 - }, - "branches": { - "total": 73, - "covered": 1, - "skipped": 0, - "pct": 1.37 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/vega_view/vega_map_layer.js": { - "lines": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/vega_view/vega_map_view.js": { - "lines": { - "total": 44, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 46, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/vega_view/vega_tooltip.js": { - "lines": { - "total": 24, - "covered": 1, - "skipped": 0, - "pct": 4.17 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 25, - "covered": 1, - "skipped": 0, - "pct": 4 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/vega_view/vega_view.js": { - "lines": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/response_handler.js": { - "lines": { - "total": 46, - "covered": 3, - "skipped": 0, - "pct": 6.52 - }, - "functions": { - "total": 7, - "covered": 1, - "skipped": 0, - "pct": 14.29 - }, - "statements": { - "total": 47, - "covered": 3, - "skipped": 0, - "pct": 6.38 - }, - "branches": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/vis.js": { - "lines": { - "total": 44, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 47, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 24, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/vislib.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/labels/data_array.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/labels/flatten_series.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/labels/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/labels/labels.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/labels/truncate_labels.js": { - "lines": { - "total": 6, - "covered": 1, - "skipped": 0, - "pct": 16.67 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 1, - "skipped": 0, - "pct": 12.5 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/labels/uniq_labels.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/tooltip/_collect_branch.js": { - "lines": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/tooltip/_hierarchical_tooltip_formatter.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/tooltip/_pointseries_tooltip_formatter.js": { - "lines": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 28, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/tooltip/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/tooltip/position_tooltip.js": { - "lines": { - "total": 69, - "covered": 8, - "skipped": 0, - "pct": 11.59 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 75, - "covered": 8, - "skipped": 0, - "pct": 10.67 - }, - "branches": { - "total": 46, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/tooltip/tooltip.js": { - "lines": { - "total": 86, - "covered": 11, - "skipped": 0, - "pct": 12.79 - }, - "functions": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 88, - "covered": 11, - "skipped": 0, - "pct": 12.5 - }, - "branches": { - "total": 42, - "covered": 3, - "skipped": 0, - "pct": 7.14 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/zero_injection/flatten_data.js": { - "lines": { - "total": 5, - "covered": 4, - "skipped": 0, - "pct": 80 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 4, - "skipped": 0, - "pct": 80 - }, - "branches": { - "total": 12, - "covered": 8, - "skipped": 0, - "pct": 66.67 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/zero_injection/inject_zeros.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/zero_injection/ordered_x_keys.js": { - "lines": { - "total": 26, - "covered": 11, - "skipped": 0, - "pct": 42.31 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 29, - "covered": 13, - "skipped": 0, - "pct": 44.83 - }, - "branches": { - "total": 19, - "covered": 11, - "skipped": 0, - "pct": 57.89 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/zero_injection/uniq_keys.js": { - "lines": { - "total": 23, - "covered": 20, - "skipped": 0, - "pct": 86.96 - }, - "functions": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 23, - "covered": 20, - "skipped": 0, - "pct": 86.96 - }, - "branches": { - "total": 12, - "covered": 6, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/zero_injection/zero_fill_data_array.js": { - "lines": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/zero_injection/zero_filled_array.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/_data_label.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/_error_handler.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/alerts.js": { - "lines": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/chart_grid.js": { - "lines": { - "total": 39, - "covered": 1, - "skipped": 0, - "pct": 2.56 - }, - "functions": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 47, - "covered": 1, - "skipped": 0, - "pct": 2.13 - }, - "branches": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/chart_title.js": { - "lines": { - "total": 39, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 39, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/data.js": { - "lines": { - "total": 161, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 61, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 168, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 82, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/dispatch.js": { - "lines": { - "total": 141, - "covered": 26, - "skipped": 0, - "pct": 18.44 - }, - "functions": { - "total": 41, - "covered": 6, - "skipped": 0, - "pct": 14.63 - }, - "statements": { - "total": 149, - "covered": 28, - "skipped": 0, - "pct": 18.79 - }, - "branches": { - "total": 97, - "covered": 23, - "skipped": 0, - "pct": 23.71 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/handler.js": { - "lines": { - "total": 69, - "covered": 1, - "skipped": 0, - "pct": 1.45 - }, - "functions": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 71, - "covered": 1, - "skipped": 0, - "pct": 1.41 - }, - "branches": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/vis_config.js": { - "lines": { - "total": 11, - "covered": 1, - "skipped": 0, - "pct": 9.09 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 1, - "skipped": 0, - "pct": 9.09 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/axis.js": { - "lines": { - "total": 106, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 23, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 109, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 51, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/axis_config.js": { - "lines": { - "total": 84, - "covered": 7, - "skipped": 0, - "pct": 8.33 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 89, - "covered": 7, - "skipped": 0, - "pct": 7.87 - }, - "branches": { - "total": 66, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/axis_labels.js": { - "lines": { - "total": 72, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 77, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 36, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/axis_scale.js": { - "lines": { - "total": 118, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 134, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 97, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/axis_title.js": { - "lines": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/scale_modes.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/time_ticks.js": { - "lines": { - "total": 12, - "covered": 12, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 13, - "covered": 13, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/layout.js": { - "lines": { - "total": 54, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 54, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/layout_types.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/column_chart/chart_split.js": { - "lines": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/column_chart/chart_title_split.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/column_chart/x_axis_split.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/column_chart/y_axis_split.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/gauge_chart/chart_split.js": { - "lines": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/gauge_chart/chart_title_split.js": { - "lines": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/pie_chart/chart_split.js": { - "lines": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/pie_chart/chart_title_split.js": { - "lines": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/types/column_layout.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/types/gauge_layout.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/types/pie_layout.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/types/gauge.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/types/index.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/types/pie.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/types/point_series.js": { - "lines": { - "total": 70, - "covered": 57, - "skipped": 0, - "pct": 81.43 - }, - "functions": { - "total": 17, - "covered": 12, - "skipped": 0, - "pct": 70.59 - }, - "statements": { - "total": 73, - "covered": 58, - "skipped": 0, - "pct": 79.45 - }, - "branches": { - "total": 76, - "covered": 48, - "skipped": 0, - "pct": 63.16 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/_chart.js": { - "lines": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/gauge_chart.js": { - "lines": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 35, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/pie_chart.js": { - "lines": { - "total": 146, - "covered": 1, - "skipped": 0, - "pct": 0.68 - }, - "functions": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 153, - "covered": 1, - "skipped": 0, - "pct": 0.65 - }, - "branches": { - "total": 86, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/point_series.js": { - "lines": { - "total": 103, - "covered": 2, - "skipped": 0, - "pct": 1.94 - }, - "functions": { - "total": 23, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 108, - "covered": 2, - "skipped": 0, - "pct": 1.85 - }, - "branches": { - "total": 63, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/time_marker.js": { - "lines": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/vis_types.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/gauges/gauge_types.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/gauges/meter.js": { - "lines": { - "total": 132, - "covered": 3, - "skipped": 0, - "pct": 2.27 - }, - "functions": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 135, - "covered": 3, - "skipped": 0, - "pct": 2.22 - }, - "branches": { - "total": 57, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/point_series/_point_series.js": { - "lines": { - "total": 55, - "covered": 1, - "skipped": 0, - "pct": 1.82 - }, - "functions": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 61, - "covered": 1, - "skipped": 0, - "pct": 1.64 - }, - "branches": { - "total": 43, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/point_series/area_chart.js": { - "lines": { - "total": 94, - "covered": 1, - "skipped": 0, - "pct": 1.06 - }, - "functions": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 95, - "covered": 1, - "skipped": 0, - "pct": 1.05 - }, - "branches": { - "total": 38, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/point_series/column_chart.js": { - "lines": { - "total": 133, - "covered": 1, - "skipped": 0, - "pct": 0.75 - }, - "functions": { - "total": 30, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 137, - "covered": 1, - "skipped": 0, - "pct": 0.73 - }, - "branches": { - "total": 107, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/point_series/heatmap_chart.js": { - "lines": { - "total": 147, - "covered": 1, - "skipped": 0, - "pct": 0.68 - }, - "functions": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 153, - "covered": 1, - "skipped": 0, - "pct": 0.65 - }, - "branches": { - "total": 80, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/point_series/line_chart.js": { - "lines": { - "total": 77, - "covered": 1, - "skipped": 0, - "pct": 1.3 - }, - "functions": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 78, - "covered": 1, - "skipped": 0, - "pct": 1.28 - }, - "branches": { - "total": 51, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/point_series/series_types.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/visualizations/public/np_ready/public/vis_impl.js": { - "lines": { - "total": 58, - "covered": 26, - "skipped": 0, - "pct": 44.83 - }, - "functions": { - "total": 24, - "covered": 7, - "skipped": 0, - "pct": 29.17 - }, - "statements": { - "total": 59, - "covered": 26, - "skipped": 0, - "pct": 44.07 - }, - "branches": { - "total": 48, - "covered": 19, - "skipped": 0, - "pct": 39.58 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/visualizations/public/np_ready/public/expressions/vis.js": { - "lines": { - "total": 33, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 35, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/visualizations/public/np_ready/public/legacy/calculate_object_hash.js": { - "lines": { - "total": 28, - "covered": 24, - "skipped": 0, - "pct": 85.71 - }, - "functions": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 28, - "covered": 24, - "skipped": 0, - "pct": 85.71 - }, - "branches": { - "total": 16, - "covered": 12, - "skipped": 0, - "pct": 75 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/visualizations/public/np_ready/public/legacy/vis_update.js": { - "lines": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 12, - "covered": 3, - "skipped": 0, - "pct": 25 - }, - "branches": { - "total": 28, - "covered": 2, - "skipped": 0, - "pct": 7.14 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/visualizations/public/np_ready/public/legacy/vis_update_state.js": { - "lines": { - "total": 46, - "covered": 42, - "skipped": 0, - "pct": 91.3 - }, - "functions": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 47, - "covered": 42, - "skipped": 0, - "pct": 89.36 - }, - "branches": { - "total": 38, - "covered": 28, - "skipped": 0, - "pct": 73.68 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/visualizations/public/np_ready/public/vis_types/base_vis_type.js": { - "lines": { - "total": 17, - "covered": 10, - "skipped": 0, - "pct": 58.82 - }, - "functions": { - "total": 3, - "covered": 2, - "skipped": 0, - "pct": 66.67 - }, - "statements": { - "total": 17, - "covered": 10, - "skipped": 0, - "pct": 58.82 - }, - "branches": { - "total": 17, - "covered": 9, - "skipped": 0, - "pct": 52.94 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/visualizations/public/np_ready/public/vis_types/react_vis_type.js": { - "lines": { - "total": 12, - "covered": 10, - "skipped": 0, - "pct": 83.33 - }, - "functions": { - "total": 5, - "covered": 4, - "skipped": 0, - "pct": 80 - }, - "statements": { - "total": 12, - "covered": 10, - "skipped": 0, - "pct": 83.33 - }, - "branches": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - } - } -} diff --git a/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-manual-mix.json b/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-manual-mix.json index 2554d9131f7c6..baf2b6d500679 100644 --- a/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-manual-mix.json +++ b/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary-manual-mix.json @@ -1,30 +1,4 @@ { - "total": { - "lines": { - "total": 14817, - "covered": 3377, - "skipped": 0, - "pct": 22.79 - }, - "statements": { - "total": 15507, - "covered": 3453, - "skipped": 0, - "pct": 22.27 - }, - "functions": { - "total": 3286, - "covered": 654, - "skipped": 0, - "pct": 19.9 - }, - "branches": { - "total": 8060, - "covered": 1439, - "skipped": 0, - "pct": 17.85 - } - }, "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/x-pack/legacy/plugins/reporting/server/browsers/extract/unzip.js": { "lines": { "total": 4, @@ -50,109 +24,5 @@ "skipped": 0, "pct": 100 } - }, - "total": { - "lines": { - "total": 14817, - "covered": 3377, - "skipped": 0, - "pct": 22.79 - }, - "statements": { - "total": 15507, - "covered": 3453, - "skipped": 0, - "pct": 22.27 - }, - "functions": { - "total": 3286, - "covered": 654, - "skipped": 0, - "pct": 19.9 - }, - "branches": { - "total": 8060, - "covered": 1439, - "skipped": 0, - "pct": 17.85 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/button/button.js": { - "lines": { - "total": 33, - "covered": 28, - "skipped": 0, - "pct": 84.85 - }, - "functions": { - "total": 7, - "covered": 6, - "skipped": 0, - "pct": 85.71 - }, - "statements": { - "total": 33, - "covered": 28, - "skipped": 0, - "pct": 84.85 - }, - "branches": { - "total": 21, - "covered": 16, - "skipped": 0, - "pct": 76.19 - } - }, - "total": { - "lines": { - "total": 14817, - "covered": 3377, - "skipped": 0, - "pct": 22.79 - }, - "statements": { - "total": 15507, - "covered": 3453, - "skipped": 0, - "pct": 22.27 - }, - "functions": { - "total": 3286, - "covered": 654, - "skipped": 0, - "pct": 19.9 - }, - "branches": { - "total": 8060, - "covered": 1439, - "skipped": 0, - "pct": 17.85 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/button/button_icon/button_icon.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } } } diff --git a/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary.json b/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary.json index 5e6a8b2d3ea25..e69de29bb2d1d 100644 --- a/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary.json +++ b/src/dev/code_coverage/ingest_coverage/integration_tests/mocks/jest-combined/coverage-summary.json @@ -1,13366 +0,0 @@ -{ - "total": { - "lines": { - "total": 14817, - "covered": 3377, - "skipped": 0, - "pct": 22.79 - }, - "statements": { - "total": 15507, - "covered": 3453, - "skipped": 0, - "pct": 22.27 - }, - "functions": { - "total": 3286, - "covered": 654, - "skipped": 0, - "pct": 19.9 - }, - "branches": { - "total": 8060, - "covered": 1439, - "skipped": 0, - "pct": 17.85 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/bar/bar.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/bar/bar_section.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/button/button.js": { - "lines": { - "total": 33, - "covered": 28, - "skipped": 0, - "pct": 84.85 - }, - "functions": { - "total": 7, - "covered": 6, - "skipped": 0, - "pct": 85.71 - }, - "statements": { - "total": 33, - "covered": 28, - "skipped": 0, - "pct": 84.85 - }, - "branches": { - "total": 21, - "covered": 16, - "skipped": 0, - "pct": 76.19 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/button/button_group/button_group.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/button/button_icon/button_icon.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/collapse_button/collapse_button.js": { - "lines": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/empty_table_prompt/empty_table_prompt.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/empty_table_prompt/empty_table_prompt_actions.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/empty_table_prompt/empty_table_prompt_message.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/empty_table_prompt/empty_table_prompt_panel.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form/check_box/check_box.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form/check_box/check_box_label.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form/label/label.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form/select/select.js": { - "lines": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form/text_area/text_area.js": { - "lines": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form/text_input/text_input.js": { - "lines": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form_layout/field_group.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/form_layout/field_group_section.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/local_nav/local_nav.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/local_nav/local_nav_row.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/local_nav/local_nav_row_section.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/local_nav/local_tab.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/local_nav/local_tabs.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/local_nav/local_title.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/pager/pager.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 3, - "skipped": 0, - "pct": 75 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/pager/pager_button_group.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/controlled_table.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_body.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_header.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_header_cell.js": { - "lines": { - "total": 12, - "covered": 6, - "skipped": 0, - "pct": 50 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 12, - "covered": 6, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 6, - "covered": 1, - "skipped": 0, - "pct": 16.67 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_header_check_box_cell.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_info.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_row.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_row_cell.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/table_row_check_box_cell.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table.js": { - "lines": { - "total": 20, - "covered": 16, - "skipped": 0, - "pct": 80 - }, - "functions": { - "total": 11, - "covered": 8, - "skipped": 0, - "pct": 72.73 - }, - "statements": { - "total": 22, - "covered": 16, - "skipped": 0, - "pct": 72.73 - }, - "branches": { - "total": 14, - "covered": 9, - "skipped": 0, - "pct": 64.29 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table_create_button.js": { - "lines": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table_delete_button.js": { - "lines": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table_loading_prompt.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table_no_matches_prompt.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table_row.js": { - "lines": { - "total": 11, - "covered": 10, - "skipped": 0, - "pct": 90.91 - }, - "functions": { - "total": 4, - "covered": 3, - "skipped": 0, - "pct": 75 - }, - "statements": { - "total": 11, - "covered": 10, - "skipped": 0, - "pct": 90.91 - }, - "branches": { - "total": 6, - "covered": 5, - "skipped": 0, - "pct": 83.33 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table_tool_bar.js": { - "lines": { - "total": 6, - "covered": 4, - "skipped": 0, - "pct": 66.67 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 4, - "skipped": 0, - "pct": 66.67 - }, - "branches": { - "total": 4, - "covered": 2, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/table/listing_table/listing_table_tool_bar_footer.js": { - "lines": { - "total": 8, - "covered": 6, - "skipped": 0, - "pct": 75 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 8, - "covered": 6, - "skipped": 0, - "pct": 75 - }, - "branches": { - "total": 4, - "covered": 2, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tabs/tab.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tabs/tabs.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tool_bar/tool_bar.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tool_bar/tool_bar_footer.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tool_bar/tool_bar_footer_section.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tool_bar/tool_bar_search_box.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tool_bar/tool_bar_section.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/tool_bar/tool_bar_text.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/components/typography/typography.js": { - "lines": { - "total": 12, - "covered": 12, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 12, - "covered": 12, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/services/alignment.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/services/key_codes.js": { - "lines": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/services/accessibility/accessible_click_keys.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/services/accessibility/cascading_menu_key_codes.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/services/accessibility/combo_box_key_codes.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/services/accessibility/html_id_generator.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/packages/kbn-ui-framework/src/services/sort/sortable_properties.js": { - "lines": { - "total": 17, - "covered": 17, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 18, - "covered": 18, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 10, - "covered": 8, - "skipped": 0, - "pct": 80 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/apm_oss/index.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/data/public/actions/filters/create_filters_from_event.js": { - "lines": { - "total": 39, - "covered": 3, - "skipped": 0, - "pct": 7.69 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 41, - "covered": 3, - "skipped": 0, - "pct": 7.32 - }, - "branches": { - "total": 30, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/data/public/search/aggs/buckets/_terms_other_bucket_helper.js": { - "lines": { - "total": 100, - "covered": 7, - "skipped": 0, - "pct": 7 - }, - "functions": { - "total": 24, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 110, - "covered": 7, - "skipped": 0, - "pct": 6.36 - }, - "branches": { - "total": 42, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/data/public/search/expressions/create_filter.js": { - "lines": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 26, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/elasticsearch/index.js": { - "lines": { - "total": 28, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/elasticsearch/lib/version_health_check.js": { - "lines": { - "total": 10, - "covered": 9, - "skipped": 0, - "pct": 90 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 10, - "covered": 9, - "skipped": 0, - "pct": 90 - }, - "branches": { - "total": 4, - "covered": 3, - "skipped": 0, - "pct": 75 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/elasticsearch/server/lib/abortable_request_handler.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/elasticsearch/server/lib/create_proxy.js": { - "lines": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/elasticsearch/server/lib/handle_es_error.js": { - "lines": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/index.js": { - "lines": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 33, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/inject_vars.js": { - "lines": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/ui_setting_defaults.js": { - "lines": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/common/utils/no_white_space.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/common/utils/shorten_dotted_string.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/migrations/migrations.js": { - "lines": { - "total": 264, - "covered": 250, - "skipped": 0, - "pct": 94.7 - }, - "functions": { - "total": 37, - "covered": 35, - "skipped": 0, - "pct": 94.59 - }, - "statements": { - "total": 269, - "covered": 252, - "skipped": 0, - "pct": 93.68 - }, - "branches": { - "total": 190, - "covered": 149, - "skipped": 0, - "pct": 78.42 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/kibana.js": { - "lines": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/dashboard/np_ready/legacy_app.js": { - "lines": { - "total": 64, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 66, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing.js": { - "lines": { - "total": 11, - "covered": 10, - "skipped": 0, - "pct": 90.91 - }, - "functions": { - "total": 5, - "covered": 4, - "skipped": 0, - "pct": 80 - }, - "statements": { - "total": 11, - "covered": 10, - "skipped": 0, - "pct": 90.91 - }, - "branches": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context.js": { - "lines": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context_app.js": { - "lines": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 26, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js": { - "lines": { - "total": 313, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 86, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 325, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 137, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/response_handler.js": { - "lines": { - "total": 44, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 45, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/api/anchor.js": { - "lines": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/helpers/call_after_bindings_workaround.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/actions.js": { - "lines": { - "total": 57, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 30, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 68, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/constants.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query/state.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query_parameters/actions.js": { - "lines": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context/query_parameters/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/field_name.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/fixed_scroll.js": { - "lines": { - "total": 42, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 44, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/index.js": { - "lines": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/no_results.js": { - "lines": { - "total": 11, - "covered": 11, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 11, - "covered": 11, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/unsupported_index_pattern.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/debounce/debounce.js": { - "lines": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/directives/debounce/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/doc_table_strings.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/pager/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/lib/pager/pager.js": { - "lines": { - "total": 24, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 24, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/components/fetch_error/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/discover_field.js": { - "lines": { - "total": 41, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 41, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/field_chooser.js": { - "lines": { - "total": 96, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 102, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 88, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/components/field_chooser/lib/field_calculator.js": { - "lines": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/components/help_menu/help_menu_util.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/components/top_nav/open_search_panel.js": { - "lines": { - "total": 7, - "covered": 4, - "skipped": 0, - "pct": 57.14 - }, - "functions": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "statements": { - "total": 7, - "covered": 4, - "skipped": 0, - "pct": 57.14 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/discover/np_ready/components/top_nav/show_open_search_panel.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/load_tutorials.js": { - "lines": { - "total": 23, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 23, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/sample_data_client.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/add_data.js": { - "lines": { - "total": 14, - "covered": 14, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 14, - "covered": 14, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/feature_directory.js": { - "lines": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/home.js": { - "lines": { - "total": 34, - "covered": 31, - "skipped": 0, - "pct": 91.18 - }, - "functions": { - "total": 14, - "covered": 12, - "skipped": 0, - "pct": 85.71 - }, - "statements": { - "total": 34, - "covered": 31, - "skipped": 0, - "pct": 91.18 - }, - "branches": { - "total": 17, - "covered": 14, - "skipped": 0, - "pct": 82.35 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/home_app.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/recently_accessed.js": { - "lines": { - "total": 37, - "covered": 35, - "skipped": 0, - "pct": 94.59 - }, - "functions": { - "total": 8, - "covered": 7, - "skipped": 0, - "pct": 87.5 - }, - "statements": { - "total": 39, - "covered": 37, - "skipped": 0, - "pct": 94.87 - }, - "branches": { - "total": 15, - "covered": 12, - "skipped": 0, - "pct": 80 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_set_card.js": { - "lines": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_set_cards.js": { - "lines": { - "total": 48, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 54, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/sample_data_view_data_button.js": { - "lines": { - "total": 13, - "covered": 11, - "skipped": 0, - "pct": 84.62 - }, - "functions": { - "total": 5, - "covered": 2, - "skipped": 0, - "pct": 40 - }, - "statements": { - "total": 14, - "covered": 11, - "skipped": 0, - "pct": 78.57 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/synopsis.js": { - "lines": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial_directory.js": { - "lines": { - "total": 41, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 41, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/content.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/footer.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction.js": { - "lines": { - "total": 12, - "covered": 5, - "skipped": 0, - "pct": 41.67 - }, - "functions": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "statements": { - "total": 12, - "covered": 5, - "skipped": 0, - "pct": 41.67 - }, - "branches": { - "total": 6, - "covered": 3, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/instruction_set.js": { - "lines": { - "total": 54, - "covered": 45, - "skipped": 0, - "pct": 83.33 - }, - "functions": { - "total": 17, - "covered": 13, - "skipped": 0, - "pct": 76.47 - }, - "statements": { - "total": 55, - "covered": 45, - "skipped": 0, - "pct": 81.82 - }, - "branches": { - "total": 36, - "covered": 20, - "skipped": 0, - "pct": 55.56 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/introduction.js": { - "lines": { - "total": 12, - "covered": 12, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 12, - "covered": 12, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/number_parameter.js": { - "lines": { - "total": 4, - "covered": 1, - "skipped": 0, - "pct": 25 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 1, - "skipped": 0, - "pct": 25 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/parameter_form.js": { - "lines": { - "total": 8, - "covered": 2, - "skipped": 0, - "pct": 25 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 2, - "skipped": 0, - "pct": 25 - }, - "branches": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/replace_template_strings.js": { - "lines": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/saved_objects_installer.js": { - "lines": { - "total": 31, - "covered": 25, - "skipped": 0, - "pct": 80.65 - }, - "functions": { - "total": 8, - "covered": 6, - "skipped": 0, - "pct": 75 - }, - "statements": { - "total": 31, - "covered": 25, - "skipped": 0, - "pct": 80.65 - }, - "branches": { - "total": 18, - "covered": 13, - "skipped": 0, - "pct": 72.22 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/status_check_states.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/string_parameter.js": { - "lines": { - "total": 4, - "covered": 1, - "skipped": 0, - "pct": 25 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 1, - "skipped": 0, - "pct": 25 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/tutorial.js": { - "lines": { - "total": 92, - "covered": 51, - "skipped": 0, - "pct": 55.43 - }, - "functions": { - "total": 24, - "covered": 12, - "skipped": 0, - "pct": 50 - }, - "statements": { - "total": 93, - "covered": 51, - "skipped": 0, - "pct": 54.84 - }, - "branches": { - "total": 50, - "covered": 27, - "skipped": 0, - "pct": 54 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/index.js": { - "lines": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 37, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/breadcrumbs.js": { - "lines": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/index.js": { - "lines": { - "total": 40, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 42, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.js": { - "lines": { - "total": 54, - "covered": 40, - "skipped": 0, - "pct": 74.07 - }, - "functions": { - "total": 19, - "covered": 10, - "skipped": 0, - "pct": 52.63 - }, - "statements": { - "total": 58, - "covered": 41, - "skipped": 0, - "pct": 70.69 - }, - "branches": { - "total": 19, - "covered": 14, - "skipped": 0, - "pct": 73.68 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/index.js": { - "lines": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/render.js": { - "lines": { - "total": 7, - "covered": 6, - "skipped": 0, - "pct": 85.71 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 6, - "skipped": 0, - "pct": 85.71 - }, - "branches": { - "total": 4, - "covered": 3, - "skipped": 0, - "pct": 75 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_index_pattern.js": { - "lines": { - "total": 131, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 40, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 132, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 39, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/edit_sections.js": { - "lines": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/create_edit_field/create_edit_field.js": { - "lines": { - "total": 42, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 43, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/create_edit_field/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index_header/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/index_header/index_header.js": { - "lines": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/indexed_fields_table.js": { - "lines": { - "total": 22, - "covered": 20, - "skipped": 0, - "pct": 90.91 - }, - "functions": { - "total": 13, - "covered": 11, - "skipped": 0, - "pct": 84.62 - }, - "statements": { - "total": 25, - "covered": 22, - "skipped": 0, - "pct": 88 - }, - "branches": { - "total": 17, - "covered": 12, - "skipped": 0, - "pct": 70.59 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/components/table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/components/table/table.js": { - "lines": { - "total": 19, - "covered": 16, - "skipped": 0, - "pct": 84.21 - }, - "functions": { - "total": 10, - "covered": 7, - "skipped": 0, - "pct": 70 - }, - "statements": { - "total": 19, - "covered": 16, - "skipped": 0, - "pct": 84.21 - }, - "branches": { - "total": 10, - "covered": 9, - "skipped": 0, - "pct": 90 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/lib/get_field_format.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/indexed_fields_table/lib/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/scripted_fields_table.js": { - "lines": { - "total": 44, - "covered": 43, - "skipped": 0, - "pct": 97.73 - }, - "functions": { - "total": 13, - "covered": 12, - "skipped": 0, - "pct": 92.31 - }, - "statements": { - "total": 44, - "covered": 43, - "skipped": 0, - "pct": 97.73 - }, - "branches": { - "total": 12, - "covered": 11, - "skipped": 0, - "pct": 91.67 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/call_outs/call_outs.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/call_outs/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/header/header.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/header/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/scripted_fields_table/components/table/table.js": { - "lines": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 3, - "skipped": 0, - "pct": 75 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/source_filters_table.js": { - "lines": { - "total": 51, - "covered": 50, - "skipped": 0, - "pct": 98.04 - }, - "functions": { - "total": 17, - "covered": 17, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 52, - "covered": 51, - "skipped": 0, - "pct": 98.08 - }, - "branches": { - "total": 14, - "covered": 9, - "skipped": 0, - "pct": 64.29 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/add_filter/add_filter.js": { - "lines": { - "total": 8, - "covered": 7, - "skipped": 0, - "pct": 87.5 - }, - "functions": { - "total": 4, - "covered": 3, - "skipped": 0, - "pct": 75 - }, - "statements": { - "total": 8, - "covered": 7, - "skipped": 0, - "pct": 87.5 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/add_filter/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/header/header.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/header/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/edit_index_pattern/source_filters_table/components/table/table.js": { - "lines": { - "total": 34, - "covered": 30, - "skipped": 0, - "pct": 88.24 - }, - "functions": { - "total": 15, - "covered": 13, - "skipped": 0, - "pct": 86.67 - }, - "statements": { - "total": 34, - "covered": 30, - "skipped": 0, - "pct": 88.24 - }, - "branches": { - "total": 12, - "covered": 10, - "skipped": 0, - "pct": 83.33 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/index_pattern_table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/_objects.js": { - "lines": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 26, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/_view.js": { - "lines": { - "total": 107, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 23, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 111, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 44, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/breadcrumbs.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/index.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/objects_table.js": { - "lines": { - "total": 130, - "covered": 108, - "skipped": 0, - "pct": 83.08 - }, - "functions": { - "total": 46, - "covered": 35, - "skipped": 0, - "pct": 76.09 - }, - "statements": { - "total": 135, - "covered": 112, - "skipped": 0, - "pct": 82.96 - }, - "branches": { - "total": 48, - "covered": 34, - "skipped": 0, - "pct": 70.83 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/flyout.js": { - "lines": { - "total": 146, - "covered": 119, - "skipped": 0, - "pct": 81.51 - }, - "functions": { - "total": 43, - "covered": 31, - "skipped": 0, - "pct": 72.09 - }, - "statements": { - "total": 148, - "covered": 120, - "skipped": 0, - "pct": 81.08 - }, - "branches": { - "total": 77, - "covered": 66, - "skipped": 0, - "pct": 85.71 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/flyout/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/header/header.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/header/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/relationships/relationships.js": { - "lines": { - "total": 40, - "covered": 25, - "skipped": 0, - "pct": 62.5 - }, - "functions": { - "total": 13, - "covered": 7, - "skipped": 0, - "pct": 53.85 - }, - "statements": { - "total": 40, - "covered": 25, - "skipped": 0, - "pct": 62.5 - }, - "branches": { - "total": 28, - "covered": 8, - "skipped": 0, - "pct": 28.57 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/table/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/components/objects_table/components/table/table.js": { - "lines": { - "total": 38, - "covered": 23, - "skipped": 0, - "pct": 60.53 - }, - "functions": { - "total": 17, - "covered": 6, - "skipped": 0, - "pct": 35.29 - }, - "statements": { - "total": 40, - "covered": 23, - "skipped": 0, - "pct": 57.5 - }, - "branches": { - "total": 20, - "covered": 13, - "skipped": 0, - "pct": 65 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/fetch_export_by_type_and_search.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/fetch_export_objects.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/find_objects.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/get_default_title.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/get_relationships.js": { - "lines": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 7, - "covered": 5, - "skipped": 0, - "pct": 71.43 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/get_saved_object_counts.js": { - "lines": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/get_saved_object_label.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/import_file.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/import_legacy_file.js": { - "lines": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/in_app_url.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/is_same_query.js": { - "lines": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/log_legacy_import.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/parse_query.js": { - "lines": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 6, - "covered": 5, - "skipped": 0, - "pct": 83.33 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/resolve_import_errors.js": { - "lines": { - "total": 59, - "covered": 59, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 13, - "covered": 13, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 62, - "covered": 62, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 38, - "covered": 36, - "skipped": 0, - "pct": 94.74 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/management/sections/objects/lib/resolve_saved_objects.js": { - "lines": { - "total": 110, - "covered": 69, - "skipped": 0, - "pct": 62.73 - }, - "functions": { - "total": 23, - "covered": 20, - "skipped": 0, - "pct": 86.96 - }, - "statements": { - "total": 114, - "covered": 73, - "skipped": 0, - "pct": 64.04 - }, - "branches": { - "total": 57, - "covered": 29, - "skipped": 0, - "pct": 50.88 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/visualize/np_ready/legacy_app.js": { - "lines": { - "total": 35, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 37, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/editor.js": { - "lines": { - "total": 212, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 54, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 216, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 74, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/visualization.js": { - "lines": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/visualization_editor.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/visualize/np_ready/help_menu/help_menu_util.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/visualize_listing.js": { - "lines": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/public/visualize/np_ready/listing/visualize_listing_table.js": { - "lines": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/lib/export/export_dashboards.js": { - "lines": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/lib/import/import_dashboards.js": { - "lines": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/lib/management/saved_objects/inject_meta_attributes.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/lib/management/saved_objects/relationships.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/routes/api/export/index.js": { - "lines": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/routes/api/import/index.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/routes/api/management/index.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/routes/api/management/saved_objects/find.js": { - "lines": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/routes/api/management/saved_objects/relationships.js": { - "lines": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/kibana/server/routes/api/management/saved_objects/scroll.js": { - "lines": { - "total": 26, - "covered": 8, - "skipped": 0, - "pct": 30.77 - }, - "functions": { - "total": 7, - "covered": 3, - "skipped": 0, - "pct": 42.86 - }, - "statements": { - "total": 26, - "covered": 8, - "skipped": 0, - "pct": 30.77 - }, - "branches": { - "total": 12, - "covered": 3, - "skipped": 0, - "pct": 25 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/region_map/public/choropleth_layer.js": { - "lines": { - "total": 206, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 47, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 211, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 90, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/region_map/public/region_map_fn.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/region_map/public/region_map_type.js": { - "lines": { - "total": 28, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/region_map/public/region_map_visualization.js": { - "lines": { - "total": 59, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 60, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 48, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/region_map/public/tooltip_formatter.js": { - "lines": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/index.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/status_page.js": { - "lines": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/components/metric_tiles.js": { - "lines": { - "total": 10, - "covered": 8, - "skipped": 0, - "pct": 80 - }, - "functions": { - "total": 5, - "covered": 3, - "skipped": 0, - "pct": 60 - }, - "statements": { - "total": 10, - "covered": 8, - "skipped": 0, - "pct": 80 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/components/render.js": { - "lines": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/components/server_status.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/components/status_app.js": { - "lines": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/components/status_table.js": { - "lines": { - "total": 7, - "covered": 4, - "skipped": 0, - "pct": 57.14 - }, - "functions": { - "total": 4, - "covered": 1, - "skipped": 0, - "pct": 25 - }, - "statements": { - "total": 7, - "covered": 4, - "skipped": 0, - "pct": 57.14 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/lib/format_number.js": { - "lines": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/lib/load_status.js": { - "lines": { - "total": 19, - "covered": 9, - "skipped": 0, - "pct": 47.37 - }, - "functions": { - "total": 4, - "covered": 3, - "skipped": 0, - "pct": 75 - }, - "statements": { - "total": 19, - "covered": 9, - "skipped": 0, - "pct": 47.37 - }, - "branches": { - "total": 7, - "covered": 3, - "skipped": 0, - "pct": 42.86 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/lib/load_status.test.mocks.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/status_page/public/lib/prop_types.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/testbed/index.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/testbed/public/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/testbed/public/testbed.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tests_bundle/find_source_files.js": { - "lines": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tests_bundle/index.js": { - "lines": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 36, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tests_bundle/tests_entry_template.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tests_bundle/webpackShims/angular-mocks.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/base_maps_visualization.js": { - "lines": { - "total": 102, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 103, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 38, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/css_filters.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/geohash_layer.js": { - "lines": { - "total": 55, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 57, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/tile_map_fn.js": { - "lines": { - "total": 7, - "covered": 6, - "skipped": 0, - "pct": 85.71 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 8, - "covered": 7, - "skipped": 0, - "pct": 87.5 - }, - "branches": { - "total": 4, - "covered": 2, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/tile_map_type.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/tile_map_visualization.js": { - "lines": { - "total": 93, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 94, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 52, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/editors/_tooltip_formatter.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/markers/geohash_grid.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/markers/heatmap.js": { - "lines": { - "total": 62, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 63, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 28, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/markers/scaled_circles.js": { - "lines": { - "total": 80, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 24, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 80, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/tile_map/public/markers/shaded_circles.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/app.js": { - "lines": { - "total": 151, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 54, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 159, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/breadcrumbs.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/components/timelionhelp_tabs.js": { - "lines": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/components/timelionhelp_tabs_directive.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/fixed_element.js": { - "lines": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/saved_object_finder.js": { - "lines": { - "total": 120, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 134, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 67, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/saved_object_save_as_checkbox.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_expression_input.js": { - "lines": { - "total": 95, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 95, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 36, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_expression_input_helpers.js": { - "lines": { - "total": 88, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 26, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 92, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 49, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_grid.js": { - "lines": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_load_sheet.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_options_sheet.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_save_sheet.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/cells/cells.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/chart/chart.js": { - "lines": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/fullscreen/fullscreen.js": { - "lines": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_expression_suggestions/timelion_expression_suggestions.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_help/timelion_help.js": { - "lines": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/directives/timelion_interval/timelion_interval.js": { - "lines": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/timelion/public/lib/observe_resize.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_table/public/table_vis_controller.js": { - "lines": { - "total": 18, - "covered": 18, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 19, - "covered": 18, - "skipped": 0, - "pct": 94.74 - }, - "branches": { - "total": 8, - "covered": 6, - "skipped": 0, - "pct": 75 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_table/public/agg_table/agg_table.js": { - "lines": { - "total": 104, - "covered": 1, - "skipped": 0, - "pct": 0.96 - }, - "functions": { - "total": 22, - "covered": 1, - "skipped": 0, - "pct": 4.55 - }, - "statements": { - "total": 113, - "covered": 1, - "skipped": 0, - "pct": 0.88 - }, - "branches": { - "total": 61, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_table/public/agg_table/agg_table_group.js": { - "lines": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_table/public/paginated_table/paginated_table.js": { - "lines": { - "total": 32, - "covered": 27, - "skipped": 0, - "pct": 84.38 - }, - "functions": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 35, - "covered": 29, - "skipped": 0, - "pct": 82.86 - }, - "branches": { - "total": 27, - "covered": 18, - "skipped": 0, - "pct": 66.67 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_table/public/paginated_table/rows.js": { - "lines": { - "total": 47, - "covered": 21, - "skipped": 0, - "pct": 44.68 - }, - "functions": { - "total": 12, - "covered": 7, - "skipped": 0, - "pct": 58.33 - }, - "statements": { - "total": 48, - "covered": 22, - "skipped": 0, - "pct": 45.83 - }, - "branches": { - "total": 28, - "covered": 12, - "skipped": 0, - "pct": 42.86 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_tagcloud/public/components/feedback_message.js": { - "lines": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_tagcloud/public/components/label.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_tagcloud/public/components/tag_cloud.js": { - "lines": { - "total": 200, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 53, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 208, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 68, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_tagcloud/public/components/tag_cloud_visualization.js": { - "lines": { - "total": 64, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 65, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/flot.js": { - "lines": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/_generated_/chain.js": { - "lines": { - "total": 1070, - "covered": 612, - "skipped": 0, - "pct": 57.2 - }, - "functions": { - "total": 72, - "covered": 46, - "skipped": 0, - "pct": 63.89 - }, - "statements": { - "total": 1136, - "covered": 623, - "skipped": 0, - "pct": 54.84 - }, - "branches": { - "total": 559, - "covered": 237, - "skipped": 0, - "pct": 42.4 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.axislabels.js": { - "lines": { - "total": 238, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 238, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 123, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.crosshair.js": { - "lines": { - "total": 63, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 63, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 26, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.js": { - "lines": { - "total": 1526, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 123, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1653, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 1142, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.selection.js": { - "lines": { - "total": 138, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 145, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 83, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.stack.js": { - "lines": { - "total": 85, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 87, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 60, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.symbol.js": { - "lines": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.time.js": { - "lines": { - "total": 189, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 208, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 155, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/editor_controller.js": { - "lines": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/request_handler.js": { - "lines": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/add_delete_buttons.js": { - "lines": { - "total": 28, - "covered": 28, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 28, - "covered": 28, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 14, - "covered": 12, - "skipped": 0, - "pct": 85.71 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/annotations_editor.js": { - "lines": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/color_picker.js": { - "lines": { - "total": 20, - "covered": 16, - "skipped": 0, - "pct": 80 - }, - "functions": { - "total": 7, - "covered": 6, - "skipped": 0, - "pct": 85.71 - }, - "statements": { - "total": 21, - "covered": 16, - "skipped": 0, - "pct": 76.19 - }, - "branches": { - "total": 10, - "covered": 8, - "skipped": 0, - "pct": 80 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/color_rules.js": { - "lines": { - "total": 32, - "covered": 24, - "skipped": 0, - "pct": 75 - }, - "functions": { - "total": 7, - "covered": 5, - "skipped": 0, - "pct": 71.43 - }, - "statements": { - "total": 35, - "covered": 25, - "skipped": 0, - "pct": 71.43 - }, - "branches": { - "total": 11, - "covered": 5, - "skipped": 0, - "pct": 45.45 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/custom_color_picker.js": { - "lines": { - "total": 15, - "covered": 11, - "skipped": 0, - "pct": 73.33 - }, - "functions": { - "total": 5, - "covered": 3, - "skipped": 0, - "pct": 60 - }, - "statements": { - "total": 15, - "covered": 11, - "skipped": 0, - "pct": 73.33 - }, - "branches": { - "total": 12, - "covered": 4, - "skipped": 0, - "pct": 33.33 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/data_format_picker.js": { - "lines": { - "total": 47, - "covered": 4, - "skipped": 0, - "pct": 8.51 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 49, - "covered": 4, - "skipped": 0, - "pct": 8.16 - }, - "branches": { - "total": 42, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/error.js": { - "lines": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/index_pattern.js": { - "lines": { - "total": 30, - "covered": 7, - "skipped": 0, - "pct": 23.33 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 30, - "covered": 7, - "skipped": 0, - "pct": 23.33 - }, - "branches": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/markdown_editor.js": { - "lines": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/no_data.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/panel_config.js": { - "lines": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/query_bar_wrapper.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/series.js": { - "lines": { - "total": 22, - "covered": 3, - "skipped": 0, - "pct": 13.64 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 22, - "covered": 3, - "skipped": 0, - "pct": 13.64 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/series_config.js": { - "lines": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/series_drag_handler.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/series_editor.js": { - "lines": { - "total": 28, - "covered": 3, - "skipped": 0, - "pct": 10.71 - }, - "functions": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 31, - "covered": 3, - "skipped": 0, - "pct": 9.68 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/split.js": { - "lines": { - "total": 17, - "covered": 2, - "skipped": 0, - "pct": 11.76 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 17, - "covered": 2, - "skipped": 0, - "pct": 11.76 - }, - "branches": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_editor.js": { - "lines": { - "total": 53, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 53, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 26, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_editor_visualization.js": { - "lines": { - "total": 57, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 58, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 39, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_picker.js": { - "lines": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_with_splits.js": { - "lines": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 35, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/visualization.js": { - "lines": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/yes_no.js": { - "lines": { - "total": 11, - "covered": 11, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 11, - "covered": 11, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/agg.js": { - "lines": { - "total": 9, - "covered": 1, - "skipped": 0, - "pct": 11.11 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 9, - "covered": 1, - "skipped": 0, - "pct": 11.11 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/agg_row.js": { - "lines": { - "total": 8, - "covered": 1, - "skipped": 0, - "pct": 12.5 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 1, - "skipped": 0, - "pct": 12.5 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/agg_select.js": { - "lines": { - "total": 24, - "covered": 7, - "skipped": 0, - "pct": 29.17 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 30, - "covered": 7, - "skipped": 0, - "pct": 23.33 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/aggs.js": { - "lines": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/calculation.js": { - "lines": { - "total": 11, - "covered": 2, - "skipped": 0, - "pct": 18.18 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 2, - "skipped": 0, - "pct": 16.67 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/cumulative_sum.js": { - "lines": { - "total": 6, - "covered": 1, - "skipped": 0, - "pct": 16.67 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 1, - "skipped": 0, - "pct": 16.67 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/derivative.js": { - "lines": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/field_select.js": { - "lines": { - "total": 20, - "covered": 4, - "skipped": 0, - "pct": 20 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 20, - "covered": 4, - "skipped": 0, - "pct": 20 - }, - "branches": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/filter_ratio.js": { - "lines": { - "total": 12, - "covered": 2, - "skipped": 0, - "pct": 16.67 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 2, - "skipped": 0, - "pct": 16.67 - }, - "branches": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/math.js": { - "lines": { - "total": 11, - "covered": 2, - "skipped": 0, - "pct": 18.18 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 2, - "skipped": 0, - "pct": 16.67 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/metric_select.js": { - "lines": { - "total": 35, - "covered": 3, - "skipped": 0, - "pct": 8.57 - }, - "functions": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 36, - "covered": 3, - "skipped": 0, - "pct": 8.33 - }, - "branches": { - "total": 23, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/moving_average.js": { - "lines": { - "total": 17, - "covered": 4, - "skipped": 0, - "pct": 23.53 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 4, - "skipped": 0, - "pct": 22.22 - }, - "branches": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/percentile.js": { - "lines": { - "total": 12, - "covered": 3, - "skipped": 0, - "pct": 25 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 13, - "covered": 3, - "skipped": 0, - "pct": 23.08 - }, - "branches": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/percentile_ui.js": { - "lines": { - "total": 33, - "covered": 4, - "skipped": 0, - "pct": 12.12 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 34, - "covered": 4, - "skipped": 0, - "pct": 11.76 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/positive_only.js": { - "lines": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/serial_diff.js": { - "lines": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/series_agg.js": { - "lines": { - "total": 12, - "covered": 2, - "skipped": 0, - "pct": 16.67 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 2, - "skipped": 0, - "pct": 16.67 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/static.js": { - "lines": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/std_agg.js": { - "lines": { - "total": 8, - "covered": 1, - "skipped": 0, - "pct": 12.5 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 1, - "skipped": 0, - "pct": 12.5 - }, - "branches": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/std_deviation.js": { - "lines": { - "total": 18, - "covered": 4, - "skipped": 0, - "pct": 22.22 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 4, - "skipped": 0, - "pct": 22.22 - }, - "branches": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/std_sibling.js": { - "lines": { - "total": 18, - "covered": 3, - "skipped": 0, - "pct": 16.67 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 3, - "skipped": 0, - "pct": 16.67 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/temporary_unsupported_agg.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/top_hit.js": { - "lines": { - "total": 29, - "covered": 6, - "skipped": 0, - "pct": 20.69 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 31, - "covered": 6, - "skipped": 0, - "pct": 19.35 - }, - "branches": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/unsupported_agg.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/vars.js": { - "lines": { - "total": 17, - "covered": 3, - "skipped": 0, - "pct": 17.65 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 19, - "covered": 3, - "skipped": 0, - "pct": 15.79 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/percentile_rank/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/percentile_rank/multi_value_row.js": { - "lines": { - "total": 8, - "covered": 3, - "skipped": 0, - "pct": 37.5 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 3, - "skipped": 0, - "pct": 37.5 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/percentile_rank/percentile_rank.js": { - "lines": { - "total": 14, - "covered": 3, - "skipped": 0, - "pct": 21.43 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 14, - "covered": 3, - "skipped": 0, - "pct": 21.43 - }, - "branches": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/aggs/percentile_rank/percentile_rank_values.js": { - "lines": { - "total": 14, - "covered": 2, - "skipped": 0, - "pct": 14.29 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 16, - "covered": 2, - "skipped": 0, - "pct": 12.5 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/icon_select/icon_select.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/agg_to_component.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/calculate_siblings.js": { - "lines": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 5, - "covered": 4, - "skipped": 0, - "pct": 80 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/charts.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/collection_actions.js": { - "lines": { - "total": 23, - "covered": 22, - "skipped": 0, - "pct": 95.65 - }, - "functions": { - "total": 6, - "covered": 5, - "skipped": 0, - "pct": 83.33 - }, - "statements": { - "total": 27, - "covered": 24, - "skipped": 0, - "pct": 88.89 - }, - "branches": { - "total": 17, - "covered": 8, - "skipped": 0, - "pct": 47.06 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/convert_series_to_vars.js": { - "lines": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/create_change_handler.js": { - "lines": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 1, - "skipped": 0, - "pct": 25 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/create_number_handler.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 6, - "covered": 3, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/create_select_handler.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/create_text_handler.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 6, - "covered": 3, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/create_xaxis_formatter.js": { - "lines": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/detect_ie.js": { - "lines": { - "total": 12, - "covered": 8, - "skipped": 0, - "pct": 66.67 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 12, - "covered": 8, - "skipped": 0, - "pct": 66.67 - }, - "branches": { - "total": 6, - "covered": 3, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/durations.js": { - "lines": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/get_axis_label_string.js": { - "lines": { - "total": 5, - "covered": 4, - "skipped": 0, - "pct": 80 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 4, - "skipped": 0, - "pct": 80 - }, - "branches": { - "total": 4, - "covered": 2, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/get_default_query_language.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/get_display_name.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/get_interval.js": { - "lines": { - "total": 27, - "covered": 13, - "skipped": 0, - "pct": 48.15 - }, - "functions": { - "total": 6, - "covered": 1, - "skipped": 0, - "pct": 16.67 - }, - "statements": { - "total": 31, - "covered": 14, - "skipped": 0, - "pct": 45.16 - }, - "branches": { - "total": 17, - "covered": 4, - "skipped": 0, - "pct": 23.53 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/new_metric_agg_fn.js": { - "lines": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/new_series_fn.js": { - "lines": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/re_id_series.js": { - "lines": { - "total": 16, - "covered": 16, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 9, - "covered": 9, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 20, - "covered": 20, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/reorder.js": { - "lines": { - "total": 5, - "covered": 1, - "skipped": 0, - "pct": 20 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 5, - "covered": 1, - "skipped": 0, - "pct": 20 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/replace_vars.js": { - "lines": { - "total": 11, - "covered": 6, - "skipped": 0, - "pct": 54.55 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 11, - "covered": 6, - "skipped": 0, - "pct": 54.55 - }, - "branches": { - "total": 6, - "covered": 1, - "skipped": 0, - "pct": 16.67 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/series_change_handler.js": { - "lines": { - "total": 9, - "covered": 1, - "skipped": 0, - "pct": 11.11 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 1, - "skipped": 0, - "pct": 9.09 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/stacked.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/lib/tick_formatter.js": { - "lines": { - "total": 22, - "covered": 18, - "skipped": 0, - "pct": 81.82 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 23, - "covered": 19, - "skipped": 0, - "pct": 82.61 - }, - "branches": { - "total": 10, - "covered": 9, - "skipped": 0, - "pct": 90 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/panel_config/gauge.js": { - "lines": { - "total": 30, - "covered": 25, - "skipped": 0, - "pct": 83.33 - }, - "functions": { - "total": 8, - "covered": 4, - "skipped": 0, - "pct": 50 - }, - "statements": { - "total": 33, - "covered": 28, - "skipped": 0, - "pct": 84.85 - }, - "branches": { - "total": 21, - "covered": 6, - "skipped": 0, - "pct": 28.57 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/panel_config/markdown.js": { - "lines": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/panel_config/metric.js": { - "lines": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/panel_config/table.js": { - "lines": { - "total": 26, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 27, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/panel_config/timeseries.js": { - "lines": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/panel_config/top_n.js": { - "lines": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/everything.js": { - "lines": { - "total": 6, - "covered": 2, - "skipped": 0, - "pct": 33.33 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 2, - "skipped": 0, - "pct": 33.33 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/filter.js": { - "lines": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/filter_items.js": { - "lines": { - "total": 25, - "covered": 2, - "skipped": 0, - "pct": 8 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 27, - "covered": 2, - "skipped": 0, - "pct": 7.41 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/filters.js": { - "lines": { - "total": 6, - "covered": 2, - "skipped": 0, - "pct": 33.33 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 2, - "skipped": 0, - "pct": 33.33 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/group_by_select.js": { - "lines": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 9, - "covered": 2, - "skipped": 0, - "pct": 22.22 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/terms.js": { - "lines": { - "total": 19, - "covered": 18, - "skipped": 0, - "pct": 94.74 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 20, - "covered": 19, - "skipped": 0, - "pct": 95 - }, - "branches": { - "total": 9, - "covered": 6, - "skipped": 0, - "pct": 66.67 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/splits/unsupported_split.js": { - "lines": { - "total": 6, - "covered": 2, - "skipped": 0, - "pct": 33.33 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 2, - "skipped": 0, - "pct": 33.33 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/svg/bomb_icon.js": { - "lines": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/svg/fire_icon.js": { - "lines": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/gauge/series.js": { - "lines": { - "total": 18, - "covered": 12, - "skipped": 0, - "pct": 66.67 - }, - "functions": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "statements": { - "total": 19, - "covered": 13, - "skipped": 0, - "pct": 68.42 - }, - "branches": { - "total": 6, - "covered": 2, - "skipped": 0, - "pct": 33.33 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/gauge/vis.js": { - "lines": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 39, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/markdown/series.js": { - "lines": { - "total": 17, - "covered": 2, - "skipped": 0, - "pct": 11.76 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 2, - "skipped": 0, - "pct": 11.11 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/markdown/vis.js": { - "lines": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/metric/series.js": { - "lines": { - "total": 19, - "covered": 12, - "skipped": 0, - "pct": 63.16 - }, - "functions": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "statements": { - "total": 20, - "covered": 13, - "skipped": 0, - "pct": 65 - }, - "branches": { - "total": 8, - "covered": 3, - "skipped": 0, - "pct": 37.5 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/metric/vis.js": { - "lines": { - "total": 28, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/config.js": { - "lines": { - "total": 16, - "covered": 2, - "skipped": 0, - "pct": 12.5 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 16, - "covered": 2, - "skipped": 0, - "pct": 12.5 - }, - "branches": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/is_sortable.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/series.js": { - "lines": { - "total": 15, - "covered": 2, - "skipped": 0, - "pct": 13.33 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 16, - "covered": 2, - "skipped": 0, - "pct": 12.5 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/table/vis.js": { - "lines": { - "total": 75, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 79, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 58, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/timeseries/config.js": { - "lines": { - "total": 28, - "covered": 2, - "skipped": 0, - "pct": 7.14 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 28, - "covered": 2, - "skipped": 0, - "pct": 7.14 - }, - "branches": { - "total": 30, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/timeseries/series.js": { - "lines": { - "total": 19, - "covered": 3, - "skipped": 0, - "pct": 15.79 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 20, - "covered": 3, - "skipped": 0, - "pct": 15 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/timeseries/vis.js": { - "lines": { - "total": 80, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 84, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 48, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/top_n/series.js": { - "lines": { - "total": 16, - "covered": 2, - "skipped": 0, - "pct": 12.5 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 17, - "covered": 2, - "skipped": 0, - "pct": 11.76 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/components/vis_types/top_n/vis.js": { - "lines": { - "total": 35, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 38, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 23, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/contexts/form_validation_context.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/contexts/vis_data_context.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/lib/check_ui_restrictions.js": { - "lines": { - "total": 13, - "covered": 5, - "skipped": 0, - "pct": 38.46 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 13, - "covered": 5, - "skipped": 0, - "pct": 38.46 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/lib/create_brush_handler.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/lib/fetch_fields.js": { - "lines": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/lib/set_is_reversed.js": { - "lines": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/lib/validate_interval.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/constants/chart.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/constants/icons.js": { - "lines": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/constants/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/lib/active_cursor.js": { - "lines": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/lib/calc_dimensions.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/lib/calculate_coordinates.js": { - "lines": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/lib/get_value_by.js": { - "lines": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/annotation.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/gauge.js": { - "lines": { - "total": 35, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 35, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/gauge_vis.js": { - "lines": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/metric.js": { - "lines": { - "total": 41, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 46, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 40, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/top_n.js": { - "lines": { - "total": 48, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 16, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 49, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/timeseries/index.js": { - "lines": { - "total": 33, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 37, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/timeseries/decorators/area_decorator.js": { - "lines": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/timeseries/decorators/bar_decorator.js": { - "lines": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/timeseries/model/charts.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/timeseries/utils/series_styles.js": { - "lines": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 23, - "covered": 23, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_timeseries/public/visualizations/views/timeseries/utils/stack_format.js": { - "lines": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/vega_visualization.js": { - "lines": { - "total": 38, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 38, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/data_model/ems_file_parser.js": { - "lines": { - "total": 14, - "covered": 12, - "skipped": 0, - "pct": 85.71 - }, - "functions": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 16, - "covered": 13, - "skipped": 0, - "pct": 81.25 - }, - "branches": { - "total": 8, - "covered": 4, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/data_model/es_query_parser.js": { - "lines": { - "total": 142, - "covered": 115, - "skipped": 0, - "pct": 80.99 - }, - "functions": { - "total": 8, - "covered": 8, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 145, - "covered": 117, - "skipped": 0, - "pct": 80.69 - }, - "branches": { - "total": 104, - "covered": 75, - "skipped": 0, - "pct": 72.12 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/data_model/search_cache.js": { - "lines": { - "total": 11, - "covered": 11, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 11, - "covered": 11, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/data_model/time_cache.js": { - "lines": { - "total": 21, - "covered": 19, - "skipped": 0, - "pct": 90.48 - }, - "functions": { - "total": 5, - "covered": 3, - "skipped": 0, - "pct": 60 - }, - "statements": { - "total": 21, - "covered": 19, - "skipped": 0, - "pct": 90.48 - }, - "branches": { - "total": 12, - "covered": 11, - "skipped": 0, - "pct": 91.67 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/data_model/url_parser.js": { - "lines": { - "total": 9, - "covered": 1, - "skipped": 0, - "pct": 11.11 - }, - "functions": { - "total": 3, - "covered": 1, - "skipped": 0, - "pct": 33.33 - }, - "statements": { - "total": 9, - "covered": 1, - "skipped": 0, - "pct": 11.11 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/data_model/utils.js": { - "lines": { - "total": 11, - "covered": 2, - "skipped": 0, - "pct": 18.18 - }, - "functions": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - }, - "statements": { - "total": 11, - "covered": 2, - "skipped": 0, - "pct": 18.18 - }, - "branches": { - "total": 8, - "covered": 1, - "skipped": 0, - "pct": 12.5 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/data_model/vega_parser.js": { - "lines": { - "total": 209, - "covered": 154, - "skipped": 0, - "pct": 73.68 - }, - "functions": { - "total": 20, - "covered": 16, - "skipped": 0, - "pct": 80 - }, - "statements": { - "total": 214, - "covered": 156, - "skipped": 0, - "pct": 72.9 - }, - "branches": { - "total": 193, - "covered": 120, - "skipped": 0, - "pct": 62.18 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/vega_view/vega_base_view.js": { - "lines": { - "total": 145, - "covered": 7, - "skipped": 0, - "pct": 4.83 - }, - "functions": { - "total": 26, - "covered": 1, - "skipped": 0, - "pct": 3.85 - }, - "statements": { - "total": 150, - "covered": 7, - "skipped": 0, - "pct": 4.67 - }, - "branches": { - "total": 73, - "covered": 1, - "skipped": 0, - "pct": 1.37 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/vega_view/vega_map_layer.js": { - "lines": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/vega_view/vega_map_view.js": { - "lines": { - "total": 44, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 46, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/vega_view/vega_tooltip.js": { - "lines": { - "total": 24, - "covered": 1, - "skipped": 0, - "pct": 4.17 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 25, - "covered": 1, - "skipped": 0, - "pct": 4 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vega/public/vega_view/vega_view.js": { - "lines": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/response_handler.js": { - "lines": { - "total": 46, - "covered": 3, - "skipped": 0, - "pct": 6.52 - }, - "functions": { - "total": 7, - "covered": 1, - "skipped": 0, - "pct": 14.29 - }, - "statements": { - "total": 47, - "covered": 3, - "skipped": 0, - "pct": 6.38 - }, - "branches": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/vis.js": { - "lines": { - "total": 44, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 47, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 24, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/vislib.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/labels/data_array.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/labels/flatten_series.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/labels/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/labels/labels.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/labels/truncate_labels.js": { - "lines": { - "total": 6, - "covered": 1, - "skipped": 0, - "pct": 16.67 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 8, - "covered": 1, - "skipped": 0, - "pct": 12.5 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/labels/uniq_labels.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/tooltip/_collect_branch.js": { - "lines": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/tooltip/_hierarchical_tooltip_formatter.js": { - "lines": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/tooltip/_pointseries_tooltip_formatter.js": { - "lines": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 28, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/tooltip/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/tooltip/position_tooltip.js": { - "lines": { - "total": 69, - "covered": 8, - "skipped": 0, - "pct": 11.59 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 75, - "covered": 8, - "skipped": 0, - "pct": 10.67 - }, - "branches": { - "total": 46, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/tooltip/tooltip.js": { - "lines": { - "total": 86, - "covered": 11, - "skipped": 0, - "pct": 12.79 - }, - "functions": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 88, - "covered": 11, - "skipped": 0, - "pct": 12.5 - }, - "branches": { - "total": 42, - "covered": 3, - "skipped": 0, - "pct": 7.14 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/zero_injection/flatten_data.js": { - "lines": { - "total": 5, - "covered": 4, - "skipped": 0, - "pct": 80 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 4, - "skipped": 0, - "pct": 80 - }, - "branches": { - "total": 12, - "covered": 8, - "skipped": 0, - "pct": 66.67 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/zero_injection/inject_zeros.js": { - "lines": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/zero_injection/ordered_x_keys.js": { - "lines": { - "total": 26, - "covered": 11, - "skipped": 0, - "pct": 42.31 - }, - "functions": { - "total": 3, - "covered": 3, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 29, - "covered": 13, - "skipped": 0, - "pct": 44.83 - }, - "branches": { - "total": 19, - "covered": 11, - "skipped": 0, - "pct": 57.89 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/zero_injection/uniq_keys.js": { - "lines": { - "total": 23, - "covered": 20, - "skipped": 0, - "pct": 86.96 - }, - "functions": { - "total": 5, - "covered": 5, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 23, - "covered": 20, - "skipped": 0, - "pct": 86.96 - }, - "branches": { - "total": 12, - "covered": 6, - "skipped": 0, - "pct": 50 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/zero_injection/zero_fill_data_array.js": { - "lines": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 10, - "covered": 10, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/components/zero_injection/zero_filled_array.js": { - "lines": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 6, - "covered": 6, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/_data_label.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/_error_handler.js": { - "lines": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/alerts.js": { - "lines": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/chart_grid.js": { - "lines": { - "total": 39, - "covered": 1, - "skipped": 0, - "pct": 2.56 - }, - "functions": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 47, - "covered": 1, - "skipped": 0, - "pct": 2.13 - }, - "branches": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/chart_title.js": { - "lines": { - "total": 39, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 39, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/data.js": { - "lines": { - "total": 161, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 61, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 168, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 82, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/dispatch.js": { - "lines": { - "total": 141, - "covered": 26, - "skipped": 0, - "pct": 18.44 - }, - "functions": { - "total": 41, - "covered": 6, - "skipped": 0, - "pct": 14.63 - }, - "statements": { - "total": 149, - "covered": 28, - "skipped": 0, - "pct": 18.79 - }, - "branches": { - "total": 97, - "covered": 23, - "skipped": 0, - "pct": 23.71 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/handler.js": { - "lines": { - "total": 69, - "covered": 1, - "skipped": 0, - "pct": 1.45 - }, - "functions": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 71, - "covered": 1, - "skipped": 0, - "pct": 1.41 - }, - "branches": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/vis_config.js": { - "lines": { - "total": 11, - "covered": 1, - "skipped": 0, - "pct": 9.09 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 1, - "skipped": 0, - "pct": 9.09 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/axis.js": { - "lines": { - "total": 106, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 23, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 109, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 51, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/axis_config.js": { - "lines": { - "total": 84, - "covered": 7, - "skipped": 0, - "pct": 8.33 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 89, - "covered": 7, - "skipped": 0, - "pct": 7.87 - }, - "branches": { - "total": 66, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/axis_labels.js": { - "lines": { - "total": 72, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 17, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 77, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 36, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/axis_scale.js": { - "lines": { - "total": 118, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 134, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 97, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/axis_title.js": { - "lines": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 22, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/scale_modes.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/time_ticks.js": { - "lines": { - "total": 12, - "covered": 12, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 4, - "covered": 4, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 13, - "covered": 13, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 2, - "covered": 2, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/index.js": { - "lines": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/layout.js": { - "lines": { - "total": 54, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 9, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 54, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/layout_types.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/column_chart/chart_split.js": { - "lines": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 20, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/column_chart/chart_title_split.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/column_chart/x_axis_split.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/column_chart/y_axis_split.js": { - "lines": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 8, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/gauge_chart/chart_split.js": { - "lines": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/gauge_chart/chart_title_split.js": { - "lines": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/pie_chart/chart_split.js": { - "lines": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 5, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/splits/pie_chart/chart_title_split.js": { - "lines": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 10, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 6, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/types/column_layout.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/types/gauge_layout.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/layout/types/pie_layout.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 4, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/types/gauge.js": { - "lines": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/types/index.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/types/pie.js": { - "lines": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 1, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 3, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 2, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/types/point_series.js": { - "lines": { - "total": 70, - "covered": 57, - "skipped": 0, - "pct": 81.43 - }, - "functions": { - "total": 17, - "covered": 12, - "skipped": 0, - "pct": 70.59 - }, - "statements": { - "total": 73, - "covered": 58, - "skipped": 0, - "pct": 79.45 - }, - "branches": { - "total": 76, - "covered": 48, - "skipped": 0, - "pct": 63.16 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/_chart.js": { - "lines": { - "total": 29, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 32, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/gauge_chart.js": { - "lines": { - "total": 34, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 7, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 35, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 15, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/pie_chart.js": { - "lines": { - "total": 146, - "covered": 1, - "skipped": 0, - "pct": 0.68 - }, - "functions": { - "total": 31, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 153, - "covered": 1, - "skipped": 0, - "pct": 0.65 - }, - "branches": { - "total": 86, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/point_series.js": { - "lines": { - "total": 103, - "covered": 2, - "skipped": 0, - "pct": 1.94 - }, - "functions": { - "total": 23, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 108, - "covered": 2, - "skipped": 0, - "pct": 1.85 - }, - "branches": { - "total": 63, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/time_marker.js": { - "lines": { - "total": 18, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 12, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 14, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/vis_types.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/gauges/gauge_types.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/gauges/meter.js": { - "lines": { - "total": 132, - "covered": 3, - "skipped": 0, - "pct": 2.27 - }, - "functions": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 135, - "covered": 3, - "skipped": 0, - "pct": 2.22 - }, - "branches": { - "total": 57, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/point_series/_point_series.js": { - "lines": { - "total": 55, - "covered": 1, - "skipped": 0, - "pct": 1.82 - }, - "functions": { - "total": 11, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 61, - "covered": 1, - "skipped": 0, - "pct": 1.64 - }, - "branches": { - "total": 43, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/point_series/area_chart.js": { - "lines": { - "total": 94, - "covered": 1, - "skipped": 0, - "pct": 1.06 - }, - "functions": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 95, - "covered": 1, - "skipped": 0, - "pct": 1.05 - }, - "branches": { - "total": 38, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/point_series/column_chart.js": { - "lines": { - "total": 133, - "covered": 1, - "skipped": 0, - "pct": 0.75 - }, - "functions": { - "total": 30, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 137, - "covered": 1, - "skipped": 0, - "pct": 0.73 - }, - "branches": { - "total": 107, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/point_series/heatmap_chart.js": { - "lines": { - "total": 147, - "covered": 1, - "skipped": 0, - "pct": 0.68 - }, - "functions": { - "total": 21, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 153, - "covered": 1, - "skipped": 0, - "pct": 0.65 - }, - "branches": { - "total": 80, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/point_series/line_chart.js": { - "lines": { - "total": 77, - "covered": 1, - "skipped": 0, - "pct": 1.3 - }, - "functions": { - "total": 19, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 78, - "covered": 1, - "skipped": 0, - "pct": 1.28 - }, - "branches": { - "total": 51, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/vis_type_vislib/public/vislib/visualizations/point_series/series_types.js": { - "lines": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "functions": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "branches": { - "total": 0, - "covered": 0, - "skipped": 0, - "pct": 100 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/visualizations/public/np_ready/public/vis_impl.js": { - "lines": { - "total": 58, - "covered": 26, - "skipped": 0, - "pct": 44.83 - }, - "functions": { - "total": 24, - "covered": 7, - "skipped": 0, - "pct": 29.17 - }, - "statements": { - "total": 59, - "covered": 26, - "skipped": 0, - "pct": 44.07 - }, - "branches": { - "total": 48, - "covered": 19, - "skipped": 0, - "pct": 39.58 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/visualizations/public/np_ready/public/expressions/vis.js": { - "lines": { - "total": 33, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "functions": { - "total": 13, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "statements": { - "total": 35, - "covered": 0, - "skipped": 0, - "pct": 0 - }, - "branches": { - "total": 25, - "covered": 0, - "skipped": 0, - "pct": 0 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/visualizations/public/np_ready/public/legacy/calculate_object_hash.js": { - "lines": { - "total": 28, - "covered": 24, - "skipped": 0, - "pct": 85.71 - }, - "functions": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 28, - "covered": 24, - "skipped": 0, - "pct": 85.71 - }, - "branches": { - "total": 16, - "covered": 12, - "skipped": 0, - "pct": 75 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/visualizations/public/np_ready/public/legacy/vis_update.js": { - "lines": { - "total": 10, - "covered": 2, - "skipped": 0, - "pct": 20 - }, - "functions": { - "total": 1, - "covered": 1, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 12, - "covered": 3, - "skipped": 0, - "pct": 25 - }, - "branches": { - "total": 28, - "covered": 2, - "skipped": 0, - "pct": 7.14 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/visualizations/public/np_ready/public/legacy/vis_update_state.js": { - "lines": { - "total": 46, - "covered": 42, - "skipped": 0, - "pct": 91.3 - }, - "functions": { - "total": 7, - "covered": 7, - "skipped": 0, - "pct": 100 - }, - "statements": { - "total": 47, - "covered": 42, - "skipped": 0, - "pct": 89.36 - }, - "branches": { - "total": 38, - "covered": 28, - "skipped": 0, - "pct": 73.68 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/visualizations/public/np_ready/public/vis_types/base_vis_type.js": { - "lines": { - "total": 17, - "covered": 10, - "skipped": 0, - "pct": 58.82 - }, - "functions": { - "total": 3, - "covered": 2, - "skipped": 0, - "pct": 66.67 - }, - "statements": { - "total": 17, - "covered": 10, - "skipped": 0, - "pct": 58.82 - }, - "branches": { - "total": 17, - "covered": 9, - "skipped": 0, - "pct": 52.94 - } - }, - "/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/src/legacy/core_plugins/visualizations/public/np_ready/public/vis_types/react_vis_type.js": { - "lines": { - "total": 12, - "covered": 10, - "skipped": 0, - "pct": 83.33 - }, - "functions": { - "total": 5, - "covered": 4, - "skipped": 0, - "pct": 80 - }, - "statements": { - "total": 12, - "covered": 10, - "skipped": 0, - "pct": 83.33 - }, - "branches": { - "total": 2, - "covered": 1, - "skipped": 0, - "pct": 50 - } - } -} diff --git a/src/dev/code_coverage/ingest_coverage/transforms.js b/src/dev/code_coverage/ingest_coverage/transforms.js index 0f6b34a39c64a..d5a4d8933e36b 100644 --- a/src/dev/code_coverage/ingest_coverage/transforms.js +++ b/src/dev/code_coverage/ingest_coverage/transforms.js @@ -33,10 +33,7 @@ export const statsAndstaticSiteUrl = (...xs) => { }; }; -export const addJsonSummaryPath = jsonSummaryPath => obj => ({ - jsonSummaryPath: trimLeftFrom('target', jsonSummaryPath), - ...obj, -}); +export const addJsonSummaryPath = jsonSummaryPath => obj => ({ jsonSummaryPath, ...obj }); export const truncate = text => obj => { const { staticSiteUrl } = obj; diff --git a/src/plugins/data/public/search/aggs/buckets/_interval_options.ts b/src/plugins/data/public/search/aggs/buckets/_interval_options.ts index 1c4c04c40a5c1..00cf50c272fa0 100644 --- a/src/plugins/data/public/search/aggs/buckets/_interval_options.ts +++ b/src/plugins/data/public/search/aggs/buckets/_interval_options.ts @@ -52,31 +52,31 @@ export const intervalOptions = [ }, { display: i18n.translate('data.search.aggs.buckets.intervalOptions.hourlyDisplayName', { - defaultMessage: 'Hourly', + defaultMessage: 'Hour', }), val: 'h', }, { display: i18n.translate('data.search.aggs.buckets.intervalOptions.dailyDisplayName', { - defaultMessage: 'Daily', + defaultMessage: 'Day', }), val: 'd', }, { display: i18n.translate('data.search.aggs.buckets.intervalOptions.weeklyDisplayName', { - defaultMessage: 'Weekly', + defaultMessage: 'Week', }), val: 'w', }, { display: i18n.translate('data.search.aggs.buckets.intervalOptions.monthlyDisplayName', { - defaultMessage: 'Monthly', + defaultMessage: 'Month', }), val: 'M', }, { display: i18n.translate('data.search.aggs.buckets.intervalOptions.yearlyDisplayName', { - defaultMessage: 'Yearly', + defaultMessage: 'Year', }), val: 'y', }, diff --git a/src/plugins/data/public/search/aggs/metrics/avg.ts b/src/plugins/data/public/search/aggs/metrics/avg.ts index 96be3e849a3e8..dba18d562ec19 100644 --- a/src/plugins/data/public/search/aggs/metrics/avg.ts +++ b/src/plugins/data/public/search/aggs/metrics/avg.ts @@ -51,7 +51,7 @@ export const getAvgMetricAgg = ({ getInternalStartServices }: AvgMetricAggDepend { name: 'field', type: 'field', - filterFieldTypes: KBN_FIELD_TYPES.NUMBER, + filterFieldTypes: [KBN_FIELD_TYPES.NUMBER, KBN_FIELD_TYPES.HISTOGRAM], }, ], }, diff --git a/src/plugins/data/public/search/aggs/metrics/sum.ts b/src/plugins/data/public/search/aggs/metrics/sum.ts index 70fc379f2d5f1..66fad89316613 100644 --- a/src/plugins/data/public/search/aggs/metrics/sum.ts +++ b/src/plugins/data/public/search/aggs/metrics/sum.ts @@ -54,7 +54,7 @@ export const getSumMetricAgg = ({ getInternalStartServices }: SumMetricAggDepend { name: 'field', type: 'field', - filterFieldTypes: KBN_FIELD_TYPES.NUMBER, + filterFieldTypes: [KBN_FIELD_TYPES.NUMBER, KBN_FIELD_TYPES.HISTOGRAM], }, ], }, diff --git a/src/plugins/discover/public/application/angular/discover.html b/src/plugins/discover/public/application/angular/discover.html index a0f98ea38ef78..d70d5dad9130b 100644 --- a/src/plugins/discover/public/application/angular/discover.html +++ b/src/plugins/discover/public/application/angular/discover.html @@ -101,45 +101,17 @@

{{screenTitle}}

class="dscTimechart" ng-if="opts.timefield" > -
-
- - - — - - - - - - - - -
- -
+ + { if (abortController) abortController.abort(); @@ -614,24 +610,6 @@ function discoverController( $scope.state.index = $scope.indexPattern.id; $scope.state.sort = getSortArray($scope.state.sort, $scope.indexPattern); - $scope.getBucketIntervalToolTipText = () => { - return i18n.translate('discover.bucketIntervalTooltip', { - defaultMessage: - 'This interval creates {bucketsDescription} to show in the selected time range, so it has been scaled to {bucketIntervalDescription}', - values: { - bucketsDescription: - $scope.bucketInterval.scale > 1 - ? i18n.translate('discover.bucketIntervalTooltip.tooLargeBucketsText', { - defaultMessage: 'buckets that are too large', - }) - : i18n.translate('discover.bucketIntervalTooltip.tooManyBucketsText', { - defaultMessage: 'too many buckets', - }), - bucketIntervalDescription: $scope.bucketInterval.description, - }, - }); - }; - $scope.opts = { // number of records to fetch, then paginate through sampleSize: config.get(SAMPLE_SIZE_SETTING), @@ -681,12 +659,12 @@ function discoverController( error => addFatalError(core.fatalErrors, error) ) ); - //Handling change oft the histogram interval - $scope.$watch('state.interval', function(newInterval, oldInterval) { - if (newInterval !== oldInterval) { - setAppState({ interval: newInterval }); + + $scope.changeInterval = interval => { + if (interval) { + setAppState({ interval }); } - }); + }; $scope.$watchMulti( ['rows', 'fetchStatus'], @@ -939,6 +917,7 @@ function discoverController( $scope.resetQuery = function() { history.push(`/${encodeURIComponent($route.current.params.id)}`); + $route.reload(); }; $scope.newQuery = function() { diff --git a/src/plugins/discover/public/application/components/timechart_header/index.ts b/src/plugins/discover/public/application/components/timechart_header/index.ts new file mode 100644 index 0000000000000..43473319c318c --- /dev/null +++ b/src/plugins/discover/public/application/components/timechart_header/index.ts @@ -0,0 +1,21 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export { TimechartHeader } from './timechart_header'; +export { createTimechartHeaderDirective } from './timechart_header_directive'; diff --git a/src/plugins/discover/public/application/components/timechart_header/timechart_header.test.tsx b/src/plugins/discover/public/application/components/timechart_header/timechart_header.test.tsx new file mode 100644 index 0000000000000..642774d6be202 --- /dev/null +++ b/src/plugins/discover/public/application/components/timechart_header/timechart_header.test.tsx @@ -0,0 +1,95 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import React from 'react'; +import { mountWithIntl } from 'test_utils/enzyme_helpers'; +import { ReactWrapper } from 'enzyme'; +import { TimechartHeader, TimechartHeaderProps } from './timechart_header'; +import { EuiIconTip } from '@elastic/eui'; +// @ts-ignore +import { findTestSubject } from '@elastic/eui/lib/test'; + +describe('timechart header', function() { + let props: TimechartHeaderProps; + let component: ReactWrapper; + + beforeAll(() => { + props = { + from: 'May 14, 2020 @ 11:05:13.590', + to: 'May 14, 2020 @ 11:20:13.590', + stateInterval: 's', + options: [ + { + display: 'Auto', + val: 'auto', + }, + { + display: 'Millisecond', + val: 'ms', + }, + { + display: 'Second', + val: 's', + }, + ], + onChangeInterval: jest.fn(), + showScaledInfo: undefined, + bucketIntervalDescription: 'second', + bucketIntervalScale: undefined, + }; + }); + + it('TimechartHeader not renders an info text when the showScaledInfo property is not provided', () => { + component = mountWithIntl(); + expect(component.find(EuiIconTip).length).toBe(0); + }); + + it('TimechartHeader renders an info text by providing the showScaledInfo property', () => { + props.showScaledInfo = true; + component = mountWithIntl(); + expect(component.find(EuiIconTip).length).toBe(1); + }); + + it('expect to render the date range', function() { + component = mountWithIntl(); + const datetimeRangeText = findTestSubject(component, 'discoverIntervalDateRange'); + expect(datetimeRangeText.text()).toBe( + 'May 14, 2020 @ 11:05:13.590 - May 14, 2020 @ 11:20:13.590 per' + ); + }); + + it('expects to render a dropdown with the interval options', () => { + component = mountWithIntl(); + const dropdown = findTestSubject(component, 'discoverIntervalSelect'); + expect(dropdown.length).toBe(1); + // @ts-ignore + const values = dropdown.find('option').map(option => option.prop('value')); + expect(values).toEqual(['auto', 'ms', 's']); + // @ts-ignore + const labels = dropdown.find('option').map(option => option.text()); + expect(labels).toEqual(['Auto', 'Millisecond', 'Second']); + }); + + it('should change the interval', function() { + component = mountWithIntl(); + findTestSubject(component, 'discoverIntervalSelect').simulate('change', { + target: { value: 'ms' }, + }); + expect(props.onChangeInterval).toHaveBeenCalled(); + }); +}); diff --git a/src/plugins/discover/public/application/components/timechart_header/timechart_header.tsx b/src/plugins/discover/public/application/components/timechart_header/timechart_header.tsx new file mode 100644 index 0000000000000..077adcb6b006e --- /dev/null +++ b/src/plugins/discover/public/application/components/timechart_header/timechart_header.tsx @@ -0,0 +1,159 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import React, { useState, useEffect } from 'react'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiToolTip, + EuiText, + EuiSelect, + EuiIconTip, +} from '@elastic/eui'; +import { I18nProvider } from '@kbn/i18n/react'; +import { i18n } from '@kbn/i18n'; + +export interface TimechartHeaderProps { + /** + * the query from date string + */ + from: string; + /** + * the query to date string + */ + to: string; + /** + * Interval Options + */ + options: Array<{ display: string; val: string }>; + /** + * changes the interval + */ + onChangeInterval: (interval: string) => void; + /** + * selected interval + */ + stateInterval: string; + /** + * displays the scaled info of the interval + */ + showScaledInfo: boolean | undefined; + /** + * scaled info description + */ + bucketIntervalDescription: string; + /** + * bucket interval scale + */ + bucketIntervalScale: number | undefined; +} + +export function TimechartHeader({ + from, + to, + options, + onChangeInterval, + stateInterval, + showScaledInfo, + bucketIntervalDescription, + bucketIntervalScale, +}: TimechartHeaderProps) { + const [interval, setInterval] = useState(stateInterval); + + useEffect(() => { + setInterval(stateInterval); + }, [stateInterval]); + + const handleIntervalChange = (e: React.ChangeEvent) => { + setInterval(e.target.value); + onChangeInterval(e.target.value); + }; + + return ( + + + + + + {`${from} - ${to} ${ + interval !== 'auto' + ? i18n.translate('discover.timechartHeader.timeIntervalSelect.per', { + defaultMessage: 'per', + }) + : '' + }`} + + + + + val !== 'custom') + .map(({ display, val }) => { + return { + text: display, + value: val, + label: display, + }; + })} + value={interval} + onChange={handleIntervalChange} + append={ + showScaledInfo ? ( + 1 + ? i18n.translate('discover.bucketIntervalTooltip.tooLargeBucketsText', { + defaultMessage: 'buckets that are too large', + }) + : i18n.translate('discover.bucketIntervalTooltip.tooManyBucketsText', { + defaultMessage: 'too many buckets', + }), + bucketIntervalDescription, + }, + })} + color="warning" + size="s" + type="alert" + /> + ) : ( + undefined + ) + } + /> + + + + ); +} diff --git a/src/plugins/discover/public/application/components/timechart_header/timechart_header_directive.ts b/src/plugins/discover/public/application/components/timechart_header/timechart_header_directive.ts new file mode 100644 index 0000000000000..027236cd46521 --- /dev/null +++ b/src/plugins/discover/public/application/components/timechart_header/timechart_header_directive.ts @@ -0,0 +1,32 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { TimechartHeader } from './timechart_header'; + +export function createTimechartHeaderDirective(reactDirective: any) { + return reactDirective(TimechartHeader, [ + ['from', { watchDepth: 'reference' }], + ['to', { watchDepth: 'reference' }], + ['options', { watchDepth: 'reference' }], + ['onChangeInterval', { watchDepth: 'reference' }], + ['stateInterval', { watchDepth: 'reference' }], + ['showScaledInfo', { watchDepth: 'reference' }], + ['bucketIntervalDescription', { watchDepth: 'reference' }], + ['bucketIntervalScale', { watchDepth: 'reference' }], + ]); +} diff --git a/src/plugins/discover/public/get_inner_angular.ts b/src/plugins/discover/public/get_inner_angular.ts index 1389ac74b84b4..d97bbef7aca25 100644 --- a/src/plugins/discover/public/get_inner_angular.ts +++ b/src/plugins/discover/public/get_inner_angular.ts @@ -59,6 +59,7 @@ import { } from '../../kibana_legacy/public'; import { createDiscoverSidebarDirective } from './application/components/sidebar'; import { createHitsCounterDirective } from '././application/components/hits_counter'; +import { createTimechartHeaderDirective } from './application/components/timechart_header'; import { DiscoverStartPlugins } from './plugin'; import { getScopedHistory } from './kibana_services'; @@ -154,6 +155,7 @@ export function initializeInnerAngularModule( .directive('renderComplete', createRenderCompleteDirective) .directive('discoverSidebar', createDiscoverSidebarDirective) .directive('hitsCounter', createHitsCounterDirective) + .directive('timechartHeader', createTimechartHeaderDirective) .service('debounce', ['$timeout', DebounceProviderTimeout]); } diff --git a/src/plugins/share/public/components/__snapshots__/url_panel_content.test.tsx.snap b/src/plugins/share/public/components/__snapshots__/url_panel_content.test.tsx.snap index c10ca55130880..8787e0c027375 100644 --- a/src/plugins/share/public/components/__snapshots__/url_panel_content.test.tsx.snap +++ b/src/plugins/share/public/components/__snapshots__/url_panel_content.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`render 1`] = ` +exports[`share url panel content render 1`] = ` `; -exports[`should enable saved object export option when objectId is provided 1`] = ` +exports[`share url panel content should enable saved object export option when objectId is provided 1`] = ` `; -exports[`should hide short url section when allowShortUrl is false 1`] = ` +exports[`share url panel content should hide short url section when allowShortUrl is false 1`] = ` ({})); +import { EuiCopy, EuiRadioGroup, EuiSwitch, EuiSwitchEvent } from '@elastic/eui'; + +jest.mock('../lib/url_shortener', () => ({ shortenUrl: jest.fn() })); import React from 'react'; import { shallow } from 'enzyme'; -import { UrlPanelContent } from './url_panel_content'; +import { ExportUrlAsType, UrlPanelContent } from './url_panel_content'; +import { act } from 'react-dom/test-utils'; +import { shortenUrl } from '../lib/url_shortener'; const defaultProps = { allowShortUrl: true, @@ -31,19 +35,170 @@ const defaultProps = { post: () => Promise.resolve({} as any), }; -test('render', () => { - const component = shallow(); - expect(component).toMatchSnapshot(); -}); +describe('share url panel content', () => { + test('render', () => { + const component = shallow(); + expect(component).toMatchSnapshot(); + }); -test('should enable saved object export option when objectId is provided', () => { - const component = shallow(); - expect(component).toMatchSnapshot(); -}); + test('should enable saved object export option when objectId is provided', () => { + const component = shallow(); + expect(component).toMatchSnapshot(); + }); + + test('should hide short url section when allowShortUrl is false', () => { + const component = shallow( + + ); + expect(component).toMatchSnapshot(); + }); + + test('should remove _a query parameter in saved object mode', () => { + const component = shallow( + + ); + act(() => { + component.find(EuiRadioGroup).prop('onChange')!(ExportUrlAsType.EXPORT_URL_AS_SAVED_OBJECT); + }); + expect(component.find(EuiCopy).prop('textToCopy')).toEqual( + 'http://localhost:5601/app/myapp#/?_g=()' + ); + }); + + describe('short url', () => { + test('should generate short url and put it in copy button', async () => { + const shortenUrlMock = shortenUrl as jest.Mock; + shortenUrlMock.mockReset(); + shortenUrlMock.mockResolvedValue('http://localhost/short/url'); + + const component = shallow( + + ); + await act(async () => { + component.find(EuiSwitch).prop('onChange')!(({ + target: { checked: true }, + } as unknown) as EuiSwitchEvent); + }); + expect(shortenUrlMock).toHaveBeenCalledWith( + 'http://localhost:5601/app/myapp#/?_g=()&_a=()', + expect.anything() + ); + expect(component.find(EuiCopy).prop('textToCopy')).toContain('http://localhost/short/url'); + }); + + test('should hide short url for saved object mode', async () => { + const component = shallow( + + ); + act(() => { + component.find(EuiRadioGroup).prop('onChange')!(ExportUrlAsType.EXPORT_URL_AS_SAVED_OBJECT); + }); + expect(component.exists(EuiSwitch)).toEqual(false); + }); + }); + + describe('embedded', () => { + const asIframe = (url: string) => ``; + + test('should add embedded flag to target code in snapshot mode', () => { + const component = shallow( + + ); + expect(component.find(EuiCopy).prop('textToCopy')).toEqual( + asIframe('http://localhost:5601/app/myapp#/?embed=true') + ); + }); + + test('should add embedded flag to target code in snapshot mode with existing query parameters', () => { + const component = shallow( + + ); + expect(component.find(EuiCopy).prop('textToCopy')).toEqual( + asIframe('http://localhost:5601/app/myapp#/?embed=true&_g=()&_a=()') + ); + }); + + test('should remove _a query parameter and add embedded flag in saved object mode', () => { + const component = shallow( + + ); + act(() => { + component.find(EuiRadioGroup).prop('onChange')!(ExportUrlAsType.EXPORT_URL_AS_SAVED_OBJECT); + }); + expect(component.find(EuiCopy).prop('textToCopy')).toEqual( + asIframe('http://localhost:5601/app/myapp#/?embed=true&_g=()') + ); + }); + + test('should generate short url with embed flag and put it in copy button', async () => { + const shortenUrlMock = shortenUrl as jest.Mock; + shortenUrlMock.mockReset(); + shortenUrlMock.mockResolvedValue('http://localhost/short/url'); + + const component = shallow( + + ); + await act(async () => { + component.find(EuiSwitch).prop('onChange')!(({ + target: { checked: true }, + } as unknown) as EuiSwitchEvent); + }); + expect(shortenUrlMock).toHaveBeenCalledWith( + 'http://localhost:5601/app/myapp#/?embed=true&_g=()&_a=()', + expect.anything() + ); + expect(component.find(EuiCopy).prop('textToCopy')).toContain('http://localhost/short/url'); + }); -test('should hide short url section when allowShortUrl is false', () => { - const component = shallow( - - ); - expect(component).toMatchSnapshot(); + test('should hide short url for saved object mode', async () => { + const component = shallow( + + ); + act(() => { + component.find(EuiRadioGroup).prop('onChange')!(ExportUrlAsType.EXPORT_URL_AS_SAVED_OBJECT); + }); + expect(component.exists(EuiSwitch)).toEqual(false); + }); + }); }); diff --git a/src/plugins/share/public/components/url_panel_content.tsx b/src/plugins/share/public/components/url_panel_content.tsx index 2b1159be89003..804b606696a83 100644 --- a/src/plugins/share/public/components/url_panel_content.tsx +++ b/src/plugins/share/public/components/url_panel_content.tsx @@ -52,7 +52,7 @@ interface Props { post: HttpStart['post']; } -enum ExportUrlAsType { +export enum ExportUrlAsType { EXPORT_URL_AS_SAVED_OBJECT = 'savedObject', EXPORT_URL_AS_SNAPSHOT = 'snapshot', } @@ -181,7 +181,7 @@ export class UrlPanelContent extends Component { }), }); if (this.props.isEmbedded) { - formattedUrl = this.makeUrlEmbeddable(url); + formattedUrl = this.makeUrlEmbeddable(formattedUrl); } return formattedUrl; diff --git a/src/plugins/vis_type_vislib/public/components/options/point_series/point_series.tsx b/src/plugins/vis_type_vislib/public/components/options/point_series/point_series.tsx index 60458b1f5c41f..dfe469bc9843b 100644 --- a/src/plugins/vis_type_vislib/public/components/options/point_series/point_series.tsx +++ b/src/plugins/vis_type_vislib/public/components/options/point_series/point_series.tsx @@ -26,6 +26,7 @@ import { BasicOptions, SwitchOption } from '../../../../../charts/public'; import { GridPanel } from './grid_panel'; import { ThresholdPanel } from './threshold_panel'; import { BasicVislibParams } from '../../../types'; +import { ChartTypes } from '../../../utils/collections'; function PointSeriesOptions(props: ValidationVisOptionsProps) { const { stateParams, setValue, vis } = props; @@ -67,8 +68,9 @@ function PointSeriesOptions(props: ValidationVisOptionsProps) /> )} - {vis.type.type === 'histogram' && ( + {vis.type.name === ChartTypes.HISTOGRAM && ( { + describe('Discover', () => { before(async () => { await esArchiver.load('discover'); await esArchiver.loadIfNeeded('logstash_functional'); @@ -133,7 +133,14 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { // Context view test it('should open context view on a doc', async () => { await docTable.clickRowToggle(); - await (await docTable.getRowActions())[0].click(); + // click the open action + await retry.try(async () => { + const rowActions = await docTable.getRowActions(); + if (!rowActions.length) { + throw new Error('row actions empty, trying again'); + } + await rowActions[0].click(); + }); await a11y.testAppSnapshot(); }); diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js index 1f9a896ea8c7f..cca562d7f2fcd 100644 --- a/test/functional/apps/discover/_discover.js +++ b/test/functional/apps/discover/_discover.js @@ -126,6 +126,23 @@ export default function({ getService, getPageObjects }) { const isVisible = await PageObjects.discover.hasNoResults(); expect(isVisible).to.be(false); }); + + it('should reload the saved search with persisted query to show the initial hit count', async function() { + // apply query some changes + await queryBar.setQuery('test'); + await queryBar.submitQuery(); + await retry.try(async function() { + expect(await PageObjects.discover.getHitCount()).to.be('22'); + }); + + // reset to persisted state + await PageObjects.discover.clickResetSavedSearchButton(); + const expectedHitCount = '14,004'; + await retry.try(async function() { + expect(await queryBar.getQueryString()).to.be(''); + expect(await PageObjects.discover.getHitCount()).to.be(expectedHitCount); + }); + }); }); describe('query #2, which has an empty time range', () => { diff --git a/test/functional/apps/discover/_discover_histogram.js b/test/functional/apps/discover/_discover_histogram.js index 0f63510dce431..6f6dfa66f825f 100644 --- a/test/functional/apps/discover/_discover_histogram.js +++ b/test/functional/apps/discover/_discover_histogram.js @@ -69,7 +69,7 @@ export default function({ getService, getPageObjects }) { const fromTime = 'Nov 01, 2017 @ 00:00:00.000'; const toTime = 'Mar 21, 2018 @ 00:00:00.000'; await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - await PageObjects.discover.setChartInterval('Monthly'); + await PageObjects.discover.setChartInterval('Month'); await PageObjects.header.waitUntilLoadingHasFinished(); const chartCanvasExist = await elasticChart.canvasExists(); expect(chartCanvasExist).to.be(true); @@ -78,7 +78,7 @@ export default function({ getService, getPageObjects }) { const fromTime = 'Mar 01, 2018 @ 00:00:00.000'; const toTime = 'May 01, 2018 @ 00:00:00.000'; await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - await PageObjects.discover.setChartInterval('Weekly'); + await PageObjects.discover.setChartInterval('Week'); await PageObjects.header.waitUntilLoadingHasFinished(); const chartCanvasExist = await elasticChart.canvasExists(); expect(chartCanvasExist).to.be(true); @@ -88,12 +88,12 @@ export default function({ getService, getPageObjects }) { const toTime = 'Mar 21, 2019 @ 00:00:00.000'; await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime); - await PageObjects.discover.setChartInterval('Daily'); + await PageObjects.discover.setChartInterval('Day'); await PageObjects.header.waitUntilLoadingHasFinished(); const chartCanvasExist = await elasticChart.canvasExists(); expect(chartCanvasExist).to.be(true); - const chartIntervalScaledDesc = await PageObjects.discover.getChartIntervalScaledToDesc(); - expect(chartIntervalScaledDesc).to.be('Scaled to 30 days'); + const chartIntervalIconTip = await PageObjects.discover.getChartIntervalWarningIcon(); + expect(chartIntervalIconTip).to.be(true); }); }); } diff --git a/test/functional/apps/visualize/_area_chart.js b/test/functional/apps/visualize/_area_chart.js index 88a1fa3f7fa7f..b612a19e235bd 100644 --- a/test/functional/apps/visualize/_area_chart.js +++ b/test/functional/apps/visualize/_area_chart.js @@ -70,6 +70,10 @@ export default function({ getService, getPageObjects }) { await initAreaChart(); }); + after(async function() { + await security.testUser.restoreDefaults(); + }); + it('should save and load with special characters', async function() { const vizNamewithSpecialChars = vizName1 + '/?&=%'; await PageObjects.visualize.saveVisualizationExpectSuccessAndBreadcrumb( @@ -296,7 +300,6 @@ export default function({ getService, getPageObjects }) { .pop() .replace('embed=true', ''); await PageObjects.common.navigateToUrl('visualize', embedUrl, { useActualUrl: true }); - await security.testUser.restoreDefaults(); }); }); @@ -435,7 +438,7 @@ export default function({ getService, getPageObjects }) { log.debug('Click Date Histogram'); await PageObjects.visEditor.selectAggregation('Date Histogram'); await PageObjects.visEditor.selectField('@timestamp'); - await PageObjects.visEditor.setInterval('Yearly'); + await PageObjects.visEditor.setInterval('Year'); await PageObjects.visEditor.clickGo(); // This svg area is composed by 7 years (2013 - 2019). // 7 points are used to draw the upper line (usually called y1) @@ -458,7 +461,7 @@ export default function({ getService, getPageObjects }) { log.debug('Click Date Histogram'); await PageObjects.visEditor.selectAggregation('Date Histogram'); await PageObjects.visEditor.selectField('@timestamp'); - await PageObjects.visEditor.setInterval('Monthly'); + await PageObjects.visEditor.setInterval('Month'); await PageObjects.visEditor.clickGo(); // This svg area is composed by 67 months 3 (2013) + 5 * 12 + 4 (2019) // 67 points are used to draw the upper line (usually called y1) diff --git a/test/functional/apps/visualize/_data_table.js b/test/functional/apps/visualize/_data_table.js index d0136677bb4de..ec0d2f0579ccc 100644 --- a/test/functional/apps/visualize/_data_table.js +++ b/test/functional/apps/visualize/_data_table.js @@ -174,7 +174,7 @@ export default function({ getService, getPageObjects }) { await PageObjects.visEditor.clickBucket('Split rows'); await PageObjects.visEditor.selectAggregation('Date Histogram'); await PageObjects.visEditor.selectField('@timestamp'); - await PageObjects.visEditor.setInterval('Daily'); + await PageObjects.visEditor.setInterval('Day'); await PageObjects.visEditor.clickGo(); const data = await PageObjects.visChart.getTableVisData(); log.debug(data.split('\n')); @@ -196,7 +196,7 @@ export default function({ getService, getPageObjects }) { await PageObjects.visEditor.clickBucket('Split rows'); await PageObjects.visEditor.selectAggregation('Date Histogram'); await PageObjects.visEditor.selectField('@timestamp'); - await PageObjects.visEditor.setInterval('Daily'); + await PageObjects.visEditor.setInterval('Day'); await PageObjects.visEditor.clickGo(); const data = await PageObjects.visChart.getTableVisData(); expect(data.trim().split('\n')).to.be.eql([ diff --git a/test/functional/apps/visualize/_point_series_options.js b/test/functional/apps/visualize/_point_series_options.js index cc25d10cf3257..b31e39849d9ba 100644 --- a/test/functional/apps/visualize/_point_series_options.js +++ b/test/functional/apps/visualize/_point_series_options.js @@ -190,6 +190,38 @@ export default function({ getService, getPageObjects }) { }); }); + describe('show values on chart', () => { + before(async () => { + await PageObjects.visualize.navigateToNewVisualization(); + await PageObjects.visualize.clickVerticalBarChart(); + await PageObjects.visualize.clickNewSearch(); + await PageObjects.timePicker.setDefaultAbsoluteRange(); + log.debug('Bucket = X-axis'); + await PageObjects.visEditor.clickBucket('X-axis'); + log.debug('Aggregation = Terms'); + await PageObjects.visEditor.selectAggregation('Terms'); + log.debug('Field = geo.src'); + await PageObjects.visEditor.selectField('geo.src'); + await PageObjects.visEditor.clickGo(); + log.debug('Open Options tab'); + await PageObjects.visEditor.clickOptionsTab(); + }); + + it('should show values on bar chart', async () => { + await PageObjects.visEditor.toggleValuesOnChart(); + await PageObjects.visEditor.clickGo(); + const values = await PageObjects.visChart.getChartValues(); + expect(values).to.eql(['2,592', '2,373', '1,194', '489', '415']); + }); + + it('should hide values on bar chart', async () => { + await PageObjects.visEditor.toggleValuesOnChart(); + await PageObjects.visEditor.clickGo(); + const values = await PageObjects.visChart.getChartValues(); + expect(values.length).to.be(0); + }); + }); + describe('custom labels and axis titles', function() { const visName = 'Visualization Point Series Test'; const customLabel = 'myLabel'; diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index e43a774940391..831c76dd8fe46 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -36,7 +36,7 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider class DiscoverPage { public async getChartTimespan() { - const el = await find.byCssSelector('.small > label[for="dscResultsIntervalSelector"]'); + const el = await find.byCssSelector('[data-test-subj="discoverIntervalDateRange"]'); return await el.getVisibleText(); } @@ -129,6 +129,12 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider await testSubjects.click('discoverOpenButton'); } + public async clickResetSavedSearchButton() { + await testSubjects.moveMouseTo('resetSavedSearch'); + await testSubjects.click('resetSavedSearch'); + await header.waitUntilLoadingHasFinished(); + } + public async closeLoadSavedSearchPanel() { await testSubjects.click('euiFlyoutCloseButton'); } @@ -162,9 +168,9 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider return selectedOption.getVisibleText(); } - public async getChartIntervalScaledToDesc() { + public async getChartIntervalWarningIcon() { await header.waitUntilLoadingHasFinished(); - return await testSubjects.getVisibleText('discoverIntervalSelectScaledToDesc'); + return await find.existsByCssSelector('.euiToolTipAnchor'); } public async setChartInterval(interval: string) { diff --git a/test/functional/page_objects/visualize_chart_page.ts b/test/functional/page_objects/visualize_chart_page.ts index 71e722a9c8fdd..31e18adad7589 100644 --- a/test/functional/page_objects/visualize_chart_page.ts +++ b/test/functional/page_objects/visualize_chart_page.ts @@ -312,6 +312,7 @@ export function VisualizeChartPageProvider({ getService, getPageObjects }: FtrPr /** * If you are writing new tests, you should rather look into getTableVisContent method instead. + * @deprecated Use getTableVisContent instead. */ public async getTableVisData() { return await testSubjects.getVisibleText('paginated-table-body'); @@ -407,6 +408,17 @@ export function VisualizeChartPageProvider({ getService, getPageObjects }: FtrPr }; }); } + + public async getChartValues() { + const elements = await find.allByCssSelector('.series.histogram text'); + const values = await Promise.all( + elements.map(async element => { + const text = await element.getVisibleText(); + return text; + }) + ); + return values; + } } return new VisualizeChart(); diff --git a/test/functional/page_objects/visualize_editor_page.ts b/test/functional/page_objects/visualize_editor_page.ts index 8b0ec3ba26028..43323d37ffb6a 100644 --- a/test/functional/page_objects/visualize_editor_page.ts +++ b/test/functional/page_objects/visualize_editor_page.ts @@ -502,6 +502,10 @@ export function VisualizeEditorPageProvider({ getService, getPageObjects }: FtrP return await testSubjects.click('showCategoryLines'); } + public async toggleValuesOnChart() { + return await testSubjects.click('showValuesOnChart'); + } + public async setGridValueAxis(axis: string) { log.debug(`setGridValueAxis(${axis})`); await find.selectValue('select#gridAxis', axis); diff --git a/vars/slackNotifications.groovy b/vars/slackNotifications.groovy index 5092f631e7b39..0eea6640d0831 100644 --- a/vars/slackNotifications.groovy +++ b/vars/slackNotifications.groovy @@ -62,7 +62,7 @@ def getTestFailures() { def messages = [] messages << "*Test Failures*" - def list = failures.collect { "• <${it.url}|${it.fullDisplayName.split('.', 2)[-1]}>" }.join("\n") + def list = failures.collect { "• <${it.url}|${it.fullDisplayName.split(/\./, 2)[-1]}>" }.join("\n") return "*Test Failures*\n${list}" } diff --git a/x-pack/plugins/apm/server/tutorial/instructions/apm_agent_instructions.ts b/x-pack/plugins/apm/server/tutorial/instructions/apm_agent_instructions.ts index 9695c331e0504..799c12517b7c0 100644 --- a/x-pack/plugins/apm/server/tutorial/instructions/apm_agent_instructions.ts +++ b/x-pack/plugins/apm/server/tutorial/instructions/apm_agent_instructions.ts @@ -507,7 +507,7 @@ var apm = initApm({curlyOpen} See the [integration documentation]({docLink}) for more information.', values: { docLink: - '{config.docs.base_url}guide/en/apm/agent/rum-js/{config.docs.version}/framework-integrations.html' + '{config.docs.base_url}guide/en/apm/agent/rum-js/current/framework-integrations.html' } } ) diff --git a/x-pack/plugins/canvas/public/style/hackery.scss b/x-pack/plugins/canvas/public/style/hackery.scss index 7c8a63a851592..a29e9846f8d43 100644 --- a/x-pack/plugins/canvas/public/style/hackery.scss +++ b/x-pack/plugins/canvas/public/style/hackery.scss @@ -3,7 +3,7 @@ when the UI framework implements everything we need */ -#canvas-app { // sass-lint:disable-line no-ids +.canvasContainerWrapper { // Give buttons some room to the right .euiAccordion__childWrapper { overflow-x: hidden; diff --git a/x-pack/plugins/endpoint/common/schema/README.md b/x-pack/plugins/endpoint/common/schema/README.md deleted file mode 100644 index 42abedd647e6b..0000000000000 --- a/x-pack/plugins/endpoint/common/schema/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Schemas - -These schemas are used to validate, coerce, and provide types for the comms between the client, server, and ES. - -# Future work -In the future, we may be able to locate these under 'server'. diff --git a/x-pack/plugins/endpoint/kibana.json b/x-pack/plugins/endpoint/kibana.json deleted file mode 100644 index 4b48c83fb0e7c..0000000000000 --- a/x-pack/plugins/endpoint/kibana.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "endpoint", - "version": "1.0.0", - "kibanaVersion": "kibana", - "configPath": ["xpack", "endpoint"], - "requiredPlugins": ["features", "embeddable", "data", "dataEnhanced", "ingestManager"], - "server": true, - "ui": true -} diff --git a/x-pack/plugins/endpoint/package.json b/x-pack/plugins/endpoint/package.json deleted file mode 100644 index fc4f4bd586bef..0000000000000 --- a/x-pack/plugins/endpoint/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "author": "Elastic", - "name": "endpoint", - "version": "0.0.0", - "private": true, - "license": "Elastic-License", - "scripts": { - "test:generate": "ts-node --project scripts/cli_tsconfig.json scripts/resolver_generator.ts" - }, - "dependencies": { - "react-redux": "^7.1.0" - }, - "devDependencies": { - "@types/seedrandom": ">=2.0.0 <4.0.0", - "@types/react-redux": "^7.1.0", - "redux-devtools-extension": "^2.13.8" - } -} diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/README.md b/x-pack/plugins/endpoint/public/applications/endpoint/README.md deleted file mode 100644 index 25bfd615d1d2c..0000000000000 --- a/x-pack/plugins/endpoint/public/applications/endpoint/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Endpoint application -This application provides the user interface for the Elastic Endpoint - -# Architecture -The application consists of a _view_ written in React and a _model_ written in Redux. - -# Modules -We structure the modules to match the architecture. `view` contains the _view_ (all React) code. `store` contains the _model_. - -This section covers the conventions of each top level module. - -# `mocks` -This contains helper code for unit tests. - -## `models` -This contains domain models. By convention, each submodule here contains methods for a single type. Domain model classes would also live here. - -## `store` -This contains the _model_ of the application. All Redux and Redux middleware code (including API interactions) happen here. This module also contains the types and interfaces defining Redux actions. Each action type or interface should be commented and if it has fields, each field should be commented. Comments should be of `tsdoc` style. - -## `view` -This contains the code which renders elements to the DOM. All React code goes here. - -## `index.tsx` -This exports `renderApp` which instantiates the React view with the _model_. - -## `types.ts` -This contains the types and interfaces. All `export`ed types or interfaces (except ones defining Redux actions, which live in `store`) should be here. Each type or interface should have a `tsdoc` style comment. Interfaces should have `tsdoc` comments on each field and types which have fields should do the same. diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/index.tsx b/x-pack/plugins/endpoint/public/applications/endpoint/index.tsx deleted file mode 100644 index a1999c056bf59..0000000000000 --- a/x-pack/plugins/endpoint/public/applications/endpoint/index.tsx +++ /dev/null @@ -1,30 +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 * as React from 'react'; -import ReactDOM from 'react-dom'; -import { CoreStart, AppMountParameters } from 'kibana/public'; -import { EndpointPluginStartDependencies } from '../../plugin'; -import { appStoreFactory } from './store'; -import { AppRoot } from './view/app_root'; - -/** - * This module will be loaded asynchronously to reduce the bundle size of your plugin's main bundle. - */ -export function renderApp( - coreStart: CoreStart, - depsStart: EndpointPluginStartDependencies, - { element, history }: AppMountParameters -) { - const store = appStoreFactory({ coreStart, depsStart }); - ReactDOM.render( - , - element - ); - return () => { - ReactDOM.unmountComponentAtNode(element); - }; -} diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/action.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/action.ts deleted file mode 100644 index a32ecb4b45561..0000000000000 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/action.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { HostAction } from './hosts'; -import { AlertAction } from './alerts'; -import { RoutingAction } from './routing'; -import { PolicyListAction } from './policy_list'; -import { PolicyDetailsAction } from './policy_details'; - -/** - * The entire set of redux actions recognized by our reducer. - */ -export type AppAction = - | HostAction - | AlertAction - | RoutingAction - | PolicyListAction - | PolicyDetailsAction; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/immutable_combine_reducers.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/immutable_combine_reducers.ts deleted file mode 100644 index 6895f0106fb5d..0000000000000 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/immutable_combine_reducers.ts +++ /dev/null @@ -1,13 +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 { combineReducers } from 'redux'; -import { ImmutableCombineReducers } from '../types'; - -/** - * Works the same as `combineReducers` from `redux`, but uses the `ImmutableCombineReducers` type. - */ -export const immutableCombineReducers: ImmutableCombineReducers = combineReducers; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/index.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/index.ts deleted file mode 100644 index a4d0b3a8b9815..0000000000000 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/index.ts +++ /dev/null @@ -1,84 +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 { createStore, compose, applyMiddleware, Store } from 'redux'; -import { CoreStart } from 'kibana/public'; -import { appReducer } from './reducer'; -import { alertMiddlewareFactory } from './alerts/middleware'; -import { hostMiddlewareFactory } from './hosts'; -import { policyListMiddlewareFactory } from './policy_list'; -import { policyDetailsMiddlewareFactory } from './policy_details'; -import { ImmutableMiddlewareFactory, SubstateMiddlewareFactory } from '../types'; -import { EndpointPluginStartDependencies } from '../../../plugin'; - -const composeWithReduxDevTools = (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ - ? (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ name: 'EndpointApp' }) - : compose; - -export const substateMiddlewareFactory: SubstateMiddlewareFactory = (selector, middleware) => { - return api => { - const substateAPI = { - ...api, - // Return just the substate instead of global state. - getState() { - return selector(api.getState()); - }, - }; - return middleware(substateAPI); - }; -}; - -/** - * @param middlewareDeps Optionally create the store without any middleware. This is useful for testing the store w/o side effects. - */ -export const appStoreFactory: (middlewareDeps?: { - /** - * Allow middleware to communicate with Kibana core. - */ - coreStart: CoreStart; - /** - * Give middleware access to plugin start dependencies. - */ - depsStart: EndpointPluginStartDependencies; - /** - * Any additional Redux Middlewares - * (should only be used for testing - example: to inject the action spy middleware) - */ - additionalMiddleware?: Array>; -}) => Store = middlewareDeps => { - let middleware; - if (middlewareDeps) { - const { coreStart, depsStart, additionalMiddleware = [] } = middlewareDeps; - middleware = composeWithReduxDevTools( - applyMiddleware( - substateMiddlewareFactory( - globalState => globalState.hostList, - hostMiddlewareFactory(coreStart, depsStart) - ), - substateMiddlewareFactory( - globalState => globalState.policyList, - policyListMiddlewareFactory(coreStart, depsStart) - ), - substateMiddlewareFactory( - globalState => globalState.policyDetails, - policyDetailsMiddlewareFactory(coreStart, depsStart) - ), - substateMiddlewareFactory( - globalState => globalState.alertList, - alertMiddlewareFactory(coreStart, depsStart) - ), - // Additional Middleware should go last - ...additionalMiddleware - ) - ); - } else { - // Create the store without any middleware. This is useful for testing the store w/o side effects. - middleware = undefined; - } - const store = createStore(appReducer, middleware); - - return store; -}; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/reducer.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/reducer.ts deleted file mode 100644 index 2f77c380d9387..0000000000000 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/reducer.ts +++ /dev/null @@ -1,20 +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 { hostListReducer } from './hosts'; -import { AppAction } from './action'; -import { alertListReducer } from './alerts'; -import { GlobalState, ImmutableReducer } from '../types'; -import { policyListReducer } from './policy_list'; -import { policyDetailsReducer } from './policy_details'; -import { immutableCombineReducers } from './immutable_combine_reducers'; - -export const appReducer: ImmutableReducer = immutableCombineReducers({ - hostList: hostListReducer, - alertList: alertListReducer, - policyList: policyListReducer, - policyDetails: policyDetailsReducer, -}); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/types.ts b/x-pack/plugins/endpoint/public/applications/endpoint/types.ts deleted file mode 100644 index 8b401f80b2fdd..0000000000000 --- a/x-pack/plugins/endpoint/public/applications/endpoint/types.ts +++ /dev/null @@ -1,395 +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 { - Dispatch, - Action as ReduxAction, - AnyAction as ReduxAnyAction, - Action, - Middleware, -} from 'redux'; -import { IIndexPattern } from 'src/plugins/data/public'; -import { - HostMetadata, - AlertData, - AlertResultList, - Immutable, - AlertDetails, - MalwareFields, - UIPolicyConfig, - PolicyData, - HostPolicyResponse, - HostInfo, -} from '../../../common/types'; -import { EndpointPluginStartDependencies } from '../../plugin'; -import { AppAction } from './store/action'; -import { CoreStart } from '../../../../../../src/core/public'; -import { - GetAgentStatusResponse, - GetDatasourcesResponse, - GetOneDatasourceResponse, - UpdateDatasourceResponse, -} from '../../../../ingest_manager/common'; - -export { AppAction }; - -/** - * like redux's `MiddlewareAPI` but `getState` returns an `Immutable` version of - * state and `dispatch` accepts `Immutable` versions of actions. - */ -export interface ImmutableMiddlewareAPI { - dispatch: Dispatch>; - getState(): Immutable; -} - -/** - * Like redux's `Middleware` but without the ability to mutate actions or state. - * Differences: - * * `getState` returns an `Immutable` version of state - * * `dispatch` accepts `Immutable` versions of actions - * * `action`s received will be `Immutable` - */ -export type ImmutableMiddleware = ( - api: ImmutableMiddlewareAPI -) => (next: Dispatch>) => (action: Immutable) => unknown; - -/** - * Takes application-standard middleware dependencies - * and returns a redux middleware. - * Middleware will be of the `ImmutableMiddleware` variety. Not able to directly - * change actions or state. - */ -export type ImmutableMiddlewareFactory = ( - coreStart: CoreStart, - depsStart: EndpointPluginStartDependencies -) => ImmutableMiddleware; - -/** - * Simple type for a redux selector. - */ -type Selector = (state: S) => R; - -/** - * Takes a selector and an `ImmutableMiddleware`. The - * middleware's version of `getState` will receive - * the result of the selector instead of the global state. - * - * This allows middleware to have knowledge of only a subsection of state. - * - * `selector` returns an `Immutable` version of the substate. - * `middleware` must be an `ImmutableMiddleware`. - * - * Returns a regular middleware, meant to be used with `applyMiddleware`. - */ -export type SubstateMiddlewareFactory = ( - selector: Selector>, - middleware: ImmutableMiddleware -) => Middleware<{}, GlobalState, Dispatch>>; - -export interface HostState { - /** list of host **/ - hosts: HostInfo[]; - /** number of items per page */ - pageSize: number; - /** which page to show */ - pageIndex: number; - /** total number of hosts returned */ - total: number; - /** list page is retrieving data */ - loading: boolean; - /** api error from retrieving host list */ - error?: ServerApiError; - /** details data for a specific host */ - details?: Immutable; - /** details page is retrieving data */ - detailsLoading: boolean; - /** api error from retrieving host details */ - detailsError?: ServerApiError; - /** Holds the Policy Response for the Host currently being displayed in the details */ - policyResponse?: HostPolicyResponse; - /** policyResponse is being retrieved */ - policyResponseLoading: boolean; - /** api error from retrieving the policy response */ - policyResponseError?: ServerApiError; - /** current location info */ - location?: Immutable; -} - -/** - * Query params on the host page parsed from the URL - */ -export interface HostIndexUIQueryParams { - /** Selected host id shows host details flyout */ - selected_host?: string; - /** How many items to show in list */ - page_size?: string; - /** Which page to show */ - page_index?: string; - /** show the policy response or host details */ - show?: string; -} - -export interface ServerApiError { - statusCode: number; - error: string; - message: string; -} - -/** - * Policy list store state - */ -export interface PolicyListState { - /** Array of policy items */ - policyItems: PolicyData[]; - /** API error if loading data failed */ - apiError?: ServerApiError; - /** total number of policies */ - total: number; - /** Number of policies per page */ - pageSize: number; - /** page number (zero based) */ - pageIndex: number; - /** data is being retrieved from server */ - isLoading: boolean; - /** current location information */ - location?: Immutable; -} - -/** - * Policy details store state - */ -export interface PolicyDetailsState { - /** A single policy item */ - policyItem?: PolicyData; - /** API error if loading data failed */ - apiError?: ServerApiError; - isLoading: boolean; - /** current location of the application */ - location?: Immutable; - /** A summary of stats for the agents associated with a given Fleet Agent Configuration */ - agentStatusSummary: GetAgentStatusResponse['results']; - /** Status of an update to the policy */ - updateStatus?: { - success: boolean; - error?: ServerApiError; - }; -} - -/** - * The URL search params that are supported by the Policy List page view - */ -export interface PolicyListUrlSearchParams { - page_index: number; - page_size: number; -} - -/** - * Endpoint Policy configuration - */ -export interface PolicyConfig { - windows: { - events: { - dll_and_driver_load: boolean; - dns: boolean; - file: boolean; - network: boolean; - process: boolean; - registry: boolean; - security: boolean; - }; - malware: MalwareFields; - logging: { - stdout: string; - file: string; - }; - advanced: PolicyConfigAdvancedOptions; - }; - mac: { - events: { - file: boolean; - process: boolean; - network: boolean; - }; - malware: MalwareFields; - logging: { - stdout: string; - file: string; - }; - advanced: PolicyConfigAdvancedOptions; - }; - linux: { - events: { - file: boolean; - process: boolean; - network: boolean; - }; - logging: { - stdout: string; - file: string; - }; - advanced: PolicyConfigAdvancedOptions; - }; -} - -interface PolicyConfigAdvancedOptions { - elasticsearch: { - indices: { - control: string; - event: string; - logging: string; - }; - kernel: { - connect: boolean; - process: boolean; - }; - }; -} - -/** OS used in Policy */ -export enum OS { - windows = 'windows', - mac = 'mac', - linux = 'linux', -} - -/** - * Returns the keys of an object whose values meet a criteria. - * Ex) interface largeNestedObject = { - * a: { - * food: Foods; - * toiletPaper: true; - * }; - * b: { - * food: Foods; - * streamingServices: Streams; - * }; - * c: {}; - * } - * - * type hasFoods = KeysByValueCriteria; - * The above type will be: [a, b] only, and will not include c. - * - */ -export type KeysByValueCriteria = { - [K in keyof O]: O[K] extends Criteria ? K : never; -}[keyof O]; - -/** Returns an array of the policy OSes that have a malware protection field */ -export type MalwareProtectionOSes = KeysByValueCriteria; - -export interface GlobalState { - readonly hostList: HostState; - readonly alertList: AlertListState; - readonly policyList: PolicyListState; - readonly policyDetails: PolicyDetailsState; -} - -/** - * A better type for createStructuredSelector. This doesn't support the options object. - */ -export type CreateStructuredSelector = < - SelectorMap extends { [key: string]: (...args: never[]) => unknown } ->( - selectorMap: SelectorMap -) => ( - state: SelectorMap[keyof SelectorMap] extends (state: infer State) => unknown ? State : never -) => { - [Key in keyof SelectorMap]: ReturnType; -}; - -export interface EndpointAppLocation { - pathname: string; - search: string; - hash: string; - key?: string; -} - -interface AlertsSearchBarState { - patterns: IIndexPattern[]; -} - -export type AlertListData = AlertResultList; - -export interface AlertListState { - /** Array of alert items. */ - readonly alerts: Immutable; - - /** The total number of alerts on the page. */ - readonly total: number; - - /** Number of alerts per page. */ - readonly pageSize: number; - - /** Page number, starting at 0. */ - readonly pageIndex: number; - - /** Current location object from React Router history. */ - readonly location?: Immutable; - - /** Specific Alert data to be shown in the details view */ - readonly alertDetails?: Immutable; - - /** Search bar state including indexPatterns */ - readonly searchBar: AlertsSearchBarState; -} - -/** - * Gotten by parsing the URL from the browser. Used to calculate the new URL when changing views. - */ -export interface AlertingIndexUIQueryParams { - /** - * How many items to show in list. - */ - page_size?: string; - /** - * Which page to show. If `page_index` is 1, show page 2. - */ - page_index?: string; - /** - * If any value is present, show the alert detail view for the selected alert. Should be an ID for an alert event. - */ - selected_alert?: string; - query?: string; - date_range?: string; - filters?: string; -} - -export interface GetPolicyListResponse extends GetDatasourcesResponse { - items: PolicyData[]; -} - -export interface GetPolicyResponse extends GetOneDatasourceResponse { - item: PolicyData; -} - -export interface UpdatePolicyResponse extends UpdateDatasourceResponse { - item: PolicyData; -} - -/** - * Like `Reducer` from `redux` but it accepts immutable versions of `state` and `action`. - * Use this type for all Reducers in order to help enforce our pattern of immutable state. - */ -export type ImmutableReducer = ( - state: Immutable | undefined, - action: Immutable -) => State | Immutable; - -/** - * A alternate interface for `redux`'s `combineReducers`. Will work with the same underlying implementation, - * but will enforce that `Immutable` versions of `state` and `action` are received. - */ -export type ImmutableCombineReducers = ( - reducers: ImmutableReducersMapObject -) => ImmutableReducer; - -/** - * Like `redux`'s `ReducersMapObject` (which is used by `combineReducers`) but enforces that - * the `state` and `action` received are `Immutable` versions. - */ -type ImmutableReducersMapObject = { - [K in keyof S]: ImmutableReducer; -}; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/overview/index.tsx b/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/overview/index.tsx deleted file mode 100644 index 0ec5a855c8615..0000000000000 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/overview/index.tsx +++ /dev/null @@ -1,123 +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 React, { memo, useMemo } from 'react'; -import styled from 'styled-components'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { - EuiSpacer, - EuiTitle, - EuiText, - EuiHealth, - EuiTabbedContent, - EuiTabbedContentTab, -} from '@elastic/eui'; -import { useAlertListSelector } from '../../hooks/use_alerts_selector'; -import * as selectors from '../../../../store/alerts/selectors'; -import { MetadataPanel } from './metadata_panel'; -import { FormattedDate } from '../../formatted_date'; -import { AlertDetailResolver } from '../../resolver'; -import { ResolverEvent } from '../../../../../../../common/types'; -import { TakeActionDropdown } from './take_action_dropdown'; - -export const AlertDetailsOverview = styled( - memo(() => { - const alertDetailsData = useAlertListSelector(selectors.selectedAlertDetailsData); - if (alertDetailsData === undefined) { - return null; - } - - const tabs: EuiTabbedContentTab[] = useMemo(() => { - return [ - { - id: 'overviewMetadata', - 'data-test-subj': 'overviewMetadata', - name: i18n.translate( - 'xpack.endpoint.application.endpoint.alertDetails.overview.tabs.overview', - { - defaultMessage: 'Overview', - } - ), - content: ( - <> - - - - ), - }, - { - id: 'overviewResolver', - 'data-test-subj': 'overviewResolverTab', - name: i18n.translate( - 'xpack.endpoint.application.endpoint.alertDetails.overview.tabs.resolver', - { - defaultMessage: 'Resolver', - } - ), - content: ( - <> - - - - ), - }, - ]; - }, [alertDetailsData]); - - return ( - <> -
- -

- -

-
- - -

- , - }} - /> -

-
- - - Endpoint Status:{' '} - - {' '} - - - - - {' '} - - - - - -
- - - ); - }) -)` - height: 100%; - width: 100%; -`; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/hooks/use_alerts_selector.ts b/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/hooks/use_alerts_selector.ts deleted file mode 100644 index d3962f908757c..0000000000000 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/hooks/use_alerts_selector.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { useSelector } from 'react-redux'; -import { GlobalState, AlertListState } from '../../../types'; - -export function useAlertListSelector(selector: (state: AlertListState) => TSelected) { - return useSelector((state: GlobalState) => selector(state.alertList)); -} diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/resolver.tsx b/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/resolver.tsx deleted file mode 100644 index d32ad4dd9defc..0000000000000 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/resolver.tsx +++ /dev/null @@ -1,38 +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 React from 'react'; -import styled from 'styled-components'; -import { Provider } from 'react-redux'; -import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; -import { Resolver } from '../../../../embeddables/resolver/view'; -import { EndpointPluginServices } from '../../../../plugin'; -import { ResolverEvent } from '../../../../../common/types'; -import { storeFactory } from '../../../../embeddables/resolver/store'; - -export const AlertDetailResolver = styled( - React.memo( - ({ className, selectedEvent }: { className?: string; selectedEvent?: ResolverEvent }) => { - const context = useKibana(); - const { store } = storeFactory(context); - - return ( -
- - - -
- ); - } - ) -)` - height: 100%; - width: 100%; - display: flex; - flex-grow: 1; - /* gross demo hack */ - min-height: calc(100vh - 505px); -`; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/test_helpers/render_alert_page.tsx b/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/test_helpers/render_alert_page.tsx deleted file mode 100644 index 6311671407610..0000000000000 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/test_helpers/render_alert_page.tsx +++ /dev/null @@ -1,59 +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 React from 'react'; -import * as reactTestingLibrary from '@testing-library/react'; -import { Provider } from 'react-redux'; -import { I18nProvider } from '@kbn/i18n/react'; -import { createMemoryHistory } from 'history'; -import { Router } from 'react-router-dom'; -import { AlertIndex } from '../index'; -import { appStoreFactory } from '../../../store'; -import { KibanaContextProvider } from '../../../../../../../../../src/plugins/kibana_react/public'; -import { RouteCapture } from '../../route_capture'; -import { depsStartMock } from '../../../mocks'; - -/** - * Create a 'history' instance that is only in-memory and causes no side effects to the testing environment. - */ -const history = createMemoryHistory(); -/** - * Create a store, with the middleware disabled. We don't want side effects being created by our code in this test. - */ -const store = appStoreFactory(); - -const depsStart = depsStartMock(); -depsStart.data.ui.SearchBar.mockImplementation(() =>
); - -export const alertPageTestRender = { - store, - history, - depsStart, - - /** - * Render the test component, use this after setting up anything in `beforeEach`. - */ - render: () => { - /** - * Provide the store via `Provider`, and i18n APIs via `I18nProvider`. - * Use react-router via `Router`, passing our in-memory `history` instance. - * Use `RouteCapture` to emit url-change actions when the URL is changed. - * Finally, render the `AlertIndex` component which we are testing. - */ - return reactTestingLibrary.render( - - - - - - - - - - - - ); - }, -}; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/app_root.tsx b/x-pack/plugins/endpoint/public/applications/endpoint/view/app_root.tsx deleted file mode 100644 index f9634c63deefb..0000000000000 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/app_root.tsx +++ /dev/null @@ -1,59 +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 * as React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { Route, Switch } from 'react-router-dom'; -import { Store } from 'redux'; -import { AlertIndex } from './alerts'; -import { HostList } from './hosts'; -import { PolicyList } from './policy'; -import { PolicyDetails } from './policy'; -import { HeaderNavigation } from './components/header_navigation'; -import { AppRootProvider } from './app_root_provider'; -import { Setup } from './setup'; -import { EndpointPluginStartDependencies } from '../../../plugin'; -import { ScopedHistory, CoreStart } from '../../../../../../../src/core/public'; - -interface RouterProps { - history: ScopedHistory; - store: Store; - coreStart: CoreStart; - depsStart: EndpointPluginStartDependencies; -} - -/** - * The root of the Endpoint application react view. - */ -export const AppRoot: React.FunctionComponent = React.memo( - ({ history, store, coreStart, depsStart }) => { - return ( - - - - - ( -

- -

- )} - /> - - - - - ( - - )} - /> -
-
- ); - } -); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/components/header_navigation.tsx b/x-pack/plugins/endpoint/public/applications/endpoint/view/components/header_navigation.tsx deleted file mode 100644 index 7475229853698..0000000000000 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/components/header_navigation.tsx +++ /dev/null @@ -1,78 +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 React, { memo, useMemo } from 'react'; -import { i18n } from '@kbn/i18n'; -import { EuiTabs, EuiTab } from '@elastic/eui'; -import { useLocation } from 'react-router-dom'; -import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; -import { Immutable } from '../../../../../common/types'; -import { useNavigateByRouterEventHandler } from '../hooks/use_navigate_by_router_event_handler'; - -interface NavTabs { - name: string; - id: string; - href: string; -} - -const navTabs: Immutable = [ - { - id: 'home', - name: i18n.translate('xpack.endpoint.headerNav.home', { - defaultMessage: 'Home', - }), - href: '/', - }, - { - id: 'hosts', - name: i18n.translate('xpack.endpoint.headerNav.hosts', { - defaultMessage: 'Hosts', - }), - href: '/hosts', - }, - { - id: 'alerts', - name: i18n.translate('xpack.endpoint.headerNav.alerts', { - defaultMessage: 'Alerts', - }), - href: '/alerts', - }, - { - id: 'policies', - name: i18n.translate('xpack.endpoint.headerNav.policies', { - defaultMessage: 'Policies', - }), - href: '/policy', - }, -]; - -const NavTab = memo<{ tab: NavTabs }>(({ tab }) => { - const { pathname } = useLocation(); - const { services } = useKibana(); - const onClickHandler = useNavigateByRouterEventHandler(tab.href); - const BASE_PATH = services.application.getUrlForApp('endpoint'); - - return ( - - {tab.name} - - ); -}); - -export const HeaderNavigation: React.FunctionComponent = React.memo(() => { - const tabList = useMemo(() => { - return navTabs.map((tab, index) => { - return ; - }); - }, []); - - return {tabList}; -}); diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/models/process_event_test_helpers.ts b/x-pack/plugins/endpoint/public/embeddables/resolver/models/process_event_test_helpers.ts deleted file mode 100644 index e88837d325108..0000000000000 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/models/process_event_test_helpers.ts +++ /dev/null @@ -1,49 +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 { LegacyEndpointEvent } from '../../../../common/types'; - -type DeepPartial = { [K in keyof T]?: DeepPartial }; -/** - * Creates a mock process event given the 'parts' argument, which can - * include all or some process event fields as determined by the ProcessEvent type. - * The only field that must be provided is the event's 'node_id' field. - * The other fields are populated by the function unless provided in 'parts' - */ -export function mockProcessEvent(parts: { - endgame: { - unique_pid: LegacyEndpointEvent['endgame']['unique_pid']; - unique_ppid?: LegacyEndpointEvent['endgame']['unique_ppid']; - process_name?: LegacyEndpointEvent['endgame']['process_name']; - event_subtype_full?: LegacyEndpointEvent['endgame']['event_subtype_full']; - event_type_full?: LegacyEndpointEvent['endgame']['event_type_full']; - } & DeepPartial; -}): LegacyEndpointEvent { - const { endgame: dataBuffer } = parts; - return { - endgame: { - ...dataBuffer, - event_timestamp: 1, - event_type: 1, - unique_ppid: 0, - unique_pid: 1, - machine_id: '', - event_subtype_full: 'creation_event', - event_type_full: 'process_event', - process_name: '', - process_path: '', - timestamp_utc: '', - serial_event_id: 1, - }, - '@timestamp': 1582233383000, - agent: { - type: '', - id: '', - version: '', - }, - ...parts, - }; -} diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/edge_line.tsx b/x-pack/plugins/endpoint/public/embeddables/resolver/view/edge_line.tsx deleted file mode 100644 index fbd40dda9adfd..0000000000000 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/view/edge_line.tsx +++ /dev/null @@ -1,78 +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 React from 'react'; -import styled from 'styled-components'; -import { applyMatrix3, distance, angle } from '../lib/vector2'; -import { Vector2, Matrix3 } from '../types'; - -/** - * A placeholder line segment view that connects process nodes. - */ -export const EdgeLine = styled( - React.memo( - ({ - className, - startPosition, - endPosition, - projectionMatrix, - }: { - /** - * A className string provided by `styled` - */ - className?: string; - /** - * The postion of first point in the line segment. In 'world' coordinates. - */ - startPosition: Vector2; - /** - * The postion of second point in the line segment. In 'world' coordinates. - */ - endPosition: Vector2; - /** - * projectionMatrix which can be used to convert `startPosition` and `endPosition` to screen coordinates. - */ - projectionMatrix: Matrix3; - }) => { - /** - * Convert the start and end positions, which are in 'world' coordinates, - * to `left` and `top` css values. - */ - const screenStart = applyMatrix3(startPosition, projectionMatrix); - const screenEnd = applyMatrix3(endPosition, projectionMatrix); - - /** - * We render the line using a short, long, `div` element. The length of this `div` - * should be the same as the distance between the start and end points. - */ - const length = distance(screenStart, screenEnd); - - const style = { - left: screenStart[0] + 'px', - top: screenStart[1] + 'px', - width: length + 'px', - /** - * Transform from the left of the div, as the left side of the `div` is positioned - * at the start point of the line segment. - */ - transformOrigin: 'top left', - /** - * Translate the `div` in the y axis to accomodate for the height of the `div`. - * Also rotate the `div` in the z axis so that it's angle matches the angle - * between the start and end points. - */ - transform: `translateY(-50%) rotateZ(${angle(screenStart, screenEnd)}rad)`, - }; - return
; - } - ) -)` - position: absolute; - height: 3px; - background-color: #d4d4d4; - color: #333333; - contain: strict; -`; diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/graph_controls.tsx b/x-pack/plugins/endpoint/public/embeddables/resolver/view/graph_controls.tsx deleted file mode 100644 index 32c3f73ced287..0000000000000 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/view/graph_controls.tsx +++ /dev/null @@ -1,181 +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 React, { useCallback, useMemo, useContext } from 'react'; -import styled from 'styled-components'; -import { EuiRange, EuiPanel, EuiIcon } from '@elastic/eui'; -import { useSelector, useDispatch } from 'react-redux'; -import { SideEffectContext } from './side_effect_context'; -import { ResolverAction, Vector2 } from '../types'; -import * as selectors from '../store/selectors'; - -/** - * Controls for zooming, panning, and centering in Resolver - */ -export const GraphControls = styled( - React.memo( - ({ - className, - }: { - /** - * A className string provided by `styled` - */ - className?: string; - }) => { - const dispatch: (action: ResolverAction) => unknown = useDispatch(); - const scalingFactor = useSelector(selectors.scalingFactor); - const { timestamp } = useContext(SideEffectContext); - - const handleZoomAmountChange = useCallback( - (event: React.ChangeEvent | React.MouseEvent) => { - const valueAsNumber = parseFloat( - (event as React.ChangeEvent).target.value - ); - if (isNaN(valueAsNumber) === false) { - dispatch({ - type: 'userSetZoomLevel', - payload: valueAsNumber, - }); - } - }, - [dispatch] - ); - - const handleCenterClick = useCallback(() => { - dispatch({ - type: 'userSetPositionOfCamera', - payload: [0, 0], - }); - }, [dispatch]); - - const handleZoomOutClick = useCallback(() => { - dispatch({ - type: 'userClickedZoomOut', - }); - }, [dispatch]); - - const handleZoomInClick = useCallback(() => { - dispatch({ - type: 'userClickedZoomIn', - }); - }, [dispatch]); - - const [handleNorth, handleEast, handleSouth, handleWest] = useMemo(() => { - const directionVectors: readonly Vector2[] = [ - [0, 1], - [1, 0], - [0, -1], - [-1, 0], - ]; - return directionVectors.map(direction => { - return () => { - const action: ResolverAction = { - type: 'userNudgedCamera', - payload: { direction, time: timestamp() }, - }; - dispatch(action); - }; - }); - }, [dispatch, timestamp]); - - return ( -
- -
- -
-
- - - -
-
- -
-
- - - - - -
- ); - } - ) -)` - background-color: #d4d4d4; - color: #333333; - - .zoom-controls { - display: flex; - flex-direction: column; - align-items: center; - padding: 5px 0px; - - .zoom-slider { - width: 20px; - height: 150px; - margin: 5px 0px 2px 0px; - - input[type='range'] { - width: 150px; - height: 20px; - transform-origin: 75px 75px; - transform: rotate(-90deg); - } - } - } - .panning-controls { - text-align: center; - } -`; diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/process_event_dot.tsx b/x-pack/plugins/endpoint/public/embeddables/resolver/view/process_event_dot.tsx deleted file mode 100644 index 32928d511a1f9..0000000000000 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/view/process_event_dot.tsx +++ /dev/null @@ -1,605 +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 React, { useCallback, useMemo } from 'react'; -import styled from 'styled-components'; -import { i18n } from '@kbn/i18n'; -import { - htmlIdGenerator, - EuiI18nNumber, - EuiKeyboardAccessible, - EuiFlexGroup, - EuiFlexItem, -} from '@elastic/eui'; -import { useSelector } from 'react-redux'; -import { NodeSubMenu, subMenuAssets } from './submenu'; -import { applyMatrix3 } from '../lib/vector2'; -import { - Vector2, - Matrix3, - AdjacentProcessMap, - ResolverProcessType, - RelatedEventEntryWithStatsOrWaiting, -} from '../types'; -import { SymbolIds, NamedColors } from './defs'; -import { ResolverEvent } from '../../../../common/types'; -import { useResolverDispatch } from './use_resolver_dispatch'; -import * as eventModel from '../../../../common/models/event'; -import * as processModel from '../models/process_event'; -import * as selectors from '../store/selectors'; - -const nodeAssets = { - runningProcessCube: { - cubeSymbol: `#${SymbolIds.runningProcessCube}`, - labelBackground: NamedColors.labelBackgroundRunningProcess, - descriptionFill: NamedColors.empty, - descriptionText: i18n.translate('xpack.endpoint.resolver.runningProcess', { - defaultMessage: 'Running Process', - }), - }, - runningTriggerCube: { - cubeSymbol: `#${SymbolIds.runningTriggerCube}`, - labelBackground: NamedColors.labelBackgroundRunningTrigger, - descriptionFill: NamedColors.empty, - descriptionText: i18n.translate('xpack.endpoint.resolver.runningTrigger', { - defaultMessage: 'Running Trigger', - }), - }, - terminatedProcessCube: { - cubeSymbol: `#${SymbolIds.terminatedProcessCube}`, - labelBackground: NamedColors.labelBackgroundTerminatedProcess, - descriptionFill: NamedColors.empty, - descriptionText: i18n.translate('xpack.endpoint.resolver.terminatedProcess', { - defaultMessage: 'Terminated Process', - }), - }, - terminatedTriggerCube: { - cubeSymbol: `#${SymbolIds.terminatedTriggerCube}`, - labelBackground: NamedColors.labelBackgroundTerminatedTrigger, - descriptionFill: NamedColors.empty, - descriptionText: i18n.translate('xpack.endpoint.resolver.terminatedTrigger', { - defaultMessage: 'Terminated Trigger', - }), - }, -}; - -/** - * Take a gross `schemaName` and return a beautiful translated one. - */ -const getDisplayName: (schemaName: string) => string = function nameInSchemaToDisplayName( - schemaName: string -) { - const displayNameRecord: Record = { - application: i18n.translate('xpack.endpoint.resolver.applicationEventTypeDisplayName', { - defaultMessage: 'Application', - }), - apm: i18n.translate('xpack.endpoint.resolver.apmEventTypeDisplayName', { - defaultMessage: 'APM', - }), - audit: i18n.translate('xpack.endpoint.resolver.auditEventTypeDisplayName', { - defaultMessage: 'Audit', - }), - authentication: i18n.translate('xpack.endpoint.resolver.authenticationEventTypeDisplayName', { - defaultMessage: 'Authentication', - }), - certificate: i18n.translate('xpack.endpoint.resolver.certificateEventTypeDisplayName', { - defaultMessage: 'Certificate', - }), - cloud: i18n.translate('xpack.endpoint.resolver.cloudEventTypeDisplayName', { - defaultMessage: 'Cloud', - }), - database: i18n.translate('xpack.endpoint.resolver.databaseEventTypeDisplayName', { - defaultMessage: 'Database', - }), - driver: i18n.translate('xpack.endpoint.resolver.driverEventTypeDisplayName', { - defaultMessage: 'Driver', - }), - email: i18n.translate('xpack.endpoint.resolver.emailEventTypeDisplayName', { - defaultMessage: 'Email', - }), - file: i18n.translate('xpack.endpoint.resolver.fileEventTypeDisplayName', { - defaultMessage: 'File', - }), - host: i18n.translate('xpack.endpoint.resolver.hostEventTypeDisplayName', { - defaultMessage: 'Host', - }), - iam: i18n.translate('xpack.endpoint.resolver.iamEventTypeDisplayName', { - defaultMessage: 'IAM', - }), - iam_group: i18n.translate('xpack.endpoint.resolver.iam_groupEventTypeDisplayName', { - defaultMessage: 'IAM Group', - }), - intrusion_detection: i18n.translate( - 'xpack.endpoint.resolver.intrusion_detectionEventTypeDisplayName', - { - defaultMessage: 'Intrusion Detection', - } - ), - malware: i18n.translate('xpack.endpoint.resolver.malwareEventTypeDisplayName', { - defaultMessage: 'Malware', - }), - network_flow: i18n.translate('xpack.endpoint.resolver.network_flowEventTypeDisplayName', { - defaultMessage: 'Network Flow', - }), - network: i18n.translate('xpack.endpoint.resolver.networkEventTypeDisplayName', { - defaultMessage: 'Network', - }), - package: i18n.translate('xpack.endpoint.resolver.packageEventTypeDisplayName', { - defaultMessage: 'Package', - }), - process: i18n.translate('xpack.endpoint.resolver.processEventTypeDisplayName', { - defaultMessage: 'Process', - }), - registry: i18n.translate('xpack.endpoint.resolver.registryEventTypeDisplayName', { - defaultMessage: 'Registry', - }), - session: i18n.translate('xpack.endpoint.resolver.sessionEventTypeDisplayName', { - defaultMessage: 'Session', - }), - service: i18n.translate('xpack.endpoint.resolver.serviceEventTypeDisplayName', { - defaultMessage: 'Service', - }), - socket: i18n.translate('xpack.endpoint.resolver.socketEventTypeDisplayName', { - defaultMessage: 'Socket', - }), - vulnerability: i18n.translate('xpack.endpoint.resolver.vulnerabilityEventTypeDisplayName', { - defaultMessage: 'Vulnerability', - }), - web: i18n.translate('xpack.endpoint.resolver.webEventTypeDisplayName', { - defaultMessage: 'Web', - }), - alert: i18n.translate('xpack.endpoint.resolver.alertEventTypeDisplayName', { - defaultMessage: 'Alert', - }), - security: i18n.translate('xpack.endpoint.resolver.securityEventTypeDisplayName', { - defaultMessage: 'Security', - }), - dns: i18n.translate('xpack.endpoint.resolver.dnsEventTypeDisplayName', { - defaultMessage: 'DNS', - }), - clr: i18n.translate('xpack.endpoint.resolver.clrEventTypeDisplayName', { - defaultMessage: 'CLR', - }), - image_load: i18n.translate('xpack.endpoint.resolver.image_loadEventTypeDisplayName', { - defaultMessage: 'Image Load', - }), - powershell: i18n.translate('xpack.endpoint.resolver.powershellEventTypeDisplayName', { - defaultMessage: 'Powershell', - }), - wmi: i18n.translate('xpack.endpoint.resolver.wmiEventTypeDisplayName', { - defaultMessage: 'WMI', - }), - api: i18n.translate('xpack.endpoint.resolver.apiEventTypeDisplayName', { - defaultMessage: 'API', - }), - user: i18n.translate('xpack.endpoint.resolver.userEventTypeDisplayName', { - defaultMessage: 'User', - }), - }; - return ( - displayNameRecord[schemaName] || - i18n.translate('xpack.endpoint.resolver.userEventTypeDisplayUnknown', { - defaultMessage: 'Unknown', - }) - ); -}; - -/** - * An artifact that represents a process node and the things associated with it in the Resolver - */ -export const ProcessEventDot = styled( - React.memo( - ({ - className, - position, - event, - projectionMatrix, - adjacentNodeMap, - relatedEvents, - }: { - /** - * A `className` string provided by `styled` - */ - className?: string; - /** - * The positon of the process node, in 'world' coordinates. - */ - position: Vector2; - /** - * An event which contains details about the process node. - */ - event: ResolverEvent; - /** - * projectionMatrix which can be used to convert `position` to screen coordinates. - */ - projectionMatrix: Matrix3; - /** - * map of what nodes are "adjacent" to this one in "up, down, previous, next" directions - */ - adjacentNodeMap: AdjacentProcessMap; - /** - * A collection of events related to the current node and statistics (e.g. counts indexed by event type) - * to provide the user some visibility regarding the contents thereof. - */ - relatedEvents?: RelatedEventEntryWithStatsOrWaiting; - }) => { - /** - * Convert the position, which is in 'world' coordinates, to screen coordinates. - */ - const [left, top] = applyMatrix3(position, projectionMatrix); - - const [magFactorX] = projectionMatrix; - - const selfId = adjacentNodeMap.self; - - const activeDescendantId = useSelector(selectors.uiActiveDescendantId); - const selectedDescendantId = useSelector(selectors.uiSelectedDescendantId); - - const logicalProcessNodeViewWidth = 360; - const logicalProcessNodeViewHeight = 120; - /** - * The `left` and `top` values represent the 'center' point of the process node. - * Since the view has content to the left and above the 'center' point, offset the - * position to accomodate for that. This aligns the logical center of the process node - * with the correct position on the map. - */ - const processNodeViewXOffset = -0.172413 * logicalProcessNodeViewWidth * magFactorX; - const processNodeViewYOffset = -0.73684 * logicalProcessNodeViewHeight * magFactorX; - - const nodeViewportStyle = useMemo( - () => ({ - left: `${left + processNodeViewXOffset}px`, - top: `${top + processNodeViewYOffset}px`, - // Width of symbol viewport scaled to fit - width: `${logicalProcessNodeViewWidth * magFactorX}px`, - // Height according to symbol viewbox AR - height: `${logicalProcessNodeViewHeight * magFactorX}px`, - }), - [left, magFactorX, processNodeViewXOffset, processNodeViewYOffset, top] - ); - - /** - * Type in non-SVG components scales as follows: - * (These values were adjusted to match the proportions in the comps provided by UX/Design) - * 18.75 : The smallest readable font size at which labels/descriptions can be read. Font size will not scale below this. - * 12.5 : A 'slope' at which the font size will scale w.r.t. to zoom level otherwise - */ - const minimumFontSize = 18.75; - const slopeOfFontScale = 12.5; - const fontSizeAdjustmentForScale = magFactorX > 1 ? slopeOfFontScale * (magFactorX - 1) : 0; - const scaledTypeSize = minimumFontSize + fontSizeAdjustmentForScale; - - const markerBaseSize = 15; - const markerSize = markerBaseSize; - const markerPositionOffset = -markerBaseSize / 2; - - /** - * An element that should be animated when the node is clicked. - */ - const animationTarget: { - current: - | (SVGAnimationElement & { - /** - * `beginElement` is by [w3](https://www.w3.org/TR/SVG11/animate.html#__smil__ElementTimeControl__beginElement) - * but missing in [TSJS-lib-generator](https://github.com/microsoft/TSJS-lib-generator/blob/15a4678e0ef6de308e79451503e444e9949ee849/inputfiles/addedTypes.json#L1819) - */ - beginElement: () => void; - }) - | null; - } = React.createRef(); - const { cubeSymbol, labelBackground, descriptionText } = nodeAssets[nodeType(event)]; - const resolverNodeIdGenerator = useMemo(() => htmlIdGenerator('resolverNode'), []); - - const nodeId = useMemo(() => resolverNodeIdGenerator(selfId), [ - resolverNodeIdGenerator, - selfId, - ]); - const labelId = useMemo(() => resolverNodeIdGenerator(), [resolverNodeIdGenerator]); - const descriptionId = useMemo(() => resolverNodeIdGenerator(), [resolverNodeIdGenerator]); - const isActiveDescendant = nodeId === activeDescendantId; - const isSelectedDescendant = nodeId === selectedDescendantId; - - const dispatch = useResolverDispatch(); - - const handleFocus = useCallback(() => { - dispatch({ - type: 'userFocusedOnResolverNode', - payload: { - nodeId, - }, - }); - }, [dispatch, nodeId]); - - const handleClick = useCallback(() => { - if (animationTarget.current !== null) { - (animationTarget.current as any).beginElement(); - } - dispatch({ - type: 'userSelectedResolverNode', - payload: { - nodeId, - }, - }); - }, [animationTarget, dispatch, nodeId]); - - const handleRelatedEventRequest = useCallback(() => { - dispatch({ - type: 'userRequestedRelatedEventData', - payload: event, - }); - }, [dispatch, event]); - - const handleRelatedAlertsRequest = useCallback(() => { - dispatch({ - type: 'userSelectedRelatedAlerts', - payload: event, - }); - }, [dispatch, event]); - /** - * Enumerates the stats for related events to display with the node as options, - * generally in the form `number of related events in category` `category title` - * e.g. "10 DNS", "230 File" - */ - const relatedEventOptions = useMemo(() => { - if (relatedEvents === 'error') { - // Return an empty set of options if there was an error requesting them - return []; - } - const relatedStats = typeof relatedEvents === 'object' && relatedEvents.stats; - if (!relatedStats) { - // Return an empty set of options if there are no stats to report - return []; - } - // If we have entries to show, map them into options to display in the selectable list - return Object.entries(relatedStats).map(statsEntry => { - const displayName = getDisplayName(statsEntry[0]); - return { - prefix: , - optionTitle: `${displayName}`, - action: () => { - dispatch({ - type: 'userSelectedRelatedEventCategory', - payload: { - subject: event, - category: statsEntry[0], - }, - }); - }, - }; - }); - }, [relatedEvents, dispatch, event]); - - const relatedEventStatusOrOptions = (() => { - if (!relatedEvents) { - // If related events have not yet been requested - return subMenuAssets.initialMenuStatus; - } - if (relatedEvents === 'error') { - // If there was an error when we tried to request the events - return subMenuAssets.menuError; - } - if (relatedEvents === 'waitingForRelatedEventData') { - // If we're waiting for events to be returned - // Pass on the waiting symbol - return relatedEvents; - } - return relatedEventOptions; - })(); - - /* eslint-disable jsx-a11y/click-events-have-key-events */ - /** - * Key event handling (e.g. 'Enter'/'Space') is provisioned by the `EuiKeyboardAccessible` component - */ - return ( - -
- - - - - - - - -
-
- {descriptionText} -
-
= 2 ? 'euiButton' : 'euiButton euiButton--small'} - data-test-subject="nodeLabel" - id={labelId} - style={{ - backgroundColor: labelBackground, - padding: '.15rem 0', - textAlign: 'center', - maxWidth: '20rem', - minWidth: '12rem', - width: '60%', - overflow: 'hidden', - whiteSpace: 'nowrap', - textOverflow: 'ellipsis', - contain: 'content', - margin: '.25rem 0 .35rem 0', - }} - > - - - {eventModel.eventName(event)} - - -
- {magFactorX >= 2 && ( - - - - - - - - - )} -
-
-
- ); - /* eslint-enable jsx-a11y/click-events-have-key-events */ - } - ) -)` - position: absolute; - text-align: left; - font-size: 10px; - user-select: none; - box-sizing: border-box; - border-radius: 10%; - white-space: nowrap; - will-change: left, top, width, height; - contain: layout; - min-width: 280px; - min-height: 90px; - overflow-y: visible; - - //dasharray & dashoffset should be equal to "pull" the stroke back - //when it is transitioned. - //The value is tuned to look good when animated, but to preserve - //the effect, it should always be _at least_ the length of the stroke - & .backing { - stroke-dasharray: 500; - stroke-dashoffset: 500; - } - &[aria-current] .backing { - transition-property: stroke-dashoffset; - transition-duration: 1s; - stroke-dashoffset: 0; - } - - & .related-dropdown { - width: 4.5em; - } - & .euiSelectableList-bordered { - border-top-right-radius: 0px; - border-top-left-radius: 0px; - } - & .euiSelectableListItem { - background-color: black; - } - & .euiSelectableListItem path { - fill: white; - } - & .euiSelectableListItem__text { - color: white; - } -`; - -const processTypeToCube: Record = { - processCreated: 'runningProcessCube', - processRan: 'runningProcessCube', - processTerminated: 'terminatedProcessCube', - unknownProcessEvent: 'runningProcessCube', - processCausedAlert: 'runningTriggerCube', - unknownEvent: 'runningProcessCube', -}; - -function nodeType(processEvent: ResolverEvent): keyof typeof nodeAssets { - const processType = processModel.eventType(processEvent); - - if (processType in processTypeToCube) { - return processTypeToCube[processType]; - } - return 'runningProcessCube'; -} diff --git a/x-pack/plugins/endpoint/public/index.ts b/x-pack/plugins/endpoint/public/index.ts deleted file mode 100644 index e6a7683efd9a3..0000000000000 --- a/x-pack/plugins/endpoint/public/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { PluginInitializer } from 'kibana/public'; -import { - EndpointPlugin, - EndpointPluginStart, - EndpointPluginSetup, - EndpointPluginStartDependencies, - EndpointPluginSetupDependencies, -} from './plugin'; - -export const plugin: PluginInitializer< - EndpointPluginSetup, - EndpointPluginStart, - EndpointPluginSetupDependencies, - EndpointPluginStartDependencies -> = () => new EndpointPlugin(); diff --git a/x-pack/plugins/endpoint/public/plugin.ts b/x-pack/plugins/endpoint/public/plugin.ts deleted file mode 100644 index 9964454add801..0000000000000 --- a/x-pack/plugins/endpoint/public/plugin.ts +++ /dev/null @@ -1,71 +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 { Plugin, CoreSetup, AppMountParameters, CoreStart } from 'kibana/public'; -import { EmbeddableSetup } from 'src/plugins/embeddable/public'; -import { DataPublicPluginStart } from 'src/plugins/data/public'; -import { i18n } from '@kbn/i18n'; -import { IngestManagerStart } from '../../ingest_manager/public'; -import { ResolverEmbeddableFactory } from './embeddables/resolver'; - -export type EndpointPluginStart = void; -export type EndpointPluginSetup = void; -export interface EndpointPluginSetupDependencies { - embeddable: EmbeddableSetup; - data: DataPublicPluginStart; -} -export interface EndpointPluginStartDependencies { - data: DataPublicPluginStart; - ingestManager: IngestManagerStart; -} - -/** - * Functionality that the endpoint plugin uses from core. - */ -export interface EndpointPluginServices extends Partial { - http: CoreStart['http']; - overlays: CoreStart['overlays'] | undefined; - notifications: CoreStart['notifications'] | undefined; - data: DataPublicPluginStart; -} - -export class EndpointPlugin - implements - Plugin< - EndpointPluginSetup, - EndpointPluginStart, - EndpointPluginSetupDependencies, - EndpointPluginStartDependencies - > { - public setup( - core: CoreSetup, - plugins: EndpointPluginSetupDependencies - ) { - core.application.register({ - id: 'endpoint', - title: i18n.translate('xpack.endpoint.pluginTitle', { - defaultMessage: 'Endpoint', - }), - euiIconType: 'securityApp', - async mount(params: AppMountParameters) { - const [coreStart, depsStart] = await core.getStartServices(); - const { renderApp } = await import('./applications/endpoint'); - return renderApp(coreStart, depsStart, params); - }, - }); - - const resolverEmbeddableFactory = new ResolverEmbeddableFactory(); - - plugins.embeddable.registerEmbeddableFactory( - resolverEmbeddableFactory.type, - resolverEmbeddableFactory - ); - } - - public start() {} - - public stop() {} -} diff --git a/x-pack/plugins/endpoint/server/index.ts b/x-pack/plugins/endpoint/server/index.ts deleted file mode 100644 index ae603b7e44449..0000000000000 --- a/x-pack/plugins/endpoint/server/index.ts +++ /dev/null @@ -1,26 +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 { PluginInitializer, PluginInitializerContext } from 'src/core/server'; -import { - EndpointPlugin, - EndpointPluginStart, - EndpointPluginSetup, - EndpointPluginStartDependencies, - EndpointPluginSetupDependencies, -} from './plugin'; -import { EndpointConfigSchema } from './config'; - -export const config = { - schema: EndpointConfigSchema, -}; - -export const plugin: PluginInitializer< - EndpointPluginSetup, - EndpointPluginStart, - EndpointPluginSetupDependencies, - EndpointPluginStartDependencies -> = (initializerContext: PluginInitializerContext) => new EndpointPlugin(initializerContext); diff --git a/x-pack/plugins/endpoint/server/plugin.test.ts b/x-pack/plugins/endpoint/server/plugin.test.ts deleted file mode 100644 index 215b26942bcdb..0000000000000 --- a/x-pack/plugins/endpoint/server/plugin.test.ts +++ /dev/null @@ -1,59 +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 { - EndpointPlugin, - EndpointPluginSetupDependencies, - EndpointPluginStartDependencies, -} from './plugin'; -import { coreMock } from '../../../../src/core/server/mocks'; -import { PluginSetupContract } from '../../features/server'; -import { createMockIngestManagerStartContract } from './mocks'; - -describe('test endpoint plugin', () => { - let plugin: EndpointPlugin; - let mockCoreSetup: ReturnType; - let mockCoreStart: ReturnType; - let mockedEndpointPluginSetupDependencies: jest.Mocked; - let mockedEndpointPluginStartDependencies: jest.Mocked; - let mockedPluginSetupContract: jest.Mocked; - beforeEach(() => { - plugin = new EndpointPlugin( - coreMock.createPluginInitializerContext({ - cookieName: 'sid', - sessionTimeout: 1500, - }) - ); - - mockCoreSetup = coreMock.createSetup(); - mockCoreStart = coreMock.createStart(); - mockedPluginSetupContract = { - registerFeature: jest.fn(), - getFeatures: jest.fn(), - getFeaturesUICapabilities: jest.fn(), - }; - }); - - it('test properly setup plugin', async () => { - mockedEndpointPluginSetupDependencies = { - features: mockedPluginSetupContract, - }; - await plugin.setup(mockCoreSetup, mockedEndpointPluginSetupDependencies); - expect(mockedPluginSetupContract.registerFeature).toBeCalledTimes(1); - expect(mockCoreSetup.http.createRouter).toBeCalledTimes(1); - expect(() => plugin.getEndpointAppContextService().getIndexPatternRetriever()).toThrow(Error); - expect(() => plugin.getEndpointAppContextService().getAgentService()).toThrow(Error); - }); - - it('test properly start plugin', async () => { - mockedEndpointPluginStartDependencies = { - ingestManager: createMockIngestManagerStartContract(''), - }; - await plugin.start(mockCoreStart, mockedEndpointPluginStartDependencies); - expect(plugin.getEndpointAppContextService().getAgentService()).toBeTruthy(); - expect(plugin.getEndpointAppContextService().getIndexPatternRetriever()).toBeTruthy(); - }); -}); diff --git a/x-pack/plugins/endpoint/server/plugin.ts b/x-pack/plugins/endpoint/server/plugin.ts deleted file mode 100644 index ff10b9c0416f9..0000000000000 --- a/x-pack/plugins/endpoint/server/plugin.ts +++ /dev/null @@ -1,108 +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 { Plugin, CoreSetup, PluginInitializerContext, Logger, CoreStart } from 'kibana/server'; -import { first } from 'rxjs/operators'; -import { PluginSetupContract as FeaturesPluginSetupContract } from '../../features/server'; -import { createConfig$, EndpointConfigType } from './config'; -import { EndpointAppContext } from './types'; - -import { registerAlertRoutes } from './routes/alerts'; -import { registerResolverRoutes } from './routes/resolver'; -import { registerIndexPatternRoute } from './routes/index_pattern'; -import { registerEndpointRoutes } from './routes/metadata'; -import { IngestIndexPatternRetriever } from './index_pattern'; -import { IngestManagerStartContract } from '../../ingest_manager/server'; -import { EndpointAppContextService } from './endpoint_app_context_services'; -import { registerPolicyRoutes } from './routes/policy'; - -export type EndpointPluginStart = void; -export type EndpointPluginSetup = void; -export interface EndpointPluginStartDependencies { - ingestManager: IngestManagerStartContract; -} - -export interface EndpointPluginSetupDependencies { - features: FeaturesPluginSetupContract; -} - -export class EndpointPlugin - implements - Plugin< - EndpointPluginSetup, - EndpointPluginStart, - EndpointPluginSetupDependencies, - EndpointPluginStartDependencies - > { - private readonly logger: Logger; - private readonly endpointAppContextService: EndpointAppContextService = new EndpointAppContextService(); - constructor(private readonly initializerContext: PluginInitializerContext) { - this.logger = this.initializerContext.logger.get('endpoint'); - } - - public getEndpointAppContextService(): EndpointAppContextService { - return this.endpointAppContextService; - } - - public setup(core: CoreSetup, plugins: EndpointPluginSetupDependencies) { - plugins.features.registerFeature({ - id: 'endpoint', - name: 'Endpoint', - icon: 'bug', - navLinkId: 'endpoint', - app: ['endpoint', 'kibana'], - privileges: { - all: { - app: ['endpoint', 'kibana'], - api: ['resolver'], - savedObject: { - all: [], - read: [], - }, - ui: ['save'], - }, - read: { - app: ['endpoint', 'kibana'], - api: [], - savedObject: { - all: [], - read: [], - }, - ui: [], - }, - }, - }); - const endpointContext = { - logFactory: this.initializerContext.logger, - service: this.endpointAppContextService, - config: (): Promise => { - return createConfig$(this.initializerContext) - .pipe(first()) - .toPromise(); - }, - } as EndpointAppContext; - const router = core.http.createRouter(); - registerEndpointRoutes(router, endpointContext); - registerResolverRoutes(router, endpointContext); - registerAlertRoutes(router, endpointContext); - registerIndexPatternRoute(router, endpointContext); - registerPolicyRoutes(router, endpointContext); - } - - public start(core: CoreStart, plugins: EndpointPluginStartDependencies) { - this.logger.debug('Starting plugin'); - this.endpointAppContextService.start({ - indexPatternRetriever: new IngestIndexPatternRetriever( - plugins.ingestManager.esIndexPatternService, - this.initializerContext.logger - ), - agentService: plugins.ingestManager.agentService, - }); - } - public stop() { - this.logger.debug('Stopping plugin'); - this.endpointAppContextService.stop(); - } -} diff --git a/x-pack/plugins/endpoint/server/routes/alerts/details/index.ts b/x-pack/plugins/endpoint/server/routes/alerts/details/index.ts deleted file mode 100644 index 3939594fe465c..0000000000000 --- a/x-pack/plugins/endpoint/server/routes/alerts/details/index.ts +++ /dev/null @@ -1,8 +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. - */ - -export { alertDetailsReqSchema } from './schemas'; -export { alertDetailsHandlerWrapper } from './handlers'; diff --git a/x-pack/plugins/endpoint/server/routes/alerts/list/index.ts b/x-pack/plugins/endpoint/server/routes/alerts/list/index.ts deleted file mode 100644 index cf72ea4d199de..0000000000000 --- a/x-pack/plugins/endpoint/server/routes/alerts/list/index.ts +++ /dev/null @@ -1,7 +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. - */ - -export { alertListHandlerWrapper } from './handlers'; diff --git a/x-pack/plugins/endpoint/server/routes/alerts/types.ts b/x-pack/plugins/endpoint/server/routes/alerts/types.ts deleted file mode 100644 index 5aefc35b5758f..0000000000000 --- a/x-pack/plugins/endpoint/server/routes/alerts/types.ts +++ /dev/null @@ -1,99 +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 { Query, Filter, TimeRange } from '../../../../../../src/plugins/data/server'; -import { JsonObject } from '../../../../../../src/plugins/kibana_utils/public'; -import { AlertAPIOrdering } from '../../../common/types'; - -/** - * Sort parameters for alerts in ES. - */ -export interface AlertSortParam { - [key: string]: { - order: AlertAPIOrdering; - missing?: UndefinedResultPosition; - }; -} - -/** - * Sort array for alerts. - */ -export type AlertSort = [AlertSortParam, AlertSortParam]; - -/** - * Cursor-based pagination params. - */ -export type SearchCursor = [string, string]; - -/** - * Request metadata used in searching alerts. - */ -export interface AlertSearchQuery { - pageSize: number; - pageIndex?: number; - fromIndex?: number; - query: Query; - filters: Filter[]; - dateRange?: TimeRange; - sort: string; - order: AlertAPIOrdering; - searchAfter?: SearchCursor; - searchBefore?: SearchCursor; - emptyStringIsUndefined?: boolean; -} - -/** - * ES request body for alerts. - */ -export interface AlertSearchRequest { - track_total_hits: number; - query: JsonObject; - sort: AlertSort; - search_after?: SearchCursor; -} - -/** - * Request for alerts. - */ -export interface AlertSearchRequestWrapper { - index: string; - size: number; - from?: number; - body: AlertSearchRequest; -} - -/** - * Request params for alert details. - */ -export interface AlertDetailsRequestParams { - id: string; -} - -/** - * Request params for alert queries. - * - * Must match exactly the values that the API receives. - */ -export interface AlertListRequestQuery { - page_index?: number; - page_size: number; - query?: string; - filters?: string; - date_range: string; - sort: string; - order: AlertAPIOrdering; - after?: SearchCursor; - before?: SearchCursor; - empty_string_is_undefined?: boolean; -} - -/** - * Indicates whether undefined results are sorted to the beginning (_first) or end (_last) - * of a result set. - */ -export enum UndefinedResultPosition { - first = '_first', - last = '_last', -} diff --git a/x-pack/plugins/endpoint/server/routes/index_pattern.ts b/x-pack/plugins/endpoint/server/routes/index_pattern.ts deleted file mode 100644 index 7e78caaf178e4..0000000000000 --- a/x-pack/plugins/endpoint/server/routes/index_pattern.ts +++ /dev/null @@ -1,43 +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 { IRouter, Logger, RequestHandler } from 'kibana/server'; -import { EndpointAppContext } from '../types'; -import { IndexPatternGetParamsResult } from '../../common/types'; -import { AlertConstants } from '../../common/alert_constants'; -import { indexPatternGetParamsSchema } from '../../common/schema/index_pattern'; - -function handleIndexPattern( - log: Logger, - endpointAppContext: EndpointAppContext -): RequestHandler { - return async (context, req, res) => { - try { - const indexRetriever = endpointAppContext.service.getIndexPatternRetriever(); - return res.ok({ - body: { - indexPattern: await indexRetriever.getIndexPattern(context, req.params.datasetPath), - }, - }); - } catch (error) { - log.warn(error); - return res.notFound({ body: error }); - } - }; -} - -export function registerIndexPatternRoute(router: IRouter, endpointAppContext: EndpointAppContext) { - const log = endpointAppContext.logFactory.get('index_pattern'); - - router.get( - { - path: `${AlertConstants.INDEX_PATTERN_ROUTE}/{datasetPath}`, - validate: { params: indexPatternGetParamsSchema }, - options: { authRequired: true }, - }, - handleIndexPattern(log, endpointAppContext) - ); -} diff --git a/x-pack/plugins/endpoint/yarn.lock b/x-pack/plugins/endpoint/yarn.lock deleted file mode 120000 index 6e09764ec763b..0000000000000 --- a/x-pack/plugins/endpoint/yarn.lock +++ /dev/null @@ -1 +0,0 @@ -../../../yarn.lock \ No newline at end of file diff --git a/x-pack/plugins/index_management/__jest__/client_integration/helpers/home.helpers.ts b/x-pack/plugins/index_management/__jest__/client_integration/helpers/home.helpers.ts index 397a78354f470..eb4a604779a24 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/helpers/home.helpers.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/helpers/home.helpers.ts @@ -35,6 +35,7 @@ export interface IdxMgmtHomeTestBed extends TestBed { actions: { selectHomeTab: (tab: 'indicesTab' | 'templatesTab') => void; selectDetailsTab: (tab: 'summary' | 'settings' | 'mappings' | 'aliases') => void; + selectIndexDetailsTab: (tab: 'settings' | 'mappings' | 'stats' | 'edit_settings') => void; clickReloadButton: () => void; clickTemplateAction: ( name: TemplateDeserialized['name'], @@ -123,12 +124,26 @@ export const setup = async (): Promise => { find('closeDetailsButton').simulate('click'); }; + const selectIndexDetailsTab = async ( + tab: 'settings' | 'mappings' | 'stats' | 'edit_settings' + ) => { + const indexDetailsTabs = ['settings', 'mappings', 'stats', 'edit_settings']; + const { find, component } = testBed; + await act(async () => { + find('detailPanelTab') + .at(indexDetailsTabs.indexOf(tab)) + .simulate('click'); + }); + component.update(); + }; + return { ...testBed, findAction, actions: { selectHomeTab, selectDetailsTab, + selectIndexDetailsTab, clickReloadButton, clickTemplateAction, clickTemplateAt, @@ -158,7 +173,9 @@ export type TestSubjects = | 'noSettingsCallout' | 'indicesList' | 'indicesTab' + | 'indexTableIndexNameLink' | 'reloadButton' + | 'reloadIndicesButton' | 'row' | 'sectionError' | 'sectionLoading' diff --git a/x-pack/plugins/index_management/__jest__/client_integration/home.test.ts b/x-pack/plugins/index_management/__jest__/client_integration/home.test.ts index a987535e0c291..54345077949b8 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/home.test.ts +++ b/x-pack/plugins/index_management/__jest__/client_integration/home.test.ts @@ -515,4 +515,63 @@ describe('', () => { }); }); }); + + describe('index detail panel with % character in index name', () => { + const indexName = 'test%'; + beforeEach(async () => { + const index = { + health: 'green', + status: 'open', + primary: 1, + replica: 1, + documents: 10000, + documents_deleted: 100, + size: '156kb', + primary_size: '156kb', + name: indexName, + }; + httpRequestsMockHelpers.setLoadIndicesResponse([index]); + + testBed = await setup(); + const { component, find } = testBed; + + component.update(); + + find('indexTableIndexNameLink') + .at(0) + .simulate('click'); + }); + + test('should encode indexName when loading settings in detail panel', async () => { + const { actions } = testBed; + await actions.selectIndexDetailsTab('settings'); + + const latestRequest = server.requests[server.requests.length - 1]; + expect(latestRequest.url).toBe(`${API_BASE_PATH}/settings/${encodeURIComponent(indexName)}`); + }); + + test('should encode indexName when loading mappings in detail panel', async () => { + const { actions } = testBed; + await actions.selectIndexDetailsTab('mappings'); + + const latestRequest = server.requests[server.requests.length - 1]; + expect(latestRequest.url).toBe(`${API_BASE_PATH}/mapping/${encodeURIComponent(indexName)}`); + }); + + test('should encode indexName when loading stats in detail panel', async () => { + const { actions } = testBed; + await actions.selectIndexDetailsTab('stats'); + + const latestRequest = server.requests[server.requests.length - 1]; + expect(latestRequest.url).toBe(`${API_BASE_PATH}/stats/${encodeURIComponent(indexName)}`); + }); + + test('should encode indexName when editing settings in detail panel', async () => { + const { actions } = testBed; + await actions.selectIndexDetailsTab('edit_settings'); + + const latestRequest = server.requests[server.requests.length - 1]; + expect(latestRequest.url).toBe(`${API_BASE_PATH}/settings/${encodeURIComponent(indexName)}`); + }); + }); }); diff --git a/x-pack/plugins/index_management/public/application/services/api.ts b/x-pack/plugins/index_management/public/application/services/api.ts index c09c4f44c4e3a..181707b3661b4 100644 --- a/x-pack/plugins/index_management/public/application/services/api.ts +++ b/x-pack/plugins/index_management/public/application/services/api.ts @@ -168,26 +168,35 @@ export async function unfreezeIndices(indices: string[]) { } export async function loadIndexSettings(indexName: string) { - const response = await httpService.httpClient.get(`${API_BASE_PATH}/settings/${indexName}`); + const response = await httpService.httpClient.get( + `${API_BASE_PATH}/settings/${encodeURIComponent(indexName)}` + ); return response; } export async function updateIndexSettings(indexName: string, body: object) { - const response = await httpService.httpClient.put(`${API_BASE_PATH}/settings/${indexName}`, { - body: JSON.stringify(body), - }); + const response = await httpService.httpClient.put( + `${API_BASE_PATH}/settings/${encodeURIComponent(indexName)}`, + { + body: JSON.stringify(body), + } + ); // Only track successful requests. uiMetricService.trackMetric('count', UIM_UPDATE_SETTINGS); return response; } export async function loadIndexStats(indexName: string) { - const response = await httpService.httpClient.get(`${API_BASE_PATH}/stats/${indexName}`); + const response = await httpService.httpClient.get( + `${API_BASE_PATH}/stats/${encodeURIComponent(indexName)}` + ); return response; } export async function loadIndexMapping(indexName: string) { - const response = await httpService.httpClient.get(`${API_BASE_PATH}/mapping/${indexName}`); + const response = await httpService.httpClient.get( + `${API_BASE_PATH}/mapping/${encodeURIComponent(indexName)}` + ); return response; } diff --git a/x-pack/plugins/infra/common/http_api/metrics_explorer.ts b/x-pack/plugins/infra/common/http_api/metrics_explorer.ts index d3a978c9963cf..0f63b8d275e65 100644 --- a/x-pack/plugins/infra/common/http_api/metrics_explorer.ts +++ b/x-pack/plugins/infra/common/http_api/metrics_explorer.ts @@ -52,9 +52,12 @@ export const metricsExplorerRequestBodyRequiredFieldsRT = rt.type({ metrics: rt.array(metricsExplorerMetricRT), }); +const groupByRT = rt.union([rt.string, rt.null, rt.undefined]); +export const afterKeyObjectRT = rt.record(rt.string, rt.union([rt.string, rt.null])); + export const metricsExplorerRequestBodyOptionalFieldsRT = rt.partial({ - groupBy: rt.union([rt.string, rt.null, rt.undefined]), - afterKey: rt.union([rt.string, rt.null, rt.undefined]), + groupBy: rt.union([groupByRT, rt.array(groupByRT)]), + afterKey: rt.union([rt.string, rt.null, rt.undefined, afterKeyObjectRT]), limit: rt.union([rt.number, rt.null, rt.undefined]), filterQuery: rt.union([rt.string, rt.null, rt.undefined]), forceInterval: rt.boolean, @@ -68,7 +71,7 @@ export const metricsExplorerRequestBodyRT = rt.intersection([ export const metricsExplorerPageInfoRT = rt.type({ total: rt.number, - afterKey: rt.union([rt.string, rt.null]), + afterKey: rt.union([rt.string, rt.null, afterKeyObjectRT]), }); export const metricsExplorerColumnTypeRT = rt.keyof({ @@ -89,11 +92,16 @@ export const metricsExplorerRowRT = rt.intersection([ rt.record(rt.string, rt.union([rt.string, rt.number, rt.null, rt.undefined])), ]); -export const metricsExplorerSeriesRT = rt.type({ - id: rt.string, - columns: rt.array(metricsExplorerColumnRT), - rows: rt.array(metricsExplorerRowRT), -}); +export const metricsExplorerSeriesRT = rt.intersection([ + rt.type({ + id: rt.string, + columns: rt.array(metricsExplorerColumnRT), + rows: rt.array(metricsExplorerRowRT), + }), + rt.partial({ + keys: rt.array(rt.string), + }), +]); export const metricsExplorerResponseRT = rt.type({ series: rt.array(metricsExplorerSeriesRT), diff --git a/x-pack/plugins/infra/common/inventory_models/shared/components/metrics_and_groupby_toolbar_items.tsx b/x-pack/plugins/infra/common/inventory_models/shared/components/metrics_and_groupby_toolbar_items.tsx index bf37828ed0856..4a4accc6edfed 100644 --- a/x-pack/plugins/infra/common/inventory_models/shared/components/metrics_and_groupby_toolbar_items.tsx +++ b/x-pack/plugins/infra/common/inventory_models/shared/components/metrics_and_groupby_toolbar_items.tsx @@ -7,6 +7,7 @@ import React, { useMemo } from 'react'; import { EuiFlexItem } from '@elastic/eui'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { WaffleSortControls } from '../../../../public/pages/metrics/inventory_view/components/waffle/waffle_sort_controls'; import { ToolbarProps } from '../../../../public/pages/metrics/inventory_view/components/toolbars/toolbar'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { WaffleMetricControls } from '../../../../public/pages/metrics/inventory_view/components/waffle/metric_control'; @@ -58,6 +59,11 @@ export const MetricsAndGroupByToolbarItems = (props: Props) => { customOptions={props.customOptions} /> + {props.view === 'map' && ( + + + + )} ); }; diff --git a/x-pack/plugins/infra/common/saved_objects/inventory_view.ts b/x-pack/plugins/infra/common/saved_objects/inventory_view.ts index c14b75efc6887..15874f2eee348 100644 --- a/x-pack/plugins/infra/common/saved_objects/inventory_view.ts +++ b/x-pack/plugins/infra/common/saved_objects/inventory_view.ts @@ -21,6 +21,16 @@ export const inventoryViewSavedObjectType: SavedObjectsType = { name: { type: 'keyword', }, + sort: { + properties: { + by: { + type: 'keyword', + }, + direction: { + type: 'keyword', + }, + }, + }, metric: { properties: { type: { diff --git a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx index a176ba756652a..4151fd8d6cf49 100644 --- a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx +++ b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx @@ -138,7 +138,7 @@ export const Expressions: React.FC = props => { ]); const onGroupByChange = useCallback( - (group: string | null) => { + (group: string | null | string[]) => { setAlertParams('groupBy', group || ''); }, [setAlertParams] @@ -206,7 +206,10 @@ export const Expressions: React.FC = props => { convertKueryToElasticSearchQuery(md.currentOptions.filterQuery, derivedIndexPattern) || '' ); } else if (md && md.currentOptions?.groupBy && md.series) { - const filter = `${md.currentOptions?.groupBy}: "${md.series.id}"`; + const { groupBy } = md.currentOptions; + const filter = Array.isArray(groupBy) + ? groupBy.map((field, index) => `${field}: "${md.series?.keys?.[index]}"`).join(' and ') + : `${groupBy}: "${md.series.id}"`; setAlertParams('filterQueryText', filter); setAlertParams( 'filterQuery', diff --git a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx index 7665c4d84e1e9..99f5aa972758d 100644 --- a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx +++ b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx @@ -12,6 +12,8 @@ import { Settings, TooltipValue, RectAnnotation, + AnnotationDomainTypes, + LineAnnotation, } from '@elastic/charts'; import { first, last } from 'lodash'; import moment from 'moment'; @@ -140,6 +142,7 @@ export const ExpressionChart: React.FC = ({ } const isAbove = [Comparator.GT, Comparator.GT_OR_EQ].includes(expression.comparator); + const isBelow = [Comparator.LT, Comparator.LT_OR_EQ].includes(expression.comparator); const opacity = 0.3; const { timeSize, timeUnit } = expression; const timeLabel = TIME_LABELS[timeUnit]; @@ -149,44 +152,49 @@ export const ExpressionChart: React.FC = ({ - {thresholds.length ? ( - `threshold_${i}`)} - series={series} - stack={false} - opacity={opacity} - /> - ) : null} - {thresholds.length && expression.comparator === Comparator.OUTSIDE_RANGE ? ( + ({ + dataValue: threshold, + }))} + style={{ + line: { + strokeWidth: 2, + stroke: colorTransformer(MetricsExplorerColor.color1), + opacity: 1, + }, + }} + /> + {thresholds.length === 2 && expression.comparator === Comparator.BETWEEN ? ( <> - `threshold_${i}`)} - series={series} - stack={false} - opacity={opacity} + dataValues={[ + { + coordinates: { + x0: firstTimestamp, + x1: lastTimestamp, + y0: first(expression.threshold), + y1: last(expression.threshold), + }, + }, + ]} /> + + ) : null} + {thresholds.length === 2 && expression.comparator === Comparator.OUTSIDE_RANGE ? ( + <> = ({ /> ) : null} + {isBelow && first(expression.threshold) != null ? ( + + ) : null} {isAbove && first(expression.threshold) != null ? ( { const { metric, groupBy, + sort, nodeType, accountId, region, @@ -64,6 +65,7 @@ export const Layout = () => { ], } as InfraWaffleMapGradientLegend, metric, + sort, fields: source?.configuration?.fields, groupBy, }; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx index e8485fb812586..6a68599aee38c 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar.tsx @@ -19,17 +19,17 @@ import { ToolbarWrapper } from './toolbar_wrapper'; import { InfraGroupByOptions } from '../../../../../lib/lib'; import { IIndexPattern } from '../../../../../../../../../src/plugins/data/public'; import { InventoryItemType } from '../../../../../../common/inventory_models/types'; -import { WaffleOptionsState } from '../../hooks/use_waffle_options'; +import { WaffleOptionsState, WaffleSortOption } from '../../hooks/use_waffle_options'; import { useInventoryMeta } from '../../hooks/use_inventory_meta'; -export interface ToolbarProps - extends Omit { +export interface ToolbarProps extends Omit { createDerivedIndexPattern: (type: 'logs' | 'metrics' | 'both') => IIndexPattern; changeMetric: (payload: SnapshotMetricInput) => void; changeGroupBy: (payload: SnapshotGroupBy) => void; changeCustomOptions: (payload: InfraGroupByOptions[]) => void; changeAccount: (id: string) => void; changeRegion: (name: string) => void; + changeSort: (sort: WaffleSortOption) => void; accounts: InventoryCloudAccount[]; regions: string[]; changeCustomMetrics: (payload: SnapshotCustomMetricInput[]) => void; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar_wrapper.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar_wrapper.tsx index ea53122984161..3606bcc6944d1 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar_wrapper.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/toolbars/toolbar_wrapper.tsx @@ -25,12 +25,15 @@ export const ToolbarWrapper = (props: Props) => { changeCustomOptions, changeAccount, changeRegion, + changeSort, customOptions, groupBy, metric, nodeType, accountId, + view, region, + sort, customMetrics, changeCustomMetrics, } = useWaffleOptionsContext(); @@ -47,8 +50,11 @@ export const ToolbarWrapper = (props: Props) => { changeAccount, changeRegion, changeCustomOptions, + changeSort, customOptions, groupBy, + sort, + view, metric, nodeType, region, diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/map.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/map.tsx index b1f816fb46d2e..eee8c69091ef0 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/map.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/map.tsx @@ -15,6 +15,7 @@ import { GroupOfNodes } from './group_of_nodes'; import { applyWaffleMapLayout } from '../../lib/apply_wafflemap_layout'; import { SnapshotNode } from '../../../../../../common/http_api/snapshot_api'; import { InventoryItemType } from '../../../../../../common/inventory_models/types'; +import { sortNodes } from '../../lib/sort_nodes'; interface Props { nodes: SnapshotNode[]; @@ -37,7 +38,8 @@ export const Map: React.FC = ({ nodeType, dataBounds, }) => { - const map = nodesToWaffleMap(nodes); + const sortedNodes = sortNodes(options.sort, nodes); + const map = nodesToWaffleMap(sortedNodes); return ( {({ measureRef, content: { width = 0, height = 0 } }) => { diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx index f91e9a4034bc2..0cf1faec06c11 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/index.tsx @@ -132,7 +132,10 @@ export const WaffleMetricControls = ({ } const button = ( - + {currentLabel} ); diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_accounts_controls.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_accounts_controls.tsx index 3e4ff1de8291d..5ac6320510257 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_accounts_controls.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_accounts_controls.tsx @@ -58,7 +58,10 @@ export const WaffleAccountsControls = (props: Props) => { ); const button = ( - + {currentLabel ? currentLabel.name : i18n.translate('xpack.infra.waffle.accountAllTitle', { diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx index c1f406f31e85e..cc09ce226b2fe 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx @@ -130,7 +130,10 @@ export const WaffleGroupByControls = class extends React.PureComponent + {buttonBody} ); diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_inventory_switcher.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_inventory_switcher.tsx index e534c97eda090..c31b7e0a3e6ff 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_inventory_switcher.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_inventory_switcher.tsx @@ -7,6 +7,7 @@ import { EuiPopover, EuiContextMenu, EuiContextMenuPanelDescriptor } from '@elastic/eui'; import React, { useCallback, useState, useMemo } from 'react'; +import { i18n } from '@kbn/i18n'; import { findInventoryModel } from '../../../../../../common/inventory_models'; import { InventoryItemType } from '../../../../../../common/inventory_models/types'; import { useWaffleOptionsContext } from '../../hooks/use_waffle_options'; @@ -115,7 +116,10 @@ export const WaffleInventorySwitcher: React.FC = () => { }, [nodeType]); const button = ( - + {selectedText} ); diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_region_controls.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_region_controls.tsx index 9d759424cdc93..9c28f0798b519 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_region_controls.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_region_controls.tsx @@ -57,7 +57,10 @@ export const WaffleRegionControls = (props: Props) => { ); const button = ( - + {currentLabel || i18n.translate('xpack.infra.waffle.region', { defaultMessage: 'All', diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_sort_controls.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_sort_controls.tsx new file mode 100644 index 0000000000000..b5e6aacd0e6f4 --- /dev/null +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_sort_controls.tsx @@ -0,0 +1,125 @@ +/* + * 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, { useCallback, useMemo, useState, ReactNode } from 'react'; +import { EuiSwitch, EuiContextMenuPanelDescriptor, EuiPopover, EuiContextMenu } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { EuiTheme, withTheme } from '../../../../../../../observability/public'; +import { WaffleSortOption } from '../../hooks/use_waffle_options'; +import { DropdownButton } from '../dropdown_button'; + +interface Props { + sort: WaffleSortOption; + onChange: (sort: WaffleSortOption) => void; +} + +const LABELS = { + name: i18n.translate('xpack.infra.waffle.sortNameLabel', { defaultMessage: 'Name' }), + value: i18n.translate('xpack.infra.waffle.sort.valueLabel', { defaultMessage: 'Metric value' }), +}; + +export const WaffleSortControls = ({ sort, onChange }: Props) => { + const [isOpen, setIsOpen] = useState(false); + + const showPopover = useCallback(() => { + setIsOpen(true); + }, [setIsOpen]); + + const closePopover = useCallback(() => { + setIsOpen(false); + }, [setIsOpen]); + + const label = LABELS[sort.by]; + + const button = ( + + {label} + + ); + + const selectName = useCallback(() => { + onChange({ ...sort, by: 'name' }); + closePopover(); + }, [closePopover, onChange, sort]); + + const selectValue = useCallback(() => { + onChange({ ...sort, by: 'value' }); + closePopover(); + }, [closePopover, onChange, sort]); + + const toggleSort = useCallback(() => { + onChange({ + ...sort, + direction: sort.direction === 'asc' ? 'desc' : 'asc', + }); + }, [sort, onChange]); + + const panels = useMemo( + () => [ + { + id: 0, + title: '', + items: [ + { + name: LABELS.name, + icon: sort.by === 'name' ? 'check' : 'empty', + onClick: selectName, + }, + { + name: LABELS.value, + icon: sort.by === 'value' ? 'check' : 'empty', + onClick: selectValue, + }, + ], + }, + ], + [sort.by, selectName, selectValue] + ); + + return ( + + + + + + + ); +}; + +interface SwitchContainerProps { + theme: EuiTheme; + children: ReactNode; +} + +const SwitchContainer = withTheme(({ children, theme }: SwitchContainerProps) => { + return ( +
+ {children} +
+ ); +}); diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_options.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_options.ts index 32bfe6e085b4e..92f9ee4897f2d 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_options.ts +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_options.ts @@ -32,6 +32,7 @@ export const DEFAULT_WAFFLE_OPTIONS_STATE: WaffleOptionsState = { accountId: '', region: '', customMetrics: [], + sort: { by: 'name', direction: 'desc' }, }; export const useWaffleOptions = () => { @@ -99,7 +100,15 @@ export const useWaffleOptions = () => { [setState] ); + const changeSort = useCallback( + (sort: WaffleSortOption) => { + setState(previous => ({ ...previous, sort })); + }, + [setState] + ); + return { + ...DEFAULT_WAFFLE_OPTIONS_STATE, ...state, changeMetric, changeGroupBy, @@ -111,10 +120,16 @@ export const useWaffleOptions = () => { changeAccount, changeRegion, changeCustomMetrics, + changeSort, setWaffleOptionsState: setState, }; }; +export const WaffleSortOptionRT = rt.type({ + by: rt.keyof({ name: null, value: null }), + direction: rt.keyof({ asc: null, desc: null }), +}); + export const WaffleOptionsStateRT = rt.type({ metric: SnapshotMetricInputRT, groupBy: SnapshotGroupByRT, @@ -134,8 +149,10 @@ export const WaffleOptionsStateRT = rt.type({ accountId: rt.string, region: rt.string, customMetrics: rt.array(SnapshotCustomMetricInputRT), + sort: WaffleSortOptionRT, }); +export type WaffleSortOption = rt.TypeOf; export type WaffleOptionsState = rt.TypeOf; const encodeUrlState = (state: WaffleOptionsState) => { return WaffleOptionsStateRT.encode(state); diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_view_state.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_view_state.ts index 869560b2b8709..306c30228596f 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_view_state.ts +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/hooks/use_waffle_view_state.ts @@ -28,6 +28,7 @@ export const useWaffleViewState = () => { autoBounds, accountId, region, + sort, setWaffleOptionsState, } = useWaffleOptionsContext(); const { currentTime, isAutoReloading, setWaffleTimeState } = useWaffleTimeContext(); @@ -35,6 +36,7 @@ export const useWaffleViewState = () => { const viewState: WaffleViewState = { metric, + sort, groupBy, nodeType, view, @@ -59,6 +61,7 @@ export const useWaffleViewState = () => { const onViewChange = useCallback( (newState: WaffleViewState) => { setWaffleOptionsState({ + sort: newState.sort, metric: newState.metric, groupBy: newState.groupBy, nodeType: newState.nodeType, diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/lib/create_uptime_link.test.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/lib/create_uptime_link.test.ts index 5f760cf2f591e..fe9b2aebe27f7 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/lib/create_uptime_link.test.ts +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/lib/create_uptime_link.test.ts @@ -21,6 +21,7 @@ const options: InfraWaffleMapOptions = { formatTemplate: '{{value}}', metric: { type: 'cpu' }, groupBy: [], + sort: { by: 'name', direction: 'asc' }, legend: { type: 'gradient', rules: [], diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/lib/sort_nodes.ts b/x-pack/plugins/infra/public/pages/metrics/inventory_view/lib/sort_nodes.ts new file mode 100644 index 0000000000000..e676fb3e09c2b --- /dev/null +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/lib/sort_nodes.ts @@ -0,0 +1,23 @@ +/* + * 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 { sortBy, last } from 'lodash'; +import { SnapshotNode } from '../../../../../common/http_api/snapshot_api'; +import { WaffleSortOption } from '../hooks/use_waffle_options'; + +const SORT_PATHS = { + name: (node: SnapshotNode) => last(node.path), + value: 'metric.value', +}; + +export const sortNodes = (sort: WaffleSortOption, nodes: SnapshotNode[]) => { + const sortPath = SORT_PATHS[sort.by]; + const sortedNodes = sortBy(nodes, sortPath); + if (sort.direction === 'desc') { + return sortedNodes.reverse(); + } + return sortedNodes; +}; diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart.tsx index 9bd53118cf0ec..d079b7bb93d73 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart.tsx @@ -36,6 +36,7 @@ import { getChartTheme } from './helpers/get_chart_theme'; import { useKibanaUiSetting } from '../../../../utils/use_kibana_ui_setting'; import { calculateDomain } from './helpers/calculate_domain'; import { useKibana, useUiSetting } from '../../../../../../../../src/plugins/kibana_react/public'; +import { ChartTitle } from './chart_title'; interface Props { title?: string | null; @@ -92,16 +93,17 @@ export const MetricsExplorerChart = ({ chartOptions.yAxisMode === MetricsExplorerYAxisMode.fromZero ? { ...dataDomain, min: 0 } : dataDomain; + return (
{options.groupBy ? ( - + - {title} + - + { - if (source.fields.host === field) { + const fields = Array.isArray(groupBy) ? groupBy : [groupBy]; + if (fields.includes(source.fields.host)) { return 'host'; } - if (source.fields.pod === field) { + if (fields.includes(source.fields.pod)) { return 'pod'; } - if (source.fields.container === field) { + if (fields.includes(source.fields.container)) { return 'container'; } }; @@ -88,10 +89,16 @@ export const MetricsExplorerChartContextMenu: React.FC = ({ // onFilter needs check for Typescript even though it's // covered by supportFiltering variable if (supportFiltering && onFilter) { - onFilter(`${options.groupBy}: "${series.id}"`); + if (Array.isArray(options.groupBy)) { + onFilter( + options.groupBy.map((field, index) => `${field}: "${series.keys?.[index]}"`).join(' and ') + ); + } else { + onFilter(`${options.groupBy}: "${series.id}"`); + } } setPopoverState(false); - }, [supportFiltering, options.groupBy, series.id, onFilter]); + }, [supportFiltering, onFilter, options, series.keys, series.id]); // Only display the "Add Filter" option if it's supported const filterByItem = supportFiltering diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart_title.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart_title.tsx new file mode 100644 index 0000000000000..e756c3bc393ce --- /dev/null +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart_title.tsx @@ -0,0 +1,40 @@ +/* + * 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, { Fragment } from 'react'; +import { EuiText, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { MetricsExplorerSeries } from '../../../../../common/http_api'; + +interface Props { + series: MetricsExplorerSeries; +} + +export const ChartTitle = ({ series }: Props) => { + if (series.keys != null) { + const { keys } = series; + return ( + + {keys.map((name, i) => ( + + + i ? 'subdued' : 'default'}> + {name} + + + {keys.length - 1 > i && ( + + + / + + + )} + + ))} + + ); + } + return {series.id}; +}; diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/charts.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/charts.tsx index ecec116310875..2929a7316bd79 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/charts.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/charts.tsx @@ -19,11 +19,13 @@ import { NoData } from '../../../../components/empty_states/no_data'; import { MetricsExplorerChart } from './chart'; import { SourceQuery } from '../../../../graphql/types'; +type stringOrNull = string | null; + interface Props { loading: boolean; options: MetricsExplorerOptions; chartOptions: MetricsExplorerChartOptions; - onLoadMore: (afterKey: string | null) => void; + onLoadMore: (afterKey: stringOrNull | Record) => void; onRefetch: () => void; onFilter: (filter: string) => void; onTimeChange: (start: string, end: string) => void; @@ -74,6 +76,8 @@ export const MetricsExplorerCharts = ({ ); } + const and = i18n.translate('xpack.infra.metricsExplorer.andLabel', { defaultMessage: '" and "' }); + return (
@@ -105,7 +109,9 @@ export const MetricsExplorerCharts = ({ values={{ length: data.series.length, total: data.pageInfo.total, - groupBy: options.groupBy, + groupBy: Array.isArray(options.groupBy) + ? options.groupBy.join(and) + : options.groupBy, }} />

diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/group_by.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/group_by.tsx index bfe8ddb2e0829..793ddd3ce5691 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/group_by.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/group_by.tsx @@ -13,19 +13,25 @@ import { MetricsExplorerOptions } from '../hooks/use_metrics_explorer_options'; interface Props { options: MetricsExplorerOptions; - onChange: (groupBy: string | null) => void; + onChange: (groupBy: string | null | string[]) => void; fields: IFieldType[]; } export const MetricsExplorerGroupBy = ({ options, onChange, fields }: Props) => { const handleChange = useCallback( - selectedOptions => { - const groupBy = (selectedOptions.length === 1 && selectedOptions[0].label) || null; + (selectedOptions: Array<{ label: string }>) => { + const groupBy = selectedOptions.map(option => option.label); onChange(groupBy); }, [onChange] ); + const selectedOptions = Array.isArray(options.groupBy) + ? options.groupBy.map(field => ({ label: field })) + : options.groupBy + ? [{ label: options.groupBy }] + : []; + return ( defaultMessage: 'Graph per', })} fullWidth - singleSelection={true} - selectedOptions={(options.groupBy && [{ label: options.groupBy }]) || []} + singleSelection={false} + selectedOptions={selectedOptions} options={fields .filter(f => f.aggregatable && f.type === 'string') .map(f => ({ label: f.name }))} diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts index 19ea4cc7f7dec..a81e11418cd6a 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts @@ -109,7 +109,21 @@ export const createFilterFromOptions = ( } if (options.groupBy) { const id = series.id.replace('"', '\\"'); - filters.push(`${options.groupBy} : "${id}"`); + const groupByFilters = Array.isArray(options.groupBy) + ? options.groupBy + .map((field, index) => { + if (!series.keys) { + return null; + } + const value = series.keys[index]; + if (!value) { + return null; + } + return `${field}: "${value.replace('"', '\\"')}"`; + }) + .join(' and ') + : `${options.groupBy} : "${id}"`; + filters.push(groupByFilters); } return { language: 'kuery', query: filters.join(' and ') }; }; diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx index 76945eb528345..7ad1d943a9896 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx @@ -37,7 +37,7 @@ interface Props { defaultViewState: MetricExplorerViewState; onRefresh: () => void; onTimeChange: (start: string, end: string) => void; - onGroupByChange: (groupBy: string | null) => void; + onGroupByChange: (groupBy: string | null | string[]) => void; onFilterQuerySubmit: (query: string) => void; onMetricsChange: (metrics: MetricsExplorerMetric[]) => void; onAggregationChange: (aggregation: MetricsExplorerAggregation) => void; diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts index 8a9ed901de0b0..936c6e456beb7 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts @@ -30,7 +30,7 @@ export const useMetricsExplorerState = ( derivedIndexPattern: IIndexPattern ) => { const [refreshSignal, setRefreshSignal] = useState(0); - const [afterKey, setAfterKey] = useState(null); + const [afterKey, setAfterKey] = useState>(null); const { defaultViewState, options, @@ -63,7 +63,7 @@ export const useMetricsExplorerState = ( ); const handleGroupByChange = useCallback( - (groupBy: string | null) => { + (groupBy: string | null | string[]) => { setAfterKey(null); setOptions({ ...options, diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.test.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.test.tsx index 94edab54fb71e..f0b2627288d45 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.test.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.test.tsx @@ -46,7 +46,7 @@ const renderUseMetricsExplorerDataHook = () => { source, derivedIndexPattern, timeRange, - afterKey: null as string | null, + afterKey: null as string | null | Record, signal: 1, }, wrapper, diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts index 6b4ac8b1ba060..3a767b94d00c7 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_data.ts @@ -28,7 +28,7 @@ export function useMetricsExplorerData( source: SourceQuery.Query['source']['configuration'] | undefined, derivedIndexPattern: IIndexPattern, timerange: MetricsExplorerTimeOptions, - afterKey: string | null, + afterKey: string | null | Record, signal: any, fetch?: HttpHandler ) { diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_options.ts b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_options.ts index f79c7aa0d4d67..56595c09aadde 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_options.ts +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_options.ts @@ -37,7 +37,7 @@ export interface MetricsExplorerChartOptions { export interface MetricsExplorerOptions { metrics: MetricsExplorerOptionsMetric[]; limit?: number; - groupBy?: string; + groupBy?: string | string[]; filterQuery?: string; aggregation: MetricsExplorerAggregation; forceInterval?: boolean; diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts index 71bee3209bf53..9738acd13eb6e 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts @@ -74,7 +74,7 @@ const getParsedFilterQuery: ( export const getElasticsearchMetricQuery = ( { metric, aggType, timeUnit, timeSize }: MetricExpressionParams, timefield: string, - groupBy?: string, + groupBy?: string | string[], filterQuery?: string ) => { if (aggType === Aggregators.COUNT && metric) { @@ -126,15 +126,21 @@ export const getElasticsearchMetricQuery = ( groupings: { composite: { size: 10, - sources: [ - { - groupBy: { - terms: { - field: groupBy, + sources: Array.isArray(groupBy) + ? groupBy.map((field, index) => ({ + [`groupBy${index}`]: { + terms: { field }, }, - }, - }, - ], + })) + : [ + { + groupBy0: { + terms: { + field: groupBy, + }, + }, + }, + ], }, aggs: baseAggs, }, @@ -186,7 +192,7 @@ const getMetric: ( params: MetricExpressionParams, index: string, timefield: string, - groupBy: string | undefined, + groupBy: string | undefined | string[], filterQuery: string | undefined ) => Promise> = async function( { callCluster }, @@ -213,11 +219,13 @@ const getMetric: ( searchBody, bucketSelector, afterKeyHandler - )) as Array; + )) as Array }>; return compositeBuckets.reduce( (result, bucket) => ({ ...result, - [bucket.key.groupBy]: getCurrentValueFromAggregations(bucket, aggType), + [Object.values(bucket.key) + .map(value => value) + .join(', ')]: getCurrentValueFromAggregations(bucket, aggType), }), {} ); @@ -249,7 +257,7 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs, alertId: s async function({ services, params }: AlertExecutorOptions) { const { criteria, groupBy, filterQuery, sourceId, alertOnNoData } = params as { criteria: MetricExpressionParams[]; - groupBy: string | undefined; + groupBy: string | undefined | string[]; filterQuery: string | undefined; sourceId?: string; alertOnNoData: boolean; diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_alert_type.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_alert_type.ts index c1c530131f3a0..8b3903f2ee3be 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_alert_type.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_alert_type.ts @@ -62,7 +62,7 @@ export function registerMetricThresholdAlertType(libs: InfraBackendLibs) { params: schema.object( { criteria: schema.arrayOf(schema.oneOf([countCriterion, nonCountCriterion])), - groupBy: schema.maybe(schema.string()), + groupBy: schema.maybe(schema.oneOf([schema.string(), schema.arrayOf(schema.string())])), filterQuery: schema.maybe( schema.string({ validate: validateIsStringElasticsearchJSONFilter, diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/test_mocks.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/test_mocks.ts index 25b709d6afc51..ee2cf94a2fd62 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/test_mocks.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/test_mocks.ts @@ -64,11 +64,11 @@ export const emptyMetricResponse = { export const basicCompositeResponse = { aggregations: { groupings: { - after_key: 'foo', + after_key: { groupBy0: 'foo' }, buckets: [ { key: { - groupBy: 'a', + groupBy0: 'a', }, aggregatedIntervals: { buckets: bucketsA, @@ -76,7 +76,7 @@ export const basicCompositeResponse = { }, { key: { - groupBy: 'b', + groupBy0: 'b', }, aggregatedIntervals: { buckets: bucketsB, @@ -95,11 +95,11 @@ export const basicCompositeResponse = { export const alternateCompositeResponse = { aggregations: { groupings: { - after_key: 'foo', + after_key: { groupBy0: 'foo' }, buckets: [ { key: { - groupBy: 'a', + groupBy0: 'a', }, aggregatedIntervals: { buckets: bucketsB, @@ -107,7 +107,7 @@ export const alternateCompositeResponse = { }, { key: { - groupBy: 'b', + groupBy0: 'b', }, aggregatedIntervals: { buckets: bucketsA, diff --git a/x-pack/plugins/infra/server/routes/metrics_explorer/lib/get_groupings.ts b/x-pack/plugins/infra/server/routes/metrics_explorer/lib/get_groupings.ts index 47dc58997a469..a6510b2ba1478 100644 --- a/x-pack/plugins/infra/server/routes/metrics_explorer/lib/get_groupings.ts +++ b/x-pack/plugins/infra/server/routes/metrics_explorer/lib/get_groupings.ts @@ -5,10 +5,12 @@ */ import { isObject, set } from 'lodash'; +import { i18n } from '@kbn/i18n'; import { InfraDatabaseSearchResponse } from '../../../lib/adapters/framework'; import { MetricsExplorerRequestBody, MetricsExplorerResponse, + afterKeyObjectRT, } from '../../../../common/http_api/metrics_explorer'; interface GroupingAggregation { @@ -24,7 +26,13 @@ interface GroupingAggregation { } const EMPTY_RESPONSE = { - series: [{ id: 'ALL', columns: [], rows: [] }], + series: [ + { + id: i18n.translate('xpack.infra.metricsExploer.everything', { defaultMessage: 'Everything' }), + columns: [], + rows: [], + }, + ], pageInfo: { total: 0, afterKey: null }, }; @@ -35,7 +43,25 @@ export const getGroupings = async ( if (!options.groupBy) { return EMPTY_RESPONSE; } + + if (Array.isArray(options.groupBy) && options.groupBy.length === 0) { + return EMPTY_RESPONSE; + } + const limit = options.limit || 9; + const groupBy = Array.isArray(options.groupBy) ? options.groupBy : [options.groupBy]; + const filter: Array> = [ + { + range: { + [options.timerange.field]: { + gte: options.timerange.from, + lte: options.timerange.to, + format: 'epoch_millis', + }, + }, + }, + ...groupBy.map(field => ({ exists: { field } })), + ]; const params = { allowNoIndices: true, ignoreUnavailable: true, @@ -51,27 +77,21 @@ export const getGroupings = async ( exists: { field: m.field }, })), ], - filter: [ - { - range: { - [options.timerange.field]: { - gte: options.timerange.from, - lte: options.timerange.to, - format: 'epoch_millis', - }, - }, - }, - ] as object[], + filter, }, }, aggs: { groupingsCount: { - cardinality: { field: options.groupBy }, + cardinality: { + script: { source: groupBy.map(field => `doc['${field}'].value`).join('+') }, + }, }, groupings: { composite: { size: limit, - sources: [{ groupBy: { terms: { field: options.groupBy, order: 'asc' } } }], + sources: groupBy.map((field, index) => ({ + [`groupBy${index}`]: { terms: { field, order: 'asc' } }, + })), }, }, }, @@ -83,7 +103,11 @@ export const getGroupings = async ( } if (options.afterKey) { - set(params, 'body.aggs.groupings.composite.after', { groupBy: options.afterKey }); + if (afterKeyObjectRT.is(options.afterKey)) { + set(params, 'body.aggs.groupings.composite.after', options.afterKey); + } else { + set(params, 'body.aggs.groupings.composite.after', { groupBy0: options.afterKey }); + } } if (options.filterQuery) { @@ -113,11 +137,13 @@ export const getGroupings = async ( const { after_key: afterKey } = groupings; return { series: groupings.buckets.map(bucket => { - return { id: bucket.key.groupBy, rows: [], columns: [] }; + const keys = Object.values(bucket.key); + const id = keys.join(' / '); + return { id, keys, rows: [], columns: [] }; }), pageInfo: { total: groupingsCount.value, - afterKey: afterKey && groupings.buckets.length === limit ? afterKey.groupBy : null, + afterKey: afterKey && groupings.buckets.length === limit ? afterKey : null, }, }; }; diff --git a/x-pack/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts b/x-pack/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts index a709cbdeeb680..ea77050112e19 100644 --- a/x-pack/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts +++ b/x-pack/plugins/infra/server/routes/metrics_explorer/lib/populate_series_with_tsvb_data.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { union, uniq } from 'lodash'; +import { union, uniq, isArray, isString } from 'lodash'; import { KibanaRequest, RequestHandlerContext } from 'src/core/server'; import { KibanaFramework } from '../../../lib/adapters/framework/kibana_framework_adapter'; import { @@ -38,9 +38,21 @@ export const populateSeriesWithTSVBData = ( } // Set the filter for the group by or match everything - const filters: JsonObject[] = options.groupBy - ? [{ match: { [options.groupBy]: series.id } }] + const isGroupBySet = + Array.isArray(options.groupBy) && options.groupBy.length + ? true + : isString(options.groupBy) + ? true + : false; + + const filters: JsonObject[] = isGroupBySet + ? isArray(options.groupBy) + ? options.groupBy + .filter(f => f) + .map((field, index) => ({ match: { [field as string]: series.keys?.[index] || '' } })) + : [{ match: { [options.groupBy as string]: series.id } }] : []; + if (options.filterQuery) { try { const filterQuery = JSON.parse(options.filterQuery); diff --git a/x-pack/plugins/ingest_manager/common/services/agent_status.ts b/x-pack/plugins/ingest_manager/common/services/agent_status.ts index 36e6e84b35bfe..d12f1001d1ece 100644 --- a/x-pack/plugins/ingest_manager/common/services/agent_status.ts +++ b/x-pack/plugins/ingest_manager/common/services/agent_status.ts @@ -8,12 +8,47 @@ import { AGENT_TYPE_TEMPORARY, AGENT_POLLING_THRESHOLD_MS, AGENT_TYPE_PERMANENT, + AGENT_TYPE_EPHEMERAL, AGENT_SAVED_OBJECT_TYPE, } from '../constants'; +import { Agent, AgentStatus } from '../types'; + +export function getAgentStatus(agent: Agent, now: number = Date.now()): AgentStatus { + const { type, last_checkin: lastCheckIn } = agent; + const msLastCheckIn = new Date(lastCheckIn || 0).getTime(); + const msSinceLastCheckIn = new Date().getTime() - msLastCheckIn; + const intervalsSinceLastCheckIn = Math.floor(msSinceLastCheckIn / AGENT_POLLING_THRESHOLD_MS); + if (!agent.active) { + return 'inactive'; + } + if (agent.current_error_events.length > 0) { + return 'error'; + } + switch (type) { + case AGENT_TYPE_PERMANENT: + if (intervalsSinceLastCheckIn >= 4) { + return 'error'; + } + case AGENT_TYPE_TEMPORARY: + if (intervalsSinceLastCheckIn >= 3) { + return 'offline'; + } + case AGENT_TYPE_EPHEMERAL: + if (intervalsSinceLastCheckIn >= 3) { + return 'inactive'; + } + } + return 'online'; +} export function buildKueryForOnlineAgents() { - return `${AGENT_SAVED_OBJECT_TYPE}.last_checkin >= now-${(3 * AGENT_POLLING_THRESHOLD_MS) / - 1000}s`; + return `(${AGENT_SAVED_OBJECT_TYPE}.type:${AGENT_TYPE_PERMANENT} and ${AGENT_SAVED_OBJECT_TYPE}.last_checkin >= now-${(4 * + AGENT_POLLING_THRESHOLD_MS) / + 1000}s) or (${AGENT_SAVED_OBJECT_TYPE}.type:${AGENT_TYPE_TEMPORARY} and ${AGENT_SAVED_OBJECT_TYPE}.last_checkin >= now-${(3 * + AGENT_POLLING_THRESHOLD_MS) / + 1000}s) or (${AGENT_SAVED_OBJECT_TYPE}.type:${AGENT_TYPE_EPHEMERAL} and ${AGENT_SAVED_OBJECT_TYPE}.last_checkin >= now-${(3 * + AGENT_POLLING_THRESHOLD_MS) / + 1000}s)`; } export function buildKueryForOfflineAgents() { diff --git a/x-pack/plugins/ingest_manager/server/services/agents/status.ts b/x-pack/plugins/ingest_manager/server/services/agents/status.ts index c4d4a8436e147..f570243164aa9 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/status.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/status.ts @@ -7,14 +7,8 @@ import { SavedObjectsClientContract } from 'src/core/server'; import { getAgent, listAgents } from './crud'; import { AGENT_EVENT_SAVED_OBJECT_TYPE, AGENT_SAVED_OBJECT_TYPE } from '../../constants'; -import { AgentStatus, Agent } from '../../types'; +import { AgentStatus } from '../../types'; -import { - AGENT_POLLING_THRESHOLD_MS, - AGENT_TYPE_PERMANENT, - AGENT_TYPE_TEMPORARY, - AGENT_TYPE_EPHEMERAL, -} from '../../constants'; import { AgentStatusKueryHelper } from '../../../common/services'; export async function getAgentStatusById( @@ -22,39 +16,10 @@ export async function getAgentStatusById( agentId: string ): Promise { const agent = await getAgent(soClient, agentId); - return getAgentStatus(agent); + return AgentStatusKueryHelper.getAgentStatus(agent); } -export function getAgentStatus(agent: Agent, now: number = Date.now()): AgentStatus { - const { type, last_checkin: lastCheckIn } = agent; - const msLastCheckIn = new Date(lastCheckIn || 0).getTime(); - const msSinceLastCheckIn = new Date().getTime() - msLastCheckIn; - const intervalsSinceLastCheckIn = Math.floor(msSinceLastCheckIn / AGENT_POLLING_THRESHOLD_MS); - if (!agent.active) { - return 'inactive'; - } - if (agent.current_error_events.length > 0) { - return 'error'; - } - switch (type) { - case AGENT_TYPE_PERMANENT: - if (intervalsSinceLastCheckIn >= 4) { - return 'error'; - } - if (intervalsSinceLastCheckIn >= 2) { - return 'warning'; - } - case AGENT_TYPE_TEMPORARY: - if (intervalsSinceLastCheckIn >= 3) { - return 'offline'; - } - case AGENT_TYPE_EPHEMERAL: - if (intervalsSinceLastCheckIn >= 3) { - return 'inactive'; - } - } - return 'online'; -} +export const getAgentStatus = AgentStatusKueryHelper.getAgentStatus; export async function getAgentStatusForConfig( soClient: SavedObjectsClientContract, diff --git a/x-pack/plugins/lens/public/datatable_visualization/__snapshots__/expression.test.tsx.snap b/x-pack/plugins/lens/public/datatable_visualization/__snapshots__/expression.test.tsx.snap index 76063d230bdb6..c0210c3915ce8 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/__snapshots__/expression.test.tsx.snap +++ b/x-pack/plugins/lens/public/datatable_visualization/__snapshots__/expression.test.tsx.snap @@ -27,7 +27,7 @@ exports[`datatable_expression DatatableComponent it renders the title and value items={ Array [ Object { - "a": 10110, + "a": "shoes", "b": 1588024800000, "c": 3, }, diff --git a/x-pack/plugins/lens/public/datatable_visualization/expression.test.tsx b/x-pack/plugins/lens/public/datatable_visualization/expression.test.tsx index 5407389c7fc4c..ea8eeaee8b2f0 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/expression.test.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/expression.test.tsx @@ -14,6 +14,7 @@ import { createMockExecutionContext } from '../../../../../src/plugins/expressio import { IFieldFormat } from '../../../../../src/plugins/data/public'; import { IAggType } from 'src/plugins/data/public'; const onClickValue = jest.fn(); +import { EmptyPlaceholder } from '../shared_components'; function sampleArgs() { const data: LensMultiTable = { @@ -22,11 +23,11 @@ function sampleArgs() { l1: { type: 'kibana_datatable', columns: [ - { id: 'a', name: 'a', meta: { type: 'count' } }, + { id: 'a', name: 'a', meta: { type: 'terms' } }, { id: 'b', name: 'b', meta: { type: 'date_histogram', aggConfigParams: { field: 'b' } } }, - { id: 'c', name: 'c', meta: { type: 'cardinality' } }, + { id: 'c', name: 'c', meta: { type: 'count' } }, ], - rows: [{ a: 10110, b: 1588024800000, c: 3 }], + rows: [{ a: 'shoes', b: 1588024800000, c: 3 }], }, }, }; @@ -103,7 +104,7 @@ describe('datatable_expression', () => { column: 0, row: 0, table: data.tables.l1, - value: 10110, + value: 'shoes', }, ], negate: true, @@ -148,5 +149,31 @@ describe('datatable_expression', () => { timeFieldName: 'b', }); }); + + test('it shows emptyPlaceholder for undefined bucketed data', () => { + const { args, data } = sampleArgs(); + const emptyData: LensMultiTable = { + ...data, + tables: { + l1: { + ...data.tables.l1, + rows: [{ a: undefined, b: undefined, c: 0 }], + }, + }, + }; + + const component = shallow( + x as IFieldFormat} + onClickValue={onClickValue} + getType={jest.fn(type => + type === 'count' ? ({ type: 'metrics' } as IAggType) : ({ type: 'buckets' } as IAggType) + )} + /> + ); + expect(component.find(EmptyPlaceholder).prop('icon')).toEqual('visTable'); + }); }); }); diff --git a/x-pack/plugins/lens/public/datatable_visualization/expression.tsx b/x-pack/plugins/lens/public/datatable_visualization/expression.tsx index 3be5c72d2af37..d897290d5a13c 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/expression.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/expression.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React from 'react'; +import React, { useMemo } from 'react'; import ReactDOM from 'react-dom'; import { i18n } from '@kbn/i18n'; import { I18nProvider } from '@kbn/i18n/react'; @@ -21,6 +21,8 @@ import { ExpressionRenderDefinition, } from '../../../../../src/plugins/expressions/public'; import { VisualizationContainer } from '../visualization_container'; +import { EmptyPlaceholder } from '../shared_components'; + export interface DatatableColumns { columnIds: string[]; } @@ -158,26 +160,45 @@ export function DatatableComponent(props: DatatableRenderProps) { formatters[column.id] = props.formatFactory(column.formatHint); }); - const handleFilterClick = (field: string, value: unknown, colIndex: number, negate = false) => { - const col = firstTable.columns[colIndex]; - const isDateHistogram = col.meta?.type === 'date_histogram'; - const timeFieldName = negate && isDateHistogram ? undefined : col?.meta?.aggConfigParams?.field; - const rowIndex = firstTable.rows.findIndex(row => row[field] === value); + const handleFilterClick = useMemo( + () => (field: string, value: unknown, colIndex: number, negate: boolean = false) => { + const col = firstTable.columns[colIndex]; + const isDateHistogram = col.meta?.type === 'date_histogram'; + const timeFieldName = + negate && isDateHistogram ? undefined : col?.meta?.aggConfigParams?.field; + const rowIndex = firstTable.rows.findIndex(row => row[field] === value); - const data: LensFilterEvent['data'] = { - negate, - data: [ - { - row: rowIndex, - column: colIndex, - value, - table: firstTable, - }, - ], - timeFieldName, - }; - props.onClickValue(data); - }; + const data: LensFilterEvent['data'] = { + negate, + data: [ + { + row: rowIndex, + column: colIndex, + value, + table: firstTable, + }, + ], + timeFieldName, + }; + props.onClickValue(data); + }, + [firstTable] + ); + + const bucketColumns = firstTable.columns + .filter(col => { + return col?.meta?.type && props.getType(col.meta.type)?.type === 'buckets'; + }) + .map(col => col.id); + + const isEmpty = + firstTable.rows.length === 0 || + (bucketColumns.length && + firstTable.rows.every(row => bucketColumns.every(col => typeof row[col] === 'undefined'))); + + if (isEmpty) { + return ; + } return ( @@ -188,9 +209,8 @@ export function DatatableComponent(props: DatatableRenderProps) { columns={props.args.columns.columnIds .map(field => { const col = firstTable.columns.find(c => c.id === field); + const filterable = bucketColumns.includes(field); const colIndex = firstTable.columns.findIndex(c => c.id === field); - - const filterable = col?.meta?.type && props.getType(col.meta.type)?.type === 'buckets'; return { field, name: (col && col.name) || '', diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_expression.test.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_expression.test.tsx index 72e51b175543c..346351f2e7ee2 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_expression.test.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_expression.test.tsx @@ -1283,6 +1283,65 @@ describe('xy_expression', () => { expect(series.prop('data')).toEqual([{ a: 1, b: 5, c: 'J', d: 'Row 2' }]); }); + test('it should not remove rows with falsy but non-undefined values', () => { + const data: LensMultiTable = { + type: 'lens_multitable', + tables: { + first: { + type: 'kibana_datatable', + columns: [ + { id: 'a', name: 'a' }, + { id: 'b', name: 'b' }, + { id: 'c', name: 'c' }, + ], + rows: [ + { a: 0, b: 2, c: 5 }, + { a: 1, b: 0, c: 7 }, + ], + }, + }, + }; + + const args: XYArgs = { + xTitle: '', + yTitle: '', + legend: { type: 'lens_xy_legendConfig', isVisible: false, position: Position.Top }, + layers: [ + { + layerId: 'first', + seriesType: 'line', + xAccessor: 'a', + accessors: ['c'], + splitAccessor: 'b', + columnToLabel: '', + xScaleType: 'ordinal', + yScaleType: 'linear', + isHistogram: false, + }, + ], + }; + + const component = shallow( + + ); + + const series = component.find(LineSeries); + + expect(series.prop('data')).toEqual([ + { a: 0, b: 2, c: 5 }, + { a: 1, b: 0, c: 7 }, + ]); + }); + test('it should show legend for split series, even with one row', () => { const data: LensMultiTable = { type: 'lens_multitable', diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_expression.tsx b/x-pack/plugins/lens/public/xy_visualization/xy_expression.tsx index cb2defbc54f49..8b7229cd808aa 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_expression.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/xy_expression.tsx @@ -402,8 +402,12 @@ export function XYChart({ const rows = table.rows.filter( row => xAccessor && - row[xAccessor] && - !(splitAccessor && !row[splitAccessor] && accessors.every(accessor => !row[accessor])) + typeof row[xAccessor] !== 'undefined' && + !( + splitAccessor && + typeof row[splitAccessor] === 'undefined' && + accessors.every(accessor => typeof row[accessor] === 'undefined') + ) ); const seriesProps: SeriesSpec = { diff --git a/x-pack/plugins/ml/server/routes/data_frame_analytics.ts b/x-pack/plugins/ml/server/routes/data_frame_analytics.ts index 32cb2b343f876..894c4739ef96e 100644 --- a/x-pack/plugins/ml/server/routes/data_frame_analytics.ts +++ b/x-pack/plugins/ml/server/routes/data_frame_analytics.ts @@ -206,7 +206,7 @@ export function dataFrameAnalyticsRoutes({ router, mlLicense }: RouteInitializat body: dataAnalyticsEvaluateSchema, }, options: { - tags: ['access:ml:canCreateDataFrameAnalytics'], + tags: ['access:ml:canGetDataFrameAnalytics'], }, }, mlLicense.fullLicenseAPIGuard(async (context, request, response) => { diff --git a/x-pack/plugins/endpoint/common/generate_data.test.ts b/x-pack/plugins/siem/common/endpoint/generate_data.test.ts similarity index 100% rename from x-pack/plugins/endpoint/common/generate_data.test.ts rename to x-pack/plugins/siem/common/endpoint/generate_data.test.ts diff --git a/x-pack/plugins/endpoint/common/generate_data.ts b/x-pack/plugins/siem/common/endpoint/generate_data.ts similarity index 99% rename from x-pack/plugins/endpoint/common/generate_data.ts rename to x-pack/plugins/siem/common/endpoint/generate_data.ts index c701845477242..9e3b5a22f1607 100644 --- a/x-pack/plugins/endpoint/common/generate_data.ts +++ b/x-pack/plugins/siem/common/endpoint/generate_data.ts @@ -442,6 +442,7 @@ export class EndpointDocGenerator { lineage.length === generations + 1 ) { lineage.pop(); + // eslint-disable-next-line no-continue continue; } // Otherwise, add a child and any nodes associated with it @@ -738,9 +739,10 @@ export class EndpointDocGenerator { } private *randomNGenerator(max: number, count: number) { - while (count > 0) { + let iCount = count; + while (iCount > 0) { yield this.randomN(max); - count--; + iCount = iCount - 1; } } diff --git a/x-pack/plugins/endpoint/common/models/event.ts b/x-pack/plugins/siem/common/endpoint/models/event.ts similarity index 100% rename from x-pack/plugins/endpoint/common/models/event.ts rename to x-pack/plugins/siem/common/endpoint/models/event.ts diff --git a/x-pack/plugins/endpoint/common/models/policy_config.ts b/x-pack/plugins/siem/common/endpoint/models/policy_config.ts similarity index 100% rename from x-pack/plugins/endpoint/common/models/policy_config.ts rename to x-pack/plugins/siem/common/endpoint/models/policy_config.ts diff --git a/x-pack/plugins/endpoint/common/schema/policy.ts b/x-pack/plugins/siem/common/endpoint/schema/policy.ts similarity index 100% rename from x-pack/plugins/endpoint/common/schema/policy.ts rename to x-pack/plugins/siem/common/endpoint/schema/policy.ts diff --git a/x-pack/plugins/endpoint/common/schema/resolver.ts b/x-pack/plugins/siem/common/endpoint/schema/resolver.ts similarity index 100% rename from x-pack/plugins/endpoint/common/schema/resolver.ts rename to x-pack/plugins/siem/common/endpoint/schema/resolver.ts diff --git a/x-pack/plugins/endpoint/common/types.ts b/x-pack/plugins/siem/common/endpoint/types.ts similarity index 86% rename from x-pack/plugins/endpoint/common/types.ts rename to x-pack/plugins/siem/common/endpoint/types.ts index 3d096eab5c4f2..43c7e20445d5d 100644 --- a/x-pack/plugins/endpoint/common/types.ts +++ b/x-pack/plugins/siem/common/endpoint/types.ts @@ -4,11 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SearchResponse } from 'elasticsearch'; -import { TypeOf } from '@kbn/config-schema'; -import { alertingIndexGetQuerySchema } from './schema/alert_index'; -import { indexPatternGetParamsSchema } from './schema/index_pattern'; -import { Datasource, NewDatasource } from '../../ingest_manager/common'; +import { Datasource, NewDatasource } from '../../../ingest_manager/common'; + +export interface AppLocation { + pathname: string; + search: string; + hash: string; + key?: string; +} /** * A deep readonly type that will make all children of a given object readonly recursively @@ -30,11 +33,6 @@ type ImmutableMap = ReadonlyMap, Immutable>; type ImmutableSet = ReadonlySet>; type ImmutableObject = { readonly [K in keyof T]: Immutable }; -/** - * Values for the Alert APIs 'order' and 'direction' parameters. - */ -export type AlertAPIOrdering = 'asc' | 'desc'; - export interface ResolverNodeStats { totalEvents: number; totalAlerts: number; @@ -60,46 +58,6 @@ export interface ResolverNode { stats?: ResolverNodeStats; } -/** - * Returned by 'api/endpoint/alerts' - */ -export interface AlertResultList { - /** - * The alerts restricted by page size. - */ - alerts: AlertData[]; - - /** - * The total number of alerts on the page. - */ - total: number; - - /** - * The size of the requested page. - */ - request_page_size: number; - - /** - * The index of the requested page, starting at 0. - */ - request_page_index?: number; - - /** - * The offset of the requested page, starting at 0. - */ - result_from_index?: number; - - /** - * A cursor-based URL for the next page. - */ - next: string | null; - - /** - * A cursor-based URL for the previous page. - */ - prev: string | null; -} - /** * Returned by the server via /api/endpoint/metadata */ @@ -271,24 +229,6 @@ export type AlertEvent = Immutable<{ dll?: DllFields[]; }>; -interface AlertMetadata { - id: string; - - // Alert Details Pagination - next: string | null; - prev: string | null; -} - -interface AlertState { - state: { - host_metadata: HostMetadata; - }; -} - -export type AlertData = AlertEvent & AlertMetadata; - -export type AlertDetails = AlertData & AlertState; - /** * The status of the host */ @@ -337,19 +277,6 @@ export type HostMetadata = Immutable<{ host: Host; }>; -/** - * Represents `total` response from Elasticsearch after ES 7.0. - */ -export interface ESTotal { - value: number; - relation: string; -} - -/** - * `Hits` array in responses from ES search API. - */ -export type AlertHits = SearchResponse['hits']['hits']; - export interface LegacyEndpointEvent { '@timestamp': number; endgame: { @@ -427,7 +354,7 @@ export type ResolverEvent = EndpointEvent | LegacyEndpointEvent; * Note that because the types coming from `@kbn/config-schema`'s schemas sometimes have deeply nested * `Type` types, we process the result of `TypeOf` instead, as this will be consistent. */ -type KbnConfigSchemaInputTypeOf = T extends Record +export type KbnConfigSchemaInputTypeOf = T extends Record ? KbnConfigSchemaInputObjectTypeOf< T > /** `schema.number()` accepts strings, so this type should accept them as well. */ @@ -468,23 +395,6 @@ type KbnConfigSchemaNonOptionalProps> = Pi }[keyof Props] >; -/** - * Query params to pass to the alert API when fetching new data. - */ -export type AlertingIndexGetQueryInput = KbnConfigSchemaInputTypeOf< - TypeOf ->; - -/** - * Result of the validated query params when handling alert index requests. - */ -export type AlertingIndexGetQueryResult = TypeOf; - -/** - * Result of the validated params when handling an index pattern request. - */ -export type IndexPatternGetParamsResult = TypeOf; - /** * Endpoint Policy configuration */ diff --git a/x-pack/plugins/endpoint/common/alert_constants.ts b/x-pack/plugins/siem/common/endpoint_alerts/alert_constants.ts similarity index 100% rename from x-pack/plugins/endpoint/common/alert_constants.ts rename to x-pack/plugins/siem/common/endpoint_alerts/alert_constants.ts diff --git a/x-pack/plugins/endpoint/common/schema/alert_index.ts b/x-pack/plugins/siem/common/endpoint_alerts/schema/alert_index.ts similarity index 78% rename from x-pack/plugins/endpoint/common/schema/alert_index.ts rename to x-pack/plugins/siem/common/endpoint_alerts/schema/alert_index.ts index cffc00661515f..6794eea20066b 100644 --- a/x-pack/plugins/endpoint/common/schema/alert_index.ts +++ b/x-pack/plugins/siem/common/endpoint_alerts/schema/alert_index.ts @@ -47,7 +47,7 @@ export const alertingIndexGetQuerySchema = schema.object( try { decode(value); } catch (err) { - return i18n.translate('xpack.endpoint.alerts.errors.bad_rison', { + return i18n.translate('xpack.siem.endpoint.alerts.errors.bad_rison', { defaultMessage: 'must be a valid rison-encoded string', }); } @@ -62,7 +62,7 @@ export const alertingIndexGetQuerySchema = schema.object( try { decode(value); } catch (err) { - return i18n.translate('xpack.endpoint.alerts.errors.bad_rison', { + return i18n.translate('xpack.siem.endpoint.alerts.errors.bad_rison', { defaultMessage: 'must be a valid rison-encoded string', }); } @@ -77,7 +77,7 @@ export const alertingIndexGetQuerySchema = schema.object( try { decode(value); } catch (err) { - return i18n.translate('xpack.endpoint.alerts.errors.bad_rison', { + return i18n.translate('xpack.siem.endpoint.alerts.errors.bad_rison', { defaultMessage: 'must be a valid rison-encoded string', }); } @@ -88,22 +88,28 @@ export const alertingIndexGetQuerySchema = schema.object( { validate(value) { if (value.after !== undefined && value.page_index !== undefined) { - return i18n.translate('xpack.endpoint.alerts.errors.page_index_cannot_be_used_with_after', { - defaultMessage: '[page_index] cannot be used with [after]', - }); + return i18n.translate( + 'xpack.siem.endpoint.alerts.errors.page_index_cannot_be_used_with_after', + { + defaultMessage: '[page_index] cannot be used with [after]', + } + ); } if (value.before !== undefined && value.page_index !== undefined) { return i18n.translate( - 'xpack.endpoint.alerts.errors.page_index_cannot_be_used_with_before', + 'xpack.siem.endpoint.alerts.errors.page_index_cannot_be_used_with_before', { defaultMessage: '[page_index] cannot be used with [before]', } ); } if (value.before !== undefined && value.after !== undefined) { - return i18n.translate('xpack.endpoint.alerts.errors.before_cannot_be_used_with_after', { - defaultMessage: '[before] cannot be used with [after]', - }); + return i18n.translate( + 'xpack.siem.endpoint.alerts.errors.before_cannot_be_used_with_after', + { + defaultMessage: '[before] cannot be used with [after]', + } + ); } }, } diff --git a/x-pack/plugins/endpoint/common/schema/index_pattern.ts b/x-pack/plugins/siem/common/endpoint_alerts/schema/index_pattern.ts similarity index 100% rename from x-pack/plugins/endpoint/common/schema/index_pattern.ts rename to x-pack/plugins/siem/common/endpoint_alerts/schema/index_pattern.ts diff --git a/x-pack/plugins/siem/common/endpoint_alerts/types.ts b/x-pack/plugins/siem/common/endpoint_alerts/types.ts new file mode 100644 index 0000000000000..2ba8353b09c88 --- /dev/null +++ b/x-pack/plugins/siem/common/endpoint_alerts/types.ts @@ -0,0 +1,272 @@ +/* + * 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 { SearchResponse } from 'elasticsearch'; +import { TypeOf } from '@kbn/config-schema'; +import { IIndexPattern, TimeRange, Filter, Query } from 'src/plugins/data/public'; +import { JsonObject } from 'src/plugins/kibana_utils/common'; +import { alertingIndexGetQuerySchema } from './schema/alert_index'; +import { indexPatternGetParamsSchema } from './schema/index_pattern'; +import { + HostMetadata, + AlertEvent, + KbnConfigSchemaInputTypeOf, + AppLocation, +} from '../endpoint/types'; + +/** + * A deep readonly type that will make all children of a given object readonly recursively + */ +export type Immutable = T extends undefined | null | boolean | string | number + ? T + : unknown extends T + ? unknown + : T extends Array + ? ImmutableArray + : T extends Map + ? ImmutableMap + : T extends Set + ? ImmutableSet + : ImmutableObject; + +type ImmutableArray = ReadonlyArray>; +type ImmutableMap = ReadonlyMap, Immutable>; +type ImmutableSet = ReadonlySet>; +type ImmutableObject = { readonly [K in keyof T]: Immutable }; + +/** + * Values for the Alert APIs 'order' and 'direction' parameters. + */ +export type AlertAPIOrdering = 'asc' | 'desc'; + +/** + * Returned by 'api/endpoint/alerts' + */ +export interface AlertResultList { + /** + * The alerts restricted by page size. + */ + alerts: AlertData[]; + + /** + * The total number of alerts on the page. + */ + total: number; + + /** + * The size of the requested page. + */ + request_page_size: number; + + /** + * The index of the requested page, starting at 0. + */ + request_page_index?: number; + + /** + * The offset of the requested page, starting at 0. + */ + result_from_index?: number; + + /** + * A cursor-based URL for the next page. + */ + next: string | null; + + /** + * A cursor-based URL for the previous page. + */ + prev: string | null; +} + +interface AlertMetadata { + id: string; + + // Alert Details Pagination + next: string | null; + prev: string | null; +} + +interface AlertState { + state: { + host_metadata: HostMetadata; + }; +} + +export type AlertData = AlertEvent & AlertMetadata; + +export type AlertDetails = AlertData & AlertState; + +/** + * Represents `total` response from Elasticsearch after ES 7.0. + */ +export interface ESTotal { + value: number; + relation: string; +} + +/** + * `Hits` array in responses from ES search API. + */ +export type AlertHits = SearchResponse['hits']['hits']; + +/** + * Query params to pass to the alert API when fetching new data. + */ +export type AlertingIndexGetQueryInput = KbnConfigSchemaInputTypeOf< + TypeOf +>; + +/** + * Result of the validated query params when handling alert index requests. + */ +export type AlertingIndexGetQueryResult = TypeOf; + +/** + * Result of the validated params when handling an index pattern request. + */ +export type IndexPatternGetParamsResult = TypeOf; + +interface AlertsSearchBarState { + patterns: IIndexPattern[]; +} + +export type AlertListData = AlertResultList; + +export interface AlertListState { + /** Array of alert items. */ + readonly alerts: Immutable; + + /** The total number of alerts on the page. */ + readonly total: number; + + /** Number of alerts per page. */ + readonly pageSize: number; + + /** Page number, starting at 0. */ + readonly pageIndex: number; + + /** Current location object from React Router history. */ + readonly location?: Immutable; + + /** Specific Alert data to be shown in the details view */ + readonly alertDetails?: Immutable; + + /** Search bar state including indexPatterns */ + readonly searchBar: AlertsSearchBarState; +} + +/** + * Gotten by parsing the URL from the browser. Used to calculate the new URL when changing views. + */ +export interface AlertingIndexUIQueryParams { + /** + * How many items to show in list. + */ + page_size?: string; + /** + * Which page to show. If `page_index` is 1, show page 2. + */ + page_index?: string; + /** + * If any value is present, show the alert detail view for the selected alert. Should be an ID for an alert event. + */ + selected_alert?: string; + query?: string; + date_range?: string; + filters?: string; +} + +/** + * Sort parameters for alerts in ES. + */ +export interface AlertSortParam { + [key: string]: { + order: AlertAPIOrdering; + missing?: UndefinedResultPosition; + }; +} + +/** + * Sort array for alerts. + */ +export type AlertSort = [AlertSortParam, AlertSortParam]; + +/** + * Cursor-based pagination params. + */ +export type SearchCursor = [string, string]; + +/** + * Request metadata used in searching alerts. + */ +export interface AlertSearchQuery { + pageSize: number; + pageIndex?: number; + fromIndex?: number; + query: Query; + filters: Filter[]; + dateRange?: TimeRange; + sort: string; + order: AlertAPIOrdering; + searchAfter?: SearchCursor; + searchBefore?: SearchCursor; + emptyStringIsUndefined?: boolean; +} + +/** + * ES request body for alerts. + */ +export interface AlertSearchRequest { + track_total_hits: number; + query: JsonObject; + sort: AlertSort; + search_after?: SearchCursor; +} + +/** + * Request for alerts. + */ +export interface AlertSearchRequestWrapper { + index: string; + size: number; + from?: number; + body: AlertSearchRequest; +} + +/** + * Request params for alert details. + */ +export interface AlertDetailsRequestParams { + id: string; +} + +/** + * Request params for alert queries. + * + * Must match exactly the values that the API receives. + */ +export interface AlertListRequestQuery { + page_index?: number; + page_size: number; + query?: string; + filters?: string; + date_range: string; + sort: string; + order: AlertAPIOrdering; + after?: SearchCursor; + before?: SearchCursor; + empty_string_is_undefined?: boolean; +} + +/** + * Indicates whether undefined results are sorted to the beginning (_first) or end (_last) + * of a result set. + */ +export enum UndefinedResultPosition { + first = '_first', + last = '_last', +} diff --git a/x-pack/plugins/siem/common/types/timeline/index.ts b/x-pack/plugins/siem/common/types/timeline/index.ts index e87986fd1bdf2..e67eb3182ffa9 100644 --- a/x-pack/plugins/siem/common/types/timeline/index.ts +++ b/x-pack/plugins/siem/common/types/timeline/index.ts @@ -130,23 +130,42 @@ const SavedSortRuntimeType = runtimeTypes.partial({ sortDirection: unionWithNullType(runtimeTypes.string), }); +/* + * Timeline Statuses + */ + +export enum TimelineStatus { + active = 'active', + draft = 'draft', +} + +export const TimelineStatusLiteralRt = runtimeTypes.union([ + runtimeTypes.literal(TimelineStatus.active), + runtimeTypes.literal(TimelineStatus.draft), +]); + +const TimelineStatusLiteralWithNullRt = unionWithNullType(TimelineStatusLiteralRt); + +export type TimelineStatusLiteral = runtimeTypes.TypeOf; +export type TimelineStatusLiteralWithNull = runtimeTypes.TypeOf< + typeof TimelineStatusLiteralWithNullRt +>; + /* * Timeline Types */ export enum TimelineType { default = 'default', - draft = 'draft', template = 'template', } export const TimelineTypeLiteralRt = runtimeTypes.union([ runtimeTypes.literal(TimelineType.template), - runtimeTypes.literal(TimelineType.draft), runtimeTypes.literal(TimelineType.default), ]); -const TimelineTypeLiteralWithNullRt = unionWithNullType(TimelineTypeLiteralRt); +export const TimelineTypeLiteralWithNullRt = unionWithNullType(TimelineTypeLiteralRt); export type TimelineTypeLiteral = runtimeTypes.TypeOf; export type TimelineTypeLiteralWithNull = runtimeTypes.TypeOf; @@ -167,6 +186,7 @@ export const SavedTimelineRuntimeType = runtimeTypes.partial({ dateRange: unionWithNullType(SavedDateRangePickerRuntimeType), savedQueryId: unionWithNullType(runtimeTypes.string), sort: unionWithNullType(SavedSortRuntimeType), + status: unionWithNullType(TimelineStatusLiteralRt), created: unionWithNullType(runtimeTypes.number), createdBy: unionWithNullType(runtimeTypes.string), updated: unionWithNullType(runtimeTypes.number), diff --git a/x-pack/plugins/siem/cypress/integration/cases_connectors.spec.ts b/x-pack/plugins/siem/cypress/integration/cases_connectors.spec.ts index 6beb936d15ee6..9be9067a38ee8 100644 --- a/x-pack/plugins/siem/cypress/integration/cases_connectors.spec.ts +++ b/x-pack/plugins/siem/cypress/integration/cases_connectors.spec.ts @@ -17,7 +17,8 @@ import { loginAndWaitForPageWithoutDateRange } from '../tasks/login'; import { CASES } from '../urls/navigation'; -describe('Cases connectors', () => { +// FLAKY: https://github.com/elastic/kibana/issues/65278 +describe.skip('Cases connectors', () => { before(() => { cy.server(); cy.route('POST', '**/api/action').as('createConnector'); diff --git a/x-pack/plugins/siem/kibana.json b/x-pack/plugins/siem/kibana.json index 39e50838c1c97..1106781fd45e4 100644 --- a/x-pack/plugins/siem/kibana.json +++ b/x-pack/plugins/siem/kibana.json @@ -7,9 +7,11 @@ "actions", "alerting", "data", + "dataEnhanced", "embeddable", "features", "home", + "ingestManager", "inspector", "licensing", "maps", diff --git a/x-pack/plugins/siem/package.json b/x-pack/plugins/siem/package.json index a055d011a5cbb..6dc3aa3a5021e 100644 --- a/x-pack/plugins/siem/package.json +++ b/x-pack/plugins/siem/package.json @@ -9,13 +9,17 @@ "build-graphql-types": "node scripts/generate_types_from_graphql.js", "cypress:open": "cypress open --config-file ./cypress/cypress.json", "cypress:run": "cypress run --browser chrome --headless --spec ./cypress/integration/**/*.spec.ts --config-file ./cypress/cypress.json --reporter ../../node_modules/cypress-multi-reporters --reporter-options configFile=./cypress/reporter_config.json; status=$?; ../../node_modules/.bin/mochawesome-merge --reportDir ../../../target/kibana-siem/cypress/results > ../../../target/kibana-siem/cypress/results/output.json; ../../../node_modules/.bin/marge ../../../target/kibana-siem/cypress/results/output.json --reportDir ../../../target/kibana-siem/cypress/results; mkdir -p ../../../target/junit && cp ../../../target/kibana-siem/cypress/results/*.xml ../../../target/junit/ && exit $status;", - "cypress:run-as-ci": "node ../../../scripts/functional_tests --config ../../test/siem_cypress/config.ts" + "cypress:run-as-ci": "node ../../../scripts/functional_tests --config ../../test/siem_cypress/config.ts", + "test:generate": "ts-node --project scripts/endpoint/cli_tsconfig.json scripts/endpoint/resolver_generator.ts" }, "devDependencies": { "@types/lodash": "^4.14.110" }, "dependencies": { "lodash": "^4.17.15", - "react-markdown": "^4.0.6" + "querystring": "^0.2.0", + "react-markdown": "^4.0.6", + "redux-devtools-extension": "^2.13.8", + "@types/seedrandom": ">=2.0.0 <4.0.0" } } diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/helpers.ts b/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/helpers.ts deleted file mode 100644 index 99b01c8b22974..0000000000000 --- a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/helpers.ts +++ /dev/null @@ -1,16 +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 { isEmpty } from 'lodash/fp'; - -const urlExpression = /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi; - -export const isUrlInvalid = (url: string | null | undefined) => { - if (!isEmpty(url) && url != null && url.match(urlExpression) == null) { - return true; - } - return false; -}; diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/index.tsx b/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/index.tsx index 78ae3e44705c7..e41416f2a0ccb 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/index.tsx +++ b/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/index.tsx @@ -28,7 +28,7 @@ import { import { defaultRiskScoreBySeverity, severityOptions, SeverityValue } from './data'; import { stepAboutDefaultValue } from './default_value'; -import { isUrlInvalid } from './helpers'; +import { isUrlInvalid } from '../../../../common/utils/validators'; import { schema } from './schema'; import * as I18n from './translations'; import { StepContentWrapper } from '../step_content_wrapper'; diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/schema.tsx b/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/schema.tsx index 3cb5e9a0dd5f0..2f353ded3f1fd 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/schema.tsx +++ b/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/schema.tsx @@ -16,7 +16,7 @@ import { import { IMitreEnterpriseAttack } from '../../../pages/detection_engine/rules/types'; import { isMitreAttackInvalid } from '../mitre/helpers'; import { OptionalFieldLabel } from '../optional_field_label'; -import { isUrlInvalid } from './helpers'; +import { isUrlInvalid } from '../../../../common/utils/validators'; import * as I18n from './translations'; const { emptyField } = fieldValidators; diff --git a/x-pack/plugins/siem/public/alerts/components/signals/actions.test.tsx b/x-pack/plugins/siem/public/alerts/components/signals/actions.test.tsx index d3be87ce7c39c..d7a8a55077340 100644 --- a/x-pack/plugins/siem/public/alerts/components/signals/actions.test.tsx +++ b/x-pack/plugins/siem/public/alerts/components/signals/actions.test.tsx @@ -15,7 +15,7 @@ import { } from '../../../common/mock/'; import { CreateTimeline, UpdateTimelineLoading } from './types'; import { Ecs } from '../../../graphql/types'; -import { TimelineType } from '../../../../common/types/timeline'; +import { TimelineType, TimelineStatus } from '../../../../common/types/timeline'; jest.mock('apollo-client'); @@ -215,6 +215,7 @@ describe('signals actions', () => { columnId: '@timestamp', sortDirection: 'desc', }, + status: TimelineStatus.draft, title: '', timelineType: TimelineType.default, templateTimelineId: null, diff --git a/x-pack/plugins/siem/public/app/app.tsx b/x-pack/plugins/siem/public/app/app.tsx index 7aef91380b522..732b1883b9b77 100644 --- a/x-pack/plugins/siem/public/app/app.tsx +++ b/x-pack/plugins/siem/public/app/app.tsx @@ -24,7 +24,7 @@ import { DEFAULT_DARK_MODE } from '../../common/constants'; import { ErrorToastDispatcher } from '../common/components/error_toast_dispatcher'; import { compose } from '../common/lib/compose/kibana_compose'; import { AppFrontendLibs, AppApolloClient } from '../common/lib/lib'; -import { StartServices } from '../plugin'; +import { StartServices } from '../types'; import { PageRouter } from './routes'; import { createStore, createInitialState } from '../common/store'; import { GlobalToaster, ManageGlobalToaster } from '../common/components/toasters'; @@ -80,7 +80,8 @@ const StartAppComponent: FC = ({ subPlugins, ...libs }) => { const store = createStore( createInitialState(subPluginsStore.initialState), subPluginsStore.reducer, - libs$.pipe(pluck('apolloClient')) + libs$.pipe(pluck('apolloClient')), + subPluginsStore.middlewares ); const [darkMode] = useUiSetting$(DEFAULT_DARK_MODE); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/setup.tsx b/x-pack/plugins/siem/public/app/home/setup.tsx similarity index 87% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/setup.tsx rename to x-pack/plugins/siem/public/app/home/setup.tsx index a826e1f30f75d..a88b6a36100db 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/setup.tsx +++ b/x-pack/plugins/siem/public/app/home/setup.tsx @@ -6,18 +6,18 @@ import * as React from 'react'; import { i18n } from '@kbn/i18n'; import { NotificationsStart } from 'kibana/public'; -import { IngestManagerStart } from '../../../../../ingest_manager/public'; +import { IngestManagerStart } from '../../../../ingest_manager/public'; export const Setup: React.FunctionComponent<{ ingestManager: IngestManagerStart; notifications: NotificationsStart; }> = ({ ingestManager, notifications }) => { React.useEffect(() => { - const defaultText = i18n.translate('xpack.endpoint.ingestToastMessage', { + const defaultText = i18n.translate('xpack.siem.endpoint.ingestToastMessage', { defaultMessage: 'Ingest Manager failed during its setup.', }); - const title = i18n.translate('xpack.endpoint.ingestToastTitle', { + const title = i18n.translate('xpack.siem.endpoint.ingestToastTitle', { defaultMessage: 'App failed to initialize', }); diff --git a/x-pack/plugins/siem/public/app/index.tsx b/x-pack/plugins/siem/public/app/index.tsx index d69be6e09e614..13d06bd1a98c2 100644 --- a/x-pack/plugins/siem/public/app/index.tsx +++ b/x-pack/plugins/siem/public/app/index.tsx @@ -9,7 +9,7 @@ import { render, unmountComponentAtNode } from 'react-dom'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { AppMountParameters } from '../../../../../src/core/public'; -import { StartServices } from '../plugin'; +import { StartServices } from '../types'; import { SiemApp } from './app'; import { SecuritySubPlugins } from './types'; diff --git a/x-pack/plugins/siem/public/app/routes.tsx b/x-pack/plugins/siem/public/app/routes.tsx index ed3565df5f507..d1395813d39f4 100644 --- a/x-pack/plugins/siem/public/app/routes.tsx +++ b/x-pack/plugins/siem/public/app/routes.tsx @@ -11,6 +11,7 @@ import { Route, Router, Switch } from 'react-router-dom'; import { NotFoundPage } from './404'; import { HomePage } from './home'; import { ManageRoutesSpy } from '../common/utils/route/manage_spy_routes'; +import { RouteCapture } from '../common/components/endpoint/route_capture'; interface RouterProps { history: History; @@ -20,14 +21,16 @@ interface RouterProps { const PageRouterComponent: FC = ({ history, subPluginRoutes }) => ( - - - - - - - - + + + + + + + + + + ); diff --git a/x-pack/plugins/siem/public/app/types.ts b/x-pack/plugins/siem/public/app/types.ts index 5fe4b5a8d8227..1fcbc5ba25f8f 100644 --- a/x-pack/plugins/siem/public/app/types.ts +++ b/x-pack/plugins/siem/public/app/types.ts @@ -4,12 +4,18 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Reducer, AnyAction } from 'redux'; +import { Reducer, AnyAction, Middleware, Dispatch } from 'redux'; import { NavTab } from '../common/components/navigation/types'; import { HostsState } from '../hosts/store'; import { NetworkState } from '../network/store'; import { TimelineState } from '../timelines/store/timeline/types'; +import { ImmutableReducer, State } from '../common/store'; +import { Immutable } from '../../common/endpoint/types'; +import { AlertListState } from '../../common/endpoint_alerts/types'; +import { AppAction } from '../common/store/actions'; +import { HostState } from '../endpoint_hosts/types'; +import { PolicyDetailsState, PolicyListState } from '../endpoint_policy/types'; export enum SiemPageName { overview = 'overview', @@ -33,13 +39,21 @@ export type SiemNavTab = Record; export interface SecuritySubPluginStore { initialState: Record; reducer: Record>; + middleware?: Middleware<{}, State, Dispatch>>; } export interface SecuritySubPlugin { routes: React.ReactElement[]; } -type SecuritySubPluginKeyStore = 'hosts' | 'network' | 'timeline'; +type SecuritySubPluginKeyStore = + | 'hosts' + | 'network' + | 'timeline' + | 'hostList' + | 'alertList' + | 'policyDetails' + | 'policyList'; export interface SecuritySubPluginWithStore extends SecuritySubPlugin { store: SecuritySubPluginStore; @@ -51,11 +65,20 @@ export interface SecuritySubPlugins extends SecuritySubPlugin { hosts: HostsState; network: NetworkState; timeline: TimelineState; + alertList: Immutable; + hostList: Immutable; + policyDetails: Immutable; + policyList: Immutable; }; reducer: { hosts: Reducer; network: Reducer; timeline: Reducer; + alertList: ImmutableReducer; + hostList: ImmutableReducer; + policyDetails: ImmutableReducer; + policyList: ImmutableReducer; }; + middlewares: Array>>>; }; } diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/components/__snapshots__/link_to_app.test.tsx.snap b/x-pack/plugins/siem/public/common/components/endpoint/__snapshots__/link_to_app.test.tsx.snap similarity index 100% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/components/__snapshots__/link_to_app.test.tsx.snap rename to x-pack/plugins/siem/public/common/components/endpoint/__snapshots__/link_to_app.test.tsx.snap diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/components/__snapshots__/page_view.test.tsx.snap b/x-pack/plugins/siem/public/common/components/endpoint/__snapshots__/page_view.test.tsx.snap similarity index 97% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/components/__snapshots__/page_view.test.tsx.snap rename to x-pack/plugins/siem/public/common/components/endpoint/__snapshots__/page_view.test.tsx.snap index 36b602a1e6784..35a42acf7e1fb 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/components/__snapshots__/page_view.test.tsx.snap +++ b/x-pack/plugins/siem/public/common/components/endpoint/__snapshots__/page_view.test.tsx.snap @@ -21,7 +21,7 @@ exports[`PageView component should display body header custom element 1`] = ` background: none; } - body header @@ -88,7 +88,7 @@ exports[`PageView component should display body header custom element 1`] = `
- + `; exports[`PageView component should display body header wrapped in EuiTitle 1`] = ` @@ -112,7 +112,7 @@ exports[`PageView component should display body header wrapped in EuiTitle 1`] = background: none; } - @@ -150,7 +150,7 @@ exports[`PageView component should display body header wrapped in EuiTitle 1`] = className="euiPageContentHeaderSection" data-test-subj="pageViewBodyTitleArea" > - +

- +

@@ -182,7 +182,7 @@ exports[`PageView component should display body header wrapped in EuiTitle 1`] =
- + `; exports[`PageView component should display header left and right 1`] = ` @@ -206,7 +206,7 @@ exports[`PageView component should display header left and right 1`] = ` background: none; } - - + @@ -248,7 +248,7 @@ exports[`PageView component should display header left and right 1`] = ` page title - + - + `; exports[`PageView component should display only body if not header props used 1`] = ` @@ -315,7 +315,7 @@ exports[`PageView component should display only body if not header props used 1` background: none; } - - + `; exports[`PageView component should display only header left 1`] = ` @@ -383,7 +383,7 @@ exports[`PageView component should display only header left 1`] = ` background: none; } - @@ -413,7 +413,7 @@ exports[`PageView component should display only header left 1`] = ` className="euiPageHeaderSection" data-test-subj="pageViewHeaderLeft" > - + @@ -424,7 +424,7 @@ exports[`PageView component should display only header left 1`] = ` page title - + @@ -457,7 +457,7 @@ exports[`PageView component should display only header left 1`] = ` - + `; exports[`PageView component should display only header right but include an empty left side 1`] = ` @@ -481,7 +481,7 @@ exports[`PageView component should display only header right but include an empt background: none; } - @@ -552,7 +552,7 @@ exports[`PageView component should display only header right but include an empt - + `; exports[`PageView component should pass through EuiPage props 1`] = ` @@ -576,7 +576,7 @@ exports[`PageView component should pass through EuiPage props 1`] = ` background: none; } - - + `; exports[`PageView component should use custom element for header left and not wrap in EuiTitle 1`] = ` @@ -661,7 +661,7 @@ exports[`PageView component should use custom element for header left and not wr background: none; } - title here @@ -730,5 +730,5 @@ exports[`PageView component should use custom element for header left and not wr - + `; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/formatted_date_time.tsx b/x-pack/plugins/siem/public/common/components/endpoint/formatted_date_time.tsx similarity index 100% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/formatted_date_time.tsx rename to x-pack/plugins/siem/public/common/components/endpoint/formatted_date_time.tsx diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/components/link_to_app.test.tsx b/x-pack/plugins/siem/public/common/components/endpoint/link_to_app.test.tsx similarity index 92% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/components/link_to_app.test.tsx rename to x-pack/plugins/siem/public/common/components/endpoint/link_to_app.test.tsx index 2d4d1ca8a1b5b..0c3467d8f363c 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/components/link_to_app.test.tsx +++ b/x-pack/plugins/siem/public/common/components/endpoint/link_to_app.test.tsx @@ -8,8 +8,8 @@ import React from 'react'; import { mount } from 'enzyme'; import { LinkToApp } from './link_to_app'; import { CoreStart } from 'kibana/public'; -import { KibanaContextProvider } from '../../../../../../../../src/plugins/kibana_react/public'; -import { coreMock } from '../../../../../../../../src/core/public/mocks'; +import { KibanaContextProvider } from '../../../../../../../src/plugins/kibana_react/public'; +import { coreMock } from '../../../../../../../src/core/public/mocks'; type LinkToAppOnClickMock = jest.Mock< Return, @@ -31,13 +31,13 @@ describe('LinkToApp component', () => { }); it('should render with minimum input', () => { - expect(render(link)).toMatchSnapshot(); + expect(render({'link'})).toMatchSnapshot(); }); it('should render with href', () => { expect( render( - link + {'link'} ) ).toMatchSnapshot(); @@ -47,7 +47,7 @@ describe('LinkToApp component', () => { const spyOnClickHandler: LinkToAppOnClickMock = jest.fn(_event => {}); const renderResult = render( - link + {'link'} ); @@ -65,7 +65,7 @@ describe('LinkToApp component', () => { it('should navigate to App with specific path', () => { const renderResult = render( - link + {'link'} ); renderResult.find('EuiLink').simulate('click', { button: 0 }); @@ -84,7 +84,7 @@ describe('LinkToApp component', () => { color="primary" data-test-subj="my-test-subject" > - link + {'link'} ); expect(renderResult.find('EuiLink').props()).toEqual({ @@ -103,7 +103,7 @@ describe('LinkToApp component', () => { }); const renderResult = render( - link + {'link'} ); expect(() => renderResult.find('EuiLink').simulate('click')).toThrow(); @@ -116,21 +116,21 @@ describe('LinkToApp component', () => { }); const renderResult = render( - link + {'link'} ); renderResult.find('EuiLink').simulate('click', { button: 0 }); expect(fakeCoreStart.application.navigateToApp).not.toHaveBeenCalled(); }); it('should not to navigate if it was not left click', () => { - const renderResult = render(link); + const renderResult = render({'link'}); renderResult.find('EuiLink').simulate('click', { button: 1 }); expect(fakeCoreStart.application.navigateToApp).not.toHaveBeenCalled(); }); it('should not to navigate if it includes an anchor target', () => { const renderResult = render( - link + {'link'} ); renderResult.find('EuiLink').simulate('click', { button: 0 }); @@ -139,7 +139,7 @@ describe('LinkToApp component', () => { it('should not to navigate if if meta|alt|ctrl|shift keys are pressed', () => { const renderResult = render( - link + {'link'} ); const euiLink = renderResult.find('EuiLink'); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/components/link_to_app.tsx b/x-pack/plugins/siem/public/common/components/endpoint/link_to_app.tsx similarity index 83% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/components/link_to_app.tsx rename to x-pack/plugins/siem/public/common/components/endpoint/link_to_app.tsx index 6a3cf5e78f4bf..d6d8859b280b8 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/components/link_to_app.tsx +++ b/x-pack/plugins/siem/public/common/components/endpoint/link_to_app.tsx @@ -5,15 +5,15 @@ */ import React, { memo, MouseEventHandler } from 'react'; -import { EuiLink } from '@elastic/eui'; -import { EuiLinkProps } from '@elastic/eui'; -import { useNavigateToAppEventHandler } from '../hooks/use_navigate_to_app_event_handler'; +import { EuiLink, EuiLinkProps } from '@elastic/eui'; +import { useNavigateToAppEventHandler } from '../../hooks/endpoint/use_navigate_to_app_event_handler'; type LinkToAppProps = EuiLinkProps & { /** the app id - normally the value of the `id` in that plugin's `kibana.json` */ appId: string; /** Any app specific path (route) */ appPath?: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any appState?: any; onClick?: MouseEventHandler; }; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/components/page_view.test.tsx b/x-pack/plugins/siem/public/common/components/endpoint/page_view.test.tsx similarity index 80% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/components/page_view.test.tsx rename to x-pack/plugins/siem/public/common/components/endpoint/page_view.test.tsx index 4007477a088fa..2c14f66b64865 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/components/page_view.test.tsx +++ b/x-pack/plugins/siem/public/common/components/endpoint/page_view.test.tsx @@ -7,20 +7,20 @@ import React from 'react'; import { mount } from 'enzyme'; import { PageView } from './page_view'; -import { EuiThemeProvider } from '../../../../../../../legacy/common/eui_styled_components'; +import { EuiThemeProvider } from '../../../../../../legacy/common/eui_styled_components'; describe('PageView component', () => { const render = (ui: Parameters[0]) => mount(ui, { wrappingComponent: EuiThemeProvider }); it('should display only body if not header props used', () => { - expect(render(body content)).toMatchSnapshot(); + expect(render({'body content'})).toMatchSnapshot(); }); it('should display header left and right', () => { expect( render( - body content + {'body content'} ) ).toMatchSnapshot(); @@ -29,7 +29,7 @@ describe('PageView component', () => { expect( render( - body content + {'body content'} ) ).toMatchSnapshot(); @@ -38,7 +38,7 @@ describe('PageView component', () => { expect( render( - body content + {'body content'} ) ).toMatchSnapshot(); @@ -46,8 +46,8 @@ describe('PageView component', () => { it(`should use custom element for header left and not wrap in EuiTitle`, () => { expect( render( - title here

}> - body content + {'title here'}

}> + {'body content'}
) ).toMatchSnapshot(); @@ -56,7 +56,7 @@ describe('PageView component', () => { expect( render( - body content + {'body content'} ) ).toMatchSnapshot(); @@ -64,8 +64,8 @@ describe('PageView component', () => { it('should display body header custom element', () => { expect( render( - body header

}> - body content + {'body header'}

}> + {'body content'}
) ).toMatchSnapshot(); @@ -80,7 +80,7 @@ describe('PageView component', () => { aria-label="test-aria-label-here" data-test-subj="test-data-test-subj-here" > - body content + {'body content'}
) ).toMatchSnapshot(); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/components/page_view.tsx b/x-pack/plugins/siem/public/common/components/endpoint/page_view.tsx similarity index 96% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/components/page_view.tsx rename to x-pack/plugins/siem/public/common/components/endpoint/page_view.tsx index 6da352b68f890..b2b8078c3fe97 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/components/page_view.tsx +++ b/x-pack/plugins/siem/public/common/components/endpoint/page_view.tsx @@ -56,6 +56,8 @@ export const PageViewHeaderTitle = memo<{ children: ReactNode }>(({ children }) ); }); +PageViewHeaderTitle.displayName = 'PageViewHeaderTitle'; + /** * The `PageView` component used to render `bodyHeader` when it is set as a `string` * Can be used when wanting to customize the `bodyHeader` value but still use the standard @@ -70,6 +72,7 @@ export const PageViewBodyHeaderTitle = memo<{ children: ReactNode }>( ); } ); +PageViewBodyHeaderTitle.displayName = 'PageViewBodyHeaderTitle'; /** * Page View layout for use in Endpoint @@ -135,3 +138,5 @@ export const PageView = memo< ); }); + +PageView.displayName = 'PageView'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/route_capture.tsx b/x-pack/plugins/siem/public/common/components/endpoint/route_capture.tsx similarity index 77% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/route_capture.tsx rename to x-pack/plugins/siem/public/common/components/endpoint/route_capture.tsx index 28d2019b56888..7340d639070ab 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/route_capture.tsx +++ b/x-pack/plugins/siem/public/common/components/endpoint/route_capture.tsx @@ -7,15 +7,18 @@ import React, { memo } from 'react'; import { useLocation } from 'react-router-dom'; import { useDispatch } from 'react-redux'; -import { EndpointAppLocation, AppAction } from '../types'; +import { AppLocation } from '../../../../common/endpoint/types'; +import { AppAction } from '../../store/actions'; /** * This component should be used above all routes, but below the Provider. * It dispatches actions when the URL is changed. */ export const RouteCapture = memo(({ children }) => { - const location: EndpointAppLocation = useLocation(); + const location: AppLocation = useLocation(); const dispatch: (action: AppAction) => unknown = useDispatch(); dispatch({ type: 'userChangedUrl', payload: location }); return <>{children}; }); + +RouteCapture.displayName = 'RouteCapture'; diff --git a/x-pack/plugins/siem/public/common/components/links/index.tsx b/x-pack/plugins/siem/public/common/components/links/index.tsx index 4d639ce2781b1..93885b8ceaa6a 100644 --- a/x-pack/plugins/siem/public/common/components/links/index.tsx +++ b/x-pack/plugins/siem/public/common/components/links/index.tsx @@ -23,7 +23,7 @@ import { } from '../link_to'; import { FlowTarget, FlowTargetSourceDest } from '../../../graphql/types'; import { useUiSetting$ } from '../../lib/kibana'; -import { isUrlInvalid } from '../../../alerts/components/rules/step_about_rule/helpers'; +import { isUrlInvalid } from '../../utils/validators'; import { ExternalLinkIcon } from '../external_link_icon'; import { navTabs } from '../../../app/home/home_navigations'; import { useGetUrlSearch } from '../navigation/use_get_url_search'; diff --git a/x-pack/plugins/siem/public/common/components/navigation/breadcrumbs/index.ts b/x-pack/plugins/siem/public/common/components/navigation/breadcrumbs/index.ts index 16ae1b1e096ca..a202407b1270c 100644 --- a/x-pack/plugins/siem/public/common/components/navigation/breadcrumbs/index.ts +++ b/x-pack/plugins/siem/public/common/components/navigation/breadcrumbs/index.ts @@ -9,7 +9,7 @@ import { getOr, omit } from 'lodash/fp'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { ChromeBreadcrumb } from '../../../../../../../../src/core/public'; import { APP_NAME } from '../../../../../common/constants'; -import { StartServices } from '../../../../plugin'; +import { StartServices } from '../../../../types'; import { getBreadcrumbs as getHostDetailsBreadcrumbs } from '../../../../hosts/pages/details/utils'; import { getBreadcrumbs as getIPDetailsBreadcrumbs } from '../../../../network/pages/ip_details'; import { getBreadcrumbs as getCaseDetailsBreadcrumbs } from '../../../../cases/pages/utils'; diff --git a/x-pack/plugins/siem/public/common/hooks/api/api.tsx b/x-pack/plugins/siem/public/common/hooks/api/api.tsx index 12863bffcf515..4c2cf031f781f 100644 --- a/x-pack/plugins/siem/public/common/hooks/api/api.tsx +++ b/x-pack/plugins/siem/public/common/hooks/api/api.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { StartServices } from '../../../plugin'; +import { StartServices } from '../../../types'; import { IndexPatternSavedObject, IndexPatternSavedObjectAttributes } from '../types'; /** diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hooks/use_navigate_by_router_event_handler.test.tsx b/x-pack/plugins/siem/public/common/hooks/endpoint/use_navigate_by_router_event_handler.test.tsx similarity index 97% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/hooks/use_navigate_by_router_event_handler.test.tsx rename to x-pack/plugins/siem/public/common/hooks/endpoint/use_navigate_by_router_event_handler.test.tsx index b1f09617f0174..f7e433361118f 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hooks/use_navigate_by_router_event_handler.test.tsx +++ b/x-pack/plugins/siem/public/common/hooks/endpoint/use_navigate_by_router_event_handler.test.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import React from 'react'; -import { AppContextTestRender, createAppRootMockRenderer } from '../../mocks'; +import { AppContextTestRender, createAppRootMockRenderer } from '../../mock/endpoint'; import { useNavigateByRouterEventHandler } from './use_navigate_by_router_event_handler'; import { act, fireEvent, cleanup } from '@testing-library/react'; @@ -19,6 +19,7 @@ describe('useNavigateByRouterEventHandler hook', () => { let renderResult: ReturnType; let linkEle: HTMLAnchorElement; let clickHandlerSpy: ClickHandlerMock; + // eslint-disable-next-line react/display-name const Link = React.memo<{ routeTo: Parameters[0]; onClick?: Parameters[1]; @@ -26,7 +27,7 @@ describe('useNavigateByRouterEventHandler hook', () => { const onClickHandler = useNavigateByRouterEventHandler(routeTo, onClick); return (
- mock link + {'mock link'} ); }); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hooks/use_navigate_by_router_event_handler.ts b/x-pack/plugins/siem/public/common/hooks/endpoint/use_navigate_by_router_event_handler.ts similarity index 100% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/hooks/use_navigate_by_router_event_handler.ts rename to x-pack/plugins/siem/public/common/hooks/endpoint/use_navigate_by_router_event_handler.ts diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hooks/use_navigate_to_app_event_handler.ts b/x-pack/plugins/siem/public/common/hooks/endpoint/use_navigate_to_app_event_handler.ts similarity index 96% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/hooks/use_navigate_to_app_event_handler.ts rename to x-pack/plugins/siem/public/common/hooks/endpoint/use_navigate_to_app_event_handler.ts index ec9a8691c481e..5fbfa5e0e58a8 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hooks/use_navigate_to_app_event_handler.ts +++ b/x-pack/plugins/siem/public/common/hooks/endpoint/use_navigate_to_app_event_handler.ts @@ -6,7 +6,7 @@ import { MouseEventHandler, useCallback } from 'react'; import { ApplicationStart } from 'kibana/public'; -import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; +import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; type NavigateToAppHandlerProps = Parameters; type EventHandlerCallback = MouseEventHandler; diff --git a/x-pack/plugins/siem/public/common/lib/kibana/kibana_react.ts b/x-pack/plugins/siem/public/common/lib/kibana/kibana_react.ts index 42738c6bbe7d8..075f06084384b 100644 --- a/x-pack/plugins/siem/public/common/lib/kibana/kibana_react.ts +++ b/x-pack/plugins/siem/public/common/lib/kibana/kibana_react.ts @@ -12,7 +12,7 @@ import { useUiSetting$, withKibana, } from '../../../../../../../src/plugins/kibana_react/public'; -import { StartServices } from '../../../plugin'; +import { StartServices } from '../../../types'; export type KibanaContext = KibanaReactContextValue; export interface WithKibanaProps { diff --git a/x-pack/plugins/siem/public/common/lib/telemetry/index.ts b/x-pack/plugins/siem/public/common/lib/telemetry/index.ts index 0ed524c2ae548..e79ef0d128225 100644 --- a/x-pack/plugins/siem/public/common/lib/telemetry/index.ts +++ b/x-pack/plugins/siem/public/common/lib/telemetry/index.ts @@ -6,7 +6,7 @@ import { METRIC_TYPE, UiStatsMetricType } from '@kbn/analytics'; -import { SetupPlugins } from '../../../plugin'; +import { SetupPlugins } from '../../../types'; export { telemetryMiddleware } from './middleware'; export { METRIC_TYPE }; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/mocks/app_context_render.tsx b/x-pack/plugins/siem/public/common/mock/endpoint/app_context_render.tsx similarity index 54% rename from x-pack/plugins/endpoint/public/applications/endpoint/mocks/app_context_render.tsx rename to x-pack/plugins/siem/public/common/mock/endpoint/app_context_render.tsx index 639b1f7252d7f..73ac5fdf51529 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/mocks/app_context_render.tsx +++ b/x-pack/plugins/siem/public/common/mock/endpoint/app_context_render.tsx @@ -7,12 +7,20 @@ import React from 'react'; import { createMemoryHistory } from 'history'; import { render as reactRender, RenderOptions, RenderResult } from '@testing-library/react'; -import { appStoreFactory } from '../store'; +import { Store } from 'redux'; + import { coreMock } from '../../../../../../../src/core/public/mocks'; -import { EndpointPluginStartDependencies } from '../../../plugin'; +import { StartPlugins } from '../../../types'; import { depsStartMock } from './dependencies_start_mock'; -import { AppRootProvider } from '../view/app_root_provider'; -import { createSpyMiddleware, MiddlewareActionSpyHelper } from '../store/test_utils'; +import { MiddlewareActionSpyHelper, createSpyMiddleware } from '../../store/test_utils'; +import { apolloClientObservable } from '../test_providers'; +import { createStore, State, substateMiddlewareFactory } from '../../store'; +import { hostMiddlewareFactory } from '../../../endpoint_hosts/store/middleware'; +import { policyListMiddlewareFactory } from '../../../endpoint_policy/store/policy_list/middleware'; +import { policyDetailsMiddlewareFactory } from '../../../endpoint_policy/store/policy_details/middleware'; +import { alertMiddlewareFactory } from '../../../endpoint_alerts/store/middleware'; +import { AppRootProvider } from './app_root_provider'; +import { SUB_PLUGINS_REDUCER, mockGlobalState } from '..'; type UiRender = (ui: React.ReactElement, options?: RenderOptions) => RenderResult; @@ -20,15 +28,16 @@ type UiRender = (ui: React.ReactElement, options?: RenderOptions) => RenderResul * Mocked app root context renderer */ export interface AppContextTestRender { - store: ReturnType; + store: Store; history: ReturnType; coreStart: ReturnType; - depsStart: EndpointPluginStartDependencies; + depsStart: Pick; middlewareSpy: MiddlewareActionSpyHelper; /** * A wrapper around `AppRootContext` component. Uses the mocked modules as input to the * `AppRootContext` */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any AppWrapper: React.FC; /** * Renders the given UI within the created `AppWrapper` providing the given UI a mocked @@ -48,12 +57,28 @@ export const createAppRootMockRenderer = (): AppContextTestRender => { const coreStart = coreMock.createStart({ basePath: '/mock' }); const depsStart = depsStartMock(); const middlewareSpy = createSpyMiddleware(); - const store = appStoreFactory({ - coreStart, - depsStart, - additionalMiddleware: [middlewareSpy.actionSpyMiddleware], - }); - const AppWrapper: React.FunctionComponent<{ children: React.ReactElement }> = ({ children }) => ( + const state: State = mockGlobalState; + const store = createStore(state, SUB_PLUGINS_REDUCER, apolloClientObservable, [ + substateMiddlewareFactory( + globalState => globalState.hostList, + hostMiddlewareFactory(coreStart, depsStart) + ), + substateMiddlewareFactory( + globalState => globalState.policyList, + policyListMiddlewareFactory(coreStart, depsStart) + ), + substateMiddlewareFactory( + globalState => globalState.policyDetails, + policyDetailsMiddlewareFactory(coreStart, depsStart) + ), + substateMiddlewareFactory( + globalState => globalState.alertList, + alertMiddlewareFactory(coreStart, depsStart) + ), + middlewareSpy.actionSpyMiddleware, + ]); + + const AppWrapper: React.FC<{ children: React.ReactElement }> = ({ children }) => ( {children} @@ -61,7 +86,7 @@ export const createAppRootMockRenderer = (): AppContextTestRender => { const render: UiRender = (ui, options) => { // @ts-ignore return reactRender(ui, { - wrapper: AppWrapper, + wrapper: AppWrapper as React.ComponentType, ...options, }); }; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/app_root_provider.tsx b/x-pack/plugins/siem/public/common/mock/endpoint/app_root_provider.tsx similarity index 83% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/app_root_provider.tsx rename to x-pack/plugins/siem/public/common/mock/endpoint/app_root_provider.tsx index ca27831ee90b5..73c0f00573911 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/app_root_provider.tsx +++ b/x-pack/plugins/siem/public/common/mock/endpoint/app_root_provider.tsx @@ -9,22 +9,22 @@ import { Provider } from 'react-redux'; import { I18nProvider } from '@kbn/i18n/react'; import { Router } from 'react-router-dom'; import { History } from 'history'; -import { CoreStart } from 'kibana/public'; import { useObservable } from 'react-use'; +import { Store } from 'redux'; import { EuiThemeProvider } from '../../../../../../legacy/common/eui_styled_components'; import { KibanaContextProvider } from '../../../../../../../src/plugins/kibana_react/public'; -import { appStoreFactory } from '../store'; -import { RouteCapture } from './route_capture'; -import { EndpointPluginStartDependencies } from '../../../plugin'; +import { RouteCapture } from '../../components/endpoint/route_capture'; +import { StartPlugins } from '../../../types'; +import { CoreStart } from '../../../../../../../src/core/public'; /** * Provides the context for rendering the endpoint app */ export const AppRootProvider = memo<{ - store: ReturnType; + store: Store; history: History; coreStart: CoreStart; - depsStart: EndpointPluginStartDependencies; + depsStart: Pick; children: ReactNode | ReactNode[]; }>( ({ @@ -56,3 +56,5 @@ export const AppRootProvider = memo<{ ); } ); + +AppRootProvider.displayName = 'AppRootProvider'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/mocks/dependencies_start_mock.ts b/x-pack/plugins/siem/public/common/mock/endpoint/dependencies_start_mock.ts similarity index 100% rename from x-pack/plugins/endpoint/public/applications/endpoint/mocks/dependencies_start_mock.ts rename to x-pack/plugins/siem/public/common/mock/endpoint/dependencies_start_mock.ts diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/mocks/index.ts b/x-pack/plugins/siem/public/common/mock/endpoint/index.ts similarity index 100% rename from x-pack/plugins/endpoint/public/applications/endpoint/mocks/index.ts rename to x-pack/plugins/siem/public/common/mock/endpoint/index.ts diff --git a/x-pack/plugins/siem/public/common/mock/global_state.ts b/x-pack/plugins/siem/public/common/mock/global_state.ts index e215aa7403ec9..da49ebe6552f3 100644 --- a/x-pack/plugins/siem/public/common/mock/global_state.ts +++ b/x-pack/plugins/siem/public/common/mock/global_state.ts @@ -24,7 +24,16 @@ import { DEFAULT_INTERVAL_VALUE, } from '../../../common/constants'; import { networkModel } from '../../network/store'; -import { TimelineType } from '../../../common/types/timeline'; +import { TimelineType, TimelineStatus } from '../../../common/types/timeline'; +import { initialPolicyListState } from '../../endpoint_policy/store/policy_list/reducer'; +import { initialAlertListState } from '../../endpoint_alerts/store/reducer'; +import { initialPolicyDetailsState } from '../../endpoint_policy/store/policy_details/reducer'; +import { initialHostListState } from '../../endpoint_hosts/store/reducer'; + +const policyList = initialPolicyListState(); +const alertList = initialAlertListState(); +const policyDetails = initialPolicyDetailsState(); +const hostList = initialHostListState(); export const mockGlobalState: State = { app: { @@ -222,7 +231,12 @@ export const mockGlobalState: State = { width: DEFAULT_TIMELINE_WIDTH, isSaving: false, version: null, + status: TimelineStatus.active, }, }, }, + alertList, + hostList, + policyList, + policyDetails, }; diff --git a/x-pack/plugins/siem/public/common/mock/timeline_results.ts b/x-pack/plugins/siem/public/common/mock/timeline_results.ts index 13ac356f67773..5c41812fdb95c 100644 --- a/x-pack/plugins/siem/public/common/mock/timeline_results.ts +++ b/x-pack/plugins/siem/public/common/mock/timeline_results.ts @@ -5,7 +5,7 @@ */ import { FilterStateStore } from '../../../../../../src/plugins/data/common/es_query/filters/meta_filter'; -import { TimelineType } from '../../../common/types/timeline'; +import { TimelineType, TimelineStatus } from '../../../common/types/timeline'; import { OpenTimelineResult } from '../../timelines/components/open_timeline/types'; import { GetAllTimeline, SortFieldTimeline, TimelineResult, Direction } from '../../graphql/types'; @@ -2142,6 +2142,7 @@ export const mockTimelineModel: TimelineModel = { columnId: '@timestamp', sortDirection: Direction.desc, }, + status: TimelineStatus.active, title: 'Test rule', timelineType: TimelineType.default, templateTimelineId: null, @@ -2242,8 +2243,9 @@ export const defaultTimelineProps: CreateTimelineProps = { showCheckboxes: false, showRowRenderers: true, sort: { columnId: '@timestamp', sortDirection: Direction.desc }, + status: TimelineStatus.draft, title: '', - timelineType: TimelineType.draft, + timelineType: TimelineType.default, templateTimelineVersion: null, templateTimelineId: null, version: null, diff --git a/x-pack/plugins/siem/public/common/mock/utils.ts b/x-pack/plugins/siem/public/common/mock/utils.ts index 2b54bf83c0a9b..68c52e493898f 100644 --- a/x-pack/plugins/siem/public/common/mock/utils.ts +++ b/x-pack/plugins/siem/public/common/mock/utils.ts @@ -7,6 +7,10 @@ import { hostsReducer } from '../../hosts/store'; import { networkReducer } from '../../network/store'; import { timelineReducer } from '../../timelines/store/timeline/reducer'; +import { hostListReducer } from '../../endpoint_hosts/store'; +import { alertListReducer } from '../../endpoint_alerts/store'; +import { policyListReducer } from '../../endpoint_policy/store/policy_list'; +import { policyDetailsReducer } from '../../endpoint_policy/store/policy_details'; interface Global extends NodeJS.Global { // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -19,4 +23,8 @@ export const SUB_PLUGINS_REDUCER = { hosts: hostsReducer, network: networkReducer, timeline: timelineReducer, + hostList: hostListReducer, + alertList: alertListReducer, + policyList: policyListReducer, + policyDetails: policyDetailsReducer, }; diff --git a/x-pack/plugins/siem/public/common/store/actions.ts b/x-pack/plugins/siem/public/common/store/actions.ts index 8a6c292c4893a..a51b075dc7514 100644 --- a/x-pack/plugins/siem/public/common/store/actions.ts +++ b/x-pack/plugins/siem/public/common/store/actions.ts @@ -4,6 +4,19 @@ * you may not use this file except in compliance with the Elastic License. */ +import { HostAction } from '../../endpoint_hosts/store/action'; +import { AlertAction } from '../../endpoint_alerts/store/action'; +import { PolicyListAction } from '../../endpoint_policy/store/policy_list'; +import { PolicyDetailsAction } from '../../endpoint_policy/store/policy_details'; + export { appActions } from './app'; export { dragAndDropActions } from './drag_and_drop'; export { inputsActions } from './inputs'; +import { RoutingAction } from './routing'; + +export type AppAction = + | HostAction + | AlertAction + | RoutingAction + | PolicyListAction + | PolicyDetailsAction; diff --git a/x-pack/plugins/siem/public/common/store/index.ts b/x-pack/plugins/siem/public/common/store/index.ts index 8f5c4449308e2..57162eaae842a 100644 --- a/x-pack/plugins/siem/public/common/store/index.ts +++ b/x-pack/plugins/siem/public/common/store/index.ts @@ -9,5 +9,19 @@ export * from './reducer'; export * from './selectors'; import { createStore, getStore } from './store'; +import { SubstateMiddlewareFactory } from './types'; export { createStore, getStore }; + +export const substateMiddlewareFactory: SubstateMiddlewareFactory = (selector, middleware) => { + return api => { + const substateAPI = { + ...api, + // Return just the substate instead of global state. + getState() { + return selector(api.getState()); + }, + }; + return middleware(substateAPI); + }; +}; diff --git a/x-pack/plugins/siem/public/common/store/reducer.ts b/x-pack/plugins/siem/public/common/store/reducer.ts index da1dcd3ea9e73..570e851a3aa5e 100644 --- a/x-pack/plugins/siem/public/common/store/reducer.ts +++ b/x-pack/plugins/siem/public/common/store/reducer.ts @@ -13,8 +13,28 @@ import { createInitialInputsState, initialInputsState, inputsReducer, InputsStat import { HostsPluginState, HostsPluginReducer } from '../../hosts/store'; import { NetworkPluginState, NetworkPluginReducer } from '../../network/store'; import { TimelinePluginState, TimelinePluginReducer } from '../../timelines/store/timeline'; +import { + EndpointAlertsPluginState, + EndpointAlertsPluginReducer, +} from '../../endpoint_alerts/store'; +import { EndpointHostsPluginState, EndpointHostsPluginReducer } from '../../endpoint_hosts/store'; +import { + EndpointPolicyDetailsStatePluginState, + EndpointPolicyDetailsStatePluginReducer, +} from '../../endpoint_policy/store/policy_details'; +import { + EndpointPolicyListStatePluginState, + EndpointPolicyListStatePluginReducer, +} from '../../endpoint_policy/store/policy_list'; -export interface State extends HostsPluginState, NetworkPluginState, TimelinePluginState { +export interface State + extends HostsPluginState, + NetworkPluginState, + TimelinePluginState, + EndpointAlertsPluginState, + EndpointHostsPluginState, + EndpointPolicyDetailsStatePluginState, + EndpointPolicyListStatePluginState { app: AppState; dragAndDrop: DragAndDropState; inputs: InputsState; @@ -26,10 +46,20 @@ export const initialState: Pick = { inputs: initialInputsState, }; -type SubPluginsInitState = HostsPluginState & NetworkPluginState & TimelinePluginState; +type SubPluginsInitState = HostsPluginState & + NetworkPluginState & + TimelinePluginState & + EndpointAlertsPluginState & + EndpointHostsPluginState & + EndpointPolicyDetailsStatePluginState & + EndpointPolicyListStatePluginState; export type SubPluginsInitReducer = HostsPluginReducer & NetworkPluginReducer & - TimelinePluginReducer; + TimelinePluginReducer & + EndpointAlertsPluginReducer & + EndpointHostsPluginReducer & + EndpointPolicyDetailsStatePluginReducer & + EndpointPolicyListStatePluginReducer; export const createInitialState = (pluginsInitState: SubPluginsInitState): State => ({ ...initialState, diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/routing/action.ts b/x-pack/plugins/siem/public/common/store/routing/action.ts similarity index 68% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/routing/action.ts rename to x-pack/plugins/siem/public/common/store/routing/action.ts index fd72a02b33588..ae5e4eb32d476 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/routing/action.ts +++ b/x-pack/plugins/siem/public/common/store/routing/action.ts @@ -4,12 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Immutable } from '../../../../../common/types'; -import { EndpointAppLocation } from '../../types'; +import { AppLocation, Immutable } from '../../../../common/endpoint/types'; interface UserChangedUrl { readonly type: 'userChangedUrl'; - readonly payload: Immutable; + readonly payload: Immutable; } export type RoutingAction = UserChangedUrl; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/routing/index.ts b/x-pack/plugins/siem/public/common/store/routing/index.ts similarity index 100% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/routing/index.ts rename to x-pack/plugins/siem/public/common/store/routing/index.ts diff --git a/x-pack/plugins/siem/public/common/store/store.ts b/x-pack/plugins/siem/public/common/store/store.ts index ea7cb417fb24b..10ea61828ed36 100644 --- a/x-pack/plugins/siem/public/common/store/store.ts +++ b/x-pack/plugins/siem/public/common/store/store.ts @@ -4,7 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Action, applyMiddleware, compose, createStore as createReduxStore, Store } from 'redux'; +import { + Action, + applyMiddleware, + compose, + createStore as createReduxStore, + Store, + Middleware, + Dispatch, +} from 'redux'; import { createEpicMiddleware } from 'redux-observable'; import { Observable } from 'rxjs'; @@ -16,6 +24,8 @@ import { inputsSelectors } from './inputs'; import { State, SubPluginsInitReducer, createReducer } from './reducer'; import { createRootEpic } from './epic'; import { AppApolloClient } from '../lib/lib'; +import { AppAction } from './actions'; +import { Immutable } from '../../../common/endpoint/types'; type ComposeType = typeof compose; declare global { @@ -28,7 +38,8 @@ export { SubPluginsInitReducer }; export const createStore = ( state: State, pluginsReducer: SubPluginsInitReducer, - apolloClient: Observable + apolloClient: Observable, + additionalMiddleware?: Array>>> ): Store => { const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; @@ -49,7 +60,9 @@ export const createStore = ( store = createReduxStore( createReducer(pluginsReducer), state, - composeEnhancers(applyMiddleware(epicMiddleware, telemetryMiddleware)) + composeEnhancers( + applyMiddleware(epicMiddleware, telemetryMiddleware, ...(additionalMiddleware ?? [])) + ) ); epicMiddleware.run(createRootEpic()); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/test_utils.ts b/x-pack/plugins/siem/public/common/store/test_utils.ts similarity index 95% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/test_utils.ts rename to x-pack/plugins/siem/public/common/store/test_utils.ts index df17cf8cf6638..74d65ee5b589b 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/test_utils.ts +++ b/x-pack/plugins/siem/public/common/store/test_utils.ts @@ -5,12 +5,14 @@ */ import { Dispatch } from 'redux'; -import { AppAction, GlobalState, ImmutableMiddlewareFactory } from '../types'; +import { State } from './reducer'; +import { AppAction } from './actions'; +import { ImmutableMiddlewareFactory } from './types'; /** * Utilities for testing Redux middleware */ -export interface MiddlewareActionSpyHelper { +export interface MiddlewareActionSpyHelper { /** * Returns a promise that is fulfilled when the given action is dispatched or a timeout occurs. * The `action` will given to the promise `resolve` thus allowing for checks to be done. @@ -67,7 +69,7 @@ export interface MiddlewareActionSpyHelper(): MiddlewareActionSpyHelper => { type ActionWatcher = (action: A) => void; diff --git a/x-pack/plugins/siem/public/common/store/types.ts b/x-pack/plugins/siem/public/common/store/types.ts index 2c679ba41116e..0a1010ea87fca 100644 --- a/x-pack/plugins/siem/public/common/store/types.ts +++ b/x-pack/plugins/siem/public/common/store/types.ts @@ -4,6 +4,20 @@ * you may not use this file except in compliance with the Elastic License. */ +import { + Dispatch, + Action as ReduxAction, + AnyAction as ReduxAnyAction, + Action, + Middleware, +} from 'redux'; + +import { CoreStart } from '../../../../../../src/core/public'; +import { Immutable } from '../../../common/endpoint_alerts/types'; +import { State } from './reducer'; +import { StartPlugins } from '../../types'; +import { AppAction } from './actions'; + export type KueryFilterQueryKind = 'kuery' | 'lucene'; export interface KueryFilterQuery { @@ -15,3 +29,94 @@ export interface SerializedFilterQuery { kuery: KueryFilterQuery | null; serializedQuery: string; } + +/** + * like redux's `MiddlewareAPI` but `getState` returns an `Immutable` version of + * state and `dispatch` accepts `Immutable` versions of actions. + */ +export interface ImmutableMiddlewareAPI { + dispatch: Dispatch>; + getState(): Immutable; +} + +/** + * Like redux's `Middleware` but without the ability to mutate actions or state. + * Differences: + * * `getState` returns an `Immutable` version of state + * * `dispatch` accepts `Immutable` versions of actions + * * `action`s received will be `Immutable` + */ +export type ImmutableMiddleware = ( + api: ImmutableMiddlewareAPI +) => (next: Dispatch>) => (action: Immutable) => unknown; + +/** + * Takes application-standard middleware dependencies + * and returns a redux middleware. + * Middleware will be of the `ImmutableMiddleware` variety. Not able to directly + * change actions or state. + */ +export type ImmutableMiddlewareFactory = ( + coreStart: CoreStart, + depsStart: Pick +) => ImmutableMiddleware; + +/** + * Simple type for a redux selector. + */ +type Selector = (state: S) => R; + +/** + * Takes a selector and an `ImmutableMiddleware`. The + * middleware's version of `getState` will receive + * the result of the selector instead of the global state. + * + * This allows middleware to have knowledge of only a subsection of state. + * + * `selector` returns an `Immutable` version of the substate. + * `middleware` must be an `ImmutableMiddleware`. + * + * Returns a regular middleware, meant to be used with `applyMiddleware`. + */ +export type SubstateMiddlewareFactory = ( + selector: Selector>, + middleware: ImmutableMiddleware +) => Middleware<{}, State, Dispatch>>; + +/** + * Like `Reducer` from `redux` but it accepts immutable versions of `state` and `action`. + * Use this type for all Reducers in order to help enforce our pattern of immutable state. + */ +export type ImmutableReducer = ( + state: Immutable | undefined, + action: Immutable +) => State | Immutable; + +/** + * A alternate interface for `redux`'s `combineReducers`. Will work with the same underlying implementation, + * but will enforce that `Immutable` versions of `state` and `action` are received. + */ +export type ImmutableCombineReducers = ( + reducers: ImmutableReducersMapObject +) => ImmutableReducer; + +/** + * Like `redux`'s `ReducersMapObject` (which is used by `combineReducers`) but enforces that + * the `state` and `action` received are `Immutable` versions. + */ +type ImmutableReducersMapObject = { + [K in keyof S]: ImmutableReducer; +}; + +/** + * A better type for createStructuredSelector. This doesn't support the options object. + */ +export type CreateStructuredSelector = < + SelectorMap extends { [key: string]: (...args: never[]) => unknown } +>( + selectorMap: SelectorMap +) => ( + state: SelectorMap[keyof SelectorMap] extends (state: infer State) => unknown ? State : never +) => { + [Key in keyof SelectorMap]: ReturnType; +}; diff --git a/x-pack/plugins/endpoint/server/routes/alerts/details/lib/index.ts b/x-pack/plugins/siem/public/common/types.ts similarity index 72% rename from x-pack/plugins/endpoint/server/routes/alerts/details/lib/index.ts rename to x-pack/plugins/siem/public/common/types.ts index 20ae25f7aa849..f83bb71790884 100644 --- a/x-pack/plugins/endpoint/server/routes/alerts/details/lib/index.ts +++ b/x-pack/plugins/siem/public/common/types.ts @@ -4,4 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -export { AlertDetailsPagination } from './pagination'; +export interface ServerApiError { + statusCode: number; + error: string; + message: string; +} diff --git a/x-pack/plugins/endpoint/public/common/clone_http_fetch_query.test.ts b/x-pack/plugins/siem/public/common/utils/clone_http_fetch_query.test.ts similarity index 85% rename from x-pack/plugins/endpoint/public/common/clone_http_fetch_query.test.ts rename to x-pack/plugins/siem/public/common/utils/clone_http_fetch_query.test.ts index 9ac6b8b29f462..f70c2e8b63885 100644 --- a/x-pack/plugins/endpoint/public/common/clone_http_fetch_query.test.ts +++ b/x-pack/plugins/siem/public/common/utils/clone_http_fetch_query.test.ts @@ -5,8 +5,8 @@ */ import { cloneHttpFetchQuery } from './clone_http_fetch_query'; -import { Immutable } from '../../common/types'; -import { HttpFetchQuery } from '../../../../../src/core/public'; +import { HttpFetchQuery } from '../../../../../../src/core/public'; +import { Immutable } from '../../../common/endpoint/types'; describe('cloneHttpFetchQuery', () => { it('can clone complex queries', () => { diff --git a/x-pack/plugins/endpoint/public/common/clone_http_fetch_query.ts b/x-pack/plugins/siem/public/common/utils/clone_http_fetch_query.ts similarity index 82% rename from x-pack/plugins/endpoint/public/common/clone_http_fetch_query.ts rename to x-pack/plugins/siem/public/common/utils/clone_http_fetch_query.ts index fdf1d6603830a..bfa433dc9f9ac 100644 --- a/x-pack/plugins/endpoint/public/common/clone_http_fetch_query.ts +++ b/x-pack/plugins/siem/public/common/utils/clone_http_fetch_query.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Immutable } from '../../common/types'; +import { Immutable } from '../../../common/endpoint_alerts/types'; -import { HttpFetchQuery } from '../../../../../src/core/public'; +import { HttpFetchQuery } from '../../../../../../src/core/public'; export function cloneHttpFetchQuery(query: Immutable): HttpFetchQuery { const clone: HttpFetchQuery = {}; diff --git a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/helpers.test.ts b/x-pack/plugins/siem/public/common/utils/validators/index.test.ts similarity index 92% rename from x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/helpers.test.ts rename to x-pack/plugins/siem/public/common/utils/validators/index.test.ts index 5eb503f8ba074..d8008fb09ec0c 100644 --- a/x-pack/plugins/siem/public/alerts/components/rules/step_about_rule/helpers.test.ts +++ b/x-pack/plugins/siem/public/common/utils/validators/index.test.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { isUrlInvalid } from './helpers'; +import { isUrlInvalid } from '.'; describe('helpers', () => { describe('isUrlInvalid', () => { diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/formatted_date.tsx b/x-pack/plugins/siem/public/endpoint_alerts/components/formatted_date.tsx similarity index 93% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/formatted_date.tsx rename to x-pack/plugins/siem/public/endpoint_alerts/components/formatted_date.tsx index 731bd31b26cef..4b9bce4d42eb5 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/formatted_date.tsx +++ b/x-pack/plugins/siem/public/endpoint_alerts/components/formatted_date.tsx @@ -20,3 +20,5 @@ export const FormattedDate = memo(({ timestamp }: { timestamp: number }) => { /> ); }); + +FormattedDate.displayName = 'FormattedDate'; diff --git a/x-pack/plugins/siem/public/endpoint_alerts/index.ts b/x-pack/plugins/siem/public/endpoint_alerts/index.ts new file mode 100644 index 0000000000000..a1f730e209dc2 --- /dev/null +++ b/x-pack/plugins/siem/public/endpoint_alerts/index.ts @@ -0,0 +1,39 @@ +/* + * 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 { SecuritySubPluginWithStore } from '../app/types'; +import { getEndpointAlertsRoutes } from './routes'; +import { Immutable } from '../../common/endpoint/types'; +import { initialAlertListState, alertListReducer } from './store/reducer'; +import { AlertListState } from '../../common/endpoint_alerts/types'; +import { alertMiddlewareFactory } from './store/middleware'; +import { substateMiddlewareFactory } from '../common/store'; +import { CoreStart } from '../../../../../src/core/public'; +import { StartPlugins } from '../types'; + +export class EndpointAlerts { + public setup() {} + + public start( + core: CoreStart, + plugins: StartPlugins + ): SecuritySubPluginWithStore<'alertList', Immutable> { + const { data, ingestManager } = plugins; + const middleware = substateMiddlewareFactory( + globalState => globalState.alertList, + alertMiddlewareFactory(core, { data, ingestManager }) + ); + + return { + routes: getEndpointAlertsRoutes(), + store: { + initialState: { alertList: initialAlertListState() }, + reducer: { alertList: alertListReducer }, + middleware, + }, + }; + } +} diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/models/index_pattern.ts b/x-pack/plugins/siem/public/endpoint_alerts/models/index_pattern.ts similarity index 78% rename from x-pack/plugins/endpoint/public/applications/endpoint/models/index_pattern.ts rename to x-pack/plugins/siem/public/endpoint_alerts/models/index_pattern.ts index 0cae054432f96..8daaa3fef7a29 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/models/index_pattern.ts +++ b/x-pack/plugins/siem/public/endpoint_alerts/models/index_pattern.ts @@ -5,8 +5,8 @@ */ import { all } from 'deepmerge'; -import { Immutable } from '../../../../common/types'; -import { IIndexPattern } from '../../../../../../../src/plugins/data/common'; +import { IIndexPattern } from 'src/plugins/data/public'; +import { Immutable } from '../../../common/endpoint_alerts/types'; /** * Model for the `IIndexPattern` interface exported by the `data` plugin. diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/index.ts b/x-pack/plugins/siem/public/endpoint_alerts/routes.tsx similarity index 50% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/index.ts rename to x-pack/plugins/siem/public/endpoint_alerts/routes.tsx index e80d7a82dc8cb..60df7f5d47129 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/index.ts +++ b/x-pack/plugins/siem/public/endpoint_alerts/routes.tsx @@ -4,6 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -export { hostListReducer } from './reducer'; -export { HostAction } from './action'; -export { hostMiddlewareFactory } from './middleware'; +import React from 'react'; +import { Route } from 'react-router-dom'; + +import { AlertIndex } from './view'; + +export const getEndpointAlertsRoutes = () => [ + + + , +]; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/action.ts b/x-pack/plugins/siem/public/endpoint_alerts/store/action.ts similarity index 84% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/action.ts rename to x-pack/plugins/siem/public/endpoint_alerts/store/action.ts index 80b7fd87e13be..ae103edaa5a2b 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/action.ts +++ b/x-pack/plugins/siem/public/endpoint_alerts/store/action.ts @@ -5,8 +5,8 @@ */ import { IIndexPattern } from 'src/plugins/data/public'; -import { Immutable, AlertDetails } from '../../../../../common/types'; -import { AlertListData } from '../../types'; +// import { Immutable } from '../../../common/types'; +import { AlertDetails, AlertListData, Immutable } from '../../../common/endpoint_alerts/types'; interface ServerReturnedAlertsData { readonly type: 'serverReturnedAlertsData'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/alert_details.test.ts b/x-pack/plugins/siem/public/endpoint_alerts/store/alert_details.test.ts similarity index 83% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/alert_details.test.ts rename to x-pack/plugins/siem/public/endpoint_alerts/store/alert_details.test.ts index feac8944f476b..c6f3de73aa2b3 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/alert_details.test.ts +++ b/x-pack/plugins/siem/public/endpoint_alerts/store/alert_details.test.ts @@ -5,19 +5,20 @@ */ import { Store, createStore, applyMiddleware } from 'redux'; -import { History } from 'history'; +import { createBrowserHistory, History } from 'history'; + +import { coreMock } from '../../../../../../src/core/public/mocks'; +import { AlertListState, Immutable } from '../../../common/endpoint_alerts/types'; +import { depsStartMock, DepsStartMock } from '../../common/mock/endpoint'; + import { alertListReducer } from './reducer'; -import { AlertListState } from '../../types'; + import { alertMiddlewareFactory } from './middleware'; -import { AppAction } from '../action'; -import { coreMock } from 'src/core/public/mocks'; -import { DepsStartMock, depsStartMock } from '../../mocks'; -import { createBrowserHistory } from 'history'; + import { mockAlertResultList } from './mock_alert_result_list'; -import { Immutable } from '../../../../../common/types'; describe('alert details tests', () => { - let store: Store, Immutable>; + let store: Store; let coreStart: ReturnType; let depsStart: DepsStartMock; let history: History; @@ -56,7 +57,7 @@ describe('alert details tests', () => { type: 'userChangedUrl', payload: { ...history.location, - pathname: '/alerts', + pathname: '/endpoint-alerts', search: '?selected_alert=q9ncfh4q9ctrmc90umcq4', }, }); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/alert_list.test.ts b/x-pack/plugins/siem/public/endpoint_alerts/store/alert_list.test.ts similarity index 85% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/alert_list.test.ts rename to x-pack/plugins/siem/public/endpoint_alerts/store/alert_list.test.ts index 84281813312e0..9acf22d4cefe2 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/alert_list.test.ts +++ b/x-pack/plugins/siem/public/endpoint_alerts/store/alert_list.test.ts @@ -5,20 +5,17 @@ */ import { Store, createStore, applyMiddleware } from 'redux'; -import { History } from 'history'; +import { History, createBrowserHistory } from 'history'; import { alertListReducer } from './reducer'; -import { AlertListState } from '../../types'; +import { AlertListState, AlertResultList, Immutable } from '../../../common/endpoint_alerts/types'; import { alertMiddlewareFactory } from './middleware'; -import { AppAction } from '../action'; import { coreMock } from 'src/core/public/mocks'; -import { DepsStartMock, depsStartMock } from '../../mocks'; -import { AlertResultList, Immutable } from '../../../../../common/types'; +import { DepsStartMock, depsStartMock } from '../../common/mock/endpoint'; import { isOnAlertPage } from './selectors'; -import { createBrowserHistory } from 'history'; import { mockAlertResultList } from './mock_alert_result_list'; describe('alert list tests', () => { - let store: Store, Immutable>; + let store: Store; let coreStart: ReturnType; let depsStart: DepsStartMock; let history: History; @@ -59,7 +56,7 @@ describe('alert list tests', () => { type: 'userChangedUrl', payload: { ...history.location, - pathname: '/alerts', + pathname: '/endpoint-alerts', }, }); }); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/alert_list_pagination.test.ts b/x-pack/plugins/siem/public/endpoint_alerts/store/alert_list_pagination.test.ts similarity index 80% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/alert_list_pagination.test.ts rename to x-pack/plugins/siem/public/endpoint_alerts/store/alert_list_pagination.test.ts index 4cc86e9c0449c..3ba7d830ccf4a 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/alert_list_pagination.test.ts +++ b/x-pack/plugins/siem/public/endpoint_alerts/store/alert_list_pagination.test.ts @@ -4,21 +4,28 @@ * you may not use this file except in compliance with the Elastic License. */ +/* + * 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 { Store, createStore, applyMiddleware } from 'redux'; -import { History } from 'history'; -import { alertListReducer } from './reducer'; -import { AlertListState, AlertingIndexUIQueryParams } from '../../types'; +import { History, createBrowserHistory } from 'history'; + +import { coreMock } from '../../../../../../src/core/public/mocks'; + +import { AlertingIndexUIQueryParams } from '../../../common/endpoint_alerts/types'; +import { DepsStartMock, depsStartMock } from '../../common/mock/endpoint'; + import { alertMiddlewareFactory } from './middleware'; -import { AppAction } from '../action'; -import { coreMock } from 'src/core/public/mocks'; -import { DepsStartMock, depsStartMock } from '../../mocks'; -import { createBrowserHistory } from 'history'; + +import { alertListReducer } from './reducer'; import { uiQueryParams } from './selectors'; -import { urlFromQueryParams } from '../../view/alerts/url_from_query_params'; -import { Immutable } from '../../../../../common/types'; +import { urlFromQueryParams } from '../view/url_from_query_params'; describe('alert list pagination', () => { - let store: Store, Immutable>; + let store: Store; let coreStart: ReturnType; let depsStart: DepsStartMock; let history: History; diff --git a/x-pack/plugins/siem/public/endpoint_alerts/store/index.ts b/x-pack/plugins/siem/public/endpoint_alerts/store/index.ts new file mode 100644 index 0000000000000..dd97d60c532b0 --- /dev/null +++ b/x-pack/plugins/siem/public/endpoint_alerts/store/index.ts @@ -0,0 +1,20 @@ +/* + * 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 { AlertListState, Immutable } from '../../../common/endpoint_alerts/types'; +import { ImmutableReducer } from '../../common/store'; +import { AppAction } from '../../common/store/actions'; + +export { alertListReducer } from './reducer'; +export { AlertAction } from './action'; + +export interface EndpointAlertsPluginState { + alertList: Immutable; +} + +export interface EndpointAlertsPluginReducer { + alertList: ImmutableReducer; +} diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/middleware.ts b/x-pack/plugins/siem/public/endpoint_alerts/store/middleware.ts similarity index 79% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/middleware.ts rename to x-pack/plugins/siem/public/endpoint_alerts/store/middleware.ts index 6bc728db99819..f217cfcdfb5a7 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/middleware.ts +++ b/x-pack/plugins/siem/public/endpoint_alerts/store/middleware.ts @@ -4,14 +4,19 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IIndexPattern } from 'src/plugins/data/public'; -import { AlertResultList, AlertDetails } from '../../../../../common/types'; -import { ImmutableMiddlewareFactory, AlertListState } from '../../types'; +import { IIndexPattern } from '../../../../../../src/plugins/data/public'; +import { + AlertResultList, + AlertDetails, + AlertListState, +} from '../../../common/endpoint_alerts/types'; +import { AlertConstants } from '../../../common/endpoint_alerts/alert_constants'; +import { ImmutableMiddlewareFactory } from '../../common/store'; +import { cloneHttpFetchQuery } from '../../common/utils/clone_http_fetch_query'; import { isOnAlertPage, apiQueryParams, hasSelectedAlert, uiQueryParams } from './selectors'; -import { cloneHttpFetchQuery } from '../../../../common/clone_http_fetch_query'; -import { AlertConstants } from '../../../../../common/alert_constants'; +import { Immutable } from '../../../common/endpoint/types'; -export const alertMiddlewareFactory: ImmutableMiddlewareFactory = ( +export const alertMiddlewareFactory: ImmutableMiddlewareFactory> = ( coreStart, depsStart ) => { diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/mock_alert_result_list.ts b/x-pack/plugins/siem/public/endpoint_alerts/store/mock_alert_result_list.ts similarity index 89% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/mock_alert_result_list.ts rename to x-pack/plugins/siem/public/endpoint_alerts/store/mock_alert_result_list.ts index 6a13e0f92471b..88bba2b7a2474 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/mock_alert_result_list.ts +++ b/x-pack/plugins/siem/public/endpoint_alerts/store/mock_alert_result_list.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertResultList, AlertDetails } from '../../../../../common/types'; -import { EndpointDocGenerator } from '../../../../../common/generate_data'; +import { EndpointDocGenerator } from '../../../common/endpoint/generate_data'; +import { AlertResultList, AlertDetails } from '../../../common/endpoint_alerts/types'; export const mockAlertResultList: (options?: { total?: number; @@ -30,7 +30,7 @@ export const mockAlertResultList: (options?: { alerts.push({ ...generator.generateAlert(new Date().getTime() + index * 1000), ...{ - id: 'xDUYMHABAJk0XnHd8rrd' + index, + id: `xDUYMHABAJk0XnHd8rrd${index}`, prev: null, next: null, }, diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/reducer.ts b/x-pack/plugins/siem/public/endpoint_alerts/store/reducer.ts similarity index 82% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/reducer.ts rename to x-pack/plugins/siem/public/endpoint_alerts/store/reducer.ts index 52b91dcae7d70..3e79ad4d1c614 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/reducer.ts +++ b/x-pack/plugins/siem/public/endpoint_alerts/store/reducer.ts @@ -4,11 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertListState, ImmutableReducer } from '../../types'; -import { AppAction } from '../action'; -import { Immutable } from '../../../../../common/types'; +import { Immutable, AlertListState } from '../../../common/endpoint_alerts/types'; +import { ImmutableReducer } from '../../common/store'; +import { AppAction } from '../../common/store/actions'; -const initialState = (): Immutable => { +export const initialAlertListState = (): Immutable => { return { alerts: [], alertDetails: undefined, @@ -23,7 +23,7 @@ const initialState = (): Immutable => { }; export const alertListReducer: ImmutableReducer = ( - state = initialState(), + state = initialAlertListState(), action ) => { if (action.type === 'serverReturnedAlertsData') { diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/selectors.ts b/x-pack/plugins/siem/public/endpoint_alerts/store/selectors.ts similarity index 92% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/selectors.ts rename to x-pack/plugins/siem/public/endpoint_alerts/store/selectors.ts index cc362c3701956..0e9de70f7b415 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/selectors.ts +++ b/x-pack/plugins/siem/public/endpoint_alerts/store/selectors.ts @@ -4,15 +4,23 @@ * you may not use this file except in compliance with the Elastic License. */ +// eslint-disable-next-line import/no-nodejs-modules import querystring from 'querystring'; import { createSelector, createStructuredSelector as createStructuredSelectorWithBadType, } from 'reselect'; import { encode, decode } from 'rison-node'; -import { Query, TimeRange, Filter } from 'src/plugins/data/public'; -import { AlertListState, AlertingIndexUIQueryParams, CreateStructuredSelector } from '../../types'; -import { Immutable, AlertingIndexGetQueryInput } from '../../../../../common/types'; + +import { Query, TimeRange, Filter } from '../../../../../../src/plugins/data/public'; + +import { + Immutable, + AlertingIndexGetQueryInput, + AlertListState, + AlertingIndexUIQueryParams, +} from '../../../common/endpoint_alerts/types'; +import { CreateStructuredSelector } from '../../common/store'; const createStructuredSelector: CreateStructuredSelector = createStructuredSelectorWithBadType; @@ -36,7 +44,7 @@ export const alertListPagination = createStructuredSelector({ * Returns a boolean based on whether or not the user is on the alerts page */ export const isOnAlertPage = (state: Immutable): boolean => { - return state.location ? state.location.pathname === '/alerts' : false; + return state.location ? state.location.pathname === '/endpoint-alerts' : false; }; /** diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/alert_details.test.tsx b/x-pack/plugins/siem/public/endpoint_alerts/view/alert_details.test.tsx similarity index 87% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/alert_details.test.tsx rename to x-pack/plugins/siem/public/endpoint_alerts/view/alert_details.test.tsx index e3639bf1cacbc..cb44176d6b4c3 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/alert_details.test.tsx +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/alert_details.test.tsx @@ -5,21 +5,22 @@ */ import * as reactTestingLibrary from '@testing-library/react'; -import { appStoreFactory } from '../../store'; -import { fireEvent } from '@testing-library/react'; import { MemoryHistory } from 'history'; -import { AppAction } from '../../types'; -import { mockAlertDetailsResult } from '../../store/alerts/mock_alert_result_list'; +import { Store } from 'redux'; + +import { mockAlertDetailsResult } from '../store/mock_alert_result_list'; import { alertPageTestRender } from './test_helpers/render_alert_page'; +import { AppAction } from '../../common/store/actions'; +import { State } from '../../common/store/reducer'; describe('when the alert details flyout is open', () => { let render: () => reactTestingLibrary.RenderResult; let history: MemoryHistory; - let store: ReturnType; + let store: Store; beforeEach(async () => { // Creates the render elements for the tests to use - ({ render, history, store } = alertPageTestRender); + ({ render, history, store } = alertPageTestRender()); }); describe('when the alerts details flyout is open', () => { beforeEach(() => { @@ -50,7 +51,7 @@ describe('when the alert details flyout is open', () => { 'alertDetailTakeActionDropdownButton' ); if (takeActionButton) { - fireEvent.click(takeActionButton); + reactTestingLibrary.fireEvent.click(takeActionButton); } }); it('should display the correct fields in the dropdown', async () => { @@ -64,7 +65,7 @@ describe('when the alert details flyout is open', () => { renderResult = render(); const overviewTab = await renderResult.findByTestId('overviewMetadata'); if (overviewTab) { - fireEvent.click(overviewTab); + reactTestingLibrary.fireEvent.click(overviewTab); } }); it('should render all accordion panels', async () => { diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/index.ts b/x-pack/plugins/siem/public/endpoint_alerts/view/details/index.ts similarity index 100% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/index.ts rename to x-pack/plugins/siem/public/endpoint_alerts/view/details/index.ts diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/file_accordion.tsx b/x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/file_accordion.tsx similarity index 60% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/file_accordion.tsx rename to x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/file_accordion.tsx index 26f1985368465..1009bec0cec0e 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/file_accordion.tsx +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/file_accordion.tsx @@ -6,56 +6,62 @@ import React, { memo, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiAccordion, EuiDescriptionList } from '@elastic/eui'; -import { Immutable, AlertData } from '../../../../../../../common/types'; +import { Immutable, AlertData } from '../../../../../common/endpoint_alerts/types'; import { FormattedDate } from '../../formatted_date'; export const FileAccordion = memo(({ alertData }: { alertData: Immutable }) => { const columns = useMemo(() => { return [ { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.fileName', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.fileName', { defaultMessage: 'File Name', }), description: alertData.file.name, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.filePath', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.filePath', { defaultMessage: 'File Path', }), description: alertData.file.path, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.fileSize', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.fileSize', { defaultMessage: 'File Size', }), description: alertData.file.size, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.fileCreated', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.fileCreated', { defaultMessage: 'File Created', }), description: , }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.fileModified', { - defaultMessage: 'File Modified', - }), + title: i18n.translate( + 'xpack.siem.endpoint.application.endpoint.alertDetails.fileModified', + { + defaultMessage: 'File Modified', + } + ), description: , }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.fileAccessed', { - defaultMessage: 'File Accessed', - }), + title: i18n.translate( + 'xpack.siem.endpoint.application.endpoint.alertDetails.fileAccessed', + { + defaultMessage: 'File Accessed', + } + ), description: , }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.signer', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.signer', { defaultMessage: 'Signer', }), description: alertData.file.code_signature.subject_name, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.owner', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.owner', { defaultMessage: 'Owner', }), description: alertData.file.owner, @@ -67,7 +73,7 @@ export const FileAccordion = memo(({ alertData }: { alertData: Immutable ); }); + +FileAccordion.displayName = 'FileAccordion'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/general_accordion.tsx b/x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/general_accordion.tsx similarity index 64% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/general_accordion.tsx rename to x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/general_accordion.tsx index 79cb61693056c..fc0d38188fd27 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/general_accordion.tsx +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/general_accordion.tsx @@ -6,44 +6,47 @@ import React, { memo, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiAccordion, EuiDescriptionList } from '@elastic/eui'; -import { Immutable, AlertData } from '../../../../../../../common/types'; +import { Immutable, AlertData } from '../../../../../common/endpoint_alerts/types'; import { FormattedDate } from '../../formatted_date'; export const GeneralAccordion = memo(({ alertData }: { alertData: Immutable }) => { const columns = useMemo(() => { return [ { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.alertType', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.alertType', { defaultMessage: 'Alert Type', }), description: alertData.event.category, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.eventType', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.eventType', { defaultMessage: 'Event Type', }), description: alertData.event.kind, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.status', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.status', { defaultMessage: 'Status', }), description: 'TODO', }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.dateCreated', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.dateCreated', { defaultMessage: 'Date Created', }), description: , }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.malwareScore', { - defaultMessage: 'MalwareScore', - }), + title: i18n.translate( + 'xpack.siem.endpoint.application.endpoint.alertDetails.malwareScore', + { + defaultMessage: 'MalwareScore', + } + ), description: alertData.file.malware_classification.score, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.fileName', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.fileName', { defaultMessage: 'File Name', }), description: alertData.file.name, @@ -54,7 +57,7 @@ export const GeneralAccordion = memo(({ alertData }: { alertData: Immutable ); }); + +GeneralAccordion.displayName = 'GeneralAccordion'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/hash_accordion.tsx b/x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/hash_accordion.tsx similarity index 70% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/hash_accordion.tsx rename to x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/hash_accordion.tsx index 4a2f7378a36ed..ae62bd80b73bc 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/hash_accordion.tsx +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/hash_accordion.tsx @@ -6,25 +6,25 @@ import React, { memo, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiAccordion, EuiDescriptionList } from '@elastic/eui'; -import { Immutable, AlertData } from '../../../../../../../common/types'; +import { Immutable, AlertData } from '../../../../../common/endpoint_alerts/types'; export const HashAccordion = memo(({ alertData }: { alertData: Immutable }) => { const columns = useMemo(() => { return [ { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.md5', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.md5', { defaultMessage: 'MD5', }), description: alertData.file.hash.md5, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.sha1', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.sha1', { defaultMessage: 'SHA1', }), description: alertData.file.hash.sha1, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.sha256', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.sha256', { defaultMessage: 'SHA256', }), description: alertData.file.hash.sha256, @@ -36,7 +36,7 @@ export const HashAccordion = memo(({ alertData }: { alertData: Immutable ); }); + +HashAccordion.displayName = 'HashAccordion'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/host_accordion.tsx b/x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/host_accordion.tsx similarity index 50% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/host_accordion.tsx rename to x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/host_accordion.tsx index e332c96192fab..70723efd97b8c 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/host_accordion.tsx +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/host_accordion.tsx @@ -5,60 +5,75 @@ */ import React, { memo, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiAccordion, EuiDescriptionList } from '@elastic/eui'; -import { EuiHealth } from '@elastic/eui'; +import { EuiAccordion, EuiDescriptionList, EuiHealth } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { Immutable, AlertDetails } from '../../../../../../../common/types'; + +import { Immutable, AlertDetails } from '../../../../../common/endpoint_alerts/types'; export const HostAccordion = memo(({ alertData }: { alertData: Immutable }) => { const columns = useMemo(() => { return [ { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.hostNameCurrent', { - defaultMessage: 'Host Name (Current)', - }), + title: i18n.translate( + 'xpack.siem.endpoint.application.endpoint.alertDetails.hostNameCurrent', + { + defaultMessage: 'Host Name (Current)', + } + ), description: alertData.state.host_metadata.host.hostname, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.hostNameOriginal', { - defaultMessage: 'Host Name (At time of alert)', - }), + title: i18n.translate( + 'xpack.siem.endpoint.application.endpoint.alertDetails.hostNameOriginal', + { + defaultMessage: 'Host Name (At time of alert)', + } + ), description: alertData.host.hostname, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.hostIPCurrent', { - defaultMessage: 'Host IP (Current)', - }), + title: i18n.translate( + 'xpack.siem.endpoint.application.endpoint.alertDetails.hostIPCurrent', + { + defaultMessage: 'Host IP (Current)', + } + ), description: alertData.state.host_metadata.host.ip.join(', '), }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.hostIPOriginal', { - defaultMessage: 'Host IP (At time of alert)', - }), + title: i18n.translate( + 'xpack.siem.endpoint.application.endpoint.alertDetails.hostIPOriginal', + { + defaultMessage: 'Host IP (At time of alert)', + } + ), description: alertData.host.ip.join(', '), }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.currentStatus', { - defaultMessage: 'Current Status', - }), + title: i18n.translate( + 'xpack.siem.endpoint.application.endpoint.alertDetails.currentStatus', + { + defaultMessage: 'Current Status', + } + ), description: ( {' '} ), }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.osCurrent', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.osCurrent', { defaultMessage: 'OS (Current)', }), description: alertData.state.host_metadata.host.os.name, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.osOriginal', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.osOriginal', { defaultMessage: 'OS (At time of alert)', }), description: alertData.host.os.name, @@ -70,7 +85,7 @@ export const HostAccordion = memo(({ alertData }: { alertData: Immutable ); }); + +HostAccordion.displayName = 'HostAccordion'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/index.ts b/x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/index.ts similarity index 100% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/index.ts rename to x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/index.ts diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/source_process_accordion.tsx b/x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/source_process_accordion.tsx similarity index 58% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/source_process_accordion.tsx rename to x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/source_process_accordion.tsx index 538562bfbbc06..607327a49de1c 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/source_process_accordion.tsx +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/source_process_accordion.tsx @@ -6,73 +6,79 @@ import React, { memo, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiAccordion, EuiDescriptionList } from '@elastic/eui'; -import { Immutable, AlertData } from '../../../../../../../common/types'; +import { Immutable, AlertData } from '../../../../../common/endpoint_alerts/types'; export const SourceProcessAccordion = memo(({ alertData }: { alertData: Immutable }) => { const columns = useMemo(() => { return [ { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.processID', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.processID', { defaultMessage: 'Process ID', }), description: alertData.process.pid, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.processName', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.processName', { defaultMessage: 'Process Name', }), description: alertData.process.name, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.processPath', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.processPath', { defaultMessage: 'Process Path', }), description: alertData.process.executable, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.md5', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.md5', { defaultMessage: 'MD5', }), description: alertData.process.hash.md5, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.sha1', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.sha1', { defaultMessage: 'SHA1', }), description: alertData.process.hash.sha1, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.sha256', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.sha256', { defaultMessage: 'SHA256', }), description: alertData.process.hash.sha256, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.malwareScore', { - defaultMessage: 'MalwareScore', - }), + title: i18n.translate( + 'xpack.siem.endpoint.application.endpoint.alertDetails.malwareScore', + { + defaultMessage: 'MalwareScore', + } + ), description: alertData.process.malware_classification?.score || '-', }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.parentProcessID', { - defaultMessage: 'Parent Process ID', - }), + title: i18n.translate( + 'xpack.siem.endpoint.application.endpoint.alertDetails.parentProcessID', + { + defaultMessage: 'Parent Process ID', + } + ), description: alertData.process.parent?.pid || '-', }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.signer', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.signer', { defaultMessage: 'Signer', }), description: alertData.process.code_signature.subject_name, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.username', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.username', { defaultMessage: 'Username', }), description: alertData.process.token.user, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.domain', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.domain', { defaultMessage: 'Domain', }), description: alertData.process.token.domain, @@ -84,7 +90,7 @@ export const SourceProcessAccordion = memo(({ alertData }: { alertData: Immutabl ); }); + +SourceProcessAccordion.displayName = 'SourceProcessAccordion'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/source_process_token_accordion.tsx b/x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/source_process_token_accordion.tsx similarity index 68% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/source_process_token_accordion.tsx rename to x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/source_process_token_accordion.tsx index 00755673d3f82..9be494d92a88d 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/metadata/source_process_token_accordion.tsx +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/details/metadata/source_process_token_accordion.tsx @@ -6,22 +6,25 @@ import React, { memo, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiAccordion, EuiDescriptionList } from '@elastic/eui'; -import { Immutable, AlertData } from '../../../../../../../common/types'; +import { Immutable, AlertData } from '../../../../../common/endpoint_alerts/types'; export const SourceProcessTokenAccordion = memo( ({ alertData }: { alertData: Immutable }) => { const columns = useMemo(() => { return [ { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.sid', { + title: i18n.translate('xpack.siem.endpoint.application.endpoint.alertDetails.sid', { defaultMessage: 'SID', }), description: alertData.process.token.sid, }, { - title: i18n.translate('xpack.endpoint.application.endpoint.alertDetails.integrityLevel', { - defaultMessage: 'Integrity Level', - }), + title: i18n.translate( + 'xpack.siem.endpoint.application.endpoint.alertDetails.integrityLevel', + { + defaultMessage: 'Integrity Level', + } + ), description: alertData.process.token.integrity_level, }, ]; @@ -31,7 +34,7 @@ export const SourceProcessTokenAccordion = memo( { + const alertDetailsData = useAlertListSelector(selectors.selectedAlertDetailsData); + if (alertDetailsData === undefined) { + return null; + } + + const tabs: EuiTabbedContentTab[] = useMemo(() => { + return [ + { + id: 'overviewMetadata', + 'data-test-subj': 'overviewMetadata', + name: i18n.translate( + 'xpack.siem.endpoint.application.endpoint.alertDetails.overview.tabs.overview', + { + defaultMessage: 'Overview', + } + ), + content: ( + <> + + + + ), + }, + { + id: 'overviewResolver', + 'data-test-subj': 'overviewResolverTab', + name: i18n.translate( + 'xpack.siem.endpoint.application.endpoint.alertDetails.overview.tabs.resolver', + { + defaultMessage: 'Resolver', + } + ), + content: ( + <> + + + + ), + }, + ]; + }, [alertDetailsData]); + + return ( + <> +
+ +

+ +

+
+ + +

+ , + }} + /> +

+
+ + + {'Endpoint Status: '} + + + + + + + + + + +
+ + + ); +}); + +AlertDetailsOverviewComponent.displayName = 'AlertDetailsOverview'; + +export const AlertDetailsOverview = styled(AlertDetailsOverviewComponent)` + height: 100%; + width: 100%; +`; + +AlertDetailsOverview.displayName = 'AlertDetailsOverview'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/overview/metadata_panel.tsx b/x-pack/plugins/siem/public/endpoint_alerts/view/details/overview/metadata_panel.tsx similarity index 92% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/overview/metadata_panel.tsx rename to x-pack/plugins/siem/public/endpoint_alerts/view/details/overview/metadata_panel.tsx index 556d7bea2e310..75ddc58c8cad2 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/overview/metadata_panel.tsx +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/details/overview/metadata_panel.tsx @@ -7,7 +7,7 @@ import React, { memo } from 'react'; import { EuiSpacer } from '@elastic/eui'; import { useAlertListSelector } from '../../hooks/use_alerts_selector'; -import * as selectors from '../../../../store/alerts/selectors'; +import * as selectors from '../../../store/selectors'; import { GeneralAccordion, HostAccordion, @@ -38,3 +38,5 @@ export const MetadataPanel = memo(() => { ); }); + +MetadataPanel.displayName = 'MetadataPanel'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/overview/take_action_dropdown.tsx b/x-pack/plugins/siem/public/endpoint_alerts/view/details/overview/take_action_dropdown.tsx similarity index 83% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/overview/take_action_dropdown.tsx rename to x-pack/plugins/siem/public/endpoint_alerts/view/details/overview/take_action_dropdown.tsx index 8d8468b4df4a3..847249125a5fa 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/details/overview/take_action_dropdown.tsx +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/details/overview/take_action_dropdown.tsx @@ -16,12 +16,14 @@ const TakeActionButton = memo(({ onClick }: { onClick: () => void }) => ( onClick={onClick} > )); +TakeActionButton.displayName = 'TakeActionButton'; + export const TakeActionDropdown = memo(() => { const [isDropdownOpen, setIsDropdownOpen] = useState(false); @@ -48,7 +50,7 @@ export const TakeActionDropdown = memo(() => { iconType="folderCheck" > @@ -61,7 +63,7 @@ export const TakeActionDropdown = memo(() => { iconType="listAdd" > @@ -69,3 +71,5 @@ export const TakeActionDropdown = memo(() => { ); }); + +TakeActionDropdown.displayName = 'TakeActionDropdown'; diff --git a/x-pack/plugins/siem/public/endpoint_alerts/view/formatted_date.tsx b/x-pack/plugins/siem/public/endpoint_alerts/view/formatted_date.tsx new file mode 100644 index 0000000000000..4b9bce4d42eb5 --- /dev/null +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/formatted_date.tsx @@ -0,0 +1,24 @@ +/* + * 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, { memo } from 'react'; +import { FormattedDate as ReactIntlFormattedDate } from '@kbn/i18n/react'; + +export const FormattedDate = memo(({ timestamp }: { timestamp: number }) => { + const date = new Date(timestamp); + return ( + + ); +}); + +FormattedDate.displayName = 'FormattedDate'; diff --git a/x-pack/plugins/siem/public/endpoint_alerts/view/hooks/use_alerts_selector.ts b/x-pack/plugins/siem/public/endpoint_alerts/view/hooks/use_alerts_selector.ts new file mode 100644 index 0000000000000..726f6a453cb5d --- /dev/null +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/hooks/use_alerts_selector.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { useSelector } from 'react-redux'; +import { Immutable, AlertListState } from '../../../../common/endpoint_alerts/types'; +import { State } from '../../../common/store/reducer'; + +export function useAlertListSelector( + selector: ( + state: Immutable + ) => TSelected extends Immutable ? TSelected : never +) { + return useSelector((state: Immutable) => selector(state.alertList)); +} diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/index.test.tsx b/x-pack/plugins/siem/public/endpoint_alerts/view/index.test.tsx similarity index 92% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/index.test.tsx rename to x-pack/plugins/siem/public/endpoint_alerts/view/index.test.tsx index 77e31d015fc03..6d7350f20d21f 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/index.test.tsx +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/index.test.tsx @@ -6,23 +6,24 @@ import * as reactTestingLibrary from '@testing-library/react'; import { IIndexPattern } from 'src/plugins/data/public'; -import { appStoreFactory } from '../../store'; -import { fireEvent, act } from '@testing-library/react'; import { MemoryHistory } from 'history'; -import { AppAction } from '../../types'; -import { mockAlertResultList } from '../../store/alerts/mock_alert_result_list'; -import { DepsStartMock } from '../../mocks'; +import { Store } from 'redux'; + +import { mockAlertResultList } from '../store/mock_alert_result_list'; import { alertPageTestRender } from './test_helpers/render_alert_page'; +import { DepsStartMock } from '../../common/mock/endpoint'; +import { State } from '../../common/store/reducer'; +import { AppAction } from '../../common/store/actions'; describe('when on the alerting page', () => { let render: () => reactTestingLibrary.RenderResult; let history: MemoryHistory; - let store: ReturnType; + let store: Store; let depsStart: DepsStartMock; beforeEach(async () => { // Creates the render elements for the tests to use - ({ render, history, store, depsStart } = alertPageTestRender); + ({ render, history, store, depsStart } = alertPageTestRender()); }); it('should show a data grid', async () => { await render().findByTestId('alertListGrid'); @@ -63,7 +64,7 @@ describe('when on the alerting page', () => { /** * This is the cell with the alert type, it has a link. */ - fireEvent.click(alertLinks[0]); + reactTestingLibrary.fireEvent.click(alertLinks[0]); }); it('should show the flyout', async () => { await renderResult.findByTestId('alertDetailFlyout'); @@ -92,7 +93,7 @@ describe('when on the alerting page', () => { */ const closeButton = await renderResult.findByTestId('euiFlyoutCloseButton'); if (closeButton) { - fireEvent.click(closeButton); + reactTestingLibrary.fireEvent.click(closeButton); } }); it('should no longer show the flyout', () => { @@ -125,14 +126,14 @@ describe('when on the alerting page', () => { const renderResult = render(); const paginationButton = await renderResult.findByTestId('tablePaginationPopoverButton'); if (paginationButton) { - act(() => { - fireEvent.click(paginationButton); + reactTestingLibrary.act(() => { + reactTestingLibrary.fireEvent.click(paginationButton); }); } const show10RowsButton = await renderResult.findByTestId('tablePagination-10-rows'); if (show10RowsButton) { - act(() => { - fireEvent.click(show10RowsButton); + reactTestingLibrary.act(() => { + reactTestingLibrary.fireEvent.click(show10RowsButton); }); } }); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/index.tsx b/x-pack/plugins/siem/public/endpoint_alerts/view/index.tsx similarity index 81% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/index.tsx rename to x-pack/plugins/siem/public/endpoint_alerts/view/index.tsx index 6a6936c59a00e..e991080c9dc35 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/index.tsx +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/index.tsx @@ -4,8 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { memo, useState, useMemo, useCallback } from 'react'; -import React from 'react'; +import React, { memo, useState, useMemo, useCallback } from 'react'; import { EuiDataGrid, EuiDataGridColumn, @@ -26,9 +25,9 @@ import { import { i18n } from '@kbn/i18n'; import { useHistory } from 'react-router-dom'; import { FormattedMessage } from '@kbn/i18n/react'; +import { AlertData } from '../../../common/endpoint_alerts/types'; import { urlFromQueryParams } from './url_from_query_params'; -import { AlertData } from '../../../../../common/types'; -import * as selectors from '../../store/alerts/selectors'; +import * as selectors from '../store/selectors'; import { useAlertListSelector } from './hooks/use_alerts_selector'; import { AlertDetailsOverview } from './details'; import { FormattedDate } from './formatted_date'; @@ -41,49 +40,49 @@ export const AlertIndex = memo(() => { return [ { id: 'alert_type', - display: i18n.translate('xpack.endpoint.application.endpoint.alerts.alertType', { + display: i18n.translate('xpack.siem.endpoint.application.endpoint.alerts.alertType', { defaultMessage: 'Alert Type', }), }, { id: 'event_type', - display: i18n.translate('xpack.endpoint.application.endpoint.alerts.eventType', { + display: i18n.translate('xpack.siem.endpoint.application.endpoint.alerts.eventType', { defaultMessage: 'Event Type', }), }, { id: 'os', - display: i18n.translate('xpack.endpoint.application.endpoint.alerts.os', { + display: i18n.translate('xpack.siem.endpoint.application.endpoint.alerts.os', { defaultMessage: 'OS', }), }, { id: 'ip_address', - display: i18n.translate('xpack.endpoint.application.endpoint.alerts.ipAddress', { + display: i18n.translate('xpack.siem.endpoint.application.endpoint.alerts.ipAddress', { defaultMessage: 'IP Address', }), }, { id: 'host_name', - display: i18n.translate('xpack.endpoint.application.endpoint.alerts.hostName', { + display: i18n.translate('xpack.siem.endpoint.application.endpoint.alerts.hostName', { defaultMessage: 'Host Name', }), }, { id: 'timestamp', - display: i18n.translate('xpack.endpoint.application.endpoint.alerts.timestamp', { + display: i18n.translate('xpack.siem.endpoint.application.endpoint.alerts.timestamp', { defaultMessage: 'Timestamp', }), }, { id: 'archived', - display: i18n.translate('xpack.endpoint.application.endpoint.alerts.archived', { + display: i18n.translate('xpack.siem.endpoint.application.endpoint.alerts.archived', { defaultMessage: 'Archived', }), }, { id: 'malware_score', - display: i18n.translate('xpack.endpoint.application.endpoint.alerts.malwareScore', { + display: i18n.translate('xpack.siem.endpoint.application.endpoint.alerts.malwareScore', { defaultMessage: 'Malware Score', }), }, @@ -133,8 +132,8 @@ export const AlertIndex = memo(() => { ); }, [alertListData]); - const renderCellValue = useMemo(() => { - return ({ rowIndex, columnId }: { rowIndex: number; columnId: string }) => { + const renderCellValue = useCallback( + ({ rowIndex, columnId }: { rowIndex: number; columnId: string }) => { if (rowIndex > total) { return null; } @@ -149,7 +148,7 @@ export const AlertIndex = memo(() => { } > {i18n.translate( - 'xpack.endpoint.application.endpoint.alerts.alertType.maliciousFileDescription', + 'xpack.siem.endpoint.application.endpoint.alerts.alertType.maliciousFileDescription', { defaultMessage: 'Malicious File', } @@ -172,7 +171,7 @@ export const AlertIndex = memo(() => { return ( {i18n.translate( - 'xpack.endpoint.application.endpoint.alerts.alertDate.timestampInvalidLabel', + 'xpack.siem.endpoint.application.endpoint.alerts.alertDate.timestampInvalidLabel', { defaultMessage: 'invalid', } @@ -186,8 +185,9 @@ export const AlertIndex = memo(() => { return row.file.malware_classification.score; } return null; - }; - }, [total, alertListData, pageSize, history, queryParams, timestampForRows]); + }, + [total, alertListData, pageSize, history, queryParams, timestampForRows] + ); const pagination = useMemo(() => { return { @@ -216,7 +216,7 @@ export const AlertIndex = memo(() => {

- {i18n.translate('xpack.endpoint.application.endpoint.alerts.detailsTitle', { + {i18n.translate('xpack.siem.endpoint.application.endpoint.alerts.detailsTitle', { defaultMessage: 'Alert Details', })}

@@ -235,7 +235,7 @@ export const AlertIndex = memo(() => {

@@ -260,3 +260,5 @@ export const AlertIndex = memo(() => { ); }); + +AlertIndex.displayName = 'AlertIndex'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/index_search_bar.tsx b/x-pack/plugins/siem/public/endpoint_alerts/view/index_search_bar.tsx similarity index 87% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/index_search_bar.tsx rename to x-pack/plugins/siem/public/endpoint_alerts/view/index_search_bar.tsx index 1ede06c086517..8fe6eaa665765 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/index_search_bar.tsx +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/index_search_bar.tsx @@ -4,17 +4,17 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { useMemo } from 'react'; -import { memo, useEffect, useCallback } from 'react'; +import React, { useMemo, memo, useEffect, useCallback } from 'react'; import { useHistory } from 'react-router-dom'; -import { encode, RisonValue } from 'rison-node'; import { Query, TimeRange } from 'src/plugins/data/public'; -import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; +import { encode, RisonValue } from 'rison-node'; + +import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; import { urlFromQueryParams } from './url_from_query_params'; import { useAlertListSelector } from './hooks/use_alerts_selector'; -import * as selectors from '../../store/alerts/selectors'; -import { EndpointPluginServices } from '../../../../plugin'; -import { clone } from '../../models/index_pattern'; +import * as selectors from '../store/selectors'; +import { StartServices } from '../../types'; +import { clone } from '../models/index_pattern'; export const AlertIndexSearchBar = memo(() => { const history = useHistory(); @@ -30,7 +30,7 @@ export const AlertIndexSearchBar = memo(() => { const searchBarDateRange = useAlertListSelector(selectors.searchBarDateRange); const searchBarFilters = useAlertListSelector(selectors.searchBarFilters); - const kibanaContext = useKibana(); + const kibanaContext = useKibana(); const { ui: { SearchBar }, query: { filterManager }, diff --git a/x-pack/plugins/siem/public/endpoint_alerts/view/resolver.tsx b/x-pack/plugins/siem/public/endpoint_alerts/view/resolver.tsx new file mode 100644 index 0000000000000..92213a8bd3925 --- /dev/null +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/resolver.tsx @@ -0,0 +1,39 @@ +/* + * 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 from 'react'; +import styled from 'styled-components'; +import { Provider } from 'react-redux'; +import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; +import { ResolverEvent } from '../../../common/endpoint/types'; +import { StartServices } from '../../types'; +import { storeFactory } from '../../resolver/store'; +import { Resolver } from '../../resolver/view'; + +const AlertDetailResolverComponents = React.memo( + ({ className, selectedEvent }: { className?: string; selectedEvent?: ResolverEvent }) => { + const context = useKibana(); + const { store } = storeFactory(context); + + return ( +
+ + + +
+ ); + } +); + +AlertDetailResolverComponents.displayName = 'AlertDetailResolver'; + +export const AlertDetailResolver = styled(AlertDetailResolverComponents)` + height: 100%; + width: 100%; + display: flex; + flex-grow: 1; + min-height: calc(100vh - 505px); +`; diff --git a/x-pack/plugins/siem/public/endpoint_alerts/view/test_helpers/render_alert_page.tsx b/x-pack/plugins/siem/public/endpoint_alerts/view/test_helpers/render_alert_page.tsx new file mode 100644 index 0000000000000..f52d854d986ff --- /dev/null +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/test_helpers/render_alert_page.tsx @@ -0,0 +1,63 @@ +/* + * 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 from 'react'; +import * as reactTestingLibrary from '@testing-library/react'; +import { Provider } from 'react-redux'; +import { I18nProvider } from '@kbn/i18n/react'; +import { createMemoryHistory } from 'history'; +import { Router } from 'react-router-dom'; + +import { KibanaContextProvider } from '../../../../../../../src/plugins/kibana_react/public'; +import { AlertIndex } from '../index'; +import { RouteCapture } from '../../../common/components/endpoint/route_capture'; +import { depsStartMock } from '../../../common/mock/endpoint'; +import { createStore } from '../../../common/store'; +import { SUB_PLUGINS_REDUCER, mockGlobalState, apolloClientObservable } from '../../../common/mock'; + +export const alertPageTestRender = () => { + /** + * Create a 'history' instance that is only in-memory and causes no side effects to the testing environment. + */ + const history = createMemoryHistory(); + /** + * Create a store, with the middleware disabled. We don't want side effects being created by our code in this test. + */ + const store = createStore(mockGlobalState, SUB_PLUGINS_REDUCER, apolloClientObservable); + + const depsStart = depsStartMock(); + depsStart.data.ui.SearchBar.mockImplementation(() =>
); + + return { + store, + history, + depsStart, + + /** + * Render the test component, use this after setting up anything in `beforeEach`. + */ + render: () => { + /** + * Provide the store via `Provider`, and i18n APIs via `I18nProvider`. + * Use react-router via `Router`, passing our in-memory `history` instance. + * Use `RouteCapture` to emit url-change actions when the URL is changed. + * Finally, render the `AlertIndex` component which we are testing. + */ + return reactTestingLibrary.render( + + + + + + + + + + + + ); + }, + }; +}; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/url_from_query_params.ts b/x-pack/plugins/siem/public/endpoint_alerts/view/url_from_query_params.ts similarity index 74% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/url_from_query_params.ts rename to x-pack/plugins/siem/public/endpoint_alerts/view/url_from_query_params.ts index e037d000e6e8f..a8a37547a43e2 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/alerts/url_from_query_params.ts +++ b/x-pack/plugins/siem/public/endpoint_alerts/view/url_from_query_params.ts @@ -4,8 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ +// eslint-disable-next-line import/no-nodejs-modules import querystring from 'querystring'; -import { AlertingIndexUIQueryParams, EndpointAppLocation } from '../../types'; + +import { AlertingIndexUIQueryParams } from '../../../common/endpoint_alerts/types'; +import { AppLocation } from '../../../common/endpoint/types'; /** * Return a relative URL for `AlertingIndexUIQueryParams`. @@ -21,9 +24,7 @@ import { AlertingIndexUIQueryParams, EndpointAppLocation } from '../../types'; * // now use relativeURL in the 'href' of a link, the 'to' of a react-router-dom 'Link' or history.push, history.replace * ``` */ -export function urlFromQueryParams( - queryParams: AlertingIndexUIQueryParams -): Partial { +export function urlFromQueryParams(queryParams: AlertingIndexUIQueryParams): Partial { const search = querystring.stringify(queryParams); return { search, diff --git a/x-pack/plugins/siem/public/endpoint_hosts/index.ts b/x-pack/plugins/siem/public/endpoint_hosts/index.ts new file mode 100644 index 0000000000000..49d5fff98c92a --- /dev/null +++ b/x-pack/plugins/siem/public/endpoint_hosts/index.ts @@ -0,0 +1,38 @@ +/* + * 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 { SecuritySubPluginWithStore } from '../app/types'; +import { getEndpointHostsRoutes } from './routes'; +import { initialHostListState, hostListReducer } from './store/reducer'; +import { Immutable } from '../../common/endpoint/types'; +import { HostState } from './types'; +import { hostMiddlewareFactory } from './store/middleware'; +import { CoreStart } from '../../../../../src/core/public'; +import { StartPlugins } from '../types'; +import { substateMiddlewareFactory } from '../common/store'; + +export class EndpointHosts { + public setup() {} + + public start( + core: CoreStart, + plugins: StartPlugins + ): SecuritySubPluginWithStore<'hostList', Immutable> { + const { data, ingestManager } = plugins; + const middleware = substateMiddlewareFactory( + globalState => globalState.hostList, + hostMiddlewareFactory(core, { data, ingestManager }) + ); + return { + routes: getEndpointHostsRoutes(), + store: { + initialState: { hostList: initialHostListState() }, + reducer: { hostList: hostListReducer }, + middleware, + }, + }; + } +} diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/index.ts b/x-pack/plugins/siem/public/endpoint_hosts/routes.tsx similarity index 51% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/index.ts rename to x-pack/plugins/siem/public/endpoint_hosts/routes.tsx index 5545218d9abd6..b7e549dc4e5e8 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/index.ts +++ b/x-pack/plugins/siem/public/endpoint_hosts/routes.tsx @@ -4,5 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -export { alertListReducer } from './reducer'; -export { AlertAction } from './action'; +import React from 'react'; +import { Route } from 'react-router-dom'; + +import { HostList } from './view'; + +export const getEndpointHostsRoutes = () => [ + + + , +]; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/action.ts b/x-pack/plugins/siem/public/endpoint_hosts/store/action.ts similarity index 93% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/action.ts rename to x-pack/plugins/siem/public/endpoint_hosts/store/action.ts index ac10adcda0306..9b38d7ce5a23a 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/action.ts +++ b/x-pack/plugins/siem/public/endpoint_hosts/store/action.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ServerApiError } from '../../types'; -import { HostResultList, HostInfo, GetHostPolicyResponse } from '../../../../../common/types'; +import { HostResultList, HostInfo, GetHostPolicyResponse } from '../../../common/endpoint/types'; +import { ServerApiError } from '../../common/types'; interface ServerReturnedHostList { type: 'serverReturnedHostList'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/host_pagination.test.ts b/x-pack/plugins/siem/public/endpoint_hosts/store/host_pagination.test.ts similarity index 91% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/host_pagination.test.ts rename to x-pack/plugins/siem/public/endpoint_hosts/store/host_pagination.test.ts index d2e1985d055c6..d67f5af866540 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/host_pagination.test.ts +++ b/x-pack/plugins/siem/public/endpoint_hosts/store/host_pagination.test.ts @@ -5,25 +5,30 @@ */ import { CoreStart, HttpSetup } from 'kibana/public'; -import { DepsStartMock, depsStartMock } from '../../mocks'; -import { AppAction, HostState, HostIndexUIQueryParams } from '../../types'; -import { Immutable, HostResultList } from '../../../../../common/types'; import { History, createBrowserHistory } from 'history'; -import { hostMiddlewareFactory } from './middleware'; import { applyMiddleware, Store, createStore } from 'redux'; + +import { coreMock } from '../../../../../../src/core/public/mocks'; + +import { HostResultList } from '../../../common/endpoint/types'; +import { DepsStartMock, depsStartMock } from '../../common/mock/endpoint'; + +import { hostMiddlewareFactory } from './middleware'; + import { hostListReducer } from './reducer'; -import { coreMock } from 'src/core/public/mocks'; -import { urlFromQueryParams } from '../../view/hosts/url_from_query_params'; + import { uiQueryParams } from './selectors'; import { mockHostResultList } from './mock_host_result_list'; -import { MiddlewareActionSpyHelper, createSpyMiddleware } from '../test_utils'; +import { HostState, HostIndexUIQueryParams } from '../types'; +import { MiddlewareActionSpyHelper, createSpyMiddleware } from '../../common/store/test_utils'; +import { urlFromQueryParams } from '../view/url_from_query_params'; describe('host list pagination: ', () => { let fakeCoreStart: jest.Mocked; let depsStart: DepsStartMock; let fakeHttpServices: jest.Mocked; let history: History; - let store: Store, Immutable>; + let store: Store; let queryParams: () => HostIndexUIQueryParams; let waitForAction: MiddlewareActionSpyHelper['waitForAction']; let actionSpyMiddleware; @@ -62,7 +67,7 @@ describe('host list pagination: ', () => { type: 'userChangedUrl', payload: { ...history.location, - pathname: '/hosts', + pathname: '/endpoint-hosts', }, }); await waitForAction('serverReturnedHostList'); @@ -123,7 +128,7 @@ describe('host list pagination: ', () => { type: 'userChangedUrl', payload: { ...history.location, - pathname: '/hosts', + pathname: '/endpoint-hosts', search: '?foo=bar', }, }); @@ -135,7 +140,7 @@ describe('host list pagination: ', () => { type: 'userChangedUrl', payload: { ...history.location, - pathname: '/hosts', + pathname: '/endpoint-hosts', search: '?page_index=2&page_index=3&page_size=20&page_size=50', }, }); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/index.test.ts b/x-pack/plugins/siem/public/endpoint_hosts/store/index.test.ts similarity index 98% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/index.test.ts rename to x-pack/plugins/siem/public/endpoint_hosts/store/index.test.ts index f60a69a471684..8518c37fe3f5d 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/index.test.ts +++ b/x-pack/plugins/siem/public/endpoint_hosts/store/index.test.ts @@ -6,7 +6,7 @@ import { createStore, Dispatch, Store } from 'redux'; import { HostAction, hostListReducer } from './index'; -import { HostState } from '../../types'; +import { HostState } from '../types'; import { listData } from './selectors'; import { mockHostResultList } from './mock_host_result_list'; diff --git a/x-pack/plugins/siem/public/endpoint_hosts/store/index.ts b/x-pack/plugins/siem/public/endpoint_hosts/store/index.ts new file mode 100644 index 0000000000000..eafea5b9c7404 --- /dev/null +++ b/x-pack/plugins/siem/public/endpoint_hosts/store/index.ts @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { HostState } from '../types'; +import { ImmutableReducer } from '../../common/store'; +import { AppAction } from '../../common/store/actions'; +import { Immutable } from '../../../common/endpoint/types'; + +export { hostListReducer } from './reducer'; +export { HostAction } from './action'; +export { hostMiddlewareFactory } from './middleware'; + +export interface EndpointHostsPluginState { + hostList: Immutable; +} + +export interface EndpointHostsPluginReducer { + hostList: ImmutableReducer; +} diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/middleware.test.ts b/x-pack/plugins/siem/public/endpoint_hosts/store/middleware.test.ts similarity index 86% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/middleware.test.ts rename to x-pack/plugins/siem/public/endpoint_hosts/store/middleware.test.ts index 2064c76f7dfb5..6c9e3dd41907f 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/middleware.test.ts +++ b/x-pack/plugins/siem/public/endpoint_hosts/store/middleware.test.ts @@ -5,16 +5,18 @@ */ import { CoreStart, HttpSetup } from 'kibana/public'; import { applyMiddleware, createStore, Store } from 'redux'; -import { coreMock } from '../../../../../../../../src/core/public/mocks'; +import { coreMock } from '../../../../../../src/core/public/mocks'; import { History, createBrowserHistory } from 'history'; import { hostListReducer, hostMiddlewareFactory } from './index'; -import { HostResultList, Immutable } from '../../../../../common/types'; -import { HostState } from '../../types'; -import { AppAction } from '../action'; -import { listData } from './selectors'; -import { DepsStartMock, depsStartMock } from '../../mocks'; + +import { DepsStartMock, depsStartMock } from '../../common/mock/endpoint'; + +import { createSpyMiddleware, MiddlewareActionSpyHelper } from '../../common/store/test_utils'; +import { Immutable, HostResultList } from '../../../common/endpoint/types'; +import { AppAction } from '../../common/store/actions'; import { mockHostResultList } from './mock_host_result_list'; -import { createSpyMiddleware, MiddlewareActionSpyHelper } from '../test_utils'; +import { listData } from './selectors'; +import { HostState } from '../types'; describe('host list middleware', () => { let fakeCoreStart: jest.Mocked; @@ -53,7 +55,7 @@ describe('host list middleware', () => { type: 'userChangedUrl', payload: { ...history.location, - pathname: '/hosts', + pathname: '/endpoint-hosts', }, }); await waitForAction('serverReturnedHostList'); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/middleware.ts b/x-pack/plugins/siem/public/endpoint_hosts/store/middleware.ts similarity index 91% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/middleware.ts rename to x-pack/plugins/siem/public/endpoint_hosts/store/middleware.ts index 9a28423d6adc4..ce518db0ffc93 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/middleware.ts +++ b/x-pack/plugins/siem/public/endpoint_hosts/store/middleware.ts @@ -4,12 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HostResultList } from '../../../../../common/types'; +import { HostResultList, Immutable } from '../../../common/endpoint/types'; +import { ImmutableMiddlewareFactory } from '../../common/store'; import { isOnHostPage, hasSelectedHost, uiQueryParams, listData } from './selectors'; -import { HostState } from '../../types'; -import { ImmutableMiddlewareFactory } from '../../types'; +import { HostState } from '../types'; -export const hostMiddlewareFactory: ImmutableMiddlewareFactory = coreStart => { +export const hostMiddlewareFactory: ImmutableMiddlewareFactory> = coreStart => { return ({ getState, dispatch }) => next => async action => { next(action); const state = getState(); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/mock_host_result_list.ts b/x-pack/plugins/siem/public/endpoint_hosts/store/mock_host_result_list.ts similarity index 90% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/mock_host_result_list.ts rename to x-pack/plugins/siem/public/endpoint_hosts/store/mock_host_result_list.ts index 20aa973ffc93d..a2c410b5dbd65 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/mock_host_result_list.ts +++ b/x-pack/plugins/siem/public/endpoint_hosts/store/mock_host_result_list.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HostInfo, HostResultList, HostStatus } from '../../../../../common/types'; -import { EndpointDocGenerator } from '../../../../../common/generate_data'; +import { HostInfo, HostResultList, HostStatus } from '../../../common/endpoint/types'; +import { EndpointDocGenerator } from '../../../common/endpoint/generate_data'; export const mockHostResultList: (options?: { total?: number; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/reducer.ts b/x-pack/plugins/siem/public/endpoint_hosts/store/reducer.ts similarity index 92% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/reducer.ts rename to x-pack/plugins/siem/public/endpoint_hosts/store/reducer.ts index 18bc6b0bea3da..98f4a457a4598 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/reducer.ts +++ b/x-pack/plugins/siem/public/endpoint_hosts/store/reducer.ts @@ -4,12 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Immutable } from '../../../../../common/types'; -import { HostState, ImmutableReducer } from '../../types'; -import { AppAction } from '../action'; import { isOnHostPage, hasSelectedHost } from './selectors'; +import { HostState } from '../types'; +import { AppAction } from '../../common/store/actions'; +import { ImmutableReducer } from '../../common/store'; +import { Immutable } from '../../../common/endpoint/types'; -const initialState = (): HostState => { +export const initialHostListState = (): HostState => { return { hosts: [], pageSize: 10, @@ -28,7 +29,7 @@ const initialState = (): HostState => { }; export const hostListReducer: ImmutableReducer = ( - state = initialState(), + state = initialHostListState(), action ) => { if (action.type === 'serverReturnedHostList') { diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/selectors.ts b/x-pack/plugins/siem/public/endpoint_hosts/store/selectors.ts similarity index 95% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/selectors.ts rename to x-pack/plugins/siem/public/endpoint_hosts/store/selectors.ts index 457b449b060c4..a915480b1aa2a 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/selectors.ts +++ b/x-pack/plugins/siem/public/endpoint_hosts/store/selectors.ts @@ -3,6 +3,8 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + +// eslint-disable-next-line import/no-nodejs-modules import querystring from 'querystring'; import { createSelector } from 'reselect'; import { @@ -10,8 +12,8 @@ import { HostPolicyResponseAppliedAction, HostPolicyResponseConfiguration, HostPolicyResponseActionStatus, -} from '../../../../../common/types'; -import { HostState, HostIndexUIQueryParams } from '../../types'; +} from '../../../common/endpoint/types'; +import { HostState, HostIndexUIQueryParams } from '../types'; const PAGE_SIZES = Object.freeze([10, 20, 50]); @@ -95,7 +97,7 @@ export const policyResponseLoading = (state: Immutable): boolean => export const policyResponseError = (state: Immutable) => state.policyResponseError; export const isOnHostPage = (state: Immutable) => - state.location ? state.location.pathname === '/hosts' : false; + state.location ? state.location.pathname === '/endpoint-hosts' : false; export const uiQueryParams: ( state: Immutable diff --git a/x-pack/plugins/siem/public/endpoint_hosts/types.ts b/x-pack/plugins/siem/public/endpoint_hosts/types.ts new file mode 100644 index 0000000000000..421903cb6e1ab --- /dev/null +++ b/x-pack/plugins/siem/public/endpoint_hosts/types.ts @@ -0,0 +1,57 @@ +/* + * 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 { + HostInfo, + Immutable, + HostMetadata, + HostPolicyResponse, + AppLocation, +} from '../../common/endpoint/types'; +import { ServerApiError } from '../common/types'; + +export interface HostState { + /** list of host **/ + hosts: HostInfo[]; + /** number of items per page */ + pageSize: number; + /** which page to show */ + pageIndex: number; + /** total number of hosts returned */ + total: number; + /** list page is retrieving data */ + loading: boolean; + /** api error from retrieving host list */ + error?: ServerApiError; + /** details data for a specific host */ + details?: Immutable; + /** details page is retrieving data */ + detailsLoading: boolean; + /** api error from retrieving host details */ + detailsError?: ServerApiError; + /** Holds the Policy Response for the Host currently being displayed in the details */ + policyResponse?: HostPolicyResponse; + /** policyResponse is being retrieved */ + policyResponseLoading: boolean; + /** api error from retrieving the policy response */ + policyResponseError?: ServerApiError; + /** current location info */ + location?: Immutable; +} + +/** + * Query params on the host page parsed from the URL + */ +export interface HostIndexUIQueryParams { + /** Selected host id shows host details flyout */ + selected_host?: string; + /** How many items to show in list */ + page_size?: string; + /** Which page to show */ + page_index?: string; + /** show the policy response or host details */ + show?: string; +} diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/components/flyout_sub_header.tsx b/x-pack/plugins/siem/public/endpoint_hosts/view/details/components/flyout_sub_header.tsx similarity index 97% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/components/flyout_sub_header.tsx rename to x-pack/plugins/siem/public/endpoint_hosts/view/details/components/flyout_sub_header.tsx index 9abb54e8b1807..14bebfbdc88d9 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/components/flyout_sub_header.tsx +++ b/x-pack/plugins/siem/public/endpoint_hosts/view/details/components/flyout_sub_header.tsx @@ -74,3 +74,5 @@ export const FlyoutSubHeader = memo( ); } ); + +FlyoutSubHeader.displayName = 'FlyoutSubHeader'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/host_details.tsx b/x-pack/plugins/siem/public/endpoint_hosts/view/details/host_details.tsx similarity index 76% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/host_details.tsx rename to x-pack/plugins/siem/public/endpoint_hosts/view/details/host_details.tsx index 2ded0e4b3123d..eb265675d3a24 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/host_details.tsx +++ b/x-pack/plugins/siem/public/endpoint_hosts/view/details/host_details.tsx @@ -16,14 +16,14 @@ import { import React, { memo, useMemo } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { HostMetadata } from '../../../../../../common/types'; -import { FormattedDateAndTime } from '../../formatted_date_time'; -import { LinkToApp } from '../../components/link_to_app'; +import { HostMetadata } from '../../../../common/endpoint/types'; import { useHostSelector, useHostLogsUrl } from '../hooks'; import { urlFromQueryParams } from '../url_from_query_params'; -import { policyResponseStatus, uiQueryParams } from '../../../store/hosts/selectors'; -import { useNavigateByRouterEventHandler } from '../../hooks/use_navigate_by_router_event_handler'; +import { policyResponseStatus, uiQueryParams } from '../../store/selectors'; import { POLICY_STATUS_TO_HEALTH_COLOR } from '../host_constants'; +import { FormattedDateAndTime } from '../../../common/components/endpoint/formatted_date_time'; +import { useNavigateByRouterEventHandler } from '../../../common/hooks/endpoint/use_navigate_by_router_event_handler'; +import { LinkToApp } from '../../../common/components/endpoint/link_to_app'; const HostIds = styled(EuiListGroupItem)` margin-top: 0; @@ -41,19 +41,19 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => { const detailsResultsUpper = useMemo(() => { return [ { - title: i18n.translate('xpack.endpoint.host.details.os', { + title: i18n.translate('xpack.siem.endpoint.host.details.os', { defaultMessage: 'OS', }), description: details.host.os.full, }, { - title: i18n.translate('xpack.endpoint.host.details.lastSeen', { + title: i18n.translate('xpack.siem.endpoint.host.details.lastSeen', { defaultMessage: 'Last Seen', }), description: , }, { - title: i18n.translate('xpack.endpoint.host.details.alerts', { + title: i18n.translate('xpack.siem.endpoint.host.details.alerts', { defaultMessage: 'Alerts', }), description: '0', @@ -73,13 +73,13 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => { const detailsResultsLower = useMemo(() => { return [ { - title: i18n.translate('xpack.endpoint.host.details.policy', { + title: i18n.translate('xpack.siem.endpoint.host.details.policy', { defaultMessage: 'Policy', }), description: details.endpoint.policy.id, }, { - title: i18n.translate('xpack.endpoint.host.details.policyStatus', { + title: i18n.translate('xpack.siem.endpoint.host.details.policyStatus', { defaultMessage: 'Policy Status', }), description: ( @@ -90,11 +90,11 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => { {/* eslint-disable-next-line @elastic/eui/href-or-on-click */} @@ -103,7 +103,7 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => { ), }, { - title: i18n.translate('xpack.endpoint.host.details.ipAddress', { + title: i18n.translate('xpack.siem.endpoint.host.details.ipAddress', { defaultMessage: 'IP Address', }), description: ( @@ -115,13 +115,13 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => { ), }, { - title: i18n.translate('xpack.endpoint.host.details.hostname', { + title: i18n.translate('xpack.siem.endpoint.host.details.hostname', { defaultMessage: 'Hostname', }), description: details.host.hostname, }, { - title: i18n.translate('xpack.endpoint.host.details.sensorVersion', { + title: i18n.translate('xpack.siem.endpoint.host.details.sensorVersion', { defaultMessage: 'Sensor Version', }), description: details.agent.version, @@ -159,7 +159,7 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => { data-test-subj="hostDetailsLinkToLogs" > @@ -167,3 +167,5 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => { ); }); + +HostDetails.displayName = 'HostDetails'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/index.tsx b/x-pack/plugins/siem/public/endpoint_hosts/view/details/index.tsx similarity index 86% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/index.tsx rename to x-pack/plugins/siem/public/endpoint_hosts/view/details/index.tsx index e4121503b4a96..9904306a76e9c 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/index.tsx +++ b/x-pack/plugins/siem/public/endpoint_hosts/view/details/index.tsx @@ -18,7 +18,7 @@ import { import { useHistory } from 'react-router-dom'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { useKibana } from '../../../../../../../../../src/plugins/kibana_react/public'; +import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; import { useHostSelector } from '../hooks'; import { urlFromQueryParams } from '../url_from_query_params'; import { @@ -32,12 +32,12 @@ import { policyResponseFailedOrWarningActionCount, policyResponseError, policyResponseLoading, -} from '../../../store/hosts/selectors'; +} from '../../store/selectors'; import { HostDetails } from './host_details'; import { PolicyResponse } from './policy_response'; -import { HostMetadata } from '../../../../../../common/types'; +import { HostMetadata } from '../../../../common/endpoint/types'; import { FlyoutSubHeader, FlyoutSubHeaderProps } from './components/flyout_sub_header'; -import { useNavigateByRouterEventHandler } from '../../hooks/use_navigate_by_router_event_handler'; +import { useNavigateByRouterEventHandler } from '../../../common/hooks/endpoint/use_navigate_by_router_event_handler'; export const HostDetailsFlyout = memo(() => { const history = useHistory(); @@ -58,13 +58,13 @@ export const HostDetailsFlyout = memo(() => { notifications.toasts.danger({ title: ( ), body: ( ), @@ -104,6 +104,8 @@ export const HostDetailsFlyout = memo(() => { ); }); +HostDetailsFlyout.displayName = 'HostDetailsFlyout'; + const PolicyResponseFlyoutPanel = memo<{ hostMeta: HostMetadata; }>(({ hostMeta }) => { @@ -124,10 +126,10 @@ const PolicyResponseFlyoutPanel = memo<{ const backToDetailsClickHandler = useNavigateByRouterEventHandler(detailsUri); const backButtonProp = useMemo((): FlyoutSubHeaderProps['backButton'] => { return { - title: i18n.translate('xpack.endpoint.host.policyResponse.backLinkTitle', { + title: i18n.translate('xpack.siem.endpoint.host.policyResponse.backLinkTitle', { defaultMessage: 'Endpoint Details', }), - href: '?' + detailsUri.search, + href: `?${detailsUri.search}`, onClick: backToDetailsClickHandler, }; }, [backToDetailsClickHandler, detailsUri.search]); @@ -142,7 +144,7 @@ const PolicyResponseFlyoutPanel = memo<{

@@ -151,7 +153,7 @@ const PolicyResponseFlyoutPanel = memo<{ } @@ -169,3 +171,5 @@ const PolicyResponseFlyoutPanel = memo<{ ); }); + +PolicyResponseFlyoutPanel.displayName = 'PolicyResponseFlyoutPanel'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/policy_response.tsx b/x-pack/plugins/siem/public/endpoint_hosts/view/details/policy_response.tsx similarity index 95% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/policy_response.tsx rename to x-pack/plugins/siem/public/endpoint_hosts/view/details/policy_response.tsx index 24ae3e2b0f037..58ff9a17643bc 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/policy_response.tsx +++ b/x-pack/plugins/siem/public/endpoint_hosts/view/details/policy_response.tsx @@ -5,16 +5,21 @@ */ import React, { memo, useMemo } from 'react'; import styled from 'styled-components'; -import { EuiAccordion, EuiNotificationBadge, EuiHealth } from '@elastic/eui'; -import { EuiText } from '@elastic/eui'; -import { htmlIdGenerator } from '@elastic/eui'; import { - HostPolicyResponseAppliedAction, - HostPolicyResponseConfiguration, - Immutable, -} from '../../../../../../common/types'; + EuiAccordion, + EuiNotificationBadge, + EuiHealth, + EuiText, + htmlIdGenerator, +} from '@elastic/eui'; + import { formatResponse } from './policy_response_friendly_names'; import { POLICY_STATUS_TO_HEALTH_COLOR } from '../host_constants'; +import { + Immutable, + HostPolicyResponseAppliedAction, + HostPolicyResponseConfiguration, +} from '../../../../common/endpoint/types'; /** * Nested accordion in the policy response detailing any concerned @@ -110,6 +115,8 @@ const ResponseActions = memo( } ); +ResponseActions.displayName = 'ResponseActions'; + /** * A policy response is returned by the endpoint and shown in the host details after a user modifies a policy */ @@ -158,3 +165,5 @@ export const PolicyResponse = memo( ); } ); + +PolicyResponse.displayName = 'PolicyResponse'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/policy_response_friendly_names.ts b/x-pack/plugins/siem/public/endpoint_hosts/view/details/policy_response_friendly_names.ts similarity index 54% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/policy_response_friendly_names.ts rename to x-pack/plugins/siem/public/endpoint_hosts/view/details/policy_response_friendly_names.ts index 8eaacb31b4f87..2f05840567a57 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/policy_response_friendly_names.ts +++ b/x-pack/plugins/siem/public/endpoint_hosts/view/details/policy_response_friendly_names.ts @@ -9,163 +9,166 @@ import { i18n } from '@kbn/i18n'; const responseMap = new Map(); responseMap.set( 'success', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.success', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.success', { defaultMessage: 'Success', }) ); responseMap.set( 'warning', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.warning', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.warning', { defaultMessage: 'Warning', }) ); responseMap.set( 'failure', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.failed', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.failed', { defaultMessage: 'Failed', }) ); responseMap.set( 'logging', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.logging', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.logging', { defaultMessage: 'Logging', }) ); responseMap.set( 'streaming', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.streaming', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.streaming', { defaultMessage: 'Streaming', }) ); responseMap.set( 'malware', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.malware', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.malware', { defaultMessage: 'Malware', }) ); responseMap.set( 'events', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.events', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.events', { defaultMessage: 'Events', }) ); responseMap.set( 'configure_elasticsearch_connection', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.configureElasticSearchConnection', { - defaultMessage: 'Configure Elastic Search Connection', - }) + i18n.translate( + 'xpack.siem.endpoint.hostDetails.policyResponse.configureElasticSearchConnection', + { + defaultMessage: 'Configure Elastic Search Connection', + } + ) ); responseMap.set( 'configure_logging', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.configureLogging', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.configureLogging', { defaultMessage: 'Configure Logging', }) ); responseMap.set( 'configure_kernel', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.configureKernel', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.configureKernel', { defaultMessage: 'Configure Kernel', }) ); responseMap.set( 'configure_malware', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.configureMalware', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.configureMalware', { defaultMessage: 'Configure Malware', }) ); responseMap.set( 'connect_kernel', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.connectKernel', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.connectKernel', { defaultMessage: 'Connect Kernel', }) ); responseMap.set( 'detect_file_open_events', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.detectFileOpenEvents', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.detectFileOpenEvents', { defaultMessage: 'Detect File Open Events', }) ); responseMap.set( 'detect_file_write_events', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.detectFileWriteEvents', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.detectFileWriteEvents', { defaultMessage: 'Detect File Write Events', }) ); responseMap.set( 'detect_image_load_events', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.detectImageLoadEvents', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.detectImageLoadEvents', { defaultMessage: 'Detect Image Load Events', }) ); responseMap.set( 'detect_process_events', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.detectProcessEvents', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.detectProcessEvents', { defaultMessage: 'Detect Process Events', }) ); responseMap.set( 'download_global_artifacts', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.downloadGlobalArtifacts', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.downloadGlobalArtifacts', { defaultMessage: 'Download Global Artifacts', }) ); responseMap.set( 'load_config', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.loadConfig', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.loadConfig', { defaultMessage: 'Load Config', }) ); responseMap.set( 'load_malware_model', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.loadMalwareModel', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.loadMalwareModel', { defaultMessage: 'Load Malware Model', }) ); responseMap.set( 'read_elasticsearch_config', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.readElasticSearchConfig', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.readElasticSearchConfig', { defaultMessage: 'Read ElasticSearch Config', }) ); responseMap.set( 'read_events_config', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.readEventsConfig', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.readEventsConfig', { defaultMessage: 'Read Events Config', }) ); responseMap.set( 'read_kernel_config', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.readKernelConfig', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.readKernelConfig', { defaultMessage: 'Read Kernel Config', }) ); responseMap.set( 'read_logging_config', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.readLoggingConfig', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.readLoggingConfig', { defaultMessage: 'Read Logging Config', }) ); responseMap.set( 'read_malware_config', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.readMalwareConfig', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.readMalwareConfig', { defaultMessage: 'Read Malware Config', }) ); responseMap.set( 'workflow', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.workflow', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.workflow', { defaultMessage: 'Workflow', }) ); responseMap.set( 'download_model', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.downloadModel', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.downloadModel', { defaultMessage: 'Download Model', }) ); responseMap.set( 'ingest_events_config', - i18n.translate('xpack.endpoint.hostDetails.policyResponse.injestEventsConfig', { + i18n.translate('xpack.siem.endpoint.hostDetails.policyResponse.injestEventsConfig', { defaultMessage: 'Injest Events Config', }) ); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/hooks.ts b/x-pack/plugins/siem/public/endpoint_hosts/view/hooks.ts similarity index 78% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/hooks.ts rename to x-pack/plugins/siem/public/endpoint_hosts/view/hooks.ts index eb242f5c535f4..727f601dd7670 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/hooks.ts +++ b/x-pack/plugins/siem/public/endpoint_hosts/view/hooks.ts @@ -6,12 +6,13 @@ import { useSelector } from 'react-redux'; import { useMemo } from 'react'; -import { GlobalState, HostState } from '../../types'; -import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; +import { HostState } from '../types'; +import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; +import { State } from '../../common/store/reducer'; export function useHostSelector(selector: (state: HostState) => TSelected) { - return useSelector(function(state: GlobalState) { - return selector(state.hostList); + return useSelector(function(state: State) { + return selector(state.hostList as HostState); }); } diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/host_constants.ts b/x-pack/plugins/siem/public/endpoint_hosts/view/host_constants.ts similarity index 87% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/host_constants.ts rename to x-pack/plugins/siem/public/endpoint_hosts/view/host_constants.ts index 08b2608698a66..efad4e3a468d8 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/host_constants.ts +++ b/x-pack/plugins/siem/public/endpoint_hosts/view/host_constants.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HostPolicyResponseActionStatus, HostStatus } from '../../../../../common/types'; +import { HostStatus, HostPolicyResponseActionStatus } from '../../../common/endpoint/types'; export const HOST_STATUS_TO_HEALTH_COLOR = Object.freeze< { diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/index.test.tsx b/x-pack/plugins/siem/public/endpoint_hosts/view/index.test.tsx similarity index 96% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/index.test.tsx rename to x-pack/plugins/siem/public/endpoint_hosts/view/index.test.tsx index c3066dc41fa24..bb09323f547c7 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/index.test.tsx +++ b/x-pack/plugins/siem/public/endpoint_hosts/view/index.test.tsx @@ -6,16 +6,17 @@ import React from 'react'; import * as reactTestingLibrary from '@testing-library/react'; -import { fireEvent } from '@testing-library/react'; -import { AppAction } from '../../types'; + import { HostList } from './index'; +import { mockHostDetailsApiResult, mockHostResultList } from '../store/mock_host_result_list'; +import { AppContextTestRender, createAppRootMockRenderer } from '../../common/mock/endpoint'; import { - mockHostDetailsApiResult, - mockHostResultList, -} from '../../store/hosts/mock_host_result_list'; -import { AppContextTestRender, createAppRootMockRenderer } from '../../mocks'; -import { HostInfo, HostStatus, HostPolicyResponseActionStatus } from '../../../../../common/types'; -import { EndpointDocGenerator } from '../../../../../common/generate_data'; + HostInfo, + HostStatus, + HostPolicyResponseActionStatus, +} from '../../../common/endpoint/types'; +import { EndpointDocGenerator } from '../../../common/endpoint/generate_data'; +import { AppAction } from '../../common/store/actions'; describe('when on the hosts page', () => { const docGenerator = new EndpointDocGenerator(); @@ -209,7 +210,7 @@ describe('when on the hosts page', () => { const policyStatusLink = await renderResult.findByTestId('policyStatusValue'); const userChangedUrlChecker = middlewareSpy.waitForAction('userChangedUrl'); reactTestingLibrary.act(() => { - fireEvent.click(policyStatusLink); + reactTestingLibrary.fireEvent.click(policyStatusLink); }); const changedUrlAction = await userChangedUrlChecker; expect(changedUrlAction.payload.search).toEqual( @@ -282,7 +283,7 @@ describe('when on the hosts page', () => { const renderResult = render(); const linkToLogs = await renderResult.findByTestId('hostDetailsLinkToLogs'); reactTestingLibrary.act(() => { - fireEvent.click(linkToLogs); + reactTestingLibrary.fireEvent.click(linkToLogs); }); }); @@ -297,7 +298,7 @@ describe('when on the hosts page', () => { const policyStatusLink = await renderResult.findByTestId('policyStatusValue'); const userChangedUrlChecker = middlewareSpy.waitForAction('userChangedUrl'); reactTestingLibrary.act(() => { - fireEvent.click(policyStatusLink); + reactTestingLibrary.fireEvent.click(policyStatusLink); }); await userChangedUrlChecker; reactTestingLibrary.act(() => { @@ -385,7 +386,7 @@ describe('when on the hosts page', () => { const subHeaderBackLink = await renderResult.findByTestId('flyoutSubHeaderBackButton'); const userChangedUrlChecker = middlewareSpy.waitForAction('userChangedUrl'); reactTestingLibrary.act(() => { - fireEvent.click(subHeaderBackLink); + reactTestingLibrary.fireEvent.click(subHeaderBackLink); }); const changedUrlAction = await userChangedUrlChecker; expect(changedUrlAction.payload.search).toEqual( diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/index.tsx b/x-pack/plugins/siem/public/endpoint_hosts/view/index.tsx similarity index 76% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/index.tsx rename to x-pack/plugins/siem/public/endpoint_hosts/view/index.tsx index 638dd190dcbce..10a7a7ea0d445 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/index.tsx +++ b/x-pack/plugins/siem/public/endpoint_hosts/view/index.tsx @@ -8,6 +8,7 @@ import React, { useMemo, useCallback, memo } from 'react'; import { EuiHorizontalRule, EuiBasicTable, + EuiBasicTableColumn, EuiText, EuiLink, EuiHealth, @@ -17,16 +18,16 @@ import { useHistory } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { createStructuredSelector } from 'reselect'; -import { EuiBasicTableColumn } from '@elastic/eui'; + import { HostDetailsFlyout } from './details'; -import * as selectors from '../../store/hosts/selectors'; +import * as selectors from '../store/selectors'; import { useHostSelector } from './hooks'; -import { CreateStructuredSelector } from '../../types'; import { urlFromQueryParams } from './url_from_query_params'; -import { HostInfo, Immutable } from '../../../../../common/types'; -import { PageView } from '../components/page_view'; -import { useNavigateByRouterEventHandler } from '../hooks/use_navigate_by_router_event_handler'; import { HOST_STATUS_TO_HEALTH_COLOR } from './host_constants'; +import { useNavigateByRouterEventHandler } from '../../common/hooks/endpoint/use_navigate_by_router_event_handler'; +import { CreateStructuredSelector } from '../../common/store'; +import { Immutable, HostInfo } from '../../../common/endpoint/types'; +import { PageView } from '../../common/components/endpoint/page_view'; const HostLink = memo<{ name: string; @@ -47,6 +48,7 @@ const HostLink = memo<{
); }); +HostLink.displayName = 'HostLink'; const selector = (createStructuredSelector as CreateStructuredSelector)(selectors); export const HostList = () => { @@ -90,21 +92,22 @@ export const HostList = () => { return [ { field: 'metadata.host', - name: i18n.translate('xpack.endpoint.host.list.hostname', { + name: i18n.translate('xpack.siem.endpoint.host.list.hostname', { defaultMessage: 'Hostname', }), render: ({ hostname, id }: HostInfo['metadata']['host']) => { const newQueryParams = urlFromQueryParams({ ...queryParams, selected_host: id }); return ( - + ); }, }, { field: 'host_status', - name: i18n.translate('xpack.endpoint.host.list.hostStatus', { + name: i18n.translate('xpack.siem.endpoint.host.list.hostStatus', { defaultMessage: 'Host Status', }), + // eslint-disable-next-line react/display-name render: (hostStatus: HostInfo['host_status']) => { return ( { className="eui-textTruncate" > @@ -123,24 +126,26 @@ export const HostList = () => { }, { field: '', - name: i18n.translate('xpack.endpoint.host.list.policy', { + name: i18n.translate('xpack.siem.endpoint.host.list.policy', { defaultMessage: 'Policy', }), truncateText: true, + // eslint-disable-next-line react/display-name render: () => { - return Policy Name; + return {'Policy Name'}; }, }, { field: '', - name: i18n.translate('xpack.endpoint.host.list.policyStatus', { + name: i18n.translate('xpack.siem.endpoint.host.list.policyStatus', { defaultMessage: 'Policy Status', }), + // eslint-disable-next-line react/display-name render: () => { return ( @@ -149,7 +154,7 @@ export const HostList = () => { }, { field: '', - name: i18n.translate('xpack.endpoint.host.list.alerts', { + name: i18n.translate('xpack.siem.endpoint.host.list.alerts', { defaultMessage: 'Alerts', }), dataType: 'number', @@ -159,16 +164,17 @@ export const HostList = () => { }, { field: 'metadata.host.os.name', - name: i18n.translate('xpack.endpoint.host.list.os', { + name: i18n.translate('xpack.siem.endpoint.host.list.os', { defaultMessage: 'Operating System', }), truncateText: true, }, { field: 'metadata.host.ip', - name: i18n.translate('xpack.endpoint.host.list.ip', { + name: i18n.translate('xpack.siem.endpoint.host.list.ip', { defaultMessage: 'IP Address', }), + // eslint-disable-next-line react/display-name render: (ip: string[]) => { return ( @@ -183,13 +189,13 @@ export const HostList = () => { }, { field: 'metadata.agent.version', - name: i18n.translate('xpack.endpoint.host.list.endpointVersion', { + name: i18n.translate('xpack.siem.endpoint.host.list.endpointVersion', { defaultMessage: 'Version', }), }, { field: '', - name: i18n.translate('xpack.endpoint.host.list.lastActive', { + name: i18n.translate('xpack.siem.endpoint.host.list.lastActive', { defaultMessage: 'Last Active', }), dataType: 'date', @@ -204,12 +210,12 @@ export const HostList = () => { {hasSelectedHost && } diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/url_from_query_params.ts b/x-pack/plugins/siem/public/endpoint_hosts/view/url_from_query_params.ts similarity index 58% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/url_from_query_params.ts rename to x-pack/plugins/siem/public/endpoint_hosts/view/url_from_query_params.ts index 225aad8cab020..e3728d63aea7c 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/url_from_query_params.ts +++ b/x-pack/plugins/siem/public/endpoint_hosts/view/url_from_query_params.ts @@ -4,12 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ +// eslint-disable-next-line import/no-nodejs-modules import querystring from 'querystring'; -import { EndpointAppLocation, HostIndexUIQueryParams } from '../../types'; -export function urlFromQueryParams( - queryParams: HostIndexUIQueryParams -): Partial { +import { HostIndexUIQueryParams } from '../types'; +import { AppLocation } from '../../../common/endpoint/types'; + +export function urlFromQueryParams(queryParams: HostIndexUIQueryParams): Partial { const search = querystring.stringify(queryParams); return { search, diff --git a/x-pack/plugins/siem/public/endpoint_policy/details.ts b/x-pack/plugins/siem/public/endpoint_policy/details.ts new file mode 100644 index 0000000000000..1128bcfac6ab2 --- /dev/null +++ b/x-pack/plugins/siem/public/endpoint_policy/details.ts @@ -0,0 +1,41 @@ +/* + * 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 { SecuritySubPluginWithStore } from '../app/types'; +import { getPolicyDetailsRoutes } from './routes'; +import { PolicyDetailsState } from './types'; +import { Immutable } from '../../common/endpoint/types'; +import { initialPolicyDetailsState, policyDetailsReducer } from './store/policy_details/reducer'; +import { policyDetailsMiddlewareFactory } from './store/policy_details/middleware'; +import { CoreStart } from '../../../../../src/core/public'; +import { StartPlugins } from '../types'; +import { substateMiddlewareFactory } from '../common/store'; + +export class EndpointPolicyDetails { + public setup() {} + + public start( + core: CoreStart, + plugins: StartPlugins + ): SecuritySubPluginWithStore<'policyDetails', Immutable> { + const { data, ingestManager } = plugins; + const middleware = substateMiddlewareFactory( + globalState => globalState.policyDetails, + policyDetailsMiddlewareFactory(core, { data, ingestManager }) + ); + + return { + routes: getPolicyDetailsRoutes(), + store: { + initialState: { + policyDetails: initialPolicyDetailsState(), + }, + reducer: { policyDetails: policyDetailsReducer }, + middleware, + }, + }; + } +} diff --git a/x-pack/plugins/siem/public/endpoint_policy/list.ts b/x-pack/plugins/siem/public/endpoint_policy/list.ts new file mode 100644 index 0000000000000..417931e64f44e --- /dev/null +++ b/x-pack/plugins/siem/public/endpoint_policy/list.ts @@ -0,0 +1,41 @@ +/* + * 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 { SecuritySubPluginWithStore } from '../app/types'; +import { getPolicyListRoutes } from './routes'; +import { PolicyListState } from './types'; +import { Immutable } from '../../common/endpoint/types'; +import { initialPolicyListState, policyListReducer } from './store/policy_list/reducer'; +import { policyListMiddlewareFactory } from './store/policy_list/middleware'; +import { CoreStart } from '../../../../../src/core/public'; +import { StartPlugins } from '../types'; +import { substateMiddlewareFactory } from '../common/store'; + +export class EndpointPolicyList { + public setup() {} + + public start( + core: CoreStart, + plugins: StartPlugins + ): SecuritySubPluginWithStore<'policyList', Immutable> { + const { data, ingestManager } = plugins; + const middleware = substateMiddlewareFactory( + globalState => globalState.policyList, + policyListMiddlewareFactory(core, { data, ingestManager }) + ); + + return { + routes: getPolicyListRoutes(), + store: { + initialState: { + policyList: initialPolicyListState(), + }, + reducer: { policyList: policyListReducer }, + middleware, + }, + }; + } +} diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/models/policy_details_config.ts b/x-pack/plugins/siem/public/endpoint_policy/models/policy_details_config.ts similarity index 97% rename from x-pack/plugins/endpoint/public/applications/endpoint/models/policy_details_config.ts rename to x-pack/plugins/siem/public/endpoint_policy/models/policy_details_config.ts index 3e56b1ff14d65..44be5ddcc003f 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/models/policy_details_config.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/models/policy_details_config.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { UIPolicyConfig } from '../../../../common/types'; +import { UIPolicyConfig } from '../../../common/endpoint/types'; /** * A typed Object.entries() function where the keys and values are typed based on the given object diff --git a/x-pack/plugins/siem/public/endpoint_policy/routes.tsx b/x-pack/plugins/siem/public/endpoint_policy/routes.tsx new file mode 100644 index 0000000000000..be820f3f2c5dc --- /dev/null +++ b/x-pack/plugins/siem/public/endpoint_policy/routes.tsx @@ -0,0 +1,18 @@ +/* + * 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 from 'react'; +import { Route } from 'react-router-dom'; + +import { PolicyList, PolicyDetails } from './view'; + +export const getPolicyListRoutes = () => [ + , +]; + +export const getPolicyDetailsRoutes = () => [ + , +]; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/action.ts b/x-pack/plugins/siem/public/endpoint_policy/store/policy_details/action.ts similarity index 86% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/action.ts rename to x-pack/plugins/siem/public/endpoint_policy/store/policy_details/action.ts index 4de3dac02a8ec..ceb62a9f9ace9 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/action.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/store/policy_details/action.ts @@ -4,9 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { PolicyDetailsState, ServerApiError } from '../../types'; -import { GetAgentStatusResponse } from '../../../../../../ingest_manager/common/types/rest_spec'; -import { PolicyData, UIPolicyConfig } from '../../../../../common/types'; +import { GetAgentStatusResponse } from '../../../../../ingest_manager/common/types/rest_spec'; +import { PolicyData, UIPolicyConfig } from '../../../../common/endpoint/types'; +import { ServerApiError } from '../../../common/types'; +import { PolicyDetailsState } from '../../types'; interface ServerReturnedPolicyDetailsData { type: 'serverReturnedPolicyDetailsData'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/index.test.ts b/x-pack/plugins/siem/public/endpoint_policy/store/policy_details/index.test.ts similarity index 97% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/index.test.ts rename to x-pack/plugins/siem/public/endpoint_policy/store/policy_details/index.test.ts index dd4e63c95ee8f..01a824ecc7b8e 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/index.test.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/store/policy_details/index.test.ts @@ -9,7 +9,7 @@ import { createStore, Dispatch, Store } from 'redux'; import { policyDetailsReducer, PolicyDetailsAction } from './index'; import { policyConfig } from './selectors'; import { clone } from '../../models/policy_details_config'; -import { factory as policyConfigFactory } from '../../../../../common/models/policy_config'; +import { factory as policyConfigFactory } from '../../../../common/endpoint/models/policy_config'; describe('policy details: ', () => { let store: Store; diff --git a/x-pack/plugins/siem/public/endpoint_policy/store/policy_details/index.ts b/x-pack/plugins/siem/public/endpoint_policy/store/policy_details/index.ts new file mode 100644 index 0000000000000..88f090301cfa3 --- /dev/null +++ b/x-pack/plugins/siem/public/endpoint_policy/store/policy_details/index.ts @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { PolicyDetailsState } from '../../types'; +import { ImmutableReducer } from '../../../common/store'; +import { AppAction } from '../../../common/store/actions'; +import { Immutable } from '../../../../common/endpoint/types'; + +export { policyDetailsMiddlewareFactory } from './middleware'; +export { PolicyDetailsAction } from './action'; +export { policyDetailsReducer } from './reducer'; + +export interface EndpointPolicyDetailsStatePluginState { + policyDetails: Immutable; +} + +export interface EndpointPolicyDetailsStatePluginReducer { + policyDetails: ImmutableReducer; +} diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/middleware.ts b/x-pack/plugins/siem/public/endpoint_policy/store/policy_details/middleware.ts similarity index 88% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/middleware.ts rename to x-pack/plugins/siem/public/endpoint_policy/store/policy_details/middleware.ts index d82273bfdb221..f908befe05aa3 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/middleware.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/store/policy_details/middleware.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ImmutableMiddlewareFactory, PolicyDetailsState, UpdatePolicyResponse } from '../../types'; +import { PolicyDetailsState, UpdatePolicyResponse } from '../../types'; import { policyIdFromParams, isOnPolicyDetailsPage, @@ -16,10 +16,13 @@ import { sendGetFleetAgentStatusForConfig, sendPutDatasource, } from '../policy_list/services/ingest'; -import { NewPolicyData, PolicyData } from '../../../../../common/types'; -import { factory as policyConfigFactory } from '../../../../../common/models/policy_config'; +import { NewPolicyData, PolicyData, Immutable } from '../../../../common/endpoint/types'; +import { factory as policyConfigFactory } from '../../../../common/endpoint/models/policy_config'; +import { ImmutableMiddlewareFactory } from '../../../common/store'; -export const policyDetailsMiddlewareFactory: ImmutableMiddlewareFactory = coreStart => { +export const policyDetailsMiddlewareFactory: ImmutableMiddlewareFactory> = coreStart => { const http = coreStart.http; return ({ getState, dispatch }) => next => async action => { diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/reducer.ts b/x-pack/plugins/siem/public/endpoint_policy/store/policy_details/reducer.ts similarity index 91% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/reducer.ts rename to x-pack/plugins/siem/public/endpoint_policy/store/policy_details/reducer.ts index 9778f23d083a2..ff441ba663cf7 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/reducer.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/store/policy_details/reducer.ts @@ -3,13 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ - -import { AppAction } from '../action'; import { fullPolicy, isOnPolicyDetailsPage } from './selectors'; -import { PolicyDetailsState, ImmutableReducer } from '../../types'; -import { Immutable, PolicyConfig, UIPolicyConfig } from '../../../../../common/types'; +import { PolicyDetailsState } from '../../types'; +import { Immutable, PolicyConfig, UIPolicyConfig } from '../../../../common/endpoint/types'; +import { ImmutableReducer } from '../../../common/store'; +import { AppAction } from '../../../common/store/actions'; -const initialPolicyDetailsState = (): PolicyDetailsState => { +export const initialPolicyDetailsState = (): PolicyDetailsState => { return { policyItem: undefined, isLoading: false, diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/selectors.ts b/x-pack/plugins/siem/public/endpoint_policy/store/policy_details/selectors.ts similarity index 97% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/selectors.ts rename to x-pack/plugins/siem/public/endpoint_policy/store/policy_details/selectors.ts index 8ab6f77dc7276..dfbbbf65ada20 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/selectors.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/store/policy_details/selectors.ts @@ -11,8 +11,8 @@ import { NewPolicyData, PolicyConfig, UIPolicyConfig, -} from '../../../../../common/types'; -import { factory as policyConfigFactory } from '../../../../../common/models/policy_config'; +} from '../../../../common/endpoint/types'; +import { factory as policyConfigFactory } from '../../../../common/endpoint/models/policy_config'; /** Returns the policy details */ export const policyDetails = (state: Immutable) => state.policyItem; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/action.ts b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/action.ts similarity index 84% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/action.ts rename to x-pack/plugins/siem/public/endpoint_policy/store/policy_list/action.ts index 4c379b7426461..bedbcdae3306f 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/action.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/action.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ServerApiError } from '../../types'; -import { PolicyData } from '../../../../../common/types'; +import { PolicyData } from '../../../../common/endpoint/types'; +import { ServerApiError } from '../../../common/types'; interface ServerReturnedPolicyListData { type: 'serverReturnedPolicyListData'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/index.test.ts b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/index.test.ts similarity index 80% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/index.test.ts rename to x-pack/plugins/siem/public/endpoint_policy/store/policy_list/index.test.ts index 9912c9a81e6e1..9b56062879583 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/index.test.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/index.test.ts @@ -4,27 +4,25 @@ * you may not use this file except in compliance with the Elastic License. */ -import { EndpointAppLocation, PolicyListState } from '../../types'; -import { applyMiddleware, createStore, Store } from 'redux'; -import { AppAction } from '../action'; -import { policyListReducer } from './reducer'; +import { PolicyListState } from '../../types'; +import { Store, applyMiddleware, createStore } from 'redux'; + +import { coreMock } from '../../../../../../../src/core/public/mocks'; +import { DATASOURCE_SAVED_OBJECT_TYPE } from '../../../../../ingest_manager/common'; + +import { policyListReducer, initialPolicyListState } from './reducer'; import { policyListMiddlewareFactory } from './middleware'; -import { coreMock } from '../../../../../../../../src/core/public/mocks'; + import { isOnPolicyListPage, selectIsLoading, urlSearchParams } from './selectors'; -import { DepsStartMock, depsStartMock } from '../../mocks'; +import { DepsStartMock, depsStartMock } from '../../../common/mock/endpoint'; import { setPolicyListApiMockImplementation } from './test_mock_utils'; import { INGEST_API_DATASOURCES } from './services/ingest'; -import { Immutable } from '../../../../../common/types'; -import { createSpyMiddleware, MiddlewareActionSpyHelper } from '../test_utils'; -import { DATASOURCE_SAVED_OBJECT_TYPE } from '../../../../../../ingest_manager/common'; +import { createSpyMiddleware, MiddlewareActionSpyHelper } from '../../../common/store/test_utils'; describe('policy list store concerns', () => { let fakeCoreStart: ReturnType; let depsStart: DepsStartMock; - type PolicyListStore = Store, Immutable>; - let store: PolicyListStore; - let getState: PolicyListStore['getState']; - let dispatch: PolicyListStore['dispatch']; + let store: Store; let waitForAction: MiddlewareActionSpyHelper['waitForAction']; beforeEach(() => { @@ -36,28 +34,27 @@ describe('policy list store concerns', () => { store = createStore( policyListReducer, + initialPolicyListState(), applyMiddleware(policyListMiddlewareFactory(fakeCoreStart, depsStart), actionSpyMiddleware) ); - getState = store.getState; - dispatch = store.dispatch; }); it('it does nothing on `userChangedUrl` if pathname is NOT `/policy`', async () => { - const state = getState(); + const state = store.getState(); expect(isOnPolicyListPage(state)).toBe(false); - dispatch({ + store.dispatch({ type: 'userChangedUrl', payload: { pathname: '/foo', search: '', hash: '', - } as EndpointAppLocation, + }, }); - expect(getState()).toEqual(state); + expect(store.getState()).toEqual(state); }); it('it reports `isOnPolicyListPage` correctly when router pathname is `/policy`', async () => { - dispatch({ + store.dispatch({ type: 'userChangedUrl', payload: { pathname: '/policy', @@ -65,12 +62,12 @@ describe('policy list store concerns', () => { hash: '', }, }); - expect(isOnPolicyListPage(getState())).toBe(true); + expect(isOnPolicyListPage(store.getState())).toBe(true); }); it('it sets `isLoading` when `userChangedUrl`', async () => { - expect(selectIsLoading(getState())).toBe(false); - dispatch({ + expect(selectIsLoading(store.getState())).toBe(false); + store.dispatch({ type: 'userChangedUrl', payload: { pathname: '/policy', @@ -78,13 +75,13 @@ describe('policy list store concerns', () => { hash: '', }, }); - expect(selectIsLoading(getState())).toBe(true); + expect(selectIsLoading(store.getState())).toBe(true); await waitForAction('serverReturnedPolicyListData'); - expect(selectIsLoading(getState())).toBe(false); + expect(selectIsLoading(store.getState())).toBe(false); }); it('it resets state on `userChangedUrl` and pathname is NOT `/policy`', async () => { - dispatch({ + store.dispatch({ type: 'userChangedUrl', payload: { pathname: '/policy', @@ -93,7 +90,7 @@ describe('policy list store concerns', () => { }, }); await waitForAction('serverReturnedPolicyListData'); - dispatch({ + store.dispatch({ type: 'userChangedUrl', payload: { pathname: '/foo', @@ -101,7 +98,7 @@ describe('policy list store concerns', () => { hash: '', }, }); - expect(getState()).toEqual({ + expect(store.getState()).toEqual({ apiError: undefined, location: undefined, policyItems: [], @@ -112,7 +109,7 @@ describe('policy list store concerns', () => { }); }); it('uses default pagination params when not included in url', async () => { - dispatch({ + store.dispatch({ type: 'userChangedUrl', payload: { pathname: '/policy', @@ -132,7 +129,7 @@ describe('policy list store concerns', () => { describe('when url contains search params', () => { const dispatchUserChangedUrl = (searchParams: string = '') => - dispatch({ + store.dispatch({ type: 'userChangedUrl', payload: { pathname: '/policy', @@ -154,12 +151,12 @@ describe('policy list store concerns', () => { }); it('uses defaults for params not in url', async () => { dispatchUserChangedUrl('?page_index=99'); - expect(urlSearchParams(getState())).toEqual({ + expect(urlSearchParams(store.getState())).toEqual({ page_index: 99, page_size: 10, }); dispatchUserChangedUrl('?page_size=50'); - expect(urlSearchParams(getState())).toEqual({ + expect(urlSearchParams(store.getState())).toEqual({ page_index: 0, page_size: 50, }); @@ -199,14 +196,14 @@ describe('policy list store concerns', () => { }); it(`ignores unknown url search params`, async () => { dispatchUserChangedUrl('?page_size=20&page_index=10&foo=bar'); - expect(urlSearchParams(getState())).toEqual({ + expect(urlSearchParams(store.getState())).toEqual({ page_index: 10, page_size: 20, }); }); it(`uses last param value if param is defined multiple times`, async () => { dispatchUserChangedUrl('?page_size=20&page_size=50&page_index=20&page_index=40'); - expect(urlSearchParams(getState())).toEqual({ + expect(urlSearchParams(store.getState())).toEqual({ page_index: 40, page_size: 50, }); diff --git a/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/index.ts b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/index.ts new file mode 100644 index 0000000000000..a4f51fcf0ec66 --- /dev/null +++ b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/index.ts @@ -0,0 +1,21 @@ +/* + * 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 { PolicyListState } from '../../types'; +import { ImmutableReducer } from '../../../common/store'; +import { AppAction } from '../../../common/store/actions'; +import { Immutable } from '../../../../common/endpoint/types'; +export { policyListReducer } from './reducer'; +export { PolicyListAction } from './action'; +export { policyListMiddlewareFactory } from './middleware'; + +export interface EndpointPolicyListStatePluginState { + policyList: Immutable; +} + +export interface EndpointPolicyListStatePluginReducer { + policyList: ImmutableReducer; +} diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/middleware.ts b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/middleware.ts similarity index 84% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/middleware.ts rename to x-pack/plugins/siem/public/endpoint_policy/store/policy_list/middleware.ts index 78ebacd971840..b74ffec6ed897 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/middleware.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/middleware.ts @@ -4,18 +4,21 @@ * you may not use this file except in compliance with the Elastic License. */ -import { GetPolicyListResponse, ImmutableMiddlewareFactory, PolicyListState } from '../../types'; +import { GetPolicyListResponse, PolicyListState } from '../../types'; import { sendGetEndpointSpecificDatasources } from './services/ingest'; import { isOnPolicyListPage, urlSearchParams } from './selectors'; +import { ImmutableMiddlewareFactory } from '../../../common/store'; +import { Immutable } from '../../../../common/endpoint/types'; -export const policyListMiddlewareFactory: ImmutableMiddlewareFactory = coreStart => { +export const policyListMiddlewareFactory: ImmutableMiddlewareFactory> = coreStart => { const http = coreStart.http; return ({ getState, dispatch }) => next => async action => { next(action); const state = getState(); - if (action.type === 'userChangedUrl' && isOnPolicyListPage(state)) { const { page_index: pageIndex, page_size: pageSize } = urlSearchParams(state); let response: GetPolicyListResponse; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/reducer.ts b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/reducer.ts similarity index 84% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/reducer.ts rename to x-pack/plugins/siem/public/endpoint_policy/store/policy_list/reducer.ts index ccd3f84dd060c..80e890602c921 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/reducer.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/reducer.ts @@ -4,12 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import { PolicyListState, ImmutableReducer } from '../../types'; -import { AppAction } from '../action'; +import { PolicyListState } from '../../types'; import { isOnPolicyListPage } from './selectors'; -import { Immutable } from '../../../../../common/types'; +import { ImmutableReducer } from '../../../common/store'; +import { AppAction } from '../../../common/store/actions'; +import { Immutable } from '../../../../common/endpoint/types'; -const initialPolicyListState = (): PolicyListState => { +export const initialPolicyListState = (): PolicyListState => { return { policyItems: [], isLoading: false, diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/selectors.ts b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/selectors.ts similarity index 97% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/selectors.ts rename to x-pack/plugins/siem/public/endpoint_policy/store/policy_list/selectors.ts index 4986a342cca19..15516a026ff6b 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/selectors.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/selectors.ts @@ -7,7 +7,7 @@ import { createSelector } from 'reselect'; import { parse } from 'query-string'; import { PolicyListState, PolicyListUrlSearchParams } from '../../types'; -import { Immutable } from '../../../../../common/types'; +import { Immutable } from '../../../../common/endpoint/types'; const PAGE_SIZES = Object.freeze([10, 20, 50]); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/services/ingest.test.ts b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/services/ingest.test.ts similarity index 94% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/services/ingest.test.ts rename to x-pack/plugins/siem/public/endpoint_policy/store/policy_list/services/ingest.test.ts index 46f4c09e05a74..df61bbe893c58 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/services/ingest.test.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/services/ingest.test.ts @@ -5,8 +5,8 @@ */ import { sendGetDatasource, sendGetEndpointSpecificDatasources } from './ingest'; -import { httpServiceMock } from '../../../../../../../../../src/core/public/mocks'; -import { DATASOURCE_SAVED_OBJECT_TYPE } from '../../../../../../../ingest_manager/common'; +import { httpServiceMock } from '../../../../../../../../src/core/public/mocks'; +import { DATASOURCE_SAVED_OBJECT_TYPE } from '../../../../../../ingest_manager/common'; describe('ingest service', () => { let http: ReturnType; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/services/ingest.ts b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/services/ingest.ts similarity index 93% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/services/ingest.ts rename to x-pack/plugins/siem/public/endpoint_policy/store/policy_list/services/ingest.ts index 5c27680d6a35c..312a3f7491ab2 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/services/ingest.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/services/ingest.ts @@ -9,9 +9,9 @@ import { GetDatasourcesRequest, GetAgentStatusResponse, DATASOURCE_SAVED_OBJECT_TYPE, -} from '../../../../../../../ingest_manager/common'; +} from '../../../../../../ingest_manager/common'; import { GetPolicyListResponse, GetPolicyResponse, UpdatePolicyResponse } from '../../../types'; -import { NewPolicyData } from '../../../../../../common/types'; +import { NewPolicyData } from '../../../../../common/endpoint/types'; const INGEST_API_ROOT = `/api/ingest_manager`; export const INGEST_API_DATASOURCES = `${INGEST_API_ROOT}/datasources`; @@ -33,7 +33,7 @@ export const sendGetEndpointSpecificDatasources = ( query: { ...options.query, kuery: `${ - options?.query?.kuery ? options.query.kuery + ' and ' : '' + options?.query?.kuery ? `${options.query.kuery} and ` : '' }${DATASOURCE_SAVED_OBJECT_TYPE}.package.name: endpoint`, }, }); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/test_mock_utils.ts b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/test_mock_utils.ts similarity index 93% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/test_mock_utils.ts rename to x-pack/plugins/siem/public/endpoint_policy/store/policy_list/test_mock_utils.ts index a1788b8f8021d..b8fac21b76a26 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/test_mock_utils.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/store/policy_list/test_mock_utils.ts @@ -6,7 +6,7 @@ import { HttpStart } from 'kibana/public'; import { INGEST_API_DATASOURCES } from './services/ingest'; -import { EndpointDocGenerator } from '../../../../../common/generate_data'; +import { EndpointDocGenerator } from '../../../../common/endpoint/generate_data'; import { GetPolicyListResponse } from '../../types'; const generator = new EndpointDocGenerator('policy-list'); diff --git a/x-pack/plugins/siem/public/endpoint_policy/types.ts b/x-pack/plugins/siem/public/endpoint_policy/types.ts new file mode 100644 index 0000000000000..ba42140589789 --- /dev/null +++ b/x-pack/plugins/siem/public/endpoint_policy/types.ts @@ -0,0 +1,173 @@ +/* + * 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 { + PolicyData, + Immutable, + MalwareFields, + UIPolicyConfig, + AppLocation, +} from '../../common/endpoint/types'; +import { ServerApiError } from '../common/types'; +import { + GetAgentStatusResponse, + GetDatasourcesResponse, + GetOneDatasourceResponse, + UpdateDatasourceResponse, +} from '../../../ingest_manager/common'; + +/** + * Policy list store state + */ +export interface PolicyListState { + /** Array of policy items */ + policyItems: PolicyData[]; + /** API error if loading data failed */ + apiError?: ServerApiError; + /** total number of policies */ + total: number; + /** Number of policies per page */ + pageSize: number; + /** page number (zero based) */ + pageIndex: number; + /** data is being retrieved from server */ + isLoading: boolean; + /** current location information */ + location?: Immutable; +} + +/** + * Policy details store state + */ +export interface PolicyDetailsState { + /** A single policy item */ + policyItem?: PolicyData; + /** API error if loading data failed */ + apiError?: ServerApiError; + isLoading: boolean; + /** current location of the application */ + location?: Immutable; + /** A summary of stats for the agents associated with a given Fleet Agent Configuration */ + agentStatusSummary?: GetAgentStatusResponse['results']; + /** Status of an update to the policy */ + updateStatus?: { + success: boolean; + error?: ServerApiError; + }; +} + +/** + * The URL search params that are supported by the Policy List page view + */ +export interface PolicyListUrlSearchParams { + page_index: number; + page_size: number; +} + +/** + * Endpoint Policy configuration + */ +export interface PolicyConfig { + windows: { + events: { + dll_and_driver_load: boolean; + dns: boolean; + file: boolean; + network: boolean; + process: boolean; + registry: boolean; + security: boolean; + }; + malware: MalwareFields; + logging: { + stdout: string; + file: string; + }; + advanced: PolicyConfigAdvancedOptions; + }; + mac: { + events: { + file: boolean; + process: boolean; + network: boolean; + }; + malware: MalwareFields; + logging: { + stdout: string; + file: string; + }; + advanced: PolicyConfigAdvancedOptions; + }; + linux: { + events: { + file: boolean; + process: boolean; + network: boolean; + }; + logging: { + stdout: string; + file: string; + }; + advanced: PolicyConfigAdvancedOptions; + }; +} + +interface PolicyConfigAdvancedOptions { + elasticsearch: { + indices: { + control: string; + event: string; + logging: string; + }; + kernel: { + connect: boolean; + process: boolean; + }; + }; +} + +export enum OS { + windows = 'windows', + mac = 'mac', + linux = 'linux', +} + +/** + * Returns the keys of an object whose values meet a criteria. + * Ex) interface largeNestedObject = { + * a: { + * food: Foods; + * toiletPaper: true; + * }; + * b: { + * food: Foods; + * streamingServices: Streams; + * }; + * c: {}; + * } + * + * type hasFoods = KeysByValueCriteria; + * The above type will be: [a, b] only, and will not include c. + * + */ +export type KeysByValueCriteria = { + [K in keyof O]: O[K] extends Criteria ? K : never; +}[keyof O]; + +/** Returns an array of the policy OSes that have a malware protection field */ +export type MalwareProtectionOSes = KeysByValueCriteria; + +export interface GetPolicyListResponse extends GetDatasourcesResponse { + items: PolicyData[]; +} + +export interface GetPolicyResponse extends GetOneDatasourceResponse { + item: PolicyData; +} + +export interface UpdatePolicyResponse extends UpdateDatasourceResponse { + item: PolicyData; +} diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/agents_summary.tsx b/x-pack/plugins/siem/public/endpoint_policy/view/agents_summary.tsx similarity index 82% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/policy/agents_summary.tsx rename to x-pack/plugins/siem/public/endpoint_policy/view/agents_summary.tsx index a3e30eb891db4..215e52dedf5d1 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/agents_summary.tsx +++ b/x-pack/plugins/siem/public/endpoint_policy/view/agents_summary.tsx @@ -31,28 +31,28 @@ export const AgentsSummary = memo(props => { return [ { key: 'total', - title: i18n.translate('xpack.endpoint.policyDetails.agentsSummary.totalTitle', { + title: i18n.translate('xpack.siem.endpoint.policyDetails.agentsSummary.totalTitle', { defaultMessage: 'Hosts', }), health: '', }, { key: 'online', - title: i18n.translate('xpack.endpoint.policyDetails.agentsSummary.onlineTitle', { + title: i18n.translate('xpack.siem.endpoint.policyDetails.agentsSummary.onlineTitle', { defaultMessage: 'Online', }), health: 'success', }, { key: 'offline', - title: i18n.translate('xpack.endpoint.policyDetails.agentsSummary.offlineTitle', { + title: i18n.translate('xpack.siem.endpoint.policyDetails.agentsSummary.offlineTitle', { defaultMessage: 'Offline', }), health: 'warning', }, { key: 'error', - title: i18n.translate('xpack.endpoint.policyDetails.agentsSummary.errorTitle', { + title: i18n.translate('xpack.siem.endpoint.policyDetails.agentsSummary.errorTitle', { defaultMessage: 'Error', }), health: 'danger', @@ -86,3 +86,5 @@ export const AgentsSummary = memo(props => { ); }); + +AgentsSummary.displayName = 'AgentsSummary'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/index.ts b/x-pack/plugins/siem/public/endpoint_policy/view/index.ts similarity index 100% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/policy/index.ts rename to x-pack/plugins/siem/public/endpoint_policy/view/index.ts diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_details.test.tsx b/x-pack/plugins/siem/public/endpoint_policy/view/policy_details.test.tsx similarity index 96% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_details.test.tsx rename to x-pack/plugins/siem/public/endpoint_policy/view/policy_details.test.tsx index d780b7bde8af3..35786b568ce11 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_details.test.tsx +++ b/x-pack/plugins/siem/public/endpoint_policy/view/policy_details.test.tsx @@ -6,9 +6,10 @@ import React from 'react'; import { mount } from 'enzyme'; -import { createAppRootMockRenderer } from '../../mocks'; + import { PolicyDetails } from './policy_details'; -import { EndpointDocGenerator } from '../../../../../common/generate_data'; +import { EndpointDocGenerator } from '../../../common/endpoint/generate_data'; +import { createAppRootMockRenderer } from '../../common/mock/endpoint'; describe('Policy Details', () => { type FindReactWrapperResponse = ReturnType['find']>; @@ -57,7 +58,7 @@ describe('Policy Details', () => { if (typeof path === 'string') { // GET datasouce if (path === '/api/ingest_manager/datasources/1') { - asyncActions = asyncActions.then(async (): Promise => await sleep()); + asyncActions = asyncActions.then(async (): Promise => sleep()); return Promise.resolve({ item: policyDatasource, success: true, @@ -66,7 +67,7 @@ describe('Policy Details', () => { // GET Agent status for agent config if (path === '/api/ingest_manager/fleet/agent-status') { - asyncActions = asyncActions.then(async () => await sleep()); + asyncActions = asyncActions.then(async () => sleep()); return Promise.resolve({ results: { events: 0, total: 5, online: 3, error: 1, offline: 1 }, success: true, @@ -160,7 +161,7 @@ describe('Policy Details', () => { 'button[data-test-subj="confirmModalConfirmButton"]' ); http.put.mockImplementation((...args) => { - asyncActions = asyncActions.then(async () => await sleep()); + asyncActions = asyncActions.then(async () => sleep()); const [path] = args; if (typeof path === 'string') { if (path === '/api/ingest_manager/datasources/1') { diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_details.tsx b/x-pack/plugins/siem/public/endpoint_policy/view/policy_details.tsx similarity index 74% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_details.tsx rename to x-pack/plugins/siem/public/endpoint_policy/view/policy_details.tsx index d9bb7eabcf7b0..c928a374502a5 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_details.tsx +++ b/x-pack/plugins/siem/public/endpoint_policy/view/policy_details.tsx @@ -27,15 +27,15 @@ import { updateStatus, isLoading, apiError, -} from '../../store/policy_details/selectors'; -import { PageView, PageViewHeaderTitle } from '../components/page_view'; -import { AppAction } from '../../types'; -import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; +} from '../store/policy_details/selectors'; +import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; import { AgentsSummary } from './agents_summary'; import { VerticalDivider } from './vertical_divider'; import { WindowsEvents, MacEvents, LinuxEvents } from './policy_forms/events'; import { MalwareProtections } from './policy_forms/protections/malware'; -import { useNavigateByRouterEventHandler } from '../hooks/use_navigate_by_router_event_handler'; +import { AppAction } from '../../common/store/actions'; +import { useNavigateByRouterEventHandler } from '../../common/hooks/endpoint/use_navigate_by_router_event_handler'; +import { PageView, PageViewHeaderTitle } from '../../common/components/endpoint/page_view'; export const PolicyDetails = React.memo(() => { const dispatch = useDispatch<(action: AppAction) => void>(); @@ -58,12 +58,12 @@ export const PolicyDetails = React.memo(() => { if (policyUpdateStatus.success) { notifications.toasts.success({ toastLifeTimeMs: 10000, - title: i18n.translate('xpack.endpoint.policy.details.updateSuccessTitle', { + title: i18n.translate('xpack.siem.endpoint.policy.details.updateSuccessTitle', { defaultMessage: 'Success!', }), body: ( @@ -72,7 +72,7 @@ export const PolicyDetails = React.memo(() => { } else { notifications.toasts.danger({ toastLifeTimeMs: 10000, - title: i18n.translate('xpack.endpoint.policy.details.updateErrorTitle', { + title: i18n.translate('xpack.siem.endpoint.policy.details.updateErrorTitle', { defaultMessage: 'Failed!', }), body: <>{policyUpdateStatus.error!.message}, @@ -122,10 +122,10 @@ export const PolicyDetails = React.memo(() => { iconType="arrowLeft" contentProps={{ style: { paddingLeft: '0' } }} onClick={handleBackToListOnClick} - href={services.http.basePath.get() + '/app/endpoint/policy'} + href={`${services.http.basePath.get()}/app/endpoint/policy`} > @@ -136,7 +136,12 @@ export const PolicyDetails = React.memo(() => { const headerRightContent = ( - + @@ -146,7 +151,10 @@ export const PolicyDetails = React.memo(() => { onClick={handleBackToListOnClick} data-test-subj="policyDetailsCancelButton" > - + @@ -157,7 +165,7 @@ export const PolicyDetails = React.memo(() => { onClick={handleSaveOnClick} isLoading={isPolicyLoading} > - + @@ -167,7 +175,7 @@ export const PolicyDetails = React.memo(() => { <> {showConfirm && ( @@ -181,7 +189,7 @@ export const PolicyDetails = React.memo(() => {

@@ -192,7 +200,7 @@ export const PolicyDetails = React.memo(() => {

@@ -208,6 +216,8 @@ export const PolicyDetails = React.memo(() => { ); }); +PolicyDetails.displayName = 'PolicyDetails'; + const ConfirmUpdate = React.memo<{ hostCount: number; onConfirm: () => void; @@ -217,19 +227,19 @@ const ConfirmUpdate = React.memo<{ @@ -255,7 +268,7 @@ const ConfirmUpdate = React.memo<{ )}

@@ -263,3 +276,5 @@ const ConfirmUpdate = React.memo<{
); }); + +ConfirmUpdate.displayName = 'ConfirmUpdate'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/config_form.tsx b/x-pack/plugins/siem/public/endpoint_policy/view/policy_forms/config_form.tsx similarity index 93% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/config_form.tsx rename to x-pack/plugins/siem/public/endpoint_policy/view/policy_forms/config_form.tsx index 341086c7cf75c..a888aa6b4cd6e 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/config_form.tsx +++ b/x-pack/plugins/siem/public/endpoint_policy/view/policy_forms/config_form.tsx @@ -52,7 +52,7 @@ export const ConfigForm: React.FC<{
- +
@@ -65,7 +65,7 @@ export const ConfigForm: React.FC<{
@@ -94,3 +94,5 @@ export const ConfigForm: React.FC<{ ); }); + +ConfigForm.displayName = 'ConfigForm'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/events/checkbox.tsx b/x-pack/plugins/siem/public/endpoint_policy/view/policy_forms/events/checkbox.tsx similarity index 80% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/events/checkbox.tsx rename to x-pack/plugins/siem/public/endpoint_policy/view/policy_forms/events/checkbox.tsx index 74322ac8b993b..9c2e19d0b96c8 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/events/checkbox.tsx +++ b/x-pack/plugins/siem/public/endpoint_policy/view/policy_forms/events/checkbox.tsx @@ -5,13 +5,13 @@ */ import React, { useCallback, useMemo } from 'react'; -import { EuiCheckbox } from '@elastic/eui'; +import { EuiCheckbox, htmlIdGenerator } from '@elastic/eui'; import { useDispatch } from 'react-redux'; -import { htmlIdGenerator } from '@elastic/eui'; + import { usePolicyDetailsSelector } from '../../policy_hooks'; -import { policyConfig } from '../../../../store/policy_details/selectors'; -import { PolicyDetailsAction } from '../../../../store/policy_details'; -import { UIPolicyConfig } from '../../../../../../../common/types'; +import { policyConfig } from '../../../store/policy_details/selectors'; +import { PolicyDetailsAction } from '../../../store/policy_details'; +import { UIPolicyConfig } from '../../../../../common/endpoint/types'; export const EventsCheckbox = React.memo(function({ name, @@ -47,3 +47,5 @@ export const EventsCheckbox = React.memo(function({ /> ); }); + +EventsCheckbox.displayName = 'EventsCheckbox'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/events/index.tsx b/x-pack/plugins/siem/public/endpoint_policy/view/policy_forms/events/index.tsx similarity index 100% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/events/index.tsx rename to x-pack/plugins/siem/public/endpoint_policy/view/policy_forms/events/index.tsx diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/events/linux.tsx b/x-pack/plugins/siem/public/endpoint_policy/view/policy_forms/events/linux.tsx similarity index 74% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/events/linux.tsx rename to x-pack/plugins/siem/public/endpoint_policy/view/policy_forms/events/linux.tsx index c3d6bdba7c852..2b7b247e4276c 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/events/linux.tsx +++ b/x-pack/plugins/siem/public/endpoint_policy/view/policy_forms/events/linux.tsx @@ -9,12 +9,12 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiTitle, EuiText, EuiSpacer } from '@elastic/eui'; import { EventsCheckbox } from './checkbox'; -import { OS } from '../../../../types'; +import { OS } from '../../../types'; import { usePolicyDetailsSelector } from '../../policy_hooks'; -import { selectedLinuxEvents, totalLinuxEvents } from '../../../../store/policy_details/selectors'; +import { selectedLinuxEvents, totalLinuxEvents } from '../../../store/policy_details/selectors'; import { ConfigForm } from '../config_form'; -import { getIn, setIn } from '../../../../models/policy_details_config'; -import { UIPolicyConfig } from '../../../../../../../common/types'; +import { getIn, setIn } from '../../../models/policy_details_config'; +import { UIPolicyConfig } from '../../../../../common/endpoint/types'; export const LinuxEvents = React.memo(() => { const selected = usePolicyDetailsSelector(selectedLinuxEvents); @@ -27,21 +27,21 @@ export const LinuxEvents = React.memo(() => { protectionField: keyof UIPolicyConfig['linux']['events']; }> = [ { - name: i18n.translate('xpack.endpoint.policyDetailsConfig.linux.events.file', { + name: i18n.translate('xpack.siem.endpoint.policyDetailsConfig.linux.events.file', { defaultMessage: 'File', }), os: OS.linux, protectionField: 'file', }, { - name: i18n.translate('xpack.endpoint.policyDetailsConfig.linux.events.process', { + name: i18n.translate('xpack.siem.endpoint.policyDetailsConfig.linux.events.process', { defaultMessage: 'Process', }), os: OS.linux, protectionField: 'process', }, { - name: i18n.translate('xpack.endpoint.policyDetailsConfig.linux.events.network', { + name: i18n.translate('xpack.siem.endpoint.policyDetailsConfig.linux.events.network', { defaultMessage: 'Network', }), os: OS.linux, @@ -53,7 +53,7 @@ export const LinuxEvents = React.memo(() => {
@@ -79,7 +79,7 @@ export const LinuxEvents = React.memo(() => { return ( @@ -89,13 +89,13 @@ export const LinuxEvents = React.memo(() => { return ( { const selected = usePolicyDetailsSelector(selectedMacEvents); @@ -27,21 +27,21 @@ export const MacEvents = React.memo(() => { protectionField: keyof UIPolicyConfig['mac']['events']; }> = [ { - name: i18n.translate('xpack.endpoint.policyDetailsConfig.mac.events.file', { + name: i18n.translate('xpack.siem.endpoint.policyDetailsConfig.mac.events.file', { defaultMessage: 'File', }), os: OS.mac, protectionField: 'file', }, { - name: i18n.translate('xpack.endpoint.policyDetailsConfig.mac.events.process', { + name: i18n.translate('xpack.siem.endpoint.policyDetailsConfig.mac.events.process', { defaultMessage: 'Process', }), os: OS.mac, protectionField: 'process', }, { - name: i18n.translate('xpack.endpoint.policyDetailsConfig.mac.events.network', { + name: i18n.translate('xpack.siem.endpoint.policyDetailsConfig.mac.events.network', { defaultMessage: 'Network', }), os: OS.mac, @@ -53,7 +53,7 @@ export const MacEvents = React.memo(() => {
@@ -79,7 +79,7 @@ export const MacEvents = React.memo(() => { return ( @@ -89,13 +89,15 @@ export const MacEvents = React.memo(() => { return ( diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/events/windows.tsx b/x-pack/plugins/siem/public/endpoint_policy/view/policy_forms/events/windows.tsx similarity index 67% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/events/windows.tsx rename to x-pack/plugins/siem/public/endpoint_policy/view/policy_forms/events/windows.tsx index 9d73f12869058..f95b097d85df3 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_forms/events/windows.tsx +++ b/x-pack/plugins/siem/public/endpoint_policy/view/policy_forms/events/windows.tsx @@ -9,15 +9,12 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiTitle, EuiText, EuiSpacer } from '@elastic/eui'; import { EventsCheckbox } from './checkbox'; -import { OS } from '../../../../types'; +import { OS } from '../../../types'; import { usePolicyDetailsSelector } from '../../policy_hooks'; -import { - selectedWindowsEvents, - totalWindowsEvents, -} from '../../../../store/policy_details/selectors'; +import { selectedWindowsEvents, totalWindowsEvents } from '../../../store/policy_details/selectors'; import { ConfigForm } from '../config_form'; -import { setIn, getIn } from '../../../../models/policy_details_config'; -import { UIPolicyConfig, Immutable } from '../../../../../../../common/types'; +import { setIn, getIn } from '../../../models/policy_details_config'; +import { UIPolicyConfig, Immutable } from '../../../../../common/endpoint/types'; export const WindowsEvents = React.memo(() => { const selected = usePolicyDetailsSelector(selectedWindowsEvents); @@ -30,49 +27,52 @@ export const WindowsEvents = React.memo(() => { protectionField: keyof UIPolicyConfig['windows']['events']; }>> = [ { - name: i18n.translate('xpack.endpoint.policyDetailsConfig.windows.events.dllDriverLoad', { - defaultMessage: 'DLL and Driver Load', - }), + name: i18n.translate( + 'xpack.siem.endpoint.policyDetailsConfig.windows.events.dllDriverLoad', + { + defaultMessage: 'DLL and Driver Load', + } + ), os: OS.windows, protectionField: 'dll_and_driver_load', }, { - name: i18n.translate('xpack.endpoint.policyDetailsConfig.windows.events.dns', { + name: i18n.translate('xpack.siem.endpoint.policyDetailsConfig.windows.events.dns', { defaultMessage: 'DNS', }), os: OS.windows, protectionField: 'dns', }, { - name: i18n.translate('xpack.endpoint.policyDetailsConfig.windows.events.file', { + name: i18n.translate('xpack.siem.endpoint.policyDetailsConfig.windows.events.file', { defaultMessage: 'File', }), os: OS.windows, protectionField: 'file', }, { - name: i18n.translate('xpack.endpoint.policyDetailsConfig.windows.events.network', { + name: i18n.translate('xpack.siem.endpoint.policyDetailsConfig.windows.events.network', { defaultMessage: 'Network', }), os: OS.windows, protectionField: 'network', }, { - name: i18n.translate('xpack.endpoint.policyDetailsConfig.windows.events.process', { + name: i18n.translate('xpack.siem.endpoint.policyDetailsConfig.windows.events.process', { defaultMessage: 'Process', }), os: OS.windows, protectionField: 'process', }, { - name: i18n.translate('xpack.endpoint.policyDetailsConfig.windows.events.registry', { + name: i18n.translate('xpack.siem.endpoint.policyDetailsConfig.windows.events.registry', { defaultMessage: 'Registry', }), os: OS.windows, protectionField: 'registry', }, { - name: i18n.translate('xpack.endpoint.policyDetailsConfig.windows.events.security', { + name: i18n.translate('xpack.siem.endpoint.policyDetailsConfig.windows.events.security', { defaultMessage: 'Security', }), os: OS.windows, @@ -84,7 +84,7 @@ export const WindowsEvents = React.memo(() => {
@@ -110,7 +110,7 @@ export const WindowsEvents = React.memo(() => { return ( @@ -120,13 +120,13 @@ export const WindowsEvents = React.memo(() => { return ( { return [ { id: ProtectionModes.detect, - label: i18n.translate('xpack.endpoint.policy.details.detect', { defaultMessage: 'Detect' }), + label: i18n.translate('xpack.siem.endpoint.policy.details.detect', { + defaultMessage: 'Detect', + }), protection: 'malware', }, { id: ProtectionModes.prevent, - label: i18n.translate('xpack.endpoint.policy.details.prevent', { + label: i18n.translate('xpack.siem.endpoint.policy.details.prevent', { defaultMessage: 'Prevent', }), protection: 'malware', }, { id: ProtectionModes.preventNotify, - label: i18n.translate('xpack.endpoint.policy.details.preventAndNotify', { + label: i18n.translate('xpack.siem.endpoint.policy.details.preventAndNotify', { defaultMessage: 'Prevent and notify user', }), protection: 'malware', @@ -129,7 +133,7 @@ export const MalwareProtections = React.memo(() => {
@@ -153,7 +157,7 @@ export const MalwareProtections = React.memo(() => { const protectionSwitch = useMemo(() => { return ( { return ( { ); }); + +MalwareProtections.displayName = 'MalwareProtections'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_hooks.ts b/x-pack/plugins/siem/public/endpoint_policy/view/policy_hooks.ts similarity index 63% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_hooks.ts rename to x-pack/plugins/siem/public/endpoint_policy/view/policy_hooks.ts index 5bfce15d680bf..9fadba85c5245 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_hooks.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/view/policy_hooks.ts @@ -5,14 +5,15 @@ */ import { useSelector } from 'react-redux'; -import { GlobalState, PolicyListState, PolicyDetailsState } from '../../types'; +import { PolicyListState, PolicyDetailsState } from '../types'; +import { State } from '../../common/store'; export function usePolicyListSelector(selector: (state: PolicyListState) => TSelected) { - return useSelector((state: GlobalState) => selector(state.policyList)); + return useSelector((state: State) => selector(state.policyList as PolicyListState)); } export function usePolicyDetailsSelector( selector: (state: PolicyDetailsState) => TSelected ) { - return useSelector((state: GlobalState) => selector(state.policyDetails)); + return useSelector((state: State) => selector(state.policyDetails as PolicyDetailsState)); } diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_list.tsx b/x-pack/plugins/siem/public/endpoint_policy/view/policy_list.tsx similarity index 79% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_list.tsx rename to x-pack/plugins/siem/public/endpoint_policy/view/policy_list.tsx index 39529e7c11ab1..a9aea57239ed1 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/policy_list.tsx +++ b/x-pack/plugins/siem/public/endpoint_policy/view/policy_list.tsx @@ -9,7 +9,7 @@ import { EuiBasicTable, EuiText, EuiTableFieldDataColumnType, EuiLink } from '@e import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { useDispatch } from 'react-redux'; -import { useHistory, useLocation } from 'react-router-dom'; +import { useLocation, useHistory } from 'react-router-dom'; import { selectApiError, selectIsLoading, @@ -17,14 +17,14 @@ import { selectPageSize, selectPolicyItems, selectTotal, -} from '../../store/policy_list/selectors'; +} from '../store/policy_list/selectors'; import { usePolicyListSelector } from './policy_hooks'; -import { PolicyListAction } from '../../store/policy_list'; -import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; -import { PageView } from '../components/page_view'; -import { LinkToApp } from '../components/link_to_app'; -import { Immutable, PolicyData } from '../../../../../common/types'; -import { useNavigateByRouterEventHandler } from '../hooks/use_navigate_by_router_event_handler'; +import { PolicyListAction } from '../store/policy_list'; +import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; +import { Immutable, PolicyData } from '../../../common/endpoint/types'; +import { useNavigateByRouterEventHandler } from '../../common/hooks/endpoint/use_navigate_by_router_event_handler'; +import { PageView } from '../../common/components/endpoint/page_view'; +import { LinkToApp } from '../../common/components/endpoint/link_to_app'; interface TableChangeCallbackArguments { page: { index: number; size: number }; @@ -88,9 +88,10 @@ export const PolicyList = React.memo(() => { () => [ { field: 'name', - name: i18n.translate('xpack.endpoint.policyList.nameField', { + name: i18n.translate('xpack.siem.endpoint.policyList.nameField', { defaultMessage: 'Policy Name', }), + // eslint-disable-next-line react/display-name render: (value: string, item: Immutable) => { const routeUri = `/policy/${item.id}`; return ( @@ -105,14 +106,14 @@ export const PolicyList = React.memo(() => { }, { field: 'revision', - name: i18n.translate('xpack.endpoint.policyList.revisionField', { + name: i18n.translate('xpack.siem.endpoint.policyList.revisionField', { defaultMessage: 'Revision', }), dataType: 'number', }, { field: 'package', - name: i18n.translate('xpack.endpoint.policyList.versionField', { + name: i18n.translate('xpack.siem.endpoint.policyList.versionField', { defaultMessage: 'Version', }), render(pkg) { @@ -121,14 +122,14 @@ export const PolicyList = React.memo(() => { }, { field: 'description', - name: i18n.translate('xpack.endpoint.policyList.descriptionField', { + name: i18n.translate('xpack.siem.endpoint.policyList.descriptionField', { defaultMessage: 'Description', }), truncateText: true, }, { field: 'config_id', - name: i18n.translate('xpack.endpoint.policyList.agentConfigField', { + name: i18n.translate('xpack.siem.endpoint.policyList.agentConfigField', { defaultMessage: 'Agent Configuration', }), render(version: string) { @@ -152,13 +153,13 @@ export const PolicyList = React.memo(() => { @@ -176,3 +177,5 @@ export const PolicyList = React.memo(() => { ); }); + +PolicyList.displayName = 'PolicyList'; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/vertical_divider.ts b/x-pack/plugins/siem/public/endpoint_policy/view/vertical_divider.ts similarity index 91% rename from x-pack/plugins/endpoint/public/applications/endpoint/view/policy/vertical_divider.ts rename to x-pack/plugins/siem/public/endpoint_policy/view/vertical_divider.ts index c73f6f12bec82..918e94cb5b412 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/policy/vertical_divider.ts +++ b/x-pack/plugins/siem/public/endpoint_policy/view/vertical_divider.ts @@ -5,7 +5,7 @@ */ import styled from 'styled-components'; -import { EuiTheme } from '../../../../../../../legacy/common/eui_styled_components'; +import { EuiTheme } from '../../../../../legacy/common/eui_styled_components'; type SpacingOptions = keyof EuiTheme['eui']['spacerSizes']; diff --git a/x-pack/plugins/siem/public/graphql/introspection.json b/x-pack/plugins/siem/public/graphql/introspection.json index d6f34255bcc1c..3c8c7c21d72a0 100644 --- a/x-pack/plugins/siem/public/graphql/introspection.json +++ b/x-pack/plugins/siem/public/graphql/introspection.json @@ -253,7 +253,7 @@ { "name": "timelineType", "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, + "type": { "kind": "ENUM", "name": "TimelineType", "ofType": null }, "defaultValue": null } ], @@ -9726,6 +9726,14 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "status", + "description": "", + "args": [], + "type": { "kind": "ENUM", "name": "TimelineStatus", "ofType": null }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "title", "description": "", @@ -10353,6 +10361,19 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "ENUM", + "name": "TimelineStatus", + "description": "", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { "name": "active", "description": "", "isDeprecated": false, "deprecationReason": null }, + { "name": "draft", "description": "", "isDeprecated": false, "deprecationReason": null } + ], + "possibleTypes": null + }, { "kind": "SCALAR", "name": "Int", @@ -10377,7 +10398,6 @@ "isDeprecated": false, "deprecationReason": null }, - { "name": "draft", "description": "", "isDeprecated": false, "deprecationReason": null }, { "name": "template", "description": "", @@ -10962,6 +10982,12 @@ "description": "", "type": { "kind": "INPUT_OBJECT", "name": "SortTimelineInput", "ofType": null }, "defaultValue": null + }, + { + "name": "status", + "description": "", + "type": { "kind": "ENUM", "name": "TimelineStatus", "ofType": null }, + "defaultValue": null } ], "interfaces": null, diff --git a/x-pack/plugins/siem/public/graphql/types.ts b/x-pack/plugins/siem/public/graphql/types.ts index c3493c580fa22..eae3887ec0636 100644 --- a/x-pack/plugins/siem/public/graphql/types.ts +++ b/x-pack/plugins/siem/public/graphql/types.ts @@ -143,6 +143,8 @@ export interface TimelineInput { savedQueryId?: Maybe; sort?: Maybe; + + status?: Maybe; } export interface ColumnHeaderInput { @@ -340,9 +342,13 @@ export enum TlsFields { _id = '_id', } +export enum TimelineStatus { + active = 'active', + draft = 'draft', +} + export enum TimelineType { default = 'default', - draft = 'draft', template = 'template', } @@ -1954,6 +1960,8 @@ export interface TimelineResult { sort?: Maybe; + status?: Maybe; + title?: Maybe; templateTimelineId?: Maybe; @@ -2237,7 +2245,7 @@ export interface GetAllTimelineQueryArgs { onlyUserFavorite?: Maybe; - timelineType?: Maybe; + timelineType?: Maybe; } export interface AuthenticationsSourceArgs { timerange: TimerangeInput; @@ -4298,7 +4306,7 @@ export namespace GetAllTimeline { search?: Maybe; sort?: Maybe; onlyUserFavorite?: Maybe; - timelineType?: Maybe; + timelineType?: Maybe; }; export type Query = { diff --git a/x-pack/plugins/siem/public/index.ts b/x-pack/plugins/siem/public/index.ts index 46f72c1fa17c8..36344a25e1568 100644 --- a/x-pack/plugins/siem/public/index.ts +++ b/x-pack/plugins/siem/public/index.ts @@ -5,7 +5,8 @@ */ import { PluginInitializerContext } from '../../../../src/core/public'; -import { Plugin, PluginSetup, PluginStart } from './plugin'; +import { Plugin } from './plugin'; +import { PluginSetup, PluginStart } from './types'; export const plugin = (context: PluginInitializerContext): Plugin => new Plugin(context); diff --git a/x-pack/plugins/siem/public/plugin.tsx b/x-pack/plugins/siem/public/plugin.tsx index cc46025ddc4a6..9bea776220720 100644 --- a/x-pack/plugins/siem/public/plugin.tsx +++ b/x-pack/plugins/siem/public/plugin.tsx @@ -14,51 +14,12 @@ import { Plugin as IPlugin, DEFAULT_APP_CATEGORIES, } from '../../../../src/core/public'; -import { - HomePublicPluginSetup, - FeatureCatalogueCategory, -} from '../../../../src/plugins/home/public'; -import { DataPublicPluginStart } from '../../../../src/plugins/data/public'; -import { EmbeddableStart } from '../../../../src/plugins/embeddable/public'; -import { Start as NewsfeedStart } from '../../../../src/plugins/newsfeed/public'; -import { Start as InspectorStart } from '../../../../src/plugins/inspector/public'; -import { UiActionsStart } from '../../../../src/plugins/ui_actions/public'; -import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/public'; -import { - TriggersAndActionsUIPublicPluginSetup as TriggersActionsSetup, - TriggersAndActionsUIPublicPluginStart as TriggersActionsStart, -} from '../../triggers_actions_ui/public'; -import { SecurityPluginSetup } from '../../security/public'; -import { APP_ID, APP_NAME, APP_PATH, APP_ICON } from '../common/constants'; +import { FeatureCatalogueCategory } from '../../../../src/plugins/home/public'; import { initTelemetry } from './common/lib/telemetry'; import { KibanaServices } from './common/lib/kibana/services'; import { serviceNowActionType, jiraActionType } from './common/lib/connectors'; - -export interface SetupPlugins { - home: HomePublicPluginSetup; - security: SecurityPluginSetup; - triggers_actions_ui: TriggersActionsSetup; - usageCollection?: UsageCollectionSetup; -} - -export interface StartPlugins { - data: DataPublicPluginStart; - embeddable: EmbeddableStart; - inspector: InspectorStart; - newsfeed?: NewsfeedStart; - triggers_actions_ui: TriggersActionsStart; - uiActions: UiActionsStart; -} - -export type StartServices = CoreStart & - StartPlugins & { - security: SecurityPluginSetup; - }; - -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface PluginSetup {} -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface PluginStart {} +import { PluginSetup, PluginStart, SetupPlugins, StartPlugins, StartServices } from './types'; +import { APP_ID, APP_NAME, APP_ICON, APP_PATH } from '../common/constants'; export class Plugin implements IPlugin { private kibanaVersion: string; @@ -102,6 +63,14 @@ export class Plugin implements IPlugin { describe('eventType', () => { diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/models/process_event.ts b/x-pack/plugins/siem/public/resolver/models/process_event.ts similarity index 95% rename from x-pack/plugins/endpoint/public/embeddables/resolver/models/process_event.ts rename to x-pack/plugins/siem/public/resolver/models/process_event.ts index a709d6caf46cb..038e5b90b2170 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/models/process_event.ts +++ b/x-pack/plugins/siem/public/resolver/models/process_event.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ResolverEvent } from '../../../../common/types'; -import * as event from '../../../../common/models/event'; +import * as event from '../../../common/endpoint/models/event'; +import { ResolverEvent } from '../../../common/endpoint/types'; import { ResolverProcessType } from '../types'; /** diff --git a/x-pack/plugins/siem/public/resolver/models/process_event_test_helpers.ts b/x-pack/plugins/siem/public/resolver/models/process_event_test_helpers.ts new file mode 100644 index 0000000000000..be0895dbec4fe --- /dev/null +++ b/x-pack/plugins/siem/public/resolver/models/process_event_test_helpers.ts @@ -0,0 +1,42 @@ +/* + * 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 { defaults } from 'lodash/fp'; +import { LegacyEndpointEvent } from '../../../common/endpoint/types'; + +type DeepPartial = { [K in keyof T]?: DeepPartial }; +/** + * Creates a mock process event given the 'parts' argument, which can + * include all or some process event fields as determined by the ProcessEvent type. + * The only field that must be provided is the event's 'node_id' field. + * The other fields are populated by the function unless provided in 'parts' + */ +export function mockProcessEvent(parts: DeepPartial): LegacyEndpointEvent { + return defaults( + { + endgame: { + event_timestamp: 1, + event_type: 1, + unique_ppid: 0, + unique_pid: 1, + machine_id: '', + event_subtype_full: 'creation_event', + event_type_full: 'process_event', + process_name: '', + process_path: '', + timestamp_utc: '', + serial_event_id: 1, + }, + '@timestamp': 1582233383000, + agent: { + type: '', + id: '', + version: '', + }, + }, + parts + ); +} diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/actions.ts b/x-pack/plugins/siem/public/resolver/store/actions.ts similarity index 98% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/actions.ts rename to x-pack/plugins/siem/public/resolver/store/actions.ts index 462f6e251d5d0..0963118ce14b8 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/store/actions.ts +++ b/x-pack/plugins/siem/public/resolver/store/actions.ts @@ -5,7 +5,7 @@ */ import { CameraAction } from './camera'; import { DataAction } from './data'; -import { ResolverEvent } from '../../../../common/types'; +import { ResolverEvent } from '../../../common/endpoint/types'; /** * When the user wants to bring a process node front-and-center on the map. diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/action.ts b/x-pack/plugins/siem/public/resolver/store/camera/action.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/action.ts rename to x-pack/plugins/siem/public/resolver/store/camera/action.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/animation.test.ts b/x-pack/plugins/siem/public/resolver/store/camera/animation.test.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/animation.test.ts rename to x-pack/plugins/siem/public/resolver/store/camera/animation.test.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/index.ts b/x-pack/plugins/siem/public/resolver/store/camera/index.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/index.ts rename to x-pack/plugins/siem/public/resolver/store/camera/index.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/inverse_projection_matrix.test.ts b/x-pack/plugins/siem/public/resolver/store/camera/inverse_projection_matrix.test.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/inverse_projection_matrix.test.ts rename to x-pack/plugins/siem/public/resolver/store/camera/inverse_projection_matrix.test.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/methods.ts b/x-pack/plugins/siem/public/resolver/store/camera/methods.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/methods.ts rename to x-pack/plugins/siem/public/resolver/store/camera/methods.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/panning.test.ts b/x-pack/plugins/siem/public/resolver/store/camera/panning.test.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/panning.test.ts rename to x-pack/plugins/siem/public/resolver/store/camera/panning.test.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/projection_matrix.test.ts b/x-pack/plugins/siem/public/resolver/store/camera/projection_matrix.test.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/projection_matrix.test.ts rename to x-pack/plugins/siem/public/resolver/store/camera/projection_matrix.test.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/reducer.ts b/x-pack/plugins/siem/public/resolver/store/camera/reducer.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/reducer.ts rename to x-pack/plugins/siem/public/resolver/store/camera/reducer.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/scale_to_zoom.ts b/x-pack/plugins/siem/public/resolver/store/camera/scale_to_zoom.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/scale_to_zoom.ts rename to x-pack/plugins/siem/public/resolver/store/camera/scale_to_zoom.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/scaling_constants.ts b/x-pack/plugins/siem/public/resolver/store/camera/scaling_constants.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/scaling_constants.ts rename to x-pack/plugins/siem/public/resolver/store/camera/scaling_constants.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/selectors.ts b/x-pack/plugins/siem/public/resolver/store/camera/selectors.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/selectors.ts rename to x-pack/plugins/siem/public/resolver/store/camera/selectors.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/test_helpers.ts b/x-pack/plugins/siem/public/resolver/store/camera/test_helpers.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/test_helpers.ts rename to x-pack/plugins/siem/public/resolver/store/camera/test_helpers.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/zooming.test.ts b/x-pack/plugins/siem/public/resolver/store/camera/zooming.test.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/camera/zooming.test.ts rename to x-pack/plugins/siem/public/resolver/store/camera/zooming.test.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/data/__snapshots__/graphing.test.ts.snap b/x-pack/plugins/siem/public/resolver/store/data/__snapshots__/graphing.test.ts.snap similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/data/__snapshots__/graphing.test.ts.snap rename to x-pack/plugins/siem/public/resolver/store/data/__snapshots__/graphing.test.ts.snap diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/data/action.ts b/x-pack/plugins/siem/public/resolver/store/data/action.ts similarity index 94% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/data/action.ts rename to x-pack/plugins/siem/public/resolver/store/data/action.ts index 8c84d8f82b874..f6ef7b16ae682 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/store/data/action.ts +++ b/x-pack/plugins/siem/public/resolver/store/data/action.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ResolverEvent } from '../../../../../common/types'; +import { ResolverEvent } from '../../../../common/endpoint/types'; import { RelatedEventDataEntry } from '../../types'; interface ServerReturnedResolverData { diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/data/graphing.test.ts b/x-pack/plugins/siem/public/resolver/store/data/graphing.test.ts similarity index 99% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/data/graphing.test.ts rename to x-pack/plugins/siem/public/resolver/store/data/graphing.test.ts index f95ecc63d2a66..69edf3b4c134d 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/store/data/graphing.test.ts +++ b/x-pack/plugins/siem/public/resolver/store/data/graphing.test.ts @@ -8,7 +8,7 @@ import { Store, createStore } from 'redux'; import { DataAction } from './action'; import { dataReducer } from './reducer'; import { DataState } from '../../types'; -import { LegacyEndpointEvent, ResolverEvent } from '../../../../../common/types'; +import { LegacyEndpointEvent, ResolverEvent } from '../../../../common/endpoint/types'; import { graphableProcesses, processNodePositionsAndEdgeLineSegments } from './selectors'; import { mockProcessEvent } from '../../models/process_event_test_helpers'; diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/data/index.ts b/x-pack/plugins/siem/public/resolver/store/data/index.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/data/index.ts rename to x-pack/plugins/siem/public/resolver/store/data/index.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/data/reducer.ts b/x-pack/plugins/siem/public/resolver/store/data/reducer.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/data/reducer.ts rename to x-pack/plugins/siem/public/resolver/store/data/reducer.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/data/sample.ts b/x-pack/plugins/siem/public/resolver/store/data/sample.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/data/sample.ts rename to x-pack/plugins/siem/public/resolver/store/data/sample.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/data/selectors.test.ts b/x-pack/plugins/siem/public/resolver/store/data/selectors.test.ts similarity index 95% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/data/selectors.test.ts rename to x-pack/plugins/siem/public/resolver/store/data/selectors.test.ts index 561b0da12bcb1..f6d2b978d6b4d 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/store/data/selectors.test.ts +++ b/x-pack/plugins/siem/public/resolver/store/data/selectors.test.ts @@ -1,59 +1,59 @@ -/* - * 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 { Store, createStore } from 'redux'; -import { DataAction } from './action'; -import { dataReducer } from './reducer'; -import { - DataState, - RelatedEventDataEntry, - RelatedEventDataEntryWithStats, - RelatedEventData, -} from '../../types'; -import { ResolverEvent } from '../../../../../common/types'; -import { relatedEventStats, relatedEvents } from './selectors'; - -describe('resolver data selectors', () => { - const store: Store = createStore(dataReducer, undefined); - describe('when related event data is reduced into state with no results', () => { - let relatedEventInfoBeforeAction: RelatedEventData; - beforeEach(() => { - relatedEventInfoBeforeAction = new Map(relatedEvents(store.getState()) || []); - const payload: Map = new Map(); - const action: DataAction = { type: 'serverReturnedRelatedEventData', payload }; - store.dispatch(action); - }); - it('should have the same related info as before the action', () => { - const relatedInfoAfterAction = relatedEvents(store.getState()); - expect(relatedInfoAfterAction).toEqual(relatedEventInfoBeforeAction); - }); - }); - describe('when related event data is reduced into state with 2 dns results', () => { - let mockBaseEvent: ResolverEvent; - beforeEach(() => { - mockBaseEvent = {} as ResolverEvent; - function dnsRelatedEventEntry() { - const fakeEvent = {} as ResolverEvent; - return { relatedEvent: fakeEvent, relatedEventType: 'dns' }; - } - const payload: Map = new Map([ - [ - mockBaseEvent, - { - relatedEvents: [dnsRelatedEventEntry(), dnsRelatedEventEntry()], - }, - ], - ]); - const action: DataAction = { type: 'serverReturnedRelatedEventData', payload }; - store.dispatch(action); - }); - it('should compile stats reflecting a count of 2 for dns', () => { - const actualStats = relatedEventStats(store.getState()); - const statsForFakeEvent = actualStats.get(mockBaseEvent)! as RelatedEventDataEntryWithStats; - expect(statsForFakeEvent.stats).toEqual({ dns: 2 }); - }); - }); -}); +/* + * 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 { Store, createStore } from 'redux'; +import { DataAction } from './action'; +import { dataReducer } from './reducer'; +import { + DataState, + RelatedEventDataEntry, + RelatedEventDataEntryWithStats, + RelatedEventData, +} from '../../types'; +import { ResolverEvent } from '../../../../common/endpoint/types'; +import { relatedEventStats, relatedEvents } from './selectors'; + +describe('resolver data selectors', () => { + const store: Store = createStore(dataReducer, undefined); + describe('when related event data is reduced into state with no results', () => { + let relatedEventInfoBeforeAction: RelatedEventData; + beforeEach(() => { + relatedEventInfoBeforeAction = new Map(relatedEvents(store.getState()) || []); + const payload: Map = new Map(); + const action: DataAction = { type: 'serverReturnedRelatedEventData', payload }; + store.dispatch(action); + }); + it('should have the same related info as before the action', () => { + const relatedInfoAfterAction = relatedEvents(store.getState()); + expect(relatedInfoAfterAction).toEqual(relatedEventInfoBeforeAction); + }); + }); + describe('when related event data is reduced into state with 2 dns results', () => { + let mockBaseEvent: ResolverEvent; + beforeEach(() => { + mockBaseEvent = {} as ResolverEvent; + function dnsRelatedEventEntry() { + const fakeEvent = {} as ResolverEvent; + return { relatedEvent: fakeEvent, relatedEventType: 'dns' }; + } + const payload: Map = new Map([ + [ + mockBaseEvent, + { + relatedEvents: [dnsRelatedEventEntry(), dnsRelatedEventEntry()], + }, + ], + ]); + const action: DataAction = { type: 'serverReturnedRelatedEventData', payload }; + store.dispatch(action); + }); + it('should compile stats reflecting a count of 2 for dns', () => { + const actualStats = relatedEventStats(store.getState()); + const statsForFakeEvent = actualStats.get(mockBaseEvent)! as RelatedEventDataEntryWithStats; + expect(statsForFakeEvent.stats).toEqual({ dns: 2 }); + }); + }); +}); diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/data/selectors.ts b/x-pack/plugins/siem/public/resolver/store/data/selectors.ts similarity index 99% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/data/selectors.ts rename to x-pack/plugins/siem/public/resolver/store/data/selectors.ts index 413f4db1cc99e..ec6e937e03d9a 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/store/data/selectors.ts +++ b/x-pack/plugins/siem/public/resolver/store/data/selectors.ts @@ -14,11 +14,12 @@ import { ProcessWithWidthMetadata, Matrix3, AdjacentProcessMap, + Vector2, RelatedEventData, RelatedEventDataEntryWithStats, } from '../../types'; -import { ResolverEvent } from '../../../../../common/types'; -import { Vector2 } from '../../types'; +import { ResolverEvent } from '../../../../common/endpoint/types'; + import { add as vector2Add, applyMatrix3 } from '../../lib/vector2'; import { isGraphableProcess, uniquePidForProcess } from '../../models/process_event'; import { @@ -160,6 +161,7 @@ function processEdgeLineSegments( * We only handle children, drawing lines back to their parents. The root has no parent, so we skip it */ if (metadata.parent === null) { + // eslint-disable-next-line no-continue continue; } const { process, parent, parentWidth } = metadata; @@ -435,6 +437,7 @@ export const relatedEventStats = createSelector(relatedEventResults, function ge if (newStatsEntry === 'error') { // If the entry is an error, return it as is relatedEventStats.set(updatedEvent, newStatsEntry); + // eslint-disable-next-line no-continue continue; } if (typeof newStatsEntry === 'object') { diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/index.ts b/x-pack/plugins/siem/public/resolver/store/index.ts similarity index 82% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/index.ts rename to x-pack/plugins/siem/public/resolver/store/index.ts index 2a20c73347348..203ecccb1d369 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/store/index.ts +++ b/x-pack/plugins/siem/public/resolver/store/index.ts @@ -6,14 +6,14 @@ import { createStore, applyMiddleware, Store } from 'redux'; import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly'; -import { KibanaReactContextValue } from '../../../../../../../src/plugins/kibana_react/public'; +import { KibanaReactContextValue } from '../../../../../../src/plugins/kibana_react/public'; import { ResolverAction, ResolverState } from '../types'; -import { EndpointPluginServices } from '../../../plugin'; +import { StartServices } from '../../types'; import { resolverReducer } from './reducer'; import { resolverMiddlewareFactory } from './middleware'; export const storeFactory = ( - context?: KibanaReactContextValue + context?: KibanaReactContextValue ): { store: Store } => { const actionsBlacklist: Array = ['userMovedPointer']; const composeEnhancers = composeWithDevTools({ diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/methods.ts b/x-pack/plugins/siem/public/resolver/store/methods.ts similarity index 93% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/methods.ts rename to x-pack/plugins/siem/public/resolver/store/methods.ts index f15307a662388..3890770259156 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/store/methods.ts +++ b/x-pack/plugins/siem/public/resolver/store/methods.ts @@ -7,7 +7,7 @@ import { animatePanning } from './camera/methods'; import { processNodePositionsAndEdgeLineSegments } from './selectors'; import { ResolverState } from '../types'; -import { ResolverEvent } from '../../../../common/types'; +import { ResolverEvent } from '../../../common/endpoint/types'; const animationDuration = 1000; diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/middleware.ts b/x-pack/plugins/siem/public/resolver/store/middleware.ts similarity index 93% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/middleware.ts rename to x-pack/plugins/siem/public/resolver/store/middleware.ts index 06758022b05c5..f0d89e7bb5d5c 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/store/middleware.ts +++ b/x-pack/plugins/siem/public/resolver/store/middleware.ts @@ -6,14 +6,14 @@ import { Dispatch, MiddlewareAPI } from 'redux'; import { HttpHandler } from 'kibana/public'; -import { KibanaReactContextValue } from '../../../../../../../src/plugins/kibana_react/public'; -import { EndpointPluginServices } from '../../../plugin'; +import { KibanaReactContextValue } from '../../../../../../src/plugins/kibana_react/public'; +import { StartServices } from '../../types'; import { ResolverState, ResolverAction, RelatedEventDataEntry } from '../types'; -import { ResolverEvent, ResolverNode } from '../../../../common/types'; -import * as event from '../../../../common/models/event'; +import { ResolverEvent, ResolverNode } from '../../../common/endpoint/types'; +import * as event from '../../../common/endpoint/models/event'; type MiddlewareFactory = ( - context?: KibanaReactContextValue + context?: KibanaReactContextValue ) => ( api: MiddlewareAPI, S> ) => (next: Dispatch) => (action: ResolverAction) => unknown; @@ -124,6 +124,7 @@ export const resolverMiddlewareFactory: MiddlewareFactory = context => { type: 'serverFailedToReturnRelatedEventData', payload: results[0], }); + // eslint-disable-next-line no-continue continue; } diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/reducer.ts b/x-pack/plugins/siem/public/resolver/store/reducer.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/reducer.ts rename to x-pack/plugins/siem/public/resolver/store/reducer.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/selectors.ts b/x-pack/plugins/siem/public/resolver/store/selectors.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/selectors.ts rename to x-pack/plugins/siem/public/resolver/store/selectors.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/ui/selectors.ts b/x-pack/plugins/siem/public/resolver/store/ui/selectors.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/store/ui/selectors.ts rename to x-pack/plugins/siem/public/resolver/store/ui/selectors.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/types.ts b/x-pack/plugins/siem/public/resolver/types.ts similarity index 98% rename from x-pack/plugins/endpoint/public/embeddables/resolver/types.ts rename to x-pack/plugins/siem/public/resolver/types.ts index 32fefba8f0f20..e93a7856557cc 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/types.ts +++ b/x-pack/plugins/siem/public/resolver/types.ts @@ -8,8 +8,8 @@ import { Store } from 'redux'; import { ResolverAction } from './store/actions'; export { ResolverAction } from './store/actions'; -import { ResolverEvent } from '../../../common/types'; -import { eventType } from '../../../common/models/event'; +import { ResolverEvent } from '../../common/endpoint/types'; +import { eventType } from '../../common/endpoint/models/event'; /** * Redux state for the Resolver feature. Properties on this interface are populated via multiple reducers using redux's `combineReducers`. diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/defs.tsx b/x-pack/plugins/siem/public/resolver/view/defs.tsx similarity index 95% rename from x-pack/plugins/endpoint/public/embeddables/resolver/view/defs.tsx rename to x-pack/plugins/siem/public/resolver/view/defs.tsx index 064645019ca34..d70ee7bc23587 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/view/defs.tsx +++ b/x-pack/plugins/siem/public/resolver/view/defs.tsx @@ -150,6 +150,8 @@ const PaintServers = memo(() => ( )); +PaintServers.displayName = 'PaintServers'; + /** * Ids of symbols to be linked by elements */ @@ -183,7 +185,7 @@ const SymbolsAndShapes = memo(() => ( /> - Running Process + {'Running Process'} ( /> - resolver_dark process running + {'resolver_dark process running'} ( /> - Terminated Process + {'Terminated Process'} ( - Terminated Trigger Process + {'Terminated Trigger Process'} ( - resolver active backing + {'resolver active backing'} ( )); +SymbolsAndShapes.displayName = 'SymbolsAndShapes'; + /** * This `` element is used to define the reusable assets for the Resolver * It confers several advantages, including but not limited to: @@ -379,16 +383,18 @@ const SymbolsAndShapes = memo(() => ( * 2. Separation of concerns between creative assets and more functional areas of the app * 3. `` elements can be handled by compositor (faster) */ -export const SymbolDefinitions = styled( - memo(({ className }: { className?: string }) => ( - - - - - - - )) -)` +const SymbolDefinitionsComponent = memo(({ className }: { className?: string }) => ( + + + + + + +)); + +SymbolDefinitionsComponent.displayName = 'SymbolDefinitions'; + +export const SymbolDefinitions = styled(SymbolDefinitionsComponent)` position: absolute; left: 100%; top: 100%; diff --git a/x-pack/plugins/siem/public/resolver/view/edge_line.tsx b/x-pack/plugins/siem/public/resolver/view/edge_line.tsx new file mode 100644 index 0000000000000..2192422b7d31d --- /dev/null +++ b/x-pack/plugins/siem/public/resolver/view/edge_line.tsx @@ -0,0 +1,80 @@ +/* + * 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 from 'react'; +import styled from 'styled-components'; +import { applyMatrix3, distance, angle } from '../lib/vector2'; +import { Vector2, Matrix3 } from '../types'; + +/** + * A placeholder line segment view that connects process nodes. + */ +const EdgeLineComponent = React.memo( + ({ + className, + startPosition, + endPosition, + projectionMatrix, + }: { + /** + * A className string provided by `styled` + */ + className?: string; + /** + * The postion of first point in the line segment. In 'world' coordinates. + */ + startPosition: Vector2; + /** + * The postion of second point in the line segment. In 'world' coordinates. + */ + endPosition: Vector2; + /** + * projectionMatrix which can be used to convert `startPosition` and `endPosition` to screen coordinates. + */ + projectionMatrix: Matrix3; + }) => { + /** + * Convert the start and end positions, which are in 'world' coordinates, + * to `left` and `top` css values. + */ + const screenStart = applyMatrix3(startPosition, projectionMatrix); + const screenEnd = applyMatrix3(endPosition, projectionMatrix); + + /** + * We render the line using a short, long, `div` element. The length of this `div` + * should be the same as the distance between the start and end points. + */ + const length = distance(screenStart, screenEnd); + + const style = { + left: `${screenStart[0]}px`, + top: `${screenStart[1]}px`, + width: `${length}px`, + /** + * Transform from the left of the div, as the left side of the `div` is positioned + * at the start point of the line segment. + */ + transformOrigin: 'top left', + /** + * Translate the `div` in the y axis to accomodate for the height of the `div`. + * Also rotate the `div` in the z axis so that it's angle matches the angle + * between the start and end points. + */ + transform: `translateY(-50%) rotateZ(${angle(screenStart, screenEnd)}rad)`, + }; + return
; + } +); + +EdgeLineComponent.displayName = 'EdgeLine'; + +export const EdgeLine = styled(EdgeLineComponent)` + position: absolute; + height: 3px; + background-color: #d4d4d4; + color: #333333; + contain: strict; +`; diff --git a/x-pack/plugins/siem/public/resolver/view/graph_controls.tsx b/x-pack/plugins/siem/public/resolver/view/graph_controls.tsx new file mode 100644 index 0000000000000..f5bc571434d66 --- /dev/null +++ b/x-pack/plugins/siem/public/resolver/view/graph_controls.tsx @@ -0,0 +1,188 @@ +/* + * 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. + */ + +/* eslint-disable react/button-has-type */ + +import React, { useCallback, useMemo, useContext } from 'react'; +import styled from 'styled-components'; +import { EuiRange, EuiPanel, EuiIcon } from '@elastic/eui'; +import { useSelector, useDispatch } from 'react-redux'; +import { SideEffectContext } from './side_effect_context'; +import { ResolverAction, Vector2 } from '../types'; +import * as selectors from '../store/selectors'; + +/** + * Controls for zooming, panning, and centering in Resolver + */ +const GraphControlsComponent = React.memo( + ({ + className, + }: { + /** + * A className string provided by `styled` + */ + className?: string; + }) => { + const dispatch: (action: ResolverAction) => unknown = useDispatch(); + const scalingFactor = useSelector(selectors.scalingFactor); + const { timestamp } = useContext(SideEffectContext); + + const handleZoomAmountChange = useCallback( + (event: React.ChangeEvent | React.MouseEvent) => { + const valueAsNumber = parseFloat( + (event as React.ChangeEvent).target.value + ); + if (isNaN(valueAsNumber) === false) { + dispatch({ + type: 'userSetZoomLevel', + payload: valueAsNumber, + }); + } + }, + [dispatch] + ); + + const handleCenterClick = useCallback(() => { + dispatch({ + type: 'userSetPositionOfCamera', + payload: [0, 0], + }); + }, [dispatch]); + + const handleZoomOutClick = useCallback(() => { + dispatch({ + type: 'userClickedZoomOut', + }); + }, [dispatch]); + + const handleZoomInClick = useCallback(() => { + dispatch({ + type: 'userClickedZoomIn', + }); + }, [dispatch]); + + const [handleNorth, handleEast, handleSouth, handleWest] = useMemo(() => { + const directionVectors: readonly Vector2[] = [ + [0, 1], + [1, 0], + [0, -1], + [-1, 0], + ]; + return directionVectors.map(direction => { + return () => { + const action: ResolverAction = { + type: 'userNudgedCamera', + payload: { direction, time: timestamp() }, + }; + dispatch(action); + }; + }); + }, [dispatch, timestamp]); + + return ( +
+ +
+ +
+
+ + + +
+
+ +
+
+ + + + + +
+ ); + } +); + +GraphControlsComponent.displayName = 'GraphControlsComponent'; + +export const GraphControls = styled(GraphControlsComponent)` + position: absolute; + top: 5px; + right: 5px; + background-color: #d4d4d4; + color: #333333; + + .zoom-controls { + display: flex; + flex-direction: column; + align-items: center; + padding: 5px 0px; + + .zoom-slider { + width: 20px; + height: 150px; + margin: 5px 0px 2px 0px; + + input[type='range'] { + width: 150px; + height: 20px; + transform-origin: 75px 75px; + transform: rotate(-90deg); + } + } + } + .panning-controls { + text-align: center; + } +`; diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/index.tsx b/x-pack/plugins/siem/public/resolver/view/index.tsx similarity index 94% rename from x-pack/plugins/endpoint/public/embeddables/resolver/view/index.tsx rename to x-pack/plugins/siem/public/resolver/view/index.tsx index 5275ba3ec5b4c..26d7842bbbeeb 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/view/index.tsx +++ b/x-pack/plugins/siem/public/resolver/view/index.tsx @@ -17,7 +17,7 @@ import { ProcessEventDot } from './process_event_dot'; import { useCamera } from './use_camera'; import { SymbolDefinitions, NamedColors } from './defs'; import { ResolverAction } from '../types'; -import { ResolverEvent } from '../../../../common/types'; +import { ResolverEvent } from '../../../common/endpoint/types'; const StyledPanel = styled(Panel)` position: absolute; @@ -29,12 +29,6 @@ const StyledPanel = styled(Panel)` max-width: 50%; `; -const StyledGraphControls = styled(GraphControls)` - position: absolute; - top: 5px; - right: 5px; -`; - const StyledResolverContainer = styled.div` display: flex; flex-grow: 1; @@ -81,7 +75,7 @@ export const Resolver = styled(
{' '}
@@ -123,7 +117,7 @@ export const Resolver = styled( )} - +
); diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/panel.tsx b/x-pack/plugins/siem/public/resolver/view/panel.tsx similarity index 77% rename from x-pack/plugins/endpoint/public/embeddables/resolver/view/panel.tsx rename to x-pack/plugins/siem/public/resolver/view/panel.tsx index 1250c1106b355..8039d2f53d802 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/view/panel.tsx +++ b/x-pack/plugins/siem/public/resolver/view/panel.tsx @@ -4,15 +4,20 @@ * you may not use this file except in compliance with the Elastic License. */ import React, { memo, useCallback, useMemo, useContext } from 'react'; -import { EuiPanel, EuiBadge, EuiBasicTableColumn } from '@elastic/eui'; -import { EuiTitle } from '@elastic/eui'; -import { EuiHorizontalRule, EuiInMemoryTable } from '@elastic/eui'; +import { + EuiPanel, + EuiBadge, + EuiBasicTableColumn, + EuiTitle, + EuiHorizontalRule, + EuiInMemoryTable, +} from '@elastic/eui'; import euiVars from '@elastic/eui/dist/eui_theme_light.json'; import { useSelector } from 'react-redux'; import { i18n } from '@kbn/i18n'; import { SideEffectContext } from './side_effect_context'; -import { ResolverEvent } from '../../../../common/types'; -import * as event from '../../../../common/models/event'; +import { ResolverEvent } from '../../../common/endpoint/types'; +import * as event from '../../../common/endpoint/models/event'; import { useResolverDispatch } from './use_resolver_dispatch'; import * as selectors from '../store/selectors'; @@ -94,7 +99,7 @@ export const Panel = memo(function Event({ className }: { className?: string }) () => [ { field: 'name', - name: i18n.translate('xpack.endpoint.resolver.panel.tabel.row.processNameTitle', { + name: i18n.translate('xpack.siem.endpoint.resolver.panel.tabel.row.processNameTitle', { defaultMessage: 'Process Name', }), sortable: true, @@ -102,9 +107,12 @@ export const Panel = memo(function Event({ className }: { className?: string }) render(name: string) { return name === '' ? ( - {i18n.translate('xpack.endpoint.resolver.panel.table.row.valueMissingDescription', { - defaultMessage: 'Value is missing', - })} + {i18n.translate( + 'xpack.siem.endpoint.resolver.panel.table.row.valueMissingDescription', + { + defaultMessage: 'Value is missing', + } + )} ) : ( name @@ -113,7 +121,7 @@ export const Panel = memo(function Event({ className }: { className?: string }) }, { field: 'timestamp', - name: i18n.translate('xpack.endpoint.resolver.panel.tabel.row.timestampTitle', { + name: i18n.translate('xpack.siem.endpoint.resolver.panel.tabel.row.timestampTitle', { defaultMessage: 'Timestamp', }), dataType: 'date', @@ -123,27 +131,30 @@ export const Panel = memo(function Event({ className }: { className?: string }) formatter.format(eventDate) ) : ( - {i18n.translate('xpack.endpoint.resolver.panel.tabel.row.timestampInvalidLabel', { - defaultMessage: 'invalid', - })} + {i18n.translate( + 'xpack.siem.endpoint.resolver.panel.tabel.row.timestampInvalidLabel', + { + defaultMessage: 'invalid', + } + )} ); }, }, { - name: i18n.translate('xpack.endpoint.resolver.panel.tabel.row.actionsTitle', { + name: i18n.translate('xpack.siem.endpoint.resolver.panel.tabel.row.actionsTitle', { defaultMessage: 'Actions', }), actions: [ { name: i18n.translate( - 'xpack.endpoint.resolver.panel.tabel.row.actions.bringIntoViewButtonLabel', + 'xpack.siem.endpoint.resolver.panel.tabel.row.actions.bringIntoViewButtonLabel', { defaultMessage: 'Bring into view', } ), description: i18n.translate( - 'xpack.endpoint.resolver.panel.tabel.row.bringIntoViewLabel', + 'xpack.siem.endpoint.resolver.panel.tabel.row.bringIntoViewLabel', { defaultMessage: 'Bring the process into view on the map.', } @@ -161,7 +172,7 @@ export const Panel = memo(function Event({ className }: { className?: string })

- {i18n.translate('xpack.endpoint.resolver.panel.title', { + {i18n.translate('xpack.siem.endpoint.resolver.panel.title', { defaultMessage: 'Processes', })}

diff --git a/x-pack/plugins/siem/public/resolver/view/process_event_dot.tsx b/x-pack/plugins/siem/public/resolver/view/process_event_dot.tsx new file mode 100644 index 0000000000000..18a7ba404c270 --- /dev/null +++ b/x-pack/plugins/siem/public/resolver/view/process_event_dot.tsx @@ -0,0 +1,614 @@ +/* + * 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, { useCallback, useMemo } from 'react'; +import styled from 'styled-components'; +import { i18n } from '@kbn/i18n'; +import { + htmlIdGenerator, + EuiI18nNumber, + EuiKeyboardAccessible, + EuiFlexGroup, + EuiFlexItem, +} from '@elastic/eui'; +import { useSelector } from 'react-redux'; +import { NodeSubMenu, subMenuAssets } from './submenu'; +import { applyMatrix3 } from '../lib/vector2'; +import { + Vector2, + Matrix3, + AdjacentProcessMap, + ResolverProcessType, + RelatedEventEntryWithStatsOrWaiting, +} from '../types'; +import { SymbolIds, NamedColors } from './defs'; +import { ResolverEvent } from '../../../common/endpoint/types'; +import { useResolverDispatch } from './use_resolver_dispatch'; +import * as eventModel from '../../../common/endpoint/models/event'; +import * as processModel from '../models/process_event'; +import * as selectors from '../store/selectors'; + +const nodeAssets = { + runningProcessCube: { + cubeSymbol: `#${SymbolIds.runningProcessCube}`, + labelBackground: NamedColors.labelBackgroundRunningProcess, + descriptionFill: NamedColors.empty, + descriptionText: i18n.translate('xpack.siem.endpoint.resolver.runningProcess', { + defaultMessage: 'Running Process', + }), + }, + runningTriggerCube: { + cubeSymbol: `#${SymbolIds.runningTriggerCube}`, + labelBackground: NamedColors.labelBackgroundRunningTrigger, + descriptionFill: NamedColors.empty, + descriptionText: i18n.translate('xpack.siem.endpoint.resolver.runningTrigger', { + defaultMessage: 'Running Trigger', + }), + }, + terminatedProcessCube: { + cubeSymbol: `#${SymbolIds.terminatedProcessCube}`, + labelBackground: NamedColors.labelBackgroundTerminatedProcess, + descriptionFill: NamedColors.empty, + descriptionText: i18n.translate('xpack.siem.endpoint.resolver.terminatedProcess', { + defaultMessage: 'Terminated Process', + }), + }, + terminatedTriggerCube: { + cubeSymbol: `#${SymbolIds.terminatedTriggerCube}`, + labelBackground: NamedColors.labelBackgroundTerminatedTrigger, + descriptionFill: NamedColors.empty, + descriptionText: i18n.translate('xpack.siem.endpoint.resolver.terminatedTrigger', { + defaultMessage: 'Terminated Trigger', + }), + }, +}; + +/** + * Take a gross `schemaName` and return a beautiful translated one. + */ +const getDisplayName: (schemaName: string) => string = function nameInSchemaToDisplayName( + schemaName: string +) { + const displayNameRecord: Record = { + application: i18n.translate('xpack.siem.endpoint.resolver.applicationEventTypeDisplayName', { + defaultMessage: 'Application', + }), + apm: i18n.translate('xpack.siem.endpoint.resolver.apmEventTypeDisplayName', { + defaultMessage: 'APM', + }), + audit: i18n.translate('xpack.siem.endpoint.resolver.auditEventTypeDisplayName', { + defaultMessage: 'Audit', + }), + authentication: i18n.translate( + 'xpack.siem.endpoint.resolver.authenticationEventTypeDisplayName', + { + defaultMessage: 'Authentication', + } + ), + certificate: i18n.translate('xpack.siem.endpoint.resolver.certificateEventTypeDisplayName', { + defaultMessage: 'Certificate', + }), + cloud: i18n.translate('xpack.siem.endpoint.resolver.cloudEventTypeDisplayName', { + defaultMessage: 'Cloud', + }), + database: i18n.translate('xpack.siem.endpoint.resolver.databaseEventTypeDisplayName', { + defaultMessage: 'Database', + }), + driver: i18n.translate('xpack.siem.endpoint.resolver.driverEventTypeDisplayName', { + defaultMessage: 'Driver', + }), + email: i18n.translate('xpack.siem.endpoint.resolver.emailEventTypeDisplayName', { + defaultMessage: 'Email', + }), + file: i18n.translate('xpack.siem.endpoint.resolver.fileEventTypeDisplayName', { + defaultMessage: 'File', + }), + host: i18n.translate('xpack.siem.endpoint.resolver.hostEventTypeDisplayName', { + defaultMessage: 'Host', + }), + iam: i18n.translate('xpack.siem.endpoint.resolver.iamEventTypeDisplayName', { + defaultMessage: 'IAM', + }), + iam_group: i18n.translate('xpack.siem.endpoint.resolver.iam_groupEventTypeDisplayName', { + defaultMessage: 'IAM Group', + }), + intrusion_detection: i18n.translate( + 'xpack.siem.endpoint.resolver.intrusion_detectionEventTypeDisplayName', + { + defaultMessage: 'Intrusion Detection', + } + ), + malware: i18n.translate('xpack.siem.endpoint.resolver.malwareEventTypeDisplayName', { + defaultMessage: 'Malware', + }), + network_flow: i18n.translate('xpack.siem.endpoint.resolver.network_flowEventTypeDisplayName', { + defaultMessage: 'Network Flow', + }), + network: i18n.translate('xpack.siem.endpoint.resolver.networkEventTypeDisplayName', { + defaultMessage: 'Network', + }), + package: i18n.translate('xpack.siem.endpoint.resolver.packageEventTypeDisplayName', { + defaultMessage: 'Package', + }), + process: i18n.translate('xpack.siem.endpoint.resolver.processEventTypeDisplayName', { + defaultMessage: 'Process', + }), + registry: i18n.translate('xpack.siem.endpoint.resolver.registryEventTypeDisplayName', { + defaultMessage: 'Registry', + }), + session: i18n.translate('xpack.siem.endpoint.resolver.sessionEventTypeDisplayName', { + defaultMessage: 'Session', + }), + service: i18n.translate('xpack.siem.endpoint.resolver.serviceEventTypeDisplayName', { + defaultMessage: 'Service', + }), + socket: i18n.translate('xpack.siem.endpoint.resolver.socketEventTypeDisplayName', { + defaultMessage: 'Socket', + }), + vulnerability: i18n.translate( + 'xpack.siem.endpoint.resolver.vulnerabilityEventTypeDisplayName', + { + defaultMessage: 'Vulnerability', + } + ), + web: i18n.translate('xpack.siem.endpoint.resolver.webEventTypeDisplayName', { + defaultMessage: 'Web', + }), + alert: i18n.translate('xpack.siem.endpoint.resolver.alertEventTypeDisplayName', { + defaultMessage: 'Alert', + }), + security: i18n.translate('xpack.siem.endpoint.resolver.securityEventTypeDisplayName', { + defaultMessage: 'Security', + }), + dns: i18n.translate('xpack.siem.endpoint.resolver.dnsEventTypeDisplayName', { + defaultMessage: 'DNS', + }), + clr: i18n.translate('xpack.siem.endpoint.resolver.clrEventTypeDisplayName', { + defaultMessage: 'CLR', + }), + image_load: i18n.translate('xpack.siem.endpoint.resolver.image_loadEventTypeDisplayName', { + defaultMessage: 'Image Load', + }), + powershell: i18n.translate('xpack.siem.endpoint.resolver.powershellEventTypeDisplayName', { + defaultMessage: 'Powershell', + }), + wmi: i18n.translate('xpack.siem.endpoint.resolver.wmiEventTypeDisplayName', { + defaultMessage: 'WMI', + }), + api: i18n.translate('xpack.siem.endpoint.resolver.apiEventTypeDisplayName', { + defaultMessage: 'API', + }), + user: i18n.translate('xpack.siem.endpoint.resolver.userEventTypeDisplayName', { + defaultMessage: 'User', + }), + }; + return ( + displayNameRecord[schemaName] || + i18n.translate('xpack.siem.endpoint.resolver.userEventTypeDisplayUnknown', { + defaultMessage: 'Unknown', + }) + ); +}; + +/** + * An artifact that represents a process node and the things associated with it in the Resolver + */ +const ProcessEventDotComponents = React.memo( + ({ + className, + position, + event, + projectionMatrix, + adjacentNodeMap, + relatedEvents, + }: { + /** + * A `className` string provided by `styled` + */ + className?: string; + /** + * The positon of the process node, in 'world' coordinates. + */ + position: Vector2; + /** + * An event which contains details about the process node. + */ + event: ResolverEvent; + /** + * projectionMatrix which can be used to convert `position` to screen coordinates. + */ + projectionMatrix: Matrix3; + /** + * map of what nodes are "adjacent" to this one in "up, down, previous, next" directions + */ + adjacentNodeMap: AdjacentProcessMap; + /** + * A collection of events related to the current node and statistics (e.g. counts indexed by event type) + * to provide the user some visibility regarding the contents thereof. + */ + relatedEvents?: RelatedEventEntryWithStatsOrWaiting; + }) => { + /** + * Convert the position, which is in 'world' coordinates, to screen coordinates. + */ + const [left, top] = applyMatrix3(position, projectionMatrix); + + const [magFactorX] = projectionMatrix; + + const selfId = adjacentNodeMap.self; + + const activeDescendantId = useSelector(selectors.uiActiveDescendantId); + const selectedDescendantId = useSelector(selectors.uiSelectedDescendantId); + + const logicalProcessNodeViewWidth = 360; + const logicalProcessNodeViewHeight = 120; + /** + * The `left` and `top` values represent the 'center' point of the process node. + * Since the view has content to the left and above the 'center' point, offset the + * position to accomodate for that. This aligns the logical center of the process node + * with the correct position on the map. + */ + const processNodeViewXOffset = -0.172413 * logicalProcessNodeViewWidth * magFactorX; + const processNodeViewYOffset = -0.73684 * logicalProcessNodeViewHeight * magFactorX; + + const nodeViewportStyle = useMemo( + () => ({ + left: `${left + processNodeViewXOffset}px`, + top: `${top + processNodeViewYOffset}px`, + // Width of symbol viewport scaled to fit + width: `${logicalProcessNodeViewWidth * magFactorX}px`, + // Height according to symbol viewbox AR + height: `${logicalProcessNodeViewHeight * magFactorX}px`, + }), + [left, magFactorX, processNodeViewXOffset, processNodeViewYOffset, top] + ); + + /** + * Type in non-SVG components scales as follows: + * (These values were adjusted to match the proportions in the comps provided by UX/Design) + * 18.75 : The smallest readable font size at which labels/descriptions can be read. Font size will not scale below this. + * 12.5 : A 'slope' at which the font size will scale w.r.t. to zoom level otherwise + */ + const minimumFontSize = 18.75; + const slopeOfFontScale = 12.5; + const fontSizeAdjustmentForScale = magFactorX > 1 ? slopeOfFontScale * (magFactorX - 1) : 0; + const scaledTypeSize = minimumFontSize + fontSizeAdjustmentForScale; + + const markerBaseSize = 15; + const markerSize = markerBaseSize; + const markerPositionOffset = -markerBaseSize / 2; + + /** + * An element that should be animated when the node is clicked. + */ + const animationTarget: { + current: + | (SVGAnimationElement & { + /** + * `beginElement` is by [w3](https://www.w3.org/TR/SVG11/animate.html#__smil__ElementTimeControl__beginElement) + * but missing in [TSJS-lib-generator](https://github.com/microsoft/TSJS-lib-generator/blob/15a4678e0ef6de308e79451503e444e9949ee849/inputfiles/addedTypes.json#L1819) + */ + beginElement: () => void; + }) + | null; + } = React.createRef(); + const { cubeSymbol, labelBackground, descriptionText } = nodeAssets[nodeType(event)]; + const resolverNodeIdGenerator = useMemo(() => htmlIdGenerator('resolverNode'), []); + + const nodeId = useMemo(() => resolverNodeIdGenerator(selfId), [ + resolverNodeIdGenerator, + selfId, + ]); + const labelId = useMemo(() => resolverNodeIdGenerator(), [resolverNodeIdGenerator]); + const descriptionId = useMemo(() => resolverNodeIdGenerator(), [resolverNodeIdGenerator]); + const isActiveDescendant = nodeId === activeDescendantId; + const isSelectedDescendant = nodeId === selectedDescendantId; + + const dispatch = useResolverDispatch(); + + const handleFocus = useCallback(() => { + dispatch({ + type: 'userFocusedOnResolverNode', + payload: { + nodeId, + }, + }); + }, [dispatch, nodeId]); + + const handleClick = useCallback(() => { + if (animationTarget.current !== null) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (animationTarget.current as any).beginElement(); + } + dispatch({ + type: 'userSelectedResolverNode', + payload: { + nodeId, + }, + }); + }, [animationTarget, dispatch, nodeId]); + + const handleRelatedEventRequest = useCallback(() => { + dispatch({ + type: 'userRequestedRelatedEventData', + payload: event, + }); + }, [dispatch, event]); + + const handleRelatedAlertsRequest = useCallback(() => { + dispatch({ + type: 'userSelectedRelatedAlerts', + payload: event, + }); + }, [dispatch, event]); + /** + * Enumerates the stats for related events to display with the node as options, + * generally in the form `number of related events in category` `category title` + * e.g. "10 DNS", "230 File" + */ + const relatedEventOptions = useMemo(() => { + if (relatedEvents === 'error') { + // Return an empty set of options if there was an error requesting them + return []; + } + const relatedStats = typeof relatedEvents === 'object' && relatedEvents.stats; + if (!relatedStats) { + // Return an empty set of options if there are no stats to report + return []; + } + // If we have entries to show, map them into options to display in the selectable list + return Object.entries(relatedStats).map(statsEntry => { + const displayName = getDisplayName(statsEntry[0]); + return { + prefix: , + optionTitle: `${displayName}`, + action: () => { + dispatch({ + type: 'userSelectedRelatedEventCategory', + payload: { + subject: event, + category: statsEntry[0], + }, + }); + }, + }; + }); + }, [relatedEvents, dispatch, event]); + + const relatedEventStatusOrOptions = (() => { + if (!relatedEvents) { + // If related events have not yet been requested + return subMenuAssets.initialMenuStatus; + } + if (relatedEvents === 'error') { + // If there was an error when we tried to request the events + return subMenuAssets.menuError; + } + if (relatedEvents === 'waitingForRelatedEventData') { + // If we're waiting for events to be returned + // Pass on the waiting symbol + return relatedEvents; + } + return relatedEventOptions; + })(); + + /* eslint-disable jsx-a11y/click-events-have-key-events */ + /** + * Key event handling (e.g. 'Enter'/'Space') is provisioned by the `EuiKeyboardAccessible` component + */ + return ( + +
+ + + + + + + + +
+
+ {descriptionText} +
+
= 2 ? 'euiButton' : 'euiButton euiButton--small'} + data-test-subject="nodeLabel" + id={labelId} + style={{ + backgroundColor: labelBackground, + padding: '.15rem 0', + textAlign: 'center', + maxWidth: '20rem', + minWidth: '12rem', + width: '60%', + overflow: 'hidden', + whiteSpace: 'nowrap', + textOverflow: 'ellipsis', + contain: 'content', + margin: '.25rem 0 .35rem 0', + }} + > + + + {eventModel.eventName(event)} + + +
+ {magFactorX >= 2 && ( + + + + + + + + + )} +
+
+
+ ); + /* eslint-enable jsx-a11y/click-events-have-key-events */ + } +); + +ProcessEventDotComponents.displayName = 'ProcessEventDot'; + +export const ProcessEventDot = styled(ProcessEventDotComponents)` + position: absolute; + text-align: left; + font-size: 10px; + user-select: none; + box-sizing: border-box; + border-radius: 10%; + white-space: nowrap; + will-change: left, top, width, height; + contain: layout; + min-width: 280px; + min-height: 90px; + overflow-y: visible; + + //dasharray & dashoffset should be equal to "pull" the stroke back + //when it is transitioned. + //The value is tuned to look good when animated, but to preserve + //the effect, it should always be _at least_ the length of the stroke + & .backing { + stroke-dasharray: 500; + stroke-dashoffset: 500; + } + &[aria-current] .backing { + transition-property: stroke-dashoffset; + transition-duration: 1s; + stroke-dashoffset: 0; + } + + & .related-dropdown { + width: 4.5em; + } + & .euiSelectableList-bordered { + border-top-right-radius: 0px; + border-top-left-radius: 0px; + } + & .euiSelectableListItem { + background-color: black; + } + & .euiSelectableListItem path { + fill: white; + } + & .euiSelectableListItem__text { + color: white; + } +`; + +const processTypeToCube: Record = { + processCreated: 'runningProcessCube', + processRan: 'runningProcessCube', + processTerminated: 'terminatedProcessCube', + unknownProcessEvent: 'runningProcessCube', + processCausedAlert: 'runningTriggerCube', + unknownEvent: 'runningProcessCube', +}; + +function nodeType(processEvent: ResolverEvent): keyof typeof nodeAssets { + const processType = processModel.eventType(processEvent); + + if (processType in processTypeToCube) { + return processTypeToCube[processType]; + } + return 'runningProcessCube'; +} diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/side_effect_context.ts b/x-pack/plugins/siem/public/resolver/view/side_effect_context.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/view/side_effect_context.ts rename to x-pack/plugins/siem/public/resolver/view/side_effect_context.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/side_effect_simulator.ts b/x-pack/plugins/siem/public/resolver/view/side_effect_simulator.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/view/side_effect_simulator.ts rename to x-pack/plugins/siem/public/resolver/view/side_effect_simulator.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/submenu.tsx b/x-pack/plugins/siem/public/resolver/view/submenu.tsx similarity index 51% rename from x-pack/plugins/endpoint/public/embeddables/resolver/view/submenu.tsx rename to x-pack/plugins/siem/public/resolver/view/submenu.tsx index 9f6427d801ce4..cdcce5d23c0c3 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/view/submenu.tsx +++ b/x-pack/plugins/siem/public/resolver/view/submenu.tsx @@ -1,178 +1,182 @@ -/* - * 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 { i18n } from '@kbn/i18n'; -import React, { ReactNode, useState, useMemo, useCallback } from 'react'; -import { EuiSelectable, EuiButton } from '@elastic/eui'; -import styled from 'styled-components'; - -/** - * i18n-translated titles for submenus and identifiers for display of states: - * initialMenuStatus: submenu before it has been opened / requested data - * menuError: if the submenu requested data, but received an error - */ -export const subMenuAssets = { - initialMenuStatus: i18n.translate('xpack.endpoint.resolver.relatedNotRetrieved', { - defaultMessage: 'Related Events have not yet been retrieved.', - }), - menuError: i18n.translate('xpack.endpoint.resolver.relatedRetrievalError', { - defaultMessage: 'There was an error retrieving related events.', - }), - relatedAlerts: { - title: i18n.translate('xpack.endpoint.resolver.relatedAlerts', { - defaultMessage: 'Related Alerts', - }), - }, - relatedEvents: { - title: i18n.translate('xpack.endpoint.resolver.relatedEvents', { - defaultMessage: 'Events', - }), - }, -}; - -interface ResolverSubmenuOption { - optionTitle: string; - action: () => unknown; - prefix?: number | JSX.Element; -} - -export type ResolverSubmenuOptionList = ResolverSubmenuOption[] | string; - -const OptionList = React.memo( - ({ - subMenuOptions, - isLoading, - }: { - subMenuOptions: ResolverSubmenuOptionList; - isLoading: boolean; - }) => { - const [options, setOptions] = useState(() => - typeof subMenuOptions !== 'object' - ? [] - : subMenuOptions.map((opt: ResolverSubmenuOption): { - label: string; - prepend?: ReactNode; - } => { - return opt.prefix - ? { - label: opt.optionTitle, - prepend: {opt.prefix} , - } - : { - label: opt.optionTitle, - prepend: , - }; - }) - ); - return useMemo( - () => ( - { - setOptions(newOptions); - }} - listProps={{ showIcons: true, bordered: true }} - isLoading={isLoading} - > - {list => list} - - ), - [isLoading, options] - ); - } -); - -/** - * A Submenu to be displayed in one of two forms: - * 1) Provided a collection of `optionsWithActions`: it will call `menuAction` then - if and when menuData becomes available - display each item with an optional prefix and call the supplied action for the options when that option is clicked. - * 2) Provided `optionsWithActions` is undefined, it will call the supplied `menuAction` when its host button is clicked. - */ -export const NodeSubMenu = styled( - React.memo( - ({ - menuTitle, - menuAction, - optionsWithActions, - className, - }: { menuTitle: string; className?: string; menuAction: () => unknown } & { - optionsWithActions?: ResolverSubmenuOptionList | string | undefined; - }) => { - const [menuIsOpen, setMenuOpen] = useState(false); - const handleMenuOpenClick = useCallback( - (clickEvent: React.MouseEvent) => { - // stopping propagation/default to prevent other node animations from triggering - clickEvent.preventDefault(); - clickEvent.stopPropagation(); - setMenuOpen(!menuIsOpen); - }, - [menuIsOpen] - ); - const handleMenuActionClick = useCallback( - (clickEvent: React.MouseEvent) => { - // stopping propagation/default to prevent other node animations from triggering - clickEvent.preventDefault(); - clickEvent.stopPropagation(); - if (typeof menuAction === 'function') menuAction(); - setMenuOpen(true); - }, - [menuAction] - ); - - const isMenuLoading = optionsWithActions === 'waitingForRelatedEventData'; - - if (!optionsWithActions) { - /** - * When called with a `menuAction` - * Render without dropdown and call the supplied action when host button is clicked - */ - return ( -
- - {menuTitle} - -
- ); - } - /** - * When called with a set of `optionsWithActions`: - * Render with a panel of options that appear when the menu host button is clicked - */ - return ( -
- - {menuTitle} - - {menuIsOpen && typeof optionsWithActions === 'object' && ( - - )} -
- ); - } - ) -)` - margin: 0; - padding: 0; - border: none; - display: flex; - flex-flow: column; - &.is-open .euiButton { - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - } - &.is-open .euiSelectableListItem__prepend { - color: white; - } -`; +/* + * 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 { i18n } from '@kbn/i18n'; +import React, { ReactNode, useState, useMemo, useCallback } from 'react'; +import { EuiSelectable, EuiButton } from '@elastic/eui'; +import styled from 'styled-components'; + +/** + * i18n-translated titles for submenus and identifiers for display of states: + * initialMenuStatus: submenu before it has been opened / requested data + * menuError: if the submenu requested data, but received an error + */ +export const subMenuAssets = { + initialMenuStatus: i18n.translate('xpack.siem.endpoint.resolver.relatedNotRetrieved', { + defaultMessage: 'Related Events have not yet been retrieved.', + }), + menuError: i18n.translate('xpack.siem.endpoint.resolver.relatedRetrievalError', { + defaultMessage: 'There was an error retrieving related events.', + }), + relatedAlerts: { + title: i18n.translate('xpack.siem.endpoint.resolver.relatedAlerts', { + defaultMessage: 'Related Alerts', + }), + }, + relatedEvents: { + title: i18n.translate('xpack.siem.endpoint.resolver.relatedEvents', { + defaultMessage: 'Events', + }), + }, +}; + +interface ResolverSubmenuOption { + optionTitle: string; + action: () => unknown; + prefix?: number | JSX.Element; +} + +export type ResolverSubmenuOptionList = ResolverSubmenuOption[] | string; + +const OptionList = React.memo( + ({ + subMenuOptions, + isLoading, + }: { + subMenuOptions: ResolverSubmenuOptionList; + isLoading: boolean; + }) => { + const [options, setOptions] = useState(() => + typeof subMenuOptions !== 'object' + ? [] + : subMenuOptions.map((opt: ResolverSubmenuOption): { + label: string; + prepend?: ReactNode; + } => { + return opt.prefix + ? { + label: opt.optionTitle, + prepend: {opt.prefix} , + } + : { + label: opt.optionTitle, + prepend: , + }; + }) + ); + return useMemo( + () => ( + { + setOptions(newOptions); + }} + listProps={{ showIcons: true, bordered: true }} + isLoading={isLoading} + > + {list => list} + + ), + [isLoading, options] + ); + } +); + +OptionList.displayName = 'OptionList'; + +/** + * A Submenu to be displayed in one of two forms: + * 1) Provided a collection of `optionsWithActions`: it will call `menuAction` then - if and when menuData becomes available - display each item with an optional prefix and call the supplied action for the options when that option is clicked. + * 2) Provided `optionsWithActions` is undefined, it will call the supplied `menuAction` when its host button is clicked. + */ +const NodeSubMenuComponents = React.memo( + ({ + menuTitle, + menuAction, + optionsWithActions, + className, + }: { menuTitle: string; className?: string; menuAction: () => unknown } & { + optionsWithActions?: ResolverSubmenuOptionList | string | undefined; + }) => { + const [menuIsOpen, setMenuOpen] = useState(false); + const handleMenuOpenClick = useCallback( + (clickEvent: React.MouseEvent) => { + // stopping propagation/default to prevent other node animations from triggering + clickEvent.preventDefault(); + clickEvent.stopPropagation(); + setMenuOpen(!menuIsOpen); + }, + [menuIsOpen] + ); + const handleMenuActionClick = useCallback( + (clickEvent: React.MouseEvent) => { + // stopping propagation/default to prevent other node animations from triggering + clickEvent.preventDefault(); + clickEvent.stopPropagation(); + if (typeof menuAction === 'function') menuAction(); + setMenuOpen(true); + }, + [menuAction] + ); + + const isMenuLoading = optionsWithActions === 'waitingForRelatedEventData'; + + if (!optionsWithActions) { + /** + * When called with a `menuAction` + * Render without dropdown and call the supplied action when host button is clicked + */ + return ( +
+ + {menuTitle} + +
+ ); + } + /** + * When called with a set of `optionsWithActions`: + * Render with a panel of options that appear when the menu host button is clicked + */ + return ( +
+ + {menuTitle} + + {menuIsOpen && typeof optionsWithActions === 'object' && ( + + )} +
+ ); + } +); + +NodeSubMenuComponents.displayName = 'NodeSubMenu'; + +export const NodeSubMenu = styled(NodeSubMenuComponents)` + margin: 0; + padding: 0; + border: none; + display: flex; + flex-flow: column; + &.is-open .euiButton { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } + &.is-open .euiSelectableListItem__prepend { + color: white; + } +`; diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/use_camera.test.tsx b/x-pack/plugins/siem/public/resolver/view/use_camera.test.tsx similarity index 99% rename from x-pack/plugins/endpoint/public/embeddables/resolver/view/use_camera.test.tsx rename to x-pack/plugins/siem/public/resolver/view/use_camera.test.tsx index 63f47396d4479..f8aa4fbca3291 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/view/use_camera.test.tsx +++ b/x-pack/plugins/siem/public/resolver/view/use_camera.test.tsx @@ -12,7 +12,7 @@ import { Provider } from 'react-redux'; import * as selectors from '../store/selectors'; import { storeFactory } from '../store'; import { Matrix3, ResolverAction, ResolverStore, SideEffectSimulator } from '../types'; -import { ResolverEvent } from '../../../../common/types'; +import { ResolverEvent } from '../../../common/endpoint/types'; import { SideEffectContext } from './side_effect_context'; import { applyMatrix3 } from '../lib/vector2'; import { sideEffectSimulator } from './side_effect_simulator'; diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/use_camera.ts b/x-pack/plugins/siem/public/resolver/view/use_camera.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/view/use_camera.ts rename to x-pack/plugins/siem/public/resolver/view/use_camera.ts diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/use_resolver_dispatch.ts b/x-pack/plugins/siem/public/resolver/view/use_resolver_dispatch.ts similarity index 100% rename from x-pack/plugins/endpoint/public/embeddables/resolver/view/use_resolver_dispatch.ts rename to x-pack/plugins/siem/public/resolver/view/use_resolver_dispatch.ts diff --git a/x-pack/plugins/siem/public/timelines/components/open_timeline/helpers.test.ts b/x-pack/plugins/siem/public/timelines/components/open_timeline/helpers.test.ts index 350e1a3124497..a97aa29e58c28 100644 --- a/x-pack/plugins/siem/public/timelines/components/open_timeline/helpers.test.ts +++ b/x-pack/plugins/siem/public/timelines/components/open_timeline/helpers.test.ts @@ -36,7 +36,7 @@ import { KueryFilterQueryKind } from '../../../common/store/model'; import { Note } from '../../../common/lib/note'; import moment from 'moment'; import sinon from 'sinon'; -import { TimelineType } from '../../../../common/types/timeline'; +import { TimelineType, TimelineStatus } from '../../../../common/types/timeline'; jest.mock('../../../common/store/inputs/actions'); jest.mock('../../store/timeline/actions'); @@ -299,8 +299,9 @@ describe('helpers', () => { columnId: '@timestamp', sortDirection: 'desc', }, + status: TimelineStatus.draft, title: '', - timelineType: TimelineType.draft, + timelineType: TimelineType.default, templateTimelineId: null, templateTimelineVersion: null, version: '1', @@ -396,8 +397,9 @@ describe('helpers', () => { columnId: '@timestamp', sortDirection: 'desc', }, + status: TimelineStatus.draft, title: '', - timelineType: TimelineType.draft, + timelineType: TimelineType.default, templateTimelineId: null, templateTimelineVersion: null, version: '1', @@ -517,7 +519,7 @@ describe('helpers', () => { }, loadingEventIds: [], title: '', - timelineType: TimelineType.draft, + timelineType: TimelineType.default, templateTimelineId: null, templateTimelineVersion: null, noteIds: [], @@ -535,6 +537,7 @@ describe('helpers', () => { columnId: '@timestamp', sortDirection: 'desc', }, + status: TimelineStatus.draft, width: 1100, id: 'savedObject-1', }); @@ -685,7 +688,7 @@ describe('helpers', () => { }, loadingEventIds: [], title: '', - timelineType: TimelineType.draft, + timelineType: TimelineType.default, templateTimelineId: null, templateTimelineVersion: null, noteIds: [], @@ -703,6 +706,7 @@ describe('helpers', () => { columnId: '@timestamp', sortDirection: 'desc', }, + status: TimelineStatus.draft, width: 1100, id: 'savedObject-1', }); diff --git a/x-pack/plugins/siem/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx b/x-pack/plugins/siem/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx index bbf8c5af3be97..b24c262c8a2e2 100644 --- a/x-pack/plugins/siem/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx +++ b/x-pack/plugins/siem/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx @@ -14,7 +14,7 @@ import { getEmptyTagValue } from '../../../../../common/components/empty_value'; import { getRuleDetailsUrl } from '../../../../../common/components/link_to/redirect_to_detection_engine'; import { TruncatableText } from '../../../../../common/components/truncatable_text'; -import { isUrlInvalid } from '../../../../../alerts/components/rules/step_about_rule/helpers'; +import { isUrlInvalid } from '../../../../../common/utils/validators'; import endPointSvg from '../../../../../common/utils/logo_endpoint/64_color.svg'; import * as i18n from './translations'; diff --git a/x-pack/plugins/siem/public/timelines/containers/all/index.gql_query.ts b/x-pack/plugins/siem/public/timelines/containers/all/index.gql_query.ts index 76aef8de4ad84..cdbf3e768581b 100644 --- a/x-pack/plugins/siem/public/timelines/containers/all/index.gql_query.ts +++ b/x-pack/plugins/siem/public/timelines/containers/all/index.gql_query.ts @@ -12,7 +12,7 @@ export const allTimelinesQuery = gql` $search: String $sort: SortTimeline $onlyUserFavorite: Boolean - $timelineType: String + $timelineType: TimelineType ) { getAllTimeline( pageInfo: $pageInfo diff --git a/x-pack/plugins/siem/public/timelines/containers/api.ts b/x-pack/plugins/siem/public/timelines/containers/api.ts index cf6229145623d..9f5e65e0fc5af 100644 --- a/x-pack/plugins/siem/public/timelines/containers/api.ts +++ b/x-pack/plugins/siem/public/timelines/containers/api.ts @@ -9,11 +9,11 @@ import { pipe } from 'fp-ts/lib/pipeable'; import { throwErrors } from '../../../../case/common/api'; import { - SavedTimeline, TimelineResponse, TimelineResponseType, - TimelineType, + TimelineStatus, } from '../../../common/types/timeline'; +import { TimelineInput, TimelineType } from '../../graphql/types'; import { TIMELINE_URL, TIMELINE_DRAFT_URL, @@ -31,7 +31,7 @@ import { } from '../../alerts/containers/detection_engine/rules'; interface RequestPostTimeline { - timeline: SavedTimeline; + timeline: TimelineInput; signal?: AbortSignal; } @@ -75,8 +75,8 @@ export const persistTimeline = async ({ timeline, version, }: RequestPersistTimeline): Promise => { - if (timelineId == null && timeline.timelineType === TimelineType.draft) { - const draftTimeline = await cleanDraftTimeline(); + if (timelineId == null && timeline.status === TimelineStatus.draft) { + const draftTimeline = await cleanDraftTimeline({ timelineType: timeline.timelineType! }); return patchTimeline({ timelineId: draftTimeline.data.persistTimeline.timeline.savedObjectId, timeline, @@ -133,14 +133,30 @@ export const exportSelectedTimeline: ExportSelectedData = async ({ return response.body!; }; -export const getDraftTimeline = async (): Promise => { - const response = await KibanaServices.get().http.get(TIMELINE_DRAFT_URL); +export const getDraftTimeline = async ({ + timelineType, +}: { + timelineType: TimelineType; +}): Promise => { + const response = await KibanaServices.get().http.get(TIMELINE_DRAFT_URL, { + query: { + timelineType, + }, + }); return decodeTimelineResponse(response); }; -export const cleanDraftTimeline = async (): Promise => { - const response = await KibanaServices.get().http.post(TIMELINE_DRAFT_URL); +export const cleanDraftTimeline = async ({ + timelineType, +}: { + timelineType: TimelineType; +}): Promise => { + const response = await KibanaServices.get().http.post(TIMELINE_DRAFT_URL, { + body: JSON.stringify({ + timelineType, + }), + }); return decodeTimelineResponse(response); }; diff --git a/x-pack/plugins/siem/public/timelines/store/timeline/defaults.ts b/x-pack/plugins/siem/public/timelines/store/timeline/defaults.ts index 649f1007f370b..5290178092f3e 100644 --- a/x-pack/plugins/siem/public/timelines/store/timeline/defaults.ts +++ b/x-pack/plugins/siem/public/timelines/store/timeline/defaults.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { TimelineType } from '../../../../common/types/timeline'; +import { TimelineType, TimelineStatus } from '../../../../common/types/timeline'; import { Direction } from '../../../graphql/types'; import { DEFAULT_TIMELINE_WIDTH } from '../../components/timeline/body/constants'; @@ -35,7 +35,7 @@ export const timelineDefaults: SubsetTimelineModel & Pick { showCheckboxes: false, showRowRenderers: true, sort: { columnId: '@timestamp', sortDirection: Direction.desc }, + status: TimelineStatus.active, width: 1100, version: 'WzM4LDFd', id: '11169110-fc22-11e9-8ca9-072f15ce2685', @@ -290,6 +291,7 @@ describe('Epic Timeline', () => { templateTimelineVersion: null, timelineType: TimelineType.default, title: 'saved', + status: TimelineStatus.active, }); }); }); diff --git a/x-pack/plugins/siem/public/timelines/store/timeline/epic.ts b/x-pack/plugins/siem/public/timelines/store/timeline/epic.ts index 30305f63dc31a..20c2d1861bd66 100644 --- a/x-pack/plugins/siem/public/timelines/store/timeline/epic.ts +++ b/x-pack/plugins/siem/public/timelines/store/timeline/epic.ts @@ -33,8 +33,13 @@ import { Filter, MatchAllFilter, } from '../../../../../../.../../../src/plugins/data/public'; -import { TimelineType } from '../../../../common/types/timeline'; -import { TimelineInput, ResponseTimeline, TimelineResult } from '../../../graphql/types'; +import { TimelineStatus } from '../../../../common/types/timeline'; +import { + TimelineType, + TimelineInput, + ResponseTimeline, + TimelineResult, +} from '../../../graphql/types'; import { AppApolloClient } from '../../../common/lib/lib'; import { addError } from '../../../common/store/app/actions'; import { NotesById } from '../../../common/store/app/model'; @@ -152,10 +157,8 @@ export const createTimelineEpic = (): Epic< return true; } if (action.type === createTimeline.type && isItAtimelineAction(timelineId)) { - if (timelineObj.timelineType !== 'draft') { - myEpicTimelineId.setTimelineVersion(null); - myEpicTimelineId.setTimelineId(null); - } + myEpicTimelineId.setTimelineVersion(null); + myEpicTimelineId.setTimelineId(null); } else if (action.type === addTimeline.type && isItAtimelineAction(timelineId)) { const addNewTimeline: TimelineModel = get('payload.timeline', action); myEpicTimelineId.setTimelineId(addNewTimeline.savedObjectId); @@ -243,6 +246,7 @@ export const createTimelineEpic = (): Epic< ...savedTimeline, savedObjectId: response.timeline.savedObjectId, version: response.timeline.version, + status: response.timeline.status ?? TimelineStatus.active, timelineType: response.timeline.timelineType ?? TimelineType.default, templateTimelineId: response.timeline.templateTimelineId ?? null, templateTimelineVersion: response.timeline.templateTimelineVersion ?? null, @@ -299,6 +303,7 @@ const timelineInput: TimelineInput = { dateRange: null, savedQueryId: null, sort: null, + status: null, }; export const convertTimelineAsInput = ( diff --git a/x-pack/plugins/siem/public/timelines/store/timeline/model.ts b/x-pack/plugins/siem/public/timelines/store/timeline/model.ts index 8f37636910e2e..df5e2a99e0248 100644 --- a/x-pack/plugins/siem/public/timelines/store/timeline/model.ts +++ b/x-pack/plugins/siem/public/timelines/store/timeline/model.ts @@ -6,11 +6,14 @@ import { Filter } from '../../../../../../../src/plugins/data/public'; -import { TimelineTypeLiteralWithNull } from '../../../../common/types/timeline'; - import { DataProvider } from '../../components/timeline/data_providers/data_provider'; import { Sort } from '../../components/timeline/body/sort'; -import { PinnedEvent, TimelineNonEcsData } from '../../../graphql/types'; +import { + PinnedEvent, + TimelineNonEcsData, + TimelineType, + TimelineStatus, +} from '../../../graphql/types'; import { KueryFilterQuery, SerializedFilterQuery } from '../../../common/store/model'; export const DEFAULT_PAGE_COUNT = 2; // Eui Pager will not render unless this is a minimum of 2 pages @@ -81,7 +84,7 @@ export interface TimelineModel { /** Title */ title: string; /** timelineType: default | template */ - timelineType: TimelineTypeLiteralWithNull; + timelineType: TimelineType; /** an unique id for template timeline */ templateTimelineId: string | null; /** null for default timeline, number for template timeline */ @@ -107,6 +110,8 @@ export interface TimelineModel { showRowRenderers: boolean; /** Specifies which column the timeline is sorted on, and the direction (ascending / descending) */ sort: Sort; + /** status: active | draft */ + status: TimelineStatus; /** Persists the UI state (width) of the timeline flyover */ width: number; /** timeline is saving */ @@ -153,6 +158,7 @@ export type SubsetTimelineModel = Readonly< | 'savedObjectId' | 'version' | 'timelineType' + | 'status' > >; diff --git a/x-pack/plugins/siem/public/timelines/store/timeline/reducer.test.ts b/x-pack/plugins/siem/public/timelines/store/timeline/reducer.test.ts index 65c78ca8efdb2..66cd73a35f946 100644 --- a/x-pack/plugins/siem/public/timelines/store/timeline/reducer.test.ts +++ b/x-pack/plugins/siem/public/timelines/store/timeline/reducer.test.ts @@ -6,7 +6,7 @@ import { cloneDeep, set } from 'lodash/fp'; -import { TimelineType } from '../../../../common/types/timeline'; +import { TimelineType, TimelineStatus } from '../../../../common/types/timeline'; import { IS_OPERATOR, @@ -100,6 +100,7 @@ const timelineByIdMock: TimelineById = { columnId: '@timestamp', sortDirection: Direction.desc, }, + status: TimelineStatus.active, width: DEFAULT_TIMELINE_WIDTH, isSaving: false, version: null, @@ -1131,6 +1132,7 @@ describe('Timeline', () => { columnId: '@timestamp', sortDirection: Direction.desc, }, + status: TimelineStatus.active, pinnedEventIds: {}, pinnedEventsSaveObject: {}, itemsPerPage: 25, @@ -1226,6 +1228,7 @@ describe('Timeline', () => { columnId: '@timestamp', sortDirection: Direction.desc, }, + status: TimelineStatus.active, pinnedEventIds: {}, pinnedEventsSaveObject: {}, itemsPerPage: 25, @@ -1427,6 +1430,7 @@ describe('Timeline', () => { columnId: '@timestamp', sortDirection: Direction.desc, }, + status: TimelineStatus.active, pinnedEventIds: {}, pinnedEventsSaveObject: {}, itemsPerPage: 25, @@ -1522,6 +1526,7 @@ describe('Timeline', () => { columnId: '@timestamp', sortDirection: Direction.desc, }, + status: TimelineStatus.active, pinnedEventIds: {}, pinnedEventsSaveObject: {}, itemsPerPage: 25, @@ -1712,6 +1717,7 @@ describe('Timeline', () => { columnId: '@timestamp', sortDirection: Direction.desc, }, + status: TimelineStatus.active, pinnedEventIds: {}, pinnedEventsSaveObject: {}, itemsPerPage: 50, @@ -1791,6 +1797,7 @@ describe('Timeline', () => { columnId: '@timestamp', sortDirection: Direction.desc, }, + status: TimelineStatus.active, pinnedEventIds: {}, pinnedEventsSaveObject: {}, itemsPerPage: 25, @@ -1894,6 +1901,7 @@ describe('Timeline', () => { columnId: '@timestamp', sortDirection: Direction.desc, }, + status: TimelineStatus.active, pinnedEventIds: {}, pinnedEventsSaveObject: {}, itemsPerPage: 25, diff --git a/x-pack/plugins/siem/public/types.ts b/x-pack/plugins/siem/public/types.ts new file mode 100644 index 0000000000000..6c338d47cf63c --- /dev/null +++ b/x-pack/plugins/siem/public/types.ts @@ -0,0 +1,47 @@ +/* + * 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 { CoreStart } from '../../../../src/core/public'; + +import { HomePublicPluginSetup } from '../../../../src/plugins/home/public'; +import { DataPublicPluginStart } from '../../../../src/plugins/data/public'; +import { EmbeddableStart } from '../../../../src/plugins/embeddable/public'; +import { Start as NewsfeedStart } from '../../../../src/plugins/newsfeed/public'; +import { Start as InspectorStart } from '../../../../src/plugins/inspector/public'; +import { UiActionsStart } from '../../../../src/plugins/ui_actions/public'; +import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/public'; +import { IngestManagerStart } from '../../ingest_manager/public'; +import { + TriggersAndActionsUIPublicPluginSetup as TriggersActionsSetup, + TriggersAndActionsUIPublicPluginStart as TriggersActionsStart, +} from '../../triggers_actions_ui/public'; +import { SecurityPluginSetup } from '../../security/public'; + +export interface SetupPlugins { + home: HomePublicPluginSetup; + security: SecurityPluginSetup; + triggers_actions_ui: TriggersActionsSetup; + usageCollection?: UsageCollectionSetup; +} + +export interface StartPlugins { + data: DataPublicPluginStart; + embeddable: EmbeddableStart; + inspector: InspectorStart; + ingestManager: IngestManagerStart; + newsfeed?: NewsfeedStart; + triggers_actions_ui: TriggersActionsStart; + uiActions: UiActionsStart; +} + +export type StartServices = CoreStart & + StartPlugins & { + security: SecurityPluginSetup; + }; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface PluginSetup {} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface PluginStart {} diff --git a/x-pack/plugins/endpoint/scripts/README.md b/x-pack/plugins/siem/scripts/endpoint/README.md similarity index 97% rename from x-pack/plugins/endpoint/scripts/README.md rename to x-pack/plugins/siem/scripts/endpoint/README.md index f0c8c5a9b0b66..84e92d8c397e1 100644 --- a/x-pack/plugins/endpoint/scripts/README.md +++ b/x-pack/plugins/siem/scripts/endpoint/README.md @@ -11,7 +11,7 @@ Example command sequence to get ES and kibana running with sample data after ins ```yarn es snapshot``` -> starts ES -```npx yarn start --xpack.endpoint.enabled=true --no-base-path``` -> starts kibana +```npx yarn start --xpack.siem.endpoint.enabled=true --no-base-path``` -> starts kibana ```cd ~/path/to/kibana/x-pack/plugins/endpoint``` diff --git a/x-pack/plugins/endpoint/scripts/alert_mapping.json b/x-pack/plugins/siem/scripts/endpoint/alert_mapping.json similarity index 100% rename from x-pack/plugins/endpoint/scripts/alert_mapping.json rename to x-pack/plugins/siem/scripts/endpoint/alert_mapping.json diff --git a/x-pack/plugins/endpoint/scripts/cli_tsconfig.json b/x-pack/plugins/siem/scripts/endpoint/cli_tsconfig.json similarity index 68% rename from x-pack/plugins/endpoint/scripts/cli_tsconfig.json rename to x-pack/plugins/siem/scripts/endpoint/cli_tsconfig.json index 25afe109a42ea..5c68f8ee0abf2 100644 --- a/x-pack/plugins/endpoint/scripts/cli_tsconfig.json +++ b/x-pack/plugins/siem/scripts/endpoint/cli_tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../../tsconfig.json", "compilerOptions": { "target": "es2019", "resolveJsonModule": true } } - \ No newline at end of file diff --git a/x-pack/plugins/endpoint/scripts/event_mapping.json b/x-pack/plugins/siem/scripts/endpoint/event_mapping.json similarity index 100% rename from x-pack/plugins/endpoint/scripts/event_mapping.json rename to x-pack/plugins/siem/scripts/endpoint/event_mapping.json diff --git a/x-pack/plugins/endpoint/scripts/policy_mapping.json b/x-pack/plugins/siem/scripts/endpoint/policy_mapping.json similarity index 100% rename from x-pack/plugins/endpoint/scripts/policy_mapping.json rename to x-pack/plugins/siem/scripts/endpoint/policy_mapping.json diff --git a/x-pack/plugins/endpoint/scripts/resolver_generator.ts b/x-pack/plugins/siem/scripts/endpoint/resolver_generator.ts similarity index 93% rename from x-pack/plugins/endpoint/scripts/resolver_generator.ts rename to x-pack/plugins/siem/scripts/endpoint/resolver_generator.ts index 30752877db824..68d578173719c 100644 --- a/x-pack/plugins/endpoint/scripts/resolver_generator.ts +++ b/x-pack/plugins/siem/scripts/endpoint/resolver_generator.ts @@ -7,7 +7,7 @@ import * as yargs from 'yargs'; import seedrandom from 'seedrandom'; import { Client, ClientOptions } from '@elastic/elasticsearch'; import { ResponseError } from '@elastic/elasticsearch/lib/errors'; -import { EndpointDocGenerator, Event } from '../common/generate_data'; +import { EndpointDocGenerator, Event } from '../../common/endpoint/generate_data'; import { default as eventMapping } from './event_mapping.json'; import { default as alertMapping } from './alert_mapping.json'; import { default as policyMapping } from './policy_mapping.json'; @@ -142,6 +142,7 @@ async function main() { if (err instanceof ResponseError && err.statusCode !== 404) { // eslint-disable-next-line no-console console.log(err); + // eslint-disable-next-line no-process-exit process.exit(1); } } @@ -173,6 +174,7 @@ async function main() { } catch (err) { // eslint-disable-next-line no-console console.log(err); + // eslint-disable-next-line no-process-exit process.exit(1); } @@ -180,6 +182,7 @@ async function main() { await createIndex(client, argv.eventIndex, eventMapping); await createIndex(client, argv.policyIndex, policyMapping); if (argv.setupOnly) { + // eslint-disable-next-line no-process-exit process.exit(0); } @@ -187,7 +190,7 @@ async function main() { if (!seed) { seed = Math.random().toString(); // eslint-disable-next-line no-console - console.log('No seed supplied, using random seed: ' + seed); + console.log(`No seed supplied, using random seed: ${seed}`); } const random = seedrandom(seed); for (let i = 0; i < argv.numHosts; i++) { @@ -229,6 +232,7 @@ async function main() { k++; } const body = resolverDocs.reduce( + // eslint-disable-next-line @typescript-eslint/no-explicit-any (array: Array>, doc) => ( array.push({ index: { _index: argv.eventIndex } }, doc), array ), @@ -240,6 +244,7 @@ async function main() { } } +// eslint-disable-next-line @typescript-eslint/no-explicit-any async function createIndex(client: Client, index: string, mapping: any) { try { await client.indices.create({ @@ -253,6 +258,7 @@ async function createIndex(client: Client, index: string, mapping: any) { ) { // eslint-disable-next-line no-console console.log(err.body); + // eslint-disable-next-line no-process-exit process.exit(1); } } diff --git a/x-pack/plugins/siem/server/config.ts b/x-pack/plugins/siem/server/config.ts index 4b0e8d34ef1a0..f7d961ae3ec5c 100644 --- a/x-pack/plugins/siem/server/config.ts +++ b/x-pack/plugins/siem/server/config.ts @@ -16,6 +16,19 @@ export const configSchema = schema.object({ maxTimelineImportExportSize: schema.number({ defaultValue: 10000 }), maxTimelineImportPayloadBytes: schema.number({ defaultValue: 10485760 }), [SIGNALS_INDEX_KEY]: schema.string({ defaultValue: DEFAULT_SIGNALS_INDEX }), + /** + * Host Endpoint Configuration + */ + endpointResultListDefaultFirstPageIndex: schema.number({ defaultValue: 0 }), + endpointResultListDefaultPageSize: schema.number({ defaultValue: 10 }), + + /** + * Alert Endpoint Configuration + */ + alertResultListDefaultDateRange: schema.object({ + from: schema.string({ defaultValue: 'now-15m' }), + to: schema.string({ defaultValue: 'now' }), + }), }); export const createConfig$ = (context: PluginInitializerContext) => diff --git a/x-pack/plugins/endpoint/server/routes/alerts/alerts.test.ts b/x-pack/plugins/siem/server/endpoint/alerts/handlers/alerts.test.ts similarity index 89% rename from x-pack/plugins/endpoint/server/routes/alerts/alerts.test.ts rename to x-pack/plugins/siem/server/endpoint/alerts/handlers/alerts.test.ts index 1124c977ff924..37bf4bbfcbbb2 100644 --- a/x-pack/plugins/endpoint/server/routes/alerts/alerts.test.ts +++ b/x-pack/plugins/siem/server/endpoint/alerts/handlers/alerts.test.ts @@ -8,12 +8,12 @@ import { elasticsearchServiceMock, httpServiceMock, loggingServiceMock, -} from '../../../../../../src/core/server/mocks'; -import { registerAlertRoutes } from './index'; -import { EndpointConfigSchema } from '../../config'; -import { alertingIndexGetQuerySchema } from '../../../common/schema/alert_index'; +} from '../../../../../../../src/core/server/mocks'; +import { registerAlertRoutes } from '../routes'; +import { alertingIndexGetQuerySchema } from '../../../../common/endpoint_alerts/schema/alert_index'; import { createMockAgentService, createMockIndexPatternRetriever } from '../../mocks'; import { EndpointAppContextService } from '../../endpoint_app_context_services'; +import { createMockConfig } from '../../../lib/detection_engine/routes/__mocks__'; describe('test alerts route', () => { let routerMock: jest.Mocked; @@ -36,7 +36,7 @@ describe('test alerts route', () => { registerAlertRoutes(routerMock, { logFactory: loggingServiceMock.create(), service: endpointAppContextService, - config: () => Promise.resolve(EndpointConfigSchema.validate({})), + config: () => Promise.resolve(createMockConfig()), }); }); diff --git a/x-pack/plugins/endpoint/server/routes/alerts/details/handlers.ts b/x-pack/plugins/siem/server/endpoint/alerts/handlers/details/index.ts similarity index 89% rename from x-pack/plugins/endpoint/server/routes/alerts/details/handlers.ts rename to x-pack/plugins/siem/server/endpoint/alerts/handlers/details/index.ts index ab6d1850e425d..a829cdd14027c 100644 --- a/x-pack/plugins/endpoint/server/routes/alerts/details/handlers.ts +++ b/x-pack/plugins/siem/server/endpoint/alerts/handlers/details/index.ts @@ -5,11 +5,11 @@ */ import { GetResponse } from 'elasticsearch'; import { KibanaRequest, RequestHandler } from 'kibana/server'; -import { AlertEvent } from '../../../../common/types'; +import { AlertEvent } from '../../../../../common/endpoint/types'; import { EndpointAppContext } from '../../../types'; -import { AlertDetailsRequestParams } from '../types'; -import { AlertDetailsPagination } from './lib'; -import { getHostData } from '../../metadata'; +import { AlertDetailsRequestParams } from '../../../../../common/endpoint_alerts/types'; +import { AlertDetailsPagination } from './lib/pagination'; +import { getHostData } from '../../../routes/metadata'; import { AlertId, AlertIdError } from '../lib'; export const alertDetailsHandlerWrapper = function( diff --git a/x-pack/plugins/endpoint/server/routes/alerts/details/lib/pagination.ts b/x-pack/plugins/siem/server/endpoint/alerts/handlers/details/lib/pagination.ts similarity index 81% rename from x-pack/plugins/endpoint/server/routes/alerts/details/lib/pagination.ts rename to x-pack/plugins/siem/server/endpoint/alerts/handlers/details/lib/pagination.ts index 5c95b1217d829..e12bd9e4c8de9 100644 --- a/x-pack/plugins/endpoint/server/routes/alerts/details/lib/pagination.ts +++ b/x-pack/plugins/siem/server/endpoint/alerts/handlers/details/lib/pagination.ts @@ -5,14 +5,20 @@ */ import { GetResponse, SearchResponse } from 'elasticsearch'; -import { AlertEvent, AlertHits, AlertAPIOrdering } from '../../../../../common/types'; -import { AlertConstants } from '../../../../../common/alert_constants'; +import { AlertEvent } from '../../../../../../common/endpoint/types'; +import { + AlertHits, + AlertAPIOrdering, + AlertSearchQuery, + SearchCursor, + AlertDetailsRequestParams, +} from '../../../../../../common/endpoint_alerts/types'; +import { AlertConstants } from '../../../../../../common/endpoint_alerts/alert_constants'; import { EndpointConfigType } from '../../../../config'; import { searchESForAlerts, Pagination, AlertId } from '../../lib'; -import { AlertSearchQuery, SearchCursor, AlertDetailsRequestParams } from '../../types'; -import { BASE_ALERTS_ROUTE } from '../..'; -import { RequestHandlerContext } from '../../../../../../../../src/core/server'; -import { Filter } from '../../../../../../../../src/plugins/data/server'; +import { BASE_ALERTS_ROUTE } from '../../../routes'; +import { RequestHandlerContext } from '../../../../../../../../../src/core/server'; +import { Filter } from '../../../../../../../../../src/plugins/data/server'; /** * Pagination class for alert details. diff --git a/x-pack/plugins/endpoint/server/routes/alerts/details/schemas.ts b/x-pack/plugins/siem/server/endpoint/alerts/handlers/details/schemas.ts similarity index 100% rename from x-pack/plugins/endpoint/server/routes/alerts/details/schemas.ts rename to x-pack/plugins/siem/server/endpoint/alerts/handlers/details/schemas.ts diff --git a/x-pack/plugins/siem/server/endpoint/alerts/handlers/index_pattern.ts b/x-pack/plugins/siem/server/endpoint/alerts/handlers/index_pattern.ts new file mode 100644 index 0000000000000..cb40be586560f --- /dev/null +++ b/x-pack/plugins/siem/server/endpoint/alerts/handlers/index_pattern.ts @@ -0,0 +1,28 @@ +/* + * 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 { Logger, RequestHandler } from 'kibana/server'; +import { EndpointAppContext } from '../../types'; +import { IndexPatternGetParamsResult } from '../../../../common/endpoint_alerts/types'; + +export function handleIndexPattern( + log: Logger, + endpointAppContext: EndpointAppContext +): RequestHandler { + return async (context, req, res) => { + try { + const indexRetriever = endpointAppContext.service.getIndexPatternRetriever(); + return res.ok({ + body: { + indexPattern: await indexRetriever.getIndexPattern(context, req.params.datasetPath), + }, + }); + } catch (error) { + log.warn(error); + return res.notFound({ body: error }); + } + }; +} diff --git a/x-pack/plugins/endpoint/server/routes/alerts/lib/alert_id.ts b/x-pack/plugins/siem/server/endpoint/alerts/handlers/lib/alert_id.ts similarity index 100% rename from x-pack/plugins/endpoint/server/routes/alerts/lib/alert_id.ts rename to x-pack/plugins/siem/server/endpoint/alerts/handlers/lib/alert_id.ts diff --git a/x-pack/plugins/endpoint/server/routes/alerts/lib/error.ts b/x-pack/plugins/siem/server/endpoint/alerts/handlers/lib/error.ts similarity index 82% rename from x-pack/plugins/endpoint/server/routes/alerts/lib/error.ts rename to x-pack/plugins/siem/server/endpoint/alerts/handlers/lib/error.ts index 7b00634b25c9c..1ba92c64d3cde 100644 --- a/x-pack/plugins/endpoint/server/routes/alerts/lib/error.ts +++ b/x-pack/plugins/siem/server/endpoint/alerts/handlers/lib/error.ts @@ -5,6 +5,7 @@ */ export class AlertIdError extends Error { + // eslint-disable-next-line @typescript-eslint/no-useless-constructor constructor(message: string) { super(message); } diff --git a/x-pack/plugins/endpoint/server/routes/alerts/lib/index.ts b/x-pack/plugins/siem/server/endpoint/alerts/handlers/lib/index.ts similarity index 90% rename from x-pack/plugins/endpoint/server/routes/alerts/lib/index.ts rename to x-pack/plugins/siem/server/endpoint/alerts/handlers/lib/index.ts index 1c98e3c615669..4f0a7ba2450dc 100644 --- a/x-pack/plugins/endpoint/server/routes/alerts/lib/index.ts +++ b/x-pack/plugins/siem/server/endpoint/alerts/handlers/lib/index.ts @@ -5,17 +5,18 @@ */ import { SearchResponse } from 'elasticsearch'; import { IScopedClusterClient } from 'kibana/server'; -import { JsonObject } from '../../../../../../../src/plugins/kibana_utils/public'; -import { esQuery } from '../../../../../../../src/plugins/data/server'; -import { AlertEvent, AlertAPIOrdering } from '../../../../common/types'; -import { AlertConstants } from '../../../../common/alert_constants'; +import { AlertEvent } from '../../../../../common/endpoint/types'; +import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/public'; +import { esQuery } from '../../../../../../../../src/plugins/data/server'; import { + AlertAPIOrdering, AlertSearchQuery, AlertSearchRequest, AlertSearchRequestWrapper, AlertSort, UndefinedResultPosition, -} from '../types'; +} from '../../../../../common/endpoint_alerts/types'; +import { AlertConstants } from '../../../../../common/endpoint_alerts/alert_constants'; export { AlertIdError } from './error'; export { Pagination } from './pagination'; @@ -40,7 +41,7 @@ function buildQuery(query: AlertSearchQuery): JsonObject { ? [ { range: { - ['@timestamp']: { + '@timestamp': { gte: query.dateRange.from, lte: query.dateRange.to, }, diff --git a/x-pack/plugins/endpoint/server/routes/alerts/lib/pagination.ts b/x-pack/plugins/siem/server/endpoint/alerts/handlers/lib/pagination.ts similarity index 89% rename from x-pack/plugins/endpoint/server/routes/alerts/lib/pagination.ts rename to x-pack/plugins/siem/server/endpoint/alerts/handlers/lib/pagination.ts index fc408878f8956..d0ca493bf7183 100644 --- a/x-pack/plugins/endpoint/server/routes/alerts/lib/pagination.ts +++ b/x-pack/plugins/siem/server/endpoint/alerts/handlers/lib/pagination.ts @@ -5,7 +5,7 @@ */ import { EndpointConfigType } from '../../../config'; -import { RequestHandlerContext } from '../../../../../../../src/core/server'; +import { RequestHandlerContext } from '../../../../../../../../src/core/server'; /** * Abstract Pagination class for determining next/prev urls, diff --git a/x-pack/plugins/endpoint/server/routes/alerts/list/handlers.ts b/x-pack/plugins/siem/server/endpoint/alerts/handlers/list/index.ts similarity index 93% rename from x-pack/plugins/endpoint/server/routes/alerts/list/handlers.ts rename to x-pack/plugins/siem/server/endpoint/alerts/handlers/list/index.ts index 44a0cf8744a9e..ebea12191ef10 100644 --- a/x-pack/plugins/endpoint/server/routes/alerts/list/handlers.ts +++ b/x-pack/plugins/siem/server/endpoint/alerts/handlers/list/index.ts @@ -7,7 +7,7 @@ import { RequestHandler } from 'kibana/server'; import { EndpointAppContext } from '../../../types'; import { searchESForAlerts } from '../lib'; import { getRequestData, mapToAlertResultList } from './lib'; -import { AlertingIndexGetQueryResult } from '../../../../common/types'; +import { AlertingIndexGetQueryResult } from '../../../../../common/endpoint_alerts/types'; export const alertListHandlerWrapper = function( endpointAppContext: EndpointAppContext diff --git a/x-pack/plugins/endpoint/server/routes/alerts/list/lib/index.ts b/x-pack/plugins/siem/server/endpoint/alerts/handlers/list/lib/index.ts similarity index 93% rename from x-pack/plugins/endpoint/server/routes/alerts/list/lib/index.ts rename to x-pack/plugins/siem/server/endpoint/alerts/handlers/list/lib/index.ts index 0af8f6cf792dd..18e38280c7a0d 100644 --- a/x-pack/plugins/endpoint/server/routes/alerts/list/lib/index.ts +++ b/x-pack/plugins/siem/server/endpoint/alerts/handlers/list/lib/index.ts @@ -7,18 +7,18 @@ import { decode } from 'rison-node'; import { SearchResponse } from 'elasticsearch'; import { KibanaRequest } from 'kibana/server'; import { RequestHandlerContext } from 'src/core/server'; -import { Query, Filter, TimeRange } from '../../../../../../../../src/plugins/data/server'; +import { AlertEvent } from '../../../../../../common/endpoint/types'; +import { Query, Filter, TimeRange } from '../../../../../../../../../src/plugins/data/server'; import { - AlertEvent, AlertData, AlertResultList, AlertHits, ESTotal, AlertingIndexGetQueryResult, -} from '../../../../../common/types'; -import { AlertConstants } from '../../../../../common/alert_constants'; + AlertSearchQuery, +} from '../../../../../../common/endpoint_alerts/types'; +import { AlertConstants } from '../../../../../../common/endpoint_alerts/alert_constants'; import { EndpointAppContext } from '../../../../types'; -import { AlertSearchQuery } from '../../types'; import { AlertListPagination } from './pagination'; import { AlertId } from '../../lib'; diff --git a/x-pack/plugins/endpoint/server/routes/alerts/list/lib/pagination.ts b/x-pack/plugins/siem/server/endpoint/alerts/handlers/list/lib/pagination.ts similarity index 93% rename from x-pack/plugins/endpoint/server/routes/alerts/list/lib/pagination.ts rename to x-pack/plugins/siem/server/endpoint/alerts/handlers/list/lib/pagination.ts index 7bebe3d9288c3..0a831714275ee 100644 --- a/x-pack/plugins/endpoint/server/routes/alerts/list/lib/pagination.ts +++ b/x-pack/plugins/siem/server/endpoint/alerts/handlers/list/lib/pagination.ts @@ -7,11 +7,10 @@ import { get } from 'lodash'; import { RisonValue, encode } from 'rison-node'; import { RequestHandlerContext } from 'src/core/server'; -import { AlertHits } from '../../../../../common/types'; +import { AlertHits, AlertSearchQuery } from '../../../../../../common/endpoint_alerts/types'; import { EndpointConfigType } from '../../../../config'; -import { AlertSearchQuery } from '../../types'; -import { Pagination } from '../../lib'; -import { BASE_ALERTS_ROUTE } from '../..'; +import { Pagination } from '../../lib/pagination'; +import { BASE_ALERTS_ROUTE } from '../../../routes'; /** * Pagination class for alert list. diff --git a/x-pack/plugins/endpoint/server/index_pattern.ts b/x-pack/plugins/siem/server/endpoint/alerts/index_pattern.ts similarity index 91% rename from x-pack/plugins/endpoint/server/index_pattern.ts rename to x-pack/plugins/siem/server/endpoint/alerts/index_pattern.ts index f4bb1460aee4b..1cbdf96c5bcee 100644 --- a/x-pack/plugins/endpoint/server/index_pattern.ts +++ b/x-pack/plugins/siem/server/endpoint/alerts/index_pattern.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ import { Logger, LoggerFactory, RequestHandlerContext } from 'kibana/server'; -import { AlertConstants } from '../common/alert_constants'; -import { ESIndexPatternService } from '../../ingest_manager/server'; +import { AlertConstants } from '../../../common/endpoint_alerts/alert_constants'; +import { ESIndexPatternService } from '../../../../ingest_manager/server'; export interface IndexPatternRetriever { getIndexPattern(ctx: RequestHandlerContext, datasetPath: string): Promise; @@ -34,7 +34,7 @@ export class IngestIndexPatternRetriever implements IndexPatternRetriever { * @returns a string representing the index pattern (e.g. `events-endpoint-*`) */ async getEventIndexPattern(ctx: RequestHandlerContext) { - return await this.getIndexPattern(ctx, AlertConstants.EVENT_DATASET); + return this.getIndexPattern(ctx, AlertConstants.EVENT_DATASET); } /** @@ -44,7 +44,7 @@ export class IngestIndexPatternRetriever implements IndexPatternRetriever { * @returns a string representing the index pattern (e.g. `metrics-endpoint-*`) */ async getMetadataIndexPattern(ctx: RequestHandlerContext) { - return await this.getIndexPattern(ctx, IngestIndexPatternRetriever.metadataDataset); + return this.getIndexPattern(ctx, IngestIndexPatternRetriever.metadataDataset); } /** diff --git a/x-pack/plugins/endpoint/server/routes/alerts/index.ts b/x-pack/plugins/siem/server/endpoint/alerts/routes.ts similarity index 50% rename from x-pack/plugins/endpoint/server/routes/alerts/index.ts rename to x-pack/plugins/siem/server/endpoint/alerts/routes.ts index b61f90b5b17f5..07cca9e80d88b 100644 --- a/x-pack/plugins/endpoint/server/routes/alerts/index.ts +++ b/x-pack/plugins/siem/server/endpoint/alerts/routes.ts @@ -4,11 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ import { IRouter } from 'kibana/server'; -import { EndpointAppContext } from '../../types'; -import { AlertConstants } from '../../../common/alert_constants'; -import { alertListHandlerWrapper } from './list'; -import { alertDetailsHandlerWrapper, alertDetailsReqSchema } from './details'; -import { alertingIndexGetQuerySchema } from '../../../common/schema/alert_index'; +import { EndpointAppContext } from '../types'; +import { AlertConstants } from '../../../common/endpoint_alerts/alert_constants'; +import { alertListHandlerWrapper } from './handlers/list'; +import { alertDetailsHandlerWrapper } from './handlers/details'; +import { alertDetailsReqSchema } from './handlers/details/schemas'; +import { alertingIndexGetQuerySchema } from '../../../common/endpoint_alerts/schema/alert_index'; +import { indexPatternGetParamsSchema } from '../../../common/endpoint_alerts/schema/index_pattern'; +import { handleIndexPattern } from './handlers/index_pattern'; export const BASE_ALERTS_ROUTE = `${AlertConstants.BASE_API_URL}/alerts`; @@ -34,4 +37,15 @@ export function registerAlertRoutes(router: IRouter, endpointAppContext: Endpoin }, alertDetailsHandlerWrapper(endpointAppContext) ); + + const log = endpointAppContext.logFactory.get('index_pattern'); + + router.get( + { + path: `${AlertConstants.INDEX_PATTERN_ROUTE}/{datasetPath}`, + validate: { params: indexPatternGetParamsSchema }, + options: { authRequired: true }, + }, + handleIndexPattern(log, endpointAppContext) + ); } diff --git a/x-pack/plugins/endpoint/server/config.test.ts b/x-pack/plugins/siem/server/endpoint/config.test.ts similarity index 100% rename from x-pack/plugins/endpoint/server/config.test.ts rename to x-pack/plugins/siem/server/endpoint/config.test.ts diff --git a/x-pack/plugins/endpoint/server/config.ts b/x-pack/plugins/siem/server/endpoint/config.ts similarity index 100% rename from x-pack/plugins/endpoint/server/config.ts rename to x-pack/plugins/siem/server/endpoint/config.ts diff --git a/x-pack/plugins/endpoint/server/endpoint_app_context_services.test.ts b/x-pack/plugins/siem/server/endpoint/endpoint_app_context_services.test.ts similarity index 100% rename from x-pack/plugins/endpoint/server/endpoint_app_context_services.test.ts rename to x-pack/plugins/siem/server/endpoint/endpoint_app_context_services.test.ts diff --git a/x-pack/plugins/endpoint/server/endpoint_app_context_services.ts b/x-pack/plugins/siem/server/endpoint/endpoint_app_context_services.ts similarity index 91% rename from x-pack/plugins/endpoint/server/endpoint_app_context_services.ts rename to x-pack/plugins/siem/server/endpoint/endpoint_app_context_services.ts index b087405c7bc5b..5d74c75ebca5c 100644 --- a/x-pack/plugins/endpoint/server/endpoint_app_context_services.ts +++ b/x-pack/plugins/siem/server/endpoint/endpoint_app_context_services.ts @@ -3,8 +3,8 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { IndexPatternRetriever } from './index_pattern'; -import { AgentService } from '../../ingest_manager/server'; +import { IndexPatternRetriever } from './alerts/index_pattern'; +import { AgentService } from '../../../ingest_manager/server'; /** * A singleton that holds shared services that are initialized during the start up phase diff --git a/x-pack/plugins/endpoint/server/mocks.ts b/x-pack/plugins/siem/server/endpoint/mocks.ts similarity index 96% rename from x-pack/plugins/endpoint/server/mocks.ts rename to x-pack/plugins/siem/server/endpoint/mocks.ts index 76a3628562a82..6260a6c630643 100644 --- a/x-pack/plugins/endpoint/server/mocks.ts +++ b/x-pack/plugins/siem/server/endpoint/mocks.ts @@ -9,8 +9,8 @@ import { RequestHandlerContext, SavedObjectsClientContract, } from 'kibana/server'; -import { AgentService, IngestManagerStartContract } from '../../ingest_manager/server'; -import { IndexPatternRetriever } from './index_pattern'; +import { AgentService, IngestManagerStartContract } from '../../../ingest_manager/server'; +import { IndexPatternRetriever } from './alerts/index_pattern'; /** * Creates a mock IndexPatternRetriever for use in tests. diff --git a/x-pack/plugins/endpoint/server/routes/metadata/index.ts b/x-pack/plugins/siem/server/endpoint/routes/metadata/index.ts similarity index 94% rename from x-pack/plugins/endpoint/server/routes/metadata/index.ts rename to x-pack/plugins/siem/server/endpoint/routes/metadata/index.ts index 08950930441df..983739b249596 100644 --- a/x-pack/plugins/endpoint/server/routes/metadata/index.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/metadata/index.ts @@ -9,9 +9,14 @@ import { SearchResponse } from 'elasticsearch'; import { schema } from '@kbn/config-schema'; import { getESQueryHostMetadataByID, kibanaRequestToMetadataListESQuery } from './query_builders'; -import { HostInfo, HostMetadata, HostResultList, HostStatus } from '../../../common/types'; +import { + HostInfo, + HostMetadata, + HostResultList, + HostStatus, +} from '../../../../common/endpoint/types'; import { EndpointAppContext } from '../../types'; -import { AgentStatus } from '../../../../ingest_manager/common/types/models'; +import { AgentStatus } from '../../../../../ingest_manager/common/types/models'; interface HitSource { _source: HostMetadata; @@ -130,10 +135,11 @@ export async function getHostData( return undefined; } - return await enrichHostMetadata(response.hits.hits[0]._source, metadataRequestContext); + return enrichHostMetadata(response.hits.hits[0]._source, metadataRequestContext); } async function mapToHostResultList( + // eslint-disable-next-line @typescript-eslint/no-explicit-any queryParams: Record, searchResponse: SearchResponse, metadataRequestContext: MetadataRequestContext diff --git a/x-pack/plugins/endpoint/server/routes/metadata/metadata.test.ts b/x-pack/plugins/siem/server/endpoint/routes/metadata/metadata.test.ts similarity index 95% rename from x-pack/plugins/endpoint/server/routes/metadata/metadata.test.ts rename to x-pack/plugins/siem/server/endpoint/routes/metadata/metadata.test.ts index 5415ebcae31c4..b2f5866a3ae7d 100644 --- a/x-pack/plugins/endpoint/server/routes/metadata/metadata.test.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/metadata/metadata.test.ts @@ -18,20 +18,25 @@ import { httpServiceMock, loggingServiceMock, savedObjectsClientMock, -} from '../../../../../../src/core/server/mocks'; -import { HostInfo, HostMetadata, HostResultList, HostStatus } from '../../../common/types'; +} from '../../../../../../../src/core/server/mocks'; +import { + HostInfo, + HostMetadata, + HostResultList, + HostStatus, +} from '../../../../common/endpoint/types'; import { SearchResponse } from 'elasticsearch'; import { registerEndpointRoutes } from './index'; -import { EndpointConfigSchema } from '../../config'; import * as data from '../../test_data/all_metadata_data.json'; import { createMockAgentService, createMockMetadataIndexPatternRetriever, createRouteHandlerContext, } from '../../mocks'; -import { AgentService } from '../../../../ingest_manager/server'; +import { AgentService } from '../../../../../ingest_manager/server'; import Boom from 'boom'; import { EndpointAppContextService } from '../../endpoint_app_context_services'; +import { createMockConfig } from '../../../lib/detection_engine/routes/__mocks__'; describe('test endpoint route', () => { let routerMock: jest.Mocked; @@ -39,7 +44,9 @@ describe('test endpoint route', () => { let mockClusterClient: jest.Mocked; let mockScopedClient: jest.Mocked; let mockSavedObjectClient: jest.Mocked; + // eslint-disable-next-line @typescript-eslint/no-explicit-any let routeHandler: RequestHandler; + // eslint-disable-next-line @typescript-eslint/no-explicit-any let routeConfig: RouteConfig; let mockAgentService: jest.Mocked; let endpointAppContextService: EndpointAppContextService; @@ -63,7 +70,7 @@ describe('test endpoint route', () => { registerEndpointRoutes(routerMock, { logFactory: loggingServiceMock.create(), service: endpointAppContextService, - config: () => Promise.resolve(EndpointConfigSchema.validate({})), + config: () => Promise.resolve(createMockConfig()), }); }); @@ -235,6 +242,7 @@ describe('test endpoint route', () => { it('should return a single endpoint with status online', async () => { const mockRequest = httpServerMock.createKibanaRequest({ + // eslint-disable-next-line @typescript-eslint/no-explicit-any params: { id: (data as any).hits.hits[0]._id }, }); const response: SearchResponse = (data as unknown) as SearchResponse< diff --git a/x-pack/plugins/endpoint/server/routes/metadata/query_builders.test.ts b/x-pack/plugins/siem/server/endpoint/routes/metadata/query_builders.test.ts similarity index 91% rename from x-pack/plugins/endpoint/server/routes/metadata/query_builders.test.ts rename to x-pack/plugins/siem/server/endpoint/routes/metadata/query_builders.test.ts index 28bac2fa10e0c..7fa5a8b13db3d 100644 --- a/x-pack/plugins/endpoint/server/routes/metadata/query_builders.test.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/metadata/query_builders.test.ts @@ -3,11 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { httpServerMock, loggingServiceMock } from '../../../../../../src/core/server/mocks'; -import { EndpointConfigSchema } from '../../config'; +import { httpServerMock, loggingServiceMock } from '../../../../../../../src/core/server/mocks'; import { kibanaRequestToMetadataListESQuery, getESQueryHostMetadataByID } from './query_builders'; import { MetadataIndexPattern } from '../../mocks'; import { EndpointAppContextService } from '../../endpoint_app_context_services'; +import { createMockConfig } from '../../../lib/detection_engine/routes/__mocks__'; describe('query builder', () => { describe('MetadataListESQuery', () => { @@ -20,7 +20,7 @@ describe('query builder', () => { { logFactory: loggingServiceMock.create(), service: new EndpointAppContextService(), - config: () => Promise.resolve(EndpointConfigSchema.validate({})), + config: () => Promise.resolve(createMockConfig()), }, MetadataIndexPattern ); @@ -55,6 +55,7 @@ describe('query builder', () => { from: 0, size: 10, index: MetadataIndexPattern, + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as Record); }); }); @@ -71,7 +72,7 @@ describe('query builder', () => { { logFactory: loggingServiceMock.create(), service: new EndpointAppContextService(), - config: () => Promise.resolve(EndpointConfigSchema.validate({})), + config: () => Promise.resolve(createMockConfig()), }, MetadataIndexPattern ); @@ -119,6 +120,7 @@ describe('query builder', () => { from: 0, size: 10, index: MetadataIndexPattern, + // eslint-disable-next-line @typescript-eslint/no-explicit-any } as Record); }); }); diff --git a/x-pack/plugins/endpoint/server/routes/metadata/query_builders.ts b/x-pack/plugins/siem/server/endpoint/routes/metadata/query_builders.ts similarity index 88% rename from x-pack/plugins/endpoint/server/routes/metadata/query_builders.ts rename to x-pack/plugins/siem/server/endpoint/routes/metadata/query_builders.ts index abcc293985f9f..a34113e8d6f62 100644 --- a/x-pack/plugins/endpoint/server/routes/metadata/query_builders.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/metadata/query_builders.ts @@ -4,13 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ import { KibanaRequest } from 'kibana/server'; -import { esKuery } from '../../../../../../src/plugins/data/server'; +import { esKuery } from '../../../../../../../src/plugins/data/server'; import { EndpointAppContext } from '../../types'; export const kibanaRequestToMetadataListESQuery = async ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any request: KibanaRequest, endpointAppContext: EndpointAppContext, index: string + // eslint-disable-next-line @typescript-eslint/no-explicit-any ): Promise> => { const pagingProperties = await getPagingProperties(request, endpointAppContext); return { @@ -46,6 +48,7 @@ export const kibanaRequestToMetadataListESQuery = async ( }; async function getPagingProperties( + // eslint-disable-next-line @typescript-eslint/no-explicit-any request: KibanaRequest, endpointAppContext: EndpointAppContext ) { @@ -65,6 +68,7 @@ async function getPagingProperties( }; } +// eslint-disable-next-line @typescript-eslint/no-explicit-any function buildQueryBody(request: KibanaRequest): Record { if (typeof request?.body?.filter === 'string') { return esKuery.toElasticsearchQuery(esKuery.fromKueryExpression(request.body.filter)); diff --git a/x-pack/plugins/endpoint/server/routes/policy/handlers.test.ts b/x-pack/plugins/siem/server/endpoint/routes/policy/handlers.test.ts similarity index 90% rename from x-pack/plugins/endpoint/server/routes/policy/handlers.test.ts rename to x-pack/plugins/siem/server/endpoint/routes/policy/handlers.test.ts index 9348353425370..25bf2c45aa421 100644 --- a/x-pack/plugins/endpoint/server/routes/policy/handlers.test.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/policy/handlers.test.ts @@ -10,7 +10,6 @@ import { createRouteHandlerContext, } from '../../mocks'; import { getHostPolicyResponseHandler } from './handlers'; -import { EndpointConfigSchema } from '../../config'; import { IScopedClusterClient, KibanaResponseFactory, @@ -21,11 +20,12 @@ import { httpServerMock, loggingServiceMock, savedObjectsClientMock, -} from '../../../../../../src/core/server/mocks'; -import { AgentService } from '../../../../ingest_manager/server/services'; +} from '../../../../../../../src/core/server/mocks'; +import { AgentService } from '../../../../../ingest_manager/server/services'; import { SearchResponse } from 'elasticsearch'; -import { GetHostPolicyResponse, HostPolicyResponse } from '../../../common/types'; -import { EndpointDocGenerator } from '../../../common/generate_data'; +import { GetHostPolicyResponse, HostPolicyResponse } from '../../../../common/endpoint/types'; +import { EndpointDocGenerator } from '../../../../common/endpoint/generate_data'; +import { createMockConfig } from '../../../lib/detection_engine/routes/__mocks__'; describe('test policy response handler', () => { let endpointAppContextService: EndpointAppContextService; @@ -53,7 +53,7 @@ describe('test policy response handler', () => { const hostPolicyResponseHandler = getHostPolicyResponseHandler({ logFactory: loggingServiceMock.create(), service: endpointAppContextService, - config: () => Promise.resolve(EndpointConfigSchema.validate({})), + config: () => Promise.resolve(createMockConfig()), }); mockScopedClient.callAsCurrentUser.mockImplementationOnce(() => Promise.resolve(response)); @@ -76,7 +76,7 @@ describe('test policy response handler', () => { const hostPolicyResponseHandler = getHostPolicyResponseHandler({ logFactory: loggingServiceMock.create(), service: endpointAppContextService, - config: () => Promise.resolve(EndpointConfigSchema.validate({})), + config: () => Promise.resolve(createMockConfig()), }); mockScopedClient.callAsCurrentUser.mockImplementationOnce(() => diff --git a/x-pack/plugins/endpoint/server/routes/policy/handlers.ts b/x-pack/plugins/siem/server/endpoint/routes/policy/handlers.ts similarity index 93% rename from x-pack/plugins/endpoint/server/routes/policy/handlers.ts rename to x-pack/plugins/siem/server/endpoint/routes/policy/handlers.ts index 5a34164c0bb37..000d353ab90f8 100644 --- a/x-pack/plugins/endpoint/server/routes/policy/handlers.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/policy/handlers.ts @@ -5,7 +5,7 @@ */ import { RequestHandler } from 'kibana/server'; import { TypeOf } from '@kbn/config-schema'; -import { GetPolicyResponseSchema } from '../../../common/schema/policy'; +import { GetPolicyResponseSchema } from '../../../../common/endpoint/schema/policy'; import { EndpointAppContext } from '../../types'; import { getPolicyResponseByHostId } from './service'; diff --git a/x-pack/plugins/endpoint/server/routes/policy/index.ts b/x-pack/plugins/siem/server/endpoint/routes/policy/index.ts similarity index 90% rename from x-pack/plugins/endpoint/server/routes/policy/index.ts rename to x-pack/plugins/siem/server/endpoint/routes/policy/index.ts index 4c3bd8e21315c..b233ff1af30fc 100644 --- a/x-pack/plugins/endpoint/server/routes/policy/index.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/policy/index.ts @@ -6,7 +6,7 @@ import { IRouter } from 'kibana/server'; import { EndpointAppContext } from '../../types'; -import { GetPolicyResponseSchema } from '../../../common/schema/policy'; +import { GetPolicyResponseSchema } from '../../../../common/endpoint/schema/policy'; import { getHostPolicyResponseHandler } from './handlers'; export const BASE_POLICY_RESPONSE_ROUTE = `/api/endpoint/policy_response`; diff --git a/x-pack/plugins/endpoint/server/routes/policy/service.test.ts b/x-pack/plugins/siem/server/endpoint/routes/policy/service.test.ts similarity index 86% rename from x-pack/plugins/endpoint/server/routes/policy/service.test.ts rename to x-pack/plugins/siem/server/endpoint/routes/policy/service.test.ts index c7bf65627769e..7c8d006687a6b 100644 --- a/x-pack/plugins/endpoint/server/routes/policy/service.test.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/policy/service.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { GetPolicyResponseSchema } from '../../../common/schema/policy'; +import { GetPolicyResponseSchema } from '../../../../common/endpoint/schema/policy'; describe('test policy handlers schema', () => { it('validate that get policy response query schema', async () => { diff --git a/x-pack/plugins/endpoint/server/routes/policy/service.ts b/x-pack/plugins/siem/server/endpoint/routes/policy/service.ts similarity index 97% rename from x-pack/plugins/endpoint/server/routes/policy/service.ts rename to x-pack/plugins/siem/server/endpoint/routes/policy/service.ts index 7ec2c65634110..5e3c3537ec591 100644 --- a/x-pack/plugins/endpoint/server/routes/policy/service.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/policy/service.ts @@ -6,7 +6,7 @@ import { SearchResponse } from 'elasticsearch'; import { IScopedClusterClient } from 'kibana/server'; -import { GetHostPolicyResponse, HostPolicyResponse } from '../../../common/types'; +import { GetHostPolicyResponse, HostPolicyResponse } from '../../../../common/endpoint/types'; export function getESQueryPolicyResponseByHostID(hostID: string, index: string) { return { diff --git a/x-pack/plugins/endpoint/server/routes/resolver.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver.ts similarity index 96% rename from x-pack/plugins/endpoint/server/routes/resolver.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver.ts index 3599acacb4f59..9a4f55770f934 100644 --- a/x-pack/plugins/endpoint/server/routes/resolver.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/resolver.ts @@ -11,7 +11,7 @@ import { validateEvents, validateChildren, validateAncestry, -} from '../../common/schema/resolver'; +} from '../../../common/endpoint/schema/resolver'; import { handleEvents } from './resolver/events'; import { handleChildren } from './resolver/children'; import { handleAncestry } from './resolver/ancestry'; diff --git a/x-pack/plugins/endpoint/server/routes/resolver/ancestry.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/ancestry.ts similarity index 94% rename from x-pack/plugins/endpoint/server/routes/resolver/ancestry.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/ancestry.ts index 6648dc5b9e493..233f23bd314c1 100644 --- a/x-pack/plugins/endpoint/server/routes/resolver/ancestry.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/resolver/ancestry.ts @@ -6,7 +6,7 @@ import { RequestHandler, Logger } from 'kibana/server'; import { TypeOf } from '@kbn/config-schema'; -import { validateAncestry } from '../../../common/schema/resolver'; +import { validateAncestry } from '../../../../common/endpoint/schema/resolver'; import { Fetcher } from './utils/fetch'; import { EndpointAppContext } from '../../types'; diff --git a/x-pack/plugins/endpoint/server/routes/resolver/children.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/children.ts similarity index 94% rename from x-pack/plugins/endpoint/server/routes/resolver/children.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/children.ts index bb18b29a4b947..13af514c4c55f 100644 --- a/x-pack/plugins/endpoint/server/routes/resolver/children.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/resolver/children.ts @@ -6,7 +6,7 @@ import { RequestHandler, Logger } from 'kibana/server'; import { TypeOf } from '@kbn/config-schema'; -import { validateChildren } from '../../../common/schema/resolver'; +import { validateChildren } from '../../../../common/endpoint/schema/resolver'; import { Fetcher } from './utils/fetch'; import { EndpointAppContext } from '../../types'; diff --git a/x-pack/plugins/endpoint/server/routes/resolver/events.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/events.ts similarity index 94% rename from x-pack/plugins/endpoint/server/routes/resolver/events.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/events.ts index a70a6e8d097d0..97f718b66a437 100644 --- a/x-pack/plugins/endpoint/server/routes/resolver/events.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/resolver/events.ts @@ -6,7 +6,7 @@ import { TypeOf } from '@kbn/config-schema'; import { RequestHandler, Logger } from 'kibana/server'; -import { validateEvents } from '../../../common/schema/resolver'; +import { validateEvents } from '../../../../common/endpoint/schema/resolver'; import { Fetcher } from './utils/fetch'; import { EndpointAppContext } from '../../types'; diff --git a/x-pack/plugins/endpoint/server/routes/resolver/queries/base.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/queries/base.ts similarity index 91% rename from x-pack/plugins/endpoint/server/routes/resolver/queries/base.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/queries/base.ts index eba4e5581c136..4f6003492fd3a 100644 --- a/x-pack/plugins/endpoint/server/routes/resolver/queries/base.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/resolver/queries/base.ts @@ -6,14 +6,14 @@ import { SearchResponse } from 'elasticsearch'; import { IScopedClusterClient } from 'kibana/server'; -import { ResolverEvent } from '../../../../common/types'; +import { ResolverEvent } from '../../../../../common/endpoint/types'; import { paginate, paginatedResults, PaginationParams, PaginatedResults, } from '../utils/pagination'; -import { JsonObject } from '../../../../../../../src/plugins/kibana_utils/public'; +import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/public'; import { legacyEventIndexPattern } from './legacy_event_index_pattern'; export abstract class ResolverQuery { diff --git a/x-pack/plugins/endpoint/server/routes/resolver/queries/children.test.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/queries/children.test.ts similarity index 100% rename from x-pack/plugins/endpoint/server/routes/resolver/queries/children.test.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/queries/children.test.ts diff --git a/x-pack/plugins/endpoint/server/routes/resolver/queries/children.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/queries/children.ts similarity index 100% rename from x-pack/plugins/endpoint/server/routes/resolver/queries/children.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/queries/children.ts diff --git a/x-pack/plugins/endpoint/server/routes/resolver/queries/events.test.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/queries/events.test.ts similarity index 100% rename from x-pack/plugins/endpoint/server/routes/resolver/queries/events.test.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/queries/events.test.ts diff --git a/x-pack/plugins/endpoint/server/routes/resolver/queries/events.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/queries/events.ts similarity index 95% rename from x-pack/plugins/endpoint/server/routes/resolver/queries/events.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/queries/events.ts index b622cb8a21111..80c3a0e9acccc 100644 --- a/x-pack/plugins/endpoint/server/routes/resolver/queries/events.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/resolver/queries/events.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { ResolverQuery } from './base'; -import { JsonObject } from '../../../../../../../src/plugins/kibana_utils/public'; +import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/public'; export class EventsQuery extends ResolverQuery { protected legacyQuery(endpointID: string, uniquePIDs: string[], index: string): JsonObject { diff --git a/x-pack/plugins/endpoint/server/routes/resolver/queries/legacy_event_index_pattern.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/queries/legacy_event_index_pattern.ts similarity index 100% rename from x-pack/plugins/endpoint/server/routes/resolver/queries/legacy_event_index_pattern.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/queries/legacy_event_index_pattern.ts diff --git a/x-pack/plugins/endpoint/server/routes/resolver/queries/lifecycle.test.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/queries/lifecycle.test.ts similarity index 100% rename from x-pack/plugins/endpoint/server/routes/resolver/queries/lifecycle.test.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/queries/lifecycle.test.ts diff --git a/x-pack/plugins/endpoint/server/routes/resolver/queries/lifecycle.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/queries/lifecycle.ts similarity index 94% rename from x-pack/plugins/endpoint/server/routes/resolver/queries/lifecycle.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/queries/lifecycle.ts index e775b0cf9b6d2..7dbbdec2fdfcd 100644 --- a/x-pack/plugins/endpoint/server/routes/resolver/queries/lifecycle.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/resolver/queries/lifecycle.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { ResolverQuery } from './base'; -import { JsonObject } from '../../../../../../../src/plugins/kibana_utils/public'; +import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/public'; export class LifecycleQuery extends ResolverQuery { protected legacyQuery(endpointID: string, uniquePIDs: string[], index: string): JsonObject { diff --git a/x-pack/plugins/endpoint/server/routes/resolver/queries/stats.test.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/queries/stats.test.ts similarity index 100% rename from x-pack/plugins/endpoint/server/routes/resolver/queries/stats.test.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/queries/stats.test.ts diff --git a/x-pack/plugins/endpoint/server/routes/resolver/queries/stats.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/queries/stats.ts similarity index 93% rename from x-pack/plugins/endpoint/server/routes/resolver/queries/stats.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/queries/stats.ts index 7db3ab2b0cb1f..5fddf86ea4a7c 100644 --- a/x-pack/plugins/endpoint/server/routes/resolver/queries/stats.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/resolver/queries/stats.ts @@ -5,17 +5,19 @@ */ import { SearchResponse } from 'elasticsearch'; import { ResolverQuery } from './base'; -import { ResolverEvent } from '../../../../common/types'; -import { JsonObject } from '../../../../../../../src/plugins/kibana_utils/public'; +import { ResolverEvent } from '../../../../../common/endpoint/types'; +import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/public'; import { PaginatedResults } from '../utils/pagination'; export class StatsQuery extends ResolverQuery { protected postSearch(response: SearchResponse): PaginatedResults { const alerts = response.aggregations.alerts.ids.buckets.reduce( + // eslint-disable-next-line @typescript-eslint/no-explicit-any (cummulative: any, bucket: any) => ({ ...cummulative, [bucket.key]: bucket.doc_count }), {} ); const events = response.aggregations.events.ids.buckets.reduce( + // eslint-disable-next-line @typescript-eslint/no-explicit-any (cummulative: any, bucket: any) => ({ ...cummulative, [bucket.key]: bucket.doc_count }), {} ); diff --git a/x-pack/plugins/endpoint/server/routes/resolver/tree.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/tree.ts similarity index 95% rename from x-pack/plugins/endpoint/server/routes/resolver/tree.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/tree.ts index 25f15586341d5..3551123393960 100644 --- a/x-pack/plugins/endpoint/server/routes/resolver/tree.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/resolver/tree.ts @@ -6,7 +6,7 @@ import { RequestHandler, Logger } from 'kibana/server'; import { TypeOf } from '@kbn/config-schema'; -import { validateTree } from '../../../common/schema/resolver'; +import { validateTree } from '../../../../common/endpoint/schema/resolver'; import { Fetcher } from './utils/fetch'; import { Tree } from './utils/tree'; import { EndpointAppContext } from '../../types'; diff --git a/x-pack/plugins/endpoint/server/routes/resolver/utils/fetch.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/utils/fetch.ts similarity index 97% rename from x-pack/plugins/endpoint/server/routes/resolver/utils/fetch.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/utils/fetch.ts index 7315b4ee6c618..f0e1a8a9bfc6e 100644 --- a/x-pack/plugins/endpoint/server/routes/resolver/utils/fetch.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/resolver/utils/fetch.ts @@ -5,7 +5,7 @@ */ import { IScopedClusterClient } from 'kibana/server'; -import { entityId, parentEntityId } from '../../../../common/models/event'; +import { entityId, parentEntityId } from '../../../../../common/endpoint/models/event'; import { getPaginationParams } from './pagination'; import { Tree } from './tree'; import { LifecycleQuery } from '../queries/lifecycle'; diff --git a/x-pack/plugins/endpoint/server/routes/resolver/utils/pagination.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/utils/pagination.ts similarity index 83% rename from x-pack/plugins/endpoint/server/routes/resolver/utils/pagination.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/utils/pagination.ts index 20249b81660bb..a47c4442b6cf4 100644 --- a/x-pack/plugins/endpoint/server/routes/resolver/utils/pagination.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/resolver/utils/pagination.ts @@ -5,9 +5,9 @@ */ import { SearchResponse } from 'elasticsearch'; -import { ResolverEvent } from '../../../../common/types'; -import { entityId } from '../../../../common/models/event'; -import { JsonObject } from '../../../../../../../src/plugins/kibana_utils/public'; +import { ResolverEvent } from '../../../../../common/endpoint/types'; +import { entityId } from '../../../../../common/endpoint/models/event'; +import { JsonObject } from '../../../../../../../../src/plugins/kibana_utils/public'; export interface PaginationParams { size: number; @@ -37,8 +37,8 @@ function urlEncodeCursor(data: PaginationCursor): string { } function urlDecodeCursor(value: string): PaginationCursor { - value = value.replace(/\-/g, '+').replace(/_/g, '/'); - const data = Buffer.from(value, 'base64').toString('utf8'); + const localValue = value.replace(/\-/g, '+').replace(/_/g, '/'); + const data = Buffer.from(localValue, 'base64').toString('utf8'); const { timestamp, eventID } = JSON.parse(data); // take some extra care to only grab the things we want // convert the timestamp string to date object @@ -72,7 +72,10 @@ export function paginate( const { size, timestamp, eventID } = pagination; query.sort = [{ '@timestamp': 'asc' }, { [tiebreaker]: 'asc' }]; query.aggs = query.aggs || {}; - query.aggs = Object.assign({}, query.aggs, { totals: { terms: { field: aggregator, size } } }); + query.aggs = { + ...(typeof query.aggs === 'object' ? query.aggs : {}), + totals: { terms: { field: aggregator, size } }, + }; query.size = size; if (timestamp && eventID) { query.search_after = [timestamp, eventID] as Array; @@ -98,6 +101,7 @@ export function paginatedResults(response: SearchResponse): Pagin } const totals = response.aggregations?.totals?.buckets?.reduce( + // eslint-disable-next-line @typescript-eslint/no-explicit-any (cummulative: any, bucket: any) => ({ ...cummulative, [bucket.key]: bucket.doc_count }), {} ); diff --git a/x-pack/plugins/endpoint/server/routes/resolver/utils/tree.ts b/x-pack/plugins/siem/server/endpoint/routes/resolver/utils/tree.ts similarity index 98% rename from x-pack/plugins/endpoint/server/routes/resolver/utils/tree.ts rename to x-pack/plugins/siem/server/endpoint/routes/resolver/utils/tree.ts index 5a55c23b90873..28615117cf7ba 100644 --- a/x-pack/plugins/endpoint/server/routes/resolver/utils/tree.ts +++ b/x-pack/plugins/siem/server/endpoint/routes/resolver/utils/tree.ts @@ -10,8 +10,8 @@ import { ResolverNode, ResolverNodeStats, ResolverNodePagination, -} from '../../../../common/types'; -import { entityId, parentEntityId } from '../../../../common/models/event'; +} from '../../../../../common/endpoint/types'; +import { entityId, parentEntityId } from '../../../../../common/endpoint/models/event'; import { buildPaginationCursor } from './pagination'; type ExtractFunction = (event: ResolverEvent) => string | undefined; diff --git a/x-pack/plugins/endpoint/server/test_data/all_metadata_data.json b/x-pack/plugins/siem/server/endpoint/test_data/all_metadata_data.json similarity index 100% rename from x-pack/plugins/endpoint/server/test_data/all_metadata_data.json rename to x-pack/plugins/siem/server/endpoint/test_data/all_metadata_data.json diff --git a/x-pack/plugins/endpoint/server/types.ts b/x-pack/plugins/siem/server/endpoint/types.ts similarity index 86% rename from x-pack/plugins/endpoint/server/types.ts rename to x-pack/plugins/siem/server/endpoint/types.ts index dfa5950adba5c..fbcc5bc833d73 100644 --- a/x-pack/plugins/endpoint/server/types.ts +++ b/x-pack/plugins/siem/server/endpoint/types.ts @@ -4,15 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ import { LoggerFactory } from 'kibana/server'; -import { EndpointConfigType } from './config'; import { EndpointAppContextService } from './endpoint_app_context_services'; +import { ConfigType } from '../config'; /** * The context for Endpoint apps. */ export interface EndpointAppContext { logFactory: LoggerFactory; - config(): Promise; + config(): Promise; /** * Object readiness is tied to plugin start method diff --git a/x-pack/plugins/siem/server/graphql/timeline/schema.gql.ts b/x-pack/plugins/siem/server/graphql/timeline/schema.gql.ts index 2432af9a379a1..b9aa8534ab0e9 100644 --- a/x-pack/plugins/siem/server/graphql/timeline/schema.gql.ts +++ b/x-pack/plugins/siem/server/graphql/timeline/schema.gql.ts @@ -127,10 +127,14 @@ export const timelineSchema = gql` enum TimelineType { default - draft template } + enum TimelineStatus { + active + draft + } + input TimelineInput { columns: [ColumnHeaderInput!] dataProviders: [DataProviderInput!] @@ -146,6 +150,7 @@ export const timelineSchema = gql` dateRange: DateRangePickerInput savedQueryId: String sort: SortTimelineInput + status: TimelineStatus } input PageInfoTimeline { @@ -245,6 +250,7 @@ export const timelineSchema = gql` savedQueryId: String savedObjectId: String! sort: SortTimelineResult + status: TimelineStatus title: String templateTimelineId: String templateTimelineVersion: Int @@ -279,7 +285,7 @@ export const timelineSchema = gql` extend type Query { getOneTimeline(id: ID!): TimelineResult! - getAllTimeline(pageInfo: PageInfoTimeline, search: String, sort: SortTimeline, onlyUserFavorite: Boolean, timelineType: String): ResponseTimelines! + getAllTimeline(pageInfo: PageInfoTimeline, search: String, sort: SortTimeline, onlyUserFavorite: Boolean, timelineType: TimelineType): ResponseTimelines! } extend type Mutation { diff --git a/x-pack/plugins/siem/server/graphql/types.ts b/x-pack/plugins/siem/server/graphql/types.ts index 5313f4b9df268..4a063647a183d 100644 --- a/x-pack/plugins/siem/server/graphql/types.ts +++ b/x-pack/plugins/siem/server/graphql/types.ts @@ -145,6 +145,8 @@ export interface TimelineInput { savedQueryId?: Maybe; sort?: Maybe; + + status?: Maybe; } export interface ColumnHeaderInput { @@ -342,9 +344,13 @@ export enum TlsFields { _id = '_id', } +export enum TimelineStatus { + active = 'active', + draft = 'draft', +} + export enum TimelineType { default = 'default', - draft = 'draft', template = 'template', } @@ -1956,6 +1962,8 @@ export interface TimelineResult { sort?: Maybe; + status?: Maybe; + title?: Maybe; templateTimelineId?: Maybe; @@ -2239,7 +2247,7 @@ export interface GetAllTimelineQueryArgs { onlyUserFavorite?: Maybe; - timelineType?: Maybe; + timelineType?: Maybe; } export interface AuthenticationsSourceArgs { timerange: TimerangeInput; @@ -2697,7 +2705,7 @@ export namespace QueryResolvers { onlyUserFavorite?: Maybe; - timelineType?: Maybe; + timelineType?: Maybe; } } @@ -8043,6 +8051,8 @@ export namespace TimelineResultResolvers { sort?: SortResolver, TypeParent, TContext>; + status?: StatusResolver, TypeParent, TContext>; + title?: TitleResolver, TypeParent, TContext>; templateTimelineId?: TemplateTimelineIdResolver, TypeParent, TContext>; @@ -8153,6 +8163,11 @@ export namespace TimelineResultResolvers { Parent = TimelineResult, TContext = SiemContext > = Resolver; + export type StatusResolver< + R = Maybe, + Parent = TimelineResult, + TContext = SiemContext + > = Resolver; export type TitleResolver< R = Maybe, Parent = TimelineResult, diff --git a/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/index.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/index.ts index a28eb6ba3ccaa..0cec1832dab83 100644 --- a/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/index.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/index.ts @@ -19,4 +19,10 @@ export const createMockConfig = () => ({ maxRuleImportPayloadBytes: 10485760, maxTimelineImportExportSize: 10000, maxTimelineImportPayloadBytes: 10485760, + endpointResultListDefaultFirstPageIndex: 0, + endpointResultListDefaultPageSize: 10, + alertResultListDefaultDateRange: { + from: 'now-15m', + to: 'now', + }, }); diff --git a/x-pack/plugins/siem/server/lib/timeline/convert_saved_object_to_savedtimeline.ts b/x-pack/plugins/siem/server/lib/timeline/convert_saved_object_to_savedtimeline.ts index 00fb77bfb1647..3246de2190383 100644 --- a/x-pack/plugins/siem/server/lib/timeline/convert_saved_object_to_savedtimeline.ts +++ b/x-pack/plugins/siem/server/lib/timeline/convert_saved_object_to_savedtimeline.ts @@ -4,23 +4,63 @@ * you may not use this file except in compliance with the Elastic License. */ +import { intersection, type, partial, literal, union, string } from 'io-ts/lib/index'; import { failure } from 'io-ts/lib/PathReporter'; import { pipe } from 'fp-ts/lib/pipeable'; import { map, fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; import { - TimelineSavedObjectRuntimeType, + SavedTimelineRuntimeType, + TimelineTypeLiteralWithNullRt, TimelineSavedObject, TimelineType, + TimelineStatus, } from '../../../common/types/timeline'; +// TODO: Added to support legacy TimelineType.draft, can be removed in 7.10 +export const TimelineSavedObjectWithDraftRuntimeType = intersection([ + type({ + id: string, + version: string, + attributes: partial({ + ...SavedTimelineRuntimeType.props, + timelineType: union([TimelineTypeLiteralWithNullRt, literal('draft')]), + }), + }), + partial({ + savedObjectId: string, + }), +]); + +const getTimelineTypeAndStatus = ( + timelineType: TimelineType | 'draft' | null = TimelineType.default, + status: TimelineStatus | null = TimelineStatus.active +) => { + // TODO: Added to support legacy TimelineType.draft, can be removed in 7.10 + // @ts-ignore + if (timelineType === 'draft') { + return { + timelineType: TimelineType.default, + status: TimelineStatus.draft, + }; + } + + return { + timelineType, + status, + }; +}; + export const convertSavedObjectToSavedTimeline = (savedObject: unknown): TimelineSavedObject => { const timeline = pipe( - TimelineSavedObjectRuntimeType.decode(savedObject), + TimelineSavedObjectWithDraftRuntimeType.decode(savedObject), map(savedTimeline => { const attributes = { ...savedTimeline.attributes, - timelineType: savedTimeline.attributes.timelineType ?? TimelineType.default, + ...getTimelineTypeAndStatus( + savedTimeline.attributes.timelineType, + savedTimeline.attributes.status + ), }; return { savedObjectId: savedTimeline.id, diff --git a/x-pack/plugins/siem/server/lib/timeline/default_timeline.ts b/x-pack/plugins/siem/server/lib/timeline/default_timeline.ts index 710a43df1221d..b0ca3ba71f12b 100644 --- a/x-pack/plugins/siem/server/lib/timeline/default_timeline.ts +++ b/x-pack/plugins/siem/server/lib/timeline/default_timeline.ts @@ -6,7 +6,7 @@ import { Direction } from '../../graphql/types'; import { defaultHeaders } from './default_timeline_headers'; -import { SavedTimeline, TimelineType } from '../../../common/types/timeline'; +import { SavedTimeline, TimelineType, TimelineStatus } from '../../../common/types/timeline'; export const draftTimelineDefaults: SavedTimeline = { columns: defaultHeaders, @@ -15,7 +15,7 @@ export const draftTimelineDefaults: SavedTimeline = { eventType: 'all', filters: [], kqlMode: 'filter', - timelineType: TimelineType.draft, + timelineType: TimelineType.default, kqlQuery: { filterQuery: null, }, @@ -24,4 +24,5 @@ export const draftTimelineDefaults: SavedTimeline = { columnId: '@timestamp', sortDirection: Direction.desc, }, + status: TimelineStatus.draft, }; diff --git a/x-pack/plugins/siem/server/lib/timeline/pick_saved_timeline.ts b/x-pack/plugins/siem/server/lib/timeline/pick_saved_timeline.ts index 3b06adf1b751e..40c568ecda741 100644 --- a/x-pack/plugins/siem/server/lib/timeline/pick_saved_timeline.ts +++ b/x-pack/plugins/siem/server/lib/timeline/pick_saved_timeline.ts @@ -8,7 +8,7 @@ import uuid from 'uuid'; import { isEmpty } from 'lodash/fp'; import { AuthenticatedUser } from '../../../../security/common/model'; import { UNAUTHENTICATED_USER } from '../../../common/constants'; -import { SavedTimeline, TimelineType } from '../../../common/types/timeline'; +import { SavedTimeline, TimelineType, TimelineStatus } from '../../../common/types/timeline'; export const pickSavedTimeline = ( timelineId: string | null, @@ -39,10 +39,10 @@ export const pickSavedTimeline = ( savedTimeline.templateTimelineVersion = savedTimeline.templateTimelineVersion + 1; } } - } else if (savedTimeline.timelineType === TimelineType.draft) { - savedTimeline.timelineType = !isEmpty(savedTimeline.title) - ? TimelineType.default - : TimelineType.draft; + } else if (savedTimeline.status === TimelineStatus.draft) { + savedTimeline.status = !isEmpty(savedTimeline.title) + ? TimelineStatus.active + : TimelineStatus.draft; savedTimeline.templateTimelineId = null; savedTimeline.templateTimelineVersion = null; } else { diff --git a/x-pack/plugins/siem/server/lib/timeline/routes/__mocks__/import_timelines.ts b/x-pack/plugins/siem/server/lib/timeline/routes/__mocks__/import_timelines.ts index e06e6c60ac65f..7180f06d853be 100644 --- a/x-pack/plugins/siem/server/lib/timeline/routes/__mocks__/import_timelines.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/__mocks__/import_timelines.ts @@ -5,7 +5,7 @@ */ import { omit } from 'lodash/fp'; -import { TimelineType } from '../../../../../common/types/timeline'; +import { TimelineType, TimelineStatus } from '../../../../../common/types/timeline'; export const mockDuplicateIdErrors = []; @@ -176,7 +176,8 @@ export const mockGetDraftTimelineValue = { updatedBy: 'angela', noteIds: [], pinnedEventIds: ['k-gi8nABm-sIqJ_scOoS'], - timelineType: TimelineType.draft, + timelineType: TimelineType.default, + status: TimelineStatus.draft, }; export const mockParsedTimelineObject = omit( diff --git a/x-pack/plugins/siem/server/lib/timeline/routes/__mocks__/request_responses.ts b/x-pack/plugins/siem/server/lib/timeline/routes/__mocks__/request_responses.ts index 9bcef1f5930d9..470ba1a853b58 100644 --- a/x-pack/plugins/siem/server/lib/timeline/routes/__mocks__/request_responses.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/__mocks__/request_responses.ts @@ -12,7 +12,7 @@ import { } from '../../../../../common/constants'; import stream from 'stream'; import { requestMock } from '../../../detection_engine/routes/__mocks__'; -import { SavedTimeline, TimelineType } from '../../../../../common/types/timeline'; +import { SavedTimeline, TimelineType, TimelineStatus } from '../../../../../common/types/timeline'; import { updateTimelineSchema } from '../schemas/update_timelines_schema'; import { createTimelineSchema } from '../schemas/create_timelines_schema'; @@ -86,7 +86,8 @@ export const createDraftTimelineWithoutTimelineId = { timeline: inputTimeline, timelineId: null, version: null, - timelineType: TimelineType.draft, + timelineType: TimelineType.default, + status: TimelineStatus.draft, }; export const createTemplateTimelineWithoutTimelineId = { @@ -153,16 +154,22 @@ export const getImportTimelinesRequestEnableOverwrite = (filename?: string) => }, }); -export const getDraftTimelinesRequest = () => +export const getDraftTimelinesRequest = (timelineType: TimelineType) => requestMock.create({ method: 'get', path: TIMELINE_DRAFT_URL, + query: { + timelineType, + }, }); -export const cleanDraftTimelinesRequest = () => +export const cleanDraftTimelinesRequest = (timelineType: TimelineType) => requestMock.create({ method: 'post', path: TIMELINE_DRAFT_URL, + body: { + timelineType, + }, }); export const mockTimelinesSavedObjects = () => ({ diff --git a/x-pack/plugins/siem/server/lib/timeline/routes/clean_draft_timelines_route.test.ts b/x-pack/plugins/siem/server/lib/timeline/routes/clean_draft_timelines_route.test.ts index 231efff35636c..9dc957604d4df 100644 --- a/x-pack/plugins/siem/server/lib/timeline/routes/clean_draft_timelines_route.test.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/clean_draft_timelines_route.test.ts @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { SecurityPluginSetup } from '../../../../../../plugins/security/server'; +import { TimelineType } from '../../../../common/types/timeline'; import { serverMock, @@ -79,7 +80,7 @@ describe('clean draft timelines', () => { timeline: [], }); - const response = await server.inject(cleanDraftTimelinesRequest(), context); + const response = await server.inject(cleanDraftTimelinesRequest(TimelineType.default), context); expect(mockPersistTimeline).toHaveBeenCalled(); expect(response.status).toEqual(200); expect(response.body).toEqual({ @@ -98,7 +99,7 @@ describe('clean draft timelines', () => { mockResetTimeline.mockResolvedValue({}); mockGetTimeline.mockResolvedValue({ ...mockGetDraftTimelineValue }); - const response = await server.inject(cleanDraftTimelinesRequest(), context); + const response = await server.inject(cleanDraftTimelinesRequest(TimelineType.default), context); expect(mockPersistTimeline).not.toHaveBeenCalled(); expect(mockResetTimeline).toHaveBeenCalled(); expect(mockGetTimeline).toHaveBeenCalled(); diff --git a/x-pack/plugins/siem/server/lib/timeline/routes/clean_draft_timelines_route.ts b/x-pack/plugins/siem/server/lib/timeline/routes/clean_draft_timelines_route.ts index 0890b65dec4e5..ac962a848368b 100644 --- a/x-pack/plugins/siem/server/lib/timeline/routes/clean_draft_timelines_route.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/clean_draft_timelines_route.ts @@ -10,8 +10,10 @@ import { transformError, buildSiemResponse } from '../../detection_engine/routes import { TIMELINE_DRAFT_URL } from '../../../../common/constants'; import { buildFrameworkRequest } from './utils/common'; import { SetupPlugins } from '../../../plugin'; +import { buildRouteValidation } from '../../../utils/build_validation/route_validation'; import { getDraftTimeline, resetTimeline, getTimeline, persistTimeline } from '../saved_object'; import { draftTimelineDefaults } from '../default_timeline'; +import { cleanDraftTimelineSchema } from './schemas/clean_draft_timelines_schema'; export const cleanDraftTimelinesRoute = ( router: IRouter, @@ -21,7 +23,9 @@ export const cleanDraftTimelinesRoute = ( router.post( { path: TIMELINE_DRAFT_URL, - validate: {}, + validate: { + body: buildRouteValidation(cleanDraftTimelineSchema), + }, options: { tags: ['access:siem'], }, @@ -33,7 +37,7 @@ export const cleanDraftTimelinesRoute = ( try { const { timeline: [draftTimeline], - } = await getDraftTimeline(frameworkRequest); + } = await getDraftTimeline(frameworkRequest, request.body.timelineType); if (draftTimeline?.savedObjectId) { await resetTimeline(frameworkRequest, [draftTimeline.savedObjectId]); diff --git a/x-pack/plugins/siem/server/lib/timeline/routes/get_draft_timelines_route.test.ts b/x-pack/plugins/siem/server/lib/timeline/routes/get_draft_timelines_route.test.ts index 76a64e9d225a1..e9bceb2c66806 100644 --- a/x-pack/plugins/siem/server/lib/timeline/routes/get_draft_timelines_route.test.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/get_draft_timelines_route.test.ts @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { SecurityPluginSetup } from '../../../../../../plugins/security/server'; +import { TimelineType } from '../../../../common/types/timeline'; import { serverMock, @@ -80,7 +81,10 @@ describe('get draft timelines', () => { timeline: [], }); - const response = await server.inject(getDraftTimelinesRequest(), context); + const response = await server.inject( + getDraftTimelinesRequest(TimelineType.default), + context + ); expect(mockPersistTimeline).toHaveBeenCalled(); expect(response.status).toEqual(200); expect(response.body).toEqual({ @@ -97,7 +101,10 @@ describe('get draft timelines', () => { timeline: [mockGetDraftTimelineValue], }); - const response = await server.inject(getDraftTimelinesRequest(), context); + const response = await server.inject( + getDraftTimelinesRequest(TimelineType.default), + context + ); expect(mockPersistTimeline).not.toHaveBeenCalled(); expect(response.status).toEqual(200); expect(response.body).toEqual({ diff --git a/x-pack/plugins/siem/server/lib/timeline/routes/get_draft_timelines_route.ts b/x-pack/plugins/siem/server/lib/timeline/routes/get_draft_timelines_route.ts index 2ff1ec519d2a6..137b2032b8e50 100644 --- a/x-pack/plugins/siem/server/lib/timeline/routes/get_draft_timelines_route.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/get_draft_timelines_route.ts @@ -10,8 +10,10 @@ import { transformError, buildSiemResponse } from '../../detection_engine/routes import { TIMELINE_DRAFT_URL } from '../../../../common/constants'; import { buildFrameworkRequest } from './utils/common'; import { SetupPlugins } from '../../../plugin'; +import { buildRouteValidation } from '../../../utils/build_validation/route_validation'; import { getDraftTimeline, persistTimeline } from '../saved_object'; import { draftTimelineDefaults } from '../default_timeline'; +import { getDraftTimelineSchema } from './schemas/get_draft_timelines_schema'; export const getDraftTimelinesRoute = ( router: IRouter, @@ -21,7 +23,9 @@ export const getDraftTimelinesRoute = ( router.get( { path: TIMELINE_DRAFT_URL, - validate: {}, + validate: { + query: buildRouteValidation(getDraftTimelineSchema), + }, options: { tags: ['access:siem'], }, @@ -33,7 +37,7 @@ export const getDraftTimelinesRoute = ( try { const { timeline: [draftTimeline], - } = await getDraftTimeline(frameworkRequest); + } = await getDraftTimeline(frameworkRequest, request.query.timelineType); if (draftTimeline?.savedObjectId) { return response.ok({ diff --git a/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.test.ts b/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.test.ts index 2f5200c87137d..48e22f6af2a7b 100644 --- a/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.test.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.test.ts @@ -12,7 +12,7 @@ import { createMockConfig, } from '../../detection_engine/routes/__mocks__'; import { TIMELINE_EXPORT_URL } from '../../../../common/constants'; -import { TimelineType } from '../../../../common/types/timeline'; +import { TimelineStatus } from '../../../../common/types/timeline'; import { SecurityPluginSetup } from '../../../../../../plugins/security/server'; import { @@ -145,13 +145,13 @@ describe('import timelines', () => { test('should Create a new timeline savedObject with given draft timeline', async () => { mockGetTupleDuplicateErrorsAndUniqueTimeline.mockReturnValue([ mockDuplicateIdErrors, - [{ ...mockUniqueParsedObjects[0], timelineType: TimelineType.draft }], + [{ ...mockUniqueParsedObjects[0], status: TimelineStatus.draft }], ]); const mockRequest = getImportTimelinesRequest(); await server.inject(mockRequest, context); expect(mockPersistTimeline.mock.calls[0][3]).toEqual({ ...mockParsedTimelineObject, - timelineType: TimelineType.default, + status: TimelineStatus.active, }); }); diff --git a/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts b/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts index bb63d1dce5554..dee8ed5078546 100644 --- a/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts @@ -39,7 +39,7 @@ import { timelineSavedObjectOmittedFields, } from './utils/import_timelines'; import { createTimelines, getTimeline, getTemplateTimeline } from './utils/create_timelines'; -import { TimelineType } from '../../../../common/types/timeline'; +import { TimelineType, TimelineStatus } from '../../../../common/types/timeline'; import { checkIsFailureCases } from './utils/update_timelines'; const CHUNK_PARSED_OBJECT_SIZE = 10; @@ -154,10 +154,10 @@ export const importTimelinesRoute = ( frameworkRequest, { ...parsedTimelineObject, - timelineType: - parsedTimelineObject.timelineType === TimelineType.draft - ? TimelineType.default - : parsedTimelineObject.timelineType, + status: + parsedTimelineObject.status === TimelineStatus.draft + ? TimelineStatus.active + : parsedTimelineObject.status, }, null, // timelineSavedObjectId null, // timelineVersion diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/index.ts b/x-pack/plugins/siem/server/lib/timeline/routes/schemas/clean_draft_timelines_schema.ts similarity index 54% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/index.ts rename to x-pack/plugins/siem/server/lib/timeline/routes/schemas/clean_draft_timelines_schema.ts index 8086acc41d2bd..2f880ee530dd9 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/index.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/schemas/clean_draft_timelines_schema.ts @@ -3,7 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +import * as rt from 'io-ts'; -export { policyListReducer } from './reducer'; -export { PolicyListAction } from './action'; -export { policyListMiddlewareFactory } from './middleware'; +import { TimelineTypeLiteralRt } from '../../../../../common/types/timeline'; + +export const cleanDraftTimelineSchema = rt.type({ + timelineType: TimelineTypeLiteralRt, +}); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/index.ts b/x-pack/plugins/siem/server/lib/timeline/routes/schemas/get_draft_timelines_schema.ts similarity index 54% rename from x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/index.ts rename to x-pack/plugins/siem/server/lib/timeline/routes/schemas/get_draft_timelines_schema.ts index 39f0f13d2daa2..34cfb5e6e756b 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/index.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/schemas/get_draft_timelines_schema.ts @@ -3,7 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +import * as rt from 'io-ts'; -export { policyDetailsMiddlewareFactory } from './middleware'; -export { PolicyDetailsAction } from './action'; -export { policyDetailsReducer } from './reducer'; +import { TimelineTypeLiteralRt } from '../../../../../common/types/timeline'; + +export const getDraftTimelineSchema = rt.type({ + timelineType: TimelineTypeLiteralRt, +}); diff --git a/x-pack/plugins/siem/server/lib/timeline/routes/utils/export_timelines.ts b/x-pack/plugins/siem/server/lib/timeline/routes/utils/export_timelines.ts index 1e64e38ea5b0a..908aeac6b33ca 100644 --- a/x-pack/plugins/siem/server/lib/timeline/routes/utils/export_timelines.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/utils/export_timelines.ts @@ -16,7 +16,7 @@ import { ExportedNotes, TimelineSavedObject, ExportTimelineNotFoundError, - TimelineType, + TimelineStatus, } from '../../../../../common/types/timeline'; import { NoteSavedObject } from '../../../../../common/types/timeline/note'; import { PinnedEventSavedObject } from '../../../../../common/types/timeline/pinned_event'; @@ -180,10 +180,8 @@ const getTimelinesFromObjects = async ( ...acc, { ...myTimeline, - timelineType: - myTimeline.timelineType === TimelineType.draft - ? TimelineType.default - : myTimeline.timelineType, + status: + myTimeline.status === TimelineStatus.draft ? TimelineStatus.active : myTimeline.status, ...getGlobalEventNotesByTimelineId(timelineNotes), pinnedEventIds: getPinnedEventsIdsByTimelineId(timelinePinnedEventIds), }, diff --git a/x-pack/plugins/siem/server/lib/timeline/saved_object.ts b/x-pack/plugins/siem/server/lib/timeline/saved_object.ts index f95cd01b2b788..1a2a2a9c20a67 100644 --- a/x-pack/plugins/siem/server/lib/timeline/saved_object.ts +++ b/x-pack/plugins/siem/server/lib/timeline/saved_object.ts @@ -10,13 +10,19 @@ import { SavedObjectsFindOptions } from '../../../../../../src/core/server'; import { UNAUTHENTICATED_USER } from '../../../common/constants'; import { NoteSavedObject } from '../../../common/types/timeline/note'; import { PinnedEventSavedObject } from '../../../common/types/timeline/pinned_event'; -import { SavedTimeline, TimelineSavedObject, TimelineType } from '../../../common/types/timeline'; +import { + SavedTimeline, + TimelineSavedObject, + TimelineTypeLiteralWithNull, +} from '../../../common/types/timeline'; import { ResponseTimeline, PageInfoTimeline, SortTimeline, ResponseFavoriteTimeline, TimelineResult, + TimelineType, + TimelineStatus, Maybe, } from '../../graphql/types'; import { FrameworkRequest } from '../framework'; @@ -49,7 +55,7 @@ export interface Timeline { pageInfo: PageInfoTimeline | null, search: string | null, sort: SortTimeline | null, - timelineType: string | null + timelineType: TimelineTypeLiteralWithNull ) => Promise; persistFavorite: ( @@ -62,7 +68,7 @@ export interface Timeline { timelineId: string | null, version: string | null, timeline: SavedTimeline, - timelineType?: TimelineType | null + timelineType?: TimelineTypeLiteralWithNull ) => Promise; deleteTimeline: (request: FrameworkRequest, timelineIds: string[]) => Promise; @@ -98,13 +104,26 @@ export const getTimelineByTemplateTimelineId = async ( /** The filter here is able to handle the legacy data, * which has no timelineType exists in the savedObject */ -const getTimelineTypeFilter = (timelineType: string | null) => { - return timelineType === TimelineType.template - ? `siem-ui-timeline.attributes.timelineType: ${TimelineType.template}` /** Show only whose timelineType exists and equals to "template" */ - : /** Show me every timeline whose timelineType is not "template". - * which includes timelineType === 'default' and - * those timelineType doesn't exists */ - `not siem-ui-timeline.attributes.timelineType: ${TimelineType.template} and not siem-ui-timeline.attributes.timelineType: ${TimelineType.draft}`; +const getTimelineTypeFilter = ( + timelineType: TimelineTypeLiteralWithNull, + includeDraft: boolean +) => { + const typeFilter = + timelineType === TimelineType.template + ? `siem-ui-timeline.attributes.timelineType: ${TimelineType.template}` /** Show only whose timelineType exists and equals to "template" */ + : /** Show me every timeline whose timelineType is not "template". + * which includes timelineType === 'default' and + * those timelineType doesn't exists */ + `not siem-ui-timeline.attributes.timelineType: ${TimelineType.template}`; + + /** Show me every timeline whose status is not "draft". + * which includes status === 'active' and + * those status doesn't exists */ + const draftFilter = includeDraft + ? `siem-ui-timeline.attributes.status: ${TimelineStatus.draft}` + : `not siem-ui-timeline.attributes.status: ${TimelineStatus.draft}`; + + return `${typeFilter} and ${draftFilter}`; }; export const getAllTimeline = async ( @@ -113,7 +132,7 @@ export const getAllTimeline = async ( pageInfo: PageInfoTimeline | null, search: string | null, sort: SortTimeline | null, - timelineType: string | null + timelineType: TimelineTypeLiteralWithNull ): Promise => { const options: SavedObjectsFindOptions = { type: timelineSavedObjectType, @@ -123,18 +142,21 @@ export const getAllTimeline = async ( searchFields: onlyUserFavorite ? ['title', 'description', 'favorite.keySearch'] : ['title', 'description'], - filter: getTimelineTypeFilter(timelineType), + filter: getTimelineTypeFilter(timelineType, false), sortField: sort != null ? sort.sortField : undefined, sortOrder: sort != null ? sort.sortOrder : undefined, }; return getAllSavedTimeline(request, options); }; -export const getDraftTimeline = async (request: FrameworkRequest): Promise => { +export const getDraftTimeline = async ( + request: FrameworkRequest, + timelineType: TimelineTypeLiteralWithNull +): Promise => { const options: SavedObjectsFindOptions = { type: timelineSavedObjectType, perPage: 1, - filter: `siem-ui-timeline.attributes.timelineType: ${TimelineType.draft}`, + filter: getTimelineTypeFilter(timelineType, true), sortField: 'created', sortOrder: 'desc', }; diff --git a/x-pack/plugins/siem/server/lib/timeline/saved_object_mappings.ts b/x-pack/plugins/siem/server/lib/timeline/saved_object_mappings.ts index 4d9ae19bfd6a2..51bff033b8791 100644 --- a/x-pack/plugins/siem/server/lib/timeline/saved_object_mappings.ts +++ b/x-pack/plugins/siem/server/lib/timeline/saved_object_mappings.ts @@ -263,6 +263,9 @@ export const timelineSavedObjectMappings: SavedObjectsType['mappings'] = { }, }, }, + status: { + type: 'keyword', + }, created: { type: 'date', }, diff --git a/x-pack/plugins/siem/server/plugin.ts b/x-pack/plugins/siem/server/plugin.ts index d296ee94e8958..3c336991f3d9d 100644 --- a/x-pack/plugins/siem/server/plugin.ts +++ b/x-pack/plugins/siem/server/plugin.ts @@ -22,6 +22,7 @@ import { MlPluginSetup as MlSetup } from '../../ml/server'; import { EncryptedSavedObjectsPluginSetup as EncryptedSavedObjectsSetup } from '../../encrypted_saved_objects/server'; import { SpacesPluginSetup as SpacesSetup } from '../../spaces/server'; import { LicensingPluginSetup } from '../../licensing/server'; +import { IngestManagerStartContract } from '../../ingest_manager/server'; import { initServer } from './init_server'; import { compose } from './lib/compose/kibana'; import { initRoutes } from './routes'; @@ -35,6 +36,13 @@ import { SiemClientFactory } from './client'; import { createConfig$, ConfigType } from './config'; import { initUiSettings } from './ui_settings'; import { APP_ID, APP_ICON } from '../common/constants'; +import { registerEndpointRoutes } from './endpoint/routes/metadata'; +import { registerResolverRoutes } from './endpoint/routes/resolver'; +import { registerAlertRoutes } from './endpoint/alerts/routes'; +import { registerPolicyRoutes } from './endpoint/routes/policy'; +import { EndpointAppContextService } from './endpoint/endpoint_app_context_services'; +import { EndpointAppContext } from './endpoint/types'; +import { IngestIndexPatternRetriever } from './endpoint/alerts/index_pattern'; export interface SetupPlugins { alerting: AlertingSetup; @@ -46,8 +54,9 @@ export interface SetupPlugins { ml?: MlSetup; } -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface StartPlugins {} +export interface StartPlugins { + ingestManager: IngestManagerStartContract; +} // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface PluginSetup {} @@ -59,6 +68,7 @@ export class Plugin implements IPlugin; private context: PluginInitializerContext; private siemClientFactory: SiemClientFactory; + private readonly endpointAppContextService = new EndpointAppContextService(); constructor(context: PluginInitializerContext) { this.context = context; @@ -79,21 +89,27 @@ export class Plugin implements IPlugin => Promise.resolve(config), + }; const router = core.http.createRouter(); core.http.registerRouteHandlerContext(APP_ID, (context, request, response) => ({ getSiemClient: () => this.siemClientFactory.create(request), })); - const config = await this.config$.pipe(first()).toPromise(); - this.siemClientFactory.setup({ getSpaceId: plugins.spaces?.spacesService?.getSpaceId, config, }); + // TO DO We need to get the endpoint routes inside of initRoutes initRoutes( router, config, @@ -101,6 +117,10 @@ export class Plugin implements IPlugin { +export type ClientSetup = void; +export type ClientStart = void; + +export class UptimePlugin + implements Plugin { constructor(_context: PluginInitializerContext) {} public async setup( @@ -49,7 +59,7 @@ export class UptimePlugin implements Plugin { const [coreStart, corePlugins] = await core.getStartServices(); const { getKibanaFrameworkAdapter } = await import( '../lib/adapters/framework/new_platform_adapter' @@ -59,8 +69,7 @@ export class UptimePlugin implements Plugin {}; + return libs.framework.render(element); }, }); } diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_histogram/ping_histogram_container.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_histogram/ping_histogram_container.tsx index ad855419d8865..263a0c0426e40 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_histogram/ping_histogram_container.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_histogram/ping_histogram_container.tsx @@ -4,14 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { useEffect } from 'react'; +import React, { useContext, useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { PingHistogramComponent } from '../../common/charts'; import { getPingHistogram } from '../../../state/actions'; -import { selectPingHistogram } from '../../../state/selectors'; +import { esKuerySelector, selectPingHistogram } from '../../../state/selectors'; import { useGetUrlParams } from '../../../hooks'; import { useMonitorId } from '../../../hooks'; import { ResponsiveWrapperProps, withResponsiveWrapper } from '../../common/higher_order'; +import { UptimeRefreshContext } from '../../../contexts'; interface Props { height: string; @@ -28,7 +29,11 @@ const Container: React.FC = ({ height }) => { const dispatch = useDispatch(); const monitorId = useMonitorId(); - const { loading, data, esKuery, lastRefresh } = useSelector(selectPingHistogram); + const { lastRefresh } = useContext(UptimeRefreshContext); + + const esKuery = useSelector(esKuerySelector); + + const { loading, pingHistogram: data } = useSelector(selectPingHistogram); useEffect(() => { dispatch(getPingHistogram({ monitorId, dateStart, dateEnd, filters: esKuery })); diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_container.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_container.tsx index 3c3caab365e3a..4d4bb175be9a8 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_container.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_container.tsx @@ -9,7 +9,7 @@ import React, { useContext, useCallback } from 'react'; import { selectPingList } from '../../../state/selectors'; import { getPings } from '../../../state/actions'; import { GetPingsParams } from '../../../../common/runtime_types'; -import { UptimeSettingsContext } from '../../../contexts'; +import { UptimeRefreshContext, UptimeSettingsContext } from '../../../contexts'; import { PingListComponent } from './index'; export interface PingListProps { @@ -18,14 +18,13 @@ export interface PingListProps { export const PingList = (props: PingListProps) => { const { - lastRefresh, - pings: { - error, - loading, - pingList: { locations, pings, total }, - }, + error, + loading, + pingList: { locations, pings, total }, } = useSelector(selectPingList); + const { lastRefresh } = useContext(UptimeRefreshContext); + const { dateRangeStart: drs, dateRangeEnd: dre } = useContext(UptimeSettingsContext); const dispatch = useDispatch(); diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/alerts_containers/alert_monitor_status.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/alerts_containers/alert_monitor_status.tsx index 9dd27db0be607..77e0c98c0260d 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/alerts_containers/alert_monitor_status.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/alerts_containers/alert_monitor_status.tsx @@ -21,13 +21,13 @@ interface Props { }; } -export const AlertMonitorStatus = ({ +export const AlertMonitorStatus: React.FC = ({ autocomplete, enabled, numTimes, setAlertParams, timerange, -}: Props) => { +}) => { const { filters, locations } = useSelector(selectMonitorStatusAlert); return ( ); }; + +// eslint-disable-next-line import/no-default-export +export { AlertMonitorStatus as default }; diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/alerts_containers/alert_tls.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/alerts_containers/alert_tls.tsx index a2e1c1d43526c..c7657c34220fc 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/alerts_containers/alert_tls.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/alerts_containers/alert_tls.tsx @@ -10,7 +10,7 @@ import { AlertTlsComponent } from '../alert_tls'; import { setAlertFlyoutVisible } from '../../../../state/actions'; import { selectDynamicSettings } from '../../../../state/selectors'; -export const AlertTls = () => { +export const AlertTls: React.FC<{}> = () => { const dispatch = useDispatch(); const setFlyoutVisible = useCallback((value: boolean) => dispatch(setAlertFlyoutVisible(value)), [ dispatch, @@ -24,3 +24,6 @@ export const AlertTls = () => { /> ); }; + +// eslint-disable-next-line import/no-default-export +export { AlertTls as default }; diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/filters_expression_select.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/filters_expression_select.tsx index a6728643146df..8b37e09b0eeb1 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/filters_expression_select.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_expressions/filters_expression_select.tsx @@ -24,7 +24,9 @@ export const FiltersExpressionsSelect: React.FC = ({ newFilters, onRemoveFilter, }) => { - const { tags, ports, schemes, locations } = useSelector(overviewFiltersSelector); + const { + filters: { tags, ports, schemes, locations }, + } = useSelector(overviewFiltersSelector); const [updatedFieldValues, setUpdatedFieldValues] = useState<{ fieldName: string; diff --git a/x-pack/plugins/uptime/public/components/overview/empty_state/__tests__/__snapshots__/empty_state.test.tsx.snap b/x-pack/plugins/uptime/public/components/overview/empty_state/__tests__/__snapshots__/empty_state.test.tsx.snap index 8ad11b17537c4..ccf6ade66408a 100644 --- a/x-pack/plugins/uptime/public/components/overview/empty_state/__tests__/__snapshots__/empty_state.test.tsx.snap +++ b/x-pack/plugins/uptime/public/components/overview/empty_state/__tests__/__snapshots__/empty_state.test.tsx.snap @@ -583,65 +583,298 @@ exports[`EmptyState component doesn't render child components when count is fals loading={false} statesIndexStatus={null} > - - - - - -

- Loading… -

-
- - } + , + } + } + /> + } + > +
- - - +
+ + +
- + + + + + + + + + + + + } + body={ + +

+ +

+

+ +

+
+ } + iconType="logoUptime" + title={ + +

+ , + } + } + /> +

+
+ } > - -
-
- - -

- Loading… -

-
+ +
+ + + - - + + `; diff --git a/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx b/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx index 76b989671e2c1..397ea287e9261 100644 --- a/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx +++ b/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx @@ -30,43 +30,46 @@ export const EmptyStateComponent = ({ if (errors?.length) { return ; } - if (!loading && statesIndexStatus) { - const { indexExists, docCount } = statesIndexStatus; - if (!indexExists) { - return ( - {settings?.heartbeatIndices} }} - /> - } - /> - ); - } else if (indexExists && docCount === 0) { - return ( - {settings?.heartbeatIndices} }} - /> - } - /> - ); - } - /** - * We choose to render the children any time the count > 0, even if - * the component is loading. If we render the loading state for this component, - * it will blow away the state of child components and trigger an ugly - * jittery UX any time the components refresh. This way we'll keep the stale - * state displayed during the fetching process. - */ - return {children}; + const { indexExists, docCount } = statesIndexStatus ?? {}; + + if (loading && (!indexExists || docCount === 0 || !statesIndexStatus)) { + return ; + } + + if (!indexExists) { + return ( + {settings?.heartbeatIndices} }} + /> + } + /> + ); + } else if (indexExists && docCount === 0) { + return ( + {settings?.heartbeatIndices} }} + /> + } + /> + ); } - return ; + /** + * We choose to render the children any time the count > 0, even if + * the component is loading. If we render the loading state for this component, + * it will blow away the state of child components and trigger an ugly + * jittery UX any time the components refresh. This way we'll keep the stale + * state displayed during the fetching process. + */ + return {children}; + // } }; diff --git a/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group_container.tsx b/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group_container.tsx index 67cb89745269e..928e790028ba0 100644 --- a/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group_container.tsx +++ b/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group_container.tsx @@ -11,7 +11,7 @@ import { parseFiltersMap } from './parse_filter_map'; import { fetchOverviewFilters } from '../../../state/actions'; import { FilterGroupComponent } from './index'; import { UptimeRefreshContext } from '../../../contexts'; -import { filterGroupDataSelector } from '../../../state/selectors'; +import { esKuerySelector, overviewFiltersSelector } from '../../../state/selectors'; interface Props { esFilters?: string; @@ -20,7 +20,8 @@ interface Props { export const FilterGroup: React.FC = ({ esFilters }: Props) => { const { lastRefresh } = useContext(UptimeRefreshContext); - const { esKuery, filters: overviewFilters, loading } = useSelector(filterGroupDataSelector); + const { filters: overviewFilters, loading } = useSelector(overviewFiltersSelector); + const esKuery = useSelector(esKuerySelector); const { dateRangeStart, dateRangeEnd, statusFilter, filters: urlFilters } = useGetUrlParams(); diff --git a/x-pack/plugins/uptime/public/components/overview/kuery_bar/index.ts b/x-pack/plugins/uptime/public/components/overview/kuery_bar/index.ts index 60801a0ab705a..20c729da3f5b5 100644 --- a/x-pack/plugins/uptime/public/components/overview/kuery_bar/index.ts +++ b/x-pack/plugins/uptime/public/components/overview/kuery_bar/index.ts @@ -4,5 +4,4 @@ * you may not use this file except in compliance with the Elastic License. */ -export { KueryBarComponent } from './kuery_bar'; -export { KueryBar } from './kuery_bar_container'; +export { KueryBar } from './kuery_bar'; diff --git a/x-pack/plugins/uptime/public/components/overview/kuery_bar/kuery_bar.tsx b/x-pack/plugins/uptime/public/components/overview/kuery_bar/kuery_bar.tsx index bd6fb4cf54b2b..4e98633106012 100644 --- a/x-pack/plugins/uptime/public/components/overview/kuery_bar/kuery_bar.tsx +++ b/x-pack/plugins/uptime/public/components/overview/kuery_bar/kuery_bar.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { useState, useEffect } from 'react'; +import React, { useState } from 'react'; import { uniqueId, startsWith } from 'lodash'; import { EuiCallOut } from '@elastic/eui'; import styled from 'styled-components'; @@ -17,6 +17,7 @@ import { QuerySuggestion, DataPublicPluginSetup, } from '../../../../../../../src/plugins/data/public'; +import { useIndexPattern } from './use_index_pattern'; const Container = styled.div` margin-bottom: 4px; @@ -36,24 +37,14 @@ interface Props { 'aria-label': string; autocomplete: DataPublicPluginSetup['autocomplete']; 'data-test-subj': string; - loadIndexPattern: () => void; - indexPattern: IIndexPattern | null; - loading: boolean; } -export function KueryBarComponent({ +export function KueryBar({ 'aria-label': ariaLabel, autocomplete: autocompleteService, 'data-test-subj': dataTestSubj, - loadIndexPattern, - indexPattern, - loading, }: Props) { - useEffect(() => { - if (!indexPattern) { - loadIndexPattern(); - } - }, [indexPattern, loadIndexPattern]); + const { loading, index_pattern: indexPattern } = useIndexPattern(); const [state, setState] = useState({ suggestions: [], diff --git a/x-pack/plugins/uptime/public/components/overview/kuery_bar/kuery_bar_container.tsx b/x-pack/plugins/uptime/public/components/overview/kuery_bar/kuery_bar_container.tsx deleted file mode 100644 index 5e1e184b2d6e6..0000000000000 --- a/x-pack/plugins/uptime/public/components/overview/kuery_bar/kuery_bar_container.tsx +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { connect } from 'react-redux'; -import { AppState } from '../../../state'; -import { selectIndexPattern } from '../../../state/selectors'; -import { getIndexPattern } from '../../../state/actions'; -import { KueryBarComponent } from './kuery_bar'; - -const mapStateToProps = (state: AppState) => ({ ...selectIndexPattern(state) }); - -const mapDispatchToProps = (dispatch: any) => ({ - loadIndexPattern: () => { - dispatch(getIndexPattern({})); - }, -}); - -export const KueryBar = connect(mapStateToProps, mapDispatchToProps)(KueryBarComponent); diff --git a/x-pack/plugins/uptime/public/components/overview/kuery_bar/use_index_pattern.ts b/x-pack/plugins/uptime/public/components/overview/kuery_bar/use_index_pattern.ts new file mode 100644 index 0000000000000..db01f5e10193c --- /dev/null +++ b/x-pack/plugins/uptime/public/components/overview/kuery_bar/use_index_pattern.ts @@ -0,0 +1,23 @@ +/* + * 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 { useEffect } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import { getIndexPattern } from '../../../state/actions'; +import { selectIndexPattern } from '../../../state/selectors'; + +export const useIndexPattern = () => { + const dispatch = useDispatch(); + const indexPattern = useSelector(selectIndexPattern); + + useEffect(() => { + if (!indexPattern) { + dispatch(getIndexPattern()); + } + }, [indexPattern, dispatch]); + + return indexPattern; +}; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap b/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap index 55c2f591d084f..51f113db55844 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap @@ -52,8 +52,6 @@ exports[`MonitorList component MonitorListPagination component renders a no item } > `; @@ -121,8 +121,6 @@ exports[`MonitorList component MonitorListPagination component renders the pagin } > `; @@ -252,8 +252,6 @@ exports[`MonitorList component renders a no items message when no data is provid } > `; @@ -321,8 +321,6 @@ exports[`MonitorList component renders error list 1`] = ` } > `; @@ -453,8 +453,6 @@ exports[`MonitorList component renders loading state 1`] = ` } > `; @@ -1177,7 +1177,7 @@ exports[`MonitorList component renders the monitor list 1`] = ` - Rows per page: 25 + Rows per page: 10 @@ -1282,8 +1282,6 @@ exports[`MonitorList component shallow renders the monitor list 1`] = ` } > `; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list.test.tsx index 9dd44f5176664..cf6d137e8692b 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list.test.tsx @@ -106,8 +106,8 @@ describe('MonitorList component', () => { const component = shallowWithRouter( ); @@ -126,8 +126,8 @@ describe('MonitorList component', () => { }, loading: true, }} - lastRefresh={123} - getMonitorList={jest.fn()} + pageSize={10} + setPageSize={jest.fn()} /> ); expect(component).toMatchSnapshot(); @@ -137,8 +137,8 @@ describe('MonitorList component', () => { const component = renderWithRouter( ); @@ -149,8 +149,8 @@ describe('MonitorList component', () => { const component = shallowWithRouter( ); @@ -161,8 +161,8 @@ describe('MonitorList component', () => { const component = shallowWithRouter( ); @@ -260,8 +260,8 @@ describe('MonitorList component', () => { }, loading: false, }} - lastRefresh={123} - getMonitorList={jest.fn()} + pageSize={10} + setPageSize={jest.fn()} /> ); @@ -280,8 +280,8 @@ describe('MonitorList component', () => { }, loading: false, }} - lastRefresh={123} - getMonitorList={jest.fn()} + pageSize={10} + setPageSize={jest.fn()} /> ); diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx index 69ffe4e4a6dc6..a0e7e78bc0c64 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx @@ -14,9 +14,9 @@ import { EuiPanel, EuiSpacer, } from '@elastic/eui'; -import React, { useState, useEffect } from 'react'; +import React, { useState } from 'react'; import styled from 'styled-components'; -import { HistogramPoint, FetchMonitorStatesQueryArgs } from '../../../../common/runtime_types'; +import { HistogramPoint } from '../../../../common/runtime_types'; import { MonitorSummary } from '../../../../common/runtime_types'; import { MonitorListStatusColumn } from './monitor_list_status_column'; import { ExpandedRowMap } from './types'; @@ -28,14 +28,13 @@ import { MonitorListPageSizeSelect } from './monitor_list_page_size_select'; import { MonitorListDrawer } from './monitor_list_drawer/list_drawer_container'; import { MonitorListProps } from './monitor_list_container'; import { MonitorList } from '../../../state/reducers/monitor_list'; -import { useUrlParams } from '../../../hooks'; import { CertStatusColumn } from './cert_status_column'; import { MonitorListHeader } from './monitor_list_header'; interface Props extends MonitorListProps { - lastRefresh: number; + pageSize: number; + setPageSize: (val: number) => void; monitorList: MonitorList; - getMonitorList: (params: FetchMonitorStatesQueryArgs) => void; } const TruncatedEuiLink = styled(EuiLink)` @@ -44,49 +43,15 @@ const TruncatedEuiLink = styled(EuiLink)` text-overflow: ellipsis; `; -const DEFAULT_PAGE_SIZE = 10; -const LOCAL_STORAGE_KEY = 'xpack.uptime.monitorList.pageSize'; -const getPageSizeValue = () => { - const value = parseInt(localStorage.getItem(LOCAL_STORAGE_KEY) ?? '', 10); - if (isNaN(value)) { - return DEFAULT_PAGE_SIZE; - } - return value; -}; - export const MonitorListComponent: React.FC = ({ filters, - getMonitorList, - lastRefresh, monitorList: { list, error, loading }, linkParameters, + pageSize, + setPageSize, }) => { - const [pageSize, setPageSize] = useState(getPageSizeValue()); const [drawerIds, updateDrawerIds] = useState([]); - const [getUrlValues] = useUrlParams(); - const { dateRangeStart, dateRangeEnd, pagination, statusFilter } = getUrlValues(); - - useEffect(() => { - getMonitorList({ - dateRangeStart, - dateRangeEnd, - filters, - pageSize, - pagination, - statusFilter, - }); - }, [ - getMonitorList, - dateRangeStart, - dateRangeEnd, - filters, - lastRefresh, - pageSize, - pagination, - statusFilter, - ]); - const items = list.summaries ?? []; const nextPagePagination = list.nextPagePagination ?? ''; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx index 6fb880e28c734..9aac7c9af5a82 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx @@ -4,31 +4,71 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { useCallback } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { getMonitorList } from '../../../state/actions'; -import { FetchMonitorStatesQueryArgs } from '../../../../common/runtime_types'; import { monitorListSelector } from '../../../state/selectors'; import { MonitorListComponent } from './monitor_list'; +import { useUrlParams } from '../../../hooks'; +import { UptimeRefreshContext } from '../../../contexts'; export interface MonitorListProps { filters?: string; linkParameters?: string; } +const DEFAULT_PAGE_SIZE = 10; +const LOCAL_STORAGE_KEY = 'xpack.uptime.monitorList.pageSize'; +const getPageSizeValue = () => { + const value = parseInt(localStorage.getItem(LOCAL_STORAGE_KEY) ?? '', 10); + if (isNaN(value)) { + return DEFAULT_PAGE_SIZE; + } + return value; +}; + export const MonitorList: React.FC = props => { + const { filters } = props; + + const [pageSize, setPageSize] = useState(getPageSizeValue); + const dispatch = useDispatch(); - const dispatchCallback = useCallback( - (params: FetchMonitorStatesQueryArgs) => { - dispatch(getMonitorList(params)); - }, - [dispatch] - ); + const [getUrlValues] = useUrlParams(); + const { dateRangeStart, dateRangeEnd, pagination, statusFilter } = getUrlValues(); + + const { lastRefresh } = useContext(UptimeRefreshContext); + + const monitorList = useSelector(monitorListSelector); - const monitorListState = useSelector(monitorListSelector); + useEffect(() => { + dispatch( + getMonitorList({ + dateRangeStart, + dateRangeEnd, + filters, + pageSize, + pagination, + statusFilter, + }) + ); + }, [ + dispatch, + dateRangeStart, + dateRangeEnd, + filters, + lastRefresh, + pageSize, + pagination, + statusFilter, + ]); return ( - + ); }; diff --git a/x-pack/plugins/uptime/public/components/overview/overview_container.tsx b/x-pack/plugins/uptime/public/components/overview/overview_container.tsx index 7fd71f3ac89be..b68f72dff0174 100644 --- a/x-pack/plugins/uptime/public/components/overview/overview_container.tsx +++ b/x-pack/plugins/uptime/public/components/overview/overview_container.tsx @@ -12,12 +12,19 @@ import { setEsKueryString } from '../../state/actions'; export const OverviewPage: React.FC = props => { const dispatch = useDispatch(); + const setEsKueryFilters = useCallback( (esFilters: string) => dispatch(setEsKueryString(esFilters)), [dispatch] ); - const indexPattern = useSelector(selectIndexPattern); + const { index_pattern: indexPattern, loading } = useSelector(selectIndexPattern); + return ( - + ); }; diff --git a/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot_container.tsx b/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot_container.tsx index 0fd52f0a0be4f..faa1311b20d20 100644 --- a/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot_container.tsx +++ b/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot_container.tsx @@ -4,12 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { useEffect } from 'react'; +import React, { useContext, useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { useGetUrlParams } from '../../../hooks'; import { getSnapshotCountAction } from '../../../state/actions'; import { SnapshotComponent } from './snapshot'; -import { snapshotDataSelector } from '../../../state/selectors'; +import { esKuerySelector, snapshotDataSelector } from '../../../state/selectors'; +import { UptimeRefreshContext } from '../../../contexts'; interface Props { /** @@ -21,7 +22,10 @@ interface Props { export const Snapshot: React.FC = ({ height }: Props) => { const { dateRangeStart, dateRangeEnd } = useGetUrlParams(); - const { count, lastRefresh, loading, esKuery } = useSelector(snapshotDataSelector); + const { lastRefresh } = useContext(UptimeRefreshContext); + + const { count, loading } = useSelector(snapshotDataSelector); + const esKuery = useSelector(esKuerySelector); const dispatch = useDispatch(); diff --git a/x-pack/plugins/uptime/public/contexts/uptime_refresh_context.tsx b/x-pack/plugins/uptime/public/contexts/uptime_refresh_context.tsx index 8e406f621f648..b78a6492e2dcd 100644 --- a/x-pack/plugins/uptime/public/contexts/uptime_refresh_context.tsx +++ b/x-pack/plugins/uptime/public/contexts/uptime_refresh_context.tsx @@ -5,8 +5,6 @@ */ import React, { createContext, useMemo, useState } from 'react'; -import { store } from '../state'; -import { triggerAppRefresh } from '../state/actions'; interface UptimeRefreshContext { lastRefresh: number; @@ -28,8 +26,6 @@ export const UptimeRefreshContextProvider: React.FC = ({ children }) => { const refreshApp = () => { const refreshTime = Date.now(); setLastRefresh(refreshTime); - // @ts-ignore - store.dispatch(triggerAppRefresh(refreshTime)); }; const value = useMemo(() => { diff --git a/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx b/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx index f7f9e056f41af..65c75859639f6 100644 --- a/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx +++ b/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ChromeBreadcrumb, CoreStart } from 'src/core/public'; +import { CoreStart } from 'src/core/public'; import React from 'react'; import ReactDOM from 'react-dom'; import { get } from 'lodash'; @@ -46,11 +46,6 @@ export const getKibanaFrameworkAdapter = ( } }); - let breadcrumbs: ChromeBreadcrumb[] = []; - core.chrome.getBreadcrumbs$().subscribe((nextBreadcrumbs?: ChromeBreadcrumb[]) => { - breadcrumbs = nextBreadcrumbs || []; - }); - const { apm, infrastructure, logs } = getIntegratedAppAvailability( capabilities, INTEGRATED_SOLUTIONS @@ -68,7 +63,6 @@ export const getKibanaFrameworkAdapter = ( isApmAvailable: apm, isInfraAvailable: infrastructure, isLogsAvailable: logs, - kibanaBreadcrumbs: breadcrumbs, plugins, startPlugins, renderGlobalHelpControls: () => @@ -97,6 +91,10 @@ export const getKibanaFrameworkAdapter = ( if (element) { ReactDOM.render(, element); } + + return () => { + ReactDOM.unmountComponentAtNode(element); + }; }, }; }; diff --git a/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx b/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx index bba7907d79c5d..08fc044bee201 100644 --- a/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx +++ b/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx @@ -11,7 +11,6 @@ import { isRight } from 'fp-ts/lib/Either'; import { AlertTypeModel } from '../../../../triggers_actions_ui/public'; import { AlertTypeInitializer } from '.'; import { StatusCheckExecutorParamsType } from '../../../common/runtime_types'; -import { AlertMonitorStatus } from '../../components/overview/alerts/alerts_containers'; import { MonitorStatusTitle } from './monitor_status_title'; import { CLIENT_ALERT_TYPES } from '../../../common/constants'; import { MonitorStatusTranslations } from './translations'; @@ -57,6 +56,10 @@ export const validate = (alertParams: any) => { const { defaultActionMessage } = MonitorStatusTranslations; +const AlertMonitorStatus = React.lazy(() => + import('../../components/overview/alerts/alerts_containers/alert_monitor_status') +); + export const initMonitorStatusAlertType: AlertTypeInitializer = ({ autocomplete, }): AlertTypeModel => ({ diff --git a/x-pack/plugins/uptime/public/lib/alert_types/tls.tsx b/x-pack/plugins/uptime/public/lib/alert_types/tls.tsx index 5e1b8cf233d70..15ac849fe871d 100644 --- a/x-pack/plugins/uptime/public/lib/alert_types/tls.tsx +++ b/x-pack/plugins/uptime/public/lib/alert_types/tls.tsx @@ -9,14 +9,15 @@ import { AlertTypeModel } from '../../../../triggers_actions_ui/public'; import { CLIENT_ALERT_TYPES } from '../../../common/constants'; import { TlsTranslations } from './translations'; import { AlertTypeInitializer } from '.'; -import { AlertTls } from '../../components/overview/alerts/alerts_containers/alert_tls'; const { name, defaultActionMessage } = TlsTranslations; export const initTlsAlertType: AlertTypeInitializer = (): AlertTypeModel => ({ id: CLIENT_ALERT_TYPES.TLS, iconClass: 'uptimeApp', - alertParamsExpression: () => , + alertParamsExpression: React.lazy(() => + import('../../components/overview/alerts/alerts_containers/alert_tls') + ), name, validate: () => ({ errors: {} }), defaultActionMessage, diff --git a/x-pack/plugins/uptime/public/lib/lib.ts b/x-pack/plugins/uptime/public/lib/lib.ts index 7dd3aa9eed5ce..187dcee7adb1a 100644 --- a/x-pack/plugins/uptime/public/lib/lib.ts +++ b/x-pack/plugins/uptime/public/lib/lib.ts @@ -5,6 +5,7 @@ */ import { ReactElement } from 'react'; +import { AppUnmount } from 'kibana/public'; import { UMBadge } from '../badge'; import { UptimeAppProps } from '../uptime_app'; @@ -17,5 +18,5 @@ export type UMUpdateBadge = (badge: UMBadge) => void; export type BootstrapUptimeApp = (props: UptimeAppProps) => ReactElement; export interface UMFrameworkAdapter { - render(element: any): void; + render(element: any): Promise; } diff --git a/x-pack/plugins/uptime/public/pages/__tests__/__snapshots__/overview.test.tsx.snap b/x-pack/plugins/uptime/public/pages/__tests__/__snapshots__/overview.test.tsx.snap index 791bb4a57ae52..0d732a943f167 100644 --- a/x-pack/plugins/uptime/public/pages/__tests__/__snapshots__/overview.test.tsx.snap +++ b/x-pack/plugins/uptime/public/pages/__tests__/__snapshots__/overview.test.tsx.snap @@ -149,6 +149,7 @@ exports[`MonitorPage shallow renders expected elements for valid props 1`] = ` "title": "heartbeat-8*", } } + loading={false} setEsKueryFilters={[MockFunction]} /> diff --git a/x-pack/plugins/uptime/public/pages/__tests__/overview.test.tsx b/x-pack/plugins/uptime/public/pages/__tests__/overview.test.tsx index e861e245e4ac7..0fd72a6619386 100644 --- a/x-pack/plugins/uptime/public/pages/__tests__/overview.test.tsx +++ b/x-pack/plugins/uptime/public/pages/__tests__/overview.test.tsx @@ -91,7 +91,11 @@ describe('MonitorPage', () => { it('shallow renders expected elements for valid props', () => { expect( shallowWithRouter( - + ) ).toMatchSnapshot(); }); diff --git a/x-pack/plugins/uptime/public/pages/overview.tsx b/x-pack/plugins/uptime/public/pages/overview.tsx index f31edc588ff7b..32c86435913f7 100644 --- a/x-pack/plugins/uptime/public/pages/overview.tsx +++ b/x-pack/plugins/uptime/public/pages/overview.tsx @@ -21,6 +21,7 @@ import { StatusPanel } from '../components/overview/status_panel'; import { useKibana } from '../../../../../src/plugins/kibana_react/public'; interface Props { + loading: boolean; indexPattern: IIndexPattern | null; setEsKueryFilters: (esFilters: string) => void; } @@ -37,58 +38,60 @@ const EuiFlexItemStyled = styled(EuiFlexItem)` } `; -export const OverviewPageComponent = React.memo(({ indexPattern, setEsKueryFilters }: Props) => { - const { absoluteDateRangeStart, absoluteDateRangeEnd, ...params } = useGetUrlParams(); - const { search, filters: urlFilters } = params; +export const OverviewPageComponent = React.memo( + ({ indexPattern, setEsKueryFilters, loading }: Props) => { + const { absoluteDateRangeStart, absoluteDateRangeEnd, ...params } = useGetUrlParams(); + const { search, filters: urlFilters } = params; - const { - services: { - data: { autocomplete }, - }, - } = useKibana(); + const { + services: { + data: { autocomplete }, + }, + } = useKibana(); - useTrackPageview({ app: 'uptime', path: 'overview' }); - useTrackPageview({ app: 'uptime', path: 'overview', delay: 15000 }); + useTrackPageview({ app: 'uptime', path: 'overview' }); + useTrackPageview({ app: 'uptime', path: 'overview', delay: 15000 }); - const [esFilters, error] = useUpdateKueryString(indexPattern, search, urlFilters); + const [esFilters, error] = useUpdateKueryString(indexPattern, search, urlFilters); - useEffect(() => { - setEsKueryFilters(esFilters ?? ''); - }, [esFilters, setEsKueryFilters]); + useEffect(() => { + setEsKueryFilters(esFilters ?? ''); + }, [esFilters, setEsKueryFilters]); - const linkParameters = stringifyUrlParams(params, true); + const linkParameters = stringifyUrlParams(params, true); - const heading = i18n.translate('xpack.uptime.overviewPage.headerText', { - defaultMessage: 'Overview', - description: `The text that will be displayed in the app's heading when the Overview page loads.`, - }); + const heading = i18n.translate('xpack.uptime.overviewPage.headerText', { + defaultMessage: 'Overview', + description: `The text that will be displayed in the app's heading when the Overview page loads.`, + }); - useBreadcrumbs([]); // No extra breadcrumbs on overview + useBreadcrumbs([]); // No extra breadcrumbs on overview - return ( - <> - - - - - - - - - - {error && } - - - - - - - - ); -}); + return ( + <> + + + + + + + + + + {error && !loading && } + + + + + + + + ); + } +); diff --git a/x-pack/plugins/uptime/public/state/actions/ui.ts b/x-pack/plugins/uptime/public/state/actions/ui.ts index 80e8796843ac2..0d21e177d3e40 100644 --- a/x-pack/plugins/uptime/public/state/actions/ui.ts +++ b/x-pack/plugins/uptime/public/state/actions/ui.ts @@ -18,8 +18,6 @@ export const setAlertFlyoutType = createAction('SET ALERT FLYOUT TYPE'); export const setBasePath = createAction('SET BASE PATH'); -export const triggerAppRefresh = createAction('REFRESH APP'); - export const setEsKueryString = createAction('SET ES KUERY STRING'); export const toggleIntegrationsPopover = createAction( diff --git a/x-pack/plugins/uptime/public/state/reducers/__tests__/__snapshots__/ui.test.ts.snap b/x-pack/plugins/uptime/public/state/reducers/__tests__/__snapshots__/ui.test.ts.snap index 1dc4e45606c60..f8faf78fbc504 100644 --- a/x-pack/plugins/uptime/public/state/reducers/__tests__/__snapshots__/ui.test.ts.snap +++ b/x-pack/plugins/uptime/public/state/reducers/__tests__/__snapshots__/ui.test.ts.snap @@ -9,7 +9,6 @@ Object { "id": "popover-2", "open": true, }, - "lastRefresh": 125, } `; @@ -19,16 +18,5 @@ Object { "basePath": "yyz", "esKuery": "", "integrationsPopoverOpen": null, - "lastRefresh": 125, -} -`; - -exports[`ui reducer updates the refresh value 1`] = ` -Object { - "alertFlyoutVisible": false, - "basePath": "abc", - "esKuery": "", - "integrationsPopoverOpen": null, - "lastRefresh": 125, } `; diff --git a/x-pack/plugins/uptime/public/state/reducers/__tests__/ui.test.ts b/x-pack/plugins/uptime/public/state/reducers/__tests__/ui.test.ts index 3c134366347aa..94bc626088c84 100644 --- a/x-pack/plugins/uptime/public/state/reducers/__tests__/ui.test.ts +++ b/x-pack/plugins/uptime/public/state/reducers/__tests__/ui.test.ts @@ -4,12 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { - setBasePath, - toggleIntegrationsPopover, - triggerAppRefresh, - setAlertFlyoutVisible, -} from '../../actions'; +import { setBasePath, toggleIntegrationsPopover, setAlertFlyoutVisible } from '../../actions'; import { uiReducer } from '../ui'; import { Action } from 'redux-actions'; @@ -23,7 +18,6 @@ describe('ui reducer', () => { basePath: 'abc', esKuery: '', integrationsPopoverOpen: null, - lastRefresh: 125, }, action ) @@ -42,23 +36,6 @@ describe('ui reducer', () => { basePath: '', esKuery: '', integrationsPopoverOpen: null, - lastRefresh: 125, - }, - action - ) - ).toMatchSnapshot(); - }); - - it('updates the refresh value', () => { - const action = triggerAppRefresh(125) as Action; - expect( - uiReducer( - { - alertFlyoutVisible: false, - basePath: 'abc', - esKuery: '', - integrationsPopoverOpen: null, - lastRefresh: 125, }, action ) @@ -74,7 +51,6 @@ describe('ui reducer', () => { basePath: '', esKuery: '', integrationsPopoverOpen: null, - lastRefresh: 125, }, action ) @@ -84,7 +60,6 @@ describe('ui reducer', () => { "basePath": "", "esKuery": "", "integrationsPopoverOpen": null, - "lastRefresh": 125, } `); }); diff --git a/x-pack/plugins/uptime/public/state/reducers/ui.ts b/x-pack/plugins/uptime/public/state/reducers/ui.ts index 82c2bfe2c0cec..9e7bc2ad02723 100644 --- a/x-pack/plugins/uptime/public/state/reducers/ui.ts +++ b/x-pack/plugins/uptime/public/state/reducers/ui.ts @@ -10,7 +10,6 @@ import { toggleIntegrationsPopover, setBasePath, setEsKueryString, - triggerAppRefresh, UiPayload, setAlertFlyoutType, setAlertFlyoutVisible, @@ -22,7 +21,6 @@ export interface UiState { basePath: string; esKuery: string; integrationsPopoverOpen: PopoverState | null; - lastRefresh: number; } const initialState: UiState = { @@ -30,7 +28,6 @@ const initialState: UiState = { basePath: '', esKuery: '', integrationsPopoverOpen: null, - lastRefresh: Date.now(), }; export const uiReducer = handleActions( @@ -50,11 +47,6 @@ export const uiReducer = handleActions( basePath: action.payload as string, }), - [String(triggerAppRefresh)]: (state, action: Action) => ({ - ...state, - lastRefresh: action.payload as number, - }), - [String(setEsKueryString)]: (state, action: Action) => ({ ...state, esKuery: action.payload as string, diff --git a/x-pack/plugins/uptime/public/state/selectors/__tests__/index.test.ts b/x-pack/plugins/uptime/public/state/selectors/__tests__/index.test.ts index 1c4c12f5f52d2..d8121e29d0cae 100644 --- a/x-pack/plugins/uptime/public/state/selectors/__tests__/index.test.ts +++ b/x-pack/plugins/uptime/public/state/selectors/__tests__/index.test.ts @@ -44,7 +44,6 @@ describe('state selectors', () => { basePath: 'yyz', esKuery: '', integrationsPopoverOpen: null, - lastRefresh: 125, }, monitorStatus: { status: null, diff --git a/x-pack/plugins/uptime/public/state/selectors/index.ts b/x-pack/plugins/uptime/public/state/selectors/index.ts index 2b7eabe727ad1..1d1eb61a563d2 100644 --- a/x-pack/plugins/uptime/public/state/selectors/index.ts +++ b/x-pack/plugins/uptime/public/state/selectors/index.ts @@ -26,33 +26,13 @@ export const monitorStatusSelector = (state: AppState) => state.monitorStatus.st export const selectDynamicSettings = (state: AppState) => state.dynamicSettings; -export const selectIndexPattern = ({ indexPattern }: AppState) => { - return { indexPattern: indexPattern.index_pattern, loading: indexPattern.loading }; -}; +export const selectIndexPattern = ({ indexPattern }: AppState) => indexPattern; -export const selectPingHistogram = ({ ping, ui }: AppState) => { - return { - data: ping.pingHistogram, - loading: ping.loading, - lastRefresh: ui.lastRefresh, - esKuery: ui.esKuery, - }; -}; +export const selectPingHistogram = ({ ping }: AppState) => ping; -export const selectPingList = ({ pingList, ui: { lastRefresh } }: AppState) => ({ - pings: pingList, - lastRefresh, -}); +export const selectPingList = ({ pingList }: AppState) => pingList; -export const snapshotDataSelector = ({ - snapshot: { count, loading }, - ui: { lastRefresh, esKuery }, -}: AppState) => ({ - count, - lastRefresh, - loading, - esKuery, -}); +export const snapshotDataSelector = ({ snapshot }: AppState) => snapshot; const mlCapabilitiesSelector = (state: AppState) => state.ml.mlCapabilities.data; @@ -84,9 +64,7 @@ export const isMLJobDeletedSelector = ({ ml }: AppState) => ml.deleteJob; export const anomaliesSelector = ({ ml }: AppState) => ml.anomalies.data; -export const selectDurationLines = ({ monitorDuration }: AppState) => { - return monitorDuration; -}; +export const selectDurationLines = ({ monitorDuration }: AppState) => monitorDuration; export const selectAlertFlyoutVisibility = ({ ui: { alertFlyoutVisible } }: AppState) => alertFlyoutVisible; @@ -99,24 +77,10 @@ export const selectMonitorStatusAlert = ({ indexPattern, overviewFilters, ui }: locations: overviewFilters.filters.locations, }); -export const indexStatusSelector = ({ indexStatus }: AppState) => { - return indexStatus.indexStatus; -}; +export const indexStatusSelector = ({ indexStatus }: AppState) => indexStatus.indexStatus; -export const monitorListSelector = ({ monitorList, ui: { lastRefresh } }: AppState) => ({ - monitorList, - lastRefresh, -}); +export const monitorListSelector = ({ monitorList }: AppState) => monitorList; -export const overviewFiltersSelector = ({ overviewFilters }: AppState) => { - return overviewFilters.filters; -}; +export const overviewFiltersSelector = ({ overviewFilters }: AppState) => overviewFilters; -export const filterGroupDataSelector = ({ - overviewFilters: { loading, filters }, - ui: { esKuery }, -}: AppState) => ({ - esKuery, - filters, - loading, -}); +export const esKuerySelector = ({ ui: { esKuery } }: AppState) => esKuery; diff --git a/x-pack/plugins/uptime/public/uptime_app.tsx b/x-pack/plugins/uptime/public/uptime_app.tsx index 2891a15510f31..cc6475d6c9d90 100644 --- a/x-pack/plugins/uptime/public/uptime_app.tsx +++ b/x-pack/plugins/uptime/public/uptime_app.tsx @@ -47,7 +47,6 @@ export interface UptimeAppProps { isApmAvailable: boolean; isInfraAvailable: boolean; isLogsAvailable: boolean; - kibanaBreadcrumbs: ChromeBreadcrumb[]; plugins: ClientPluginsSetup; startPlugins: ClientPluginsStart; routerBasename: string; diff --git a/x-pack/scripts/functional_tests.js b/x-pack/scripts/functional_tests.js index b00150467de00..fc78e1b80bc68 100644 --- a/x-pack/scripts/functional_tests.js +++ b/x-pack/scripts/functional_tests.js @@ -6,16 +6,11 @@ const alwaysImportedTests = [ require.resolve('../test/functional/config.js'), - require.resolve('../test/functional_endpoint_ingest_failure/config.ts'), - require.resolve('../test/functional_endpoint/config.ts'), require.resolve('../test/functional_with_es_ssl/config.ts'), require.resolve('../test/functional/config_security_basic.ts'), require.resolve('../test/functional/config_security_trial.ts'), - require.resolve('../test/plugin_functional/config.ts'), ]; const onlyNotInCoverageTests = [ - require.resolve('../test/reporting/configs/chromium_api.js'), - require.resolve('../test/reporting/configs/generate_api.js'), require.resolve('../test/api_integration/config_security_basic.js'), require.resolve('../test/api_integration/config.js'), require.resolve('../test/alerting_api_integration/basic/config.ts'), @@ -53,6 +48,7 @@ const onlyNotInCoverageTests = [ require.resolve('../test/licensing_plugin/config.public.ts'), require.resolve('../test/licensing_plugin/config.legacy.ts'), require.resolve('../test/endpoint_api_integration_no_ingest/config.ts'), + require.resolve('../test/reporting_api_integration/config.js'), ]; require('@kbn/plugin-helpers').babelRegister(); diff --git a/x-pack/test/api_integration/apis/endpoint/alerts.ts b/x-pack/test/api_integration/apis/endpoint/alerts/index.ts similarity index 98% rename from x-pack/test/api_integration/apis/endpoint/alerts.ts rename to x-pack/test/api_integration/apis/endpoint/alerts/index.ts index 94aaab2530247..62ea9e1624eec 100644 --- a/x-pack/test/api_integration/apis/endpoint/alerts.ts +++ b/x-pack/test/api_integration/apis/endpoint/alerts/index.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ import expect from '@kbn/expect/expect.js'; -import { FtrProviderContext } from '../../ftr_provider_context'; -import { AlertData } from '../../../../plugins/endpoint/common/types'; -import { AlertId } from '../../../../plugins/endpoint/server/routes/alerts/lib/index'; +import { FtrProviderContext } from '../../../ftr_provider_context'; +import { AlertData } from '../../../../../plugins/siem/common/endpoint_alerts/types'; +import { AlertId } from '../../../../../plugins/siem/server/endpoint/alerts/handlers/lib/index'; /** * The number of alert documents in the es archive. diff --git a/x-pack/test/api_integration/apis/endpoint/index_pattern.ts b/x-pack/test/api_integration/apis/endpoint/alerts/index_pattern.ts similarity index 94% rename from x-pack/test/api_integration/apis/endpoint/index_pattern.ts rename to x-pack/test/api_integration/apis/endpoint/alerts/index_pattern.ts index d3ffd67defef1..395f208150931 100644 --- a/x-pack/test/api_integration/apis/endpoint/index_pattern.ts +++ b/x-pack/test/api_integration/apis/endpoint/alerts/index_pattern.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import expect from '@kbn/expect/expect.js'; -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrProviderContext } from '../../../ftr_provider_context'; export default function({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/endpoint/index.ts b/x-pack/test/api_integration/apis/endpoint/index.ts index 0c7c03da6c594..92a22b66c45c8 100644 --- a/x-pack/test/api_integration/apis/endpoint/index.ts +++ b/x-pack/test/api_integration/apis/endpoint/index.ts @@ -16,7 +16,7 @@ export default function endpointAPIIntegrationTests({ before(async () => { await ingestManager.setup(); }); - loadTestFile(require.resolve('./index_pattern')); + loadTestFile(require.resolve('./alerts/index_pattern')); loadTestFile(require.resolve('./resolver')); loadTestFile(require.resolve('./metadata')); loadTestFile(require.resolve('./alerts')); diff --git a/x-pack/test/api_integration/apis/features/features/features.ts b/x-pack/test/api_integration/apis/features/features/features.ts index 7a0196adbfffd..197e551c71888 100644 --- a/x-pack/test/api_integration/apis/features/features/features.ts +++ b/x-pack/test/api_integration/apis/features/features/features.ts @@ -114,7 +114,6 @@ export default function({ getService }: FtrProviderContext) { 'maps', 'uptime', 'siem', - 'endpoint', 'ingestManager', ].sort() ); diff --git a/x-pack/test/api_integration/apis/infra/metrics_explorer.ts b/x-pack/test/api_integration/apis/infra/metrics_explorer.ts index 1563ae208867c..4491944699b21 100644 --- a/x-pack/test/api_integration/apis/infra/metrics_explorer.ts +++ b/x-pack/test/api_integration/apis/infra/metrics_explorer.ts @@ -36,11 +36,9 @@ export default function({ getService }: FtrProviderContext) { { aggregation: 'avg', field: 'system.cpu.user.pct', - rate: false, }, { aggregation: 'count', - rate: false, }, ], }; @@ -52,7 +50,7 @@ export default function({ getService }: FtrProviderContext) { const body = decodeOrThrow(metricsExplorerResponseRT)(response.body); expect(body.series).length(1); const firstSeries = first(body.series); - expect(firstSeries).to.have.property('id', 'ALL'); + expect(firstSeries).to.have.property('id', 'Everything'); expect(firstSeries.columns).to.eql([ { name: 'timestamp', type: 'date' }, { name: 'metric_0', type: 'number' }, @@ -81,7 +79,6 @@ export default function({ getService }: FtrProviderContext) { { aggregation: 'avg', field: 'system.cpu.user.pct', - rate: false, }, ], }; @@ -93,7 +90,7 @@ export default function({ getService }: FtrProviderContext) { const body = decodeOrThrow(metricsExplorerResponseRT)(response.body); expect(body.series).length(1); const firstSeries = first(body.series); - expect(firstSeries).to.have.property('id', 'ALL'); + expect(firstSeries).to.have.property('id', 'Everything'); expect(firstSeries.columns).to.eql([ { name: 'timestamp', type: 'date' }, { name: 'metric_0', type: 'number' }, @@ -124,7 +121,7 @@ export default function({ getService }: FtrProviderContext) { const body = decodeOrThrow(metricsExplorerResponseRT)(response.body); expect(body.series).length(1); const firstSeries = first(body.series); - expect(firstSeries).to.have.property('id', 'ALL'); + expect(firstSeries).to.have.property('id', 'Everything'); expect(firstSeries.columns).to.eql([]); expect(firstSeries.rows).to.have.length(0); }); @@ -144,7 +141,6 @@ export default function({ getService }: FtrProviderContext) { metrics: [ { aggregation: 'count', - rate: false, }, ], }; @@ -169,10 +165,55 @@ export default function({ getService }: FtrProviderContext) { timestamp: 1547571300000, }); expect(body.pageInfo).to.eql({ - afterKey: 'system.fsstat', + afterKey: { groupBy0: 'system.fsstat' }, total: 12, }); }); + + it('should work with multiple groupBy', async () => { + const postBody = { + timerange: { + field: '@timestamp', + to: max, + from: min, + interval: '>=1m', + }, + indexPattern: 'metricbeat-*', + groupBy: ['host.name', 'system.network.name'], + limit: 3, + afterKey: null, + metrics: [ + { + aggregation: 'rate', + field: 'system.network.out.bytes', + }, + ], + }; + const response = await supertest + .post('/api/infra/metrics_explorer') + .set('kbn-xsrf', 'xxx') + .send(postBody) + .expect(200); + const body = decodeOrThrow(metricsExplorerResponseRT)(response.body); + expect(body.series).length(3); + const firstSeries = first(body.series); + expect(firstSeries).to.have.property('id', 'demo-stack-mysql-01 / eth0'); + expect(firstSeries.columns).to.eql([ + { name: 'timestamp', type: 'date' }, + { name: 'metric_0', type: 'number' }, + { name: 'groupBy', type: 'string' }, + ]); + expect(firstSeries.rows).to.have.length(9); + expect(firstSeries.rows![1]).to.eql({ + groupBy: 'demo-stack-mysql-01 / eth0', + metric_0: 53577.683333333334, + timestamp: 1547571300000, + }); + expect(body.pageInfo).to.eql({ + afterKey: { groupBy0: 'demo-stack-mysql-01', groupBy1: 'eth2' }, + total: 4, + }); + }); }); describe('without data', () => { @@ -191,7 +232,6 @@ export default function({ getService }: FtrProviderContext) { { aggregation: 'avg', field: 'system.cpu.user.pct', - rate: false, }, ], }; @@ -225,7 +265,6 @@ export default function({ getService }: FtrProviderContext) { { aggregation: 'avg', field: 'system.cpu.user.pct', - rate: false, }, ], }; diff --git a/x-pack/test/api_integration/apis/security/privileges.ts b/x-pack/test/api_integration/apis/security/privileges.ts index 9bec3fd076e86..a6537644551a1 100644 --- a/x-pack/test/api_integration/apis/security/privileges.ts +++ b/x-pack/test/api_integration/apis/security/privileges.ts @@ -36,7 +36,6 @@ export default function({ getService }: FtrProviderContext) { uptime: ['all', 'read'], apm: ['all', 'read'], siem: ['all', 'read'], - endpoint: ['all', 'read'], ingestManager: ['all', 'read'], }, global: ['all', 'read'], diff --git a/x-pack/test/api_integration/apis/security/privileges_basic.ts b/x-pack/test/api_integration/apis/security/privileges_basic.ts index 1f9eac148b302..dc352c2833594 100644 --- a/x-pack/test/api_integration/apis/security/privileges_basic.ts +++ b/x-pack/test/api_integration/apis/security/privileges_basic.ts @@ -34,7 +34,6 @@ export default function({ getService }: FtrProviderContext) { uptime: ['all', 'read'], apm: ['all', 'read'], siem: ['all', 'read'], - endpoint: ['all', 'read'], ingestManager: ['all', 'read'], }, global: ['all', 'read'], diff --git a/x-pack/test/api_integration/config.js b/x-pack/test/api_integration/config.js index dda8c2d888d30..41ae65062b113 100644 --- a/x-pack/test/api_integration/config.js +++ b/x-pack/test/api_integration/config.js @@ -26,11 +26,9 @@ export async function getApiIntegrationConfig({ readConfigFile }) { ...xPackFunctionalTestsConfig.get('kbnTestServer.serverArgs'), '--xpack.security.session.idleTimeout=3600000', // 1 hour '--optimize.enabled=false', - '--xpack.endpoint.enabled=true', '--telemetry.optIn=true', - '--xpack.endpoint.enabled=true', '--xpack.ingestManager.enabled=true', - '--xpack.endpoint.alertResultListDefaultDateRange.from=2018-01-10T00:00:00.000Z', + '--xpack.siem.alertResultListDefaultDateRange.from=2018-01-10T00:00:00.000Z', ], }, esTestCluster: { diff --git a/x-pack/test/encrypted_saved_objects_api_integration/fixtures/api_consumer_plugin/server/hidden_saved_object_routes.ts b/x-pack/test/encrypted_saved_objects_api_integration/fixtures/api_consumer_plugin/server/hidden_saved_object_routes.ts new file mode 100644 index 0000000000000..ac3791be538f9 --- /dev/null +++ b/x-pack/test/encrypted_saved_objects_api_integration/fixtures/api_consumer_plugin/server/hidden_saved_object_routes.ts @@ -0,0 +1,235 @@ +/* + * 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 { schema } from '@kbn/config-schema'; +import { IRouter, CoreSetup } from 'kibana/server'; +import { PluginsSetup, PluginsStart } from '.'; + +export function registerHiddenSORoutes( + router: IRouter, + core: CoreSetup, + deps: PluginsSetup, + hiddenTypes: string[] +) { + router.get( + { + path: '/api/hidden_saved_objects/get-decrypted-as-internal-user/{type}/{id}', + validate: { params: value => ({ value }) }, + }, + async (context, request, response) => { + const [, { encryptedSavedObjects }] = await core.getStartServices(); + const spaceId = deps.spaces.spacesService.getSpaceId(request); + const namespace = deps.spaces.spacesService.spaceIdToNamespace(spaceId); + try { + return response.ok({ + body: await encryptedSavedObjects + .getClient([request.params.type]) + .getDecryptedAsInternalUser(request.params.type, request.params.id, { namespace }), + }); + } catch (err) { + if (encryptedSavedObjects.isEncryptionError(err)) { + return response.badRequest({ body: 'Failed to encrypt attributes' }); + } + + return response.customError({ body: err, statusCode: 500 }); + } + } + ); + + router.get( + { + path: '/api/hidden_saved_objects/_find', + validate: { + query: schema.object({ + per_page: schema.number({ min: 0, defaultValue: 20 }), + page: schema.number({ min: 0, defaultValue: 1 }), + type: schema.oneOf([schema.string(), schema.arrayOf(schema.string())]), + search: schema.maybe(schema.string()), + default_search_operator: schema.oneOf([schema.literal('OR'), schema.literal('AND')], { + defaultValue: 'OR', + }), + search_fields: schema.maybe( + schema.oneOf([schema.string(), schema.arrayOf(schema.string())]) + ), + sort_field: schema.maybe(schema.string()), + has_reference: schema.maybe( + schema.object({ + type: schema.string(), + id: schema.string(), + }) + ), + fields: schema.maybe(schema.oneOf([schema.string(), schema.arrayOf(schema.string())])), + filter: schema.maybe(schema.string()), + }), + }, + }, + async (context, request, response) => { + const query = request.query; + const [{ savedObjects }] = await core.getStartServices(); + return response.ok({ + body: await savedObjects + .getScopedClient(request, { includedHiddenTypes: hiddenTypes }) + .find({ + perPage: query.per_page, + page: query.page, + type: Array.isArray(query.type) ? query.type : [query.type], + search: query.search, + defaultSearchOperator: query.default_search_operator, + searchFields: + typeof query.search_fields === 'string' ? [query.search_fields] : query.search_fields, + sortField: query.sort_field, + hasReference: query.has_reference, + fields: typeof query.fields === 'string' ? [query.fields] : query.fields, + filter: query.filter, + }), + }); + } + ); + + router.get( + { + path: '/api/hidden_saved_objects/{type}/{id}', + validate: { params: value => ({ value }) }, + }, + async (context, request, response) => { + const [{ savedObjects }] = await core.getStartServices(); + return response.ok({ + body: await savedObjects + .getScopedClient(request, { includedHiddenTypes: hiddenTypes }) + .get(request.params.type, request.params.id), + }); + } + ); + router.post( + { + path: '/api/hidden_saved_objects/{type}', + validate: { + params: schema.object({ + type: schema.string(), + id: schema.maybe(schema.string()), + }), + query: schema.object({ + overwrite: schema.boolean({ defaultValue: false }), + }), + body: schema.object({ + attributes: schema.recordOf(schema.string(), schema.any()), + migrationVersion: schema.maybe(schema.recordOf(schema.string(), schema.string())), + references: schema.maybe( + schema.arrayOf( + schema.object({ + name: schema.string(), + type: schema.string(), + id: schema.string(), + }) + ) + ), + }), + }, + }, + async (context, request, response) => { + const [{ savedObjects }] = await core.getStartServices(); + const { type, id } = request.params; + const { attributes, migrationVersion, references } = request.body as any; + const options = { id, migrationVersion, references }; + const so = await savedObjects + .getScopedClient(request, { includedHiddenTypes: hiddenTypes }) + .create(type, attributes, options); + return response.ok({ + body: so, + }); + } + ); + router.put( + { + path: '/api/hidden_saved_objects/{type}/{id}', + validate: { + params: schema.object({ + type: schema.string(), + id: schema.string(), + }), + body: schema.object({ + attributes: schema.recordOf(schema.string(), schema.any()), + version: schema.maybe(schema.string()), + references: schema.maybe( + schema.arrayOf( + schema.object({ + name: schema.string(), + type: schema.string(), + id: schema.string(), + }) + ) + ), + }), + }, + }, + async (context, request, response) => { + const [{ savedObjects }] = await core.getStartServices(); + const { type, id } = request.params as any; + const { attributes, version, references } = request.body as any; + const options = { version, references }; + return response.ok({ + body: await savedObjects + .getScopedClient(request, { includedHiddenTypes: hiddenTypes }) + .update(type, id, attributes, options), + }); + } + ); + router.post( + { + path: '/api/hidden_saved_objects/_bulk_get', + validate: { + body: schema.arrayOf( + schema.object({ + type: schema.string(), + id: schema.string(), + fields: schema.maybe(schema.arrayOf(schema.string())), + }) + ), + }, + }, + async (context, request, response) => { + const [{ savedObjects }] = await core.getStartServices(); + return response.ok({ + body: await savedObjects + .getScopedClient(request, { includedHiddenTypes: hiddenTypes }) + .bulkGet(request.body as any), + }); + } + ); + router.post( + { + path: '/api/hidden_saved_objects/_bulk_create', + validate: { + body: schema.arrayOf( + schema.object({ + type: schema.string(), + id: schema.maybe(schema.string()), + attributes: schema.recordOf(schema.string(), schema.any()), + version: schema.maybe(schema.string()), + migrationVersion: schema.maybe(schema.recordOf(schema.string(), schema.string())), + references: schema.maybe( + schema.arrayOf( + schema.object({ + name: schema.string(), + type: schema.string(), + id: schema.string(), + }) + ) + ), + }) + ), + }, + }, + async (context, request, response) => { + const [{ savedObjects }] = await core.getStartServices(); + return response.ok({ + body: await savedObjects + .getScopedClient(request, { includedHiddenTypes: hiddenTypes }) + .bulkCreate(request.body as any), + }); + } + ); +} diff --git a/x-pack/test/encrypted_saved_objects_api_integration/fixtures/api_consumer_plugin/server/index.ts b/x-pack/test/encrypted_saved_objects_api_integration/fixtures/api_consumer_plugin/server/index.ts index 136d52557f9f7..b0b73a54ceefe 100644 --- a/x-pack/test/encrypted_saved_objects_api_integration/fixtures/api_consumer_plugin/server/index.ts +++ b/x-pack/test/encrypted_saved_objects_api_integration/fixtures/api_consumer_plugin/server/index.ts @@ -15,31 +15,34 @@ import { EncryptedSavedObjectsPluginStart, } from '../../../../../plugins/encrypted_saved_objects/server'; import { SpacesPluginSetup } from '../../../../../plugins/spaces/server'; +import { registerHiddenSORoutes } from './hidden_saved_object_routes'; const SAVED_OBJECT_WITH_SECRET_TYPE = 'saved-object-with-secret'; +const HIDDEN_SAVED_OBJECT_WITH_SECRET_TYPE = 'hidden-saved-object-with-secret'; const SAVED_OBJECT_WITH_SECRET_AND_MULTIPLE_SPACES_TYPE = 'saved-object-with-secret-and-multiple-spaces'; const SAVED_OBJECT_WITHOUT_SECRET_TYPE = 'saved-object-without-secret'; -interface PluginsSetup { +export interface PluginsSetup { encryptedSavedObjects: EncryptedSavedObjectsPluginSetup; spaces: SpacesPluginSetup; } -interface PluginsStart { +export interface PluginsStart { encryptedSavedObjects: EncryptedSavedObjectsPluginStart; spaces: never; } export const plugin: PluginInitializer = () => ({ setup(core: CoreSetup, deps) { - for (const [name, namespaceType] of [ - [SAVED_OBJECT_WITH_SECRET_TYPE, 'single'], - [SAVED_OBJECT_WITH_SECRET_AND_MULTIPLE_SPACES_TYPE, 'multiple'], - ] as Array<[string, SavedObjectsNamespaceType]>) { + for (const [name, namespaceType, hidden] of [ + [SAVED_OBJECT_WITH_SECRET_TYPE, 'single', false], + [HIDDEN_SAVED_OBJECT_WITH_SECRET_TYPE, 'single', true], + [SAVED_OBJECT_WITH_SECRET_AND_MULTIPLE_SPACES_TYPE, 'multiple', false], + ] as Array<[string, SavedObjectsNamespaceType, boolean]>) { core.savedObjects.registerType({ name, - hidden: false, + hidden, namespaceType, mappings: deepFreeze({ properties: { @@ -68,7 +71,8 @@ export const plugin: PluginInitializer = mappings: deepFreeze({ properties: { publicProperty: { type: 'keyword' } } }), }); - core.http.createRouter().get( + const router = core.http.createRouter(); + router.get( { path: '/api/saved_objects/get-decrypted-as-internal-user/{type}/{id}', validate: { params: value => ({ value }) }, @@ -93,6 +97,8 @@ export const plugin: PluginInitializer = } } ); + + registerHiddenSORoutes(router, core, deps, [HIDDEN_SAVED_OBJECT_WITH_SECRET_TYPE]); }, start() {}, stop() {}, diff --git a/x-pack/test/encrypted_saved_objects_api_integration/tests/encrypted_saved_objects_api.ts b/x-pack/test/encrypted_saved_objects_api_integration/tests/encrypted_saved_objects_api.ts index 54b1f00616c94..2c97640b8d650 100644 --- a/x-pack/test/encrypted_saved_objects_api_integration/tests/encrypted_saved_objects_api.ts +++ b/x-pack/test/encrypted_saved_objects_api_integration/tests/encrypted_saved_objects_api.ts @@ -14,6 +14,7 @@ export default function({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const SAVED_OBJECT_WITH_SECRET_TYPE = 'saved-object-with-secret'; + const HIDDEN_SAVED_OBJECT_WITH_SECRET_TYPE = 'hidden-saved-object-with-secret'; const SAVED_OBJECT_WITH_SECRET_AND_MULTIPLE_SPACES_TYPE = 'saved-object-with-secret-and-multiple-spaces'; const SAVED_OBJECT_WITHOUT_SECRET_TYPE = 'saved-object-without-secret'; @@ -438,7 +439,7 @@ export default function({ getService }: FtrProviderContext) { afterEach(async () => { await es.deleteByQuery({ index: '.kibana', - q: `type:${SAVED_OBJECT_WITH_SECRET_TYPE} OR type:${SAVED_OBJECT_WITH_SECRET_AND_MULTIPLE_SPACES_TYPE} OR type:${SAVED_OBJECT_WITHOUT_SECRET_TYPE}`, + q: `type:${SAVED_OBJECT_WITH_SECRET_TYPE} OR type:${HIDDEN_SAVED_OBJECT_WITH_SECRET_TYPE} OR type:${SAVED_OBJECT_WITH_SECRET_AND_MULTIPLE_SPACES_TYPE} OR type:${SAVED_OBJECT_WITHOUT_SECRET_TYPE}`, refresh: true, }); }); @@ -452,6 +453,14 @@ export default function({ getService }: FtrProviderContext) { ); }); + describe('hidden type with `single` namespace saved object', () => { + runTests( + HIDDEN_SAVED_OBJECT_WITH_SECRET_TYPE, + () => '/api/hidden_saved_objects/', + (id, type) => generateRawId(id, type) + ); + }); + describe('with `multiple` namespace saved object', () => { runTests( SAVED_OBJECT_WITH_SECRET_AND_MULTIPLE_SPACES_TYPE, diff --git a/x-pack/test/endpoint_api_integration_no_ingest/apis/alerts.ts b/x-pack/test/endpoint_api_integration_no_ingest/apis/alerts/index.ts similarity index 93% rename from x-pack/test/endpoint_api_integration_no_ingest/apis/alerts.ts rename to x-pack/test/endpoint_api_integration_no_ingest/apis/alerts/index.ts index b75d69238d653..badb05cbe7a74 100644 --- a/x-pack/test/endpoint_api_integration_no_ingest/apis/alerts.ts +++ b/x-pack/test/endpoint_api_integration_no_ingest/apis/alerts/index.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrProviderContext } from '../../ftr_provider_context'; export default function({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/endpoint_api_integration_no_ingest/apis/index_pattern.ts b/x-pack/test/endpoint_api_integration_no_ingest/apis/alerts/index_pattern.ts similarity index 90% rename from x-pack/test/endpoint_api_integration_no_ingest/apis/index_pattern.ts rename to x-pack/test/endpoint_api_integration_no_ingest/apis/alerts/index_pattern.ts index 664ef7d96847c..13a0d61de3139 100644 --- a/x-pack/test/endpoint_api_integration_no_ingest/apis/index_pattern.ts +++ b/x-pack/test/endpoint_api_integration_no_ingest/apis/alerts/index_pattern.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { FtrProviderContext } from '../ftr_provider_context'; +import { FtrProviderContext } from '../../ftr_provider_context'; export default function({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/endpoint_api_integration_no_ingest/apis/index.ts b/x-pack/test/endpoint_api_integration_no_ingest/apis/index.ts index 6110f398df5a0..321ef35180ca8 100644 --- a/x-pack/test/endpoint_api_integration_no_ingest/apis/index.ts +++ b/x-pack/test/endpoint_api_integration_no_ingest/apis/index.ts @@ -9,7 +9,7 @@ import { FtrProviderContext } from '../ftr_provider_context'; export default function endpointAPIIntegrationTests({ loadTestFile }: FtrProviderContext) { describe('Endpoint plugin', function() { this.tags('ciGroup7'); - loadTestFile(require.resolve('./index_pattern')); + loadTestFile(require.resolve('./alerts/index_pattern')); loadTestFile(require.resolve('./metadata')); loadTestFile(require.resolve('./alerts')); }); diff --git a/x-pack/test/functional/apps/visualize/precalculated_histogram.ts b/x-pack/test/functional/apps/visualize/precalculated_histogram.ts index 5d362d29b640c..d20af67508b57 100644 --- a/x-pack/test/functional/apps/visualize/precalculated_histogram.ts +++ b/x-pack/test/functional/apps/visualize/precalculated_histogram.ts @@ -24,37 +24,62 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { return esArchiver.unload('pre_calculated_histogram'); }); - const initHistogramBarChart = async () => { - await PageObjects.visualize.navigateToNewVisualization(); - await PageObjects.visualize.clickVerticalBarChart(); - await PageObjects.visualize.clickNewSearch('histogram-test'); - await PageObjects.visChart.waitForVisualization(); - }; - - const getFieldOptionsForAggregation = async (aggregation: string): Promise => { - await PageObjects.visEditor.clickBucket('Y-axis', 'metrics'); - await PageObjects.visEditor.selectAggregation(aggregation, 'metrics'); - const fieldValues = await PageObjects.visEditor.getField(); - return fieldValues; - }; - it('appears correctly in discover', async function() { await PageObjects.common.navigateToApp('discover'); const rowData = await PageObjects.discover.getDocTableIndex(1); expect(rowData.includes('"values": [ 0.3, 1, 3, 4.2, 4.8 ]')).to.be.ok(); }); - it('appears in the field options of a Percentiles aggregation', async function() { - await initHistogramBarChart(); - const fieldValues: string[] = await getFieldOptionsForAggregation('Percentiles'); - log.debug('Percentiles Fields = ' + fieldValues); - expect(fieldValues[0]).to.be('histogram-content'); - }); + describe('works in visualizations', () => { + before(async () => { + await PageObjects.visualize.navigateToNewVisualization(); + await PageObjects.visualize.clickDataTable(); + await PageObjects.visualize.clickNewSearch('histogram-test'); + await PageObjects.visChart.waitForVisualization(); + await PageObjects.visEditor.clickMetricEditor(); + }); + + const renderTableForAggregation = async (aggregation: string) => { + await PageObjects.visEditor.selectAggregation(aggregation, 'metrics'); + await PageObjects.visEditor.selectField('histogram-content', 'metrics'); + await PageObjects.visEditor.clickGo(); + + return await PageObjects.visChart.getTableVisContent(); + }; + + it('with percentiles aggregation', async () => { + const data = (await renderTableForAggregation('Percentiles')) as string[][]; + expect(data[0]).to.have.property('length', 7); + // Percentile values are not deterministic, so we can't check for the exact values here, + // but just check they are all within the given range + // see https://github.com/elastic/elasticsearch/issues/49225 + expect(data[0].every((p: string) => Number(p) >= 0.3 && Number(p) <= 5)).to.be(true); + }); + + it('with percentile ranks aggregation', async () => { + const data = await renderTableForAggregation('Percentile Ranks'); + expect(data).to.eql([['0%']]); + }); + + it('with average aggregation', async () => { + const data = await renderTableForAggregation('Average'); + expect(data).to.eql([['2.8510720308359434']]); + }); + + it('with median aggregation', async () => { + // Percentile values (which are used by median behind the scenes) are not deterministic, + // so we can't check for the exact values here, but just check they are all within the given range + // see https://github.com/elastic/elasticsearch/issues/49225 + const data = await renderTableForAggregation('Median'); + const value = Number(data[0][0]); + expect(value).to.be.above(3.0); + expect(value).to.be.below(3.3); + }); - it('appears in the field options of a Percentile Ranks aggregation', async function() { - const fieldValues: string[] = await getFieldOptionsForAggregation('Percentile Ranks'); - log.debug('Percentile Ranks Fields = ' + fieldValues); - expect(fieldValues[0]).to.be('histogram-content'); + it('with sum aggregation', async () => { + const data = await renderTableForAggregation('Sum'); + expect(data).to.eql([['11834.800000000001']]); + }); }); }); } diff --git a/x-pack/test/functional_endpoint/config.ts b/x-pack/test/functional_endpoint/config.ts index a371c548f3022..8b87993e4b985 100644 --- a/x-pack/test/functional_endpoint/config.ts +++ b/x-pack/test/functional_endpoint/config.ts @@ -30,7 +30,6 @@ export default async function({ readConfigFile }: FtrConfigProviderContext) { ...xpackFunctionalConfig.get('kbnTestServer'), serverArgs: [ ...xpackFunctionalConfig.get('kbnTestServer.serverArgs'), - '--xpack.endpoint.enabled=true', '--xpack.ingestManager.enabled=true', ], }, diff --git a/x-pack/test/functional_endpoint/services/endpoint_policy.ts b/x-pack/test/functional_endpoint/services/endpoint_policy.ts index e8e2d9957aa38..5142c083a0891 100644 --- a/x-pack/test/functional_endpoint/services/endpoint_policy.ts +++ b/x-pack/test/functional_endpoint/services/endpoint_policy.ts @@ -9,8 +9,8 @@ import { CreateAgentConfigResponse, CreateDatasourceResponse, } from '../../../plugins/ingest_manager/common'; -import { Immutable } from '../../../plugins/endpoint/common/types'; -import { factory as policyConfigFactory } from '../../../plugins/endpoint/common/models/policy_config'; +import { Immutable } from '../../../plugins/siem/common/endpoint/types'; +import { factory as policyConfigFactory } from '../../../plugins/siem/common/endpoint/models/policy_config'; const INGEST_API_ROOT = '/api/ingest_manager'; const INGEST_API_AGENT_CONFIGS = `${INGEST_API_ROOT}/agent_configs`; diff --git a/x-pack/test/plugin_functional/config.ts b/x-pack/test/plugin_functional/config.ts index aa3c9bd24842a..496be59ec3427 100644 --- a/x-pack/test/plugin_functional/config.ts +++ b/x-pack/test/plugin_functional/config.ts @@ -42,7 +42,6 @@ export default async function({ readConfigFile }: FtrConfigProviderContext) { ...plugins.map(pluginDir => `--plugin-path=${resolve(__dirname, 'plugins', pluginDir)}`), // Required to load new platform plugins via `--plugin-path` flag. '--env.name=development', - '--xpack.endpoint.enabled=true', ], }, uiSettings: xpackFunctionalConfig.get('uiSettings'), diff --git a/x-pack/test/reporting/.gitignore b/x-pack/test/reporting/.gitignore deleted file mode 100644 index 99ee4c44686a0..0000000000000 --- a/x-pack/test/reporting/.gitignore +++ /dev/null @@ -1 +0,0 @@ -functional/reports/session/ diff --git a/x-pack/test/reporting/api/chromium_tests.ts b/x-pack/test/reporting/api/chromium_tests.ts deleted file mode 100644 index 75e8e3e70b5a5..0000000000000 --- a/x-pack/test/reporting/api/chromium_tests.ts +++ /dev/null @@ -1,34 +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 { OSS_DATA_ARCHIVE_PATH, OSS_KIBANA_ARCHIVE_PATH } from './constants'; -import { FtrProviderContext } from '../ftr_provider_context'; - -// eslint-disable-next-line import/no-default-export -export default function({ loadTestFile, getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); - const kibanaServer = getService('kibanaServer'); - - describe('chromium', function() { - this.tags('ciGroup2'); - - before(async () => { - await esArchiver.load(OSS_KIBANA_ARCHIVE_PATH); - await esArchiver.load(OSS_DATA_ARCHIVE_PATH); - - await kibanaServer.uiSettings.update({ - defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', - }); - }); - - after(async () => { - await esArchiver.unload(OSS_KIBANA_ARCHIVE_PATH); - await esArchiver.unload(OSS_DATA_ARCHIVE_PATH); - }); - - loadTestFile(require.resolve('./usage')); - }); -} diff --git a/x-pack/test/reporting/configs/chromium_api.js b/x-pack/test/reporting/configs/chromium_api.js deleted file mode 100644 index 95649dfb5d7a3..0000000000000 --- a/x-pack/test/reporting/configs/chromium_api.js +++ /dev/null @@ -1,39 +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 { ReportingAPIProvider } from '../services'; - -export default async function({ readConfigFile }) { - const apiConfig = await readConfigFile(require.resolve('../../api_integration/config.js')); - const functionalConfig = await readConfigFile(require.resolve('../../functional/config.js')); - - return { - servers: apiConfig.get('servers'), - junit: { reportName: 'X-Pack Chromium API Reporting Tests' }, - testFiles: [require.resolve('../api/chromium_tests')], - services: { - ...apiConfig.get('services'), - reportingAPI: ReportingAPIProvider, - }, - kbnTestServer: { - ...apiConfig.get('kbnTestServer'), - serverArgs: [ - // Reporting API tests use functionalConfig instead of apiConfig because they needs a fully working UI. By default, the API config - // does not have optimize setting enabled, and Kibana would not have a working UI. - ...functionalConfig.get('kbnTestServer.serverArgs'), - '--logging.events.log', - '["info","warning","error","fatal","optimize","reporting"]', - '--xpack.endpoint.enabled=true', - '--xpack.reporting.csv.enablePanelActionDownload=true', - '--xpack.reporting.capture.maxAttempts=1', - '--xpack.security.session.idleTimeout=3600000', - '--xpack.spaces.enabled=false', - ], - }, - esArchiver: apiConfig.get('esArchiver'), - esTestCluster: apiConfig.get('esTestCluster'), - }; -} diff --git a/x-pack/test/reporting/services/index.ts b/x-pack/test/reporting/services/index.ts deleted file mode 100644 index 9684f2a8abc6c..0000000000000 --- a/x-pack/test/reporting/services/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import { ReportingAPIProvider } from './reporting_api'; -import { services as xpackServices } from '../../functional/services'; - -export const services = { - ...xpackServices, - reportingAPI: ReportingAPIProvider, -}; - -export { ReportingAPIProvider }; diff --git a/x-pack/test/reporting/configs/generate_api.js b/x-pack/test/reporting_api_integration/config.js similarity index 69% rename from x-pack/test/reporting/configs/generate_api.js rename to x-pack/test/reporting_api_integration/config.js index c2b5e6c84f05f..2b1cd637a831d 100644 --- a/x-pack/test/reporting/configs/generate_api.js +++ b/x-pack/test/reporting_api_integration/config.js @@ -6,15 +6,16 @@ import { esTestConfig, kbnTestConfig, kibanaServerTestUser } from '@kbn/test'; import { format as formatUrl } from 'url'; -import { ReportingAPIProvider } from '../services'; +import { ReportingAPIProvider } from './services'; export default async function({ readConfigFile }) { - const apiConfig = await readConfigFile(require.resolve('../../api_integration/config.js')); + const apiConfig = await readConfigFile(require.resolve('../api_integration/config')); + const functionalConfig = await readConfigFile(require.resolve('../functional/config')); // Reporting API tests need a fully working UI return { servers: apiConfig.get('servers'), - junit: { reportName: 'X-Pack Reporting Generate API Integration Tests' }, - testFiles: [require.resolve('../api/generate')], + junit: { reportName: 'X-Pack Reporting API Integration Tests' }, + testFiles: [require.resolve('./reporting')], services: { ...apiConfig.get('services'), reportingAPI: ReportingAPIProvider, @@ -22,18 +23,18 @@ export default async function({ readConfigFile }) { kbnTestServer: { ...apiConfig.get('kbnTestServer'), serverArgs: [ - '--logging.events.log', - '["info","warning","error","fatal","optimize","reporting"]', + ...functionalConfig.get('kbnTestServer.serverArgs'), + `--elasticsearch.hosts=${formatUrl(esTestConfig.getUrlParts())}`, `--elasticsearch.password=${kibanaServerTestUser.password}`, `--elasticsearch.username=${kibanaServerTestUser.username}`, `--logging.json=false`, - `--optimize.enabled=false`, `--server.maxPayloadBytes=1679958`, `--server.port=${kbnTestConfig.getPort()}`, - `--xpack.reporting.csv.enablePanelActionDownload=true`, + `--xpack.reporting.capture.maxAttempts=1`, `--xpack.reporting.csv.maxSizeBytes=2850`, `--xpack.reporting.queue.pollInterval=3000`, + `--xpack.security.session.idleTimeout=3600000`, `--xpack.spaces.enabled=false`, ], }, diff --git a/x-pack/test/reporting/api/generate/fixtures.ts b/x-pack/test/reporting_api_integration/fixtures.ts similarity index 100% rename from x-pack/test/reporting/api/generate/fixtures.ts rename to x-pack/test/reporting_api_integration/fixtures.ts diff --git a/x-pack/test/reporting/ftr_provider_context.d.ts b/x-pack/test/reporting_api_integration/ftr_provider_context.d.ts similarity index 100% rename from x-pack/test/reporting/ftr_provider_context.d.ts rename to x-pack/test/reporting_api_integration/ftr_provider_context.d.ts diff --git a/x-pack/test/reporting/api/generation_urls.ts b/x-pack/test/reporting_api_integration/generation_urls.ts similarity index 100% rename from x-pack/test/reporting/api/generation_urls.ts rename to x-pack/test/reporting_api_integration/generation_urls.ts diff --git a/x-pack/test/reporting/api/constants.ts b/x-pack/test/reporting_api_integration/reporting/constants.ts similarity index 65% rename from x-pack/test/reporting/api/constants.ts rename to x-pack/test/reporting_api_integration/reporting/constants.ts index 0b4cb4f44a4bc..590ef6325dd51 100644 --- a/x-pack/test/reporting/api/constants.ts +++ b/x-pack/test/reporting_api_integration/reporting/constants.ts @@ -3,13 +3,15 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + +import { REPO_ROOT } from '@kbn/dev-utils'; import path from 'path'; export const OSS_KIBANA_ARCHIVE_PATH = path.resolve( - __dirname, - '../../../../test/functional/fixtures/es_archiver/dashboard/current/kibana' + REPO_ROOT, + 'test/functional/fixtures/es_archiver/dashboard/current/kibana' ); export const OSS_DATA_ARCHIVE_PATH = path.resolve( - __dirname, - '../../../../test/functional/fixtures/es_archiver/dashboard/current/data' + REPO_ROOT, + 'test/functional/fixtures/es_archiver/dashboard/current/data' ); diff --git a/x-pack/test/reporting/api/generate/csv_job_params.ts b/x-pack/test/reporting_api_integration/reporting/csv_job_params.ts similarity index 89% rename from x-pack/test/reporting/api/generate/csv_job_params.ts rename to x-pack/test/reporting_api_integration/reporting/csv_job_params.ts index c8d6f11b74f9d..0cee0308e7489 100644 --- a/x-pack/test/reporting/api/generate/csv_job_params.ts +++ b/x-pack/test/reporting_api_integration/reporting/csv_job_params.ts @@ -6,12 +6,15 @@ import expect from '@kbn/expect'; import supertest from 'supertest'; -import { JOB_PARAMS_RISON } from './fixtures'; +import { JOB_PARAMS_RISON } from '../fixtures'; +import { FtrProviderContext } from '../ftr_provider_context'; // eslint-disable-next-line import/no-default-export -export default function({ getService }: { getService: any }) { +export default function({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const supertestSvc = getService('supertest'); + const reportingAPI = getService('reportingAPI'); + const generateAPI = { getCsvFromParamsInPayload: async (jobParams: object = {}) => { return await supertestSvc @@ -30,11 +33,13 @@ export default function({ getService }: { getService: any }) { before(async () => { await esArchiver.load('reporting/logs'); await esArchiver.load('logstash_functional'); - }); // prettier-ignore + }); + after(async () => { await esArchiver.unload('reporting/logs'); await esArchiver.unload('logstash_functional'); - }); // prettier-ignore + await reportingAPI.deleteAllReports(); + }); it('Rejects bogus jobParams', async () => { const { status: resStatus, text: resText } = (await generateAPI.getCsvFromParamsInPayload({ diff --git a/x-pack/test/reporting/api/generate/csv_saved_search.ts b/x-pack/test/reporting_api_integration/reporting/csv_saved_search.ts similarity index 98% rename from x-pack/test/reporting/api/generate/csv_saved_search.ts rename to x-pack/test/reporting_api_integration/reporting/csv_saved_search.ts index ed44ba8ea4a76..96d3f0f28c22b 100644 --- a/x-pack/test/reporting/api/generate/csv_saved_search.ts +++ b/x-pack/test/reporting_api_integration/reporting/csv_saved_search.ts @@ -7,15 +7,16 @@ import expect from '@kbn/expect'; import supertest from 'supertest'; import { + CSV_RESULT_DOCVALUE, CSV_RESULT_HUGE, + CSV_RESULT_NANOS, CSV_RESULT_SCRIPTED, CSV_RESULT_SCRIPTED_REQUERY, CSV_RESULT_SCRIPTED_RESORTED, CSV_RESULT_TIMEBASED, CSV_RESULT_TIMELESS, - CSV_RESULT_NANOS, - CSV_RESULT_DOCVALUE, -} from './fixtures'; +} from '../fixtures'; +import { FtrProviderContext } from '../ftr_provider_context'; interface GenerateOpts { timerange?: { @@ -27,9 +28,11 @@ interface GenerateOpts { } // eslint-disable-next-line import/no-default-export -export default function({ getService }: { getService: any }) { +export default function({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const supertestSvc = getService('supertest'); + const reportingAPI = getService('reportingAPI'); + const generateAPI = { getCsvFromSavedSearch: async ( id: string, @@ -45,6 +48,10 @@ export default function({ getService }: { getService: any }) { describe('Generation from Saved Search ID', () => { describe('Saved Search Features', () => { + after(async () => { + await reportingAPI.deleteAllReports(); + }); + it('With filters and timebased data', async () => { // load test data that contains a saved search and documents await esArchiver.load('reporting/logs'); diff --git a/x-pack/test/reporting/api/generate/index.ts b/x-pack/test/reporting_api_integration/reporting/index.ts similarity index 77% rename from x-pack/test/reporting/api/generate/index.ts rename to x-pack/test/reporting_api_integration/reporting/index.ts index b9db0d465d005..abfdb735d1dc7 100644 --- a/x-pack/test/reporting/api/generate/index.ts +++ b/x-pack/test/reporting_api_integration/reporting/index.ts @@ -4,13 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -import { FtrProviderContext } from '../../ftr_provider_context'; +import { FtrProviderContext } from '../ftr_provider_context'; // eslint-disable-next-line import/no-default-export export default function({ loadTestFile }: FtrProviderContext) { - describe('CSV', function() { + describe('Reporting APIs', function() { this.tags('ciGroup2'); - loadTestFile(require.resolve('./csv_saved_search')); loadTestFile(require.resolve('./csv_job_params')); + loadTestFile(require.resolve('./csv_saved_search')); + loadTestFile(require.resolve('./usage')); }); } diff --git a/x-pack/test/reporting/api/usage.ts b/x-pack/test/reporting_api_integration/reporting/usage.ts similarity index 88% rename from x-pack/test/reporting/api/usage.ts rename to x-pack/test/reporting_api_integration/reporting/usage.ts index e3ebcf9d3bab0..dc0144f74912c 100644 --- a/x-pack/test/reporting/api/usage.ts +++ b/x-pack/test/reporting_api_integration/reporting/usage.ts @@ -6,8 +6,9 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../ftr_provider_context'; -import { ReportingUsageStats } from '../services/reporting_api'; -import * as GenerationUrls from './generation_urls'; +import * as GenerationUrls from '../generation_urls'; +import { ReportingUsageStats } from '../services'; +import { OSS_DATA_ARCHIVE_PATH, OSS_KIBANA_ARCHIVE_PATH } from './constants'; interface UsageStats { reporting: ReportingUsageStats; @@ -16,12 +17,29 @@ interface UsageStats { // eslint-disable-next-line import/no-default-export export default function({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); const reportingAPI = getService('reportingAPI'); const usageAPI = getService('usageAPI' as any); // NOTE Usage API service is not Typescript describe('reporting usage', () => { - before(() => reportingAPI.deleteAllReportingIndexes()); - afterEach(() => reportingAPI.deleteAllReportingIndexes()); + before(async () => { + await esArchiver.load(OSS_KIBANA_ARCHIVE_PATH); + await esArchiver.load(OSS_DATA_ARCHIVE_PATH); + + await kibanaServer.uiSettings.update({ + defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', + }); + await reportingAPI.deleteAllReports(); + }); + + after(async () => { + await esArchiver.unload(OSS_KIBANA_ARCHIVE_PATH); + await esArchiver.unload(OSS_DATA_ARCHIVE_PATH); + }); + + afterEach(async () => { + await reportingAPI.deleteAllReports(); + }); describe('initial state', () => { let usage: UsageStats; @@ -98,7 +116,7 @@ export default function({ getService }: FtrProviderContext) { }); describe('from new jobs posted', () => { - it('csv', async () => { + it('should handle csv', async () => { await reportingAPI.expectAllJobsToFinishSuccessfully( await Promise.all([ reportingAPI.postJob(GenerationUrls.CSV_DISCOVER_KUERY_AND_FILTER_6_3), @@ -114,7 +132,7 @@ export default function({ getService }: FtrProviderContext) { reportingAPI.expectRecentJobTypeTotalStats(usage, 'printable_pdf', 0); }); - it('preserve_layout pdf', async () => { + it('should handle preserve_layout pdf', async () => { await reportingAPI.expectAllJobsToFinishSuccessfully( await Promise.all([ reportingAPI.postJob(GenerationUrls.PDF_PRESERVE_DASHBOARD_FILTER_6_3), @@ -131,7 +149,7 @@ export default function({ getService }: FtrProviderContext) { reportingAPI.expectRecentJobTypeTotalStats(usage, 'printable_pdf', 2); }); - it('print_layout pdf', async () => { + it('should handle print_layout pdf', async () => { await reportingAPI.expectAllJobsToFinishSuccessfully( await Promise.all([ reportingAPI.postJob(GenerationUrls.PDF_PRINT_DASHBOARD_6_3), diff --git a/x-pack/test/reporting/services/reporting_api.ts b/x-pack/test/reporting_api_integration/services.ts similarity index 76% rename from x-pack/test/reporting/services/reporting_api.ts rename to x-pack/test/reporting_api_integration/services.ts index 1fa5fd7135708..ae7b83e2ac81b 100644 --- a/x-pack/test/reporting/services/reporting_api.ts +++ b/x-pack/test/reporting_api_integration/services.ts @@ -5,9 +5,12 @@ */ import expect from '@kbn/expect'; +import * as Rx from 'rxjs'; +import { filter, first, mapTo, switchMap, timeout } from 'rxjs/operators'; // @ts-ignore no module definition -import { indexTimestamp } from '../../../legacy/plugins/reporting/server/lib/esqueue/helpers/index_timestamp'; -import { FtrProviderContext } from '../ftr_provider_context'; +import { indexTimestamp } from '../../legacy/plugins/reporting/server/lib/esqueue/helpers/index_timestamp'; +import { services as xpackServices } from '../functional/services'; +import { FtrProviderContext } from './ftr_provider_context'; interface PDFAppCounts { app: { @@ -56,7 +59,13 @@ export function ReportingAPIProvider({ getService }: FtrProviderContext) { .get(downloadReportPath) .responseType('blob') .set('kbn-xsrf', 'xxx')) as any; - log.debug(`Report at path ${downloadReportPath} returned code ${response.statusCode}`); + if (response.statusCode === 503) { + log.debug(`Report at path ${downloadReportPath} is pending`); + } else if (response.statusCode === 200) { + log.debug(`Report at path ${downloadReportPath} is complete`); + } else { + log.debug(`Report at path ${downloadReportPath} returned code ${response.statusCode}`); + } if (response.statusCode !== JOB_IS_PENDING_CODE) { clearInterval(intervalId); resolve(response.statusCode); @@ -120,9 +129,25 @@ export function ReportingAPIProvider({ getService }: FtrProviderContext) { }; }, - async deleteAllReportingIndexes() { - log.debug('ReportingAPI.deleteAllReportingIndexes'); - await esSupertest.delete('/.reporting*').expect(200); + async deleteAllReports() { + log.debug('ReportingAPI.deleteAllReports'); + + // ignores 409 errs and keeps retrying + const deleted$ = Rx.interval(100).pipe( + switchMap(() => + esSupertest + .post('/.reporting*/_delete_by_query') + .send({ query: { match_all: {} } }) + .then(({ status }) => status) + ), + filter(status => status === 200), + mapTo(true), + first(), + timeout(5000) + ); + + const reportsDeleted = await deleted$.toPromise(); + expect(reportsDeleted).to.be(true); }, expectRecentPdfAppStats(stats: UsageStats, app: string, count: number) { @@ -158,3 +183,8 @@ export function ReportingAPIProvider({ getService }: FtrProviderContext) { }, }; } + +export const services = { + ...xpackServices, + reportingAPI: ReportingAPIProvider, +}; diff --git a/x-pack/test/siem_cypress/config.ts b/x-pack/test/siem_cypress/config.ts index bd5052cf38381..b4c0eaaa77324 100644 --- a/x-pack/test/siem_cypress/config.ts +++ b/x-pack/test/siem_cypress/config.ts @@ -46,6 +46,9 @@ export default async function({ readConfigFile }: FtrConfigProviderContext) { '--csp.strict=false', // define custom kibana server args here `--elasticsearch.ssl.certificateAuthorities=${CA_CERT_PATH}`, + '--xpack.ingestManager.enabled=true', + '--xpack.ingestManager.epm.enabled=true', + '--xpack.ingestManager.fleet.enabled=true', ], }, }; diff --git a/x-pack/test/siem_cypress/es_archives/timeline/data.json.gz b/x-pack/test/siem_cypress/es_archives/timeline/data.json.gz index cde2775bddb24..bc4079ad2a90b 100644 Binary files a/x-pack/test/siem_cypress/es_archives/timeline/data.json.gz and b/x-pack/test/siem_cypress/es_archives/timeline/data.json.gz differ diff --git a/x-pack/test/siem_cypress/es_archives/timeline/mappings.json b/x-pack/test/siem_cypress/es_archives/timeline/mappings.json index ae36c130ee168..fcc16afd963d8 100644 --- a/x-pack/test/siem_cypress/es_archives/timeline/mappings.json +++ b/x-pack/test/siem_cypress/es_archives/timeline/mappings.json @@ -2416,6 +2416,9 @@ "timelineType": { "type": "keyword" }, + "status": { + "type": "keyword" + }, "columns": { "properties": { "aggregatable": { diff --git a/yarn.lock b/yarn.lock index a18f89cd480f8..a6dc525547be9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4696,16 +4696,6 @@ "@types/prop-types" "*" "@types/react" "*" -"@types/react-redux@^7.1.0": - version "7.1.5" - resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.5.tgz#c7a528d538969250347aa53c52241051cf886bd3" - integrity sha512-ZoNGQMDxh5ENY7PzU7MVonxDzS1l/EWiy8nUhDqxFqUZn4ovboCyvk4Djf68x6COb7vhGTKjyjxHxtFdAA5sUA== - dependencies: - "@types/hoist-non-react-statics" "^3.3.0" - "@types/react" "*" - hoist-non-react-statics "^3.3.0" - redux "^4.0.0" - "@types/react-redux@^7.1.7": version "7.1.7" resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.7.tgz#12a0c529aba660696947384a059c5c6e08185c7a"