From e37ddd5b640f9ac2ec8ce520922de65ca13a5de6 Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Tue, 20 Feb 2024 13:48:28 -0700 Subject: [PATCH] =?UTF-8?q?=E2=80=9C@kbn/reporting-share=E2=80=9D=20=3D>?= =?UTF-8?q?=20=E2=80=9C@kbn/reporting-public/share=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/CODEOWNERS | 1 - package.json | 1 - packages/kbn-reporting/common/types.ts | 2 +- packages/kbn-reporting/public/context.tsx | 2 +- .../public/reporting_api_client.test.ts | 2 +- packages/kbn-reporting/public/share/README.md | 3 -- .../kbn-reporting/public/share/kibana.jsonc | 5 --- .../kbn-reporting/public/share/package.json | 6 ---- .../public/share/share_context_menu/index.ts | 2 +- .../share_context_menu/panel_spinner.tsx | 2 +- .../register_csv_reporting.tsx | 2 +- .../register_pdf_png_reporting.tsx | 13 ++++---- .../reporting_panel_content.test.tsx | 10 +++--- .../reporting_panel_content.tsx | 2 +- .../screen_capture_panel_content.test.tsx | 6 ++-- .../share/shared/get_shared_components.tsx | 2 +- .../kbn-reporting/public/share/tsconfig.json | 33 ------------------- tsconfig.base.json | 2 -- .../export_types.ts => constants.ts} | 6 +++- .../reporting/common/constants/index.ts | 13 -------- x-pack/plugins/reporting/public/index.ts | 2 +- x-pack/plugins/reporting/public/mocks.ts | 2 +- x-pack/plugins/reporting/public/plugin.ts | 2 +- .../migrate_existing_indices_ilm_policy.ts | 3 +- .../routes/common/generate/request_handler.ts | 4 +-- .../internal/deprecations/deprecations.ts | 3 +- .../integration_tests/deprecations.test.ts | 2 +- .../routes/internal/diagnostic/browser.ts | 2 +- .../integration_tests/browser.test.ts | 4 +-- .../generate/csv_searchsource_immediate.ts | 2 +- .../generate/generate_from_jobparams.ts | 2 +- .../generation_from_jobparams.test.ts | 6 ++-- .../management/integration_tests/jobs.test.ts | 6 ++-- .../server/routes/internal/management/jobs.ts | 2 +- .../routes/public/generate_from_jobparams.ts | 2 +- .../generation_from_jobparams.test.ts | 6 ++-- .../public/integration_tests/jobs.test.ts | 6 ++-- .../reporting/server/routes/public/jobs.ts | 2 +- x-pack/plugins/reporting/tsconfig.json | 1 - .../reporting/download_csv_dashboard.ts | 2 +- .../common/reporting/management.ts | 2 +- .../functional/services/svl_reporting.ts | 2 +- .../shared/services/svl_reporting.ts | 2 +- yarn.lock | 4 --- 44 files changed, 60 insertions(+), 126 deletions(-) delete mode 100644 packages/kbn-reporting/public/share/README.md delete mode 100644 packages/kbn-reporting/public/share/kibana.jsonc delete mode 100644 packages/kbn-reporting/public/share/package.json delete mode 100644 packages/kbn-reporting/public/share/tsconfig.json rename x-pack/plugins/reporting/common/{constants/export_types.ts => constants.ts} (90%) delete mode 100644 x-pack/plugins/reporting/common/constants/index.ts diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e0bfac8ffebf0..fab1893db2389 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -635,7 +635,6 @@ packages/kbn-reporting/mocks_server @elastic/appex-sharedux x-pack/plugins/reporting @elastic/appex-sharedux packages/kbn-reporting/public @elastic/appex-sharedux packages/kbn-reporting/server @elastic/appex-sharedux -packages/kbn-reporting/public/share @elastic/appex-sharedux packages/kbn-resizable-layout @elastic/kibana-data-discovery examples/resizable_layout_examples @elastic/kibana-data-discovery x-pack/test/plugin_functional/plugins/resolver_test @elastic/security-solution diff --git a/package.json b/package.json index 0a3f9cf8e8314..5b974431584e4 100644 --- a/package.json +++ b/package.json @@ -639,7 +639,6 @@ "@kbn/reporting-plugin": "link:x-pack/plugins/reporting", "@kbn/reporting-public": "link:packages/kbn-reporting/public", "@kbn/reporting-server": "link:packages/kbn-reporting/server", - "@kbn/reporting-share": "link:packages/kbn-reporting/public/share", "@kbn/resizable-layout": "link:packages/kbn-resizable-layout", "@kbn/resizable-layout-examples-plugin": "link:examples/resizable_layout_examples", "@kbn/resolver-test-plugin": "link:x-pack/test/plugin_functional/plugins/resolver_test", diff --git a/packages/kbn-reporting/common/types.ts b/packages/kbn-reporting/common/types.ts index 08ea3238d8a64..92eb444880543 100644 --- a/packages/kbn-reporting/common/types.ts +++ b/packages/kbn-reporting/common/types.ts @@ -11,8 +11,8 @@ import type { PerformanceMetrics as ScreenshotMetrics, } from '@kbn/screenshotting-plugin/common'; import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server'; -import type { LocatorParams } from './url'; import { JOB_STATUS } from './constants'; +import type { LocatorParams } from './url'; export * from './url'; diff --git a/packages/kbn-reporting/public/context.tsx b/packages/kbn-reporting/public/context.tsx index 8e695751b7996..667607fc0396d 100644 --- a/packages/kbn-reporting/public/context.tsx +++ b/packages/kbn-reporting/public/context.tsx @@ -7,7 +7,7 @@ */ import type { HttpSetup } from '@kbn/core/public'; -import React, { createContext, useContext, FunctionComponent } from 'react'; +import React, { createContext, useContext, type FunctionComponent } from 'react'; import { ReportingAPIClient } from './reporting_api_client'; interface ContextValue { diff --git a/packages/kbn-reporting/public/reporting_api_client.test.ts b/packages/kbn-reporting/public/reporting_api_client.test.ts index 2ec9919c71e1e..c61579d9ccaa7 100644 --- a/packages/kbn-reporting/public/reporting_api_client.test.ts +++ b/packages/kbn-reporting/public/reporting_api_client.test.ts @@ -10,8 +10,8 @@ import { tz } from 'moment-timezone'; import { HttpSetup, IUiSettingsClient } from '@kbn/core/public'; import { httpServiceMock, uiSettingsServiceMock } from '@kbn/core/public/mocks'; -import { ReportingAPIClient } from './reporting_api_client'; import { Job } from './job'; +import { ReportingAPIClient } from './reporting_api_client'; describe('ReportingAPIClient', () => { let uiSettingsClient: jest.Mocked; diff --git a/packages/kbn-reporting/public/share/README.md b/packages/kbn-reporting/public/share/README.md deleted file mode 100644 index 3c2c0b121204f..0000000000000 --- a/packages/kbn-reporting/public/share/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# @kbn/reporting-share - -This package includes the share components that are responsible for reporting. \ No newline at end of file diff --git a/packages/kbn-reporting/public/share/kibana.jsonc b/packages/kbn-reporting/public/share/kibana.jsonc deleted file mode 100644 index a37ed1097996f..0000000000000 --- a/packages/kbn-reporting/public/share/kibana.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "type": "shared-browser", - "id": "@kbn/reporting-share", - "owner": "@elastic/appex-sharedux" -} diff --git a/packages/kbn-reporting/public/share/package.json b/packages/kbn-reporting/public/share/package.json deleted file mode 100644 index cd9ec6b9b009c..0000000000000 --- a/packages/kbn-reporting/public/share/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "@kbn/reporting-share", - "private": true, - "version": "1.0.0", - "license": "SSPL-1.0 OR Elastic License 2.0" -} \ No newline at end of file diff --git a/packages/kbn-reporting/public/share/share_context_menu/index.ts b/packages/kbn-reporting/public/share/share_context_menu/index.ts index 075d6b663e022..22503eae119cb 100644 --- a/packages/kbn-reporting/public/share/share_context_menu/index.ts +++ b/packages/kbn-reporting/public/share/share_context_menu/index.ts @@ -14,7 +14,7 @@ import type { } from '@kbn/core/public'; import { ILicense } from '@kbn/licensing-plugin/public'; import type { LayoutParams } from '@kbn/screenshotting-plugin/common'; -import type { ReportingAPIClient } from '@kbn/reporting-public/reporting_api_client'; +import type { ReportingAPIClient } from '../../reporting_api_client'; export interface ExportPanelShareOpts { apiClient: ReportingAPIClient; diff --git a/packages/kbn-reporting/public/share/share_context_menu/panel_spinner.tsx b/packages/kbn-reporting/public/share/share_context_menu/panel_spinner.tsx index 8b57ccc2e0c0d..3e78a1d1bd487 100644 --- a/packages/kbn-reporting/public/share/share_context_menu/panel_spinner.tsx +++ b/packages/kbn-reporting/public/share/share_context_menu/panel_spinner.tsx @@ -9,7 +9,7 @@ import * as React from 'react'; import { EuiSpacer, EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; -export const PanelSpinner: React.FC = (props) => { +export const PanelSpinner: React.FC = () => { return ( <> diff --git a/packages/kbn-reporting/public/share/share_context_menu/register_csv_reporting.tsx b/packages/kbn-reporting/public/share/share_context_menu/register_csv_reporting.tsx index d1161199e3351..2de8abe723a86 100644 --- a/packages/kbn-reporting/public/share/share_context_menu/register_csv_reporting.tsx +++ b/packages/kbn-reporting/public/share/share_context_menu/register_csv_reporting.tsx @@ -13,8 +13,8 @@ import { CSV_JOB_TYPE, CSV_JOB_TYPE_V2 } from '@kbn/reporting-export-types-csv-c import type { SearchSourceFields } from '@kbn/data-plugin/common'; import { ShareContext, ShareMenuProvider } from '@kbn/share-plugin/public'; -import { checkLicense } from '@kbn/reporting-public'; import type { ExportPanelShareOpts } from '.'; +import { checkLicense } from '../..'; import { ReportingPanelContent } from './reporting_panel_content_lazy'; export const reportingCsvShareProvider = ({ diff --git a/packages/kbn-reporting/public/share/share_context_menu/register_pdf_png_reporting.tsx b/packages/kbn-reporting/public/share/share_context_menu/register_pdf_png_reporting.tsx index 6d46a3b8f5808..cd75ab11e764c 100644 --- a/packages/kbn-reporting/public/share/share_context_menu/register_pdf_png_reporting.tsx +++ b/packages/kbn-reporting/public/share/share_context_menu/register_pdf_png_reporting.tsx @@ -7,11 +7,10 @@ */ import { i18n } from '@kbn/i18n'; -import React from 'react'; import { ShareContext, ShareMenuProvider } from '@kbn/share-plugin/public'; -import { checkLicense } from '@kbn/reporting-public'; -import { ReportingAPIClient } from '@kbn/reporting-public'; +import React from 'react'; import { ExportPanelShareOpts, JobParamsProviderOptions, ReportingSharingData } from '.'; +import { ReportingAPIClient, checkLicense } from '../..'; import { ScreenCapturePanelContent } from './screen_capture_panel_content_lazy'; const getJobParams = @@ -125,9 +124,11 @@ export const reportingScreenshotShareProvider = ({ objectType, sharingData, }; - // eslint-disable-next-line @typescript-eslint/no-shadow - const isJobV2Params = ({ sharingData }: { sharingData: Record }): boolean => - sharingData.locatorParams != null; + const isJobV2Params = ({ + sharingData: _sharingData, + }: { + sharingData: Record; + }) => _sharingData.locatorParams != null; const isV2Job = isJobV2Params(jobProviderOptions); const requiresSavedState = !isV2Job; diff --git a/packages/kbn-reporting/public/share/share_context_menu/reporting_panel_content/reporting_panel_content.test.tsx b/packages/kbn-reporting/public/share/share_context_menu/reporting_panel_content/reporting_panel_content.test.tsx index 7c0f8a8398477..67a7433fe0878 100644 --- a/packages/kbn-reporting/public/share/share_context_menu/reporting_panel_content/reporting_panel_content.test.tsx +++ b/packages/kbn-reporting/public/share/share_context_menu/reporting_panel_content/reporting_panel_content.test.tsx @@ -6,22 +6,22 @@ * Side Public License, v 1. */ -import React from 'react'; -import { mountWithIntl } from '@kbn/test-jest-helpers'; import { httpServiceMock, notificationServiceMock, themeServiceMock, uiSettingsServiceMock, } from '@kbn/core/public/mocks'; -import { ReportingAPIClient } from '@kbn/reporting-public'; -import { ReportingPanelContent, ReportingPanelProps as Props } from '.'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; +import React from 'react'; +import { ReportingPanelProps as Props, ReportingPanelContent } from '.'; +import { ReportingAPIClient } from '../../..'; import { ErrorUnsavedWorkPanel } from './components'; +import * as constants from './constants'; jest.mock('./constants', () => ({ getMaxUrlLength: jest.fn(() => 9999999), })); -import * as constants from './constants'; const theme = themeServiceMock.createSetupContract(); diff --git a/packages/kbn-reporting/public/share/share_context_menu/reporting_panel_content/reporting_panel_content.tsx b/packages/kbn-reporting/public/share/share_context_menu/reporting_panel_content/reporting_panel_content.tsx index 08ff8fcd52b38..f464f7217860b 100644 --- a/packages/kbn-reporting/public/share/share_context_menu/reporting_panel_content/reporting_panel_content.tsx +++ b/packages/kbn-reporting/public/share/share_context_menu/reporting_panel_content/reporting_panel_content.tsx @@ -29,7 +29,7 @@ import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n-react'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; import type { BaseParams } from '@kbn/reporting-common/types'; -import { ReportingAPIClient } from '@kbn/reporting-public/reporting_api_client'; +import { ReportingAPIClient } from '../../../reporting_api_client'; import { ErrorUnsavedWorkPanel, ErrorUrlTooLongPanel } from './components'; import { getMaxUrlLength } from './constants'; diff --git a/packages/kbn-reporting/public/share/share_context_menu/screen_capture_panel_content.test.tsx b/packages/kbn-reporting/public/share/share_context_menu/screen_capture_panel_content.test.tsx index 407d0679a4c0a..42d599da19622 100644 --- a/packages/kbn-reporting/public/share/share_context_menu/screen_capture_panel_content.test.tsx +++ b/packages/kbn-reporting/public/share/share_context_menu/screen_capture_panel_content.test.tsx @@ -6,11 +6,11 @@ * Side Public License, v 1. */ +import { coreMock, themeServiceMock } from '@kbn/core/public/mocks'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { mount } from 'enzyme'; import React from 'react'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; -import { coreMock, themeServiceMock } from '@kbn/core/public/mocks'; -import { ReportingAPIClient } from '@kbn/reporting-public'; +import { ReportingAPIClient } from '../..'; import { ScreenCapturePanelContent } from './screen_capture_panel_content'; const { http, uiSettings, ...coreSetup } = coreMock.createSetup(); diff --git a/packages/kbn-reporting/public/share/shared/get_shared_components.tsx b/packages/kbn-reporting/public/share/shared/get_shared_components.tsx index 9744443849c3f..0fc0f2ad10ab3 100644 --- a/packages/kbn-reporting/public/share/shared/get_shared_components.tsx +++ b/packages/kbn-reporting/public/share/shared/get_shared_components.tsx @@ -12,7 +12,7 @@ import React from 'react'; import { PDF_REPORT_TYPE, PDF_REPORT_TYPE_V2 } from '@kbn/reporting-export-types-pdf-common'; import { PNG_REPORT_TYPE_V2 } from '@kbn/reporting-export-types-png-common'; -import { ReportingAPIClient } from '@kbn/reporting-public/reporting_api_client'; +import { ReportingAPIClient } from '../../reporting_api_client'; import { ReportingPanelProps } from '../share_context_menu/reporting_panel_content'; import { ScreenCapturePanelContent } from '../share_context_menu/screen_capture_panel_content_lazy'; diff --git a/packages/kbn-reporting/public/share/tsconfig.json b/packages/kbn-reporting/public/share/tsconfig.json deleted file mode 100644 index 67b88e58e2b86..0000000000000 --- a/packages/kbn-reporting/public/share/tsconfig.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": ["jest", "node"] - }, - "include": [ - "**/*.ts", - "**/share_context_menu/*.ts*", - "**/shared/*.ts*", - "**/share_context_menu/reporting_panel_content/commponents/*.ts*", - "**/share_context_menu/reporting_panel_content/components/error_unsaved_work_panel.tsx", - "**/share_context_menu/reporting_panel_content/components/error_url_too_long_panel.tsx", - "**/share_context_menu/reporting_panel_content/*.ts*" - ], - "exclude": ["target/**/*"], - "kbn_references": [ - "@kbn/core", - "@kbn/licensing-plugin", - "@kbn/screenshotting-plugin", - "@kbn/reporting-public", - "@kbn/i18n", - "@kbn/reporting-export-types-csv-common", - "@kbn/data-plugin", - "@kbn/share-plugin", - "@kbn/reporting-common", - "@kbn/i18n-react", - "@kbn/test-jest-helpers", - "@kbn/reporting-export-types-pdf-common", - "@kbn/reporting-export-types-png-common", - "@kbn/kibana-react-plugin" - ] -} diff --git a/tsconfig.base.json b/tsconfig.base.json index c4af53fc447a0..1a54c368d5344 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1264,8 +1264,6 @@ "@kbn/reporting-public/*": ["packages/kbn-reporting/public/*"], "@kbn/reporting-server": ["packages/kbn-reporting/server"], "@kbn/reporting-server/*": ["packages/kbn-reporting/server/*"], - "@kbn/reporting-share": ["packages/kbn-reporting/public/share"], - "@kbn/reporting-share/*": ["packages/kbn-reporting/public/share/*"], "@kbn/resizable-layout": ["packages/kbn-resizable-layout"], "@kbn/resizable-layout/*": ["packages/kbn-resizable-layout/*"], "@kbn/resizable-layout-examples-plugin": ["examples/resizable_layout_examples"], diff --git a/x-pack/plugins/reporting/common/constants/export_types.ts b/x-pack/plugins/reporting/common/constants.ts similarity index 90% rename from x-pack/plugins/reporting/common/constants/export_types.ts rename to x-pack/plugins/reporting/common/constants.ts index 20f8a63204e75..19d4ac4578aeb 100644 --- a/x-pack/plugins/reporting/common/constants/export_types.ts +++ b/x-pack/plugins/reporting/common/constants.ts @@ -5,7 +5,6 @@ * 2.0. */ -// Export Type Sets import { CSV_JOB_TYPE, CSV_JOB_TYPE_DEPRECATED, @@ -26,6 +25,7 @@ import { PNG_REPORT_TYPE_V2, } from '@kbn/reporting-export-types-png-common'; +// Export Type Sets export const reportTypes = [ CSV_REPORT_TYPE, CSV_REPORT_TYPE_V2, @@ -52,3 +52,7 @@ export const USES_HEADLESS_JOB_TYPES = [ ]; export const DEPRECATED_JOB_TYPES = [CSV_JOB_TYPE_DEPRECATED]; + +// Test Subjects +export const REPORT_TABLE_ID = 'reportJobListing'; +export const REPORT_TABLE_ROW_ID = 'reportJobRow'; diff --git a/x-pack/plugins/reporting/common/constants/index.ts b/x-pack/plugins/reporting/common/constants/index.ts deleted file mode 100644 index 7e390763773c6..0000000000000 --- a/x-pack/plugins/reporting/common/constants/index.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 - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export * from '@kbn/reporting-common/routes'; -export * from './export_types'; - -// Test Subjects -export const REPORT_TABLE_ID = 'reportJobListing'; -export const REPORT_TABLE_ROW_ID = 'reportJobRow'; diff --git a/x-pack/plugins/reporting/public/index.ts b/x-pack/plugins/reporting/public/index.ts index 0ccbb827f3fdf..59f1f4e359851 100644 --- a/x-pack/plugins/reporting/public/index.ts +++ b/x-pack/plugins/reporting/public/index.ts @@ -6,7 +6,7 @@ */ import type { PluginInitializerContext } from '@kbn/core/public'; -import type { ReportingPublicComponents } from '@kbn/reporting-share'; +import type { ReportingPublicComponents } from '@kbn/reporting-public/share'; import { ReportingPublicPlugin } from './plugin'; /** diff --git a/x-pack/plugins/reporting/public/mocks.ts b/x-pack/plugins/reporting/public/mocks.ts index 6295f88fc93f7..34aa311e54822 100644 --- a/x-pack/plugins/reporting/public/mocks.ts +++ b/x-pack/plugins/reporting/public/mocks.ts @@ -6,7 +6,7 @@ */ import { coreMock } from '@kbn/core/public/mocks'; -import { getSharedComponents } from '@kbn/reporting-share'; +import { getSharedComponents } from '@kbn/reporting-public/share'; import { ReportingAPIClient } from '@kbn/reporting-public/reporting_api_client'; import { ReportingSetup } from '.'; diff --git a/x-pack/plugins/reporting/public/plugin.ts b/x-pack/plugins/reporting/public/plugin.ts index 2ac27766076f5..edcc2affaa3dd 100644 --- a/x-pack/plugins/reporting/public/plugin.ts +++ b/x-pack/plugins/reporting/public/plugin.ts @@ -36,7 +36,7 @@ import { getSharedComponents, reportingScreenshotShareProvider, reportingCsvShareProvider, -} from '@kbn/reporting-share'; +} from '@kbn/reporting-public/share'; import type { ReportingSetup, ReportingStart } from '.'; import { ReportingNotifierStreamHandler as StreamHandler } from './lib/stream_handler'; import { getGeneralErrorToast } from './notifier'; diff --git a/x-pack/plugins/reporting/server/deprecations/migrate_existing_indices_ilm_policy.ts b/x-pack/plugins/reporting/server/deprecations/migrate_existing_indices_ilm_policy.ts index d7c6e1fd9fc2a..2fcba6c0ccf53 100644 --- a/x-pack/plugins/reporting/server/deprecations/migrate_existing_indices_ilm_policy.ts +++ b/x-pack/plugins/reporting/server/deprecations/migrate_existing_indices_ilm_policy.ts @@ -7,8 +7,7 @@ import { DeprecationsDetails, GetDeprecationsContext } from '@kbn/core/server'; import { i18n } from '@kbn/i18n'; -import { ILM_POLICY_NAME } from '@kbn/reporting-common'; -import { INTERNAL_ROUTES } from '../../common/constants'; +import { ILM_POLICY_NAME, INTERNAL_ROUTES } from '@kbn/reporting-common'; import { ReportingCore } from '../core'; import { deprecations } from '../lib/deprecations'; diff --git a/x-pack/plugins/reporting/server/routes/common/generate/request_handler.ts b/x-pack/plugins/reporting/server/routes/common/generate/request_handler.ts index 10f368097c686..b2882d1d5ef6f 100644 --- a/x-pack/plugins/reporting/server/routes/common/generate/request_handler.ts +++ b/x-pack/plugins/reporting/server/routes/common/generate/request_handler.ts @@ -11,13 +11,13 @@ import moment from 'moment'; import { schema, TypeOf } from '@kbn/config-schema'; import type { KibanaRequest, KibanaResponseFactory, Logger } from '@kbn/core/server'; import { i18n } from '@kbn/i18n'; +import { PUBLIC_ROUTES } from '@kbn/reporting-common'; import type { BaseParams } from '@kbn/reporting-common/types'; import { cryptoFactory } from '@kbn/reporting-server'; import rison from '@kbn/rison'; -import { Counters, getCounters } from '..'; +import { type Counters, getCounters } from '..'; import type { ReportingCore } from '../../..'; -import { PUBLIC_ROUTES } from '../../../../common/constants'; import { checkParamsVersion } from '../../../lib'; import { Report } from '../../../lib/store'; import type { diff --git a/x-pack/plugins/reporting/server/routes/internal/deprecations/deprecations.ts b/x-pack/plugins/reporting/server/routes/internal/deprecations/deprecations.ts index d6322f2d60346..d35adf717cbb9 100644 --- a/x-pack/plugins/reporting/server/routes/internal/deprecations/deprecations.ts +++ b/x-pack/plugins/reporting/server/routes/internal/deprecations/deprecations.ts @@ -6,9 +6,8 @@ */ import { errors } from '@elastic/elasticsearch'; import type { Logger, RequestHandler } from '@kbn/core/server'; -import { ILM_POLICY_NAME } from '@kbn/reporting-common'; +import { ILM_POLICY_NAME, INTERNAL_ROUTES } from '@kbn/reporting-common'; import type { IlmPolicyStatusResponse } from '@kbn/reporting-common/url'; -import { INTERNAL_ROUTES } from '../../../../common/constants'; import type { ReportingCore } from '../../../core'; import { IlmPolicyManager } from '../../../lib'; import { deprecations } from '../../../lib/deprecations'; diff --git a/x-pack/plugins/reporting/server/routes/internal/deprecations/integration_tests/deprecations.test.ts b/x-pack/plugins/reporting/server/routes/internal/deprecations/integration_tests/deprecations.test.ts index e143216447af0..ef3fcb8605eba 100644 --- a/x-pack/plugins/reporting/server/routes/internal/deprecations/integration_tests/deprecations.test.ts +++ b/x-pack/plugins/reporting/server/routes/internal/deprecations/integration_tests/deprecations.test.ts @@ -8,10 +8,10 @@ import { setupServer } from '@kbn/core-test-helpers-test-utils'; import { loggingSystemMock } from '@kbn/core/server/mocks'; import { licensingMock } from '@kbn/licensing-plugin/server/mocks'; +import { INTERNAL_ROUTES } from '@kbn/reporting-common'; import { createMockConfigSchema } from '@kbn/reporting-mocks-server'; import { securityMock } from '@kbn/security-plugin/server/mocks'; import supertest from 'supertest'; -import { INTERNAL_ROUTES } from '../../../../../common/constants'; import { createMockPluginSetup, createMockPluginStart, diff --git a/x-pack/plugins/reporting/server/routes/internal/diagnostic/browser.ts b/x-pack/plugins/reporting/server/routes/internal/diagnostic/browser.ts index 703dd5b24a97b..a4ca554b1e7db 100644 --- a/x-pack/plugins/reporting/server/routes/internal/diagnostic/browser.ts +++ b/x-pack/plugins/reporting/server/routes/internal/diagnostic/browser.ts @@ -7,10 +7,10 @@ import type { DocLinksServiceSetup, Logger } from '@kbn/core/server'; import { i18n } from '@kbn/i18n'; +import { INTERNAL_ROUTES } from '@kbn/reporting-common'; import { lastValueFrom } from 'rxjs'; import type { DiagnosticResponse } from '.'; import type { ReportingCore } from '../../..'; -import { INTERNAL_ROUTES } from '../../../../common/constants'; import { authorizedUserPreRouting, getCounters } from '../../common'; const logsToHelpMapFactory = (docLinks: DocLinksServiceSetup) => ({ diff --git a/x-pack/plugins/reporting/server/routes/internal/diagnostic/integration_tests/browser.test.ts b/x-pack/plugins/reporting/server/routes/internal/diagnostic/integration_tests/browser.test.ts index a395fab20e8d3..cccf6eaacafdc 100644 --- a/x-pack/plugins/reporting/server/routes/internal/diagnostic/integration_tests/browser.test.ts +++ b/x-pack/plugins/reporting/server/routes/internal/diagnostic/integration_tests/browser.test.ts @@ -10,11 +10,11 @@ import supertest from 'supertest'; import { setupServer } from '@kbn/core-test-helpers-test-utils'; import { docLinksServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; -import { ScreenshottingStart } from '@kbn/screenshotting-plugin/server'; +import { INTERNAL_ROUTES } from '@kbn/reporting-common'; import { createMockConfigSchema } from '@kbn/reporting-mocks-server'; +import { ScreenshottingStart } from '@kbn/screenshotting-plugin/server'; import { IUsageCounter } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counter'; import { ReportingCore } from '../../../..'; -import { INTERNAL_ROUTES } from '../../../../../common/constants'; import { reportingMock } from '../../../../mocks'; import { createMockPluginSetup, createMockReportingCore } from '../../../../test_helpers'; import { ReportingRequestHandlerContext } from '../../../../types'; diff --git a/x-pack/plugins/reporting/server/routes/internal/generate/csv_searchsource_immediate.ts b/x-pack/plugins/reporting/server/routes/internal/generate/csv_searchsource_immediate.ts index 60e8da242ddbf..cc9ad946d84ef 100644 --- a/x-pack/plugins/reporting/server/routes/internal/generate/csv_searchsource_immediate.ts +++ b/x-pack/plugins/reporting/server/routes/internal/generate/csv_searchsource_immediate.ts @@ -10,12 +10,12 @@ import moment from 'moment'; import { schema } from '@kbn/config-schema'; import type { KibanaRequest, Logger } from '@kbn/core/server'; +import { INTERNAL_ROUTES } from '@kbn/reporting-common'; import { CSV_SEARCHSOURCE_IMMEDIATE_TYPE, JobParamsDownloadCSV, } from '@kbn/reporting-export-types-csv-common'; import type { ReportingCore } from '../../..'; -import { INTERNAL_ROUTES } from '../../../../common/constants'; import { PassThroughStream } from '../../../lib'; import { authorizedUserPreRouting, getCounters } from '../../common'; diff --git a/x-pack/plugins/reporting/server/routes/internal/generate/generate_from_jobparams.ts b/x-pack/plugins/reporting/server/routes/internal/generate/generate_from_jobparams.ts index 4dbd187069e58..7f547702475cd 100644 --- a/x-pack/plugins/reporting/server/routes/internal/generate/generate_from_jobparams.ts +++ b/x-pack/plugins/reporting/server/routes/internal/generate/generate_from_jobparams.ts @@ -7,8 +7,8 @@ import { KibanaResponse } from '@kbn/core-http-router-server-internal'; import type { Logger } from '@kbn/core/server'; +import { INTERNAL_ROUTES } from '@kbn/reporting-common'; import type { ReportingCore } from '../../..'; -import { INTERNAL_ROUTES } from '../../../../common/constants'; import { authorizedUserPreRouting } from '../../common'; import { RequestHandler } from '../../common/generate'; diff --git a/x-pack/plugins/reporting/server/routes/internal/generate/integration_tests/generation_from_jobparams.test.ts b/x-pack/plugins/reporting/server/routes/internal/generate/integration_tests/generation_from_jobparams.test.ts index fce4bb86582ec..ebfff13de69a9 100644 --- a/x-pack/plugins/reporting/server/routes/internal/generate/integration_tests/generation_from_jobparams.test.ts +++ b/x-pack/plugins/reporting/server/routes/internal/generate/integration_tests/generation_from_jobparams.test.ts @@ -5,21 +5,21 @@ * 2.0. */ +import rison from '@kbn/rison'; import { BehaviorSubject } from 'rxjs'; import supertest from 'supertest'; -import rison from '@kbn/rison'; import { setupServer } from '@kbn/core-test-helpers-test-utils'; import { coreMock, loggingSystemMock } from '@kbn/core/server/mocks'; import { licensingMock } from '@kbn/licensing-plugin/server/mocks'; +import { INTERNAL_ROUTES } from '@kbn/reporting-common'; import { PdfExportType } from '@kbn/reporting-export-types-pdf'; import { createMockConfigSchema } from '@kbn/reporting-mocks-server'; +import { ExportTypesRegistry } from '@kbn/reporting-server/export_types_registry'; import { IUsageCounter } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counter'; import { ReportingCore } from '../../../..'; -import { INTERNAL_ROUTES } from '../../../../../common/constants'; import { ReportingStore } from '../../../../lib'; -import { ExportTypesRegistry } from '@kbn/reporting-server/export_types_registry'; import { Report } from '../../../../lib/store'; import { reportingMock } from '../../../../mocks'; import { diff --git a/x-pack/plugins/reporting/server/routes/internal/management/integration_tests/jobs.test.ts b/x-pack/plugins/reporting/server/routes/internal/management/integration_tests/jobs.test.ts index a42d531fd9ef6..559bb510da8db 100644 --- a/x-pack/plugins/reporting/server/routes/internal/management/integration_tests/jobs.test.ts +++ b/x-pack/plugins/reporting/server/routes/internal/management/integration_tests/jobs.test.ts @@ -17,12 +17,13 @@ import { estypes } from '@elastic/elasticsearch'; import { setupServer } from '@kbn/core-test-helpers-test-utils'; import { ElasticsearchClientMock } from '@kbn/core/server/mocks'; import { licensingMock } from '@kbn/licensing-plugin/server/mocks'; -import { ExportType } from '@kbn/reporting-server'; +import { INTERNAL_ROUTES } from '@kbn/reporting-common'; import { createMockConfigSchema } from '@kbn/reporting-mocks-server'; +import { ExportType } from '@kbn/reporting-server'; +import { ExportTypesRegistry } from '@kbn/reporting-server/export_types_registry'; import { IUsageCounter } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counter'; import { ReportingCore } from '../../../..'; -import { INTERNAL_ROUTES } from '../../../../../common/constants'; import { ReportingInternalSetup, ReportingInternalStart } from '../../../../core'; import { ContentStream, getContentStream } from '../../../../lib'; import { reportingMock } from '../../../../mocks'; @@ -33,7 +34,6 @@ import { } from '../../../../test_helpers'; import { ReportingRequestHandlerContext } from '../../../../types'; import { registerJobInfoRoutesInternal as registerJobInfoRoutes } from '../jobs'; -import { ExportTypesRegistry } from '@kbn/reporting-server/export_types_registry'; type SetupServerReturn = Awaited>; diff --git a/x-pack/plugins/reporting/server/routes/internal/management/jobs.ts b/x-pack/plugins/reporting/server/routes/internal/management/jobs.ts index 717ac8db9b104..44a085a76dd91 100644 --- a/x-pack/plugins/reporting/server/routes/internal/management/jobs.ts +++ b/x-pack/plugins/reporting/server/routes/internal/management/jobs.ts @@ -6,9 +6,9 @@ */ import { schema } from '@kbn/config-schema'; +import { INTERNAL_ROUTES } from '@kbn/reporting-common'; import { ROUTE_TAG_CAN_REDIRECT } from '@kbn/security-plugin/server'; import { ReportingCore } from '../../..'; -import { INTERNAL_ROUTES } from '../../../../common/constants'; import { authorizedUserPreRouting, getCounters } from '../../common'; import { handleUnavailable } from '../../common/generate'; import { diff --git a/x-pack/plugins/reporting/server/routes/public/generate_from_jobparams.ts b/x-pack/plugins/reporting/server/routes/public/generate_from_jobparams.ts index 512b39935de5e..276c9da8a30b4 100644 --- a/x-pack/plugins/reporting/server/routes/public/generate_from_jobparams.ts +++ b/x-pack/plugins/reporting/server/routes/public/generate_from_jobparams.ts @@ -7,8 +7,8 @@ import { KibanaResponse } from '@kbn/core-http-router-server-internal'; import type { Logger } from '@kbn/core/server'; +import { PUBLIC_ROUTES } from '@kbn/reporting-common'; import type { ReportingCore } from '../..'; -import { PUBLIC_ROUTES } from '../../../common/constants'; import { authorizedUserPreRouting } from '../common'; import { RequestHandler } from '../common/generate'; diff --git a/x-pack/plugins/reporting/server/routes/public/integration_tests/generation_from_jobparams.test.ts b/x-pack/plugins/reporting/server/routes/public/integration_tests/generation_from_jobparams.test.ts index a875b96369baa..149932b27d08b 100644 --- a/x-pack/plugins/reporting/server/routes/public/integration_tests/generation_from_jobparams.test.ts +++ b/x-pack/plugins/reporting/server/routes/public/integration_tests/generation_from_jobparams.test.ts @@ -12,13 +12,13 @@ import supertest from 'supertest'; import { setupServer } from '@kbn/core-test-helpers-test-utils'; import { coreMock, loggingSystemMock } from '@kbn/core/server/mocks'; import { licensingMock } from '@kbn/licensing-plugin/server/mocks'; +import { PUBLIC_ROUTES } from '@kbn/reporting-common'; import { PdfExportType } from '@kbn/reporting-export-types-pdf'; -import { IUsageCounter } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counter'; import { createMockConfigSchema } from '@kbn/reporting-mocks-server'; +import { ExportTypesRegistry } from '@kbn/reporting-server/export_types_registry'; +import { IUsageCounter } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counter'; import { ReportingCore } from '../../..'; -import { PUBLIC_ROUTES } from '../../../../common/constants'; import { ReportingStore } from '../../../lib'; -import { ExportTypesRegistry } from '@kbn/reporting-server/export_types_registry'; import { Report } from '../../../lib/store'; import { reportingMock } from '../../../mocks'; import { diff --git a/x-pack/plugins/reporting/server/routes/public/integration_tests/jobs.test.ts b/x-pack/plugins/reporting/server/routes/public/integration_tests/jobs.test.ts index d7330d6b7e0fc..effd34672e947 100644 --- a/x-pack/plugins/reporting/server/routes/public/integration_tests/jobs.test.ts +++ b/x-pack/plugins/reporting/server/routes/public/integration_tests/jobs.test.ts @@ -17,12 +17,12 @@ import { estypes } from '@elastic/elasticsearch'; import { setupServer } from '@kbn/core-test-helpers-test-utils'; import type { ElasticsearchClientMock } from '@kbn/core/server/mocks'; import { licensingMock } from '@kbn/licensing-plugin/server/mocks'; -import type { ExportType } from '@kbn/reporting-server'; +import { PUBLIC_ROUTES } from '@kbn/reporting-common'; import { createMockConfigSchema } from '@kbn/reporting-mocks-server'; -import { IUsageCounter } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counter'; +import type { ExportType } from '@kbn/reporting-server'; import { ExportTypesRegistry } from '@kbn/reporting-server/export_types_registry'; +import { IUsageCounter } from '@kbn/usage-collection-plugin/server/usage_counters/usage_counter'; import { ReportingCore } from '../../..'; -import { PUBLIC_ROUTES } from '../../../../common/constants'; import { ReportingInternalSetup, ReportingInternalStart } from '../../../core'; import { ContentStream, getContentStream } from '../../../lib'; import { reportingMock } from '../../../mocks'; diff --git a/x-pack/plugins/reporting/server/routes/public/jobs.ts b/x-pack/plugins/reporting/server/routes/public/jobs.ts index 7b56e4393a31a..54ebf3d4e0c1c 100644 --- a/x-pack/plugins/reporting/server/routes/public/jobs.ts +++ b/x-pack/plugins/reporting/server/routes/public/jobs.ts @@ -5,9 +5,9 @@ * 2.0. */ +import { PUBLIC_ROUTES } from '@kbn/reporting-common'; import { ROUTE_TAG_CAN_REDIRECT } from '@kbn/security-plugin/server'; import { ReportingCore } from '../..'; -import { PUBLIC_ROUTES } from '../../../common/constants'; import { authorizedUserPreRouting } from '../common'; import { commonJobsRouteHandlerFactory } from '../common/jobs'; diff --git a/x-pack/plugins/reporting/tsconfig.json b/x-pack/plugins/reporting/tsconfig.json index 0508977d1d381..f104e29637581 100644 --- a/x-pack/plugins/reporting/tsconfig.json +++ b/x-pack/plugins/reporting/tsconfig.json @@ -51,7 +51,6 @@ "@kbn/core-http-request-handler-context-server", "@kbn/reporting-public", "@kbn/discover-utils", - "@kbn/reporting-share", ], "exclude": [ "target/**/*", diff --git a/x-pack/test_serverless/api_integration/test_suites/common/reporting/download_csv_dashboard.ts b/x-pack/test_serverless/api_integration/test_suites/common/reporting/download_csv_dashboard.ts index d28186248f1cd..652e76ad9ce45 100644 --- a/x-pack/test_serverless/api_integration/test_suites/common/reporting/download_csv_dashboard.ts +++ b/x-pack/test_serverless/api_integration/test_suites/common/reporting/download_csv_dashboard.ts @@ -7,7 +7,7 @@ import { X_ELASTIC_INTERNAL_ORIGIN_REQUEST } from '@kbn/core-http-common'; import expect from '@kbn/expect'; -import { INTERNAL_ROUTES } from '@kbn/reporting-plugin/common/constants'; +import { INTERNAL_ROUTES } from '@kbn/reporting-common'; import type { JobParamsDownloadCSV } from '@kbn/reporting-export-types-csv-common'; import { FtrProviderContext } from '../../../ftr_provider_context'; diff --git a/x-pack/test_serverless/api_integration/test_suites/common/reporting/management.ts b/x-pack/test_serverless/api_integration/test_suites/common/reporting/management.ts index 309a56b2296e7..3d4c0a31cf126 100644 --- a/x-pack/test_serverless/api_integration/test_suites/common/reporting/management.ts +++ b/x-pack/test_serverless/api_integration/test_suites/common/reporting/management.ts @@ -7,7 +7,7 @@ import { X_ELASTIC_INTERNAL_ORIGIN_REQUEST } from '@kbn/core-http-common/src/constants'; import expect from '@kbn/expect'; -import { INTERNAL_ROUTES } from '@kbn/reporting-plugin/common/constants'; +import { INTERNAL_ROUTES } from '@kbn/reporting-common'; import { FtrProviderContext } from '../../../ftr_provider_context'; // the archived data holds a report created by test_user diff --git a/x-pack/test_serverless/functional/services/svl_reporting.ts b/x-pack/test_serverless/functional/services/svl_reporting.ts index c9709b3a7dc30..70c7b9c04827e 100644 --- a/x-pack/test_serverless/functional/services/svl_reporting.ts +++ b/x-pack/test_serverless/functional/services/svl_reporting.ts @@ -6,8 +6,8 @@ */ import { X_ELASTIC_INTERNAL_ORIGIN_REQUEST } from '@kbn/core-http-common'; -import { INTERNAL_ROUTES } from '@kbn/reporting-plugin/common/constants'; import expect from '@kbn/expect'; +import { INTERNAL_ROUTES } from '@kbn/reporting-common'; import type { ReportingJobResponse } from '@kbn/reporting-plugin/server/types'; import rison from '@kbn/rison'; import { FtrProviderContext } from '../ftr_provider_context'; diff --git a/x-pack/test_serverless/shared/services/svl_reporting.ts b/x-pack/test_serverless/shared/services/svl_reporting.ts index 7cfaf40452e41..fafc81d807352 100644 --- a/x-pack/test_serverless/shared/services/svl_reporting.ts +++ b/x-pack/test_serverless/shared/services/svl_reporting.ts @@ -6,8 +6,8 @@ */ import { X_ELASTIC_INTERNAL_ORIGIN_REQUEST } from '@kbn/core-http-common'; -import { INTERNAL_ROUTES } from '@kbn/reporting-plugin/common/constants'; import expect from '@kbn/expect'; +import { INTERNAL_ROUTES } from '@kbn/reporting-common'; import type { ReportingJobResponse } from '@kbn/reporting-plugin/server/types'; import rison from '@kbn/rison'; import { FtrProviderContext } from '../../functional/ftr_provider_context'; diff --git a/yarn.lock b/yarn.lock index bcaa61c41e7ad..23b654ef1d7bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5597,10 +5597,6 @@ version "0.0.0" uid "" -"@kbn/reporting-share@link:packages/kbn-reporting/public/share": - version "0.0.0" - uid "" - "@kbn/resizable-layout-examples-plugin@link:examples/resizable_layout_examples": version "0.0.0" uid ""