Skip to content

Commit

Permalink
Merge pull request #39 from eea/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
GhitaB committed May 10, 2024
2 parents ff6e9d0 + 7a698c0 commit a8e3002
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [0.1.15](https://github.com/eea/volto-insitu-policy/compare/0.1.14...0.1.15) - 7 May 2024
### [0.1.16](https://github.com/eea/volto-insitu-policy/compare/0.1.15...0.1.16) - 10 May 2024

#### :hammer_and_wrench: Others

- Refs #268585 - Update data providers list widget to use new serializer. [GhitaB - [`489c87e`](https://github.com/eea/volto-insitu-policy/commit/489c87edca95cbe5fac323a55b7b895c76c04333)]
### [0.1.15](https://github.com/eea/volto-insitu-policy/compare/0.1.14...0.1.15) - 9 May 2024

#### :hammer_and_wrench: Others

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/volto-insitu-policy",
"version": "0.1.15",
"version": "0.1.16",
"description": "@eeacms/volto-insitu-policy: Volto add-on",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
36 changes: 36 additions & 0 deletions src/components/theme/Widgets/DataProviderListWidget.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
function DataProviderListWidget(props) {
const { value } = props;

/*
Example of data providers list:
[{
"acronym": "AAA",
"countries": [
{
"code": "IT",
"name": "Italy"
}
],
"id": 1,
"is_network": false,
"link": "https://test.test/1/",
"members": [],
"name": "Aaaa AAAaa AAAAA"
}, ...]
*/

return (
<div className="data-providers">
<h4>Data providers</h4>
<ul>
{value.map((item, index) => (
<li key={index}>
<a href={item.link}>{item.name}</a>
</li>
))}
</ul>
</div>
);
}

export default DataProviderListWidget;
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
import { composeSchema } from '@eeacms/volto-listing-block/schema-utils';
import NewsItemView from './components/theme/Views/NewsItemView';
import InsituReportView from './components/theme/Views/InsituReportView';
import DataProviderListWidget from './components/theme/Widgets/DataProviderListWidget';

const applyConfig = (config) => {
//Routes
Expand Down Expand Up @@ -157,6 +158,7 @@ const applyConfig = (config) => {
};

config.widgets.id.copernicus_components = TokenWidget;
config.widgets.views.id.data_providers_list = DataProviderListWidget;
config.widgets.id.copernicus_themes = TokenWidget;

return config;
Expand Down

0 comments on commit a8e3002

Please sign in to comment.