Skip to content

Commit c220d77

Browse files
committed
Revert "Fix wrong impor (#52994)"
This reverts commit 6c1f248.
1 parent 3658220 commit c220d77

39 files changed

Lines changed: 770 additions & 712 deletions

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ module.exports = {
346346
'Server modules cannot be imported into client modules or shared modules.',
347347
},
348348
{
349-
target: ['src/**/*'],
349+
target: ['src/core/**/*'],
350350
from: ['x-pack/**/*'],
351351
errorMessage: 'OSS cannot import x-pack files.',
352352
},

x-pack/legacy/common/poller.d.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,4 @@ export declare class Poller {
88
constructor(options: any);
99

1010
public start(): void;
11-
public stop(): void;
12-
public isRunning(): boolean;
13-
public getPollFrequency(): number;
1411
}

x-pack/legacy/plugins/graph/public/index.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { SavedObjectRegistryProvider } from 'ui/saved_objects/saved_object_regis
1717
import { npSetup, npStart } from 'ui/new_platform';
1818
import { Storage } from '../../../../../src/plugins/kibana_utils/public';
1919
import { start as navigation } from '../../../../../src/legacy/core_plugins/navigation/public/legacy';
20-
import { LicensingPluginSetup } from '../../../../plugins/licensing/public';
2120
import { GraphPlugin } from './plugin';
2221

2322
// @ts-ignore
@@ -40,17 +39,13 @@ async function getAngularInjectedDependencies(): Promise<LegacyAngularInjectedDe
4039
};
4140
}
4241

43-
type XpackNpSetupDeps = typeof npSetup.plugins & {
44-
licensing: LicensingPluginSetup;
45-
};
46-
4742
(async () => {
4843
const instance = new GraphPlugin();
4944
instance.setup(npSetup.core, {
5045
__LEGACY: {
5146
Storage,
5247
},
53-
...(npSetup.plugins as XpackNpSetupDeps),
48+
...npSetup.plugins,
5449
});
5550
instance.start(npStart.core, {
5651
npData: npStart.plugins.data,

x-pack/legacy/plugins/graph/public/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { CoreSetup, CoreStart, Plugin, SavedObjectsClientContract } from 'src/co
99
import { Plugin as DataPlugin } from 'src/plugins/data/public';
1010
import { LegacyAngularInjectedDependencies } from './render_app';
1111
import { NavigationStart } from '../../../../../src/legacy/core_plugins/navigation/public';
12-
import { LicensingPluginSetup } from '../../../../plugins/licensing/public';
12+
import { LicensingPluginSetup } from '../../../../plugins/licensing/common/types';
1313

1414
export interface GraphPluginStartDependencies {
1515
npData: ReturnType<DataPlugin['start']>;

x-pack/legacy/plugins/graph/public/render_app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {
3838
IndexPatternsContract,
3939
} from '../../../../../src/plugins/data/public';
4040
import { NavigationStart } from '../../../../../src/legacy/core_plugins/navigation/public';
41-
import { LicensingPluginSetup } from '../../../../plugins/licensing/public';
41+
import { LicensingPluginSetup } from '../../../../plugins/licensing/common/types';
4242
import { checkLicense } from '../../../../plugins/graph/common/check_license';
4343

4444
/**

x-pack/legacy/plugins/xpack_main/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
import { resolve } from 'path';
88
import dedent from 'dedent';
9+
import {
10+
XPACK_INFO_API_DEFAULT_POLL_FREQUENCY_IN_MILLIS
11+
} from '../../server/lib/constants';
912
import { mirrorPluginStatus } from '../../server/lib/mirror_plugin_status';
1013
import { replaceInjectedVars } from './server/lib/replace_injected_vars';
1114
import { setupXPackMain } from './server/lib/setup_xpack_main';
@@ -31,6 +34,7 @@ export const xpackMain = (kibana) => {
3134
enabled: Joi.boolean().default(),
3235
url: Joi.string().default(),
3336
}).default(), // deprecated
37+
xpack_api_polling_frequency_millis: Joi.number().default(XPACK_INFO_API_DEFAULT_POLL_FREQUENCY_IN_MILLIS),
3438
}).default();
3539
},
3640

@@ -43,9 +47,6 @@ export const xpackMain = (kibana) => {
4347
},
4448

4549
uiExports: {
46-
hacks: [
47-
'plugins/xpack_main/hacks/check_xpack_info_change',
48-
],
4950
replaceInjectedVars,
5051
injectDefaultVars(server) {
5152
const config = server.config();

x-pack/legacy/plugins/xpack_main/public/hacks/check_xpack_info_change.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

x-pack/legacy/plugins/xpack_main/server/lib/__tests__/setup_xpack_main.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
import { BehaviorSubject } from 'rxjs';
87
import sinon from 'sinon';
98
import { XPackInfo } from '../xpack_info';
109
import { setupXPackMain } from '../setup_xpack_main';
1110
import * as InjectXPackInfoSignatureNS from '../inject_xpack_info_signature';
1211

13-
1412
describe('setupXPackMain()', () => {
1513
const sandbox = sinon.createSandbox();
1614

@@ -41,16 +39,17 @@ describe('setupXPackMain()', () => {
4139
elasticsearch: mockElasticsearchPlugin,
4240
xpack_main: mockXPackMainPlugin
4341
},
44-
newPlatform: { setup: { plugins: { features: {}, licensing: { license$: new BehaviorSubject() } } } },
42+
newPlatform: { setup: { plugins: { features: {} } } },
4543
events: { on() {} },
4644
log() {},
4745
config() {},
4846
expose() {},
4947
ext() {}
5048
});
5149

52-
// Make sure plugins doesn't consume config
50+
// Make sure we don't misspell config key.
5351
const configGetStub = sinon.stub().throws(new Error('`config.get` is called with unexpected key.'));
52+
configGetStub.withArgs('xpack.xpack_main.xpack_api_polling_frequency_millis').returns(1234);
5453
mockServer.config.returns({ get: configGetStub });
5554
});
5655

0 commit comments

Comments
 (0)