From 1680999ec4fb3e7c2eccd7e23acf91afef29e0b4 Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Wed, 14 Apr 2021 13:22:24 -0700 Subject: [PATCH] move APP_WRAPPER_CLASS definition to src/core/common --- src/core/common/index.ts | 13 +++++++++++++ src/core/public/index.ts | 1 - src/core/public/rendering/app_containers.tsx | 7 +------ src/core/public/rendering/index.ts | 1 - src/core/server/index.ts | 2 -- src/core/tsconfig.json | 1 + src/plugins/dashboard/public/plugin.tsx | 2 +- .../reporting/server/lib/screenshots/constants.ts | 2 +- .../server/routes/diagnostic/screenshot.ts | 2 +- 9 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 src/core/common/index.ts diff --git a/src/core/common/index.ts b/src/core/common/index.ts new file mode 100644 index 00000000000000..51230cbbb6f784 --- /dev/null +++ b/src/core/common/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +/** + * The class name for top level *and* nested application wrappers to ensure proper layout + * @public + */ +export const APP_WRAPPER_CLASS = 'kbnAppWrapper'; diff --git a/src/core/public/index.ts b/src/core/public/index.ts index 9feb518bd88447..ca432d6b8269fa 100644 --- a/src/core/public/index.ts +++ b/src/core/public/index.ts @@ -195,7 +195,6 @@ export type { DeprecationsServiceStart, ResolveDeprecationResponse } from './dep export type { MountPoint, UnmountCallback, PublicUiSettingsParams } from './types'; export { URL_MAX_LENGTH } from './core_app'; -export { APP_WRAPPER_CLASS } from './rendering'; /** * Core services exposed to the `Plugin` setup lifecycle diff --git a/src/core/public/rendering/app_containers.tsx b/src/core/public/rendering/app_containers.tsx index db97c69f1b02f2..dfd5180d370ada 100644 --- a/src/core/public/rendering/app_containers.tsx +++ b/src/core/public/rendering/app_containers.tsx @@ -10,12 +10,7 @@ import React from 'react'; import { Observable } from 'rxjs'; import useObservable from 'react-use/lib/useObservable'; import classNames from 'classnames'; - -/** - * The class name for top level *and* nested application wrappers to ensure proper layout - * @public - */ -export const APP_WRAPPER_CLASS = 'kbnAppWrapper'; +import { APP_WRAPPER_CLASS } from '../../common'; export const AppWrapper: React.FunctionComponent<{ chromeVisible$: Observable; diff --git a/src/core/public/rendering/index.ts b/src/core/public/rendering/index.ts index 0944de5f6022c3..37315635220ee2 100644 --- a/src/core/public/rendering/index.ts +++ b/src/core/public/rendering/index.ts @@ -7,4 +7,3 @@ */ export { RenderingService } from './rendering_service'; -export { APP_WRAPPER_CLASS } from './app_containers'; diff --git a/src/core/server/index.ts b/src/core/server/index.ts index 87d02e1e496698..2c6fa74cb54a0c 100644 --- a/src/core/server/index.ts +++ b/src/core/server/index.ts @@ -536,8 +536,6 @@ export type { PluginOpaqueId, }; -export { APP_WRAPPER_CLASS } from '../public/rendering'; - /** * Config schemas for the platform services. * diff --git a/src/core/tsconfig.json b/src/core/tsconfig.json index 855962070457e7..1b9d786beaf559 100644 --- a/src/core/tsconfig.json +++ b/src/core/tsconfig.json @@ -9,6 +9,7 @@ "isolatedModules": true, }, "include": [ + "common/**/*", "public/**/*", "server/**/*", "types/**/*", diff --git a/src/plugins/dashboard/public/plugin.tsx b/src/plugins/dashboard/public/plugin.tsx index d97d873fdadd3f..9be6f7668240ae 100644 --- a/src/plugins/dashboard/public/plugin.tsx +++ b/src/plugins/dashboard/public/plugin.tsx @@ -12,6 +12,7 @@ import { filter, map } from 'rxjs/operators'; import { Start as InspectorStartContract } from 'src/plugins/inspector/public'; import { UrlForwardingSetup, UrlForwardingStart } from 'src/plugins/url_forwarding/public'; +import { APP_WRAPPER_CLASS } from '../../../core/common'; import { App, Plugin, @@ -23,7 +24,6 @@ import { DEFAULT_APP_CATEGORIES, PluginInitializerContext, SavedObjectsClientContract, - APP_WRAPPER_CLASS, } from '../../../core/public'; import { createKbnUrlTracker } from './services/kibana_utils'; diff --git a/x-pack/plugins/reporting/server/lib/screenshots/constants.ts b/x-pack/plugins/reporting/server/lib/screenshots/constants.ts index 8d3a415e517e04..06f2cc5dffdfa1 100644 --- a/x-pack/plugins/reporting/server/lib/screenshots/constants.ts +++ b/x-pack/plugins/reporting/server/lib/screenshots/constants.ts @@ -4,8 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { APP_WRAPPER_CLASS } from '../../../../../../src/core/server'; +import { APP_WRAPPER_CLASS } from '../../../../../../src/core/common'; export const DEFAULT_PAGELOAD_SELECTOR = `.${APP_WRAPPER_CLASS}`; export const CONTEXT_GETNUMBEROFITEMS = 'GetNumberOfItems'; diff --git a/x-pack/plugins/reporting/server/routes/diagnostic/screenshot.ts b/x-pack/plugins/reporting/server/routes/diagnostic/screenshot.ts index 86f79823dba21e..3365510d878911 100644 --- a/x-pack/plugins/reporting/server/routes/diagnostic/screenshot.ts +++ b/x-pack/plugins/reporting/server/routes/diagnostic/screenshot.ts @@ -7,6 +7,7 @@ import { i18n } from '@kbn/i18n'; import { ReportingCore } from '../..'; +import { APP_WRAPPER_CLASS } from '../../../../../../src/core/common'; import { API_DIAGNOSE_URL } from '../../../common/constants'; import { omitBlockedHeaders } from '../../export_types/common'; import { getAbsoluteUrlFactory } from '../../export_types/common/get_absolute_url'; @@ -14,7 +15,6 @@ import { generatePngObservableFactory } from '../../export_types/png/lib/generat import { LevelLogger as Logger } from '../../lib'; import { authorizedUserPreRoutingFactory } from '../lib/authorized_user_pre_routing'; import { DiagnosticResponse } from './'; -import { APP_WRAPPER_CLASS } from '../../../../../../src/core/server'; export const registerDiagnoseScreenshot = (reporting: ReportingCore, logger: Logger) => { const setupDeps = reporting.getPluginSetupDeps();