Removing the lens feature, using visualize instead (#48041)

* Removing the lens feature, using visualize instead

* Updating /api/features test because lens isn't a feature anymore

* Updating capability from lens to visualize in test

* Fixing api integration test
This commit is contained in:
Brandon Kobel 2019-10-15 12:03:12 -07:00 committed by GitHub
parent 549b0792af
commit 21841f6ff8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 36 deletions

View file

@ -54,33 +54,6 @@ export const lens: LegacyPluginInitializer = kibana => {
init(server: Server) { init(server: Server) {
const kbnServer = (server as unknown) as KbnServer; const kbnServer = (server as unknown) as KbnServer;
server.plugins.xpack_main.registerFeature({
id: PLUGIN_ID,
name: NOT_INTERNATIONALIZED_PRODUCT_NAME,
app: [PLUGIN_ID, 'kibana'],
catalogue: [PLUGIN_ID],
privileges: {
all: {
api: [PLUGIN_ID],
catalogue: [PLUGIN_ID],
savedObject: {
all: ['search'],
read: ['index-pattern'],
},
ui: ['save', 'show', 'saveQuery'],
},
read: {
api: [PLUGIN_ID],
catalogue: [PLUGIN_ID],
savedObject: {
all: [],
read: ['index-pattern'],
},
ui: ['show'],
},
},
});
// Set up with the new platform plugin lifecycle API. // Set up with the new platform plugin lifecycle API.
const plugin = lensServerPlugin(); const plugin = lensServerPlugin();
plugin.setup(kbnServer.newPlatform.setup.core, { plugin.setup(kbnServer.newPlatform.setup.core, {

View file

@ -88,7 +88,7 @@ describe('Lens App', () => {
...core.application, ...core.application,
capabilities: { capabilities: {
...core.application.capabilities, ...core.application.capabilities,
lens: { save: true, saveQuery: true, show: true }, visualize: { save: true, saveQuery: true, show: true },
}, },
}, },
}, },
@ -302,7 +302,7 @@ describe('Lens App', () => {
...args.core.application, ...args.core.application,
capabilities: { capabilities: {
...args.core.application.capabilities, ...args.core.application.capabilities,
lens: { save: false, saveQuery: false, show: true }, visualize: { save: false, saveQuery: false, show: true },
}, },
}; };
args.editorFrame = frame; args.editorFrame = frame;
@ -520,7 +520,7 @@ describe('Lens App', () => {
...args.core.application, ...args.core.application,
capabilities: { capabilities: {
...args.core.application.capabilities, ...args.core.application.capabilities,
lens: { save: false, saveQuery: false, show: true }, visualize: { save: false, saveQuery: false, show: true },
}, },
}; };

View file

@ -153,7 +153,7 @@ export function App({
// Can save if the frame has told us what it has, and there is either: // Can save if the frame has told us what it has, and there is either:
// a) No saved doc // a) No saved doc
// b) A saved doc that differs from the frame state // b) A saved doc that differs from the frame state
const isSaveable = state.isDirty && (core.application.capabilities.lens.save as boolean); const isSaveable = state.isDirty && (core.application.capabilities.visualize.save as boolean);
const onError = useCallback( const onError = useCallback(
(e: { message: string }) => (e: { message: string }) =>
@ -229,7 +229,7 @@ export function App({
showDatePicker={true} showDatePicker={true}
showQueryBar={true} showQueryBar={true}
showFilterBar={true} showFilterBar={true}
showSaveQuery={core.application.capabilities.lens.saveQuery as boolean} showSaveQuery={core.application.capabilities.visualize.saveQuery as boolean}
savedQuery={state.savedQuery} savedQuery={state.savedQuery}
onSaved={savedQuery => { onSaved={savedQuery => {
setState(s => ({ ...s, savedQuery })); setState(s => ({ ...s, savedQuery }));

View file

@ -48,7 +48,7 @@ export class EmbeddableFactory extends AbstractEmbeddableFactory {
} }
public isEditable() { public isEditable() {
return capabilities.get().lens.save as boolean; return capabilities.get().visualize.save as boolean;
} }
canCreateNew() { canCreateNew() {

View file

@ -46,7 +46,7 @@ export const buildOSSFeatures = ({ savedObjectTypes, includeTimelion }: BuildOSS
}), }),
icon: 'visualizeApp', icon: 'visualizeApp',
navLinkId: 'kibana:visualize', navLinkId: 'kibana:visualize',
app: ['kibana'], app: ['kibana', 'lens'],
catalogue: ['visualize'], catalogue: ['visualize'],
privileges: { privileges: {
all: { all: {

View file

@ -112,7 +112,6 @@ export default function({ getService }: FtrProviderContext) {
'canvas', 'canvas',
'code', 'code',
'infrastructure', 'infrastructure',
'lens',
'logs', 'logs',
'maps', 'maps',
'uptime', 'uptime',

View file

@ -38,7 +38,6 @@ export default function({ getService }: FtrProviderContext) {
apm: ['all', 'read'], apm: ['all', 'read'],
siem: ['all', 'read'], siem: ['all', 'read'],
code: ['all', 'read'], code: ['all', 'read'],
lens: ['all', 'read'],
}, },
global: ['all', 'read'], global: ['all', 'read'],
space: ['all', 'read'], space: ['all', 'read'],