Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy data table #111339

Merged
merged 9 commits into from
Sep 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[Datatable] Removes the angular implementation
stratoula committed Sep 7, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 6c5f91e769ba6090b7a9f08354a58b42c264febd
7 changes: 1 addition & 6 deletions src/plugins/vis_type_table/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
Contains the data table visualization, that allows presenting data in a simple table format.

By default a new version of visualization will be used. To use the previous version of visualization the config must have the `vis_type_table.legacyVisEnabled: true` setting
configured in `kibana.dev.yml` or `kibana.yml`, as shown in the example below:

```yaml
vis_type_table.legacyVisEnabled: true
```
Aggregation-based datatable visualizations uses EuiDataGrid component.
5 changes: 1 addition & 4 deletions src/plugins/vis_type_table/common/index.ts
Original file line number Diff line number Diff line change
@@ -6,7 +6,4 @@
* Side Public License, v 1.
*/

// TODO: https://github.com/elastic/kibana/issues/110891
/* eslint-disable @kbn/eslint/no_export_all */

export * from './types';
export { AggTypes, TableVisParams, VIS_TYPE_TABLE } from './types';
1 change: 0 additions & 1 deletion src/plugins/vis_type_table/config.ts
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ import { schema, TypeOf } from '@kbn/config-schema';

export const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
legacyVisEnabled: schema.boolean({ defaultValue: false }),
});

export type ConfigSchema = TypeOf<typeof configSchema>;

This file was deleted.

25 changes: 0 additions & 25 deletions src/plugins/vis_type_table/public/legacy/_table_vis.scss

This file was deleted.

42 changes: 0 additions & 42 deletions src/plugins/vis_type_table/public/legacy/agg_table/_agg_table.scss

This file was deleted.

This file was deleted.

34 changes: 0 additions & 34 deletions src/plugins/vis_type_table/public/legacy/agg_table/agg_table.html

This file was deleted.

253 changes: 0 additions & 253 deletions src/plugins/vis_type_table/public/legacy/agg_table/agg_table.js

This file was deleted.

488 changes: 0 additions & 488 deletions src/plugins/vis_type_table/public/legacy/agg_table/agg_table.test.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

784 changes: 0 additions & 784 deletions src/plugins/vis_type_table/public/legacy/agg_table/tabified_data.js

This file was deleted.

88 changes: 0 additions & 88 deletions src/plugins/vis_type_table/public/legacy/get_inner_angular.ts

This file was deleted.

10 changes: 0 additions & 10 deletions src/plugins/vis_type_table/public/legacy/index.scss

This file was deleted.

9 changes: 0 additions & 9 deletions src/plugins/vis_type_table/public/legacy/index.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

130 changes: 0 additions & 130 deletions src/plugins/vis_type_table/public/legacy/paginated_table/rows.js

This file was deleted.

This file was deleted.

26 changes: 0 additions & 26 deletions src/plugins/vis_type_table/public/legacy/register_legacy_vis.ts

This file was deleted.

29 changes: 0 additions & 29 deletions src/plugins/vis_type_table/public/legacy/table_vis.html

This file was deleted.

45 changes: 0 additions & 45 deletions src/plugins/vis_type_table/public/legacy/table_vis_controller.js

This file was deleted.

245 changes: 0 additions & 245 deletions src/plugins/vis_type_table/public/legacy/table_vis_controller.test.ts

This file was deleted.

This file was deleted.

62 changes: 0 additions & 62 deletions src/plugins/vis_type_table/public/legacy/table_vis_legacy_fn.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

85 changes: 0 additions & 85 deletions src/plugins/vis_type_table/public/legacy/table_vis_legacy_type.ts

This file was deleted.

70 changes: 0 additions & 70 deletions src/plugins/vis_type_table/public/legacy/to_ast_legacy.ts

This file was deleted.

121 changes: 0 additions & 121 deletions src/plugins/vis_type_table/public/legacy/vis_controller.ts

This file was deleted.

32 changes: 5 additions & 27 deletions src/plugins/vis_type_table/public/plugin.ts
Original file line number Diff line number Diff line change
@@ -6,18 +6,14 @@
* Side Public License, v 1.
*/

