Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
});
console.log(that.state.userLocation);
});
}
},
getInitialState: function(){
return {
outletData: [],
outletTable: 'hello',
userLocation: {}
};
},
mixins: [Router.Navigation], //makes the router navigation information available for use (need this for redirection)
componentDidMount: function() {
this.getLocation();
FooterCheck.checker();
var that = this;
// TODO: change function so that it retrieves only outlets near users location
outletStore.getOutlets().then(function(outletData){
outletData.map(function(outlet){
userStore.getUsernameById(outlet.id).then(function(user){
console.log(user.username)
outlet['seller'] = user.username;
that.setState({outletData: outletData});
});
});
});
},
var $ = require('jquery');
var jqueryUI = require('jquery-ui');
var React = require('react/addons');
var Navigation = require('react-router').Navigation;
var ReactBootstrap = require('react-bootstrap');
var Input = ReactBootstrap.Input;
var Button = ReactBootstrap.Button;
var ButtonToolbar = ReactBootstrap.ButtonToolbar;
var ButtonInput = ReactBootstrap.ButtonInput;
var Grid = ReactBootstrap.Grid;
var Row = ReactBootstrap.Row;
var Col = ReactBootstrap.Col;
var Tooltip = ReactBootstrap.Tooltip;
var OverlayTrigger = ReactBootstrap.OverlayTrigger;
var Landing = React.createClass({
mixins : [Navigation],
errorMessages: {badRepo: "Unable to fetch the requested repository. You may only gitualize public repositories. Please try again in a little while if you believe this is a mistake, we're doing our best :)"},
styles: {
containerStyle: {
import Router from 'react-router';
import ResourceActions from 'actions/ResourceActions';
import LinkMixin from 'components/LinkMixin';
var PT = React.PropTypes
export default React.createClass({
displayName: 'list/SearchBox',
mixins: [LinkMixin, Router.Navigation],
propTypes: {
name: PT.string,
pagination: PT.object,
transition: PT.bool,
},
getInitialState: function() {
return {value: this.props.pagination.q};
},
handleChange: function(event) {
this.setState({value: event.target.value});
},
handleKeyPress: function(event) {
var React = require('react');
var Reflux = require('reflux');
var BS = require('react-bootstrap');
var Router= require('react-router');
var actions = require('../actions/actions');
var userStore = require('../stores/userStore');
var Profile = React.createClass({
mixins:[
Router.Navigation,
Reflux.listenTo(userStore, "updateProfile"),
],
updateProfile: function(user){
alert(user.balance)
},
getInitialState: function() {
return {
user: userStore.getDefaultUser(),
};
},
componentDidMount: function() {
if (!this.state.user.logd) {
this.transitionTo("login");
}
},
render: function(){
var React = require('react/addons');
var ReactRouter = require('react-router');
var Actions = require('../Actions');
var LogoutStore = require('../stores/Logout');
var Link = ReactRouter.Link;
var Navigation = ReactRouter.Navigation;
var Component = React.createClass({
mixins: [Navigation],
getInitialState: function () {
LogoutStore.reset();
return LogoutStore.getState();
},
componentDidMount: function () {
LogoutStore.addChangeListener(this.onStoreChange);
Actions.logout();
},
componentWillUnmount: function () {
});
_needCalulate && (task.totalTime = totalTime);
});
return result;
}).then(function (data) {
that.setState({
todayTaskTime: data
});
});
}
});
var ProjectInfo = React.createClass({
mixins: [PureRenderMixin, Router.State, Router.Navigation],
propTypes: {
onFilterTags: React.PropTypes.func
},
getDefaultProps: function () {
return {
onDateColumnClick: noop
};
},
getInitialState: function () {
return {
showProjectDetail: false,
selectTags: []
};
render(){
var row = this.props.rowData;
return <span>{row.processtaskuser['user_repr']}</span>;
}
});
const StatusShow = React.createClass({
render(){
return <span disabled="">
{moment(this.props.data['date']).fromNow()}
</span>
}
});
export default React.createClass({
mixins: [ Router.Navigation,
Authentication,
Reflux.listenTo(TaskStore, 'update'), Reflux.listenTo(ResultStore, 'update')],
statics: {
fetch(params, route) {
if(route.name.toLowerCase().indexOf('result') !== -1){
return new Promise(function (fulfill, reject){
ResultActions.loadDetailIfNecessary.triggerPromise(params.object).then(
(result) => {
return TaskActions.loadDetailIfNecessary.triggerPromise(result.processtaskuser).then(
(task) => {
fulfill({
result: result,
task: task
});
"use strict";
var React = require("react");
var Router = require("react-router");
var classSet = require("react/lib/cx");
var Navigation = Router.Navigation;
var State = Router.State;
var Link = Router.Link;
var NavigationLink = React.createClass({
mixins: [State, Navigation],
propTypes: {
activeClassName: React.PropTypes.string.isRequired,
to: React.PropTypes.string.isRequired
},
getDefaultProps: function () {
return {
activeClassName: "active"
};
},
getClassName: function () {
var classNames = {};
loadTotalTime: function () {
var that = this;
DataAPI.Log.totalTime()
.then(function (total) {
that.setState({
totalTime: total
});
});
}
});
var LogsTable = React.createClass({
mixins: [Router.Navigation],
getInitialState: function () {
return {
sortDir: null,
sortBy: null,
logs: this.props.logs
};
},
componentWillReceiveProps: function (nextProps) {
this.setState({
logs: nextProps.logs,
sortBy: null,
sortDir: null
});