Commit 76dd5bb9 authored by Andrew Hrdy's avatar Andrew Hrdy
Browse files

Application now runs.

parent 0295bd7d
Pipeline #3954 passed with stage
in 1 minute and 43 seconds
...@@ -665,26 +665,6 @@ ...@@ -665,26 +665,6 @@
} }
} }
}, },
"@types/react-router": {
"version": "4.4.4",
"resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-4.4.4.tgz",
"integrity": "sha512-TZVfpT6nvUv/lbho/nRtckEtgkhspOQr3qxrnpXixwgQRKKyg5PvDfNKc8Uend/p/Pi70614VCmC0NPAKWF+0g==",
"requires": {
"@types/history": "*",
"@types/react": "*"
}
},
"@types/react-router-redux": {
"version": "5.0.18",
"resolved": "https://registry.npmjs.org/@types/react-router-redux/-/react-router-redux-5.0.18.tgz",
"integrity": "sha512-5SI69Virpmo+5HXWXKIzSt5hsnV7TTidL3Ddmbi+PH1CIdi40wthJwjFoqiE+gRQANur5WhjEtfyPorJ4zymHA==",
"requires": {
"@types/history": "*",
"@types/react": "*",
"@types/react-router": "*",
"redux": ">= 3.7.2"
}
},
"@types/react-transition-group": { "@types/react-transition-group": {
"version": "2.0.15", "version": "2.0.15",
"resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-2.0.15.tgz", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-2.0.15.tgz",
...@@ -3413,6 +3393,15 @@ ...@@ -3413,6 +3393,15 @@
"integrity": "sha1-sGhzk0vF40T+9hGhlqb6rgruAVo=", "integrity": "sha1-sGhzk0vF40T+9hGhlqb6rgruAVo=",
"dev": true "dev": true
}, },
"connected-react-router": {
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/connected-react-router/-/connected-react-router-6.3.1.tgz",
"integrity": "sha512-nhuQiLOAQlCgkCypGSUhycgaqqTh2IUwVFvzw2y13v8JqB92yTk3yeAKG6X1b0IcD7S4gQizYbjgejf7DJjbyw==",
"requires": {
"immutable": "^3.8.1",
"seamless-immutable": "^7.1.3"
}
},
"console-browserify": { "console-browserify": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz",
...@@ -6668,6 +6657,18 @@ ...@@ -6668,6 +6657,18 @@
"integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=",
"dev": true "dev": true
}, },
"history": {
"version": "4.7.2",
"resolved": "https://registry.npmjs.org/history/-/history-4.7.2.tgz",
"integrity": "sha512-1zkBRWW6XweO0NBcjiphtVJVsIQ+SXF29z9DVkceeaSLVMFXHool+fdCZD4spDCfZJCILPILc3bm7Bc+HRi0nA==",
"requires": {
"invariant": "^2.2.1",
"loose-envify": "^1.2.0",
"resolve-pathname": "^2.2.0",
"value-equal": "^0.4.0",
"warning": "^3.0.0"
}
},
"hmac-drbg": { "hmac-drbg": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
...@@ -7230,6 +7231,11 @@ ...@@ -7230,6 +7231,11 @@
"integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==", "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==",
"dev": true "dev": true
}, },
"immutable": {
"version": "3.8.2",
"resolved": "https://registry.npmjs.org/immutable/-/immutable-3.8.2.tgz",
"integrity": "sha1-wkOZUUVbs5kT2vKBN28VMOEErfM="
},
"import-lazy": { "import-lazy": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz",
...@@ -8451,12 +8457,8 @@ ...@@ -8451,12 +8457,8 @@
"lodash": { "lodash": {
"version": "4.17.10", "version": "4.17.10",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==",
}, "dev": true
"lodash-es": {
"version": "4.17.10",
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.10.tgz",
"integrity": "sha512-iesFYPmxYYGTcmQK0sL8bX3TGHyM6b2qREaB4kamHfQyfPJP0xgoGxp19nsH16nsfquLdiyKyX3mQkfiSGV8Rg=="
}, },
"lodash._reinterpolate": { "lodash._reinterpolate": {
"version": "3.0.0", "version": "3.0.0",
...@@ -10015,7 +10017,6 @@ ...@@ -10015,7 +10017,6 @@
"version": "1.7.0", "version": "1.7.0",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz",
"integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=",
"dev": true,
"requires": { "requires": {
"isarray": "0.0.1" "isarray": "0.0.1"
}, },
...@@ -10023,8 +10024,7 @@ ...@@ -10023,8 +10024,7 @@
"isarray": { "isarray": {
"version": "0.0.1", "version": "0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
"dev": true
} }
} }
}, },
...@@ -11850,22 +11850,69 @@ ...@@ -11850,22 +11850,69 @@
"integrity": "sha512-ANK/SDDA3z827vcY8w77tTC8pOkpMSw1xNs5ifImho92oNS1rIfiTdVXNW7TpqP3a8hU+p9AxPAgPZhmkYtyzw==" "integrity": "sha512-ANK/SDDA3z827vcY8w77tTC8pOkpMSw1xNs5ifImho92oNS1rIfiTdVXNW7TpqP3a8hU+p9AxPAgPZhmkYtyzw=="
}, },
"react-redux": { "react-redux": {
"version": "5.0.7", "version": "6.0.0",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-5.0.7.tgz", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-6.0.0.tgz",
"integrity": "sha512-5VI8EV5hdgNgyjfmWzBbdrqUkrVRKlyTKk1sGH3jzM2M2Mhj/seQgPXaz6gVAj2lz/nz688AdTqMO18Lr24Zhg==", "integrity": "sha512-EmbC3uLl60pw2VqSSkj6HpZ6jTk12RMrwXMBdYtM6niq0MdEaRq9KYCwpJflkOZj349BLGQm1MI/JO1W96kLWQ==",
"requires": { "requires": {
"hoist-non-react-statics": "^2.5.0", "@babel/runtime": "^7.2.0",
"invariant": "^2.0.0", "hoist-non-react-statics": "^3.2.1",
"lodash": "^4.17.5", "invariant": "^2.2.4",
"lodash-es": "^4.17.5", "loose-envify": "^1.4.0",
"loose-envify": "^1.1.0", "prop-types": "^15.6.2",
"prop-types": "^15.6.0" "react-is": "^16.6.3"
},
"dependencies": {
"hoist-non-react-statics": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz",
"integrity": "sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA==",
"requires": {
"react-is": "^16.7.0"
}
},
"loose-envify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
"requires": {
"js-tokens": "^3.0.0 || ^4.0.0"
}
},
"prop-types": {
"version": "15.7.2",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz",
"integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==",
"requires": {
"loose-envify": "^1.4.0",
"object-assign": "^4.1.1",
"react-is": "^16.8.1"
}
}
} }
}, },
"react-router-redux": { "react-router": {
"version": "4.0.8", "version": "4.3.1",
"resolved": "https://registry.npmjs.org/react-router-redux/-/react-router-redux-4.0.8.tgz", "resolved": "https://registry.npmjs.org/react-router/-/react-router-4.3.1.tgz",
"integrity": "sha1-InQDWWtRUeGCN32rg1tdRfD4BU4=" "integrity": "sha512-yrvL8AogDh2X42Dt9iknk4wF4V8bWREPirFfS9gLU1huk6qK41sg7Z/1S81jjTrGHxa3B8R3J6xIkDAA6CVarg==",
"requires": {
"history": "^4.7.2",
"hoist-non-react-statics": "^2.5.0",
"invariant": "^2.2.4",
"loose-envify": "^1.3.1",
"path-to-regexp": "^1.7.0",
"prop-types": "^15.6.1",
"warning": "^4.0.1"
},
"dependencies": {
"warning": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz",
"integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==",
"requires": {
"loose-envify": "^1.0.0"
}
}
}
}, },
"react-transition-group": { "react-transition-group": {
"version": "2.3.1", "version": "2.3.1",
...@@ -12359,6 +12406,11 @@ ...@@ -12359,6 +12406,11 @@
"integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=",
"dev": true "dev": true
}, },
"resolve-pathname": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-2.2.0.tgz",
"integrity": "sha512-bAFz9ld18RzJfddgrO2e/0S2O81710++chRMUxHjXOYKF6jTAMrUNZrEZ1PvV0zlhfjidm08iRPdTLPno1FuRg=="
},
"resolve-protobuf-schema": { "resolve-protobuf-schema": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz",
...@@ -12577,6 +12629,11 @@ ...@@ -12577,6 +12629,11 @@
} }
} }
}, },
"seamless-immutable": {
"version": "7.1.4",
"resolved": "https://registry.npmjs.org/seamless-immutable/-/seamless-immutable-7.1.4.tgz",
"integrity": "sha512-XiUO1QP4ki4E2PHegiGAlu6r82o5A+6tRh7IkGGTVg/h+UoeX4nFBeCGPOhb4CYjvkqsfm/TUtvOMYC1xmV30A=="
},
"select-hose": { "select-hose": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz",
...@@ -14597,6 +14654,11 @@ ...@@ -14597,6 +14654,11 @@
"spdx-expression-parse": "^3.0.0" "spdx-expression-parse": "^3.0.0"
} }
}, },
"value-equal": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-0.4.0.tgz",
"integrity": "sha512-x+cYdNnaA3CxvMaTX0INdTCN8m8aF2uY9BvEqmxuYp8bL09cs/kWVQPVGcA35fMktdOsP69IgU7wFj/61dJHEw=="
},
"vary": { "vary": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
......
import * as React from 'react'; import * as React from 'react';
import classNames from 'classnames';
import { findLink } from '../utils/nameUtils'; import { findLink } from '../utils/nameUtils';
import { IAlert } from '../models/alert.model'; import { IAlert } from '../models/alert.model';
...@@ -7,6 +6,8 @@ import Chip from '@material-ui/core/Chip'; ...@@ -7,6 +6,8 @@ import Chip from '@material-ui/core/Chip';
import Button from '@material-ui/core/Button'; import Button from '@material-ui/core/Button';
import ArrowForwardIcon from '@material-ui/icons/ArrowForward'; import ArrowForwardIcon from '@material-ui/icons/ArrowForward';
var classNames = require('classnames');
class Alert extends React.Component<AlertProps> { class Alert extends React.Component<AlertProps> {
constructor(props: AlertProps) { constructor(props: AlertProps) {
......
...@@ -6,13 +6,14 @@ import Button from '@material-ui/core/Button'; ...@@ -6,13 +6,14 @@ import Button from '@material-ui/core/Button';
import IconButton from '@material-ui/core/IconButton'; import IconButton from '@material-ui/core/IconButton';
import MenuIcon from '@material-ui/icons/Menu'; import MenuIcon from '@material-ui/icons/Menu';
import SearchBar from '../containers/SearchBar'; import SearchBar from '../containers/SearchBar';
import classNames from 'classnames';
import AlertContainer from '../containers/AlertContainer'; import AlertContainer from '../containers/AlertContainer';
var classNames = require('classnames');
class CustomAppBar extends React.Component<{}, CustomAppBarState> { class CustomAppBar extends React.Component<{}, CustomAppBarState> {
constructor() { constructor(props: {}) {
super({}); super(props);
this.state = { this.state = {
isAppBarExpanded: false, isAppBarExpanded: false,
isSearchExpanded: false isSearchExpanded: false
......
...@@ -39,7 +39,7 @@ class FacilitiesMap extends React.Component<FacilitiesMapProps, FacilitiesMapSta ...@@ -39,7 +39,7 @@ class FacilitiesMap extends React.Component<FacilitiesMapProps, FacilitiesMapSta
maxBounds: getMaxBounds(campusRegion), maxBounds: getMaxBounds(campusRegion),
campusRegion: campusRegion, campusRegion: campusRegion,
zoom: [17], zoom: [17],
center: facility ? facility.facility_location.coordinate_location.coordinates : getCenterOfCampusRegion(campusRegion), center: facility && facility.facility_location ? facility.facility_location.coordinate_location.coordinates : getCenterOfCampusRegion(campusRegion),
facilityLocations: [], facilityLocations: [],
selectedLocation: null, selectedLocation: null,
isLoaded: false isLoaded: false
......
import * as React from 'react'; import * as React from 'react';
import classNames from 'classnames';
import FacilityUtils from '../utils/facilityUtils'; import FacilityUtils from '../utils/facilityUtils';
import { IFacility } from '../models/facility.model'; import { IFacility } from '../models/facility.model';
import Typography from '@material-ui/core/Typography'; import Typography from '@material-ui/core/Typography';
var classNames = require('classnames');
class FacilityStatus extends React.Component<FacilityStatusProps> { class FacilityStatus extends React.Component<FacilityStatusProps> {
constructor(props: FacilityStatusProps) { constructor(props: FacilityStatusProps) {
......
import * as React from 'react'; import * as React from 'react';
import classNames from 'classnames';
import ReactPiwik from 'react-piwik';
import FavoriteBorderIcon from '@material-ui/icons/FavoriteBorder'; import FavoriteBorderIcon from '@material-ui/icons/FavoriteBorder';
import FavoriteIcon from '@material-ui/icons/Favorite'; import FavoriteIcon from '@material-ui/icons/Favorite';
import { trackPiwikEvent } from '../piwik/piwik';
var classNames = require('classnames');
class FavoriteButton extends React.Component<FavoriteButtonProps, FavoriteButtonState> { class FavoriteButton extends React.Component<FavoriteButtonProps, FavoriteButtonState> {
...@@ -25,13 +26,13 @@ class FavoriteButton extends React.Component<FavoriteButtonProps, FavoriteButton ...@@ -25,13 +26,13 @@ class FavoriteButton extends React.Component<FavoriteButtonProps, FavoriteButton
}); });
if (!newState) { if (!newState) {
ReactPiwik.push(['trackEvent', 'card-action', 'un-favorite']); trackPiwikEvent('card-action', 'un-favorite');
setTimeout(() => { setTimeout(() => {
this.props.removeFavoriteFacility(this.props.slug); this.props.removeFavoriteFacility(this.props.slug);
}, 0); }, 0);
} else { } else {
ReactPiwik.push(['trackEvent', 'card-action', 'favorite']); trackPiwikEvent('card-action', 'favorite');
setTimeout(() => { setTimeout(() => {
this.props.addFavoriteFacility(this.props.slug); this.props.addFavoriteFacility(this.props.slug);
......
import * as React from 'react'; import * as React from 'react';
import classNames from 'classnames';
import { removeBrackets } from '../utils/nameUtils'; import { removeBrackets } from '../utils/nameUtils';
import * as phoneFormatter from 'phone-formatter'; import * as phoneFormatter from 'phone-formatter';
import ReactPiwik from 'react-piwik';
import { IFacility } from '../models/facility.model'; import { IFacility } from '../models/facility.model';
import TextwTitle from './TextwTitle'; import TextwTitle from './TextwTitle';
...@@ -16,6 +14,9 @@ import Typography from '@material-ui/core/Typography'; ...@@ -16,6 +14,9 @@ import Typography from '@material-ui/core/Typography';
import Divider from '@material-ui/core/Divider'; import Divider from '@material-ui/core/Divider';
import CloseIcon from '@material-ui/icons/Close'; import CloseIcon from '@material-ui/icons/Close';
import IconButton from '@material-ui/core/IconButton'; import IconButton from '@material-ui/core/IconButton';
import { trackPiwikEvent } from '../piwik/piwik';
var classNames = require('classnames');
class Sidebar extends React.Component<SidebarProps, SidebarState> { class Sidebar extends React.Component<SidebarProps, SidebarState> {
...@@ -33,14 +34,16 @@ class Sidebar extends React.Component<SidebarProps, SidebarState> { ...@@ -33,14 +34,16 @@ class Sidebar extends React.Component<SidebarProps, SidebarState> {
}; };
handleMapDialogClose = () => { handleMapDialogClose = () => {
ReactPiwik.push(['trackEvent', 'map-action', 'close']); trackPiwikEvent('map-action', 'close');
this.setState({ this.setState({
mapDialogOpen: false mapDialogOpen: false
}); });
}; };
handleMapDialogOpen = () => { handleMapDialogOpen = () => {
ReactPiwik.push(['trackEvent', 'map-action', 'open']); trackPiwikEvent('map-action', 'open');
this.setState({ this.setState({
mapDialogOpen: true mapDialogOpen: true
}); });
......
...@@ -129,7 +129,7 @@ interface AlertContainerState { ...@@ -129,7 +129,7 @@ interface AlertContainerState {
const mapStateToProps = (state: ApplicationState) => ({ const mapStateToProps = (state: ApplicationState) => ({
alerts: state.alerts.alerts, alerts: state.alerts.alerts,
viewedAlerts: state.alerts.viewedAlerts viewedAlerts: state.alerts.viewedAlerts
}) });
const mapDispatchToProps = (dispatch: Dispatch) => ({ const mapDispatchToProps = (dispatch: Dispatch) => ({
addViewedAlerts: (alertIds: number[]) => dispatch(addViewedAlerts(alertIds)) addViewedAlerts: (alertIds: number[]) => dispatch(addViewedAlerts(alertIds))
......
import * as React from 'react'; import * as React from 'react';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {removeBrackets} from '../utils/nameUtils'; import {removeBrackets} from '../utils/nameUtils';
import classNames from 'classnames';
import FacilityUtils from '../utils/facilityUtils'; import FacilityUtils from '../utils/facilityUtils';
import ReactPiwik from 'react-piwik';
import { IFacility } from '../models/facility.model'; import { IFacility } from '../models/facility.model';
import FacilityStatus from '../components/FacilityStatus'; import FacilityStatus from '../components/FacilityStatus';
...@@ -19,6 +17,9 @@ import LocationOnIcon from '@material-ui/icons/LocationOn'; ...@@ -19,6 +17,9 @@ import LocationOnIcon from '@material-ui/icons/LocationOn';
import { ApplicationState } from '../store'; import { ApplicationState } from '../store';
import { Dispatch } from 'redux'; import { Dispatch } from 'redux';
import { addFavoriteFacility, removeFavoriteFacility, setSelectedFacility, setSidebarExpansion } from '../store/ui/ui.actions'; import { addFavoriteFacility, removeFavoriteFacility, setSelectedFacility, setSidebarExpansion } from '../store/ui/ui.actions';
import { trackPiwikEvent } from '../piwik/piwik';
var classNames = require('classnames');
class FacilityCard extends React.Component<FacilityCardProps, FacilityCardState> { class FacilityCard extends React.Component<FacilityCardProps, FacilityCardState> {
...@@ -51,7 +52,7 @@ class FacilityCard extends React.Component<FacilityCardProps, FacilityCardState> ...@@ -51,7 +52,7 @@ class FacilityCard extends React.Component<FacilityCardProps, FacilityCardState>
const newState = !this.props.isSelected; const newState = !this.props.isSelected;
ReactPiwik.push(['trackEvent', 'card-action', 'click']); trackPiwikEvent('card-action', 'click');
setTimeout(() => { setTimeout(() => {
this.props.setSelectedFacility(newState ? this.props.facility : null); this.props.setSelectedFacility(newState ? this.props.facility : null);
......
import * as React from 'react'; import * as React from 'react';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import classNames from 'classnames';
import ReactPiwik from 'react-piwik';
import { CampusRegion } from '../models/facility.model'; import { CampusRegion } from '../models/facility.model';
import SearchIcon from '@material-ui/icons/Search'; import SearchIcon from '@material-ui/icons/Search';
...@@ -15,6 +13,9 @@ import Select from '@material-ui/core/Select'; ...@@ -15,6 +13,9 @@ import Select from '@material-ui/core/Select';
import FormControl from '@material-ui/core/FormControl'; import FormControl from '@material-ui/core/FormControl';
import { Dispatch } from 'redux'; import { Dispatch } from 'redux';
import { setSearchTerm, setSelectedCampusRegion } from '../store/ui/ui.actions'; import { setSearchTerm, setSelectedCampusRegion } from '../store/ui/ui.actions';
import { trackPiwikEvent } from '../piwik/piwik';
var classNames = require('classnames');
class SearchBar extends React.Component<SearchBarProps, SearchBarState> { class SearchBar extends React.Component<SearchBarProps, SearchBarState> {
private inputElement: any; private inputElement: any;
...@@ -39,7 +40,7 @@ class SearchBar extends React.Component<SearchBarProps, SearchBarState> { ...@@ -39,7 +40,7 @@ class SearchBar extends React.Component<SearchBarProps, SearchBarState> {
}; };
handleRegionChange = (e: React.ChangeEvent<HTMLSelectElement>) => { handleRegionChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
ReactPiwik.push(['trackEvent', 'change-campus', e.target.value]); trackPiwikEvent('change-campus', e.target.value);
const campusRegion = (CampusRegion as any)[e.target.value]; const campusRegion = (CampusRegion as any)[e.target.value];
...@@ -51,7 +52,7 @@ class SearchBar extends React.Component<SearchBarProps, SearchBarState> { ...@@ -51,7 +52,7 @@ class SearchBar extends React.Component<SearchBarProps, SearchBarState> {
}; };
handleFocus = () => { handleFocus = () => {
ReactPiwik.push(['trackEvent', 'search-action', 'focused']); trackPiwikEvent('search-action', 'focused');
this.setState({ this.setState({
isFocused: true