Skip to content

Commit

Permalink
[Feature #129799] Added Explore the data block
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Apr 20, 2021
1 parent 1232075 commit 52fc7b5
Show file tree
Hide file tree
Showing 24 changed files with 199 additions and 5 deletions.
Binary file added Files for web/About button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Files for web/Analyse button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Files for web/Chemicals icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Files for web/Download button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Files for web/EIEP mock up version 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Files for web/Elliptical image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Files for web/Energy icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Files for web/Explore full image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Files for web/Food and beverage icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Files for web/Metals icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Files for web/Minerals icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Files for web/Other icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Files for web/Paper and wood icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Files for web/Waste and wastewater icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions src/components/manage/Blocks/ExploreEprtr/Edit.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from 'react';
import { SidebarPortal } from '@plone/volto/components';
import InlineForm from '@plone/volto/components/manage/Form/InlineForm';
import ExploreEprtrView from './View';
import schema from './schema';
import { connectBlockToProviderData } from 'volto-datablocks/hocs';

const Edit = (props) => {
const { data = {}, block = null, selected = false, onChangeBlock } = props;

return (
<>
<ExploreEprtrView {...props} mode="edit" />

<SidebarPortal selected={selected}>
<InlineForm
schema={schema}
title={schema.title}
onChangeField={(id, value) => {
onChangeBlock(block, {
...data,
[id]: value,
});
}}
formData={data}
/>
</SidebarPortal>
</>
);
};

export default connectBlockToProviderData(Edit);
70 changes: 70 additions & 0 deletions src/components/manage/Blocks/ExploreEprtr/View.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { Grid } from 'semantic-ui-react';
import about from './images/about.png';
import analyse from './images/analyse.png';
import download from './images/download.png';
import explore from './images/explore.png';

import './styles.css';

const View = (props) => {
return (
<Grid className="explore-eprtr" columns="12">
<Grid.Row>
<Grid.Column
className="explore-map"
widescreen="8"
largeScreen="8"
computer="8"
tablet="7"
mobile="12"
>
<img src={explore} alt="Explore the data" />
</Grid.Column>
<Grid.Column
className="description"
widescreen="4"
largeScreen="4"
computer="4"
tablet="5"
mobile="12"
>
<Link to="/analyse">
<div className="explore-tile">
<img src={analyse} alt="Analyse" />
<div>
<p className="title">ANALYSE</p>
<p>
Find the biggest polluters and compare data across countries
</p>
</div>
</div>
</Link>
<Link to="/download">
<div className="explore-tile">
<img src={download} alt="Download" />
<div>
<p className="title">DOWNLOAD</p>
<p>Work with raw datasheets on your own choice of software</p>
</div>
</div>
</Link>
<Link to="/about">
<div className="explore-tile">
<img src={about} alt="About" />

<div>
<p className="title">ABOUT</p>
<p>New to this topic?</p>
<p>Understand the Industry portal</p>
</div>
</div>
</Link>
</Grid.Column>
</Grid.Row>
</Grid>
);
};

export default View;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/components/manage/Blocks/ExploreEprtr/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import worldSVG from '@plone/volto/icons/world.svg';
import ExploreEprtrEdit from './Edit';
import ExploreEprtrView from './View';

export default (config) => {
config.blocks.blocksConfig.explore_eprtr = {
id: 'explore_eprtr',
title: 'Explore eprtr',
icon: worldSVG,
group: 'eprtr_blocks',
view: ExploreEprtrView,
edit: ExploreEprtrEdit,
restricted: false,
mostUsed: false,
sidebarTab: 1,
security: {
addPermission: [],
view: [],
},
};
return config;
};
17 changes: 17 additions & 0 deletions src/components/manage/Blocks/ExploreEprtr/schema.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const Schema = {
title: 'Explore the data',

fieldsets: [
{
id: 'default',
title: 'Default',
fields: [],
},
],

properties: {},

required: [],
};

export default Schema;
50 changes: 50 additions & 0 deletions src/components/manage/Blocks/ExploreEprtr/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.ui.grid.explore-eprtr {
margin-left: -1rem !important;
margin-right: -1rem !important;
}

.ui.grid.explore-eprtr .column {
display: flex !important;
justify-content: center;
}

.ui.grid.explore-eprtr .explore-map {
margin-bottom: 1rem !important;
}

.explore-eprtr .description {
display: flex !important;
justify-content: space-between;
}

.explore-eprtr .description .explore-tile {
display: flex;
align-items: center;
margin-bottom: 1rem;
}

.explore-eprtr .description .explore-tile img {
margin-right: 1rem;
}

.explore-eprtr .description .explore-tile p {
margin-bottom: 0;
color: #4896B0;
font-size: 1.1em;
}

.explore-eprtr .description .explore-tile p.title {
margin-bottom: 0;
color: #00435C;
font-weight: bold;
font-size: 1.2em;
margin-bottom: .2rem;
}

.explore-eprtr .description > a:hover .explore-tile img {
opacity: .9;
}

.explore-eprtr .description > a:hover .explore-tile p {
color: #00435C;
}
13 changes: 8 additions & 5 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,21 @@ import ListView from '~/components/manage/Blocks/DiscodataComponents/List/View';

import BlocksWidget from '~/components/manage/Widgets/BlocksWidget';
import QueryParametersListWidget from '~/components/manage/Blocks/DiscodataComponents/Widgets/QueryParametersListWidget';
import packSVG from '@plone/volto/icons/pack.svg';
import folderSVG from '@plone/volto/icons/folder.svg';
import linkSVG from '@plone/volto/icons/link.svg';
import listSVG from '@plone/volto/icons/content-listing.svg';
import worldSVG from '@plone/volto/icons/world.svg';

import installExploreEprtr from '~/components/manage/Blocks/ExploreEprtr';
import {
installTableau,
installExpendableList,
installFolderListing,
} from 'volto-addons';
import { installDiscodataSqlBuilder } from 'volto-datablocks/config';

import packSVG from '@plone/volto/icons/pack.svg';
import folderSVG from '@plone/volto/icons/folder.svg';
import linkSVG from '@plone/volto/icons/link.svg';
import listSVG from '@plone/volto/icons/content-listing.svg';
import worldSVG from '@plone/volto/icons/world.svg';

// All your imports required for the config here BEFORE this line
import '@plone/volto/config';

Expand Down Expand Up @@ -427,6 +429,7 @@ export default function applyConfig(config) {
};

return [
installExploreEprtr,
installTableau,
installExpendableList,
installFolderListing,
Expand Down

0 comments on commit 52fc7b5

Please sign in to comment.