mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 18:27:59 -04:00
This PR moves the test guide used for testing and dev work to the guided onboarding package. It is now being registered when the guided onboarding example plugin is being setup. For that a server side is added to the example plugin. Registering the test guide from the example plugin demonstrates how the "register guide" function can be used for production guides. The test config needs to be in the `kbn-guided-onboarding` package because example plugins have some problems importing files from other plugins. That way the test config is available to the example plugin and to the guided onboarding plugin for unit and functional tests. Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
/*
|
|
* 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 { GuidedOnboardingPluginSetup } from '@kbn/guided-onboarding-plugin/server';
|
|
import { PluginInitializerContext, CoreSetup, Plugin, Logger } from '@kbn/core/server';
|
|
import { testGuideId, testGuideConfig } from '@kbn/guided-onboarding';
|
|
|
|
interface PluginsSetup {
|
|
guidedOnboarding: GuidedOnboardingPluginSetup;
|
|
}
|
|
|
|
export class GuidedOnboardingExamplePlugin implements Plugin {
|
|
private readonly logger: Logger;
|
|
|
|
constructor(initializerContext: PluginInitializerContext) {
|
|
this.logger = initializerContext.logger.get();
|
|
}
|
|
|
|
public setup(coreSetup: CoreSetup, { guidedOnboarding }: PluginsSetup) {
|
|
this.logger.debug('guidedOnboardingExample: Setup');
|
|
guidedOnboarding.registerGuideConfig(testGuideId, testGuideConfig);
|
|
return {};
|
|
}
|
|
|
|
public start() {
|
|
this.logger.debug('guidedOnboardingExample: Started');
|
|
return {};
|
|
}
|
|
|
|
public stop() {}
|
|
}
|