Skip to content

Commit

Permalink
Volto 8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Sep 21, 2020
1 parent 8c8bdfd commit 40140cf
Show file tree
Hide file tree
Showing 6 changed files with 336 additions and 75 deletions.
9 changes: 9 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
],
"volto-embed": [
"develop/volto-embed/src"
],
"@eeacms/volto-tabs-block": [
"develop/volto-tabs-block/src"
],
"@eeacms/volto-slate-metadata-mentions": [
"develop/volto-slate-metadata-mentions/src"
],
"volto-slate": [
"develop/volto-slate/src"
]
},
"baseUrl": "src"
Expand Down
19 changes: 18 additions & 1 deletion mrs.developer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@
"url": "https://github.com/eea/volto-embed.git",
"branch": "master",
"path": "src"
}
},
"volto-tabs-block": {
"url": "https://github.com/eea/volto-tabs-block.git",
"branch": "develop",
"path": "src",
"package": "@eeacms/volto-tabs-block"
},
"volto-slate-metadata-mentions": {
"url": "https://github.com/eea/volto-slate-metadata-mentions.git",
"branch": "develop",
"path": "src",
"package": "@eeacms/volto-slate-metadata-mentions"
},
"volto-slate": {
"url": "https://github.com/eea/volto-slate.git",
"branch": "develop",
"path": "src"
}
}

23 changes: 11 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@
"workspaces": [
"src/develop/volto-grid-block",
"src/develop/volto-addons",
"src/develop/volto-datablocks"
"src/develop/volto-datablocks",
"src/develop/volto-slate-metadata-mentions",
"src/develop/volto-slate"
],
"addons": [
"volto-slate:asDefault",
"@eeacms/volto-image-zoom-and-flip",
"@eeacms/volto-widgets-view",
"@eeacms/volto-slate-metadata-mentions",
"@eeacms/volto-metadata-block",
"@eeacms/volto-tabs-block",
"@eeacms/volto-widget-toggle",
"@eeacms/volto-object-widget",
"@eeacms/volto-grid-block",
"volto-addons",
"volto-datablocks",
"@eeacms/volto-grid-block"
"volto-datablocks"
],
"scripts": {
"start": "razzle start",
Expand Down Expand Up @@ -107,13 +109,11 @@
"node": "^10 || ^12"
},
"dependencies": {
"@eeacms/volto-image-zoom-and-flip": "github:eea/volto-image-zoom-and-flip#0.1.0",
"@eeacms/volto-metadata-block": "github:eea/volto-metadata-block#0.2.0",
"@eeacms/volto-slate-metadata-mentions": "github:eea/volto-slate-metadata-mentions#0.2.0",
"@eeacms/volto-tabs-block": "github:eea/volto-tabs-block#0.2.2",
"@eeacms/volto-metadata-block": "github:eea/volto-metadata-block#1.0.1",
"@eeacms/volto-widget-toggle": "github:eea/volto-widget-toggle#0.1.0",
"@eeacms/volto-widgets-view": "github:eea/volto-widgets-view#0.2.4",
"@plone/volto": "github:eea/volto#7.11.1-beta.1",
"@eeacms/volto-widgets-view": "github:eea/volto-widgets-view#1.0.1",
"@eeacms/volto-object-widget": "github:eea/volto-object-widget#0.1.2",
"@plone/volto": "github:eea/volto#8.0.0-beta.10",
"@tinymce/tinymce-react": "^3.6.0",
"axios": "^0.20.0",
"jsonp": "^0.2.1",
Expand All @@ -128,8 +128,7 @@
"react-loadable": "^5.5.0",
"react-sizeme": "^2.6.12",
"react-tooltip": "^4.2.9",
"react-visibility-sensor": "^5.1.1",
"volto-slate": "github:eea/volto-slate#0.6.0"
"react-visibility-sensor": "^5.1.1"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
Expand Down
20 changes: 17 additions & 3 deletions src/components/manage/Blocks/DiscodataOpenlayersMapBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const OpenlayersMapView = (props) => {
sitesSourceQuery: { whereStatements: {}, where: '' },
oldSitesSourceQuery: { whereStatements: {}, where: '' },
sitesSourceLayer: null,
regionsSourceLayer: null,
},
popup: { element: null, properties: {} },
popupDetails: { element: null, properties: {} },
Expand All @@ -119,6 +120,7 @@ const OpenlayersMapView = (props) => {
sitesSourceQuery: { whereStatements: {}, where: '' },
oldSitesSourceQuery: { whereStatements: {}, where: '' },
sitesSourceLayer: null,
regionsSourceLayer: null,
},
popup: { element: null, properties: {} },
popupDetails: { element: null, properties: {} },
Expand Down Expand Up @@ -262,6 +264,7 @@ const OpenlayersMapView = (props) => {
}),
);
}
/* eslint-disable-next-line */
}, [selectedSite]);

useEffect(() => {
Expand All @@ -272,13 +275,23 @@ const OpenlayersMapView = (props) => {
if (mapRendered) {
updateFilters();
const baseSql = `(CNTR_CODE LIKE '%:options%')`;
const countries = props.discodata_query.search.siteCountry || [];
regionsSourceWhere.current =
const countries =
props.discodata_query.search.siteCountry?.filter(
(country) => country,
) || [];
const newRegionsSourceWhere =
countries.length > 0
? `(${countries
.map((country) => baseSql.replace('options', country))
.map((country) => baseSql.replace(':options', country))
.join(' OR ')})`
: '';
if (
hasRegionsFeatures &&
newRegionsSourceWhere !== regionsSourceWhere.current
) {
regionsSourceWhere.current = newRegionsSourceWhere;
state.map.regionsSourceLayer.getSource().refresh();
}
}
/* eslint-disable-next-line */
}, [
Expand Down Expand Up @@ -1000,6 +1013,7 @@ const OpenlayersMapView = (props) => {
...stateRef.current.map,
element: map,
sitesSourceLayer,
regionsSourceLayer: hasRegionsFeatures ? regionsSourceLayer : null,
},
popup: {
...stateRef.current.popup,
Expand Down
14 changes: 4 additions & 10 deletions src/components/manage/Blocks/DiscodataTableBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const components = {
if (Array.isArray(item[itemMetadata])) return item[itemMetadata].join(', ');
if (typeof item[itemMetadata] === 'object' && item[itemMetadata] !== null)
return Object.keys(item[itemMetadata]).join(', ');
return item[itemMetadata];
return <p className="mb-0">{item[itemMetadata]}</p>;
},
};

Expand Down Expand Up @@ -172,8 +172,8 @@ const View = (props) => {
props.discodata_resources.pendingRequests[collection_count];

const additionalWhereStatements = [
`x_3857 >= ${extent[0]} AND x_3857 <= ${extent[2]}`,
`y_3857 >= ${extent[1]} AND y_3857 <= ${extent[3]}`,
`shape_wm.STX >= ${extent[0]} AND shape_wm.STX <= ${extent[2]}`,
`shape_wm.STY >= ${extent[1]} AND shape_wm.STY <= ${extent[3]}`,
];

return (
Expand Down Expand Up @@ -275,13 +275,7 @@ const View = (props) => {
: 'hidden-row hide'
}
>
<Table.Cell
colSpan={
props.data?.hiddenRowTypes?.value?.length
? props.data.hiddenRowTypes.value.length
: 1
}
>
<Table.Cell colSpan={state.tableHeaders + 1}>
<div className="hidden-row-container">
<div className="table-flex-container white">
{props.data?.hiddenRowTypes?.value
Expand Down
Loading

0 comments on commit 40140cf

Please sign in to comment.