mirror of
https://github.com/vale981/Vulcan
synced 2025-03-08 19:11:38 -05:00
fix small issue with users edit form when logged out
This commit is contained in:
parent
4ca3cab7ce
commit
6c5fc6c0dd
3 changed files with 3 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
import { Components, addRoute } from 'meteor/nova:core';
|
||||
|
||||
addRoute([
|
||||
{name:'posts.list', path: '/', component: Components.PostsHome }, // index route
|
||||
{name:'posts.list', path: '/', component: Components.PostsHome }, // index route
|
||||
{name:'posts.daily', path:'daily', component: Components.PostsDaily},
|
||||
{name:'posts.single', path:'posts/:_id(/:slug)', component: Components.PostsSingle},
|
||||
{name:'users.single', path:'users/:slug', component: Components.UsersSingle},
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { Components, registerComponent } from 'meteor/nova:lib';
|
||||
import React, { PropTypes, Component } from 'react';
|
||||
import { FormattedMessage, intlShape } from 'react-intl';
|
||||
import { Row, Col } from 'react-bootstrap';
|
||||
import SmartForm from "meteor/nova:forms";
|
||||
import Users from 'meteor/nova:users';
|
||||
import { ShowIf, withCurrentUser, withDocument, withMessages } from 'meteor/nova:core';
|
||||
|
@ -11,14 +10,14 @@ const UsersEditForm = (props, context) => {
|
|||
return (
|
||||
<ShowIf
|
||||
check={Users.options.mutations.edit.check}
|
||||
document={{_id: props.userId || props.document._id}}
|
||||
document={{_id: props.userId || props.document && props.document._id}}
|
||||
failureComponent={<FormattedMessage id="app.noPermission"/>}
|
||||
>
|
||||
<div className="page users-edit-form">
|
||||
<h2 className="page-title users-edit-form-title"><FormattedMessage id="users.edit_account"/></h2>
|
||||
<SmartForm
|
||||
collection={Users}
|
||||
documentId={props.userId || props.document._id}
|
||||
documentId={props.userId || props.document && props.document._id}
|
||||
queryToUpdate="usersSingleQuery"
|
||||
successCallback={user => {
|
||||
props.flash(context.intl.formatMessage({id: "users.edit_success"}, {name: Users.getDisplayName(user)}), 'success')
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { registerComponent } from 'meteor/nova:lib';
|
||||
import React, { PropTypes } from 'react';
|
||||
import Users from 'meteor/nova:users';
|
||||
import withCurrentUser from '../containers/withCurrentUser.js';
|
||||
|
||||
const ShowIf = props => {
|
||||
|
|
Loading…
Add table
Reference in a new issue