From b310df0b1466a556a26ab8c4f70a2120bef04d42 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 7 Mar 2018 16:22:55 -0500 Subject: [PATCH 1/2] Add targeting score to sidebardetail --- src/components/SideBarDetail/index.js | 32 ++++++++++++++++++--------- src/containers/Building/propTypes.js | 1 + 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/components/SideBarDetail/index.js b/src/components/SideBarDetail/index.js index eb020b57..a7fe758e 100644 --- a/src/components/SideBarDetail/index.js +++ b/src/components/SideBarDetail/index.js @@ -1,7 +1,8 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Link, browserHistory } from 'react-router'; -import ReactTooltip from 'react-tooltip'; +import { UncontrolledTooltip } from 'reactstrap'; +import { Icon } from 'react-fa'; import './styles.css'; import { contactsPropTypes } from '../../containers/Project/propTypes'; import buildingDetailPropType from '../../containers/Building/propTypes'; @@ -47,21 +48,19 @@ export default function SideBarDetail({ building, children, contacts, user }) { {val} )); - const addressListText = 'There can be multiple addresses for a single building if the building has multiple entrances'; addressListSection = (
-
Borough: {building.borough}
Zipcode: {building.zipcode}
-
- Address List (?) +
+ Address List{' '} +
+ + There can be multiple addresses for a single building + if the building has multiple entrances + {addressListString} @@ -165,6 +164,19 @@ export default function SideBarDetail({ building, children, contacts, user }) { + {building.targeting_score ? ( + + + + + A lower targeting scores is correlated with higher chance of going through + with a retrofit. Below 50 is considered very good. + + + ) : null}
Bin {building.bin}
Targeting + {building.targeting_score.toFixed(2)} + {' '} +
diff --git a/src/containers/Building/propTypes.js b/src/containers/Building/propTypes.js index d5fe2ee4..f1d4a886 100644 --- a/src/containers/Building/propTypes.js +++ b/src/containers/Building/propTypes.js @@ -18,6 +18,7 @@ export const overviewPropTypes = { lot_id: number, borough_id: string, zipcode: string, + targeting_score: number, }; -- GitLab From b8d16f4e01e7283b5403238f40ec6bc19d7a6072 Mon Sep 17 00:00:00 2001 From: Conrad Date: Thu, 8 Mar 2018 16:14:59 -0500 Subject: [PATCH 2/2] Add permission for building detait targeting score --- src/components/SideBarDetail/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SideBarDetail/index.js b/src/components/SideBarDetail/index.js index a7fe758e..bf06ec46 100644 --- a/src/components/SideBarDetail/index.js +++ b/src/components/SideBarDetail/index.js @@ -164,7 +164,7 @@ export default function SideBarDetail({ building, children, contacts, user }) { Bin {building.bin} - {building.targeting_score ? ( + {user.permissions['view::buildingDetailTargetingScore'] && building.targeting_score ? ( Targeting -- GitLab