Skip to content

Commit

Permalink
Clean up linting comments. Add linting comments to route controller. …
Browse files Browse the repository at this point in the history
…Move common to NP
  • Loading branch information
Aaron Caldwell committed Apr 17, 2020
1 parent 0d1888a commit b1d4dd8
Show file tree
Hide file tree
Showing 81 changed files with 135 additions and 202 deletions.
8 changes: 0 additions & 8 deletions x-pack/legacy/plugins/maps/common/constants.ts

This file was deleted.

8 changes: 0 additions & 8 deletions x-pack/legacy/plugins/maps/common/descriptor_types.ts

This file was deleted.

8 changes: 0 additions & 8 deletions x-pack/legacy/plugins/maps/common/get_join_key.ts

This file was deleted.

8 changes: 0 additions & 8 deletions x-pack/legacy/plugins/maps/common/i18n_getters.ts

This file was deleted.

8 changes: 0 additions & 8 deletions x-pack/legacy/plugins/maps/common/parse_xml_string.js

This file was deleted.

9 changes: 7 additions & 2 deletions x-pack/legacy/plugins/maps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ import mappings from './mappings.json';
import { i18n } from '@kbn/i18n';
import { resolve } from 'path';
import { migrations } from './migrations';
import { getAppTitle } from './common/i18n_getters';
import { getAppTitle } from '../../../plugins/maps/common/i18n_getters';
import { MapPlugin } from './server/plugin';
import { APP_ID, APP_ICON, createMapPath, MAP_SAVED_OBJECT_TYPE } from './common/constants';
import {
APP_ID,
APP_ICON,
createMapPath,
MAP_SAVED_OBJECT_TYPE,
} from '../../../plugins/maps/common/constants';
import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/utils';

