-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Canvas] Enable Embeddable maps #53971
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ab536d7
Enables Embeddable maps in Canvas. Updates expressions as maps are in…
c1afa2e
Merge branch 'master' into embeddable-maps
elasticmachine 473876c
Fix type check errors
9308223
Merge branch 'master' into embeddable-maps
elasticmachine e23a7ac
Update imports. Remove filters from initial embed expressions
4998db2
Merge branch 'master' into embeddable-maps
elasticmachine 99922ca
Adds hide layer functionality to canvas map embeds
7ed2f38
Fix typecheck error
de7b39d
Fix Type check
a700ba0
Merge branch 'master' into embeddable-maps
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,7 +9,7 @@ import { MAP_SAVED_OBJECT_TYPE } from '../../../maps/common/constants'; | |||||||||
| import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../../../src/legacy/core_plugins/kibana/public/visualize_embeddable/constants'; | ||||||||||
| import { SEARCH_EMBEDDABLE_TYPE } from '../../../../../../src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/constants'; | ||||||||||
|
|
||||||||||
| export const EmbeddableTypes = { | ||||||||||
| export const EmbeddableTypes: Record<string, string> = { | ||||||||||
|
||||||||||
| export const EmbeddableTypes: Record<string, string> = { | |
| export const EmbeddableTypes: Record<string, string | undefined> = { |
or
Suggested change
| export const EmbeddableTypes: Record<string, string> = { | |
| export const EmbeddableTypes: { map: string, search: string, visualization: string } = { |
This file contains hidden or 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
50 changes: 50 additions & 0 deletions
50
x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/map_center.ts
This file contains hidden or 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,50 @@ | ||
| /* | ||
| * 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 { ExpressionFunction } from 'src/plugins/expressions/common'; | ||
| import { getFunctionHelp } from '../../../i18n/functions'; | ||
| import { MapCenter } from '../../../types'; | ||
|
|
||
| interface Args { | ||
| lat: number; | ||
| lon: number; | ||
| zoom: number; | ||
| } | ||
|
|
||
| export function mapCenter(): ExpressionFunction<'mapCenter', null, Args, MapCenter> { | ||
| const { help, args: argHelp } = getFunctionHelp().mapCenter; | ||
| return { | ||
| name: 'mapCenter', | ||
| help, | ||
| type: 'mapCenter', | ||
| context: { | ||
| types: ['null'], | ||
| }, | ||
| args: { | ||
| lat: { | ||
| types: ['number'], | ||
| required: true, | ||
| help: argHelp.lat, | ||
| }, | ||
| lon: { | ||
| types: ['number'], | ||
| required: true, | ||
| help: argHelp.lon, | ||
| }, | ||
| zoom: { | ||
| types: ['number'], | ||
| required: true, | ||
| help: argHelp.zoom, | ||
| }, | ||
| }, | ||
| fn: (context, args) => { | ||
| return { | ||
| type: 'mapCenter', | ||
| ...args, | ||
| }; | ||
| }, | ||
| }; | ||
| } |
This file contains hidden or 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 hidden or 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
44 changes: 44 additions & 0 deletions
44
x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/time_range.ts
This file contains hidden or 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,44 @@ | ||
| /* | ||
| * 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 { ExpressionFunction } from 'src/plugins/expressions/common'; | ||
| import { getFunctionHelp } from '../../../i18n/functions'; | ||
| import { TimeRange } from '../../../types'; | ||
|
|
||
| interface Args { | ||
| from: string; | ||
| to: string; | ||
| } | ||
|
|
||
| export function timerange(): ExpressionFunction<'timerange', null, Args, TimeRange> { | ||
| const { help, args: argHelp } = getFunctionHelp().timerange; | ||
| return { | ||
| name: 'timerange', | ||
| help, | ||
| type: 'timerange', | ||
| context: { | ||
| types: ['null'], | ||
| }, | ||
| args: { | ||
| from: { | ||
| types: ['string'], | ||
| required: true, | ||
| help: argHelp.from, | ||
| }, | ||
| to: { | ||
| types: ['string'], | ||
| required: true, | ||
| help: argHelp.to, | ||
| }, | ||
| }, | ||
| fn: (context, args) => { | ||
| return { | ||
| type: 'timerange', | ||
| ...args, | ||
| }; | ||
| }, | ||
| }; | ||
| } |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Embeddables are in the New Platform, you can import everything from there.