@eeacms/volto-datahub 0.1.12 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ const defaultBabel = require('@plone/volto/babel');
2
2
 
3
3
  function applyDefault(api) {
4
4
  const voltoBabel = defaultBabel(api);
5
- voltoBabel.plugins.push('@babel/plugin-transform-modules-commonjs', 'transform-class-properties', 'istanbul');
5
+ voltoBabel.plugins.push('istanbul');
6
6
  return voltoBabel;
7
7
  }
8
8
 
@@ -0,0 +1 @@
1
+ module.exports = require('@plone/volto/babel');
@@ -1,15 +1,18 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
3
 
4
- const projectRootPath = fs.realpathSync('./project'); // __dirname
4
+ const projectRootPath = fs.existsSync('./project')
5
+ ? fs.realpathSync('./project')
6
+ : fs.realpathSync('./../../../');
5
7
  const packageJson = require(path.join(projectRootPath, 'package.json'));
6
- const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;
8
+ const jsConfig = require(path.join(projectRootPath, 'jsconfig.json'))
9
+ .compilerOptions;
7
10
 
8
11
  const pathsConfig = jsConfig.paths;
9
12
 
10
13
  let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');
11
14
 
12
- Object.keys(pathsConfig).forEach(pkg => {
15
+ Object.keys(pathsConfig).forEach((pkg) => {
13
16
  if (pkg === '@plone/volto') {
14
17
  voltoPath = `./${jsConfig.baseUrl}/${pathsConfig[pkg][0]}`;
15
18
  }
@@ -18,11 +21,15 @@ const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
18
21
  const reg = new AddonConfigurationRegistry(projectRootPath);
19
22
 
20
23
  // Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
21
- const addonAliases = Object.keys(reg.packages).map(o => [
24
+ const addonAliases = Object.keys(reg.packages).map((o) => [
22
25
  o,
23
26
  reg.packages[o].modulePath,
24
27
  ]);
25
28
 
29
+ const voltoSearchlibPath = path.dirname(
30
+ reg.packages['@eeacms/volto-searchlib'].modulePath,
31
+ );
32
+ const searchlibPath = path.resolve(`${voltoSearchlibPath}/searchlib`);
26
33
 
27
34
  module.exports = {
28
35
  extends: `${projectRootPath}/node_modules/@plone/volto/.eslintrc`,
@@ -32,6 +39,7 @@ module.exports = {
32
39
  map: [
33
40
  ['@plone/volto', '@plone/volto/src'],
34
41
  ...addonAliases,
42
+ ['@eeacms/search', searchlibPath],
35
43
  ['@package', `${__dirname}/src`],
36
44
  ['~', `${__dirname}/src`],
37
45
  ],
@@ -43,4 +51,3 @@ module.exports = {
43
51
  },
44
52
  },
45
53
  };
46
-
package/CHANGELOG.md CHANGED
@@ -4,6 +4,28 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [1.0.1](https://github.com/eea/volto-datahub/compare/1.0.0...1.0.1) - 15 November 2022
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - Fix eslintrc: add @eeacms/search [kreafox - [`465816f`](https://github.com/eea/volto-datahub/commit/465816feb8f58095ab4b5b3168cd29ebede3a10c)]
12
+ - Use latest Volto before yarn 3 [Tiberiu Ichim - [`69f5859`](https://github.com/eea/volto-datahub/commit/69f585980fd9a38ff99d0c7875704671857720f7)]
13
+ - Reorder sections on landing page [kreafox - [`46fac8d`](https://github.com/eea/volto-datahub/commit/46fac8d821cf93fe1b2c380380719de130c3f1cb)]
14
+ - Fix project eslintrc [kreafox - [`5baa150`](https://github.com/eea/volto-datahub/commit/5baa1505ec38ed313269f5608c186c6a6a8bbfc4)]
15
+ - Open dataset links in new tab [kreafox - [`bbed914`](https://github.com/eea/volto-datahub/commit/bbed914dc2edf6c749d1d73d93a423bc642e680c)]
16
+ - Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`380a2a9`](https://github.com/eea/volto-datahub/commit/380a2a9625c6f799df7a7c343fad3f3b3d959f96)]
17
+ ## [1.0.0](https://github.com/eea/volto-datahub/compare/0.1.12...1.0.0) - 28 October 2022
18
+
19
+ #### :nail_care: Enhancements
20
+
21
+ - refactor(cypress): Upgrade Cypress 10 / Razzle 4 [Alin Voinea - [`53a5bca`](https://github.com/eea/volto-datahub/commit/53a5bcae5a21af13232c8654f542aa07328d4675)]
22
+ - refactor(volto-slate): Upgrade to @plone/volto-slate - refs #153447 [Alin Voinea - [`d1dc182`](https://github.com/eea/volto-datahub/commit/d1dc1828d5c6f5d8cd553b132981be7af4977a86)]
23
+
24
+ #### :hammer_and_wrench: Others
25
+
26
+ - Cleanup cypress.json [Alin Voinea - [`0ae42af`](https://github.com/eea/volto-datahub/commit/0ae42af39334dae0c4cfb151349c2e5b3a0eb7a3)]
27
+ - Cleanup [Alin Voinea - [`e210800`](https://github.com/eea/volto-datahub/commit/e21080044017c8693e44a5d3d31eec3d9318c783)]
28
+ - Update dependencies [Alin Voinea - [`e4ef04a`](https://github.com/eea/volto-datahub/commit/e4ef04a27e66a608caecf5c9d01cbef97b8576ac)]
7
29
  ### [0.1.12](https://github.com/eea/volto-datahub/compare/0.1.11...0.1.12) - 19 October 2022
8
30
 
9
31
  #### :hammer_and_wrench: Others
package/README.md CHANGED
@@ -15,36 +15,14 @@
15
15
  [![Duplicated Lines (%)](https://sonarqube.eea.europa.eu/api/project_badges/measure?project=volto-addon-template-develop&metric=duplicated_lines_density)](https://sonarqube.eea.europa.eu/dashboard?id=volto-addon-template-develop)
16
16
 
17
17
 
18
- [Volto](https://github.com/plone/volto) add-on
18
+ EEA DataHub search [Volto](https://github.com/plone/volto) add-on
19
19
 
20
- ## Features
20
+ ## Demo
21
21
 
22
- Demo GIF
22
+ - https://demo-www.eea.europa.eu/en/datahub
23
23
 
24
24
  ## Getting started
25
25
 
26
- ### Try volto-addon-template with Docker
27
-
28
- 1. Get the latest Docker images
29
-
30
- ```
31
- docker pull plone
32
- docker pull plone/volto
33
- ```
34
-
35
- 1. Start Plone backend
36
- ```
37
- docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
38
- ```
39
-
40
- 1. Start Volto frontend
41
-
42
- ```
43
- docker run -it --rm -p 3000:3000 --link plone -e ADDONS="@eeacms/volto-addon-template" plone/volto
44
- ```
45
-
46
- 1. Go to http://localhost:3000
47
-
48
26
  ### Add volto-addon-template to your Volto project
49
27
 
50
28
  1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone
@@ -59,7 +37,7 @@ Demo GIF
59
37
  ],
60
38
 
61
39
  "dependencies": {
62
- "@eeacms/volto-addon-template": "^1.0.0"
40
+ "@eeacms/volto-addon-template": "*"
63
41
  }
64
42
  ```
65
43
 
package/babel.config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  module.exports = function (api) {
2
2
  api.cache(true);
3
- const presets = ['razzle/babel'];
3
+ const presets = ['razzle'];
4
4
  const plugins = [
5
5
  [
6
6
  'react-intl', // React Intl extractor, required for the whole i18n infrastructure to work
@@ -0,0 +1,26 @@
1
+ const { defineConfig } = require('cypress');
2
+
3
+ module.exports = defineConfig({
4
+ viewportWidth: 1280,
5
+ defaultCommandTimeout: 8888,
6
+ chromeWebSecurity: false,
7
+ reporter: 'junit',
8
+ video: true,
9
+ retries: {
10
+ runMode: 8,
11
+ openMode: 0,
12
+ },
13
+ reporterOptions: {
14
+ mochaFile: 'cypress/reports/cypress-[hash].xml',
15
+ jenkinsMode: true,
16
+ toConsole: true,
17
+ },
18
+ e2e: {
19
+ setupNodeEvents(on, config) {
20
+ // e2e testing node events setup code
21
+ require('@cypress/code-coverage/task')(on, config);
22
+ return config;
23
+ },
24
+ baseUrl: 'http://localhost:3000',
25
+ },
26
+ });
@@ -9,18 +9,18 @@ module.exports = {
9
9
  '@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
10
10
  '@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
11
11
  '@package/(.*)$': '<rootDir>/src/$1',
12
+ '@root/(.*)$': '<rootDir>/src/$1',
12
13
  '@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
13
14
  '@eeacms/(.*?)/(.*)$': '<rootDir>/src/addons/$1/src/$2',
14
- 'volto-slate/(.*)$': '<rootDir>/src/addons/volto-slate/src/$1',
15
+ '@plone/volto-slate':
16
+ '<rootDir>/node_modules/@plone/volto/packages/volto-slate/src',
15
17
  '~/(.*)$': '<rootDir>/src/$1',
16
18
  'load-volto-addons':
17
19
  '<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
20
+ '\\.(css|less|scss|sass)$': 'identity-obj-proxy',
18
21
  },
19
22
  transform: {
20
23
  '^.+\\.js(x)?$': 'babel-jest',
21
- '^.+\\.css$': 'jest-css-modules',
22
- '^.+\\.less$': 'jest-css-modules',
23
- '^.+\\.scss$': 'jest-css-modules',
24
24
  '^.+\\.(png)$': 'jest-file',
25
25
  '^.+\\.(jpg)$': 'jest-file',
26
26
  '^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-datahub",
3
- "version": "0.1.12",
3
+ "version": "1.0.1",
4
4
  "description": "@eeacms/volto-datahub: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "devDependencies": {
24
24
  "@plone/scripts": "*",
25
- "@cypress/code-coverage": "^3.9.5",
25
+ "@cypress/code-coverage": "^3.10.0",
26
26
  "babel-plugin-transform-class-properties": "^6.24.1",
27
27
  "md5": "^2.3.0"
28
28
  },
@@ -32,19 +32,21 @@
32
32
  ],
33
33
  "scripts": {
34
34
  "release": "release-it",
35
+ "release-major-beta": "release-it major --preRelease=beta",
36
+ "release-beta": "release-it --preRelease=beta",
35
37
  "bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
36
38
  "test": "make test",
37
39
  "test:fix": "make test-update",
38
40
  "pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
39
- "stylelint": "if [ -d ./project ]; then ./project/node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'; else ../../../node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}'; fi",
40
- "stylelint:overrides": "if [ -d ./project ]; then ./project/node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'; else ../../../node_modules/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'; fi",
41
- "stylelint:fix": "yarn stylelint --fix && yarn stylelint:overrides --fix",
42
- "prettier": "if [ -d ./project ]; then ./project/node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'; else ../../../node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'; fi",
43
- "prettier:fix": "if [ -d ./project ]; then ./project/node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'; else ../../../node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'; fi",
44
- "lint": "if [ -d ./project ]; then ./project/node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'; else ../../../node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'; fi",
45
- "lint:fix": "if [ -d ./project ]; then ./project/node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'; else ../../../node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'; fi",
46
- "i18n": "rm -rf build/messages && NODE_ENV=production i18n --addon",
47
- "cypress:run": "if [ -d ./project ]; then NODE_ENV=development ./project/node_modules/cypress/bin/cypress run; else NODE_ENV=development ../../../node_modules/cypress/bin/cypress run; fi",
48
- "cypress:open": "if [ -d ./project ]; then NODE_ENV=development ./project/node_modules/cypress/bin/cypress open; else NODE_ENV=development ../../../node_modules/cypress/bin/cypress open; fi"
41
+ "stylelint": "make stylelint",
42
+ "stylelint:overrides": "make stylelint-overrides",
43
+ "stylelint:fix": "make stylelint-fix",
44
+ "prettier": "make prettier",
45
+ "prettier:fix": "make prettier-fix",
46
+ "lint": "make lint",
47
+ "lint:fix": "make lint-fix",
48
+ "i18n": "make i18n",
49
+ "cypress:run": "make cypress-run",
50
+ "cypress:open": "make cypress-open"
49
51
  }
50
52
  }
@@ -43,7 +43,12 @@ const DatasetList = (props) => {
43
43
  <List.Content>
44
44
  <div className="dataset-item">
45
45
  <Icon className="download" />
46
- <a href={item.url} className="item-link">
46
+ <a
47
+ href={item.url}
48
+ className="item-link"
49
+ target="_blank"
50
+ rel="noreferrer"
51
+ >
47
52
  <span>{item.name}</span>
48
53
  </a>
49
54
  </div>
@@ -64,11 +69,21 @@ const DatasetList = (props) => {
64
69
  <div className="dataset-item">
65
70
  <Icon className="download" />
66
71
  {item.name ? (
67
- <a href={item.url} className="item-link">
72
+ <a
73
+ href={item.url}
74
+ className="item-link"
75
+ target="_blank"
76
+ rel="noreferrer"
77
+ >
68
78
  {item.name}
69
79
  </a>
70
80
  ) : (
71
- <a href={item.url} className="item-link">
81
+ <a
82
+ href={item.url}
83
+ className="item-link"
84
+ target="_blank"
85
+ rel="noreferrer"
86
+ >
72
87
  Download link
73
88
  </a>
74
89
  )}
@@ -84,7 +99,12 @@ const DatasetList = (props) => {
84
99
  <List.Content>
85
100
  <div className="dataset-item">
86
101
  <Icon className="download" />
87
- <a href={item.url} className="item-link">
102
+ <a
103
+ href={item.url}
104
+ className="item-link"
105
+ target="_blank"
106
+ rel="noreferrer"
107
+ >
88
108
  WebDAV: {item.name || item.function}
89
109
  </a>
90
110
  </div>
@@ -99,7 +119,12 @@ const DatasetList = (props) => {
99
119
  <List.Content>
100
120
  <div className="dataset-item">
101
121
  <Icon className="download" />
102
- <a href={item.url} className="item-link">
122
+ <a
123
+ href={item.url}
124
+ className="item-link"
125
+ target="_blank"
126
+ rel="noreferrer"
127
+ >
103
128
  WebDAV: {item.name || item.function}
104
129
  </a>
105
130
  </div>
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { DateTime, StringList } from '@eeacms/search';
4
4
  import { ResultContext } from '@eeacms/search';
5
5
  import { Link } from 'react-router-dom';
6
- import { UniversalItem } from '@eeacms/volto-listing-block';
6
+ import { UniversalCard } from '@eeacms/volto-listing-block';
7
7
 
8
8
  const DatahubCardItem = (props) => {
9
9
  const { result } = props;
@@ -57,7 +57,7 @@ const DatahubCardItem = (props) => {
57
57
  '@type': 'searchItem',
58
58
  };
59
59
 
60
- return <UniversalItem item={item} itemModel={itemModel} />;
60
+ return <UniversalCard item={item} itemModel={itemModel} />;
61
61
  };
62
62
 
63
63
  // <div
@@ -19,18 +19,18 @@ export default {
19
19
  sortField: 'issued.date',
20
20
  sortDirection: 'desc',
21
21
  sections: [
22
- {
23
- id: 'rod',
24
- title: 'Reporting obligations',
25
- facetField: 'rod',
26
- sortOn: 'alpha',
27
- },
28
22
  {
29
23
  id: 'topics',
30
24
  title: 'EEA topics',
31
25
  facetField: 'topic',
32
26
  sortOn: 'alpha',
33
27
  },
28
+ {
29
+ id: 'rod',
30
+ title: 'Reporting obligations',
31
+ facetField: 'rod',
32
+ sortOn: 'alpha',
33
+ },
34
34
  {
35
35
  id: 'website',
36
36
  title: 'Sources',
package/cypress.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "baseUrl": "http://localhost:3000",
3
- "viewportWidth": 1280,
4
- "defaultCommandTimeout": 8888,
5
- "chromeWebSecurity": false,
6
- "reporter": "junit",
7
- "video": true,
8
- "retries": {
9
- "runMode": 8,
10
- "openMode": 0
11
- },
12
- "reporterOptions": {
13
- "mochaFile": "cypress/reports/cypress-[hash].xml",
14
- "jenkinsMode": true,
15
- "toConsole": true
16
- }
17
- }