diff --git a/frontend/components/FullscreenField/FullscreenField.js b/frontend/components/FullscreenField/FullscreenField.js
deleted file mode 100644
index 2fc4b80d..00000000
--- a/frontend/components/FullscreenField/FullscreenField.js
+++ /dev/null
@@ -1,39 +0,0 @@
-import React from 'react';
-
-import CenteredContent from 'components/CenteredContent';
-import { Button } from 'rebass';
-
-import styles from './FullscreenField.scss';
-import classNames from 'classnames/bind';
-const cx = classNames.bind(styles);
-
-class FullscreenField extends React.Component {
- render() {
- return (
-
-
-
-
Create a new collection
-
Collections are spaces where you, your teams or friends can share and collect information.
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default FullscreenField;
diff --git a/frontend/components/FullscreenField/FullscreenField.scss b/frontend/components/FullscreenField/FullscreenField.scss
deleted file mode 100644
index ca1e4c99..00000000
--- a/frontend/components/FullscreenField/FullscreenField.scss
+++ /dev/null
@@ -1,46 +0,0 @@
-.container {
- position: fixed;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
-
- display: flex;
- justify-content: center;
-
- background-color: #fff;
-}
-
-.content {
- padding: 100px 0;
-}
-
-.field {
- padding: 20px 0;
-
- .label {
- font-size: 16px;
- font-weight: bold;
- color: #242425;
- }
-
- input {
- font-size: 32px;
- width: 100%;
- padding: 5px 0;
-
- border: 0;
- border-bottom: 1px solid #242425;
- border-radius: 0;
-
- outline: none;
- }
-}
-
-.button {
- font-size: 20px;
- background-color: #171B35;
- color: #FAFAFA;
- padding: 8px 20px 5px;
- border: none;
-}
diff --git a/frontend/components/FullscreenField/index.js b/frontend/components/FullscreenField/index.js
deleted file mode 100644
index 12ae902e..00000000
--- a/frontend/components/FullscreenField/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-import FullscreenField from './FullscreenField';
-export default FullscreenField;
\ No newline at end of file
diff --git a/frontend/scenes/Dashboard/Dashboard.js b/frontend/scenes/Dashboard/Dashboard.js
index 9a7e0549..b12ad153 100644
--- a/frontend/scenes/Dashboard/Dashboard.js
+++ b/frontend/scenes/Dashboard/Dashboard.js
@@ -9,7 +9,6 @@ import AtlasPreview from 'components/AtlasPreview';
import AtlasPreviewLoading from 'components/AtlasPreviewLoading';
import CenteredContent from 'components/CenteredContent';
import DropdownMenu, { MenuItem, MoreIcon } from 'components/DropdownMenu';
-import FullscreenField from 'components/FullscreenField';
// import styles from './Dashboard.scss';
@@ -19,26 +18,16 @@ class Dashboard extends React.Component {
user: React.PropTypes.object.isRequired,
}
- state = {
- newAtlasVisible: false,
- }
-
componentDidMount = () => {
store.fetchCollections(this.props.user.team.id);
}
- onClickNewAtlas = () => {
- this.setState({
- newAtlasVisible: true,
- });
- }
-
render() {
const actions = (
} >
@@ -59,8 +48,6 @@ class Dashboard extends React.Component {
-
- { this.state.newAtlasVisible && }
);
}
diff --git a/server/models/Atlas.js b/server/models/Atlas.js
index 3086ef76..c20b6b40 100644
--- a/server/models/Atlas.js
+++ b/server/models/Atlas.js
@@ -154,21 +154,19 @@ const Atlas = sequelize.define('atlas', {
},
async deleteDocument(document) {
const deleteNodeAndDocument = async (node, documentId, shouldDelete = false) => {
- if (document.id === node.id) {
- shouldDelete = true;
- }
+ // Delete node if id matches
+ if (document.id === node.id) shouldDelete = true;
+
const newChildren = [];
- node.children.map(async childNode => {
+ node.children.forEach(async childNode => {
const child = await deleteNodeAndDocument(childNode, documentId, shouldDelete);
- if (child) {
- newChildren.push(child);
- }
+ if (child) newChildren.push(child);
});
node.children = newChildren;
if (shouldDelete) {
- const document = await Document.findById(node.id);
- await document.destroy();
+ const doc = await Document.findById(node.id);
+ await doc.destroy();
}
return shouldDelete ? null : node;