@eeacms/volto-n2k 1.0.2 → 1.0.4

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.
@@ -1,16 +1,21 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const projectRootPath = fs.realpathSync('./project'); // __dirname
5
- const packageJson = require(path.join(projectRootPath, 'package.json'));
6
- const jsConfig = require(path.join(projectRootPath, 'jsconfig.json')).compilerOptions;
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+
4
+ const projectRootPath = fs.existsSync("./project")
5
+ ? fs.realpathSync("./project")
6
+ : fs.realpathSync("./../../../");
7
+ const packageJson = require(path.join(projectRootPath, "package.json"));
8
+ const jsConfig = require(path.join(
9
+ projectRootPath,
10
+ "jsconfig.json"
11
+ )).compilerOptions;
7
12
 
8
13
  const pathsConfig = jsConfig.paths;
9
14
 
10
- let voltoPath = path.join(projectRootPath, 'node_modules/@plone/volto');
15
+ let voltoPath = path.join(projectRootPath, "node_modules/@plone/volto");
11
16
 
12
- Object.keys(pathsConfig).forEach(pkg => {
13
- if (pkg === '@plone/volto') {
17
+ Object.keys(pathsConfig).forEach((pkg) => {
18
+ if (pkg === "@plone/volto") {
14
19
  voltoPath = `./${jsConfig.baseUrl}/${pathsConfig[pkg][0]}`;
15
20
  }
16
21
  });
@@ -18,29 +23,27 @@ const AddonConfigurationRegistry = require(`${voltoPath}/addon-registry.js`);
18
23
  const reg = new AddonConfigurationRegistry(projectRootPath);
19
24
 
20
25
  // Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
21
- const addonAliases = Object.keys(reg.packages).map(o => [
26
+ const addonAliases = Object.keys(reg.packages).map((o) => [
22
27
  o,
23
28
  reg.packages[o].modulePath,
24
29
  ]);
25
30
 
26
-
27
31
  module.exports = {
28
32
  extends: `${projectRootPath}/node_modules/@plone/volto/.eslintrc`,
29
33
  settings: {
30
- 'import/resolver': {
34
+ "import/resolver": {
31
35
  alias: {
32
36
  map: [
33
- ['@plone/volto', '@plone/volto/src'],
37
+ ["@plone/volto", "@plone/volto/src"],
34
38
  ...addonAliases,
35
- ['@package', `${__dirname}/src`],
36
- ['~', `${__dirname}/src`],
39
+ ["@package", `${__dirname}/src`],
40
+ ["~", `${__dirname}/src`],
37
41
  ],
38
- extensions: ['.js', '.jsx', '.json'],
42
+ extensions: [".js", ".jsx", ".json"],
39
43
  },
40
- 'babel-plugin-root-import': {
41
- rootPathSuffix: 'src',
44
+ "babel-plugin-root-import": {
45
+ rootPathSuffix: "src",
42
46
  },
43
47
  },
44
48
  },
45
49
  };
46
-
package/CHANGELOG.md CHANGED
@@ -4,11 +4,23 @@ 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.2](https://github.com/eea/volto-n2k/compare/1.0.1...1.0.2) - 4 November 2022
7
+ ### [1.0.4](https://github.com/eea/volto-n2k/compare/1.0.3...1.0.4) - 17 November 2022
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - Update View.jsx [Nilesh - [`747144a`](https://github.com/eea/volto-n2k/commit/747144ac9d7deeff8b5924d3ee23fafc5bdf91ae)]
12
+ - do not break on empty DOMlist class [Nilesh - [`f1298a0`](https://github.com/eea/volto-n2k/commit/f1298a06e2587b576065d97a1da18a3537286d59)]
13
+ ### [1.0.3](https://github.com/eea/volto-n2k/compare/1.0.2...1.0.3) - 10 November 2022
14
+
15
+ #### :bug: Bug Fixes
16
+
17
+ - fix: show navigation for explorer [Miu Razvan - [`3dda827`](https://github.com/eea/volto-n2k/commit/3dda82724fa04ddfb52f6c4f0f050d29a46f21e8)]
8
18
 
9
19
  #### :hammer_and_wrench: Others
10
20
 
11
- - Remove volto-slate dependency [Miu Razvan - [`a966c5b`](https://github.com/eea/volto-n2k/commit/a966c5b0d79552706683fd9620161b9e5e559e10)]
21
+ - fix error [Claudia Ifrim - [`2942ada`](https://github.com/eea/volto-n2k/commit/2942adaa55a378b9861bff6567899606fd193c8b)]
22
+ ### [1.0.2](https://github.com/eea/volto-n2k/compare/1.0.1...1.0.2) - 4 November 2022
23
+
12
24
  ### [1.0.1](https://github.com/eea/volto-n2k/compare/1.0.0...1.0.1) - 2 November 2022
13
25
 
14
26
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-n2k",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "volto-n2k: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -2,10 +2,11 @@ import React from 'react';
2
2
  import { BodyClass } from '@plone/volto/helpers';
3
3
 
4
4
  const View = (props) => {
5
+ const { data } = props;
5
6
  return (
6
7
  <>
7
8
  {props.mode === 'edit' ? <p>Body className: {props.data.class}</p> : ''}
8
- <BodyClass className={props.data.class || ''} />
9
+ <BodyClass className={data.class ? data.class.trim() : ''} />
9
10
  </>
10
11
  );
11
12
  };
@@ -313,7 +313,7 @@ class Navigation extends Component {
313
313
  ''
314
314
  )}
315
315
 
316
- {!this.state.isSdf && !this.props.isRoot && !this.props.isExplorer
316
+ {(!this.state.isSdf && !this.props.isRoot) || this.props.isExplorer
317
317
  ? this.props.items.map((item) => {
318
318
  const flatUrl = flattenToAppURL(item.url);
319
319
  const itemID = item.title.split(' ').join('-').toLowerCase();