import { PluginInitializerContext, CoreSetup, CoreStart, AsyncPlugin } from 'kibana/public';
import { CoreSetup, CoreStart, Plugin } from 'kibana/public';
import { Plugin as ExpressionsPublicPlugin } from '../../expressions/public';
import { VisualizationsSetup } from '../../visualizations/public';
import { UsageCollectionSetup } from '../../usage_collection/public';

import { DataPublicPluginStart } from '../../data/public';
import { setFormatService } from './services';
import { KibanaLegacyStart } from '../../kibana_legacy/public';

interface ClientConfigType {
legacyVisEnabled: boolean;
}
import { registerTableVis } from './register_vis';

/** @internal */
export interface TablePluginSetupDependencies {
@@ -29,31 +25,13 @@ export interface TablePluginSetupDependencies {
/** @internal */
export interface TablePluginStartDependencies {
data: DataPublicPluginStart;
kibanaLegacy: KibanaLegacyStart;
}

/** @internal */
export class TableVisPlugin
implements AsyncPlugin<void, void, TablePluginSetupDependencies, TablePluginStartDependencies> {
initializerContext: PluginInitializerContext<ClientConfigType>;

constructor(initializerContext: PluginInitializerContext) {
this.initializerContext = initializerContext;
}

public async setup(
core: CoreSetup<TablePluginStartDependencies>,
deps: TablePluginSetupDependencies
) {
const { legacyVisEnabled } = this.initializerContext.config.get();

if (legacyVisEnabled) {
const { registerLegacyVis } = await import('./legacy');
registerLegacyVis(core, deps, this.initializerContext);
} else {
const { registerTableVis } = await import('./register_vis');
registerTableVis(core, deps, this.initializerContext);
}
implements Plugin<void, void, TablePluginSetupDependencies, TablePluginStartDependencies> {
public setup(core: CoreSetup<TablePluginStartDependencies>, deps: TablePluginSetupDependencies) {
registerTableVis(core, deps);
}

public start(core: CoreStart, { data }: TablePluginStartDependencies) {
6 changes: 2 additions & 4 deletions src/plugins/vis_type_table/public/register_vis.ts
Original file line number Diff line number Diff line change
@@ -6,17 +6,15 @@
* Side Public License, v 1.
*/

import { PluginInitializerContext, CoreSetup } from 'kibana/public';

import { CoreSetup } from 'kibana/public';
import { TablePluginSetupDependencies, TablePluginStartDependencies } from './plugin';
import { createTableVisFn } from './table_vis_fn';
import { getTableVisRenderer } from './table_vis_renderer';
import { tableVisTypeDefinition } from './table_vis_type';

export const registerTableVis = async (
core: CoreSetup<TablePluginStartDependencies>,
{ expressions, visualizations }: TablePluginSetupDependencies,
context: PluginInitializerContext
{ expressions, visualizations }: TablePluginSetupDependencies
) => {
const [coreStart] = await core.getStartServices();
expressions.registerFunction(createTableVisFn);
3 changes: 0 additions & 3 deletions src/plugins/vis_type_table/server/index.ts
Original file line number Diff line number Diff line change
@@ -13,9 +13,6 @@ import { configSchema, ConfigSchema } from '../config';
import { registerVisTypeTableUsageCollector } from './usage_collector';

export const config: PluginConfigDescriptor<ConfigSchema> = {
exposeToBrowser: {
legacyVisEnabled: true,
},
schema: configSchema,
deprecations: ({ renameFromRoot }) => [
renameFromRoot('table_vis.enabled', 'vis_type_table.enabled'),
5 changes: 1 addition & 4 deletions test/functional/config.legacy.ts
Original file line number Diff line number Diff line change
@@ -19,10 +19,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {

kbnTestServer: {
...defaultConfig.get('kbnTestServer'),
serverArgs: [
...defaultConfig.get('kbnTestServer.serverArgs'),
'--vis_type_table.legacyVisEnabled=true',
],
serverArgs: [...defaultConfig.get('kbnTestServer.serverArgs')],
},
};
}