Skip to content

Commit

Permalink
chore(NA): move kibana_legacy, saved_objects saved_objects_management…
Browse files Browse the repository at this point in the history
… into lodash3
  • Loading branch information
mistic committed Jun 24, 2020
1 parent dda3777 commit 2d10fe4
Show file tree
Hide file tree
Showing 29 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
IRootScopeService,
} from 'angular';
import $ from 'jquery';
import { cloneDeep, forOwn, get, set } from 'lodash4';
import { cloneDeep, forOwn, get, set } from 'lodash3';
import * as Rx from 'rxjs';
import { ChromeBreadcrumb, EnvironmentMode, PackageInfo } from 'kibana/public';
import { History } from 'history';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kibana_legacy/public/angular/promises.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 'lodash3';

export function PromiseServiceCreator($q, $timeout) {
function Promise(fn) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kibana_legacy/public/angular/watch_multi.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 'lodash3';

export function watchMultiDecorator($provide) {
$provide.decorator('$rootScope', function ($delegate) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable */

import { once } from 'lodash4';
import { once } from 'lodash3';
import angular from 'angular';

// @ts-ignore
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 'lodash3';

const getRootCause = (err: Record<string, any> | string) => _.get(err, 'resp.error.root_cause');

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kibana_legacy/public/notify/lib/format_msg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import _ from 'lodash4';
import _ from 'lodash3';
import { i18n } from '@kbn/i18n';
import { formatESMsg } from './format_es_msg';
const has = _.has;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kibana_legacy/public/paginate/paginate.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 'lodash3';
import { i18n } from '@kbn/i18n';
import paginateControlsTemplate from './paginate_controls.html';

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

import { has } from 'lodash4';
import { has } from 'lodash3';
import { Query } from 'src/plugins/data/public';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kibana_legacy/public/utils/private.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
*
* @param {[type]} prov [description]
*/
import _ from 'lodash4';
import _ from 'lodash3';

const nextId = _.partial(_.uniqueId, 'privateProvider#');

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kibana_legacy/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
CoreStart,
PluginConfigDescriptor,
} from 'kibana/server';
import { get } from 'lodash4';
import { get } from 'lodash3';

import { configSchema, ConfigSchema } from '../config';

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('lodash3', () => ({
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 'lodash3';
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 'lodash3';
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 'lodash3';
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 'lodash3';
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 'lodash3';
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 'lodash3';
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 'lodash3';
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 'lodash3';

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 'lodash3';
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 'lodash3';
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 'lodash3';

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 'lodash3';
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 'lodash3';
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 'lodash3';
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('lodash3', () => ({
...jest.requireActual('lodash3'),
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 'lodash3';
// @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 'lodash3';
import { i18n } from '@kbn/i18n';
import { CoreStart, ChromeBreadcrumb } from 'src/core/public';
import { DataPublicPluginStart } 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 { times } from 'lodash4';
import { times } from 'lodash3';
import { SavedObjectsFindOptions, SavedObject } from 'src/core/server';
import { savedObjectsClientMock } from '../../../../core/server/mocks';
import { findAll } from './find_all';
Expand Down

0 comments on commit 2d10fe4

Please sign in to comment.