diff --git a/frontend/components/Layout/components/Title/Title.js b/frontend/components/Layout/components/Title/Title.js index e5a6a7b1..f3ac25bc 100644 --- a/frontend/components/Layout/components/Title/Title.js +++ b/frontend/components/Layout/components/Title/Title.js @@ -1,5 +1,5 @@ import React from 'react'; -import _truncate from 'lodash/truncate'; +import _ from 'lodash'; import styles from './Title.scss'; import classNames from 'classnames/bind'; @@ -15,7 +15,7 @@ class Title extends React.Component { render() { let title; if (this.props.truncate) { - title = _truncate(this.props.children, this.props.truncate); + title = _.truncate(this.props.children, this.props.truncate); } else { title = this.props.children; } diff --git a/frontend/scenes/DocumentScene/DocumentSceneStore.js b/frontend/scenes/DocumentScene/DocumentSceneStore.js index 84dd0ce0..ff7d8eba 100644 --- a/frontend/scenes/DocumentScene/DocumentSceneStore.js +++ b/frontend/scenes/DocumentScene/DocumentSceneStore.js @@ -1,6 +1,4 @@ -import _isEqual from 'lodash/isEqual'; -import _indexOf from 'lodash/indexOf'; -import _without from 'lodash/without'; +import _ from 'lodash'; import { observable, action, computed, runInAction, toJS, autorunAsync } from 'mobx'; import { client } from 'utils/ApiClient'; import { browserHistory } from 'react-router'; @@ -35,7 +33,7 @@ class DocumentSceneStore { } node.children = node.children.map(childNode => { return collapseNodes(childNode); - }) + }); return node; }; @@ -83,7 +81,7 @@ class DocumentSceneStore { @action updateNavigationTree = async (tree) => { // Only update when tree changes - if (_isEqual(toJS(tree), toJS(this.document.collection.navigationTree))) { + if (_.isEqual(toJS(tree), toJS(this.document.collection.navigationTree))) { return true; } @@ -105,8 +103,8 @@ class DocumentSceneStore { } @action onNodeCollapse = (nodeId, collapsed) => { - if (_indexOf(this.collapsedNodes, nodeId) >= 0) { - this.collapsedNodes = _without(this.collapsedNodes, nodeId); + if (_.indexOf(this.collapsedNodes, nodeId) >= 0) { + this.collapsedNodes = _.without(this.collapsedNodes, nodeId); } else { this.collapsedNodes.push(nodeId); } diff --git a/frontend/scenes/Search/Search.js b/frontend/scenes/Search/Search.js index fe457d1c..e64cfe1c 100644 --- a/frontend/scenes/Search/Search.js +++ b/frontend/scenes/Search/Search.js @@ -1,6 +1,6 @@ import React from 'react'; import { observer } from 'mobx-react'; -import _debounce from 'lodash/debounce'; +import _ from 'lodash'; import { Flex } from 'reflexbox'; import Layout from 'components/Layout'; @@ -22,7 +22,7 @@ class Search extends React.Component { } render() { - const search = _debounce((searchTerm) => { + const search = _.debounce((searchTerm) => { this.store.search(searchTerm); }, 250); diff --git a/server/models/Atlas.js b/server/models/Atlas.js index 8afca2e6..3086ef76 100644 --- a/server/models/Atlas.js +++ b/server/models/Atlas.js @@ -2,7 +2,7 @@ import { DataTypes, sequelize, } from '../sequelize'; -import _isEqual from 'lodash/isEqual'; +import _ from 'lodash'; import Document from './Document'; const allowedAtlasTypes = [['atlas', 'journal']]; @@ -121,7 +121,7 @@ const Atlas = sequelize.define('atlas', { }); const documentIds = documents.map(doc => doc.id); - if (!_isEqual(nodeIds.sort(), documentIds.sort())) { + if (!_.isEqual(nodeIds.sort(), documentIds.sort())) { throw new Error('Invalid navigation tree'); }