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

Migrate vis_type_table to kibana/new platform #63105

Merged
Merged
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/src/legacy/core_plugins/kibana/public/dev_tools/ @elastic/kibana-app
/src/legacy/core_plugins/vis_type_vislib/ @elastic/kibana-app
/src/plugins/vis_type_xy/ @elastic/kibana-app
/src/plugins/vis_type_table/ @elastic/kibana-app
/src/plugins/kibana_legacy/ @elastic/kibana-app
/src/plugins/vis_type_timelion/ @elastic/kibana-app
/src/plugins/dashboard/ @elastic/kibana-app
Expand Down
2 changes: 1 addition & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"visDefaultEditor": "src/plugins/vis_default_editor",
"visTypeMarkdown": "src/plugins/vis_type_markdown",
"visTypeMetric": "src/plugins/vis_type_metric",
"visTypeTable": "src/legacy/core_plugins/vis_type_table",
"visTypeTable": "src/plugins/vis_type_table",
"visTypeTagCloud": "src/legacy/core_plugins/vis_type_tagcloud",
"visTypeTimeseries": ["src/legacy/core_plugins/vis_type_timeseries", "src/plugins/vis_type_timeseries"],
"visTypeVega": "src/legacy/core_plugins/vis_type_vega",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,27 @@ import moment from 'moment';
import ngMock from 'ng_mock';
import expect from '@kbn/expect';
import sinon from 'sinon';
import { npStart } from '../../legacy_imports';
import './legacy';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { npStart } from 'ui/new_platform';
import { round } from 'lodash';
import { getAngularModule } from '../../get_inner_angular';
import { initTableVisLegacyModule } from '../../table_vis_legacy_module';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { getInnerAngular } from '../../../../../../plugins/vis_type_table/public/get_inner_angular';

// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { initTableVisLegacyModule } from '../../../../../../plugins/vis_type_table/public/table_vis_legacy_module';
import { tabifiedData } from './tabified_data';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { configureAppAngularModule } from '../../../../../../plugins/kibana_legacy/public/angular';

describe('Table Vis - AggTable Directive', function() {
let $rootScope;
let $compile;
let settings;

const initLocalAngular = () => {
const tableVisModule = getAngularModule('kibana/table_vis', npStart.core);
const tableVisModule = getInnerAngular('kibana/table_vis', npStart.core);
configureAppAngularModule(tableVisModule, npStart.core, true);
initTableVisLegacyModule(tableVisModule);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,24 @@
import $ from 'jquery';
import ngMock from 'ng_mock';
import expect from '@kbn/expect';
import { npStart } from '../../legacy_imports';
import { getAngularModule } from '../../get_inner_angular';
import { initTableVisLegacyModule } from '../../table_vis_legacy_module';
import './legacy';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { getInnerAngular } from '../../../../../../plugins/vis_type_table/public/get_inner_angular';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { initTableVisLegacyModule } from '../../../../../../plugins/vis_type_table/public/table_vis_legacy_module';
import { tabifiedData } from './tabified_data';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { npStart } from 'ui/new_platform';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { configureAppAngularModule } from '../../../../../../plugins/kibana_legacy/public/angular';

describe('Table Vis - AggTableGroup Directive', function() {
let $rootScope;
let $compile;

const initLocalAngular = () => {
const tableVisModule = getAngularModule('kibana/table_vis', npStart.core);
const tableVisModule = getInnerAngular('kibana/table_vis', npStart.core);
configureAppAngularModule(tableVisModule, npStart.core, true);
initTableVisLegacyModule(tableVisModule);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,23 @@
* specific language governing permissions and limitations
* under the License.
*/

import { PluginInitializerContext } from 'kibana/public';
import { npSetup, npStart } from './legacy_imports';
import { plugin } from '.';

import { TablePluginSetupDependencies } from './plugin';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { npStart, npSetup } from 'ui/new_platform';
import {
TableVisPlugin,
TablePluginSetupDependencies,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../../../../../plugins/vis_type_table/public/plugin';

const plugins: Readonly<TablePluginSetupDependencies> = {
expressions: npSetup.plugins.expressions,
visualizations: npSetup.plugins.visualizations,
};

const pluginInstance = plugin({} as PluginInitializerContext);
const pluginInstance = new TableVisPlugin({} as PluginInitializerContext);

export const setup = pluginInstance.setup(npSetup.core, plugins);
export const start = pluginInstance.start(npStart.core, { data: npStart.plugins.data });
export const start = pluginInstance.start(npStart.core, {
data: npStart.plugins.data,
});
44 changes: 0 additions & 44 deletions src/legacy/core_plugins/vis_type_table/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/legacy/core_plugins/vis_type_table/package.json

This file was deleted.

This file was deleted.

This file was deleted.

98 changes: 0 additions & 98 deletions src/legacy/core_plugins/vis_type_table/public/table_vis_type.ts

This file was deleted.

104 changes: 0 additions & 104 deletions src/legacy/core_plugins/vis_type_table/public/vis_controller.ts

This file was deleted.

6 changes: 3 additions & 3 deletions src/plugins/kibana_legacy/public/angular/angular_config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ export const configureAppAngularModule = (
) => {
const core = 'core' in newPlatform ? newPlatform.core : newPlatform;
const packageInfo =
'injectedMetadata' in newPlatform
? newPlatform.injectedMetadata.getLegacyMetadata()
: newPlatform.env.packageInfo;
'env' in newPlatform
? newPlatform.env.packageInfo
: newPlatform.injectedMetadata.getLegacyMetadata();

if ('injectedMetadata' in newPlatform) {
forOwn(newPlatform.injectedMetadata.getInjectedVars(), (val, name) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,10 @@
* under the License.
*/

export { npSetup, npStart } from 'ui/new_platform';
import { schema, TypeOf } from '@kbn/config-schema';

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

export type ConfigSchema = TypeOf<typeof configSchema>;
Loading