From 19c1a02bc45f3d9eadfeee8aa9f46dbf5a81100f Mon Sep 17 00:00:00 2001 From: Adam Kendis Date: Sun, 19 Jul 2020 22:44:17 -0700 Subject: [PATCH 1/8] Hotjar and google optimizer scripts. --- public/index.html | 4 ++++ src/components/privacyPolicy/PrivacyPolicy.jsx | 2 ++ 2 files changed, 6 insertions(+) diff --git a/public/index.html b/public/index.html index 08865a5d6..3cb063aed 100644 --- a/public/index.html +++ b/public/index.html @@ -12,6 +12,10 @@ window['ga-disable-UA-166263401-1'] = devHostname; window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-166263401-1'); + + + + diff --git a/src/components/privacyPolicy/PrivacyPolicy.jsx b/src/components/privacyPolicy/PrivacyPolicy.jsx index f018ec15e..0e3328920 100644 --- a/src/components/privacyPolicy/PrivacyPolicy.jsx +++ b/src/components/privacyPolicy/PrivacyPolicy.jsx @@ -197,6 +197,8 @@ const PrivacyPolicy = () => ( {', '} Mixpanel {', '} + Hotjar + {', '} Eventbrite {', '} Donorbox From 4a499b51026b89cd375940b017f82a1d5eee14fa Mon Sep 17 00:00:00 2001 From: Adam Kendis Date: Sun, 19 Jul 2020 22:45:35 -0700 Subject: [PATCH 2/8] Updated searchbar placeholder in district selectors --- src/components/common/MultiSelect/SearchBar.jsx | 7 +++++-- src/components/common/MultiSelect/index.jsx | 4 ++++ src/components/main/menu/CCSelector.jsx | 1 + src/components/main/menu/NCSelector.jsx | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/common/MultiSelect/SearchBar.jsx b/src/components/common/MultiSelect/SearchBar.jsx index eb610ce51..0048451cb 100644 --- a/src/components/common/MultiSelect/SearchBar.jsx +++ b/src/components/common/MultiSelect/SearchBar.jsx @@ -3,16 +3,17 @@ import PropTypes from 'proptypes'; const SearchBar = ({ value, + placeholder, onChange, }) => (
onChange(e.target.value)} - aria-label="Search" + aria-label={placeholder} /> @@ -24,10 +25,12 @@ export default SearchBar; SearchBar.propTypes = { value: PropTypes.string, + placeholder: PropTypes.string, onChange: PropTypes.func, }; SearchBar.defaultProps = { value: null, + placeholder: 'Search', onChange: () => null, }; diff --git a/src/components/common/MultiSelect/index.jsx b/src/components/common/MultiSelect/index.jsx index c10f7ef46..271b5a2f0 100644 --- a/src/components/common/MultiSelect/index.jsx +++ b/src/components/common/MultiSelect/index.jsx @@ -11,6 +11,7 @@ const MultiSelect = ({ onChange, groupBy, searchBar, + searchPlaceholder, selectAll, }) => { const [searchTerm, setSearchTerm] = useState(''); @@ -20,6 +21,7 @@ const MultiSelect = ({ { searchBar && ( )} @@ -76,6 +78,7 @@ MultiSelect.propTypes = { onChange: PropTypes.func, groupBy: PropTypes.string, searchBar: PropTypes.bool, + searchPlaceholder: PropTypes.string, selectAll: PropTypes.bool, }; @@ -84,5 +87,6 @@ MultiSelect.defaultProps = { onChange: () => null, groupBy: null, searchBar: false, + searchPlaceholder: 'Search', selectAll: false, }; diff --git a/src/components/main/menu/CCSelector.jsx b/src/components/main/menu/CCSelector.jsx index b8728ea26..49387db86 100644 --- a/src/components/main/menu/CCSelector.jsx +++ b/src/components/main/menu/CCSelector.jsx @@ -27,6 +27,7 @@ const CCSelector = ({ items={items} onChange={onChange} searchBar + searchPlaceholder="Neighborhood" selectAll /> ); diff --git a/src/components/main/menu/NCSelector.jsx b/src/components/main/menu/NCSelector.jsx index 8079d9731..772713d6b 100644 --- a/src/components/main/menu/NCSelector.jsx +++ b/src/components/main/menu/NCSelector.jsx @@ -29,6 +29,7 @@ const NCSelector = ({ onChange={onChange} groupBy="region" searchBar + searchPlaceholder="Neighborhood" selectAll /> ); From 6e49093f7688bdbd4771f4197c65af87d256ee54 Mon Sep 17 00:00:00 2001 From: Adam Kendis Date: Sun, 19 Jul 2020 22:47:17 -0700 Subject: [PATCH 3/8] Updated comparison pie chart titles to display comparison names --- .../Comparison/Contact311Comparison.jsx | 40 ++++++++++++------- src/styles/comparison/_comparison.scss | 4 ++ 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/components/Comparison/Contact311Comparison.jsx b/src/components/Comparison/Contact311Comparison.jsx index 8112231e1..3cff0d0ce 100644 --- a/src/components/Comparison/Contact311Comparison.jsx +++ b/src/components/Comparison/Contact311Comparison.jsx @@ -8,6 +8,8 @@ import { transformCounts } from '@utils'; const Contact311Comparison = ({ counts: { set1, set2 }, + set1list, + set2list, }) => { const setName = district => ( DISTRICT_TYPES @@ -73,21 +75,25 @@ const Contact311Comparison = ({ exportData={exportData} filename="How People Contact 311" /> -
- -

{ set1name }

-
-
- -

{ set2name }

+
+
+ +

{`${set1name}${set1list.length > 1 ? 's' : ''} (Set 1):`}

+

{ set1list.join(', ')}

+
+
+ +

{`${set2name}${set2list.length > 1 ? 's' : ''} (Set 2):`}

+

{ set2list.join(', ') }

+
); @@ -95,6 +101,8 @@ const Contact311Comparison = ({ const mapStateToProps = state => ({ counts: state.comparisonData.counts, + set1list: state.comparisonFilters.comparison.set1.list, + set2list: state.comparisonFilters.comparison.set2.list, }); export default connect(mapStateToProps)(Contact311Comparison); @@ -110,6 +118,8 @@ Contact311Comparison.propTypes = { source: PropTypes.shape({}), }), }), + set1list: PropTypes.arrayOf(PropTypes.string).isRequired, + set2list: PropTypes.arrayOf(PropTypes.string).isRequired, }; Contact311Comparison.defaultProps = { diff --git a/src/styles/comparison/_comparison.scss b/src/styles/comparison/_comparison.scss index b72857851..d96149afe 100644 --- a/src/styles/comparison/_comparison.scss +++ b/src/styles/comparison/_comparison.scss @@ -34,5 +34,9 @@ width: 100%; padding: 2px; } + .set-list { + margin: 0 15px; + } + } } From 46691a6d760f8f1f4cd90c02db5587bc27fb1fda Mon Sep 17 00:00:00 2001 From: Adam Kendis Date: Thu, 30 Jul 2020 11:05:59 -0700 Subject: [PATCH 4/8] Removed splash page redux action. Added /data route. --- src/Routes.jsx | 3 +- src/components/about/About.jsx | 22 ++------- src/components/main/body/Body.jsx | 48 ++++++++----------- src/components/main/footer/Footer.jsx | 9 ++-- src/components/main/menu/Submit.jsx | 8 ++-- .../main/util/routeChangeActions.js | 11 +---- src/redux/reducers/ui.js | 11 ----- 7 files changed, 36 insertions(+), 76 deletions(-) diff --git a/src/Routes.jsx b/src/Routes.jsx index 0f59829e0..c50408d1e 100644 --- a/src/Routes.jsx +++ b/src/Routes.jsx @@ -16,7 +16,8 @@ export default function Routes() { - + + ); } diff --git a/src/components/about/About.jsx b/src/components/about/About.jsx index 6ffc31549..fc7006aa0 100644 --- a/src/components/about/About.jsx +++ b/src/components/about/About.jsx @@ -1,8 +1,4 @@ import React from 'react'; -import PropTypes from 'proptypes'; -import { connect } from 'react-redux'; -import { disableSplashPage } from '@reducers/ui'; - import { Link } from 'react-router-dom'; import Button from '@components/common/Button'; import Icon from '@components/common/Icon'; @@ -11,9 +7,7 @@ import HeroImage from './HeroImage'; import WhatIs311Data from './WhatIs311Data'; import HowItWorks from './HowItWorks'; -const About = ({ - disableSplash, -}) => { +const About = () => { const aboutRef = React.createRef(); const scrollTo = ref => { @@ -37,19 +31,11 @@ const About = ({
- -