changes per tom's comments

This commit is contained in:
Jori Lallo
2017-06-06 22:34:29 -07:00
parent a80f58b0e2
commit 9220978639
3 changed files with 6 additions and 12 deletions

View File

@@ -117,11 +117,7 @@ type Props = {
/>
: <a onClick={this.onEdit}>Edit</a>}
</HeaderAction>
<Menu
store={this.store}
document={this.store.document}
collectionTree={this.store.collectionTree}
/>
<Menu store={this.store} document={this.store.document} />
</Flex>
);

View File

@@ -11,7 +11,6 @@ import DocumentStore from '../DocumentStore';
type Props = {
history: Object,
document: DocumentType,
collectionTree: ?Object,
store: DocumentStore,
};
@@ -19,8 +18,9 @@ type Props = {
props: Props;
onCreateDocument = () => {
invariant(this.props.collectionTree, 'collectionTree is not available');
this.props.history.push(`${this.props.collectionTree.url}/new`);
// Disabled until created a better API
// invariant(this.props.collectionTree, 'collectionTree is not available');
// this.props.history.push(`${this.props.collectionTree.url}/new`);
};
onCreateChild = () => {
@@ -57,7 +57,6 @@ type Props = {
const document = get(this.props, 'document');
if (document) {
const collection = document.collection;
debugger;
const allowDelete =
collection &&
collection.type === 'atlas' &&
@@ -77,9 +76,8 @@ type Props = {
{allowDelete && <MenuItem onClick={this.onDelete}>Delete</MenuItem>}
</DropdownMenu>
);
} else {
return <div />;
}
return null;
}
}

View File

@@ -47,7 +47,7 @@ export async function presentDocument(ctx, document, options) {
id: document.atlasId,
},
}));
return await presentCollection(ctx, collection);
return presentCollection(ctx, collection);
});
}