Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing where CodeEditor fields get useDarkMode value #159638

Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
27a5756
new theme hook
kc13greiner Jun 14, 2023
ddf2dba
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jun 14, 2023
bab63ee
Adding TODOs to aid testers
kc13greiner Jun 14, 2023
3470185
Fixing theme in adv settings context and updating notes about snapsho…
kc13greiner Jun 14, 2023
993ca17
Changing import/exports
kc13greiner Jun 14, 2023
a410436
Fixing CodeEditor to respond to Observable changes
kc13greiner Jun 15, 2023
9b9c2e6
Merge branch 'main' into bugfix/provide_theme_in_context_for_useTheme…
kc13greiner Jun 15, 2023
cac52ab
Adding tests and final comments
kc13greiner Jun 20, 2023
5ebd0b2
Code Review Feedback from Tina H.
kc13greiner Jun 21, 2023
0ff4ad7
CodeReview feed back from Stratoula K.
kc13greiner Jun 21, 2023
79b0be0
CodeReview feedback for Stratoula K. - removing TODOs
kc13greiner Jun 22, 2023
0bf6102
Update x-pack/plugins/snapshot_restore/__jest__/client_integration/he…
kc13greiner Jun 22, 2023
d3d6458
CodeReview feedback from Alison G. - removing TODOs and fixing test e…
kc13greiner Jun 22, 2023
e29211b
CodeReview feedback from Paulo H.
kc13greiner Jun 22, 2023
9f48c10
Code Review feedback from Devon T. - removing TODOs
kc13greiner Jun 23, 2023
4aa4657
Code Review feedback from Sander P. - removing TODO
kc13greiner Jun 26, 2023
86b26f9
Merge branch 'main' into bugfix/provide_theme_in_context_for_useTheme…
kc13greiner Jun 27, 2023
88fa757
CodeReview feedback from Julia R. - Removing TODOs
kc13greiner Jun 28, 2023
abcc170
Code Review feedback from Nathan R. - adding theme to the file_upload…
kc13greiner Jun 28, 2023
21c6350
Code Review feedback from Nathan R.
kc13greiner Jun 29, 2023
d070e98
Code Review feedback from Nathan R. - removing TODOs
kc13greiner Jun 30, 2023
701dff4
Code Review feedback from Rachel S. - removing TODOs
kc13greiner Jun 30, 2023
0bf4623
Code Review feedback from Tina H. - Removing TODO
kc13greiner Jun 30, 2023
a1e2421
Removing todo - context was provided
kc13greiner Jun 30, 2023
881d031
Code Review feedback from Karl G. - Removing TODO
kc13greiner Jun 30, 2023
6502957
Code Review feedback Sander P
kc13greiner Jun 30, 2023
74401ad
Merge branch 'main' into bugfix/provide_theme_in_context_for_useTheme…
kc13greiner Jul 3, 2023
78c3eac
Code Review from Nicolas C. - removing TODOs
kc13greiner Jul 3, 2023
6e444eb
Code Review from Alison G. - Removing TODOs
kc13greiner Jul 3, 2023
79c0cfc
Code Review from Alison G. - removing TODOs
kc13greiner Jul 3, 2023
27acfe0
Code Review from Alison G - Removing TODOs
kc13greiner Jul 3, 2023
ac527b0
fix MLJobEditor theme
darnautov Jul 4, 2023
7a8fa2a
Update x-pack/plugins/ml/public/application/data_frame_analytics/page…
kc13greiner Jul 5, 2023
c26fdeb
Update x-pack/plugins/ml/public/application/data_frame_analytics/page…
kc13greiner Jul 5, 2023
6e797b2
Update x-pack/plugins/transform/public/app/sections/create_transform/…
kc13greiner Jul 5, 2023
6eab9a7
Update x-pack/plugins/transform/public/app/sections/create_transform/…
kc13greiner Jul 5, 2023
ce64897
Update x-pack/plugins/transform/public/app/sections/create_transform/…
kc13greiner Jul 5, 2023
f699b43
Update x-pack/plugins/transform/public/app/sections/create_transform/…
kc13greiner Jul 5, 2023
888ae97
Merge branch 'main' into bugfix/provide_theme_in_context_for_useTheme…
kc13greiner Jul 5, 2023
d7f048e
Updating jest tests
kc13greiner Jul 5, 2023
74e23c6
Fixing URL Drilldown CodeEditor and Functional Test
kc13greiner Jul 5, 2023
2ff74d8
Removing debug statement
kc13greiner Jul 5, 2023
f814874
Passing CoreStart to props for expression editor
kc13greiner Jul 5, 2023
9e86ef1
Merge branch 'main' into bugfix/provide_theme_in_context_for_useTheme…
kc13greiner Jul 5, 2023
100d542
Updating props and unit test
kc13greiner Jul 6, 2023
1174b6a
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Jul 6, 2023
c53870c
Adding theme to fleet kb context
kc13greiner Jul 6, 2023
11e0888
Merge branch 'main' into bugfix/provide_theme_in_context_for_useTheme…
kc13greiner Jul 6, 2023
5cf8510
Changing imports to remove circular deps
kc13greiner Jul 6, 2023
5a4453a
Code Review from Patryk K. - removing TODO
kc13greiner Jul 7, 2023
85318b1
Removing TODOs from reviewed CodeEditors
kc13greiner Jul 7, 2023
5859a29
Merge branch 'main' into bugfix/provide_theme_in_context_for_useTheme…
kc13greiner Jul 7, 2023
956c7a3
Fixing mergemain issue
kc13greiner Jul 10, 2023
53eee69
Merge branch 'main' into bugfix/provide_theme_in_context_for_useTheme…
kc13greiner Jul 10, 2023
e625dcd
Removing todos
kc13greiner Jul 10, 2023
ff98c8e
Merge branch 'main' into bugfix/provide_theme_in_context_for_useTheme…
kc13greiner Jul 10, 2023
24f07a1
Merge branch 'main' into bugfix/provide_theme_in_context_for_useTheme…
kc13greiner Jul 11, 2023
b671375
Merge branch 'main' into bugfix/provide_theme_in_context_for_useTheme…
kc13greiner Jul 11, 2023
bdbe9a8
Code Review feedback from Christos N. - removing TODO
kc13greiner Jul 11, 2023
cc45a2b
Removing type error to avoid breaking changes
kc13greiner Jul 11, 2023
ad1ed21
CodeReview feedback Oliver G. - Removing TODO
kc13greiner Jul 11, 2023
e5c265f
Merge branch 'main' into bugfix/provide_theme_in_context_for_useTheme…
kc13greiner Jul 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/expressions_explorer/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ interface Props {
}

