Skip to content

Commit

Permalink
Removing the lens feature, using visualize instead (elastic#48041) (e…
Browse files Browse the repository at this point in the history
…lastic#48272)

* 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
  • Loading branch information
kobelb authored Oct 15, 2019
1 parent 82fc260 commit fd9f4a4
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 36 deletions.
27 changes: 0 additions & 27 deletions x-pack/legacy/plugins/lens/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,6 @@ export const lens: LegacyPluginInitializer = kibana => {
init(server: Server) {
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.
const plugin = lensServerPlugin();
plugin.setup(kbnServer.newPlatform.setup.core, {
Expand Down
6 changes: 3 additions & 3 deletions x-pack/legacy/plugins/lens/public/app_plugin/app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('Lens App', () => {
...core.application,
capabilities: {
...core.application.capabilities,
lens: { save: true, saveQuery: true, show: true },
visualize: { save: true, saveQuery: true, show: true },
},
},
},
Expand Down Expand Up @@ -302,7 +302,7 @@ describe('Lens App', () => {
...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;
Expand Down Expand Up @@ -520,7 +520,7 @@ describe('Lens App', () => {
...args.core.application,
capabilities: {
...args.core.application.capabilities,
lens: { save: false, saveQuery: false, show: true },
visualize: { save: false, saveQuery: false, show: true },
},
};

Expand Down
4 changes: 2 additions & 2 deletions x-pack/legacy/plugins/lens/public/app_plugin/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function App({
// Can save if the frame has told us what it has, and there is either:
// a) No saved doc
// 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(
(e: { message: string }) =>
Expand Down Expand Up @@ -229,7 +229,7 @@ export function App({
showDatePicker={true}
showQueryBar={true}
showFilterBar={true}
showSaveQuery={core.application.capabilities.lens.saveQuery as boolean}
showSaveQuery={core.application.capabilities.visualize.saveQuery as boolean}
savedQuery={state.savedQuery}
onSaved={savedQuery => {
setState(s => ({ ...s, savedQuery }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class EmbeddableFactory extends AbstractEmbeddableFactory {
}

public isEditable() {
return capabilities.get().lens.save as boolean;
return capabilities.get().visualize.save as boolean;
}

canCreateNew() {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/features/server/oss_features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const buildOSSFeatures = ({ savedObjectTypes, includeTimelion }: BuildOSS
}),
icon: 'visualizeApp',
navLinkId: 'kibana:visualize',
app: ['kibana'],
app: ['kibana', 'lens'],
catalogue: ['visualize'],
privileges: {
all: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ export default function({ getService }: FtrProviderContext) {
'canvas',
'code',
'infrastructure',
'lens',
'logs',
'maps',
'uptime',
Expand Down
1 change: 0 additions & 1 deletion x-pack/test/api_integration/apis/security/privileges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export default function({ getService }: FtrProviderContext) {
apm: ['all', 'read'],
siem: ['all', 'read'],
code: ['all', 'read'],
lens: ['all', 'read'],
},
global: ['all', 'read'],
space: ['all', 'read'],
Expand Down

0 comments on commit fd9f4a4

Please sign in to comment.