Skip to content

Commit

Permalink
Revert "chore(NA): upgrade usage_collection, ui_actions, tile_map, te…
Browse files Browse the repository at this point in the history
…lemtry, share, saved_objects, saved_objects_management, region_map and navigation to lodash4"

This reverts commit 137055c.
  • Loading branch information
mistic committed Jun 24, 2020
1 parent 92b85bf commit f7e7368
Show file tree
Hide file tree
Showing 36 changed files with 44 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { upperFirst, isFunction } from 'lodash4';
import { capitalize, isFunction } from 'lodash';
import React, { MouseEvent } from 'react';
import { EuiButtonEmpty, EuiToolTip } from '@elastic/eui';

Expand Down Expand Up @@ -50,11 +50,11 @@ export function TopNavMenuItem(props: TopNavMenuData) {

const btn = props.emphasize ? (
<EuiButton {...commonButtonProps} size="s" fill>
{upperFirst(props.label || props.id!)}
{capitalize(props.label || props.id!)}
</EuiButton>
) : (
<EuiButtonEmpty {...commonButtonProps} size="xs">
{upperFirst(props.label || props.id!)}
{capitalize(props.label || props.id!)}
</EuiButtonEmpty>
);

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

import expect from '@kbn/expect';
import ngMock from 'ng_mock';
import _ from 'lodash4';
import _ from 'lodash';

import ChoroplethLayer from '../choropleth_layer';
import { ImageComparator } from 'test_utils/image_comparator';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/region_map/public/choropleth_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import $ from 'jquery';
import _ from 'lodash4';
import _ from 'lodash';
import d3 from 'd3';
import { i18n } from '@kbn/i18n';
import * as topojson from 'topojson-client';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

jest.mock('lodash4', () => ({
jest.mock('lodash', () => ({
debounce: (fn: any) => fn,
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import _ from 'lodash4';
import _ from 'lodash';
import PropTypes from 'prop-types';
import React from 'react';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import _ from 'lodash4';
import _ from 'lodash';
import { EsResponse, SavedObject, SavedObjectConfig, SavedObjectKibanaServices } from '../../types';
import { SavedObjectNotFound } from '../../../../kibana_utils/public';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { once } from 'lodash4';
import { once } from 'lodash';
import { hydrateIndexPattern } from './hydrate_index_pattern';
import { intializeSavedObject } from './initialize_saved_object';
import { serializeSavedObject } from './serialize_saved_object';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import _ from 'lodash4';
import _ from 'lodash';
import { i18n } from '@kbn/i18n';
import { SavedObjectAttributes } from 'kibana/public';
import { SavedObject, SavedObjectKibanaServices } from '../../types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import _ from 'lodash4';
import _ from 'lodash';
import { SavedObjectsClientContract } from 'kibana/public';
import { SavedObject, SavedObjectConfig } from '../../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { get } from 'lodash4';
import { get } from 'lodash';
import { i18n } from '@kbn/i18n';
import {
SavedObjectAttributes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import _ from 'lodash4';
import _ from 'lodash';
import { SavedObject, SavedObjectConfig } from '../../types';
import { extractSearchSourceReferences, expandShorthand } from '../../../../data/public';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { mapKeys, camelCase } from 'lodash4';
import { mapKeys, camelCase } from 'lodash';

export function keysToCamelCaseShallow(object: Record<string, any>) {
return mapKeys(object, (value, key) => camelCase(key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { forOwn, keyBy, isNumber, isBoolean, isPlainObject, isString } from 'lodash4';
import { forOwn, indexBy, isNumber, isBoolean, isPlainObject, isString } from 'lodash';
import { SimpleSavedObject } from '../../../../core/public';
import { castEsToKbnFieldTypeName } from '../../../data/public';
import { ObjectField } from '../management_section/types';
Expand Down Expand Up @@ -93,9 +93,9 @@ const addFieldsFromClass = function (
Class: { mapping: Record<string, string>; searchSource: any },
fields: ObjectField[]
) {
const fieldMap = keyBy(fields, 'name');
const fieldMap = indexBy(fields, 'name');

forOwn(Class.mapping, (esType, name) => {
_.forOwn(Class.mapping, (esType, name) => {
if (!name || fieldMap[name]) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { HttpStart } from 'src/core/public';
import { get } from 'lodash4';
import { get } from 'lodash';
import { SavedObjectRelation } from '../types';

export async function getRelationships(
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/saved_objects_management/public/lib/numeric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { isNaN } from 'lodash4';
import { isNaN } from 'lodash';

export function isNumeric(v: any): boolean {
return !isNaN(v) && (typeof v === 'number' || (!Array.isArray(v) && !isNaN(parseFloat(v))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { i18n } from '@kbn/i18n';
import { cloneDeep } from 'lodash4';
import { cloneDeep } from 'lodash';
import { OverlayStart, SavedObjectReference } from 'src/core/public';
import { SavedObject, SavedObjectLoader } from '../../../saved_objects/public';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
EuiButtonEmpty,
EuiSpacer,
} from '@elastic/eui';
import { cloneDeep, set } from 'lodash4';
import { cloneDeep, set } from 'lodash';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { SimpleSavedObject, SavedObjectsClientContract } from '../../../../../../core/public';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import React, { Component, Fragment } from 'react';
import { take, get as getField } from 'lodash4';
import { take, get as getField } from 'lodash';
import {
EuiFlyout,
EuiFlyoutBody,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jest.doMock('@elastic/filesaver', () => ({
saveAs: saveAsMock,
}));

jest.doMock('lodash4', () => ({
...jest.requireActual('lodash4'),
jest.doMock('lodash', () => ({
...jest.requireActual('lodash'),
debounce: (func: Function) => {
function debounced(this: any, ...args: any[]) {
return func.apply(this, args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import React, { Component } from 'react';
import { debounce } from 'lodash4';
import { debounce } from 'lodash';
// @ts-ignore
import { saveAs } from '@elastic/filesaver';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import React, { useEffect } from 'react';
import { get } from 'lodash4';
import { get } from 'lodash';
import { i18n } from '@kbn/i18n';
import { CoreStart, ChromeBreadcrumb } from 'src/core/public';
import { DataPublicPluginStart } from '../../../data/public';
Expand Down Expand Up @@ -78,7 +78,7 @@ const SavedObjectsTablePage = ({
}}
canGoInApp={(savedObject) => {
const { inAppUrl } = savedObject.meta;
return inAppUrl ? (get(capabilities, inAppUrl.uiCapabilitiesPath) as any) : false;
return inAppUrl ? get(capabilities, inAppUrl.uiCapabilitiesPath) : false;
}}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { times } from 'lodash4';
import { times } from 'lodash';
import { SavedObjectsFindOptions, SavedObject } from 'src/core/server';
import { savedObjectsClientMock } from '../../../../core/server/mocks';
import { findAll } from './find_all';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { parse } from 'url';
import { trim } from 'lodash4';
import { trim } from 'lodash';
import Boom from 'boom';

export function shortUrlAssertValid(url: string) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/share/server/routes/lib/short_url_lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import crypto from 'crypto';
import { get } from 'lodash4';
import { get } from 'lodash';

import { Logger, SavedObject, SavedObjectsClientContract } from 'kibana/server';

Expand Down
6 changes: 3 additions & 3 deletions src/plugins/share/server/saved_objects/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
import { SavedObjectsType } from 'kibana/server';
import { flow } from 'lodash4';
import { SavedObjectMigrationFn, SavedObjectsType } from 'kibana/server';
import { flow } from 'lodash';
import { migrateLegacyKibanaAppShortUrls } from './kibana_app_migration';

export const url: SavedObjectsType = {
Expand All @@ -33,7 +33,7 @@ export const url: SavedObjectsType = {
},
},
migrations: {
'7.9.0': flow(migrateLegacyKibanaAppShortUrls),
'7.9.0': flow<SavedObjectMigrationFn>(migrateLegacyKibanaAppShortUrls),
},
mappings: {
properties: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import sinon from 'sinon';
import { mockGetClusterInfo } from './get_cluster_info';
import { mockGetClusterStats } from './get_cluster_stats';

import { omit } from 'lodash4';
import { omit } from 'lodash';
import { getLocalStats, handleLocalStats } from '../get_local_stats';

const mockUsageCollection = (kibanaUsage = {}) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { omit } from 'lodash4';
import { omit } from 'lodash';
import { UsageCollectionSetup } from 'src/plugins/usage_collection/server';
import { APICaller } from 'kibana/server';
import { StatsCollectionContext } from 'src/plugins/telemetry_collection_manager/server';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/tile_map/public/css_filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import _ from 'lodash4';
import _ from 'lodash';

/**
* just a place to put feature detection checks
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/tile_map/public/geohash_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { min, isEqual } from 'lodash4';
import { min, isEqual } from 'lodash';
import { i18n } from '@kbn/i18n';
import { L, KibanaMapLayer, MapTypes } from '../../maps_legacy/public';
import { HeatmapMarkers } from './markers/heatmap';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/tile_map/public/markers/heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import _ from 'lodash4';
import _ from 'lodash';
import d3 from 'd3';
import { EventEmitter } from 'events';
import { L } from '../../../maps_legacy/public';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/tile_map/public/markers/scaled_circles.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import _ from 'lodash4';
import _ from 'lodash';
import d3 from 'd3';
import $ from 'jquery';
import { EventEmitter } from 'events';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/tile_map/public/markers/shaded_circles.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import _ from 'lodash4';
import _ from 'lodash';
import { ScaledCirclesMarkers } from './scaled_circles';
import { L } from '../../../maps_legacy/public';

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/tile_map/public/tile_map_visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { get } from 'lodash4';
import { get } from 'lodash';
import { GeohashLayer } from './geohash_layer';
import { getFormatService, getQueryService } from './services';
import { scaleBounds, geoContains, mapTooltipProvider } from '../../maps_legacy/public';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import * as React from 'react';
import { EuiContextMenuPanelDescriptor, EuiContextMenuPanelItemDescriptor } from '@elastic/eui';
import _ from 'lodash4';
import _ from 'lodash';
import { i18n } from '@kbn/i18n';
import { uiToReactComponent } from '../../../kibana_react/public';
import { Action } from '../actions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { noop } from 'lodash4';
import { noop } from 'lodash';
import { Collector } from './collector';
import { CollectorSet } from './collector_set';
import { UsageCollector } from './usage_collector';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { snakeCase } from 'lodash4';
import { snakeCase } from 'lodash';
import { Logger, APICaller } from 'kibana/server';
import { Collector, CollectorOptions } from './collector';
import { UsageCollector } from './usage_collector';
Expand Down

0 comments on commit f7e7368

Please sign in to comment.