diff --git a/client/modules/IDE/components/CollectionPopover/CollectionPopover.jsx b/client/modules/IDE/components/CollectionPopover/CollectionPopover.jsx index 79dbb1f8..05e57725 100644 --- a/client/modules/IDE/components/CollectionPopover/CollectionPopover.jsx +++ b/client/modules/IDE/components/CollectionPopover/CollectionPopover.jsx @@ -69,7 +69,12 @@ const CollectionPopover = ({ const handleSelect = inCollection ? handleRemoveFromCollection : handleAddToCollection; return ( - handleSelect(collection.id)} /> + handleSelect(collection.id)} + /> ); }) } @@ -89,7 +94,12 @@ const CollectionPopover = ({
- setSearchTerm('')} /> + setSearchTerm('')} + />
diff --git a/client/modules/IDE/components/SketchList.jsx b/client/modules/IDE/components/SketchList.jsx index f472d181..a0c14b80 100644 --- a/client/modules/IDE/components/SketchList.jsx +++ b/client/modules/IDE/components/SketchList.jsx @@ -256,7 +256,12 @@ class SketchListRowBase extends React.Component { } } - {this.state.showPopover && } + {this.state.showPopover && + + } ); } @@ -446,7 +451,8 @@ class SketchList extends React.Component { addMode={this.props.addMode} onCollectionAdd={() => this.handleCollectionAdd(sketch.id)} onCollectionRemove={() => this.handleCollectionRemove(sketch.id)} - inCollection={this.props.collection && this.props.collection.items.find(item => item.project.id === sketch.id) != null} + inCollection={this.props.collection && + this.props.collection.items.find(item => item.project.id === sketch.id) != null} />))} } @@ -505,7 +511,10 @@ function mapStateToProps(state) { } function mapDispatchToProps(dispatch) { - return bindActionCreators(Object.assign({}, ProjectsActions, CollectionsActions, ToastActions, SortingActions), dispatch); + return bindActionCreators( + Object.assign({}, ProjectsActions, CollectionsActions, ToastActions, SortingActions), + dispatch + ); } export default connect(mapStateToProps, mapDispatchToProps)(SketchList); diff --git a/client/modules/IDE/pages/IDEView.jsx b/client/modules/IDE/pages/IDEView.jsx index 6feca94f..99e37ba2 100644 --- a/client/modules/IDE/pages/IDEView.jsx +++ b/client/modules/IDE/pages/IDEView.jsx @@ -29,9 +29,6 @@ import * as ToastActions from '../actions/toast'; import * as ConsoleActions from '../actions/console'; import { getHTMLFile } from '../reducers/files'; import Overlay from '../../App/components/Overlay'; -import SketchList from '../components/SketchList'; -import Searchbar from '../components/Searchbar'; -import AssetList from '../components/AssetList'; import About from '../components/About'; import CollectionList from '../components/CollectionList'; import Feedback from '../components/Feedback'; diff --git a/client/modules/User/components/Collection.jsx b/client/modules/User/components/Collection.jsx index deb3efb1..41fbf13e 100644 --- a/client/modules/User/components/Collection.jsx +++ b/client/modules/User/components/Collection.jsx @@ -162,7 +162,7 @@ class CollectionItemRowBase extends React.Component { } render() { - const { item, username } = this.props; + const { item } = this.props; const { renameOpen, optionsOpen, renameValue } = this.state; const sketchOwnerUsername = item.project.user.username; const userIsOwner = this.props.user.username === sketchOwnerUsername; @@ -285,7 +285,9 @@ class Collection extends React.Component { isOwner() { let isOwner = false; - if (this.props.user != null && this.props.user.username && this.props.collection.owner.username === this.props.user.username) { + if (this.props.user != null && + this.props.user.username && + this.props.collection.owner.username === this.props.user.username) { isOwner = true; } @@ -307,7 +309,7 @@ class Collection extends React.Component { _renderCollectionMetadata() { const { - id, name, description, items, owner, slug + id, name, description, items, owner } = this.props.collection; const hostname = window.location.origin; @@ -331,13 +333,16 @@ class Collection extends React.Component { this.props.editCollection(id, { description: value }); }; - const handleEditCollectionSlug = (value) => { - if (value === slug) { - return; - } - - this.props.editCollection(id, { slug: value }); - }; + // + // TODO: Implement UI for editing slug + // + // const handleEditCollectionSlug = (value) => { + // if (value === slug) { + // return; + // } + // + // this.props.editCollection(id, { slug: value }); + // }; return (
@@ -518,7 +523,10 @@ function mapStateToProps(state, ownProps) { } function mapDispatchToProps(dispatch) { - return bindActionCreators(Object.assign({}, CollectionsActions, ProjectsActions, ToastActions, SortingActions), dispatch); + return bindActionCreators( + Object.assign({}, CollectionsActions, ProjectsActions, ToastActions, SortingActions), + dispatch + ); } export default connect(mapStateToProps, mapDispatchToProps)(Collection); diff --git a/client/modules/User/pages/DashboardView.jsx b/client/modules/User/pages/DashboardView.jsx index 13120e48..af03a42a 100644 --- a/client/modules/User/pages/DashboardView.jsx +++ b/client/modules/User/pages/DashboardView.jsx @@ -10,7 +10,7 @@ import Overlay from '../../App/components/Overlay'; import AssetList from '../../IDE/components/AssetList'; import CollectionList from '../../IDE/components/CollectionList'; import SketchList from '../../IDE/components/SketchList'; -import Searchbar from '../../IDE/components/Searchbar'; +import SketchSearchbar from '../../IDE/components/Searchbar'; import CollectionCreate from '../components/CollectionCreate'; import DashboardTabSwitcher, { TabKey } from '../components/DashboardTabSwitcher'; @@ -85,7 +85,7 @@ class DashboardView extends React.Component { default: return ( - + New sketch ); diff --git a/server/controllers/collection.controller/removeProjectFromCollection.js b/server/controllers/collection.controller/removeProjectFromCollection.js index 561a9ce7..679d0cc0 100644 --- a/server/controllers/collection.controller/removeProjectFromCollection.js +++ b/server/controllers/collection.controller/removeProjectFromCollection.js @@ -1,5 +1,4 @@ import Collection from '../../models/collection'; -import Project from '../../models/project'; export default function addProjectToCollection(req, res) { const owner = req.user._id;