-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move lens saved object setup to Kibana platform (#61157)
- Loading branch information
Tim Roes
authored
Mar 25, 2020
1 parent
11bcfae
commit b8e3ccb
Showing
4 changed files
with
68 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* 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 } from 'kibana/server'; | ||
import { getEditPath } from '../common'; | ||
|
||
export function setupSavedObjects(core: CoreSetup) { | ||
core.savedObjects.registerType({ | ||
name: 'lens', | ||
hidden: false, | ||
namespaceAgnostic: false, | ||
management: { | ||
icon: 'lensApp', | ||
defaultSearchField: 'title', | ||
importableAndExportable: true, | ||
getTitle: (obj: { attributes: { title: string } }) => obj.attributes.title, | ||
getInAppUrl: (obj: { id: string }) => ({ | ||
path: getEditPath(obj.id), | ||
uiCapabilitiesPath: 'visualize.show', | ||
}), | ||
}, | ||
mappings: { | ||
properties: { | ||
title: { | ||
type: 'text', | ||
}, | ||
visualizationType: { | ||
type: 'keyword', | ||
}, | ||
state: { | ||
type: 'flattened', | ||
}, | ||
expression: { | ||
index: false, | ||
type: 'keyword', | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
core.savedObjects.registerType({ | ||
name: 'lens-ui-telemetry', | ||
hidden: false, | ||
namespaceAgnostic: false, | ||
mappings: { | ||
properties: { | ||
name: { | ||
type: 'keyword', | ||
}, | ||
type: { | ||
type: 'keyword', | ||
}, | ||
date: { | ||
type: 'date', | ||
}, | ||
count: { | ||
type: 'integer', | ||
}, | ||
}, | ||
}, | ||
}); | ||
} |