Upstream sync
This commit is contained in:
@@ -3,57 +3,60 @@ import Dialog from 'material-ui/Dialog';
|
||||
import FlatButton from 'material-ui/FlatButton';
|
||||
|
||||
export class ValidationErrorsInfoDialog extends React.Component {
|
||||
|
||||
state = {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.props = props;
|
||||
this.state = {
|
||||
open: this.props.open,
|
||||
}
|
||||
|
||||
componentWillReceiveProps(newProps){
|
||||
this.setState({open: newProps.open});
|
||||
}
|
||||
|
||||
handleOpen = () => {
|
||||
this.setState({ open: true });
|
||||
};
|
||||
|
||||
handleClose = () => {
|
||||
this.setState({ open: false });
|
||||
this.props.onDismiss();
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
const actions = [
|
||||
<FlatButton
|
||||
label="Dismiss"
|
||||
primary={true}
|
||||
keyboardFocused={true}
|
||||
onClick={this.handleClose}
|
||||
/>,
|
||||
];
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Dialog
|
||||
title="Erors"
|
||||
actions={actions}
|
||||
modal={this.props.modal ? this.props.modal : false}
|
||||
open={this.state.open}
|
||||
onRequestClose={this.handleClose}
|
||||
overlayStyle={{backgroundColor: 'transparent'}}
|
||||
>
|
||||
{this.props.errorMessages.map(errorMessage => {
|
||||
return (
|
||||
<div>
|
||||
<a>{errorMessage.message}</a>
|
||||
<br/>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</Dialog>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ValidationErrorsInfoDialog;
|
||||
componentWillReceiveProps(newProps) {
|
||||
this.setState({ open: newProps.open });
|
||||
}
|
||||
|
||||
handleOpen = () => {
|
||||
this.setState({ open: true });
|
||||
};
|
||||
|
||||
handleClose = () => {
|
||||
this.setState({ open: false });
|
||||
this.props.onDismiss();
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
const actions = [
|
||||
<FlatButton
|
||||
label="Dismiss"
|
||||
primary={true}
|
||||
keyboardFocused={true}
|
||||
onClick={this.handleClose}
|
||||
/>,
|
||||
];
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Dialog
|
||||
title="Errors"
|
||||
actions={actions}
|
||||
modal={this.props.modal ? this.props.modal : false}
|
||||
open={this.state.open}
|
||||
onRequestClose={this.handleClose}
|
||||
overlayStyle={{ backgroundColor: 'transparent' }}
|
||||
>
|
||||
{this.props.errorMessages.map(errorMessage => {
|
||||
return (
|
||||
<div>
|
||||
<a>{errorMessage.message}</a>
|
||||
<br />
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</Dialog>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ValidationErrorsInfoDialog;
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
loggedUser,
|
||||
planScheduler,
|
||||
providerScheduler,
|
||||
visitReporter,
|
||||
} from 'utils/authorization';
|
||||
|
||||
class SidebarContent extends React.Component {
|
||||
@@ -66,7 +67,6 @@ class SidebarContent extends React.Component {
|
||||
$subUl.stop().slideToggle(slideTime);
|
||||
});
|
||||
|
||||
|
||||
// HighlightActiveItems
|
||||
const $links = $nav.find('a');
|
||||
const currentLocation = hashHistory.getCurrentLocation();
|
||||
@@ -101,27 +101,34 @@ class SidebarContent extends React.Component {
|
||||
|
||||
return (
|
||||
<ul className="nav" ref={(c) => { this.nav = c; }}>
|
||||
{loggedUser.anyOf(planScheduler, visitReporter) &&
|
||||
<li><FlatButton className="prepend-icon" href={"#/app/form/visit/" + this.state.user.useruuid}><span>Create Visit</span></FlatButton></li>
|
||||
}
|
||||
{!loggedUser.anyOf(planScheduler, visitReporter) &&
|
||||
<li>
|
||||
<FlatButton href="#/app/form"><i className="nav-icon material-icons cyan-text text-lighter-4">directions_car</i><span className="nav-text">Rides</span></FlatButton>
|
||||
<ul>
|
||||
<li><FlatButton className="prepend-icon" href={"#/app/form/steppers/" + this.state.user.useruuid}><span>Book Rides</span></FlatButton></li>
|
||||
<li><FlatButton className="prepend-icon" href="#/app/table/rides"><span>Manage Rides</span></FlatButton></li>
|
||||
</ul>
|
||||
</li>
|
||||
}
|
||||
{!loggedUser.anyOf(planScheduler, visitReporter) &&
|
||||
<li>
|
||||
<FlatButton href="#/app/chart"><i className="nav-icon material-icons">people_outline</i><span className="nav-text">Members</span></FlatButton>
|
||||
<ul>
|
||||
<li><FlatButton className="prepend-icon" href="#/app/page/eligibility"><span>Verify Eligibility</span></FlatButton></li>
|
||||
<li><FlatButton className="prepend-icon" href="#/app/table/members"><span>Manage Members</span></FlatButton></li>
|
||||
</ul>
|
||||
</li>
|
||||
}
|
||||
<li>
|
||||
<FlatButton href="#/app/form"><i className="nav-icon material-icons cyan-text text-lighter-4">directions_car</i><span className="nav-text">Rides</span></FlatButton>
|
||||
<FlatButton href="#/app/chart"><i className="nav-icon material-icons">schedule</i><span className="nav-text">Visits</span></FlatButton>
|
||||
<ul>
|
||||
<li><FlatButton className="prepend-icon" href={"#/app/form/steppers/" + this.state.user.useruuid}><span>Book Rides</span></FlatButton></li>
|
||||
<li><FlatButton className="prepend-icon" href="#/app/table/rides"><span>Manage Rides</span></FlatButton></li>
|
||||
<li><FlatButton className="prepend-icon" href={"#/app/form/visit/" + this.state.user.useruuid}><span>Create Visit</span></FlatButton></li>
|
||||
<li> <FlatButton className="prepend-icon" href="#/app/table/visits"><span className="nav-text">Manage Visits</span></FlatButton></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<FlatButton href="#/app/chart"><i className="nav-icon material-icons">people_outline</i><span className="nav-text">Members</span></FlatButton>
|
||||
<ul>
|
||||
<li><FlatButton className="prepend-icon" href="#/app/page/eligibility"><span>Verify Eligibility</span></FlatButton></li>
|
||||
<li><FlatButton className="prepend-icon" href="#/app/table/members"><span>Manage Members</span></FlatButton></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<FlatButton href="#/app/table/visits"><i className="nav-icon material-icons">schedule</i><span className="nav-text">Visits</span></FlatButton>
|
||||
</li>
|
||||
{/* <li>
|
||||
<FlatButton href="#/app/table/message"><i className="nav-icon material-icons">mail_outline</i><span className="nav-text">Message Center</span></FlatButton>
|
||||
</li> */}
|
||||
|
||||
<li>
|
||||
<FlatButton href="#/app/chart"><i className="nav-icon material-icons">settings</i><span className="nav-text">Manage</span></FlatButton>
|
||||
|
||||
Reference in New Issue
Block a user