-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Reporting] Initial Export types plugin (#158479)
## Summary Closes #158512 - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios Co-authored-by: Tim Sullivan <[email protected]>
- Loading branch information
Showing
18 changed files
with
138 additions
and
5 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# exportTypePlugin | ||
|
||
This plugin is intended to be a central point for the export types of reporting to convene before hitting the reporting plugin. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"type": "plugin", | ||
"id": "@kbn/reporting-export-types-plugin", | ||
"owner": "@elastic/appex-sharedux", | ||
"description": "Currently PDF, PNG or CSV export types for the reporting plugin", | ||
"plugin": { | ||
"id": "reportingExportTypes", | ||
"server": true, | ||
"browser": false, | ||
"configPath": [ | ||
"xpack", | ||
"reporting" | ||
], | ||
"requiredPlugins": [ | ||
"reporting" | ||
], | ||
"optionalPlugins": [ | ||
"security", | ||
"spaces", | ||
"usageCollection" | ||
], | ||
"requiredBundles": [ | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* 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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { PluginInitializerContext, Logger } from '@kbn/core/server'; | ||
import { ExportTypesPlugin } from './plugin'; | ||
|
||
// This exports static code and TypeScript types, | ||
// as well as, Kibana Platform `plugin()` initializer. | ||
|
||
export function plugin(initializerContext: PluginInitializerContext, logger: Logger) { | ||
return new ExportTypesPlugin(initializerContext, logger); | ||
} | ||
|
||
export type { ExportTypesPluginSetup, ExportTypesPluginStart } from './types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* 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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from '@kbn/core/server'; | ||
|
||
import { ConfigSchema } from '@kbn/reporting-plugin/server/config'; | ||
import { ExportTypesPluginSetup, ExportTypesPluginStart } from './types'; | ||
|
||
export class ExportTypesPlugin | ||
implements Plugin<{}, {}, ExportTypesPluginSetup, ExportTypesPluginStart> | ||
{ | ||
exportTypes = [ | ||
// new CsvExportType(), | ||
// new PdfExportType(), | ||
// new PngExportType(), | ||
]; | ||
|
||
constructor(initializerContext: PluginInitializerContext<typeof ConfigSchema>, logger: Logger) { | ||
logger = initializerContext.logger.get(); | ||
} | ||
|
||
public setup(core: CoreSetup, pluginsSetup: ExportTypesPluginSetup) { | ||
const { reporting } = pluginsSetup; | ||
this.exportTypes.forEach((eType) => { | ||
reporting.registerExportTypes(eType); | ||
}); | ||
return {}; | ||
} | ||
|
||
public start(core: CoreStart, plugins: ExportTypesPluginStart) { | ||
this.exportTypes.forEach((eType) => {}); | ||
return {}; | ||
} | ||
|
||
public stop() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* 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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import type { ReportingSetup, ReportingStart } from '@kbn/reporting-plugin/server/types'; | ||
|
||
export interface ExportTypesPluginSetup { | ||
reporting: ReportingSetup; | ||
} | ||
export interface ExportTypesPluginStart { | ||
reporting: ReportingStart; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"extends": "../../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"outDir": "target/types" | ||
}, | ||
"include": [ | ||
"common/**/*", | ||
"server/**/*", | ||
"../../../typings/**/*" | ||
], | ||
"kbn_references": [ | ||
"@kbn/core", | ||
"@kbn/reporting-plugin", | ||
], | ||
"exclude": ["target/**/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters