Skip to content

Commit

Permalink
fix(NA): uniqWith to uniqBy
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic committed Jun 18, 2020
1 parent e0c1415 commit 329f71d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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 { uniqWith } from 'lodash';
import { uniqBy } from 'lodash';
import { i18n } from '@kbn/i18n';
import { ExpressionFunctionDefinition } from '../../expression_functions';
import { KibanaContext } from '../../expression_types';
Expand All @@ -40,7 +40,7 @@ const getParsedValue = (data: any, defaultValue: any) =>
typeof data === 'string' && data.length ? JSON.parse(data) || defaultValue : defaultValue;

const mergeQueries = (first: Query | Query[] = [], second: Query | Query[]) =>
uniqWith<Query>(
uniqBy<Query>(
[...(Array.isArray(first) ? first : [first]), ...(Array.isArray(second) ? second : [second])],
(n: any) => JSON.stringify(n.query) as any
);
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/canvas/canvas_plugin_src/uis/views/pie.js
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 { map, uniqBy } from 'lodash';
import { map, uniq } from 'lodash';
import { legendOptions } from '../../../public/lib/legend_options';
import { getState, getValue } from '../../../public/lib/resolved_arg';
import { ViewStrings } from '../../../i18n';
Expand Down Expand Up @@ -93,6 +93,6 @@ export const pie = () => ({
if (getState(context) !== 'ready') {
return { labels: [] };
}
return { labels: uniqBy(map(getValue(context).rows, 'color').filter((v) => v !== undefined)) };
return { labels: uniq(map(getValue(context).rows, 'color').filter((v) => v !== undefined)) };
},
});

0 comments on commit 329f71d

Please sign in to comment.