forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Maps] show map saved objects in visualize listing page (elastic#87165)
* [Maps] show map saved objects in visualize listing page * tslint * tslint * tslint fixes Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
9e53880
commit d21caf2
Showing
7 changed files
with
80 additions
and
41 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 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
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
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 { i18n } from '@kbn/i18n'; | ||
import { | ||
VisualizationsSetup, | ||
VisualizationStage, | ||
} from '../../../../src/plugins/visualizations/public'; | ||
import { SavedObject } from '../../../../src/core/types/saved_objects'; | ||
import { MapSavedObject } from '../common/map_saved_object_type'; | ||
import { | ||
APP_ID, | ||
APP_ICON, | ||
APP_NAME, | ||
getEditPath, | ||
MAP_PATH, | ||
MAP_SAVED_OBJECT_TYPE, | ||
} from '../common/constants'; | ||
|
||
export function getMapsVisTypeAlias( | ||
visualizations: VisualizationsSetup, | ||
showMapVisualizationTypes: boolean | ||
) { | ||
if (!showMapVisualizationTypes) { | ||
visualizations.hideTypes(['region_map', 'tile_map']); | ||
} | ||
|
||
const appDescription = i18n.translate('xpack.maps.visTypeAlias.description', { | ||
defaultMessage: 'Create and style maps with multiple layers and indices.', | ||
}); | ||
|
||
return { | ||
aliasApp: APP_ID, | ||
aliasPath: `/${MAP_PATH}`, | ||
name: APP_ID, | ||
title: APP_NAME, | ||
description: appDescription, | ||
icon: APP_ICON, | ||
stage: 'production' as VisualizationStage, | ||
appExtensions: { | ||
visualizations: { | ||
docTypes: [MAP_SAVED_OBJECT_TYPE], | ||
searchFields: ['title^3'], | ||
toListItem(savedObject: SavedObject) { | ||
const { id, type, attributes } = savedObject as MapSavedObject; | ||
const { title, description } = attributes; | ||
return { | ||
id, | ||
title, | ||
description, | ||
editUrl: getEditPath(id), | ||
editApp: APP_ID, | ||
icon: APP_ICON, | ||
stage: 'production' as VisualizationStage, | ||
savedObjectType: type, | ||
typeTitle: APP_NAME, | ||
}; | ||
}, | ||
}, | ||
}, | ||
}; | ||
} |
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