display booking charge incidents; refactor frontend

This commit is contained in:
Bilal Catic
2019-07-08 20:23:50 +02:00
parent c0d7418f3f
commit f6e8e6667b
7 changed files with 179 additions and 36 deletions

View File

@@ -3,7 +3,8 @@ import {Accordion, Label} from 'semantic-ui-react';
import SingleIncidentsTable from './components/SingleIncidentsTable';
import {
UNLOCKED_INCIDENT_RELATED_WITH_RESERVATION, UNLOCKED_INCIDENT_STANDALONE, UNSCHEDULED_INCIDENT_AFTER_RESERVATION,
UNSCHEDULED_INCIDENT_BEFORE_RESERVATION, UNSCHEDULED_INCIDENT_STANDALONE
UNSCHEDULED_INCIDENT_BEFORE_RESERVATION, UNSCHEDULED_INCIDENT_STANDALONE, BOOKING_MOVED_TO_ANOTHER_DAY, BOOKING_SHORTENED,
incidentTableTypes
} from '../../constants/enums';
export default function MemberIncidentsTables (props) {
@@ -11,6 +12,7 @@ export default function MemberIncidentsTables (props) {
const incidentsRelatedToReservations = [];
const standaloneIncidents = [];
const bookingChangeIncidents = [];
if (Array.isArray(incidents)){
incidents.forEach((incident) => {
@@ -25,6 +27,12 @@ export default function MemberIncidentsTables (props) {
case UNSCHEDULED_INCIDENT_STANDALONE:
standaloneIncidents.push(incident);
break;
case BOOKING_MOVED_TO_ANOTHER_DAY:
case BOOKING_SHORTENED:
bookingChangeIncidents.push(incident);
break;
default:
break;
}
}
});
@@ -35,8 +43,8 @@ export default function MemberIncidentsTables (props) {
loading={pendingIncidents}
incidents={incidentsRelatedToReservations}
openMemberSummaryOnMemberClick
showBookingTimes
hideMemberName={hideMemberName}
tableType={incidentTableTypes.INCIDENTS_RELATED_TO_RESERVATIONS}
/>
);
@@ -45,8 +53,17 @@ export default function MemberIncidentsTables (props) {
loading={pendingIncidents}
incidents={standaloneIncidents}
openMemberSummaryOnMemberClick
showDoorLockEntryTimes
hideMemberName={hideMemberName}
tableType={incidentTableTypes.STANDALONE_INCIDENTS}
/>
);
const bookingChangeIncidentsTable = (
<SingleIncidentsTable
loading={pendingIncidents}
incidents={bookingChangeIncidents}
hideMemberName={hideMemberName}
tableType={incidentTableTypes.BOOKING_CHANGE_INCIDENTS}
/>
);
@@ -63,7 +80,8 @@ export default function MemberIncidentsTables (props) {
},
{
key: 'reservation-modification-incidents',
title: {content: <Label color='blue' content={'Cancellation charges'}/>},
title: {content: <Label color='blue' content={'Booking change charges'}/>},
content: { content: bookingChangeIncidentsTable },
}
];