Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Feat/map update #383

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

.vscode

key_file
key_file.pub
15 changes: 0 additions & 15 deletions .vscode/launch.json

This file was deleted.

17 changes: 0 additions & 17 deletions .vscode/settings.json

This file was deleted.

54 changes: 54 additions & 0 deletions key_file
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,060C7F6BB6D7544F4DF0B0F076801EA9

vAqdWMMVskOZWdc0hmMcNDwz8Hx0simnfUJh5PKr+ZZfITt6ODaNVxA4ANIU2IuK
5DaJPj3N1kJVNigQTz9n75na3dTsbAOn36zEte/VA3WwMKjl6tp8IypZb5E64Kqh
z7x3zfmt6Ts4j2uIYdFI4kP9ilgyD6122DbXQNQanONrzdpDa952PqmD3inxabiL
wKFtyhRA5IaeF8NrJwjR+6fe336CPBXmzteQIWcecQ8O5BEgDui8D93G5O7zXD3y
LMn90u21brrMOmXMCdEHtUCgz0xu3EAfq4xSqCEyG7SgFXcN6HCRtYYXRpUZiX7H
t/TBFJC7CrhsSj2wtIjcz4xwP6O9g9JXnWpREN50OvvUBXW3vFv4ojE1ac4vA3NP
JRWCUn9C8aIJZlWubhmPWbWeFRRUs3Uq1PFKxQFZdThEYHUR+SFndRJo4GO9mFYN
bHhpTsV1vGQfpLT7RIo5+zV4Ff8AdXOsprXMI3Zhl7CIVAc1nCCw3VL0RLx1FVkS
csZtsZGxFuxxwMvXhw0K5C3b6DfAwWD225AmRp5421dBVIklFVormVszd8MQiH5P
barqjfY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XzYAWeVt9DzNFE3s1scdUUONeiDzUVg9qnNiu2d+
tPnCl/BHIr2uRKuZO+Itm1zwlcQXvwrayzgUCDSlrKntbl5AsoYH7Qj2UgXAkrHY
tRPicxyfIi9b4zbwbkO4kBXF+tYKhhVW14/IT4oHhGuxFjR+YBIFnBkn4wIT5Yea
lJpoVSHRXvi1LO8OLgt18RxeEGmt8i4/xE9D/7W/vJ/aXTvDYtBs4qoAZcg/E6hs
om4r62Iuet7ByFWVF9OrZtcHOukk4WcZyQOxNWehTjZ87vdGSymqFeP5CIGncCKy
03MGfXxKKvZa3kTcY6jW6DUJIm8QR7Ik9N8FN4bJcAmOWm6CgNoSyYVlW4TVjy/w
mHC29LEtex2g8bRaQGl/dTnrHlOM1woV34KrpUU+0fzsJW7B+0IrRqtybgh4hktR
-----END RSA PRIVATE KEY-----
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think this key is used anywhere in this code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what this key is either, maybe my SSH key?

1 change: 1 addition & 0 deletions key_file.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCi3kUTVjIVhkaa0GSr3vieErzdaVlZs1tski+XwGQZFFq2jCHfxHl361bLx6pQRwak/QQRZ6soPveHEvOxm/Ss7nMZS34twni3M709uAjanaFVx7hjiRjf+YLiAyyCWlsTt/1QPjMdSl3NUWiK5TUaR3qmOKI6utmqMwB2wT/5Py5wq/zSMcQ7BspytztkTug2o3eKvD7OhWvDfhtjhWgCybk1rETbVdxzbvsqqFsqqWX6YJII97IHlB5VoJBjm7TYopBS+amh4enFTwBkI8wzRuKdONoZ2sR138J1zMN9s4vEe9So1OInshbYM3JISCIeGtIZi5eaJP14N5ewj5K8Pi3i+4rP619f5ZUp4L9qbIKz6VGwmg4xEDc3ARYYFxpsTJz4+wLmmPadW7RqI528cwD/cfLmeO56pli7hviBT0itc9w2GFAhYFHm91EQBsTvkZTSWThXdx9Tt9vl3Cj1B9hpaHwaf8X99aln7NxMzmif6qr/46XwYGa4gVolBDX3fEbdbWXrUHpXMEwP24PpZBfq5QXVx8n9iEvaGEzbVUVwhTVcJrV3Ogt5C+X9AaUfu0ie+fiRW1grcfuk+R1VW2ZvZSbsIJeBhRP8n2bqBfrGF26IMJpkGGJEqyWZbbN+dApfeg4MUQaABbN8nYc9AkyqIFhs37Cj+hLzSqg3Lw== eugen.lefter@gmail.com
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this key is also not used

