diff --git a/kibana-reports/server/index.ts b/kibana-reports/server/index.ts index f74125c8..aee0bbce 100644 --- a/kibana-reports/server/index.ts +++ b/kibana-reports/server/index.ts @@ -14,29 +14,11 @@ */ import { OpendistroKibanaReportsPlugin } from './plugin'; -import { schema, TypeOf } from '@kbn/config-schema'; import { PluginInitializerContext, - PluginConfigDescriptor, HttpServerInfo, } from '../../../src/core/server'; -export const configSchema = schema.object({ - access: schema.object({ - port: schema.number({ defaultValue: 5601 }), - basePath: schema.string({ defaultValue: '' }), - }), -}); - -export type KibanaReportsPluginConfigType = TypeOf; - -export const config: PluginConfigDescriptor = { - exposeToBrowser: { - access: true, - }, - schema: configSchema, -}; - export type AccessInfoType = { basePath: string; serverInfo: HttpServerInfo; diff --git a/kibana-reports/server/plugin.ts b/kibana-reports/server/plugin.ts index 41b5dfe9..380ee994 100644 --- a/kibana-reports/server/plugin.ts +++ b/kibana-reports/server/plugin.ts @@ -32,7 +32,7 @@ import { import registerRoutes from './routes'; import { pollAndExecuteJob } from './executor/executor'; import { POLL_INTERVAL } from './utils/constants'; -import { AccessInfoType, KibanaReportsPluginConfigType } from 'server'; +import { AccessInfoType } from 'server'; export interface ReportsPluginRequestContext { logger: Logger; diff --git a/kibana-reports/server/routes/index.ts b/kibana-reports/server/routes/index.ts index 1c49567c..da749abe 100644 --- a/kibana-reports/server/routes/index.ts +++ b/kibana-reports/server/routes/index.ts @@ -17,8 +17,8 @@ import registerReportRoute from './report'; import registerReportDefinitionRoute from './reportDefinition'; import registerReportSourceRoute from './reportSource'; import registerMetricRoute from './metric'; -import { HttpServerInfo, IRouter } from '../../../../src/core/server'; -import { AccessInfoType, KibanaReportsPluginConfigType } from 'server'; +import { IRouter } from '../../../../src/core/server'; +import { AccessInfoType } from 'server'; export default function (router: IRouter, accessInfo: AccessInfoType) { registerReportRoute(router, accessInfo); diff --git a/kibana-reports/server/routes/utils/converters/__tests__/backendToUi.test.ts b/kibana-reports/server/routes/utils/converters/__tests__/backendToUi.test.ts index e4026b0b..0888e914 100644 --- a/kibana-reports/server/routes/utils/converters/__tests__/backendToUi.test.ts +++ b/kibana-reports/server/routes/utils/converters/__tests__/backendToUi.test.ts @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -import { KibanaReportsPluginConfigType } from 'server'; +import { AccessInfoType } from 'server'; import { BackendReportInstanceType, BACKEND_DELIVERY_FORMAT, @@ -74,10 +74,13 @@ const input: BackendReportInstanceType = { status: BACKEND_REPORT_STATE.success, }; -const testConfig: KibanaReportsPluginConfigType = { - access: { +const testAccessInfo: AccessInfoType = { + basePath: '', + serverInfo: { + name: '', + hostname: 'localhost', port: 5601, - basePath: '', + protocol: 'http', }, }; @@ -133,7 +136,7 @@ const output = { describe('test backend to ui model conversion', () => { test('convert backend to ui report', async () => { - const res = backendToUiReport(input, testConfig.access.basePath); + const res = backendToUiReport(input, testAccessInfo.basePath); expect(res).toEqual(output); }, 20000); });