-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
don't register any features in LP. #65611
Changes from 9 commits
a532afe
db1a8d0
4322802
fff1728
13efac5
8a6784f
476d1de
a929c5b
4213638
6702a47
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
fields?: { | ||
[subfield: string]: { | ||
type: string; | ||
ignore_above?: number; | ||
}; | ||
}; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,8 +22,7 @@ export function setupXPackMain(server) { | |
|
||
server.ext('onPreResponse', (request, h) => injectXPackInfoSignature(info, request, h)); | ||
|
||
const { registerFeature, getFeatures } = server.newPlatform.setup.plugins.features; | ||
server.expose('registerFeature', registerFeature); | ||
const { getFeatures } = server.newPlatform.setup.plugins.features; | ||
server.expose('getFeatures', getFeatures); | ||
Comment on lines
-25
to
26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are 3rd party plugins meant to be used with a licensed version of Kibana supposed to be able to use x-pack features/apis? If so, should we add a dev doc or anything to warn that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, I will do. just in case |
||
|
||
const setPluginStatus = () => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* 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 { i18n } from '@kbn/i18n'; | ||
import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from 'src/core/server'; | ||
import { PluginSetupContract as FeaturesPluginSetupContract } from '../../features/server'; | ||
|
||
import { APP_ID, APP_ICON, MAP_SAVED_OBJECT_TYPE } from '../common/constants'; | ||
|
||
interface SetupDeps { | ||
features: FeaturesPluginSetupContract; | ||
} | ||
|
||
export class MapsPlugin implements Plugin { | ||
constructor(initializerContext: PluginInitializerContext) {} | ||
setup(core: CoreSetup, plugins: SetupDeps) { | ||
plugins.features.registerFeature({ | ||
id: APP_ID, | ||
name: i18n.translate('xpack.maps.featureRegistry.mapsFeatureName', { | ||
defaultMessage: 'Maps', | ||
}), | ||
order: 600, | ||
icon: APP_ICON, | ||
navLinkId: APP_ID, | ||
app: [APP_ID, 'kibana'], | ||
catalogue: [APP_ID], | ||
privileges: { | ||
all: { | ||
app: [APP_ID, 'kibana'], | ||
catalogue: [APP_ID], | ||
savedObject: { | ||
all: [MAP_SAVED_OBJECT_TYPE, 'query'], | ||
read: ['index-pattern'], | ||
}, | ||
ui: ['save', 'show', 'saveQuery'], | ||
}, | ||
read: { | ||
app: [APP_ID, 'kibana'], | ||
catalogue: [APP_ID], | ||
savedObject: { | ||
all: [], | ||
read: [MAP_SAVED_OBJECT_TYPE, 'index-pattern', 'query'], | ||
}, | ||
ui: ['show'], | ||
}, | ||
}, | ||
}); | ||
} | ||
start(core: CoreStart) {} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"id": "namespace_agnostic_type_plugin", | ||
"version": "1.0.0", | ||
"kibanaVersion": "kibana", | ||
"requiredPlugins": ["features"], | ||
"server": true, | ||
"ui": false | ||
} |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* 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 { CoreSetup, Plugin } from 'src/core/server'; | ||
import { PluginSetupContract as FeaturesPluginSetupContract } from '../../../../../../plugins/features/server'; | ||
|
||
export const plugin = () => new NamespaceAgnosticTypePlugin(); | ||
|
||
interface SetupDeps { | ||
features: FeaturesPluginSetupContract; | ||
} | ||
|
||
class NamespaceAgnosticTypePlugin implements Plugin { | ||
setup(core: CoreSetup, plugins: SetupDeps) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @elastic/kibana-platform that's another big thing to get rid of LP: to make all tests KP-compatible. we should have done it as a part of the plugin migration effort 😅 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. Even if they are small, there is a lot of test legacy plugins we will still need to migrate to get rid of legacy... |
||
core.savedObjects.registerType({ | ||
name: 'globaltype', | ||
hidden: false, | ||
namespaceType: 'agnostic', | ||
management: { | ||
importableAndExportable: true, | ||
}, | ||
mappings: { | ||
properties: { | ||
title: { | ||
type: 'text', | ||
fields: { | ||
keyword: { | ||
type: 'keyword', | ||
ignore_above: 2048, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
plugins.features.registerFeature({ | ||
id: 'namespace_agnostic_type_plugin', | ||
name: 'namespace_agnostic_type_plugin', | ||
icon: 'upArrow', | ||
navLinkId: 'namespace_agnostic_type_plugin', | ||
app: [], | ||
privileges: { | ||
all: { | ||
savedObject: { | ||
all: ['globaltype'], | ||
read: [], | ||
}, | ||
ui: [], | ||
}, | ||
read: { | ||
savedObject: { | ||
all: [], | ||
read: ['globaltype'], | ||
}, | ||
ui: [], | ||
}, | ||
}, | ||
}); | ||
} | ||
start() {} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"id": "foo_plugin", | ||
"version": "1.0.0", | ||
"kibanaVersion": "kibana", | ||
"requiredPlugins": ["features"], | ||
"server": true, | ||
"ui": true | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be only used in a test plugin and could probably be removed from the mapping instead (even if I did not try to launch the test suite with the mapping modified). But I guess it doesn't hurt to still add it.