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

[7.x] [Maps] rename connected_components/map folder to mb_map (#82897) #82914

Merged
merged 2 commits into from
Nov 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { isRetina } from '../../../meta';
import {
addSpriteSheetToMapFromImageData,
loadSpriteSheetImageData,
} from '../../../connected_components/map/mb/utils'; //todo move this implementation
} from '../../../connected_components/mb_map/utils'; //todo move this implementation

const MB_STYLE_TYPE_TO_OPACITY = {
fill: ['fill-opacity'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
@import 'layer_panel/index';
@import 'widget_overlay/index';
@import 'toolbar_overlay/index';
@import 'map/features_tooltip/index';
@import 'mb_map/features_tooltip/index';
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import uuid from 'uuid/v4';
import { Filter } from 'src/plugins/data/public';
import { ActionExecutionContext, Action } from 'src/plugins/ui_actions/public';
// @ts-expect-error
import { MBMap } from '../map/mb';
import { MBMap } from '../mb_map';
// @ts-expect-error
import { WidgetOverlay } from '../widget_overlay';
// @ts-expect-error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import _ from 'lodash';
import React from 'react';
import { DRAW_TYPE } from '../../../../../common/constants';
import { DRAW_TYPE } from '../../../../common/constants';
import MapboxDraw from '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw-unminified';
import DrawRectangle from 'mapbox-gl-draw-rectangle-mode';
import { DrawCircle } from './draw_circle';
Expand All @@ -15,7 +15,7 @@ import {
createSpatialFilterWithGeometry,
getBoundingBoxGeometry,
roundCoordinates,
} from '../../../../../common/elasticsearch_util';
} from '../../../../common/elasticsearch_util';
import { DrawTooltip } from './draw_tooltip';

const DRAW_RECTANGLE = 'draw_rectangle';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import _ from 'lodash';
import React, { Component } from 'react';
import { EuiPopover, EuiText } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { DRAW_TYPE } from '../../../../../common/constants';
import { DRAW_TYPE } from '../../../../common/constants';

const noop = () => {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import { connect } from 'react-redux';
import { DrawControl } from './draw_control';
import { updateDrawState } from '../../../../actions';
import { getDrawState, isDrawingFilter } from '../../../../selectors/map_selectors';
import { updateDrawState } from '../../../actions';
import { getDrawState, isDrawingFilter } from '../../../selectors/map_selectors';

function mapStateToProps(state = {}) {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { INITIAL_LOCATION } from '../../../../common/constants';
import { Goto, MapCenterAndZoom } from '../../../../common/descriptor_types';
import { MapSettings } from '../../../reducers/map';
import { INITIAL_LOCATION } from '../../../common/constants';
import { Goto, MapCenterAndZoom } from '../../../common/descriptor_types';
import { MapSettings } from '../../reducers/map';

export async function getInitialView(
goto: Goto | null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { connect } from 'react-redux';
import { MBMap } from './view';
import { MBMap } from './mb_map';
import {
mapExtentChanged,
mapReady,
Expand All @@ -14,7 +14,7 @@ import {
clearMouseCoordinates,
clearGoto,
setMapInitError,
} from '../../../actions';
} from '../../actions';
import {
getLayerList,
getMapReady,
Expand All @@ -25,9 +25,9 @@ import {
isViewControlHidden,
getSpatialFiltersLayer,
getMapSettings,
} from '../../../selectors/map_selectors';
} from '../../selectors/map_selectors';

import { getInspectorAdapters } from '../../../reducers/non_serializable_instances';
import { getInspectorAdapters } from '../../reducers/non_serializable_instances';

function mapStateToProps(state = {}) {
return {
Expand Down Expand Up @@ -72,7 +72,5 @@ function mapDispatchToProps(dispatch) {
};
}

const connectedMBMap = connect(mapStateToProps, mapDispatchToProps, null, {
forwardRef: true,
})(MBMap);
export { connectedMBMap as MBMap };
const connected = connect(mapStateToProps, mapDispatchToProps)(MBMap);
export { connected as MBMap };
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { removeOrphanedSourcesAndLayers } from './utils';
import { SPATIAL_FILTERS_LAYER_ID } from '../../../../common/constants';
import { SPATIAL_FILTERS_LAYER_ID } from '../../../common/constants';
import _ from 'lodash';

class MockMbMap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

import _ from 'lodash';
import React from 'react';
import { ResizeChecker } from '../../../../../../../src/plugins/kibana_utils/public';
import { ResizeChecker } from '../../../../../../src/plugins/kibana_utils/public';
import { removeOrphanedSourcesAndLayers, addSpritesheetToMap } from './utils';
import { syncLayerOrder } from './sort_layers';
import { getGlyphUrl, isRetina } from '../../../meta';
import { getGlyphUrl, isRetina } from '../../meta';
import {
DECIMAL_DEGREES_PRECISION,
KBN_TOO_MANY_FEATURES_IMAGE_ID,
ZOOM_PRECISION,
} from '../../../../common/constants';
} from '../../../common/constants';
import mapboxgl from 'mapbox-gl/dist/mapbox-gl-csp';
import mbWorkerUrl from '!!file-loader!mapbox-gl/dist/mapbox-gl-csp-worker';
import mbRtlPlugin from '!!file-loader!@mapbox/mapbox-gl-rtl-text/mapbox-gl-rtl-text.min.js';
Expand All @@ -23,9 +23,9 @@ import sprites1 from '@elastic/maki/dist/[email protected]';
import sprites2 from '@elastic/maki/dist/[email protected]';
import { DrawControl } from './draw_control';
import { TooltipControl } from './tooltip_control';
import { clampToLatBounds, clampToLonBounds } from '../../../../common/elasticsearch_util';
import { clampToLatBounds, clampToLonBounds } from '../../../common/elasticsearch_util';
import { getInitialView } from './get_initial_view';
import { getPreserveDrawingBuffer } from '../../../kibana_services';
import { getPreserveDrawingBuffer } from '../../kibana_services';

mapboxgl.workerUrl = mbWorkerUrl;
mapboxgl.setRTLTextPlugin(mbRtlPlugin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import _ from 'lodash';
import { Map as MbMap, Layer as MbLayer, Style as MbStyle } from 'mapbox-gl';
import { getIsTextLayer, syncLayerOrder } from './sort_layers';
import { SPATIAL_FILTERS_LAYER_ID } from '../../../../common/constants';
import { ILayer } from '../../../classes/layers/layer';
import { SPATIAL_FILTERS_LAYER_ID } from '../../../common/constants';
import { ILayer } from '../../classes/layers/layer';

let moveCounter = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { Map as MbMap, Layer as MbLayer } from 'mapbox-gl';
import { ILayer } from '../../../classes/layers/layer';
import { ILayer } from '../../classes/layers/layer';

// "Layer" is overloaded and can mean the following
// 1) Map layer (ILayer): A single map layer consists of one to many mapbox layers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import {
openOnClickTooltip,
closeOnHoverTooltip,
openOnHoverTooltip,
} from '../../../../actions';
} from '../../../actions';
import {
getLayerList,
getOpenTooltips,
getHasLockedTooltips,
isDrawingFilter,
} from '../../../../selectors/map_selectors';
} from '../../../selectors/map_selectors';

function mapStateToProps(state = {}) {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import _ from 'lodash';
import React from 'react';
import { FEATURE_ID_PROPERTY_NAME, LON_INDEX } from '../../../../../common/constants';
import { FEATURE_ID_PROPERTY_NAME, LON_INDEX } from '../../../../common/constants';
import { TooltipPopover } from './tooltip_popover';
import { EXCLUDE_TOO_MANY_FEATURES_BOX } from '../../../../classes/util/mb_filter_expressions';
import { EXCLUDE_TOO_MANY_FEATURES_BOX } from '../../../classes/util/mb_filter_expressions';

function justifyAnchorLocation(mbLngLat, targetFeature) {
let popupAnchorLocation = [mbLngLat.lng, mbLngLat.lat]; // default popup location to mouse location
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

import React, { Component } from 'react';
import { LAT_INDEX, LON_INDEX } from '../../../../../common/constants';
import { FeaturesTooltip } from '../../features_tooltip/features_tooltip';
import { LAT_INDEX, LON_INDEX } from '../../../../common/constants';
import { FeaturesTooltip } from '../features_tooltip/features_tooltip';
import { EuiPopover, EuiText } from '@elastic/eui';

const noop = () => {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

jest.mock('../../features_tooltip/features_tooltip', () => ({
jest.mock('../features_tooltip/features_tooltip', () => ({
FeaturesTooltip: () => {
return <div>mockFeaturesTooltip</div>;
},
Expand Down