Added ways to define the save location of the document

This commit is contained in:
Jori Lallo
2017-09-19 00:13:49 -07:00
parent d3313632ce
commit 3648c11a41
3 changed files with 28 additions and 5 deletions

View File

@ -15,6 +15,11 @@ import { DropdownMenu, DropdownMenuItem } from 'components/DropdownMenu';
collection: Collection,
};
onNewDocument = () => {
const { collection, history } = this.props;
history.push(`${collection.url}/new`);
};
onEdit = () => {
const { collection } = this.props;
this.props.ui.setActiveModal('collection-edit', { collection });
@ -31,6 +36,10 @@ import { DropdownMenu, DropdownMenuItem } from 'components/DropdownMenu';
return (
<DropdownMenu label={label || <Icon type="MoreHorizontal" />}>
{collection &&
<DropdownMenuItem onClick={this.onNewDocument}>
New document
</DropdownMenuItem>}
{collection &&
<DropdownMenuItem onClick={this.onEdit}>Edit</DropdownMenuItem>}
{allowDelete &&