diff --git a/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/__snapshots__/screen_capture_panel_content.test.tsx.snap b/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/__snapshots__/screen_capture_panel_content.test.tsx.snap index 5fbc5bf09c016..539e48fb04ceb 100644 --- a/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/__snapshots__/screen_capture_panel_content.test.tsx.snap +++ b/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/__snapshots__/screen_capture_panel_content.test.tsx.snap @@ -2,7 +2,7 @@ exports[`ScreenCapturePanelContent properly renders a view with "canvas" layout option 1`] = `
void; startServices$: Rx.Observable; + theme: WithEuiThemeProps['theme']; } export type Props = ReportingPanelProps & { intl: InjectedIntl }; @@ -66,7 +70,7 @@ interface State { isCreatingReportJob: boolean; } -class ReportingPanelContentUi extends Component { +class ReportingPanelContentUi extends Component { private mounted?: boolean; constructor(props: Props) { @@ -157,10 +161,14 @@ class ReportingPanelContentUi extends Component { public render() { const isUnsaved: boolean = this.isNotSaved() || this.props.isDirty || this.state.isStale; + const { theme } = this.props; + const basePadding = css({ + padding: theme.euiTheme.size.base, + }); if (this.props.requiresSavedState && isUnsaved) { return ( - + { const exceedsMaxLength = this.state.absoluteUrl.length >= getMaxUrlLength(); return ( - +

{ }; } -export const ReportingPanelContent = injectI18n(ReportingPanelContentUi); +export const ReportingPanelContent = injectI18n(withEuiTheme(ReportingPanelContentUi)); diff --git a/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/screen_capture_panel_content.tsx b/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/screen_capture_panel_content.tsx index 08ac218a396f3..150619d8c80de 100644 --- a/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/screen_capture_panel_content.tsx +++ b/src/platform/packages/private/kbn-reporting/public/share/share_context_menu/screen_capture_panel_content.tsx @@ -13,7 +13,7 @@ import React, { Component } from 'react'; import type { LayoutParams } from '@kbn/screenshotting-plugin/common'; import { ReportingPanelContent, ReportingPanelProps } from './reporting_panel_content'; -export interface Props extends ReportingPanelProps { +export interface Props extends Omit { layoutOption?: 'canvas' | 'print'; } diff --git a/src/platform/plugins/shared/share/public/components/_index.scss b/src/platform/plugins/shared/share/public/components/_index.scss deleted file mode 100644 index 85168c9ea80f7..0000000000000 --- a/src/platform/plugins/shared/share/public/components/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './share_context_menu'; diff --git a/src/platform/plugins/shared/share/public/components/_share_context_menu.scss b/src/platform/plugins/shared/share/public/components/_share_context_menu.scss deleted file mode 100644 index a05164a6bb0d1..0000000000000 --- a/src/platform/plugins/shared/share/public/components/_share_context_menu.scss +++ /dev/null @@ -1,3 +0,0 @@ -.kbnShareContextMenu__finalPanel { - padding: $euiSize; -} diff --git a/src/platform/plugins/shared/share/public/components/url_panel_content.tsx b/src/platform/plugins/shared/share/public/components/url_panel_content.tsx index 0d789e5339588..345231bbac49c 100644 --- a/src/platform/plugins/shared/share/public/components/url_panel_content.tsx +++ b/src/platform/plugins/shared/share/public/components/url_panel_content.tsx @@ -21,7 +21,10 @@ import { EuiRadioGroup, EuiSwitch, EuiSwitchEvent, + withEuiTheme, + WithEuiThemeProps, } from '@elastic/eui'; +import { css } from '@emotion/react'; import { format as formatUrl, parse as parseUrl } from 'url'; @@ -53,6 +56,7 @@ export interface UrlPanelContentProps { showPublicUrlSwitch?: (anonymousUserCapabilities: Capabilities) => boolean; urlService: BrowserUrlService; snapshotShareWarning?: string; + theme: WithEuiThemeProps['theme']; } export enum ExportUrlAsType { @@ -79,7 +83,7 @@ interface State { showWarningButton: boolean; } -export class UrlPanelContent extends Component { +class UrlPanelContentComponent extends Component { private mounted?: boolean; private shortUrlCache?: string; @@ -149,10 +153,10 @@ export class UrlPanelContent extends Component { } public render() { + const { theme } = this.props; const shortUrlSwitch = this.renderShortUrlSwitch(); const publicUrlSwitch = this.renderPublicUrlSwitch(); const copyButton = this.renderCopyButton(); - const urlRow = (!!shortUrlSwitch || !!publicUrlSwitch) && ( } @@ -167,7 +171,7 @@ export class UrlPanelContent extends Component { return ( - + {this.renderExportAsRadioGroup()} {this.renderUrlParamExtensions()} {urlRow} @@ -612,3 +616,6 @@ export class UrlPanelContent extends Component { ); }; } + +export const UrlPanelContent = withEuiTheme(UrlPanelContentComponent); +UrlPanelContent.displayName = 'UrlPanelContent'; diff --git a/src/platform/plugins/shared/share/public/index.scss b/src/platform/plugins/shared/share/public/index.scss deleted file mode 100644 index 0271fbb8e9026..0000000000000 --- a/src/platform/plugins/shared/share/public/index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './components/index' \ No newline at end of file diff --git a/src/platform/plugins/shared/share/public/plugin.ts b/src/platform/plugins/shared/share/public/plugin.ts index 22557f58e9a03..188a15d172e90 100644 --- a/src/platform/plugins/shared/share/public/plugin.ts +++ b/src/platform/plugins/shared/share/public/plugin.ts @@ -7,8 +7,6 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import './index.scss'; - import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; import { ShareMenuManager, ShareMenuManagerStart } from './services'; import { ShareMenuRegistry, ShareMenuRegistrySetup } from './services';