Skip to content

Commit

Permalink
[Maps] migrate maps, maps_file_upload, and maps_legacy_licensing to T…
Browse files Browse the repository at this point in the history
…S projects (#89439) (#89483)

* [Maps] migrate maps, maps_file_upload, and maps_legacy_licensing to TS projects

* include types to avoid rison import errors

* add mappings to tsconfig include
  • Loading branch information
nreese authored Jan 27, 2021
1 parent 2043589 commit fb74c3c
Show file tree
Hide file tree
Showing 16 changed files with 75 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const ADD_LAYER_STEP_LABEL = i18n.translate('xpack.maps.addLayerPanel.addLayer',
});
const SELECT_WIZARD_LABEL = ADD_LAYER_STEP_LABEL;

interface Props {
export interface Props {
addPreviewLayers: (layerDescriptors: LayerDescriptor[]) => void;
closeFlyout: () => void;
hasPreviewLayers: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { ILayer } from '../../../classes/layers/layer';
import { JoinDescriptor } from '../../../../common/descriptor_types';
import { IField } from '../../../classes/fields/field';

interface Props {
export interface Props {
joins: JoinDescriptor[];
layer: ILayer;
layerDisplayName: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { AlphaSlider } from '../../../components/alpha_slider';
import { ValidatedDualRange } from '../../../../../../../src/plugins/kibana_react/public';
import { ILayer } from '../../../classes/layers/layer';

interface Props {
export interface Props {
layer: ILayer;
updateLabel: (layerId: string, label: string) => void;
updateMinZoom: (layerId: string, minZoom: number) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import 'mapbox-gl/dist/mapbox-gl.css';

const RENDER_COMPLETE_EVENT = 'renderComplete';

interface Props {
export interface Props {
addFilters: ((filters: Filter[]) => Promise<void>) | null;
getFilterActions?: () => Promise<Action[]>;
getActionContext?: () => ActionExecutionContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { SpatialFiltersPanel } from './spatial_filters_panel';
import { DisplayPanel } from './display_panel';
import { MapCenter } from '../../../common/descriptor_types';

interface Props {
export interface Props {
cancelChanges: () => void;
center: MapCenter;
hasMapSettingsChanges: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import mbWorkerUrl from '!!file-loader!mapbox-gl/dist/mapbox-gl-csp-worker';
mapboxgl.workerUrl = mbWorkerUrl;
mapboxgl.setRTLTextPlugin(mbRtlPlugin);

interface Props {
export interface Props {
isMapReady: boolean;
settings: MapSettings;
layerList: ILayer[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { EuiButtonIcon } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { ILayer } from '../../../classes/layers/layer';

interface Props {
export interface Props {
layerList: ILayer[];
fitToBounds: () => void;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const DRAW_DISTANCE_LABEL_SHORT = i18n.translate(
}
);

interface Props {
export interface Props {
cancelDraw: () => void;
geoFields: GeoFieldWithIndex[];
initiateDraw: (drawState: DrawState) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n';
import { ILayer } from '../../../../../../classes/layers/layer';
import { TOCEntryButton } from '../toc_entry_button';

interface Props {
export interface Props {
cloneLayer: (layerId: string) => void;
displayName: string;
editLayer: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import {
unsavedChangesWarning,
} from '../saved_map';

interface Props {
export interface Props {
savedMap: SavedMap;
// saveCounter used to trigger MapApp render after SaveMap.save
saveCounter: number;
Expand Down Expand Up @@ -83,7 +83,7 @@ interface Props {
setHeaderActionMenu: AppMountParameters['setHeaderActionMenu'];
}

interface State {
export interface State {
initialized: boolean;
indexPatterns: IndexPattern[];
savedQuery?: SavedQuery;
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/maps/public/url_generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +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.
*/

import rison from 'rison-node';
import {
TimeRange,
Expand Down
25 changes: 25 additions & 0 deletions x-pack/plugins/maps/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"common/**/*",
"public/**/*",
"server/**/*",
"config.ts",
"../../../typings/**/*",
],
"references": [
{ "path": "../../../src/core/tsconfig.json" },
{ "path": "../../../src/plugins/maps_legacy/tsconfig.json" },
{ "path": "../features/tsconfig.json" },
{ "path": "../licensing/tsconfig.json" },
{ "path": "../maps_file_upload/tsconfig.json" },
{ "path": "../saved_objects_tagging/tsconfig.json" },
]
}
15 changes: 15 additions & 0 deletions x-pack/plugins/maps_file_upload/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": ["common/**/*", "public/**/*", "server/**/*", "mappings.ts"],
"references": [
{ "path": "../../../src/plugins/data/tsconfig.json" },
{ "path": "../../../src/plugins/usage_collection/tsconfig.json" }
]
}
14 changes: 14 additions & 0 deletions x-pack/plugins/maps_legacy_licensing/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": ["public/**/*"],
"references": [
{ "path": "../licensing/tsconfig.json" },
]
}
6 changes: 6 additions & 0 deletions x-pack/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"plugins/event_log/**/*",
"plugins/licensing/**/*",
"plugins/lens/**/*",
"plugins/maps/**/*",
"plugins/maps_file_upload/**/*",
"plugins/maps_legacy_licensing/**/*",
"plugins/searchprofiler/**/*",
"plugins/security_solution/cypress/**/*",
"plugins/task_manager/**/*",
Expand Down Expand Up @@ -86,6 +89,9 @@
{ "path": "./plugins/event_log/tsconfig.json" },
{ "path": "./plugins/licensing/tsconfig.json" },
{ "path": "./plugins/lens/tsconfig.json" },
{ "path": "./plugins/maps/tsconfig.json" },
{ "path": "./plugins/maps_file_upload/tsconfig.json" },
{ "path": "./plugins/maps_legacy_licensing/tsconfig.json" },
{ "path": "./plugins/searchprofiler/tsconfig.json" },
{ "path": "./plugins/task_manager/tsconfig.json" },
{ "path": "./plugins/telemetry_collection_xpack/tsconfig.json" },
Expand Down
3 changes: 3 additions & 0 deletions x-pack/tsconfig.refs.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
{ "path": "./plugins/features/tsconfig.json" },
{ "path": "./plugins/graph/tsconfig.json" },
{ "path": "./plugins/embeddable_enhanced/tsconfig.json" },
{ "path": "./plugins/maps/tsconfig.json" },
{ "path": "./plugins/maps_file_upload/tsconfig.json" },
{ "path": "./plugins/maps_legacy_licensing/tsconfig.json" },
{ "path": "./plugins/searchprofiler/tsconfig.json" },
{ "path": "./plugins/task_manager/tsconfig.json" },
{ "path": "./plugins/telemetry_collection_xpack/tsconfig.json" },
Expand Down

0 comments on commit fb74c3c

Please sign in to comment.