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] Move layers to np maps #61877

Merged
merged 19 commits into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -4,8 +4,10 @@
* you may not use this file except in compliance with the Elastic License.
*/
import _ from 'lodash';
import { KibanaTilemapSource } from '../layers/sources/kibana_tilemap_source';
import { EMSTMSSource } from '../layers/sources/ems_tms_source';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { KibanaTilemapSource } from '../../../../../plugins/maps/public/layers/sources/kibana_tilemap_source';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { EMSTMSSource } from '../../../../../plugins/maps/public/layers/sources/ems_tms_source';
import { getInjectedVarFunc } from '../kibana_services';
import { getKibanaTileMap } from '../meta';

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

import React from 'react';
import { Filter } from 'src/plugins/data/public';
import { RenderToolTipContent } from '../../layers/tooltips/tooltip_property';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { RenderToolTipContent } from '../../../../../../plugins/maps/public/layers/tooltips/tooltip_property';

export const GisMap: React.ComponentType<{
addFilters: ((filters: Filter[]) => void) | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*/

import React, { Fragment } from 'react';
import { GeojsonFileSource } from '../../../layers/sources/client_file_source';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { GeojsonFileSource } from '../../../../../../../plugins/maps/public/layers/sources/client_file_source';
import { EuiSpacer, EuiPanel, EuiButtonEmpty } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

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

import React, { Fragment } from 'react';
import { ALL_SOURCES } from '../../../layers/sources/all_sources';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { ALL_SOURCES } from '../../../../../../../plugins/maps/public/layers/sources/all_sources';
import { EuiSpacer, EuiPanel, EuiButtonEmpty } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

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

import React, { Fragment } from 'react';
import { ALL_SOURCES } from '../../../layers/sources/all_sources';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { ALL_SOURCES } from '../../../../../../../plugins/maps/public/layers/sources/all_sources';
import { EuiTitle, EuiSpacer, EuiCard, EuiIcon } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import _ from 'lodash';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ import {
} from '../../../../../plugins/maps/public/reducers/non_serializable_instances';
import { getMapCenter, getMapZoom, getHiddenLayerIds } from '../selectors/map_selectors';
import { MAP_SAVED_OBJECT_TYPE } from '../../common/constants';
import { RenderToolTipContent } from '../layers/tooltips/tooltip_property';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { RenderToolTipContent } from '../../../../../plugins/maps/public/layers/tooltips/tooltip_property';

interface MapEmbeddableConfig {
editUrl?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import { getInitialLayers } from '../angular/get_initial_layers';
import { mergeInputWithSavedMap } from './merge_input_with_saved_map';
import '../angular/services/gis_map_saved_object_loader';
import { bindSetupCoreAndPlugins, bindStartCoreAndPlugins } from '../plugin';
import { RenderToolTipContent } from '../layers/tooltips/tooltip_property';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { RenderToolTipContent } from '../../../../../plugins/maps/public/layers/tooltips/tooltip_property';
import {
EventHandlers,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
Expand Down
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/maps/public/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
@import './mapbox_hacks';
@import './connected_components/index';
@import './components/index';
@import './layers/index';
@import '../../../../plugins/maps/public/layers/index';
6 changes: 5 additions & 1 deletion x-pack/legacy/plugins/maps/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ export const plugin = (initializerContext: PluginInitializerContext) => {
return new MapsPlugin();
};

export { RenderTooltipContentParams, ITooltipProperty } from './layers/tooltips/tooltip_property';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
export {
RenderTooltipContentParams,
ITooltipProperty,
} from '../../../../plugins/maps/public/layers/tooltips/tooltip_property';
export { MapEmbeddable, MapEmbeddableInput } from './embeddable';
1 change: 0 additions & 1 deletion x-pack/legacy/plugins/maps/public/layers/_index.scss

This file was deleted.

4 changes: 0 additions & 4 deletions x-pack/legacy/plugins/maps/public/layers/styles/_index.scss

This file was deleted.

21 changes: 14 additions & 7 deletions x-pack/legacy/plugins/maps/public/selectors/map_selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@

import { createSelector } from 'reselect';
import _ from 'lodash';
import { TileLayer } from '../layers/tile_layer';
import { VectorTileLayer } from '../layers/vector_tile_layer';
import { VectorLayer } from '../layers/vector_layer';
import { HeatmapLayer } from '../layers/heatmap_layer';
import { BlendedVectorLayer } from '../layers/blended_vector_layer';
import { ALL_SOURCES } from '../layers/sources/all_sources';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { TileLayer } from '../../../../../plugins/maps/public/layers/tile_layer';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { VectorTileLayer } from '../../../../../plugins/maps/public/layers/vector_tile_layer';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { VectorLayer } from '../../../../../plugins/maps/public/layers/vector_layer';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { HeatmapLayer } from '../../../../../plugins/maps/public/layers/heatmap_layer';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { BlendedVectorLayer } from '../../../../../plugins/maps/public/layers/blended_vector_layer';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { ALL_SOURCES } from '../../../../../plugins/maps/public/layers/sources/all_sources';
import { getTimeFilter } from '../kibana_services';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { getInspectorAdapters } from '../../../../../plugins/maps/public/reducers/non_serializable_instances';
Expand All @@ -20,7 +26,8 @@ import {
TRACKED_LAYER_DESCRIPTOR,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../../../../plugins/maps/public/reducers/util';
import { InnerJoin } from '../layers/joins/inner_join';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { InnerJoin } from '../../../../../plugins/maps/public/layers/joins/inner_join';

function createLayerInstance(layerDescriptor, inspectorAdapters) {
const source = createSourceInstance(layerDescriptor.sourceDescriptor, inspectorAdapters);
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/maps/public/layers/_index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import 'styles/index';
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ import {
VECTOR_STYLES,
LAYER_STYLE_TYPE,
FIELD_ORIGIN,
} from '../../common/constants';
} from '../../../../legacy/plugins/maps/common/constants';
import { ESGeoGridSource } from './sources/es_geo_grid_source/es_geo_grid_source';
import { canSkipSourceUpdate } from './util/can_skip_fetch';
import { IVectorLayer, VectorLayerArguments } from './vector_layer';
import { IESSource } from './sources/es_source';
import { IESAggSource } from './sources/es_agg_source';
import { ISource } from './sources/source';
import { SyncContext } from '../actions/map_actions';
import { SyncContext } from '../../../../legacy/plugins/maps/public/actions/map_actions';
import { DataRequestAbortError } from './util/data_request';
import {
VectorStyleDescriptor,
SizeDynamicOptions,
DynamicStylePropertyOptions,
} from '../../common/descriptor_types';
} from '../../../../legacy/plugins/maps/common/descriptor_types';

const ACTIVE_COUNT_DATA_ID = 'ACTIVE_COUNT_DATA_ID';

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.
*/

import { FIELD_ORIGIN } from '../../../common/constants';
import { FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants';
import { IField, AbstractField } from './field';
import { IVectorSource } from '../sources/vector_source';
import { IEmsFileSource } from '../sources/ems_file_source/ems_file_source';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { ESAggField, esAggFieldsFactory } from './es_agg_field';
import { AGG_TYPE, FIELD_ORIGIN } from '../../../common/constants';
import { AGG_TYPE, FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants';
import { IESAggSource } from '../sources/es_agg_source';
import { IIndexPattern } from 'src/plugins/data/public';

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

import { IndexPattern } from 'src/plugins/data/public';
import { IField } from './field';
import { AggDescriptor } from '../../../common/descriptor_types';
import { AggDescriptor } from '../../../../../legacy/plugins/maps/common/descriptor_types';
import { IESAggSource } from '../sources/es_agg_source';
import { IVectorSource } from '../sources/vector_source';
import { ESDocField } from './es_doc_field';
import { AGG_TYPE, FIELD_ORIGIN } from '../../../common/constants';
import { AGG_TYPE, FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants';
import { isMetricCountable } from '../util/is_metric_countable';
import { getField, addFieldToDSL } from '../util/es_agg_utils';
import { TopTermPercentageField } from './top_term_percentage_field';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { FIELD_ORIGIN } from '../../../common/constants';
import { FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants';
import { ESTooltipProperty } from '../tooltips/es_tooltip_property';
import { ITooltipProperty, TooltipProperty } from '../tooltips/tooltip_property';
import { COLOR_PALETTE_MAX_SIZE } from '../../../common/constants';
import { indexPatterns } from '../../../../../../../src/plugins/data/public';
import { IFieldType } from '../../../../../../../src/plugins/data/public';
import { COLOR_PALETTE_MAX_SIZE } from '../../../../../legacy/plugins/maps/common/constants';
import { indexPatterns } from '../../../../../../src/plugins/data/public';
import { IFieldType } from '../../../../../../src/plugins/data/public';
import { IField, AbstractField } from './field';
import { IESSource } from '../sources/es_source';
import { IVectorSource } from '../sources/vector_source';
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.
*/

import { FIELD_ORIGIN } from '../../../common/constants';
import { FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants';
import { IVectorSource } from '../sources/vector_source';
import { ITooltipProperty, TooltipProperty } from '../tooltips/tooltip_property';

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

import { IField, AbstractField } from './field';
import { IKibanaRegionSource } from '../sources/kibana_regionmap_source/kibana_regionmap_source';
import { FIELD_ORIGIN } from '../../../common/constants';
import { FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants';
import { IVectorSource } from '../sources/vector_source';

export class KibanaRegionField extends AbstractField implements IField {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { IESAggField } from './es_agg_field';
import { IVectorSource } from '../sources/vector_source';
// @ts-ignore
import { ITooltipProperty, TooltipProperty } from '../tooltips/tooltip_property';
import { TOP_TERM_PERCENTAGE_SUFFIX } from '../../../common/constants';
import { FIELD_ORIGIN } from '../../../common/constants';
import { TOP_TERM_PERCENTAGE_SUFFIX } from '../../../../../legacy/plugins/maps/common/constants';
import { FIELD_ORIGIN } from '../../../../../legacy/plugins/maps/common/constants';

export class TopTermPercentageField implements IESAggField {
private readonly _topTermAggField: IESAggField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
import { AbstractLayer } from './layer';
import { VectorLayer } from './vector_layer';
import { HeatmapStyle } from './styles/heatmap/heatmap_style';
import { EMPTY_FEATURE_COLLECTION, LAYER_TYPE } from '../../common/constants';
import {
EMPTY_FEATURE_COLLECTION,
LAYER_TYPE,
} from '../../../../legacy/plugins/maps/common/constants';

const SCALED_PROPERTY_NAME = '__kbn_heatmap_weight__'; //unique name to store scaled value for weighting

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

import { ESTermSource } from '../sources/es_term_source';
import { getComputedFieldNamePrefix } from '../styles/vector/style_util';
import { META_ID_ORIGIN_SUFFIX, FORMATTERS_ID_ORIGIN_SUFFIX } from '../../../common/constants';
import {
META_ID_ORIGIN_SUFFIX,
FORMATTERS_ID_ORIGIN_SUFFIX,
} from '../../../../../legacy/plugins/maps/common/constants';

export class InnerJoin {
constructor(joinDescriptor, leftSource) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { LayerDescriptor } from '../../common/descriptor_types';
import { LayerDescriptor } from '../../../../legacy/plugins/maps/common/descriptor_types';
import { ISource } from './sources/source';
import { DataRequest } from './util/data_request';
import { SyncContext } from '../actions/map_actions';
import { SyncContext } from '../../../../legacy/plugins/maps/public/actions/map_actions';

export interface ILayer {
getDataRequest(id: string): DataRequest | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import {
MB_SOURCE_ID_LAYER_ID_PREFIX_DELIMITER,
MIN_ZOOM,
SOURCE_DATA_ID_ORIGIN,
} from '../../common/constants';
} from '../../../../legacy/plugins/maps/common/constants';
import uuid from 'uuid/v4';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { copyPersistentState } from '../../../../../plugins/maps/public/reducers/util.js';
import { copyPersistentState } from '../reducers/util.js';
import { i18n } from '@kbn/i18n';

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

import React from 'react';
import { getFileUploadComponent } from '../../../kibana_services';
import { getFileUploadComponent } from '../../../../../../legacy/plugins/maps/public/kibana_services';

export function ClientFileCreateSourceEditor({
previewGeojsonFile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ES_GEO_FIELD_TYPE,
GEOJSON_FILE,
DEFAULT_MAX_RESULT_WINDOW,
} from '../../../../common/constants';
} from '../../../../../../legacy/plugins/maps/common/constants';
import { ClientFileCreateSourceEditor } from './create_client_file_source_editor';
import { ESSearchSource } from '../es_search_source';
import uuid from 'uuid/v4';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import { EuiComboBox, EuiFormRow } from '@elastic/eui';

import { getEMSClient } from '../../../meta';
import { getEMSClient } from '../../../../../../legacy/plugins/maps/public/meta';
import { getEmsUnavailableMessage } from '../ems_unavailable_message';
import { i18n } from '@kbn/i18n';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import { AbstractVectorSource } from '../vector_source';
import { VECTOR_SHAPE_TYPES } from '../vector_feature_types';
import React from 'react';
import { EMS_FILE, FIELD_ORIGIN } from '../../../../common/constants';
import { getEMSClient } from '../../../meta';
import { EMS_FILE, FIELD_ORIGIN } from '../../../../../../legacy/plugins/maps/common/constants';
import { getEMSClient } from '../../../../../../legacy/plugins/maps/public/meta';
import { EMSFileCreateSourceEditor } from './create_source_editor';
import { i18n } from '@kbn/i18n';
import { getDataSourceLabel } from '../../../../common/i18n_getters';
import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters';
import { UpdateSourceEditor } from './update_source_editor';
import { EMSFileField } from '../../fields/ems_file_field';

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

import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import { TooltipSelector } from '../../../components/tooltip_selector';
import { getEMSClient } from '../../../meta';
import { TooltipSelector } from '../../../../../../legacy/plugins/maps/public/components/tooltip_selector';
import { getEMSClient } from '../../../../../../legacy/plugins/maps/public/meta';
import { EuiTitle, EuiPanel, EuiSpacer } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ import React from 'react';
import { AbstractTMSSource } from '../tms_source';
import { VectorTileLayer } from '../../vector_tile_layer';

import { getEMSClient } from '../../../meta';
import { getEMSClient } from '../../../../../../legacy/plugins/maps/public/meta';
import { TileServiceSelect } from './tile_service_select';
import { UpdateSourceEditor } from './update_source_editor';
import { i18n } from '@kbn/i18n';
import { getDataSourceLabel } from '../../../../common/i18n_getters';
import { EMS_TMS } from '../../../../common/constants';
import { getInjectedVarFunc, getUiSettings } from '../../../kibana_services';
import { getDataSourceLabel } from '../../../../../../legacy/plugins/maps/common/i18n_getters';
import { EMS_TMS } from '../../../../../../legacy/plugins/maps/common/constants';
import {
getInjectedVarFunc,
getUiSettings,
} from '../../../../../../legacy/plugins/maps/public/kibana_services';

export class EMSTMSSource extends AbstractTMSSource {
static type = EMS_TMS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import { EuiSelect, EuiFormRow } from '@elastic/eui';

import { getEMSClient } from '../../../meta';
import { getEMSClient } from '../../../../../../legacy/plugins/maps/public/meta';
import { getEmsUnavailableMessage } from '../ems_unavailable_message';
import { i18n } from '@kbn/i18n';

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.
*/

import { getInjectedVarFunc } from '../../kibana_services';
import { getInjectedVarFunc } from '../../../../../legacy/plugins/maps/public/kibana_services';
import { i18n } from '@kbn/i18n';

export function getEmsUnavailableMessage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import { IESSource } from './es_source';
import { AbstractESSource } from './es_source';
import { AGG_TYPE } from '../../../common/constants';
import { AGG_TYPE } from '../../../../../legacy/plugins/maps/common/constants';
import { IESAggField } from '../fields/es_agg_field';
import { AbstractESAggSourceDescriptor } from '../../../common/descriptor_types';
import { AbstractESAggSourceDescriptor } from '../../../../../legacy/plugins/maps/common/descriptor_types';

export interface IESAggSource extends IESSource {
getAggKey(aggType: AGG_TYPE, fieldName: string): string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
COUNT_PROP_LABEL,
COUNT_PROP_NAME,
FIELD_ORIGIN,
} from '../../../common/constants';
} from '../../../../../legacy/plugins/maps/common/constants';

export const AGG_DELIMITER = '_of_';

Expand Down
Loading