mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Timelion App removal (#110255)
* Remove timelion app and stuff which related to it * Fix CI * Fix lint * Fix tests * Fix tests * Fis tests * Fix some comments * Clean up * fix CI * fix some comments * Fix deprecation examples * Return `enabled` property in config for timelion vis * Remove unused angular lib Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
This commit is contained in:
parent
3c71408690
commit
70090e326c
240 changed files with 147 additions and 10726 deletions
|
@ -551,7 +551,6 @@ Array [
|
|||
"index-pattern",
|
||||
"search",
|
||||
"visualization",
|
||||
"timelion-sheet",
|
||||
"canvas-workpad",
|
||||
"lens",
|
||||
"map",
|
||||
|
@ -584,7 +583,6 @@ Array [
|
|||
"index-pattern",
|
||||
"search",
|
||||
"visualization",
|
||||
"timelion-sheet",
|
||||
"canvas-workpad",
|
||||
"lens",
|
||||
"map",
|
||||
|
@ -857,54 +855,6 @@ Array [
|
|||
]
|
||||
`;
|
||||
|
||||
exports[`buildOSSFeatures with a basic license returns the timelion feature augmented with appropriate sub feature privileges 1`] = `
|
||||
Array [
|
||||
Object {
|
||||
"privilege": Object {
|
||||
"app": Array [
|
||||
"timelion",
|
||||
"kibana",
|
||||
],
|
||||
"catalogue": Array [
|
||||
"timelion",
|
||||
],
|
||||
"savedObject": Object {
|
||||
"all": Array [
|
||||
"timelion-sheet",
|
||||
],
|
||||
"read": Array [
|
||||
"index-pattern",
|
||||
],
|
||||
},
|
||||
"ui": Array [
|
||||
"save",
|
||||
],
|
||||
},
|
||||
"privilegeId": "all",
|
||||
},
|
||||
Object {
|
||||
"privilege": Object {
|
||||
"app": Array [
|
||||
"timelion",
|
||||
"kibana",
|
||||
],
|
||||
"catalogue": Array [
|
||||
"timelion",
|
||||
],
|
||||
"savedObject": Object {
|
||||
"all": Array [],
|
||||
"read": Array [
|
||||
"index-pattern",
|
||||
"timelion-sheet",
|
||||
],
|
||||
},
|
||||
"ui": Array [],
|
||||
},
|
||||
"privilegeId": "read",
|
||||
},
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`buildOSSFeatures with a basic license returns the visualize feature augmented with appropriate sub feature privileges 1`] = `
|
||||
Array [
|
||||
Object {
|
||||
|
@ -1081,7 +1031,6 @@ Array [
|
|||
"index-pattern",
|
||||
"search",
|
||||
"visualization",
|
||||
"timelion-sheet",
|
||||
"canvas-workpad",
|
||||
"lens",
|
||||
"map",
|
||||
|
@ -1114,7 +1063,6 @@ Array [
|
|||
"index-pattern",
|
||||
"search",
|
||||
"visualization",
|
||||
"timelion-sheet",
|
||||
"canvas-workpad",
|
||||
"lens",
|
||||
"map",
|
||||
|
@ -1387,54 +1335,6 @@ Array [
|
|||
]
|
||||
`;
|
||||
|
||||
exports[`buildOSSFeatures with a enterprise license returns the timelion feature augmented with appropriate sub feature privileges 1`] = `
|
||||
Array [
|
||||
Object {
|
||||
"privilege": Object {
|
||||
"app": Array [
|
||||
"timelion",
|
||||
"kibana",
|
||||
],
|
||||
"catalogue": Array [
|
||||
"timelion",
|
||||
],
|
||||
"savedObject": Object {
|
||||
"all": Array [
|
||||
"timelion-sheet",
|
||||
],
|
||||
"read": Array [
|
||||
"index-pattern",
|
||||
],
|
||||
},
|
||||
"ui": Array [
|
||||
"save",
|
||||
],
|
||||
},
|
||||
"privilegeId": "all",
|
||||
},
|
||||
Object {
|
||||
"privilege": Object {
|
||||
"app": Array [
|
||||
"timelion",
|
||||
"kibana",
|
||||
],
|
||||
"catalogue": Array [
|
||||
"timelion",
|
||||
],
|
||||
"savedObject": Object {
|
||||
"all": Array [],
|
||||
"read": Array [
|
||||
"index-pattern",
|
||||
"timelion-sheet",
|
||||
],
|
||||
},
|
||||
"ui": Array [],
|
||||
},
|
||||
"privilegeId": "read",
|
||||
},
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`buildOSSFeatures with a enterprise license returns the visualize feature augmented with appropriate sub feature privileges 1`] = `
|
||||
Array [
|
||||
Object {
|
||||
|
|
|
@ -11,52 +11,10 @@ import { KibanaFeature } from '.';
|
|||
import { LicenseType, LICENSE_TYPE } from '../../licensing/server';
|
||||
|
||||
describe('buildOSSFeatures', () => {
|
||||
it('returns features including timelion', () => {
|
||||
expect(
|
||||
buildOSSFeatures({
|
||||
savedObjectTypes: ['foo', 'bar'],
|
||||
includeTimelion: true,
|
||||
includeReporting: false,
|
||||
}).map((f) => f.id)
|
||||
).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
"discover",
|
||||
"visualize",
|
||||
"dashboard",
|
||||
"dev_tools",
|
||||
"advancedSettings",
|
||||
"indexPatterns",
|
||||
"savedObjectsManagement",
|
||||
"timelion",
|
||||
]
|
||||
`);
|
||||
});
|
||||
|
||||
it('returns features excluding timelion', () => {
|
||||
expect(
|
||||
buildOSSFeatures({
|
||||
savedObjectTypes: ['foo', 'bar'],
|
||||
includeTimelion: false,
|
||||
includeReporting: false,
|
||||
}).map((f) => f.id)
|
||||
).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
"discover",
|
||||
"visualize",
|
||||
"dashboard",
|
||||
"dev_tools",
|
||||
"advancedSettings",
|
||||
"indexPatterns",
|
||||
"savedObjectsManagement",
|
||||
]
|
||||
`);
|
||||
});
|
||||
|
||||
it('returns features including reporting subfeatures', () => {
|
||||
expect(
|
||||
buildOSSFeatures({
|
||||
savedObjectTypes: ['foo', 'bar'],
|
||||
includeTimelion: false,
|
||||
includeReporting: true,
|
||||
}).map(({ id, subFeatures }) => ({ id, subFeatures }))
|
||||
).toMatchSnapshot();
|
||||
|
@ -66,7 +24,6 @@ Array [
|
|||
expect(
|
||||
buildOSSFeatures({
|
||||
savedObjectTypes: ['foo', 'bar'],
|
||||
includeTimelion: false,
|
||||
includeReporting: false,
|
||||
}).map(({ id, subFeatures }) => ({ id, subFeatures }))
|
||||
).toMatchSnapshot();
|
||||
|
@ -74,7 +31,6 @@ Array [
|
|||
|
||||
const features = buildOSSFeatures({
|
||||
savedObjectTypes: ['foo', 'bar'],
|
||||
includeTimelion: true,
|
||||
includeReporting: false,
|
||||
});
|
||||
features.forEach((featureConfig) => {
|
||||
|
|
|
@ -11,13 +11,11 @@ import type { KibanaFeatureConfig, SubFeatureConfig } from '../common';
|
|||
|
||||
export interface BuildOSSFeaturesParams {
|
||||
savedObjectTypes: string[];
|
||||
includeTimelion: boolean;
|
||||
includeReporting: boolean;
|
||||
}
|
||||
|
||||
export const buildOSSFeatures = ({
|
||||
savedObjectTypes,
|
||||
includeTimelion,
|
||||
includeReporting,
|
||||
}: BuildOSSFeaturesParams): KibanaFeatureConfig[] => {
|
||||
return [
|
||||
|
@ -203,7 +201,6 @@ export const buildOSSFeatures = ({
|
|||
'index-pattern',
|
||||
'search',
|
||||
'visualization',
|
||||
'timelion-sheet',
|
||||
'canvas-workpad',
|
||||
'lens',
|
||||
'map',
|
||||
|
@ -221,7 +218,6 @@ export const buildOSSFeatures = ({
|
|||
'index-pattern',
|
||||
'search',
|
||||
'visualization',
|
||||
'timelion-sheet',
|
||||
'canvas-workpad',
|
||||
'lens',
|
||||
'map',
|
||||
|
@ -450,39 +446,9 @@ export const buildOSSFeatures = ({
|
|||
},
|
||||
},
|
||||
},
|
||||
...(includeTimelion ? [timelionFeature] : []),
|
||||
] as KibanaFeatureConfig[];
|
||||
};
|
||||
|
||||
const timelionFeature: KibanaFeatureConfig = {
|
||||
id: 'timelion',
|
||||
name: 'Timelion',
|
||||
order: 350,
|
||||
category: DEFAULT_APP_CATEGORIES.kibana,
|
||||
app: ['timelion', 'kibana'],
|
||||
catalogue: ['timelion'],
|
||||
privileges: {
|
||||
all: {
|
||||
app: ['timelion', 'kibana'],
|
||||
catalogue: ['timelion'],
|
||||
savedObject: {
|
||||
all: ['timelion-sheet'],
|
||||
read: ['index-pattern'],
|
||||
},
|
||||
ui: ['save'],
|
||||
},
|
||||
read: {
|
||||
app: ['timelion', 'kibana'],
|
||||
catalogue: ['timelion'],
|
||||
savedObject: {
|
||||
all: [],
|
||||
read: ['index-pattern', 'timelion-sheet'],
|
||||
},
|
||||
ui: [],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const reportingPrivilegeGroupName = i18n.translate(
|
||||
'xpack.features.ossFeatures.reporting.reportingTitle',
|
||||
{
|
||||
|
|
|
@ -46,36 +46,7 @@ describe('Features Plugin', () => {
|
|||
|
||||
it('returns OSS + registered kibana features', async () => {
|
||||
const plugin = new FeaturesPlugin(initContext);
|
||||
const { registerKibanaFeature } = await plugin.setup(coreSetup, {});
|
||||
registerKibanaFeature({
|
||||
id: 'baz',
|
||||
name: 'baz',
|
||||
app: [],
|
||||
category: { id: 'foo', label: 'foo' },
|
||||
privileges: null,
|
||||
});
|
||||
|
||||
const { getKibanaFeatures } = plugin.start(coreStart);
|
||||
|
||||
expect(getKibanaFeatures().map((f) => f.id)).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
"baz",
|
||||
"discover",
|
||||
"visualize",
|
||||
"dashboard",
|
||||
"dev_tools",
|
||||
"advancedSettings",
|
||||
"indexPatterns",
|
||||
"savedObjectsManagement",
|
||||
]
|
||||
`);
|
||||
});
|
||||
|
||||
it('returns OSS + registered kibana features with timelion when available', async () => {
|
||||
const plugin = new FeaturesPlugin(initContext);
|
||||
const { registerKibanaFeature: registerFeature } = await plugin.setup(coreSetup, {
|
||||
visTypeTimelion: { uiEnabled: true },
|
||||
});
|
||||
const { registerKibanaFeature: registerFeature } = await plugin.setup(coreSetup);
|
||||
registerFeature({
|
||||
id: 'baz',
|
||||
name: 'baz',
|
||||
|
@ -96,7 +67,6 @@ describe('Features Plugin', () => {
|
|||
"advancedSettings",
|
||||
"indexPatterns",
|
||||
"savedObjectsManagement",
|
||||
"timelion",
|
||||
]
|
||||
`);
|
||||
});
|
||||
|
@ -105,7 +75,7 @@ describe('Features Plugin', () => {
|
|||
typeRegistry.isHidden.mockReturnValueOnce(true);
|
||||
typeRegistry.isHidden.mockReturnValueOnce(false);
|
||||
const plugin = new FeaturesPlugin(initContext);
|
||||
await plugin.setup(coreSetup, {});
|
||||
await plugin.setup(coreSetup);
|
||||
const { getKibanaFeatures } = plugin.start(coreStart);
|
||||
|
||||
const soTypes =
|
||||
|
@ -120,7 +90,7 @@ describe('Features Plugin', () => {
|
|||
|
||||
it('returns registered elasticsearch features', async () => {
|
||||
const plugin = new FeaturesPlugin(initContext);
|
||||
const { registerElasticsearchFeature } = await plugin.setup(coreSetup, {});
|
||||
const { registerElasticsearchFeature } = await plugin.setup(coreSetup);
|
||||
registerElasticsearchFeature({
|
||||
id: 'baz',
|
||||
privileges: [
|
||||
|
@ -142,7 +112,7 @@ describe('Features Plugin', () => {
|
|||
|
||||
it('registers a capabilities provider', async () => {
|
||||
const plugin = new FeaturesPlugin(initContext);
|
||||
await plugin.setup(coreSetup, {});
|
||||
await plugin.setup(coreSetup);
|
||||
|
||||
expect(coreSetup.capabilities.registerProvider).toHaveBeenCalledTimes(1);
|
||||
expect(coreSetup.capabilities.registerProvider).toHaveBeenCalledWith(expect.any(Function));
|
||||
|
|
|
@ -81,10 +81,6 @@ export interface PluginStartContract {
|
|||
getKibanaFeatures(): KibanaFeature[];
|
||||
}
|
||||
|
||||
interface TimelionSetupContract {
|
||||
uiEnabled: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents Features Plugin instance that will be managed by the Kibana plugin system.
|
||||
*/
|
||||
|
@ -93,19 +89,13 @@ export class FeaturesPlugin
|
|||
Plugin<RecursiveReadonly<PluginSetupContract>, RecursiveReadonly<PluginStartContract>> {
|
||||
private readonly logger: Logger;
|
||||
private readonly featureRegistry: FeatureRegistry = new FeatureRegistry();
|
||||
private isTimelionEnabled: boolean = false;
|
||||
private isReportingEnabled: boolean = false;
|
||||
|
||||
constructor(private readonly initializerContext: PluginInitializerContext) {
|
||||
this.logger = this.initializerContext.logger.get();
|
||||
}
|
||||
|
||||
public setup(
|
||||
core: CoreSetup,
|
||||
{ visTypeTimelion }: { visTypeTimelion?: TimelionSetupContract }
|
||||
): RecursiveReadonly<PluginSetupContract> {
|
||||
this.isTimelionEnabled = visTypeTimelion !== undefined && visTypeTimelion.uiEnabled;
|
||||
|
||||
public setup(core: CoreSetup): RecursiveReadonly<PluginSetupContract> {
|
||||
defineRoutes({
|
||||
router: core.http.createRouter(),
|
||||
featureRegistry: this.featureRegistry,
|
||||
|
@ -160,14 +150,8 @@ export class FeaturesPlugin
|
|||
new Set([...savedObjectVisibleTypes, ...savedObjectImportableAndExportableHiddenTypes])
|
||||
);
|
||||
|
||||
this.logger.debug(
|
||||
`Registering OSS features with SO types: ${savedObjectTypes.join(', ')}. "includeTimelion": ${
|
||||
this.isTimelionEnabled
|
||||
}.`
|
||||
);
|
||||
const features = buildOSSFeatures({
|
||||
savedObjectTypes,
|
||||
includeTimelion: this.isTimelionEnabled,
|
||||
includeReporting: this.isReportingEnabled,
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue