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] add drilldown support map embeddable (elastic#75598)
* [Maps] add drilldown support * filter actions view * use i18n getter * remove unused changed * tslint fixes * more tslint changes * clean-up and API doc changes * update snapshots * do not show first drilldown in tooltip * add light grey line to seperate feature property rows * Improving tooltip row styles (#36) * Improving tooltip actions row styles * Removind unecessary comment * update snapshot and add functional test * switch UiActionsActionDefinition to Action and remove unneeded checks Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elizabet Oliveira <elizabet.oliveira@elastic.co>
- Loading branch information
1 parent
641a5ad
commit 1e20cd4
Showing
27 changed files
with
608 additions
and
119 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...ins/data/public/kibana-plugin-plugins-data-public.action_global_apply_filter.md
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,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ACTION\_GLOBAL\_APPLY\_FILTER](./kibana-plugin-plugins-data-public.action_global_apply_filter.md) | ||
|
||
## ACTION\_GLOBAL\_APPLY\_FILTER variable | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
ACTION_GLOBAL_APPLY_FILTER = "ACTION_GLOBAL_APPLY_FILTER" | ||
``` |
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 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
16 changes: 16 additions & 0 deletions
16
x-pack/plugins/maps/public/components/__snapshots__/geometry_filter_form.test.js.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,3 @@ | ||
.mapActionSelectIcon { | ||
margin-right: $euiSizeS; | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
@import 'action_select'; | ||
@import 'metric_editors'; | ||
@import './geometry_filter'; | ||
@import 'tooltip_selector/tooltip_selector'; |
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,87 @@ | ||
/* | ||
* 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 React, { Component } from 'react'; | ||
import { EuiFormRow, EuiSuperSelect, EuiIcon } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { ActionExecutionContext, Action } from 'src/plugins/ui_actions/public'; | ||
|
||
interface Props { | ||
value?: string; | ||
onChange: (value: string) => void; | ||
getFilterActions?: () => Promise<Action[]>; | ||
getActionContext?: () => ActionExecutionContext; | ||
} | ||
|
||
interface State { | ||
actions: Action[]; | ||
} | ||
|
||
export class ActionSelect extends Component<Props, State> { | ||
private _isMounted = false; | ||
state: State = { | ||
actions: [], | ||
}; | ||
|
||
componentDidMount() { | ||
this._isMounted = true; | ||
this._loadActions(); | ||
} | ||
|
||
componentWillUnmount() { | ||
this._isMounted = false; | ||
} | ||
|
||
async _loadActions() { | ||
if (!this.props.getFilterActions || !this.props.getActionContext) { | ||
return; | ||
} | ||
const actions = await this.props.getFilterActions(); | ||
if (this._isMounted) { | ||
this.setState({ actions }); | ||
} | ||
} | ||
|
||
render() { | ||
if (this.state.actions.length === 0 || !this.props.getActionContext) { | ||
return null; | ||
} | ||
|
||
if (this.state.actions.length === 1 && this.props.value === this.state.actions[0].id) { | ||
return null; | ||
} | ||
|
||
const actionContext = this.props.getActionContext(); | ||
const options = this.state.actions.map((action) => { | ||
const iconType = action.getIconType(actionContext); | ||
return { | ||
value: action.id, | ||
inputDisplay: ( | ||
<div> | ||
{iconType ? <EuiIcon className="mapActionSelectIcon" type={iconType} /> : null} | ||
{action.getDisplayName(actionContext)} | ||
</div> | ||
), | ||
}; | ||
}); | ||
|
||
return ( | ||
<EuiFormRow | ||
label={i18n.translate('xpack.maps.actionSelect.label', { | ||
defaultMessage: 'Action', | ||
})} | ||
display="rowCompressed" | ||
> | ||
<EuiSuperSelect | ||
compressed | ||
options={options} | ||
valueOfSelected={this.props.value ? this.props.value : ''} | ||
onChange={this.props.onChange} | ||
/> | ||
</EuiFormRow> | ||
); | ||
} | ||
} |
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
Oops, something went wrong.