@eeacms/volto-cca-policy 0.2.100 → 0.3.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,25 @@ 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.3.1](https://github.com/eea/volto-cca-policy/compare/0.3.0...0.3.1) - 6 February 2025
8
+
9
+ #### :rocket: Dependency updates
10
+
11
+ - Release @eeacms/volto-searchlib@2.0.7 [EEA Jenkins - [`859c099`](https://github.com/eea/volto-cca-policy/commit/859c0992afec0009c5c38c97b9eb017e4ee76f0e)]
12
+
13
+ ### [0.3.0](https://github.com/eea/volto-cca-policy/compare/0.2.100...0.3.0) - 5 February 2025
14
+
15
+ #### :bug: Bug Fixes
16
+
17
+ - fix: test [kreafox - [`478fb27`](https://github.com/eea/volto-cca-policy/commit/478fb2701bee49dd191ba1c4542ce9c9faed9958)]
18
+ - fix(UniversalLink): fix issue with @@download in url - refs #273406 [kreafox - [`544d91c`](https://github.com/eea/volto-cca-policy/commit/544d91cfcccf12a7eb6cc04ddf10313c2883ece7)]
19
+
20
+ #### :hammer_and_wrench: Others
21
+
22
+ - Bump version to 0.3.0 [kreafox - [`7380a83`](https://github.com/eea/volto-cca-policy/commit/7380a8312271bdda07dc7a2494c21ecddffa514a)]
23
+ - Remove console log [Tiberiu Ichim - [`23e5f6e`](https://github.com/eea/volto-cca-policy/commit/23e5f6e395021504b4a955564eb46425933cf4e5)]
24
+ - Make language default a function [Tiberiu Ichim - [`a96766e`](https://github.com/eea/volto-cca-policy/commit/a96766ec8b020f485a184ca77fb1aa3a91800afa)]
25
+ - Add missing code [Tiberiu Ichim - [`b9d2b8d`](https://github.com/eea/volto-cca-policy/commit/b9d2b8ddfda6169ba748d9eed21bba685585e8ab)]
7
26
  ### [0.2.100](https://github.com/eea/volto-cca-policy/compare/0.2.99...0.2.100) - 4 February 2025
8
27
 
9
28
  #### :bug: Bug Fixes
@@ -1864,10 +1883,13 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1864
1883
  - Refs #260715 rast-block wip [Tripon Eugen - [`f19d54e`](https://github.com/eea/volto-cca-policy/commit/f19d54e0b9a6a86bf344eb85b6a1cda7f3de91bf)]
1865
1884
  - Refs #260715 rast-block wip [Tripon Eugen - [`2828537`](https://github.com/eea/volto-cca-policy/commit/2828537b6c084cd1a82162d552fb4ef025b71f9f)]
1866
1885
  - Refs #260715 rast-block updates [Tripon Eugen - [`1e803e5`](https://github.com/eea/volto-cca-policy/commit/1e803e5bd3d3fb7558f261c76c68866be7beb8b5)]
1886
+ - test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`0a15e1b`](https://github.com/eea/volto-cca-policy/commit/0a15e1b2ad081233685e80d5b3c60a8663f6b896)]
1887
+ - test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`9554e44`](https://github.com/eea/volto-cca-policy/commit/9554e44c92a621a52b2adb5a4830fb084ee5734b)]
1867
1888
  ### [0.1.49](https://github.com/eea/volto-cca-policy/compare/0.1.48...0.1.49) - 15 November 2023
1868
1889
 
1869
1890
  #### :house: Internal changes
1870
1891
 
1892
+ - chore: [JENKINS] Refactor automated testing [valentinab25 - [`7b820a6`](https://github.com/eea/volto-cca-policy/commit/7b820a6369c2ddd5203b1a4abe352cb4bb43db7a)]
1871
1893
  - chore: husky, lint-staged use fixed versions [valentinab25 - [`f0a8061`](https://github.com/eea/volto-cca-policy/commit/f0a8061c275c236deb00087c23fac9860a073106)]
1872
1894
 
1873
1895
  #### :hammer_and_wrench: Others
@@ -1884,6 +1906,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
1884
1906
  - Refs #259267 - jenkins test [Tripon Eugen - [`cacd31e`](https://github.com/eea/volto-cca-policy/commit/cacd31e7b1afe0983674ed5c7632d2e1d7fa752e)]
1885
1907
  - Refs #259267 - jenkins [Tripon Eugen - [`5b3affe`](https://github.com/eea/volto-cca-policy/commit/5b3affee8401239de10097884c1b7f2349d15ec0)]
1886
1908
  - Refs #259267 - add When, lead image and title to files [Tripon Eugen - [`2cedb23`](https://github.com/eea/volto-cca-policy/commit/2cedb237f898af9057e13fba94b615ef71077204)]
1909
+ - test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`4d607a5`](https://github.com/eea/volto-cca-policy/commit/4d607a576e9d0a5c34e48c41b409e7df616ee3d6)]
1910
+ - test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`b7f74d5`](https://github.com/eea/volto-cca-policy/commit/b7f74d53513a6edbfbca5cb6d19687929bb1e5db)]
1911
+ - test: [JENKINS] Improve cypress time [valentinab25 - [`db65617`](https://github.com/eea/volto-cca-policy/commit/db656173391f65157098d95d388c25f6429753d8)]
1887
1912
  - Refs #259267 - cca event blocks attachments and check not mandatoty fields [Tripon Eugen - [`3138e5a`](https://github.com/eea/volto-cca-policy/commit/3138e5afb5bfbdbed14e27ed457b16867b7fa414)]
1888
1913
  - Refs #256681 - Fix error in CCA Event view menu. ([React Intl] An id must be provided to format a message.) [GhitaB - [`517eeb8`](https://github.com/eea/volto-cca-policy/commit/517eeb817264a47bbfd6b9b7d22aaf22d44ed224)]
1889
1914
  - Refs #161485 - Fix ECDE name conflict. [GhitaB - [`8bfd99f`](https://github.com/eea/volto-cca-policy/commit/8bfd99ff68bb82a04d1c0ed625fa514fcf46289e)]
@@ -2100,6 +2125,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2100
2125
 
2101
2126
  #### :house: Internal changes
2102
2127
 
2128
+ - chore: [JENKINS] Remove alpha testing version [valentinab25 - [`ad1ced0`](https://github.com/eea/volto-cca-policy/commit/ad1ced0971ba116c13a3b5fcc039172cc915c919)]
2103
2129
 
2104
2130
  #### :hammer_and_wrench: Others
2105
2131
 
@@ -2580,6 +2606,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
2580
2606
  #### :hammer_and_wrench: Others
2581
2607
 
2582
2608
  - Refs #158294 - Update supported languages list. [GhitaB - [`0a4f91f`](https://github.com/eea/volto-cca-policy/commit/0a4f91f39b7edc367bd4c127d6a8f273c7788361)]
2609
+ - Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`8f1f9ce`](https://github.com/eea/volto-cca-policy/commit/8f1f9ce6c22805670cc0800d3c779b6d619d0f31)]
2583
2610
  ### [0.1.1](https://github.com/eea/volto-cca-policy/compare/0.1.0...0.1.1) - 13 December 2022
2584
2611
 
2585
2612
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "0.2.100",
3
+ "version": "0.3.1",
4
4
  "description": "@eeacms/volto-cca-policy: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -35,7 +35,7 @@
35
35
  "@eeacms/volto-globalsearch": "^1.1.0",
36
36
  "@eeacms/volto-hero-block": "^7.1.0",
37
37
  "@eeacms/volto-openlayers-map": "*",
38
- "@eeacms/volto-searchlib": "2.0.6",
38
+ "@eeacms/volto-searchlib": "2.0.7",
39
39
  "@eeacms/volto-slate-label": "^0.6.0",
40
40
  "@eeacms/volto-tabs-block": "^7.5.1",
41
41
  "@elastic/search-ui": "1.21.2",
@@ -58,10 +58,10 @@ const UniversalLink = ({
58
58
 
59
59
  //case: item of type 'File'
60
60
  if (
61
- !token &&
61
+ download &&
62
62
  config.settings.downloadableObjects.includes(item['@type'])
63
63
  ) {
64
- url = `${url}/@@download/file`;
64
+ url = url.includes('/@@download/file') ? url : `${url}/@@download/file`;
65
65
  }
66
66
 
67
67
  if (
@@ -73,15 +73,21 @@ const UniversalLink = ({
73
73
  }
74
74
  }
75
75
 
76
+ if (download && isInternalURL(url)) {
77
+ url = url.includes('/@@download/file') ? url : `${url}/@@download/file`;
78
+ }
79
+
76
80
  const isExternal = !isInternalURL(url);
81
+ const isDownload =
82
+ (!isExternal && url && url.includes('@@download')) || download;
77
83
 
78
- const isDownload = (!isExternal && url.includes('@@download')) || download;
79
84
  const isDisplayFile =
80
85
  (!isExternal && url.includes('@@display-file')) || false;
81
-
82
86
  const checkedURL = URLUtils.checkAndNormalizeUrl(url);
83
87
 
84
- url = checkedURL.url;
88
+ // we can receive an item with a linkWithHash property set from ObjectBrowserWidget
89
+ // if so, we use that instead of the url prop
90
+ url = (item && item['linkWithHash']) || checkedURL.url;
85
91
  let tag = (
86
92
  <Link
87
93
  to={flattenToAppURL(url)}
@@ -95,16 +101,18 @@ const UniversalLink = ({
95
101
  </Link>
96
102
  );
97
103
 
98
- const isBlank =
99
- (isExternal || openLinkInNewTab) &&
100
- (!checkedURL.isMail || !checkedURL.isTelephone);
101
-
102
104
  if (isExternal) {
103
105
  tag = (
104
106
  <a
105
107
  href={url}
106
108
  title={title}
107
- target={isBlank ? '_blank' : null}
109
+ target={
110
+ !checkedURL.isMail &&
111
+ !checkedURL.isTelephone &&
112
+ !(openLinkInNewTab === false)
113
+ ? '_blank'
114
+ : null
115
+ }
108
116
  rel="noopener"
109
117
  className={className}
110
118
  {...props}
@@ -129,6 +137,7 @@ const UniversalLink = ({
129
137
  <a
130
138
  href={flattenToAppURL(url)}
131
139
  title={title}
140
+ target={!(openLinkInNewTab === false) ? '_blank' : null}
132
141
  rel="noopener"
133
142
  className={className}
134
143
  {...props}
@@ -120,9 +120,9 @@ describe('UniversalLink', () => {
120
120
  </Provider>,
121
121
  );
122
122
 
123
- expect(getByTitle('Volto GitHub repository').getAttribute('target')).toBe(
124
- '_blank',
125
- );
123
+ expect(
124
+ getByTitle('Volto GitHub repository').getAttribute('target'),
125
+ ).toBeNull();
126
126
  });
127
127
 
128
128
  it('check UniversalLink renders ext link for blacklisted urls', () => {
@@ -1,6 +1,6 @@
1
1
  import { mergeConfig } from '@eeacms/search';
2
- import { getClientProxyAddress } from './utils';
3
- import vocabs from './vocabulary';
2
+ import { getClientProxyAddress } from '../utils';
3
+ import vocabs from '../vocabulary';
4
4
 
5
5
  import facets from './facets';
6
6
  import views from './views';
@@ -115,6 +115,19 @@ export default function installMainSearch(config) {
115
115
  },
116
116
  });
117
117
 
118
+ // ccaSearch.permanentFilters.push((filters) => {
119
+ // const hasLanguageFilter = filters.find(({ field }) => field === 'language');
120
+ // console.log('permanentFilters', hasLanguageFilter, filters);
121
+ // if (!hasLanguageFilter) {
122
+ // return {
123
+ // terms: {
124
+ // language: ['en'],
125
+ // },
126
+ // };
127
+ // }
128
+ // return null;
129
+ // });
130
+
118
131
  // ccaSearch.permanentFilters.push({
119
132
  // terms: {
120
133
  // objectProvides: [
@@ -3,7 +3,7 @@ import {
3
3
  language,
4
4
  issued_date,
5
5
  geographic_countries,
6
- } from './common';
6
+ } from '../common';
7
7
 
8
8
  const adaptation_sectors = {
9
9
  field: 'cca_adaptation_sectors.keyword',
@@ -136,9 +136,13 @@ export const language = {
136
136
  isFilterable: false,
137
137
  show: 10000,
138
138
  isMulti: true,
139
- default: {
140
- values: ['en'],
141
- type: 'any',
139
+ default: (options) => {
140
+ const { language } = options || {};
141
+ // console.log('options', options);
142
+ return {
143
+ values: [language || 'en'],
144
+ type: 'any',
145
+ };
142
146
  },
143
147
  facetValues: [
144
148
  'de',
@@ -1,4 +1,4 @@
1
- import installMainSearch from './config';
1
+ import installMainSearch from './cca/config';
2
2
  import installHealthSearch from './health_observatory/config-health';
3
3
  import installMissionStoriesSearch from './mission_stories/config-stories';
4
4
  import installMissionToolsSearch from './mission_tools/config-tools';
@@ -37,12 +37,13 @@ const applyConfig = (config) => {
37
37
  installMissionAllSearch,
38
38
  ].reduce((acc, cur) => cur(acc), config.settings.searchlib);
39
39
 
40
- config.settings.searchlib.searchui.ccaSearch.extraQueryParams = extraQueryParams;
41
- config.settings.searchlib.searchui.ccaHealthSearch.extraQueryParams = extraQueryParams;
42
- config.settings.searchlib.searchui.missionProjects.extraQueryParams = extraQueryParams;
43
- config.settings.searchlib.searchui.missionStoriesSearch.extraQueryParams = extraQueryParams;
44
- config.settings.searchlib.searchui.missionToolsSearch.extraQueryParams = extraQueryParams;
45
- config.settings.searchlib.searchui.missionAll.extraQueryParams = extraQueryParams;
40
+ const searchui = config.settings.searchlib.searchui;
41
+ searchui.ccaSearch.extraQueryParams = extraQueryParams;
42
+ searchui.ccaHealthSearch.extraQueryParams = extraQueryParams;
43
+ searchui.missionProjects.extraQueryParams = extraQueryParams;
44
+ searchui.missionStoriesSearch.extraQueryParams = extraQueryParams;
45
+ searchui.missionToolsSearch.extraQueryParams = extraQueryParams;
46
+ searchui.missionAll.extraQueryParams = extraQueryParams;
46
47
 
47
48
  // console.log(config.settings.searchlib);
48
49
 
File without changes