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

Removing the lens feature, using visualize instead #48041

Merged
merged 7 commits into from
Oct 15, 2019
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
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'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically unrelated to your changeset, but should the dashboard feature privileges also grant read access to the lens saved object type, like we do for timelion-sheet today?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wylieconlon can Lens visualizations currently be "embedded" in Dashboards?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if Lens can be "embedded" in Dashboards, I'd prefer this separate bug be addressed in another PR.

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