From dc2fbdbb82be8b27a22c926087f76a5d837577f3 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Fri, 6 Mar 2020 15:46:50 +0100 Subject: [PATCH 1/2] Remove unused code --- src/plugins/console/public/application/index.tsx | 5 ----- .../models/sense_editor/sense_editor.test.mocks.ts | 3 --- 2 files changed, 8 deletions(-) diff --git a/src/plugins/console/public/application/index.tsx b/src/plugins/console/public/application/index.tsx index 1fef52da6f31b..bf5338a81e33e 100644 --- a/src/plugins/console/public/application/index.tsx +++ b/src/plugins/console/public/application/index.tsx @@ -27,11 +27,6 @@ import * as localStorageObjectClient from '../lib/local_storage_object_client'; import { createUsageTracker } from '../services/tracker'; import { UsageCollectionSetup } from '../../../usage_collection/public'; -let settingsRef: Settings; -export function legacyBackDoorToSettings() { - return settingsRef; -} - export interface BootDependencies { docLinkVersion: string; I18nContext: any; diff --git a/src/plugins/console/public/application/models/sense_editor/sense_editor.test.mocks.ts b/src/plugins/console/public/application/models/sense_editor/sense_editor.test.mocks.ts index 8df9bb8ef9a0b..76556fd0e1880 100644 --- a/src/plugins/console/public/application/models/sense_editor/sense_editor.test.mocks.ts +++ b/src/plugins/console/public/application/models/sense_editor/sense_editor.test.mocks.ts @@ -20,9 +20,6 @@ import '../legacy_core_editor/legacy_core_editor.test.mocks'; -// TODO: Remove this mock -jest.mock('../../../application', () => ({ legacyBackDoorToSettings: () => {} })); - import jQuery from 'jquery'; jest.spyOn(jQuery, 'ajax').mockImplementation( () => From b8803e28c3c060dcfc6254662dec828daad9c9bf Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Fri, 6 Mar 2020 17:05:43 +0100 Subject: [PATCH 2/2] fix: remove use of undeclared variable --- src/plugins/console/public/application/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/console/public/application/index.tsx b/src/plugins/console/public/application/index.tsx index bf5338a81e33e..051eaea27a7de 100644 --- a/src/plugins/console/public/application/index.tsx +++ b/src/plugins/console/public/application/index.tsx @@ -22,7 +22,7 @@ import { render, unmountComponentAtNode } from 'react-dom'; import { NotificationsSetup } from 'src/core/public'; import { ServicesContextProvider, EditorContextProvider, RequestContextProvider } from './contexts'; import { Main } from './containers'; -import { createStorage, createHistory, createSettings, Settings } from '../services'; +import { createStorage, createHistory, createSettings } from '../services'; import * as localStorageObjectClient from '../lib/local_storage_object_client'; import { createUsageTracker } from '../services/tracker'; import { UsageCollectionSetup } from '../../../usage_collection/public'; @@ -54,7 +54,6 @@ export function renderApp({ const history = createHistory({ storage }); const settings = createSettings({ storage }); const objectStorageClient = localStorageObjectClient.create(storage); - settingsRef = settings; render(