67 changes: 44 additions & 23 deletions src/App/AppContainer.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
// import React/Redux dependencies
import React, { Component } from 'react';
import { Route } from 'react-router';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { loadResources } from '../action/resourceDataAction';
import { getAllSites } from '../api/directoryGoogleSheets';
import React, { Component } from "react";
import { Route } from "react-router";
import { connect } from "react-redux";
import PropTypes from "prop-types";
import { loadResources } from "../action/resourceDataAction";
import { getAllSites } from "../api/directoryGoogleSheets";

// import components

import Header from '../components/Header/Header';
import MapPage from '../components/MapPage/MapPage';
import AdminPage from '../components/AdminPage/AdminPage';
import { SplitScreenTogglePane } from '../components/AdminPage/SplitScreenTogglePane';
import SavedResourcePanel from '../components/SavedResources/SavedResourcePanel';
import NotFoundPage from '../components/NotFoundPage/NotFoundPage';
import { Loading } from '../components/Common/Loading';
import { FeedbackContainer } from '../components/Common/FeedbackContainer';
import Header from "../components/Header/Header";
import MapPage from "../components/MapPage/MapPage";
import AdminPage from "../components/AdminPage/AdminPage";
import { SplitScreenTogglePane } from "../components/AdminPage/SplitScreenTogglePane";
import SavedResourcePanel from "../components/SavedResources/SavedResourcePanel";
import NotFoundPage from "../components/NotFoundPage/NotFoundPage";
import { Loading } from "../components/Common/Loading";
import { FeedbackContainer } from "../components/Common/FeedbackContainer";
import LandingPage from '../components/LandingPage/LandingPage';
// import Button from '../components/Button/Button'

const envSheetId = process.env.REACT_APP_GOOGLE_SHEETS_ID;

Expand All @@ -34,14 +36,15 @@ class AppContainer extends Component {
constructor(props) {
super(props);
this.state = {

position: {},
displayFeedbackLink: true,
isValidPage: true,
isValidPage: true
};
}

static propTypes = {
dispatch: PropTypes.func,
dispatch: PropTypes.func
};

componentDidMount() {
Expand Down Expand Up @@ -75,26 +78,36 @@ class AppContainer extends Component {
position: {
coordinates: {
lat: parseFloat(position.coords.latitude),
lng: parseFloat(position.coords.longitude),
},
},
lng: parseFloat(position.coords.longitude)
}
}
});
},
error => {
console.log(error);
},
}
);
}
};

toggleSavedResourcesPane = () => {
this.setState({
isSavedResourcePaneOpen: !this.state.isSavedResourcePaneOpen,
isSavedResourcePaneOpen: !this.state.isSavedResourcePaneOpen
});
};

goToResources = () => {
this.setState({
landingPage: false
})
}




