Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/search #23

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/gltg.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/closure_compiler_v20170124.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/closure_compiler_v201701241.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/compiler1.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/compiler2.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/success.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/success1.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/success2.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

736 changes: 735 additions & 1 deletion src/config.js

Large diffs are not rendered by default.

30 changes: 6 additions & 24 deletions src/containers/Layout/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Box, CircularProgress, makeStyles } from '@material-ui/core';

import Footer from './Footer';
import Header, { HEADERS_HEIGHT } from './Header';
import SmallHeader from './SmallHeader';


const useStyles = makeStyles({
scrim: {
Expand All @@ -26,24 +26,10 @@ type Props = {
extraMainClasses: string;
children: React.Node;
hasFooter: boolean;
stickyFooter: boolean;
}

const Layout = ({ isLoading, children, extraMainClasses, hasFooter, stickyFooter }: Props) => {
const Layout = ({ isLoading, children, extraMainClasses, hasFooter }: Props) => {
const classes = useStyles();

// Handle screen resizing
const [windowWidth, setWindowWidth] = React.useState(window.innerWidth);
const widthBreakpoint = 1340;
React.useEffect(() => {
const handleResizeWindow = () => setWindowWidth(window.innerWidth);
window.addEventListener('resize',handleResizeWindow);
return () => {
window.removeEventListener('resize',handleResizeWindow);
};
},[]);


return (
<>
{isLoading ?
Expand All @@ -56,13 +42,10 @@ const Layout = ({ isLoading, children, extraMainClasses, hasFooter, stickyFooter
<CircularProgress />
</Box> :
null}
{(windowWidth > widthBreakpoint) ?
<Header /> :
<SmallHeader />
}
<Header />
<main className={`${classes.main} ${extraMainClasses}`}>
{children}
{hasFooter ? <Footer sticky={stickyFooter} /> : null}
{hasFooter ? <Footer /> : null}
</main>
</>
);
Expand All @@ -71,12 +54,11 @@ const Layout = ({ isLoading, children, extraMainClasses, hasFooter, stickyFooter
Layout.defaultProps = {
extraMainClasses: '',
children: null,
hasFooter: false,
stickyFooter: false
hasFooter: false
};

const mapStateToProps = (state) => ({
isLoading: state.page.isLoading
});

export default connect(mapStateToProps)(Layout);
export default connect(mapStateToProps)(Layout);
6 changes: 3 additions & 3 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const __old_config = require('@geostreams/gltg__old/config');
window.configruntime = __old_config;

// $FlowFixMe
import { addEndpoints, fetchSensors as __old_fetchSensors } from '@geostreams/core__old/app/actions';
// import { addEndpoints, fetchSensors as __old_fetchSensors } from '@geostreams/core__old/app/actions';

import render from '@geostreams/core/src/render';
import { updateGeoStreamingConfig } from '@geostreams/geostreaming/src/actions/config';
Expand All @@ -23,8 +23,8 @@ render(
routes,
(store) => {
store.dispatch(updateGeoStreamingConfig(config));
store.dispatch(addEndpoints());
store.dispatch(__old_fetchSensors(config.geostreamingEndpoint));
// store.dispatch(addEndpoints());
// store.dispatch(__old_fetchSensors(config.geostreamingEndpoint));geostreamingEndpoint
store.dispatch(fetchParameters());
store.dispatch(fetchSensors());
}
Expand Down
4 changes: 2 additions & 2 deletions src/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import geostreamingReducers from '@geostreams/geostreaming/src/reducers';

// $FlowFixMe
import __old_reducers from '@geostreams/gltg__old/app/reducers';
//import __old_reducers from '@geostreams/gltg__old/app/reducers';

export default {
...__old_reducers,
// ...__old_reducers,
...geostreamingReducers
};
4 changes: 2 additions & 2 deletions src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import GeoStreamingSearch from '@geostreams/geostreaming/src/containers/Search';
import GeoStreamingSensorDetail from '@geostreams/geostreaming/src/containers/Sensor/Detail';

// $FlowFixMe
import __old_Search from '@geostreams/gltg__old/app/pages/Search';
// import __old_Search from '@geostreams/gltg__old/app/pages/Search';
// $FlowFixMe
import __old_Analysis from '@geostreams/gltg__old/app/pages/Analysis';

Expand All @@ -32,7 +32,7 @@ const routes = Object.assign(
'/:parent(explore|search|analysis)/detail/location/:name/:category': { component: hocs.withLayout(GLTGLayout, GeoStreamingSensorDetail) },
// Routes pointing to the __old code
'/explore/:stations': { component: hocs.withLayout(GLTGLayout, GeoStreamingExplore), exact: true },
'/search': { component: hocs.withLayout(GLTGLayout, __old_Search), exact: true },
'/search': { component: hocs.withLayout(GLTGLayout, GeoStreamingSearch), exact: true },
'/analysis': { component: hocs.withLayout(GLTGLayout, __old_Analysis), exact: true },
'/bmp': { component: hocs.withLayout(GLTGLayout, BMP), exact: true }
}
Expand Down
2 changes: 1 addition & 1 deletion webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
olStyle: 'ol/ol.css',
olLayerSwitcherStyle: 'ol-layerswitcher/src/ol-layerswitcher.css',
mcw__old: 'material-components-web/dist/material-components-web.min.css',
mdc__old: '@geostreams/gltg__old/app/styles_custom/react-mdc-web.css',
// mdc__old: '@geostreams/gltg__old/app/styles_custom/react-mdc-web.css',
coreStyle: '@geostreams/core/src/styles/core.less',
gltgStyle: './src/styles/gltg.less'
},
Expand Down