@eeacms/volto-datahub 0.1.10 → 0.1.11

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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ 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
+ ### [0.1.11](https://github.com/eea/volto-datahub/compare/0.1.10...0.1.11) - 27 September 2022
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - fixed query for related items [Zoltan Szabo - [`b66faee`](https://github.com/eea/volto-datahub/commit/b66faee1f8a1922cd22b3a36eccc9c7b92e377d4)]
12
+ - Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`158fe1a`](https://github.com/eea/volto-datahub/commit/158fe1a0b1767452e2e51a3e2ef97169589a50e8)]
7
13
  ### [0.1.10](https://github.com/eea/volto-datahub/compare/0.1.9...0.1.10) - 21 September 2022
8
14
 
9
15
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-datahub",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "@eeacms/volto-datahub: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Card } from 'semantic-ui-react';
3
3
  import { runRequest, firstWords } from '@eeacms/search';
4
4
 
5
- function buildQuery(title, docid) {
5
+ function buildQuery(title, docid, index_name) {
6
6
  const body = {
7
7
  // _source: {
8
8
  // include: ['label', 'about', ],
@@ -32,18 +32,19 @@ function buildQuery(title, docid) {
32
32
  ],
33
33
  },
34
34
  },
35
+ ...(index_name ? { index: index_name } : {}),
35
36
  };
36
37
  return body;
37
38
  }
38
39
 
39
40
  const MoreLikeThis = (props) => {
40
41
  const { docid, title, appConfig } = props;
41
-
42
42
  const [similarDocs, setSimilarDocs] = React.useState();
43
43
 
44
44
  React.useEffect(() => {
45
45
  async function getSimilarDocs(docid, title, appConfig) {
46
- const query_body = buildQuery(title, docid);
46
+ const { index_name } = appConfig;
47
+ const query_body = buildQuery(title, docid, index_name);
47
48
  const resp = await runRequest(query_body, appConfig);
48
49
  setSimilarDocs(resp.body.hits.hits);
49
50
  }