Skip to content

Commit

Permalink
Merge branch 'preproduction'
Browse files Browse the repository at this point in the history
* preproduction:
  Hotfix: explore-embed-and-share
  • Loading branch information
mbarrenechea committed Jan 24, 2018
2 parents dffdc83 + 649534c commit 736ffb2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { getSelectedDataset } from '../explore-datasets-list/explore-datasets-li

const mapStateToProps = state => ({
embed: true,
dataset: getSelectedDataset(state)
dataset: getSelectedDataset(state),
user: state.user
});

export { initialState };
Expand Down
14 changes: 13 additions & 1 deletion app/scripts/pages/explore/explore-map/explore-map-component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class ExploreMap extends PureComponent {
'-embed': embed
});

const { origin, search } = window.location;

return (
<div className={`c-explore-map ${classNames}`}>
<Map
Expand Down Expand Up @@ -56,6 +58,13 @@ class ExploreMap extends PureComponent {

<ShareControl
className="-absolute" // pfff....
open={this.props.open}
links={{
link: window.location.href,
embed: `${origin}/embed/explore/${search}`
}}
setOpen={this.props.setOpen}
setLinks={this.props.setLinks}
/>
}
</Map>
Expand Down Expand Up @@ -92,6 +101,7 @@ ExploreMap.propTypes = {
lat: PropTypes.number,
lng: PropTypes.number,
embed: PropTypes.bool,
open: PropTypes.bool,
setBasemap: PropTypes.func,
setLabels: PropTypes.func,
setBoundaries: PropTypes.func,
Expand All @@ -101,7 +111,9 @@ ExploreMap.propTypes = {
toggleDataset: PropTypes.func,
toggleVisibility: PropTypes.func,
updateOpacity: PropTypes.func,
setMultiActiveLayer: PropTypes.func
setMultiActiveLayer: PropTypes.func,
setOpen: PropTypes.func,
setLinks: PropTypes.func
};

export default ExploreMap;
16 changes: 13 additions & 3 deletions app/scripts/pages/explore/explore-map/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { connect } from 'react-redux';
import * as shareModalActions from 'components/share-modal/share-modal-actions';

import * as exploreActions from '../explore-actions';
import * as reducers from './explore-map-reducers';
import initialState from './explore-map-initial-state';
import Component from './explore-map-component';
import { getActiveLayers } from './explore-map-selector';

import Component from './explore-map-component';

const mapStateToProps = state => ({
activeLayers: getActiveLayers(state),
lat: state.explorePage.map.lat,
Expand All @@ -13,9 +16,16 @@ const mapStateToProps = state => ({
minZoom: state.explorePage.map.minZoom,
basemap: state.explorePage.map.basemap,
labels: state.explorePage.map.labels,
boundaries: state.explorePage.map.boundaries
boundaries: state.explorePage.map.boundaries,
open: state.shareModal.open
});

export { reducers, initialState };

export default connect(mapStateToProps, exploreActions)(Component);
export default connect(
mapStateToProps,
{
...exploreActions,
...shareModalActions
}
)(Component);

0 comments on commit 736ffb2

Please sign in to comment.