render() {
const { isFetchingResource } = this.props;


if (!this.state.isValidPage) {
return <NotFoundPage />;
Expand All @@ -104,13 +117,18 @@ class AppContainer extends Component {
return <Loading />;
}




return (
<div className="viewport">
<div className="viewport-header">
<div className="viewport" >
<div>
<div className="viewport-header">
<Header toggleSavedResourcesPane={this.toggleSavedResourcesPane} />
</div>

<div className="page">

<Route
exact
path="/:resource/admin"
Expand All @@ -136,6 +154,9 @@ class AppContainer extends Component {
{this.state.displayFeedbackLink && (
<FeedbackContainer hideFeedbackLink={this.hideFeedbackLink} />
)}
</div>


</div>
);
}
Expand Down
16 changes: 16 additions & 0 deletions src/components/Button/Button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React, { Component } from "react";

class Button extends Component {
constructor(props){
super(props);
}



render() {
const { goToResources } = this.props;
return <button onClick={goToResources}> Go to Resources </button>;
}
}

export default Button;
29 changes: 29 additions & 0 deletions src/components/LandingPage/LandingPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React, { Component } from "react";


class LandingPage extends Component {
render() {
return (
<div >
<h1> Welcom to Community Connect</h1>
<p style={{ margin: "5rem", fontSize: "1.2rem", lineHeight: "2.2rem" }}>
"Community Connect" is a health resource web application that aims to
consolidate information about businesses and organization available in
communities that promote healthy lifestyle choices. A health resource
is defined as services or materials that improve the quality of life
of others, ranging from affordable child care, substance abuse
counseling, domestic violence support, and more. We are working in
conjunction with Massachusetts General Hospital's Center for Community
Health Improvement, MGH Revere HealthCare Center, and Revere CARES
Coalition to create an extensive database in our pilot region of
Revere, Chelsea, Charlestown, and eventually the Greater Boston Area.
</p>


</div>

);
}
}

export default LandingPage;
33 changes: 21 additions & 12 deletions src/components/MapPage/Map.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
import React from 'react';
import { withScriptjs, withGoogleMap, GoogleMap } from 'react-google-maps';
import { MarkerClusterer } from 'react-google-maps/lib/components/addons/MarkerClusterer';
import OrganizationMarker from './OrganizationMarker';
import { compose, lifecycle } from 'recompose';
import React from "react";
import { withScriptjs, withGoogleMap, GoogleMap } from "react-google-maps";
import { MarkerClusterer } from "react-google-maps/lib/components/addons/MarkerClusterer";
import OrganizationMarker from "./OrganizationMarker";
import { compose, lifecycle } from "recompose";
import Styles from "./mapStyles";

const Map = compose(
lifecycle({
componentWillMount () {
componentWillMount() {
this.setState({
zoomToMarkers: map => {
const bounds = new window.google.maps.LatLngBounds();
map.props.children.props.children.forEach(child => {
bounds.extend(
new window.google.maps.LatLng(
child.props.resource.coordinates.lat,
child.props.resource.coordinates.lng,
),
child.props.resource.coordinates.lng
)
);
});
map.fitBounds(bounds);
},
}
});
},
}
}),

withScriptjs,
withGoogleMap,
withGoogleMap
)(props => (
<GoogleMap {...props} ref={props.zoomToMarkers} defaultZoom={5}>
<GoogleMap
{...props}
ref={props.zoomToMarkers}
defaultZoom={5}
defaultOptions={{
styles: Styles
}}
>
<MarkerClusterer
averageCenter={true}
enableRetinaIcons={true}
Expand Down
12 changes: 6 additions & 6 deletions src/components/MapPage/MapPage.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, { Component } from 'react';
import React, { Component } from "react";

import ResultList from './ResultList';
import OrganizationMap from './OrganizationMap';
import { SplitScreenSlidingPane } from './SplitScreenSlidingPane';
import cx from 'classnames';
import ResultList from "./ResultList";
import OrganizationMap from "./OrganizationMap";
import { SplitScreenSlidingPane } from "./SplitScreenSlidingPane";
import cx from "classnames";

class MapPage extends Component {
render() {
const mapClassName = cx('map-container');
const mapClassName = cx("map-container");
return (
<div className={mapClassName}>
<SplitScreenSlidingPane>
Expand Down
20 changes: 16 additions & 4 deletions src/components/MapPage/OrganizationMarker.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { Component } from 'react';
import { Marker, InfoWindow } from 'react-google-maps';
import React, { Component } from "react";
import { Marker, InfoWindow } from "react-google-maps";

export class OrganizationMarker extends Component {
constructor(props) {
super(props);
this.state = {
open: this.props.open,
open: this.props.open
};
}

Expand All @@ -31,20 +31,32 @@ export class OrganizationMarker extends Component {

render() {
let { resource } = this.props;
let iconMarker = new window.google.maps.MarkerImage(
"https://cdn0.iconfinder.com/data/icons/business-human-resources-2/128/60-512.png",
null /* size is determined at runtime */,
null /* origin is 0,0 */,
null /* anchor is bottom center of the scaled image */,
new window.google.maps.Size(32, 32)
);
const InfoWindowStyle = {
backgroundColor: "green"
};
return (
<Marker
icon={iconMarker}
optimize={false}
position={resource.coordinates}
onClick={this.scrollToElement}
>
{this.state.open && (
<InfoWindow onCloseClick={this.handleClose}>
<InfoWindow onCloseClick={this.handleClose} style={InfoWindowStyle}>
<div>
{resource.groupedResource.map(resource => (
<div
key={resource.id}
id={resource.id}
onClick={this.handleClickOfInfoWindow}
style={{ padding: "25px" }}
>
<h3>{resource.name}</h3>
<div>{resource.combinedaddress}</div>
Expand Down
Loading