Fixed bookings and timezone problems
This commit is contained in:
@@ -73,17 +73,25 @@ class DateRangePicker extends Component {
|
||||
|
||||
render() {
|
||||
const { startDate, endDate, error, startDateLabel, endDateLabel } = this.state;
|
||||
const { inlineButton } = this.props;
|
||||
|
||||
const buttonLabel = this.props.buttonLabel || 'Save';
|
||||
|
||||
const startDateValue = startDate.format(defaultDateFormat);
|
||||
const endDateValue = endDate.format(defaultDateFormat);
|
||||
|
||||
const buttonRender = (
|
||||
<Grid.Column width={inlineButton ? 1 : null}>
|
||||
{ inlineButton && <label>{'\u00A0'}</label> }
|
||||
<Form.Button onClick={this.onButtonClick.bind(this)}>{buttonLabel}</Form.Button>
|
||||
</Grid.Column>
|
||||
);
|
||||
|
||||
return (
|
||||
<Form>
|
||||
<Grid columns="equal">
|
||||
<Grid stackable columns={inlineButton ? null : 'equal'}>
|
||||
<Grid.Row>
|
||||
<Grid.Column>
|
||||
<Grid.Column width={inlineButton ? 7 : null}>
|
||||
<label>{startDateLabel}</label>
|
||||
<Form.Input
|
||||
fluid
|
||||
@@ -93,7 +101,7 @@ class DateRangePicker extends Component {
|
||||
onChange={this.onStartDateChange.bind(this)}
|
||||
/>
|
||||
</Grid.Column>
|
||||
<Grid.Column>
|
||||
<Grid.Column width={inlineButton ? 6 : null}>
|
||||
<label>{endDateLabel}</label>
|
||||
<Form.Input
|
||||
fluid
|
||||
@@ -103,6 +111,9 @@ class DateRangePicker extends Component {
|
||||
onChange={this.onEndDateChange.bind(this)}
|
||||
/>
|
||||
</Grid.Column>
|
||||
{
|
||||
inlineButton && buttonRender
|
||||
}
|
||||
</Grid.Row>
|
||||
{ error &&
|
||||
<Grid.Row>
|
||||
@@ -114,11 +125,12 @@ class DateRangePicker extends Component {
|
||||
</Grid.Column>
|
||||
</Grid.Row>
|
||||
}
|
||||
<Grid.Row>
|
||||
<Grid.Column>
|
||||
<Form.Button onClick={this.onButtonClick.bind(this)}>{buttonLabel}</Form.Button>
|
||||
</Grid.Column>
|
||||
</Grid.Row>
|
||||
{
|
||||
!inlineButton &&
|
||||
<Grid.Row>
|
||||
{buttonRender}
|
||||
</Grid.Row>
|
||||
}
|
||||
</Grid>
|
||||
</Form>
|
||||
);
|
||||
|
||||
@@ -7,14 +7,19 @@ import { mainMenuItems } from '../../constants/menuItems';
|
||||
const MainMenu = () =>
|
||||
(<Menu>
|
||||
{
|
||||
mainMenuItems.map(mainMenuItem =>
|
||||
<Menu.Item key={mainMenuItem.id}
|
||||
as={NavLink}
|
||||
to={mainMenuItem.url}
|
||||
exact
|
||||
>
|
||||
{mainMenuItem.title}
|
||||
</Menu.Item>)
|
||||
mainMenuItems.map(mainMenuItem => {
|
||||
if (!mainMenuItem.showInMenu){
|
||||
return null;
|
||||
} else {
|
||||
return (
|
||||
<Menu.Item key={mainMenuItem.id}
|
||||
as={NavLink}
|
||||
to={mainMenuItem.url}
|
||||
exact
|
||||
>
|
||||
{mainMenuItem.title}
|
||||
</Menu.Item>)
|
||||
}})
|
||||
}
|
||||
</Menu>);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import React from 'react';
|
||||
import { Loader } from 'semantic-ui-react';
|
||||
import ReactTable from 'react-table';
|
||||
import 'react-table/react-table.css';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
|
||||
import {incidentsReportHeaderTitles} from '../../constants/menuItems';
|
||||
import {
|
||||
@@ -13,7 +14,7 @@ import {
|
||||
|
||||
|
||||
const MemberIncidentsTable = props => {
|
||||
const { loading, title } = props;
|
||||
const { loading, title, openMemberSummaryOnMemberClick } = props;
|
||||
const incidents = props.incidents ? props.incidents : [];
|
||||
|
||||
const columns = [];
|
||||
@@ -34,9 +35,15 @@ const MemberIncidentsTable = props => {
|
||||
Header: incidentsReportHeaderTitles[header],
|
||||
accessor: header,
|
||||
Cell: props => {
|
||||
let cellValue;
|
||||
let cellValue = '';
|
||||
let urlValue = undefined;
|
||||
|
||||
switch (props.column.id) {
|
||||
case 'memberName':
|
||||
const memberId = props.row['_original'].memberId;
|
||||
urlValue = `/practice-summary-report/${memberId}`;
|
||||
cellValue = props.value;
|
||||
break;
|
||||
case 'incidentType':
|
||||
cellValue = incidentDescriptions[props.value];
|
||||
break;
|
||||
@@ -68,7 +75,17 @@ const MemberIncidentsTable = props => {
|
||||
cellValue = props.value;
|
||||
}
|
||||
|
||||
return <div style={{ textAlign: columnContentsAlignment }}>{cellValue}</div>
|
||||
if (openMemberSummaryOnMemberClick && urlValue){
|
||||
return <NavLink to={urlValue}>{cellValue}</NavLink>
|
||||
}else{
|
||||
return <div style={{ textAlign: columnContentsAlignment }}>{cellValue}</div>
|
||||
}
|
||||
|
||||
// return <NavLink to={urlValue}>
|
||||
// <div>{cellValue}</div>
|
||||
// </NavLink>
|
||||
|
||||
// return <div style={{ textAlign: columnContentsAlignment }}><a href={'www.gogole.com'} >{cellValue}</a></div>
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user