@eeacms/volto-cca-policy 0.1.61 → 0.1.62

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,17 @@ 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.62](https://github.com/eea/volto-cca-policy/compare/0.1.61...0.1.62) - 19 January 2024
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix: preview image in search listing [kreafox - [`e164430`](https://github.com/eea/volto-cca-policy/commit/e1644300d19fa58fa69fdd0e5b23041809ca69a6)]
12
+ - fix: stories search listing + show images [kreafox - [`081ff11`](https://github.com/eea/volto-cca-policy/commit/081ff115adfcab58dfe8e7f9fce09cc71e9281f5)]
13
+
14
+ #### :nail_care: Enhancements
15
+
16
+ - change: separate mission styling [kreafox - [`a3d972c`](https://github.com/eea/volto-cca-policy/commit/a3d972ce871649af92f2c9b7ba8abcdfff969852)]
17
+
7
18
  ### [0.1.61](https://github.com/eea/volto-cca-policy/compare/0.1.60...0.1.61) - 17 January 2024
8
19
 
9
20
  #### :bug: Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "0.1.61",
3
+ "version": "0.1.62",
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",
@@ -249,7 +249,7 @@ class ContentTypeLayout extends Component {
249
249
  * @returns {undefined}
250
250
  */
251
251
  onEnableBlocks = () => {
252
- const { properties = {} } = this.props.schema;
252
+ const properties = this.props.schema?.properties || {};
253
253
  const blocksFieldName = getBlocksFieldname(properties);
254
254
  const blocksLayoutFieldname = getBlocksLayoutFieldname(properties);
255
255
  const schema = {
@@ -1,5 +1,5 @@
1
1
  import { mergeConfig } from '@eeacms/search';
2
- import { getClientProxyAddress } from './../utils';
2
+ import { getClientProxyAddress, getSearchThumbUrl } from './../utils';
3
3
  import facets from './facets-stories';
4
4
 
5
5
  const missionStoriesConfig = {
@@ -25,12 +25,6 @@ export default function installMissionStoriesSearch(config) {
25
25
 
26
26
  const { missionStoriesSearch } = config.searchui;
27
27
 
28
- missionStoriesSearch.permanentFilters.push({
29
- terms: {
30
- objectProvides: ['mission_storyy'],
31
- },
32
- });
33
-
34
28
  missionStoriesSearch.facets = facets;
35
29
 
36
30
  if (typeof window !== 'undefined') {
@@ -38,5 +32,21 @@ export default function installMissionStoriesSearch(config) {
38
32
  process.env.RAZZLE_ES_PROXY_ADDR || getClientProxyAddress();
39
33
  }
40
34
 
35
+ missionStoriesSearch.resultItemModel = {
36
+ factory: 'ResultModel',
37
+ urlField: 'about',
38
+ titleField: 'title',
39
+ metatypeField: 'objectProvides',
40
+ descriptionField: 'description',
41
+ tagsField: 'topic',
42
+ issuedField: 'issued',
43
+ getThumbnailUrl: 'getSearchThumbUrl',
44
+ getIconUrl: 'getGlobalsearchIconUrl',
45
+ fallbackThumbUrl:
46
+ 'https://react.semantic-ui.com/images/wireframe/white-image.png',
47
+ };
48
+
49
+ config.resolve.getSearchThumbUrl = getSearchThumbUrl();
50
+
41
51
  return config;
42
52
  }
@@ -34,3 +34,19 @@ export function getClientProxyAddress() {
34
34
  url.search = '';
35
35
  return url.toString();
36
36
  }
37
+
38
+ export const getSearchThumbUrl = () => (result, config, fallback) => {
39
+ let image = fallback;
40
+
41
+ if (
42
+ result.about?.raw?.indexOf('://cca-p6.devel5cph.eionet.europa.eu') !== -1 ||
43
+ result.about?.raw?.indexOf('://cca.devel5cph.eionet.europa.eu') !== -1 ||
44
+ result.about?.raw?.indexOf('://climate-adapt.eea.europa.eu') !== -1
45
+ ) {
46
+ if (result.cca_preview_image) {
47
+ image = result?.about?.raw + '/@@images/preview_image/preview';
48
+ }
49
+ }
50
+
51
+ return image;
52
+ };
@@ -0,0 +1,129 @@
1
+ /* Mission subsite */
2
+
3
+ body.subsite-mkh {
4
+ .top.bar .ui.container {
5
+ z-index: 3;
6
+ }
7
+
8
+ &.subsite-root {
9
+ .segment.content-area {
10
+ padding-top: 0;
11
+ margin-top: 0;
12
+ }
13
+
14
+ #page-document {
15
+ > div.styled-group:nth-child(2) {
16
+ margin-top: 0;
17
+ }
18
+ }
19
+ }
20
+
21
+ .subfooter .footer-description {
22
+ margin-top: 3em;
23
+ margin-bottom: 1em;
24
+
25
+ p {
26
+ font-size: 1.125rem;
27
+ font-weight: 600;
28
+ }
29
+ }
30
+
31
+ .ui.menu .green.active.item,
32
+ .ui.green.menu .active.item {
33
+ border-color: @green-1 !important;
34
+ color: @green-1 !important;
35
+ }
36
+
37
+ .main-menu {
38
+ .item a {
39
+ color: @blue-1;
40
+ }
41
+
42
+ .item a:hover {
43
+ border-color: @green-1;
44
+ }
45
+
46
+ .item.active a {
47
+ border-color: @green-1;
48
+ color: @green-1;
49
+ }
50
+ }
51
+
52
+ .search-action {
53
+ background-color: @green-1;
54
+ }
55
+
56
+ .eea.banner {
57
+ background: @green-1;
58
+ }
59
+
60
+ #mega-menu {
61
+ .ui.accordion .title i,
62
+ .ui.accordion button.title i {
63
+ color: @white;
64
+ }
65
+ }
66
+
67
+ footer,
68
+ .burger-action,
69
+ #search-box,
70
+ #mega-menu,
71
+ #mega-menu .ui.accordion .content {
72
+ background: @subsiteBackgroundGradient;
73
+ }
74
+ }
75
+
76
+ /* Latest news updates, Latest events */
77
+ body.subsite-root.section-mission {
78
+ div.columns-view {
79
+ div.block.listing.default {
80
+ div.items {
81
+ div.listing-item {
82
+ border: none;
83
+ margin: 0;
84
+ }
85
+
86
+ .listing-body {
87
+ position: relative;
88
+ padding-left: 2em;
89
+
90
+ &:before {
91
+ position: absolute;
92
+ top: -5px;
93
+ left: 0;
94
+ color: inherit;
95
+ content: '\ea6c';
96
+ font-family: remixicon !important;
97
+ font-size: 1.5em;
98
+ }
99
+ }
100
+ }
101
+ }
102
+
103
+ div.block.listing.summary {
104
+ .u-item {
105
+ padding-top: 0;
106
+ padding-bottom: 20px;
107
+ border: none;
108
+ }
109
+
110
+ .listing-header {
111
+ font-size: @h4;
112
+ }
113
+
114
+ .listing-body.has-icon i.icon {
115
+ margin-top: 1px;
116
+ }
117
+ }
118
+
119
+ div.block.listing.default {
120
+ div.listing-item {
121
+ padding-bottom: 0.5em;
122
+
123
+ h4 {
124
+ margin-bottom: 0.5em;
125
+ }
126
+ }
127
+ }
128
+ }
129
+ }
@@ -1,6 +1,7 @@
1
1
  /*******************************
2
2
  Global Overrides
3
3
  *******************************/
4
+ @import './mission.less';
4
5
 
5
6
  // [class~='view-defaultview'] [id='page-document'] > *,
6
7
  // [class~='view-viewview'] [id='page-document'] > * {
@@ -141,80 +142,6 @@ div.content-metadata {
141
142
  }
142
143
  }
143
144
 
144
- // Mission subsites
145
- body.subsite-mkh {
146
- .top.bar .ui.container {
147
- z-index: 3;
148
- }
149
-
150
- &.subsite-root {
151
- .segment.content-area {
152
- padding-top: 0;
153
- margin-top: 0;
154
- }
155
-
156
- #page-document {
157
- > div.styled-group:nth-child(2) {
158
- margin-top: 0;
159
- }
160
- }
161
- }
162
-
163
- .subfooter .footer-description {
164
- margin-top: 3em;
165
- margin-bottom: 1em;
166
-
167
- p {
168
- font-size: 1.125rem;
169
- font-weight: 600;
170
- }
171
- }
172
-
173
- .ui.menu .green.active.item,
174
- .ui.green.menu .active.item {
175
- border-color: @green-1 !important;
176
- color: @green-1 !important;
177
- }
178
-
179
- .main-menu {
180
- .item a {
181
- color: @blue-1;
182
- }
183
-
184
- .item a:hover {
185
- border-color: @green-1;
186
- }
187
-
188
- .item.active a {
189
- border-color: @green-1;
190
- color: @green-1;
191
- }
192
- }
193
-
194
- .search-action {
195
- background-color: @green-1;
196
- }
197
-
198
- .eea.banner {
199
- background: @green-1;
200
- }
201
-
202
- #mega-menu {
203
- .ui.accordion .title i,
204
- .ui.accordion button.title i {
205
- color: @white;
206
- }
207
- }
208
-
209
- footer,
210
- .burger-action,
211
- #search-box,
212
- #mega-menu,
213
- #mega-menu .ui.accordion .content {
214
- background: @subsiteBackgroundGradient;
215
- }
216
- }
217
-
218
145
  body.view-viewview .full {
219
146
  position: relative !important;
220
147
  right: 50%;
@@ -291,61 +218,6 @@ body.view-viewview.has-toolbar:not(.has-sidebar):not(.has-sidebar-collapsed) {
291
218
  }
292
219
  }
293
220
 
294
- /* Mission: Latest news updates, Latest events */
295
- body.subsite-root.section-mission {
296
- div.columns-view {
297
- div.block.listing.default {
298
- div.items {
299
- div.listing-item {
300
- border: none;
301
- margin: 0;
302
- }
303
-
304
- .listing-body {
305
- position: relative;
306
- padding-left: 2em;
307
-
308
- &:before {
309
- position: absolute;
310
- top: -5px;
311
- left: 0;
312
- color: inherit;
313
- content: '\ea6c';
314
- font-family: remixicon !important;
315
- font-size: 1.5em;
316
- }
317
- }
318
- }
319
- }
320
-
321
- div.block.listing.summary {
322
- .u-item {
323
- padding-top: 0;
324
- padding-bottom: 20px;
325
- border: none;
326
- }
327
-
328
- .listing-header {
329
- font-size: @h4;
330
- }
331
-
332
- .listing-body.has-icon i.icon {
333
- margin-top: 1px;
334
- }
335
- }
336
-
337
- div.block.listing.default {
338
- div.listing-item {
339
- padding-bottom: 0.5em;
340
-
341
- h4 {
342
- margin-bottom: 0.5em;
343
- }
344
- }
345
- }
346
- }
347
- }
348
-
349
221
  .listing-body-dates:empty {
350
222
  margin-bottom: 0;
351
223
  }