const ExpressionsExplorer = ({ expressions, inspector, actions, uiSettings, settings }: Props) => {
// TODO theme needs to be provided here for examples/expressions_explorer/public/editor/expression_editor.tsx, need CodeOwners help
const { Provider: KibanaReactContextProvider } = createKibanaReactContext({
uiSettings,
settings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface Props {

export function ExpressionEditor({ value, onChange }: Props) {
return (
<CodeEditor
<CodeEditor // TODO theme needs to be provided from examples/expressions_explorer/public/app.tsx, need CodeOwners help
languageId="javascript"
width="100%"
height="250px"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export class AdvancedSettings extends Component<AdvancedSettingsProps> {
services={{
uiSettings: this.props.settingsService.client,
settings: this.props.settingsService,
theme: { theme$: this.props.theme },
}}
>
<Form
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jest.mock('@kbn/kibana-react-plugin/public/ui_settings/use_ui_setting', () => ({
useUiSetting: jest.fn(),
}));

jest.mock('@kbn/kibana-react-plugin/public/theme/use_theme', () => ({
useKibanaTheme: jest.fn(() => {
return { darkMode: false };
}),
}));

const defaults = {
requiresPageReload: false,
readOnly: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const FieldCodeEditor = ({
);

return (
<CodeEditor
<CodeEditor // TODO updated to provide theme via src/plugins/advanced_settings/public/management_app/advanced_settings.tsx
{...a11yProps}
languageId={type === 'json' ? XJsonLang.ID : MarkdownLang}
value={value}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const InspectFlyout = ({ uiSettings, searchSession }: InspectFlyoutProps) => {
const renderInfo = () => {
return (
<Fragment>
<CodeEditor
<CodeEditor // TODO theme provided by src/plugins/data/public/search/search_service.ts
kc13greiner marked this conversation as resolved.
Show resolved Hide resolved
kc13greiner marked this conversation as resolved.
Show resolved Hide resolved
languageId="json"
value={JSON.stringify(searchSession, null, 2)}
options={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ const ScriptFieldComponent = ({ existingConcreteFields, links, placeholder }: Pr
}
fullWidth
>
<CodeEditor
<CodeEditor // TODO theme provided in src/plugins/data_view_field_editor/public/open_editor.tsx
kc13greiner marked this conversation as resolved.
Show resolved Hide resolved
kc13greiner marked this conversation as resolved.
Show resolved Hide resolved
languageId={PainlessLang.ID}
suggestionProvider={suggestionProvider}
// 99% width allows the editor to resize horizontally. 100% prevents it from resizing.
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/data_view_field_editor/public/open_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ export const getFieldEditorOpener =
apiService,
}: Dependencies) =>
(options: OpenFieldEditorOptions): CloseEditor => {
const { uiSettings, overlays, docLinks, notifications, settings } = core;
const { uiSettings, overlays, docLinks, notifications, settings, theme } = core;
const { Provider: KibanaReactContextProvider } = createKibanaReactContext({
uiSettings,
docLinks,
http: core.http,
settings,
theme,
});

let overlayRef: OverlayRef | null = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ export class FieldEditor extends PureComponent<FieldEdiorProps, FieldEditorState
isInvalid={isInvalid}
error={isInvalid ? errorMsg : null}
>
<CodeEditor
<CodeEditor // TODO theme provided in src/plugins/data_view_management/public/management_app/mount_management_section.tsx
kc13greiner marked this conversation as resolved.
Show resolved Hide resolved
kc13greiner marked this conversation as resolved.
Show resolved Hide resolved
languageId={PainlessLang.ID}
width="100%"
height="300px"
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/discover/public/build_services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import { DiscoverAppLocator } from '../common';
export interface HistoryLocationState {
referrer: string;
}

// TODO theme needs to be provided with the theme$ observable, let code owners decide
kc13greiner marked this conversation as resolved.
Show resolved Hide resolved
export interface DiscoverServices {
application: ApplicationStart;
addBasePath: (path: string) => string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const mockServices = {
fieldFormats: {
getDefaultInstance: jest.fn(() => ({ convert: (value: unknown) => (value ? value : '-') })),
},
// TODO needs theme to provide theme$ observable, the required value here depends on how Discover services are changed
};

jest.mock('../../hooks/use_discover_services', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const JsonCodeEditorCommon = ({
return null;
}
const codeEditor = (
<CodeEditor
<CodeEditor // TODO theme needs to be provided in the top level context, in src/plugins/discover/public/build_services.ts, theme is not providing a theme$ observable
kc13greiner marked this conversation as resolved.
Show resolved Hide resolved
languageId={XJsonLang.ID}
width={width}
height={height}
Expand Down
1 change: 1 addition & 0 deletions src/plugins/inspector/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export class InspectorPublicPlugin implements Plugin<Setup, Start> {
uiSettings: core.uiSettings,
share: startDeps.share,
settings: core.settings,
theme: core.theme,
}}
/>,
{ theme$: core.theme.theme$ }
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/inspector/public/ui/inspector_panel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ import { Adapters } from '../../common';
import type { ApplicationStart, HttpSetup, IUiSettingsClient } from '@kbn/core/public';
import { SharePluginStart } from '@kbn/share-plugin/public';
import { sharePluginMock } from '@kbn/share-plugin/public/mocks';
import { applicationServiceMock } from '@kbn/core/public/mocks';
import { applicationServiceMock, themeServiceMock } from '@kbn/core/public/mocks';
import { settingsServiceMock } from '@kbn/core-ui-settings-browser-mocks';
import type { SettingsStart } from '@kbn/core-ui-settings-browser';
import { ThemeServiceStart } from '@kbn/core/public';

describe('InspectorPanel', () => {
let adapters: Adapters;
Expand All @@ -27,12 +28,14 @@ describe('InspectorPanel', () => {
share: sharePluginMock.createStartContract(),
uiSettings: {},
settings: settingsServiceMock.createStartContract(),
theme: themeServiceMock.createStartContract(),
} as unknown as {
application: ApplicationStart;
http: HttpSetup;
share: SharePluginStart;
uiSettings: IUiSettingsClient;
settings: SettingsStart;
theme: ThemeServiceStart;
};

beforeEach(() => {
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/inspector/public/ui/inspector_panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ import {
EuiFlyoutBody,
EuiLoadingSpinner,
} from '@elastic/eui';
import { ApplicationStart, HttpStart, IUiSettingsClient } from '@kbn/core/public';
import {
ApplicationStart,
HttpStart,
IUiSettingsClient,
ThemeServiceStart,
} from '@kbn/core/public';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { SharePluginStart } from '@kbn/share-plugin/public';
import type { SettingsStart } from '@kbn/core-ui-settings-browser';
Expand Down Expand Up @@ -48,6 +53,7 @@ interface InspectorPanelProps {
uiSettings: IUiSettingsClient;
share: SharePluginStart;
settings: SettingsStart;
theme: ThemeServiceStart;
};
}

Expand Down
9 changes: 9 additions & 0 deletions src/plugins/kibana_react/public/code_editor/code_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,15 @@ export const CodeEditor: React.FC<Props> = ({
]
);

useEffect(() => {
kc13greiner marked this conversation as resolved.
Show resolved Hide resolved
// Register themes when 'useDarkThem' changes
monaco.editor.defineTheme('euiColors', useDarkTheme ? DARK_THEME : LIGHT_THEME);
monaco.editor.defineTheme(
'euiColorsTransparent',
useDarkTheme ? DARK_THEME_TRANSPARENT : LIGHT_THEME_TRANSPARENT
);
}, [useDarkTheme]);

const _editorDidMount = useCallback(
(editor: monaco.editor.IStandaloneCodeEditor, __monaco: unknown) => {
if (__monaco !== monaco) {
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/kibana_react/public/code_editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import React from 'react';
import { EuiDelayRender, EuiErrorBoundary, EuiSkeletonText } from '@elastic/eui';

import { useUiSetting } from '../ui_settings';
import { useKibanaTheme } from '../theme';
import type { Props } from './code_editor';

export * from './languages/constants';
Expand Down Expand Up @@ -40,11 +40,11 @@ export type CodeEditorProps = Props;
* @see CodeEditorField to render a code editor in the same style as other EUI form fields.
*/
export const CodeEditor: React.FunctionComponent<Props> = (props) => {
const darkMode = useUiSetting<boolean>('theme:darkMode');
const coreTheme = useKibanaTheme();
return (
<EuiErrorBoundary>
<React.Suspense fallback={<Fallback height={props.height} />}>
<LazyBaseEditor {...props} useDarkTheme={darkMode} />
<LazyBaseEditor {...props} useDarkTheme={coreTheme.darkMode} />
</React.Suspense>
</EuiErrorBoundary>
);
Expand All @@ -54,11 +54,11 @@ export const CodeEditor: React.FunctionComponent<Props> = (props) => {
* Renders a Monaco code editor in the same style as other EUI form fields.
*/
export const CodeEditorField: React.FunctionComponent<Props> = (props) => {
const darkMode = useUiSetting<boolean>('theme:darkMode');
const coreTheme = useKibanaTheme();
return (
<EuiErrorBoundary>
<React.Suspense fallback={<Fallback height={props.height} />}>
<LazyCodeEditorField {...props} useDarkTheme={darkMode} />
<LazyCodeEditorField {...props} useDarkTheme={coreTheme.darkMode} />
</React.Suspense>
</EuiErrorBoundary>
);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kibana_react/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export type { ToMountPointOptions } from './util';
/** @deprecated Use `RedirectAppLinks` from `@kbn/shared-ux-link-redirect-app` */
export { RedirectAppLinks } from './app_links';

export { wrapWithTheme, KibanaThemeProvider } from './theme';
export { wrapWithTheme, KibanaThemeProvider, useKibanaTheme } from './theme';

/** dummy plugin, we just want kibanaReact to have its own bundle */
export function plugin() {
Expand Down
1 change: 1 addition & 0 deletions src/plugins/kibana_react/public/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@

export { wrapWithTheme } from './wrap_with_theme';
export { KibanaThemeProvider } from './kibana_theme_provider';
export { useKibanaTheme } from './use_theme';
export type { EuiTheme } from './types';
56 changes: 56 additions & 0 deletions src/plugins/kibana_react/public/theme/use_theme.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* 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.
*/
kc13greiner marked this conversation as resolved.
Show resolved Hide resolved

import React, { FC, useEffect } from 'react';
import { mountWithIntl } from '@kbn/test-jest-helpers';
import type { CoreTheme } from '@kbn/core/public';
import { KibanaContextProvider } from '../context';
import { themeServiceMock } from '@kbn/core/public/mocks';
import { useKibanaTheme } from './use_theme';

describe('useKibanaTheme', () => {
let resultTheme: CoreTheme | undefined;

beforeEach(() => {
resultTheme = undefined;
});

const InnerComponent: FC = () => {
const theme = useKibanaTheme();
useEffect(() => {
resultTheme = theme;
}, [theme]);
return <div>foo</div>;
};

it('retrieve CoreTheme when theme service is provided in context', async () => {
const expectedCoreTheme: CoreTheme = { darkMode: false };

const themeServiceStart = themeServiceMock.createStartContract();

mountWithIntl(
<KibanaContextProvider services={{ theme: themeServiceStart }}>
<InnerComponent />
</KibanaContextProvider>
);

expect(resultTheme).toEqual(expectedCoreTheme);
});

it('throws type error when theme is not provided', async () => {
const mount = () => {
return mountWithIntl(
<KibanaContextProvider>
<InnerComponent />
</KibanaContextProvider>
);
};

expect(mount).toThrow(new TypeError('theme service not available in kibana-react context.'));
});
});
25 changes: 25 additions & 0 deletions src/plugins/kibana_react/public/theme/use_theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* 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.
*/

import { CoreTheme } from '@kbn/core-theme-browser';
import useObservable from 'react-use/lib/useObservable';
import { useKibana } from '../context';

export const useKibanaTheme = (): CoreTheme => {
const defaultTheme: CoreTheme = { darkMode: false };

const {
services: { theme },
} = useKibana();

if (!theme) {
throw new TypeError('theme service not available in kibana-react context.');
}

return useObservable(theme.theme$, defaultTheme);
};
1 change: 1 addition & 0 deletions src/plugins/kibana_react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@kbn/test-jest-helpers",
"@kbn/i18n",
"@kbn/i18n-react",
"@kbn/core-theme-browser",
],
"exclude": [
"target/**/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const ExpressionInput = (props: ExpressionInputProps) => {

return (
<div style={{ height, ...style }} {...{ rest }}>
<CodeEditor
<CodeEditor // TODO CodeOwners will need to help with this one
kc13greiner marked this conversation as resolved.
Show resolved Hide resolved
languageId={EXPRESSIONS_LANGUAGE_ID}
languageConfiguration={LANGUAGE_CONFIGURATION}
value={expression}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const Inspect: FC<InspectProps> = ({ object }) => {
</EuiCopy>
<EuiSpacer size="s" />
</div>
<CodeEditor
<CodeEditor // TODO theme provided in src/plugins/saved_objects_management/public/management_section/object_view/saved_object_view.tsx
kc13greiner marked this conversation as resolved.
Show resolved Hide resolved
languageId={XJsonLang.ID}
value={objectAsJsonString}
aria-label={codeEditorAriaLabel(title)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
uiSettingsServiceMock,
scopedHistoryMock,
docLinksServiceMock,
themeServiceMock,
} from '@kbn/core/public/mocks';

import type { SavedObjectWithMetadata } from '../../types';
Expand All @@ -42,6 +43,7 @@ describe('SavedObjectEdition', () => {
let applications: ReturnType<typeof applicationServiceMock.createStartContract>;
let docLinks: ReturnType<typeof docLinksServiceMock.createStartContract>;
let settings: ReturnType<typeof settingsServiceMock.createStartContract>;
let theme: ReturnType<typeof themeServiceMock.createStartContract>;

const shallowRender = (overrides: Partial<SavedObjectEditionProps> = {}) => {
return shallowWithI18nProvider(
Expand All @@ -62,6 +64,7 @@ describe('SavedObjectEdition', () => {
history = scopedHistoryMock.create();
docLinks = docLinksServiceMock.createStartContract();
applications = applicationServiceMock.createStartContract();
theme = themeServiceMock.createStartContract();
applications.capabilities = {
navLinks: {},
management: {},
Expand All @@ -86,6 +89,7 @@ describe('SavedObjectEdition', () => {
uiSettings,
docLinks: docLinks.links,
settings,
theme,
};

bulkDeleteObjectsMock.mockResolvedValue([{}]);
Expand Down
Loading