Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed May 26, 2021
1 parent 80a562e commit 9ca01cb
Show file tree
Hide file tree
Showing 7 changed files with 1,161 additions and 113 deletions.
1 change: 0 additions & 1 deletion src/components/manage/Blocks/FiltersBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,6 @@ const View = ({ content, ...props }) => {
}
});


setState({
...state,
filters: newFilters,
Expand Down
7 changes: 4 additions & 3 deletions src/components/manage/Blocks/SiteLocationMap/View.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from 'react';
import { connect } from 'react-redux';
import { Container } from 'semantic-ui-react';
import Map from '@eeacms/volto-openlayers-map/Map';
import { Interactions } from '@eeacms/volto-openlayers-map/Interactions';
import { Controls } from '@eeacms/volto-openlayers-map/Controls';
Expand Down Expand Up @@ -52,8 +53,8 @@ const View = (props) => {
});

return (
<div className="site-location-map-wrapper full-width">
<div className="site-location-map full-width">
<div className="site-location-map-wrapper">
<Container className="site-location-map">
<Map
view={{
center: proj.fromLonLat([20, 50]),
Expand Down Expand Up @@ -94,7 +95,7 @@ const View = (props) => {
select={false}
/>
</Map>
</div>
</Container>
</div>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/manage/Blocks/SiteLocationMap/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ div#view .ui.container > .site-location-map {
}

.site-location-map .ol-map {
height: 400px;
min-height: 400px;
height: 300px;
min-height: 300px;
}
7 changes: 2 additions & 5 deletions src/components/manage/Blocks/SiteStructureSidebar/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ GROUP BY facilities.siteName,
lcps.lcpInspireId
*/

// AT.CAED/9008390010204.SITE -> fara lcps
// AT.CAED/9008390099636.SITE -> cu de toate

const getQueryString = (query) => {
if (!Object.keys(query).length) return '';
return '?' + qs.stringify(query);
Expand All @@ -35,10 +32,9 @@ const getQueryString = (query) => {
const View = (props) => {
const [siteStructure, setSiteStructure] = React.useState(null);
const [siteDetails, setSiteDetails] = React.useState({});
const { data = {}, provider_data = {} } = props;
const { provider_data = {} } = props;
const provider_data_string = JSON.stringify(provider_data);
const dataReady = provider_data?.siteInspireId?.length > 0;
const parentPathname = removeTralingSlash(data.pathname || '');
const pathname = removeTralingSlash(props.location.pathname || '');
const query = qs.parse(props.location?.search?.replace('?', ''));
const newQuery = qs.parse(props.location?.search?.replace('?', ''));
Expand Down Expand Up @@ -88,6 +84,7 @@ const View = (props) => {
facilities: newSiteStructure.facilities.sort(),
});
}
/* eslint-disable-next-line */
}, [provider_data_string]);

return props.mode === 'edit' ? (
Expand Down
18 changes: 12 additions & 6 deletions src/components/theme/View/DefaultView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import React, { useEffect, useState } from 'react';
import { compose } from 'redux';
import { connect } from 'react-redux';
import { matchPath } from 'react-router';
import { useHistory } from 'react-router-dom';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
Expand All @@ -21,6 +22,7 @@ import {
getBlocksLayoutFieldname,
hasBlocksData,
getBaseUrl,
flattenToAppURL,
} from '@plone/volto/helpers';

const messages = defineMessages({
Expand Down Expand Up @@ -53,10 +55,12 @@ const DefaultView = ({ content, intl, location, query }) => {
const unlisten = history.listen((location, action) => {
if (location?.state?.ignoreScrollBehavior) {
const scrollTo = window.scrollTo;
const y = window.scrollY;
window.scrollTo = () => {};
setTimeout(() => {
window.scrollTo = scrollTo;
}, 1);
window.scrollTo(0, y);
}, 10);
}
});
return () => {
Expand All @@ -67,11 +71,13 @@ const DefaultView = ({ content, intl, location, query }) => {
}, []);

useEffect(() => {
if (
content['layout'] === 'default_view' &&
content['@type'] === 'site_template' &&
hasRequiredQuery
) {
const isIndustrialSite = !!matchPath(flattenToAppURL(content?.['@id']), {
path: '/industrial-site/*',
exact: true,
strict: false,
});

if (isIndustrialSite && hasRequiredQuery) {
history.push('/explore/explore-data-map/map');
return;
}
Expand Down
22 changes: 14 additions & 8 deletions src/customizations/volto/components/theme/Footer/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,28 @@ const Footer = ({ intl }) => (
</li>

<li>
<Link className="item" to="/explore/explore-data-map/map">
<FormattedMessage
id="data"
defaultMessage="Browse the data"
/>
<Link className="item" to="/explore">
<FormattedMessage id="explore" defaultMessage="Explore" />
</Link>
</li>

<li>
<Link className="item" to="/analyse">
<FormattedMessage id="analyse" defaultMessage="Analyse" />
</Link>
</li>

<li>
<Link className="item" to="/download">
<FormattedMessage id="datasets" defaultMessage="Download" />
<FormattedMessage id="download" defaultMessage="Download" />
</Link>
</li>
<li>
<Link className="item" to="/glossary">
<FormattedMessage id="glossary" defaultMessage="Glossary" />
<Link className="item" to="/pollutants">
<FormattedMessage
id="pollutants"
defaultMessage="Pollutants"
/>
</Link>
</li>
<li>
Expand Down
Loading

0 comments on commit 9ca01cb

Please sign in to comment.