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

[Maps] add draw filter action to layer #33686

Merged
merged 35 commits into from
May 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5c73c7c
apply patch
thomasneirynck Apr 23, 2019
b932ea6
handle single filter case
thomasneirynck Apr 23, 2019
dcdb81f
remove cruft
thomasneirynck Apr 23, 2019
c71806f
remove unused code
thomasneirynck Apr 23, 2019
47b9da7
Design edits
cchaos Apr 24, 2019
f14bc1c
Fix focus states
cchaos Apr 24, 2019
944a9f3
Merge pull request #4 from cchaos/maps/add_drawfilter/design
thomasneirynck Apr 24, 2019
cc1010a
Merge branch 'master' into maps/add_drawfilter
thomasneirynck May 1, 2019
f519a8b
simplify
thomasneirynck May 1, 2019
5ec0731
show crosshair
thomasneirynck May 1, 2019
c72e9ff
Merge branch 'maps/add_drawfilter' of github.com:thomasneirynck/kiban…
thomasneirynck May 1, 2019
974998d
temp commit
thomasneirynck May 1, 2019
a6f3c1c
fix regression after design merge
thomasneirynck May 1, 2019
d7ecc3d
move some files
thomasneirynck May 1, 2019
9e6b2a2
add support for geo_shapes
thomasneirynck May 1, 2019
834cbde
remove dupe label string
thomasneirynck May 1, 2019
8c7727e
do not trigger edit mode for shapes and rectangles, since it is buggy
thomasneirynck May 1, 2019
c08ab10
Merge branch 'master' into maps/add_drawfilter
thomasneirynck May 1, 2019
410a8f0
update yarn lock, allow freebsd
thomasneirynck May 1, 2019
a35f54d
Merge branch 'master' into maps/add_drawfilter
thomasneirynck May 3, 2019
84a6699
fix accidental removal of flag
thomasneirynck May 3, 2019
cf1207f
review feedback
thomasneirynck May 3, 2019
4b40d24
remove comment
thomasneirynck May 3, 2019
138d8eb
add isDrawingFilter flag
thomasneirynck May 3, 2019
eb9c2f4
remove draw_state_type
thomasneirynck May 3, 2019
43b212f
tmp commit
thomasneirynck May 6, 2019
9fcb46e
formatting
thomasneirynck May 6, 2019
cf25ce7
remove cruft
thomasneirynck May 6, 2019
f9f21ff
revert
thomasneirynck May 6, 2019
2e60217
use isfilterable instead of isreadonly
thomasneirynck May 6, 2019
4f68f3a
avoid redundant rerender
thomasneirynck May 6, 2019
08ab8fd
Merge branch 'master' into maps/add_drawfilter
thomasneirynck May 7, 2019
d428db0
feedback
thomasneirynck May 7, 2019
59cfdc5
create bounds filters when possible
thomasneirynck May 7, 2019
4cc3432
Merge branch 'master' into maps/add_drawfilter
thomasneirynck May 7, 2019
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
1 change: 1 addition & 0 deletions src/dev/license_checker/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const LICENSE_WHITELIST = [
'CC-BY-3.0',
'CC-BY-4.0',
'Eclipse Distribution License - v 1.0',
'FreeBSD',
'ISC',
'ISC*',
'MIT OR GPL-2.0',
Expand Down
2 changes: 2 additions & 0 deletions x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
"@kbn/i18n": "1.0.0",
"@kbn/interpreter": "1.0.0",
"@kbn/ui-framework": "1.0.0",
"@mapbox/mapbox-gl-draw": "^1.1.1",
"@samverschueren/stream-to-observable": "^0.3.0",
"@scant/router": "^0.1.0",
"@slack/client": "^4.8.0",
Expand Down Expand Up @@ -255,6 +256,7 @@
"lodash.uniqby": "^4.7.0",
"lz-string": "^1.4.4",
"mapbox-gl": "0.52.0",
"mapbox-gl-draw-rectangle-mode": "^1.0.4",
"markdown-it": "^8.4.1",
"mime": "^2.2.2",
"mkdirp": "0.5.1",
Expand Down
5 changes: 5 additions & 0 deletions x-pack/plugins/maps/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ export const APP_ICON = 'gisApp';
export const SOURCE_DATA_ID_ORIGIN = 'source';

export const FEATURE_ID_PROPERTY_NAME = '__kbn__feature_id__';

export const ES_GEO_FIELD_TYPE = {
GEO_POINT: 'geo_point',
GEO_SHAPE: 'geo_shape'
};
44 changes: 27 additions & 17 deletions x-pack/plugins/maps/public/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,39 @@

.mapContainer {
flex-grow: 1;
}

.mapboxgl-popup {
z-index: 100;
border-color: $euiColorEmptyShade;
}
.mapboxgl-popup {
z-index: 100;
border-color: $euiColorEmptyShade;
}

.mapboxgl-popup-content {
background-color: $euiColorEmptyShade;
}
.mapboxgl-popup-content {
background-color: $euiColorEmptyShade;
}

.mapboxgl-popup-tip {
border-top-color: $euiColorEmptyShade !important;
}
.mapboxgl-popup-tip {
border-top-color: $euiColorEmptyShade !important;
}

.mapboxgl-ctrl-top-left .mapboxgl-ctrl {
margin-left: $euiSizeM;
margin-top: $euiSizeM;
}

// This is not good practice to create such a generic class.
// I can't seem to find it being applied anywhere in GIS
// .hidden {
// display: none
// }
.mapboxgl-ctrl-group:not(:empty) {
@include euiBottomShadowLarge;
background-color: $euiColorEmptyShade;
border-radius: $euiBorderRadius;

// EUIFIXTODO:
> button {
@include size($euiSizeXL);

+ button {
border: none;
}
}
}
}
.euiColorPicker__emptySwatch {
position: relative;
}
18 changes: 18 additions & 0 deletions x-pack/plugins/maps/public/actions/store_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ export const TRACK_CURRENT_LAYER_STATE = 'TRACK_CURRENT_LAYER_STATE';
export const ROLLBACK_TO_TRACKED_LAYER_STATE = 'ROLLBACK_TO_TRACKED_LAYER_STATE';
export const REMOVE_TRACKED_LAYER_STATE = 'REMOVE_TRACKED_LAYER_STATE';
export const SET_TOOLTIP_STATE = 'SET_TOOLTIP_STATE';
export const UPDATE_DRAW_STATE = 'UPDATE_DRAW_STATE';

