mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
fix PostsEditForm (no need of wrapping in container, it already has the data); clean unnecessary propTypes / import
This commit is contained in:
parent
c2117a6fcc
commit
be0576d125
2 changed files with 10 additions and 14 deletions
|
@ -56,29 +56,26 @@ class PostsEditForm extends Component {
|
|||
return (
|
||||
<div className="posts-edit-form">
|
||||
{this.renderAdminArea()}
|
||||
<Telescope.components.PostsSingleContainer
|
||||
postId={this.props.post._id}
|
||||
component={NovaForm}
|
||||
componentProps={{
|
||||
collection: Posts,
|
||||
mutationName: "postsEdit",
|
||||
resultQuery: Posts.graphQLQueries.single,
|
||||
successCallback: (post) => {
|
||||
this.context.closeCallback();
|
||||
this.props.flash(this.context.intl.formatMessage({id: "posts.edit_success"}, {title: post.title}), 'success');
|
||||
}
|
||||
<NovaForm
|
||||
collection={Posts}
|
||||
mutationName="postsEdit"
|
||||
document={this.props.post}
|
||||
resultQuery={Posts.graphQLQueries.single}
|
||||
successCallback={post => {
|
||||
this.context.closeCallback();
|
||||
this.props.flash(this.context.intl.formatMessage({id: "posts.edit_success"}, {title: post.title}), 'success');
|
||||
}}
|
||||
/>
|
||||
<hr/>
|
||||
<a onClick={this.deletePost} className="delete-post-link"><Telescope.components.Icon name="close"/> <FormattedMessage id="posts.delete"/></a>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
PostsEditForm.propTypes = {
|
||||
flash: React.PropTypes.func,
|
||||
novaFormMutation: React.PropTypes.func,
|
||||
post: React.PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import Telescope from 'meteor/nova:lib';
|
||||
import React, { PropTypes, Component } from 'react';
|
||||
import Posts from "meteor/nova:posts";
|
||||
import Users from "meteor/nova:users";
|
||||
import { graphql } from 'react-apollo';
|
||||
import gql from 'graphql-tag';
|
||||
|
|
Loading…
Add table
Reference in a new issue