Added facts status

This commit is contained in:
vjrj 2018-01-31 10:43:15 +01:00
parent 81acc255d7
commit 67ab0186b5
6 changed files with 53 additions and 0 deletions

View file

@ -60,3 +60,4 @@ mongo-livedata
reywood:publish-composite
barbatus:stars-rating
arkham:comments-ui
facts

View file

@ -45,6 +45,7 @@ ejson@1.1.0
email@1.2.3
es5-shim@4.6.15
facebook-oauth@1.4.0
facts@1.0.9
flowkey:raven@1.0.0
fortawesome:fontawesome@4.7.0
fourseven:scss@4.5.4

View file

@ -0,0 +1,9 @@
/* global Facts */
import { Roles } from 'meteor/alanning:roles';
import { Meteor } from 'meteor/meteor';
Facts.setUserIdFilter((userId) => {
const user = Meteor.users.findOne(userId);
console.log(`User roles: ${user.roles}`);
return Roles.userIsInRole(userId, ['admin']);
});

View file

@ -6,4 +6,5 @@ import './email';
import './IPGeocoder';
import './migrations';
import './notificationsObserver';
import './facts';
import '../common/comments';

View file

@ -31,6 +31,7 @@ import Signup from '../../pages/Signup/Signup';
import Auth from '../../pages/Auth/Auth';
import Login from '../../pages/Login/Login';
import Logout from '../../pages/Logout/Logout';
import Status from '../../pages/Status/Status';
import VerifyEmail from '../../pages/VerifyEmail/VerifyEmail';
import RecoverPassword from '../../pages/RecoverPassword/RecoverPassword';
import ResetPassword from '../../pages/ResetPassword/ResetPassword';
@ -75,6 +76,7 @@ const App = props => (
<Authenticated exact path="/subscriptions/:_id" component={ViewSubscription} {...props} />
<Authenticated exact path="/subscriptions/:_id/edit" component={EditSubscription} {...props} />
<Authenticated exact path="/profile" component={Profile} {...props} />
<Authenticated exact path="/status" component={Status} {...props} />
<Route path="/fires" component={FiresMap} {...props} />
<Route path="/fire/:id" component={Fires} {...props} />
<Public path="/auth/:token" component={Auth} {...props} />

View file

@ -0,0 +1,39 @@
/* eslint-disable react/jsx-indent-props */
/* eslint-disable import/no-absolute-path */
/* eslint-disable import/no-absolute-path */
import React, { Fragment, Component } from 'react';
import PropTypes from 'prop-types';
import { translate } from 'react-i18next';
import { withTracker } from 'meteor/react-meteor-data';
import Blaze from 'meteor/gadicc:blaze-react-component';
class Status extends Component {
constructor(props) {
super(props);
this.t = props.t;
this.state = {
};
}
render() {
return (
<Fragment>
<h4 className="page-header">Status</h4>
<Blaze template="serverFacts" />
</Fragment>
);
}
}
Status.propTypes = {
t: PropTypes.func.isRequired
};
Status.defaultProps = {
};
// export default translate([], { wait: true })(Status);
export default translate([], { wait: true })(withTracker(props => ({
// props.something
}))(Status));