export function maps(kibana) {
Expand Down
16 changes: 8 additions & 8 deletions x-pack/legacy/plugins/maps/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { extractReferences } from './common/migrations/references';
import { emsRasterTileToEmsVectorTile } from './common/migrations/ems_raster_tile_to_ems_vector_tile';
import { topHitsTimeToSort } from './common/migrations/top_hits_time_to_sort';
import { moveApplyGlobalQueryToSources } from './common/migrations/move_apply_global_query';
import { addFieldMetaOptions } from './common/migrations/add_field_meta_options';
import { migrateSymbolStyleDescriptor } from './common/migrations/migrate_symbol_style_descriptor';
import { migrateUseTopHitsToScalingType } from './common/migrations/scaling_type';
import { migrateJoinAggKey } from './common/migrations/join_agg_key';
import { extractReferences } from '../../../plugins/maps/common/migrations/references';
import { emsRasterTileToEmsVectorTile } from '../../../plugins/maps/common/migrations/ems_raster_tile_to_ems_vector_tile';
import { topHitsTimeToSort } from '../../../plugins/maps/common/migrations/top_hits_time_to_sort';
import { moveApplyGlobalQueryToSources } from '../../../plugins/maps/common/migrations/move_apply_global_query';
import { addFieldMetaOptions } from '../../../plugins/maps/common/migrations/add_field_meta_options';
import { migrateSymbolStyleDescriptor } from '../../../plugins/maps/common/migrations/migrate_symbol_style_descriptor';
import { migrateUseTopHitsToScalingType } from '../../../plugins/maps/common/migrations/scaling_type';
import { migrateJoinAggKey } from '../../../plugins/maps/common/migrations/join_agg_key';

export const migrations = {
map: {
Expand Down
12 changes: 11 additions & 1 deletion x-pack/legacy/plugins/maps/public/angular/map_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ import {
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { createMapStore } from '../../../../../plugins/maps/public/reducers/store';
import { Provider } from 'react-redux';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { GisMap } from '../../../../../plugins/maps/public/connected_components/gis_map';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { addHelpMenuToAppChrome } from '../../../../../plugins/maps/public/help_menu_util';
import {
setSelectedLayer,
Expand All @@ -37,6 +39,7 @@ import {
replaceLayerList,
setQuery,
clearTransientLayerStateAndCloseFlyout,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../../../../plugins/maps/public/actions/map_actions';
import {
DEFAULT_IS_LAYER_TOC_OPEN,
Expand All @@ -49,22 +52,29 @@ import {
setReadOnly,
setIsLayerTOCOpen,
setOpenTOCDetails,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../../../../plugins/maps/public/actions/ui_actions';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { getIsFullScreen } from '../../../../../plugins/maps/public/selectors/ui_selectors';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { copyPersistentState } from '../../../../../plugins/maps/public/reducers/util';
import {
getQueryableUniqueIndexPatternIds,
hasDirtyState,
getLayerListRaw,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../../../../plugins/maps/public/selectors/map_selectors';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { getInspectorAdapters } from '../../../../../plugins/maps/public/reducers/non_serializable_instances';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { getInitialLayers } from '../../../../../plugins/maps/public/angular/get_initial_layers';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { getInitialQuery } from '../../../../../plugins/maps/public/angular/get_initial_query';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { getInitialTimeFilters } from '../../../../../plugins/maps/public/angular/get_initial_time_filters';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { getInitialRefreshConfig } from '../../../../../plugins/maps/public/angular/get_initial_refresh_config';
import { MAP_SAVED_OBJECT_TYPE, MAP_APP_PATH } from '../../common/constants';
import { MAP_SAVED_OBJECT_TYPE, MAP_APP_PATH } from '../../../../../plugins/maps/common/constants';
import { npSetup, npStart } from 'ui/new_platform';
import { esFilters } from '../../../../../../src/plugins/data/public';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
*/

import _ from 'lodash';
import { DEFAULT_MAX_RESULT_WINDOW, DEFAULT_MAX_INNER_RESULT_WINDOW } from '../../common/constants';
import {
DEFAULT_MAX_RESULT_WINDOW,
DEFAULT_MAX_INNER_RESULT_WINDOW,
} from '../../../../../plugins/maps/common/constants';

export function getIndexPatternSettings(indicesSettingsResp) {
let maxResultWindow = Infinity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
*/

import { getIndexPatternSettings } from './get_index_pattern_settings';
import { DEFAULT_MAX_RESULT_WINDOW, DEFAULT_MAX_INNER_RESULT_WINDOW } from '../../common/constants';
import {
DEFAULT_MAX_RESULT_WINDOW,
DEFAULT_MAX_INNER_RESULT_WINDOW,
} from '../../../../../plugins/maps/common/constants';

describe('max_result_window and max_inner_result_window are not set', () => {
test('Should provide default values when values not set', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
import { SavedObjectsClientContract } from 'src/core/server';
import { getMapsTelemetry } from '../maps_telemetry';
// @ts-ignore
import { TELEMETRY_TYPE } from '../../../common/constants';
import { TELEMETRY_TYPE } from '../../../../../../plugins/maps/common/constants';

export function registerMapsUsageCollector(
usageCollection: UsageCollectionSetup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {
ES_GEO_FIELD_TYPE,
MAP_SAVED_OBJECT_TYPE,
TELEMETRY_TYPE,
} from '../../common/constants';
import { LayerDescriptor } from '../../common/descriptor_types';
} from '../../../../../plugins/maps/common/constants';
import { LayerDescriptor } from '../../../../../plugins/maps/common/descriptor_types';
import { MapSavedObject } from '../../../../../plugins/maps/common/map_saved_object_type';

interface IStats {
Expand Down
7 changes: 6 additions & 1 deletion x-pack/legacy/plugins/maps/server/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { i18n } from '@kbn/i18n';
import { APP_ID, APP_ICON, createMapPath, MAP_SAVED_OBJECT_TYPE } from '../common/constants';
import {
APP_ID,
APP_ICON,
createMapPath,
MAP_SAVED_OBJECT_TYPE,
} from '../../../../plugins/maps/common/constants';
import { getEcommerceSavedObjects } from './sample_data/ecommerce_saved_objects';
import { getFlightsSavedObjects } from './sample_data/flights_saved_objects.js';
import { getWebLogsSavedObjects } from './sample_data/web_logs_saved_objects.js';
Expand Down
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/maps/server/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
GIS_API_PATH,
EMS_SPRITES_PATH,
INDEX_SETTINGS_API_PATH,
} from '../common/constants';
} from '../../../../plugins/maps/common/constants';
import { EMSClient } from '@elastic/ems-client';
import fetch from 'node-fetch';
import { i18n } from '@kbn/i18n';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
LayerDescriptor,
VectorLayerDescriptor,
} from '../descriptor_types';
import { MapSavedObjectAttributes } from '../../../../../plugins/maps/common/map_saved_object_type';
import { MapSavedObjectAttributes } from '../map_saved_object_type';

const GROUP_BY_DELIMITER = '_groupby_';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import _ from 'lodash';
import { SOURCE_TYPES, SCALING_TYPES } from '../constants';
import { LayerDescriptor, ESSearchSourceDescriptor } from '../descriptor_types';
import { MapSavedObjectAttributes } from '../../../../../plugins/maps/common/map_saved_object_type';
import { MapSavedObjectAttributes } from '../map_saved_object_type';

function isEsDocumentSource(layerDescriptor: LayerDescriptor) {
const sourceType = _.get(layerDescriptor, 'sourceDescriptor.type');
Expand Down
5 changes: 2 additions & 3 deletions x-pack/plugins/maps/public/actions/map_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@ import {
getQuery,
getDataRequestDescriptor,
} from '../selectors/map_selectors';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import { FLYOUT_STATE } from '../reducers/ui';
import {
cancelRequest,
registerCancelCallback,
unregisterCancelCallback,
getEventHandlers,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../reducers/non_serializable_instances';
import { updateFlyout } from './ui_actions';
import {
FEATURE_ID_PROPERTY_NAME,
LAYER_TYPE,
SOURCE_DATA_ID_ORIGIN,
} from '../../../../legacy/plugins/maps/common/constants';
} from '../../common/constants';

export const SET_SELECTED_LAYER = 'SET_SELECTED_LAYER';
export const SET_TRANSIENT_LAYER = 'SET_TRANSIENT_LAYER';
Expand Down
21 changes: 10 additions & 11 deletions x-pack/plugins/maps/public/angular/get_initial_layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,27 @@
*/
import _ from 'lodash';
// Import each layer type, even those not used, to init in registry
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import '../layers/sources/wms_source';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import '../layers/sources/ems_file_source';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import '../layers/sources/es_search_source';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import '../layers/sources/es_pew_pew_source/es_pew_pew_source';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import '../layers/sources/kibana_regionmap_source';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import '../layers/sources/es_geo_grid_source';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import '../layers/sources/xyz_tms_source';

// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { KibanaTilemapSource } from '../layers/sources/kibana_tilemap_source';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import { EMSTMSSource } from '../layers/sources/ems_tms_source';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import { getInjectedVarFunc } from '../kibana_services';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import { getKibanaTileMap } from '../meta';

export function getInitialLayers(layerListJSON, initialLayers = []) {
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/maps/public/angular/get_initial_query.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/

// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { getUiSettings } from '../kibana_services';

export function getInitialQuery({ mapStateJSON, appState = {}, userQueryLanguage }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import { getUiSettings } from '../kibana_services';

export function getInitialRefreshConfig({ mapStateJSON, globalState = {} }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import { getUiSettings } from '../kibana_services';

export function getInitialTimeFilters({ mapStateJSON, globalState = {} }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
getIndexPatternService,
getCoreOverlays,
getData,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../kibana_services';

export const getMapsSavedObjectLoader = _.once(function() {
Expand Down
11 changes: 4 additions & 7 deletions x-pack/plugins/maps/public/angular/services/saved_gis_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ import {
getFilters,
} from '../../selectors/map_selectors';
import { getIsLayerTOCOpen, getOpenTOCDetails } from '../../selectors/ui_selectors';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import { convertMapExtentToPolygon } from '../../elasticsearch_geo_utils';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import { copyPersistentState } from '../../reducers/util';
import {
extractReferences,
injectReferences,
} from '../../../../../legacy/plugins/maps/common/migrations/references';
import { MAP_SAVED_OBJECT_TYPE } from '../../../../../legacy/plugins/maps/common/constants';
import { extractReferences, injectReferences } from '../../../common/migrations/references';
import { MAP_SAVED_OBJECT_TYPE } from '../../../common/constants';

export function createSavedGisMapClass(services) {
const SavedObjectClass = createSavedObjectClass(services);
Expand Down
7 changes: 2 additions & 5 deletions x-pack/plugins/maps/public/components/geometry_filter_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ import {
EuiFormErrorText,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import {
ES_GEO_FIELD_TYPE,
ES_SPATIAL_RELATIONS,
} from '../../../../legacy/plugins/maps/common/constants';
import { getEsSpatialRelationLabel } from '../../../../legacy/plugins/maps/common/i18n_getters';
import { ES_GEO_FIELD_TYPE, ES_SPATIAL_RELATIONS } from '../../common/constants';
import { getEsSpatialRelationLabel } from '../../common/i18n_getters';
import { MultiIndexGeoFieldSelect } from './multi_index_geo_field_select';

export class GeometryFilterForm extends Component {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/maps/public/components/map_listing.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import _ from 'lodash';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import { getToasts } from '../kibana_services';
import {
EuiTitle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

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

import { RenderToolTipContent } from '../../layers/tooltips/tooltip_property';

export const GisMap: React.ComponentType<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { connect } from 'react-redux';
import { GisMap } from './view';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import { FLYOUT_STATE } from '../../reducers/ui';
import { exitFullScreen } from '../../actions/ui_actions';
import { getFlyoutDisplay, getIsFullScreen } from '../../selectors/ui_selectors';
Expand All @@ -18,7 +18,7 @@ import {
getQueryableUniqueIndexPatternIds,
isToolbarOverlayHidden,
} from '../../selectors/map_selectors';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths

import { getCoreChrome } from '../../kibana_services';

function mapStateToProps(state = {}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ import { AddLayerPanel } from '../layer_addpanel';
import { EuiFlexGroup, EuiFlexItem, EuiCallOut } from '@elastic/eui';
import { ExitFullScreenButton } from '../../../../../../src/plugins/kibana_react/public';

// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { getIndexPatternsFromIds } from '../../index_pattern_util';
import { ES_GEO_FIELD_TYPE } from '../../../../../legacy/plugins/maps/common/constants';
import { ES_GEO_FIELD_TYPE } from '../../../common/constants';
import { indexPatterns as indexPatternsUtils } from '../../../../../../src/plugins/data/public';
import { i18n } from '@kbn/i18n';
import uuid from 'uuid/v4';
Expand Down
Loading

0 comments on commit b1d4dd8

Please sign in to comment.