export const DRAW_TYPE = {
BOUNDS: 'BOUNDS',
POLYGON: 'POLYGON'
};
export const SET_SCROLL_ZOOM = 'SET_SCROLL_ZOOM';

function getLayerLoadingCallbacks(dispatch, layerId) {
Expand Down Expand Up @@ -685,3 +691,15 @@ export function setJoinsForLayer(layer, joins) {
dispatch(syncDataForLayer(layer.getId()));
};
}

export function updateDrawState(drawState) {
return async (dispatch) => {
if (drawState !== null) {
await dispatch(setTooltipState(null));//tooltips just get in the way
}
dispatch({
type: UPDATE_DRAW_STATE,
drawState: drawState
});
};
}
1 change: 1 addition & 0 deletions x-pack/plugins/maps/public/components/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
@import './layer_addpanel/layer_addpanel';
@import './layer_panel/index';
@import './widget_overlay/index';
@import './toolbar_overlay/index';
6 changes: 4 additions & 2 deletions x-pack/plugins/maps/public/components/gis_map/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import React, { Component } from 'react';
import { MBMapContainer } from '../map/mb';
import { WidgetOverlay } from '../widget_overlay/index';
import { ToolbarOverlay } from '../toolbar_overlay/index';
import { LayerPanel } from '../layer_panel/index';
import { AddLayerPanel } from '../layer_addpanel/index';
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
Expand Down Expand Up @@ -47,13 +48,13 @@ export class GisMap extends Component {
interval
);
}
}
};

clearRefreshTimer = () => {
if (this.refreshTimerId) {
clearInterval(this.refreshTimerId);
}
}
};

render() {
const {
Expand Down Expand Up @@ -91,6 +92,7 @@ export class GisMap extends Component {
<EuiFlexGroup gutterSize="none" responsive={false}>
<EuiFlexItem className="mapMapWrapper">
<MBMapContainer/>
<ToolbarOverlay />
<WidgetOverlay/>
</EuiFlexItem>

Expand Down
18 changes: 15 additions & 3 deletions x-pack/plugins/maps/public/components/map/mb/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,17 @@ import {
setMouseCoordinates,
clearMouseCoordinates,
clearGoto,
setTooltipState
setTooltipState,
updateDrawState
} from '../../../actions/store_actions';
import { getTooltipState, getLayerList, getMapReady, getGoto, getScrollZoom } from '../../../selectors/map_selectors';
import {
getTooltipState,
getLayerList,
getMapReady,
getGoto,
getDrawState,
getScrollZoom
} from '../../../selectors/map_selectors';
import { getIsFilterable } from '../../../store/ui';
import { getInspectorAdapters } from '../../../store/non_serializable_instances';

Expand All @@ -27,7 +35,8 @@ function mapStateToProps(state = {}) {
goto: getGoto(state),
inspectorAdapters: getInspectorAdapters(state),
tooltipState: getTooltipState(state),
scrollZoom: getScrollZoom(state),
drawState: getDrawState(state),
scrollZoom: getScrollZoom(state)
};
}

Expand Down Expand Up @@ -55,6 +64,9 @@ function mapDispatchToProps(dispatch) {
},
setTooltipState(tooltipState) {
dispatch(setTooltipState(tooltipState));
},
disableDrawState() {
dispatch(updateDrawState(null));
}
};
}
Expand Down
Loading