diff --git a/client/src/components/MainMenu/index.js b/client/src/components/MainMenu/index.js
index 6890a4c..1fd8f65 100644
--- a/client/src/components/MainMenu/index.js
+++ b/client/src/components/MainMenu/index.js
@@ -7,14 +7,19 @@ import { mainMenuItems } from '../../constants/menuItems';
const MainMenu = () =>
(
);
diff --git a/client/src/components/MemberIncidentsTable/index.js b/client/src/components/MemberIncidentsTable/index.js
index 2e6b44f..6f79f59 100644
--- a/client/src/components/MemberIncidentsTable/index.js
+++ b/client/src/components/MemberIncidentsTable/index.js
@@ -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 {cellValue}
+ if (openMemberSummaryOnMemberClick && urlValue){
+ return {cellValue}
+ }else{
+ return {cellValue}
+ }
+
+ // return
+ // {cellValue}
+ //
+
+ // return
}
});
}
diff --git a/client/src/constants/menuItems.js b/client/src/constants/menuItems.js
index e2ab184..07b6c96 100644
--- a/client/src/constants/menuItems.js
+++ b/client/src/constants/menuItems.js
@@ -6,24 +6,34 @@ import PracticeSummaryReport from '../scenes/PracticeSummaryReport';
export const mainMenuItems = [
{
id: 'home',
+ showInMenu: true,
title: 'Home',
url: '/',
component: Home,
},
{
id: 'practiceSummaryReport',
+ showInMenu: true,
title: 'Practice Summary Report',
url: '/practice-summary-report',
component: PracticeSummaryReport,
},
+ {
+ id: 'practiceSummaryReportWithMemberId',
+ showInMenu: false,
+ url: '/practice-summary-report/:memberId',
+ component: PracticeSummaryReport,
+ },
{
id: 'report',
+ showInMenu: true,
title: 'Incidents Report',
url: '/incidents-report',
component: IncidentsReport,
},
{
id: 'uploadDLockData',
+ showInMenu: true,
title: 'DLock',
url: '/dlock',
component: UploadDLockData,
diff --git a/client/src/scenes/IncidentsReport/index.js b/client/src/scenes/IncidentsReport/index.js
index 6501d47..fa464ac 100644
--- a/client/src/scenes/IncidentsReport/index.js
+++ b/client/src/scenes/IncidentsReport/index.js
@@ -24,7 +24,7 @@ class IncidentsReport extends Component {
-
+
);
}
diff --git a/client/src/scenes/PracticeSummaryReport/components/MemberSummary.js b/client/src/scenes/PracticeSummaryReport/components/MemberSummary.js
index 687fed0..6f15622 100644
--- a/client/src/scenes/PracticeSummaryReport/components/MemberSummary.js
+++ b/client/src/scenes/PracticeSummaryReport/components/MemberSummary.js
@@ -11,7 +11,6 @@ const MemberSummary = props => {
let totalUnlockedFees = 0;
incidents.forEach((incident) => {
- console.log(incident);
switch (incident.incidentType) {
case UNSCHEDULED_INCIDENT:
totalUnscheduledFees += parseFloat(incident.totalChargeFee);
@@ -19,6 +18,8 @@ const MemberSummary = props => {
case UNLOCKED_INCIDENT:
totalUnlockedFees += parseFloat(incident.incidentPrice);
break;
+ default:
+ break;
}
});
@@ -65,5 +66,4 @@ const MemberSummary = props => {
);
};
-
export default MemberSummary;
diff --git a/client/src/scenes/PracticeSummaryReport/index.js b/client/src/scenes/PracticeSummaryReport/index.js
index b53050f..32ea48e 100644
--- a/client/src/scenes/PracticeSummaryReport/index.js
+++ b/client/src/scenes/PracticeSummaryReport/index.js
@@ -16,7 +16,7 @@ class PracticeSummaryReport extends Component {
this.state = {
dateRange: null,
- memberId: null,
+ memberId: props.match.params.memberId,
};
}