From c7226c0f568b4f79e609d1eb24ddebd96769411f Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 14 Mar 2018 12:00:58 -0400 Subject: [PATCH] Fix bug with tooltip and add new tooltip describing number discrepency --- src/components/BuildingListTable/index.js | 2 +- src/components/BuildingListTable/styles.css | 6 +-- src/components/ProjectListTable/index.js | 2 +- src/components/ProjectListTable/styles.css | 6 +-- .../Reports/components/Impact/Impact.js | 47 ++++++++++++++++--- .../components/Impact/ImpactWrapper.js | 11 +++++ .../Reports/components/Impact/styles.css | 0 .../Reports/components/Lighting/index.js | 2 +- src/containers/Reports/index.js | 1 + src/containers/Reports/styles.css | 6 +++ 10 files changed, 67 insertions(+), 16 deletions(-) create mode 100644 src/containers/Reports/components/Impact/styles.css create mode 100644 src/containers/Reports/styles.css diff --git a/src/components/BuildingListTable/index.js b/src/components/BuildingListTable/index.js index f5458c6e..b1e684a7 100644 --- a/src/components/BuildingListTable/index.js +++ b/src/components/BuildingListTable/index.js @@ -161,7 +161,7 @@ export default function BuildingListTable({ return (
- +
{buildingProperties} diff --git a/src/components/BuildingListTable/styles.css b/src/components/BuildingListTable/styles.css index 798a0f23..959384a8 100644 --- a/src/components/BuildingListTable/styles.css +++ b/src/components/BuildingListTable/styles.css @@ -1,4 +1,4 @@ -.table { +.building-table { margin-bottom: 0rem !important; } @@ -6,11 +6,11 @@ * Remove the default on hover css so we can customize which td's get * hovered with javascript */ -table.table tbody tr:hover:nth-child(odd) { +table.building-table tbody tr:hover:nth-child(odd) { background-color: rgba(63, 63, 63, 0.03) !important; cursor: default !important; } -table.table tbody tr:hover:nth-child(even) { +table.building-table tbody tr:hover:nth-child(even) { background-color: transparent !important; cursor: default !important; } diff --git a/src/components/ProjectListTable/index.js b/src/components/ProjectListTable/index.js index 34744f97..670fe9c4 100644 --- a/src/components/ProjectListTable/index.js +++ b/src/components/ProjectListTable/index.js @@ -99,7 +99,7 @@ export default function ProjectListTable({ projects, error, loading }) { return (
-
+
{projectProperties} diff --git a/src/components/ProjectListTable/styles.css b/src/components/ProjectListTable/styles.css index 798a0f23..04783a45 100644 --- a/src/components/ProjectListTable/styles.css +++ b/src/components/ProjectListTable/styles.css @@ -1,4 +1,4 @@ -.table { +.project-table { margin-bottom: 0rem !important; } @@ -6,11 +6,11 @@ * Remove the default on hover css so we can customize which td's get * hovered with javascript */ -table.table tbody tr:hover:nth-child(odd) { +table.project-table tbody tr:hover:nth-child(odd) { background-color: rgba(63, 63, 63, 0.03) !important; cursor: default !important; } -table.table tbody tr:hover:nth-child(even) { +table.project-table tbody tr:hover:nth-child(even) { background-color: transparent !important; cursor: default !important; } diff --git a/src/containers/Reports/components/Impact/Impact.js b/src/containers/Reports/components/Impact/Impact.js index 82b91f57..d5b2b54e 100644 --- a/src/containers/Reports/components/Impact/Impact.js +++ b/src/containers/Reports/components/Impact/Impact.js @@ -1,9 +1,13 @@ +/* eslint-disable import/no-named-as-default-member */ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import ReactTooltip from 'react-tooltip'; +import { Icon } from 'react-fa'; +import { UncontrolledTooltip } from 'reactstrap'; import { impactReportPropTypes } from '../../propTypes'; import Loading from '../../../../components/Loading'; +import './styles.css'; export default class Impact extends Component { @@ -20,14 +24,13 @@ export default class Impact extends Component { } const dateCompareString = ` The blue number represents the difference between the last two generated reports -
The last reports were generated on - ${impactReports[0].created} and ${impactReports.length > 1 ? impactReports[1].created : 'n/a'} + ${impactReports[0].created} and ${impactReports.length > 1 ? impactReports[1].created : 'n/a'}. `; return (
-
+
{ impactReports[0].report.map((val, index) => { @@ -45,8 +48,7 @@ export default class Impact extends Component { } const changeEl = ( {changeString} @@ -56,13 +58,41 @@ export default class Impact extends Component { if (val.col === 'Total Buildings') { trStyling = { backgroundColor: 'rgba(176, 167, 167, 0.41)', - pointerEvents: 'none', }; + if (this.props.totalBuildingsTooltip) { + return ( + + + + + {this.props.totalBuildingsTooltip} + + + + ); + } } return ( - + + ); }) @@ -78,4 +108,7 @@ export default class Impact extends Component { Impact.propTypes = { impactReports: impactReportPropTypes, loading: PropTypes.bool, + uid: PropTypes.number, + totalBuildingsTooltip: PropTypes.string, + }; diff --git a/src/containers/Reports/components/Impact/ImpactWrapper.js b/src/containers/Reports/components/Impact/ImpactWrapper.js index f0b4f042..2ff2f951 100644 --- a/src/containers/Reports/components/Impact/ImpactWrapper.js +++ b/src/containers/Reports/components/Impact/ImpactWrapper.js @@ -1,3 +1,4 @@ +/* eslint-disable import/no-named-as-default-member */ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { UncontrolledTooltip } from 'reactstrap'; @@ -51,9 +52,16 @@ export default class ImpactWrapper extends Component { ); } + const totalBuildingsTooltip = ` + Note that the overall report is generated only once a day. + The filter report is generated from the building group which is + updated closer to real time. Therefore there may be discrepencies between + the numbers. + `; return (
@@ -62,6 +70,7 @@ export default class ImpactWrapper extends Component {
@@ -79,6 +88,8 @@ export default class ImpactWrapper extends Component {
diff --git a/src/containers/Reports/components/Impact/styles.css b/src/containers/Reports/components/Impact/styles.css new file mode 100644 index 00000000..e69de29b diff --git a/src/containers/Reports/components/Lighting/index.js b/src/containers/Reports/components/Lighting/index.js index aa378975..2bab78b6 100644 --- a/src/containers/Reports/components/Lighting/index.js +++ b/src/containers/Reports/components/Lighting/index.js @@ -23,7 +23,7 @@ export default function Lighting({ return (
-
{val.col} + {val.value} + {changeEl} + {' '} + + + + + {dateCompareString} + +
{val.col}{val.value}{changeEl} + {val.value} + {changeEl} + + {dateCompareString} + +
+
diff --git a/src/containers/Reports/index.js b/src/containers/Reports/index.js index 8e59feb0..b77c647d 100644 --- a/src/containers/Reports/index.js +++ b/src/containers/Reports/index.js @@ -19,6 +19,7 @@ import reportsPropTypes from './propTypes'; import ImpactWrapper from './components/Impact/ImpactWrapper'; import Lighting from './components/Lighting'; import userPropType from '../../containers/User/propTypes'; +import './styles.css'; class Reports extends Component { constructor(props) { diff --git a/src/containers/Reports/styles.css b/src/containers/Reports/styles.css new file mode 100644 index 00000000..b48542d9 --- /dev/null +++ b/src/containers/Reports/styles.css @@ -0,0 +1,6 @@ +table.report-table tbody tr:hover:nth-child(odd) { + cursor: default !important; +} +table.report-table tbody tr:hover:nth-child(even) { + cursor: default !important; +} -- GitLab
Status