diff --git a/client/src/components/MemberIncidentsTable/index.js b/client/src/components/MemberIncidentsTables/components/SingleIncidentsTable.js
similarity index 93%
rename from client/src/components/MemberIncidentsTable/index.js
rename to client/src/components/MemberIncidentsTables/components/SingleIncidentsTable.js
index 01dac02..5c1d91e 100644
--- a/client/src/components/MemberIncidentsTable/index.js
+++ b/client/src/components/MemberIncidentsTables/components/SingleIncidentsTable.js
@@ -4,17 +4,17 @@ import ReactTable from 'react-table';
import 'react-table/react-table.css';
import { NavLink } from 'react-router-dom';
-import {incidentsReportHeaderTitles} from '../../constants/menuItems';
+import {incidentsReportHeaderTitles} from '../../../constants/menuItems';
import {
incidentDescriptions,
incidentLevelDescriptions,
UNLOCKED_INCIDENT_RELATED_WITH_RESERVATION, UNLOCKED_INCIDENT_STANDALONE, UNSCHEDULED_INCIDENT_AFTER_RESERVATION,
UNSCHEDULED_INCIDENT_BEFORE_RESERVATION, UNSCHEDULED_INCIDENT_STANDALONE
-} from '../../constants/enums';
+} from '../../../constants/enums';
-const MemberIncidentsTable = props => {
- const { loading, title, openMemberSummaryOnMemberClick, showBookingTimes, showDoorLockEntryTimes } = props;
+const SingleIncidentsTable = props => {
+ const { loading, title, openMemberSummaryOnMemberClick, showBookingTimes, showDoorLockEntryTimes, hideMemberName } = props;
const incidents = props.incidents ? props.incidents : [];
const columns = [];
@@ -31,6 +31,9 @@ const MemberIncidentsTable = props => {
if ((header === 'unlockTimestamp' || header === 'lockTimestamp') && !showDoorLockEntryTimes){
showColumn = false;
}
+ if (header === 'memberName' && hideMemberName){
+ showColumn = false;
+ }
if (columnTitle && showColumn){
const columnAlignments = {
@@ -113,4 +116,4 @@ const MemberIncidentsTable = props => {
);
};
-export default MemberIncidentsTable;
+export default SingleIncidentsTable;
diff --git a/client/src/components/MemberIncidentsTables/index.js b/client/src/components/MemberIncidentsTables/index.js
new file mode 100644
index 0000000..ed05541
--- /dev/null
+++ b/client/src/components/MemberIncidentsTables/index.js
@@ -0,0 +1,78 @@
+import React from 'react';
+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
+} from '../../constants/enums';
+
+export default function MemberIncidentsTables (props) {
+ const { pendingIncidents, incidents, hideMemberName } = props;
+
+ const incidentsRelatedToReservations = [];
+ const standaloneIncidents = [];
+
+ if (Array.isArray(incidents)){
+ incidents.forEach((incident) => {
+ if (incident && incident.incidentType){
+ switch (incident.incidentType) {
+ case UNLOCKED_INCIDENT_RELATED_WITH_RESERVATION:
+ case UNSCHEDULED_INCIDENT_BEFORE_RESERVATION:
+ case UNSCHEDULED_INCIDENT_AFTER_RESERVATION:
+ incidentsRelatedToReservations.push(incident);
+ break;
+ case UNLOCKED_INCIDENT_STANDALONE:
+ case UNSCHEDULED_INCIDENT_STANDALONE:
+ standaloneIncidents.push(incident);
+ break;
+ }
+ }
+ });
+ }
+
+ const incidentsRelatedToReservationsTable = (
+
+ );
+
+ const standaloneIncidentsTable = (
+
+ );
+
+ const accordionPanels = [
+ {
+ key: 'related-door-lock-incidents',
+ title : { content: },
+ content: { content : incidentsRelatedToReservationsTable },
+ },
+ {
+ key: 'standalone-door-lock-incidents',
+ title : { content: },
+ content: { content: standaloneIncidentsTable },
+ },
+ {
+ key: 'reservation-modification-incidents',
+ title: {content: },
+ }
+ ];
+
+ return (
+
+ );
+}
diff --git a/client/src/scenes/IncidentsReport/index.js b/client/src/scenes/IncidentsReport/index.js
index 8194ee7..3c4f766 100644
--- a/client/src/scenes/IncidentsReport/index.js
+++ b/client/src/scenes/IncidentsReport/index.js
@@ -1,20 +1,13 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
-import { Container, Accordion, Label } from 'semantic-ui-react';
+import { Container } from 'semantic-ui-react';
import MainMenu from '../../components/MainMenu';
import DateRangePicker from '../../components/DateRangePicker';
-import MemberIncidentsTable from '../../components/MemberIncidentsTable';
+import MemberIncidentsTables from '../../components/MemberIncidentsTables';
import { fetchIncidents } from '../../store/actions';
-import {
- UNLOCKED_INCIDENT_RELATED_WITH_RESERVATION,
- UNLOCKED_INCIDENT_STANDALONE, UNSCHEDULED_INCIDENT_AFTER_RESERVATION,
- UNSCHEDULED_INCIDENT_BEFORE_RESERVATION,
- UNSCHEDULED_INCIDENT_STANDALONE
-} from '../../constants/enums';
-
class IncidentsReport extends Component {
onDatesUpdate(dateRange) {
const { fetchIncidents } = this.props;
@@ -24,62 +17,6 @@ class IncidentsReport extends Component {
render () {
const { pendingIncidents, incidents } = this.props;
- const incidentsRelatedToReservations = [];
- const standaloneIncidents = [];
-
- if (Array.isArray(incidents)){
- incidents.forEach((incident) => {
- if (incident && incident.incidentType){
- switch (incident.incidentType) {
- case UNLOCKED_INCIDENT_RELATED_WITH_RESERVATION:
- case UNSCHEDULED_INCIDENT_BEFORE_RESERVATION:
- case UNSCHEDULED_INCIDENT_AFTER_RESERVATION:
- incidentsRelatedToReservations.push(incident);
- break;
- case UNLOCKED_INCIDENT_STANDALONE:
- case UNSCHEDULED_INCIDENT_STANDALONE:
- standaloneIncidents.push(incident);
- break;
- }
- }
- });
- }
-
- const incidentsRelatedToReservationsTable = (
-
- );
-
- const standaloneIncidentsTable = (
-
- );
-
- const accordionPanels = [
- {
- key: 'related-door-lock-incidents',
- title : { content: },
- content: { content : incidentsRelatedToReservationsTable },
- },
- {
- key: 'standalone-door-lock-incidents',
- title : { content: },
- content: { content: standaloneIncidentsTable },
- },
- {
- key: 'reservation-modification-incidents',
- title: {content: },
- }
- ];
-
return (
@@ -87,12 +24,7 @@ class IncidentsReport extends Component {
-
+
);
}
diff --git a/client/src/scenes/PracticeSummaryReport/index.js b/client/src/scenes/PracticeSummaryReport/index.js
index 6083a0b..e9a062b 100644
--- a/client/src/scenes/PracticeSummaryReport/index.js
+++ b/client/src/scenes/PracticeSummaryReport/index.js
@@ -6,7 +6,7 @@ import MainMenu from '../../components/MainMenu';
import DateRangePicker from '../../components/DateRangePicker';
import MemberSelector from './components/MemberSelector';
import MemberSummary from './components/MemberSummary';
-import MemberIncidentsTable from '../../components/MemberIncidentsTable';
+import MemberIncidentsTables from '../../components/MemberIncidentsTables';
import { fetchMemberIncidents } from '../../store/actions';
@@ -67,11 +67,7 @@ class PracticeSummaryReport extends Component {
-
+