Commit d9209acf authored by Dhiraj Bodicherla's avatar Dhiraj Bodicherla

Use lodash instead of underscore in frequent items

parent f3a7b371
<script> <script>
/* eslint-disable vue/require-default-prop */ /* eslint-disable vue/require-default-prop */
import _ from 'underscore'; import { isEmpty, isString } from 'lodash';
import Identicon from '~/vue_shared/components/identicon.vue'; import Identicon from '~/vue_shared/components/identicon.vue';
import highlight from '~/lib/utils/highlight'; import highlight from '~/lib/utils/highlight';
import { truncateNamespace } from '~/lib/utils/text_utility'; import { truncateNamespace } from '~/lib/utils/text_utility';
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
}, },
computed: { computed: {
hasAvatar() { hasAvatar() {
return _.isString(this.avatarUrl) && !_.isEmpty(this.avatarUrl); return isString(this.avatarUrl) && !isEmpty(this.avatarUrl);
}, },
truncatedNamespace() { truncatedNamespace() {
return truncateNamespace(this.namespace); return truncateNamespace(this.namespace);
......
<script> <script>
import _ from 'underscore'; import { debounce } from 'lodash';
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
}, },
}, },
watch: { watch: {
searchQuery: _.debounce(function debounceSearchQuery() { searchQuery: debounce(function debounceSearchQuery() {
this.setSearchQuery(this.searchQuery); this.setSearchQuery(this.searchQuery);
}, 500), }, 500),
}, },
......
import _ from 'underscore'; import { take } from 'lodash';
import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils'; import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
import sanitize from 'sanitize-html'; import sanitize from 'sanitize-html';
import { FREQUENT_ITEMS, HOUR_IN_MS } from './constants'; import { FREQUENT_ITEMS, HOUR_IN_MS } from './constants';
...@@ -31,7 +31,7 @@ export const getTopFrequentItems = items => { ...@@ -31,7 +31,7 @@ export const getTopFrequentItems = items => {
return 0; return 0;
}); });
return _.first(frequentItems, frequentItemsCount); return take(frequentItems, frequentItemsCount);
}; };
export const updateExistingFrequentItem = (frequentItem, item) => { export const updateExistingFrequentItem = (frequentItem, item) => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment