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 graph_workspace saved object registration to Kibana platform #64157

Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ export const TEMPORARILY_IGNORED_PATHS = [
'webpackShims/elasticsearch-browser.js',
'webpackShims/moment-timezone.js',
'webpackShims/ui-bootstrap.js',
'x-pack/legacy/plugins/graph/public/graphClientWorkspace.js',
'x-pack/legacy/plugins/graph/public/angular-venn-simple.js',
'x-pack/legacy/plugins/index_management/public/lib/editSettings.js',
'x-pack/legacy/plugins/license_management/public/store/reducers/licenseManagement.js',
'x-pack/legacy/plugins/monitoring/public/components/sparkline/__mocks__/plugins/xpack_main/jquery_flot.js',
Expand Down
2 changes: 1 addition & 1 deletion x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"xpack.endpoint": "plugins/endpoint",
"xpack.features": "plugins/features",
"xpack.fileUpload": "plugins/file_upload",
"xpack.graph": ["legacy/plugins/graph", "plugins/graph"],
"xpack.graph": ["plugins/graph"],
"xpack.grokDebugger": "plugins/grokdebugger",
"xpack.idxMgmt": "plugins/index_management",
"xpack.indexLifecycleMgmt": "plugins/index_lifecycle_management",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

import { xpackMain } from './legacy/plugins/xpack_main';
import { graph } from './legacy/plugins/graph';
import { monitoring } from './legacy/plugins/monitoring';
import { reporting } from './legacy/plugins/reporting';
import { security } from './legacy/plugins/security';
Expand All @@ -32,7 +31,6 @@ import { triggersActionsUI } from './legacy/plugins/triggers_actions_ui';
module.exports = function(kibana) {
return [
xpackMain(kibana),
graph(kibana),
monitoring(kibana),
reporting(kibana),
spaces(kibana),
Expand Down
32 changes: 0 additions & 32 deletions x-pack/legacy/plugins/graph/index.ts

This file was deleted.

31 changes: 0 additions & 31 deletions x-pack/legacy/plugins/graph/mappings.json

This file was deleted.

41 changes: 0 additions & 41 deletions x-pack/legacy/plugins/graph/migrations.js

This file was deleted.

102 changes: 0 additions & 102 deletions x-pack/legacy/plugins/graph/migrations.test.js

This file was deleted.

2 changes: 2 additions & 0 deletions x-pack/plugins/graph/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { registerExploreRoute } from './routes/explore';
import { HomeServerPluginSetup } from '../../../../src/plugins/home/server';
import { registerSampleData } from './sample_data';
import { PluginSetupContract as FeaturesPluginSetup } from '../../features/server';
import { graphWorkspace } from './saved_objects';

export class GraphPlugin implements Plugin {
private licenseState: LicenseState | null = null;
Expand All @@ -32,6 +33,7 @@ export class GraphPlugin implements Plugin {
const licenseState = new LicenseState();
licenseState.start(licensing.license$);
this.licenseState = licenseState;
core.savedObjects.registerType(graphWorkspace);

if (home) {
registerSampleData(home.sampleData, licenseState);
Expand Down
43 changes: 43 additions & 0 deletions x-pack/plugins/graph/server/saved_objects/graph_workspace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { SavedObjectsType } from 'kibana/server';
import { graphMigrations } from './migrations';

export const graphWorkspace: SavedObjectsType = {
name: 'graph-workspace',
namespaceType: 'single',
hidden: false,
migrations: graphMigrations,
mappings: {
properties: {
description: {
type: 'text',
},
kibanaSavedObjectMeta: {
properties: {
searchSourceJSON: {
type: 'text',
},
},
},
numLinks: {
type: 'integer',
},
numVertices: {
type: 'integer',
},
title: {
type: 'text',
},
version: {
type: 'integer',
},
wsState: {
type: 'text',
},
},
},
};
6 changes: 6 additions & 0 deletions x-pack/plugins/graph/server/saved_objects/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
export { graphWorkspace } from './graph_workspace';
Loading