@eeacms/volto-clms-theme 1.1.74 → 1.1.75

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,7 +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.1.74](https://github.com/eea/volto-clms-theme/compare/1.1.73...1.1.74) - 6 November 2023
7
+ ### [1.1.75](https://github.com/eea/volto-clms-theme/compare/1.1.74...1.1.75) - 8 November 2023
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat: allow Files in Global search [Mikel Larreategi - [`fd202e9`](https://github.com/eea/volto-clms-theme/commit/fd202e95810fbcfa369fda1e493265ac01e5c439)]
12
+
13
+ #### :bug: Bug Fixes
14
+
15
+ - fix: re-request relatedListings navigating between datasets [Ion Lizarazu - [`8f2c617`](https://github.com/eea/volto-clms-theme/commit/8f2c6177da3bfa4583d4292dcbad2edf49a128fe)]
16
+ - fix:CLMS-2805 addition of two new boxes [Unai - [`31c3285`](https://github.com/eea/volto-clms-theme/commit/31c3285e8f06313919b8bb7492111c35633b0cde)]
17
+ - fix: CLMS-2803 removed < and > buttons from main page's carousel [Unai - [`2b539f4`](https://github.com/eea/volto-clms-theme/commit/2b539f4e26a556bb55d0cf09b92d489786ae7ed3)]
18
+
19
+ #### :house: Internal changes
20
+
21
+ - style: Automated code fix [eea-jenkins - [`95b48d1`](https://github.com/eea/volto-clms-theme/commit/95b48d109d48a633c614a9f26072b989ad7e6466)]
22
+
23
+ ### [1.1.74](https://github.com/eea/volto-clms-theme/compare/1.1.73...1.1.74) - 7 November 2023
8
24
 
9
25
  #### :rocket: New Features
10
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-clms-theme",
3
- "version": "1.1.74",
3
+ "version": "1.1.75",
4
4
  "description": "volto-clms-theme: Volto theme for CLMS site",
5
5
  "main": "src/index.js",
6
6
  "author": "CodeSyntax for the European Environment Agency",
@@ -44,6 +44,7 @@ const CclHomeBgImageBlockEdit = (props) => {
44
44
  config,
45
45
  data.hasButton,
46
46
  data.hasLocationInfo,
47
+ data.hasDatasetButton,
47
48
  )}
48
49
  title="Carousel Div block"
49
50
  onChangeField={(id, value) => {
@@ -1,4 +1,9 @@
1
- export const HomeBgImageSchema = (config, hasButton, hasLocationInfo) => {
1
+ export const HomeBgImageSchema = (
2
+ config,
3
+ hasButton,
4
+ hasLocationInfo,
5
+ hasDatasetButton,
6
+ ) => {
2
7
  const variationsConfig = config.blocks.blocksConfig['homeBgImage'].variations;
3
8
  const variations = Object.keys(variationsConfig).map((variation) => [
4
9
  variationsConfig[variation].id,
@@ -13,6 +18,20 @@ export const HomeBgImageSchema = (config, hasButton, hasLocationInfo) => {
13
18
  },
14
19
  ]
15
20
  : [];
21
+ const hasDatasetButtonFieldset = hasDatasetButton
22
+ ? [
23
+ {
24
+ id: 'datasetButtonStyle',
25
+ title: 'Dataset button style',
26
+ fields: [
27
+ 'dataset_buttonTitle',
28
+ 'dataset_href',
29
+ 'dataset_style',
30
+ 'dataset_disabled',
31
+ ],
32
+ },
33
+ ]
34
+ : [];
16
35
  const hasLocationFieldset = hasLocationInfo
17
36
  ? [
18
37
  {
@@ -36,10 +55,15 @@ export const HomeBgImageSchema = (config, hasButton, hasLocationInfo) => {
36
55
  'location',
37
56
  'hasLocationInfo',
38
57
  'hasButton',
58
+ 'dataset_title',
59
+ 'dataset_subtitle',
60
+ 'dataset_description',
61
+ 'hasDatasetButton',
39
62
  ],
40
63
  },
41
64
  ...hasLocationFieldset,
42
65
  ...hasButtonFieldset,
66
+ ...hasDatasetButtonFieldset,
43
67
  ],
44
68
  properties: {
45
69
  title: {
@@ -122,6 +146,52 @@ export const HomeBgImageSchema = (config, hasButton, hasLocationInfo) => {
122
146
  type: 'boolean',
123
147
  default: false,
124
148
  },
149
+ dataset_title: {
150
+ title: 'Dataset title',
151
+ description: 'Dataset div title',
152
+ type: 'string',
153
+ },
154
+ dataset_subtitle: {
155
+ title: 'Dataset subTitle',
156
+ description: 'Dataset div Subtitle',
157
+ type: 'string',
158
+ },
159
+ dataset_description: {
160
+ title: 'Dataset description',
161
+ description: 'Dataset div description',
162
+ type: 'string',
163
+ },
164
+ hasDatasetButton: {
165
+ title: 'Dataset button',
166
+ type: 'boolean',
167
+ default: false,
168
+ },
169
+ dataset_buttonTitle: {
170
+ title: 'Title',
171
+ description: 'Add button text',
172
+ type: 'string',
173
+ },
174
+ dataset_href: {
175
+ title: 'URL',
176
+ description: 'Select site content or paste external url',
177
+ widget: 'object_browser',
178
+ mode: 'link',
179
+ selectedItemAttrs: ['Title', 'Description', '@type', '@id'],
180
+ allowExternals: true,
181
+ },
182
+ dataset_style: {
183
+ title: 'Button style',
184
+ choices: [
185
+ ['default', 'Default'],
186
+ ['filled', 'Filled'],
187
+ ],
188
+ default: 'default',
189
+ },
190
+ dataset_disabled: {
191
+ title: 'Disabled',
192
+ type: 'boolean',
193
+ default: false,
194
+ },
125
195
  },
126
196
  required: [],
127
197
  };
@@ -38,6 +38,41 @@ const CclWhiteBgView = (props) => {
38
38
  </CclButton>
39
39
  )}
40
40
  </div>
41
+ {data?.dataset_title ||
42
+ data?.dataset_subtitle ||
43
+ (data?.dataset_description && (
44
+ <div className="home-dataset-banner">
45
+ {data.dataset_title && <h1>{data?.dataset_title}</h1>}
46
+ {data.dataset_subtitle && <h2>{data?.dataset_subtitle}</h2>}
47
+ {data.dataset_description && (
48
+ <h3>{data?.dataset_description} </h3>
49
+ )}
50
+ {data?.hasDatasetButton === true && (
51
+ <CclButton
52
+ url={
53
+ data?.download &&
54
+ data?.dataset_href?.[0]?.['@type'] === 'File'
55
+ ? data?.dataset_href?.[0]?.['@id'] + '/@@download/file'
56
+ : data?.dataset_href?.[0]?.['@id']
57
+ }
58
+ disabled={data?.dataset_disabled}
59
+ download={
60
+ data?.download ||
61
+ data?.dataset_href?.[0]?.['@type'] === 'File'
62
+ }
63
+ target={
64
+ data?.target ||
65
+ (data?.download &&
66
+ data?.dataset_href[0]['@type'] === 'File' &&
67
+ '_blank')
68
+ }
69
+ mode={data?.dataset_style}
70
+ >
71
+ {data?.dataset_buttonTitle}
72
+ </CclButton>
73
+ )}
74
+ </div>
75
+ ))}
41
76
  </div>
42
77
  </div>
43
78
  );
@@ -32,10 +32,10 @@ const CclRelatedListingView = (props) => {
32
32
  const { pagination, currentPage, paginationSize, dataList } = p_data;
33
33
 
34
34
  const dispatch = useDispatch();
35
+ const uid = metadata ? metadata['UID'] : properties['UID'];
35
36
  const searchSubrequests = useSelector(
36
- (state) => state.search.subrequests?.[id],
37
+ (state) => state.search.subrequests?.[`${id}-${uid}`],
37
38
  );
38
- const uid = metadata ? metadata['UID'] : properties['UID'];
39
39
 
40
40
  const associated = directRelation
41
41
  ? directQuery
@@ -96,6 +96,7 @@ const CclRelatedListingView = (props) => {
96
96
  }
97
97
 
98
98
  uid &&
99
+ id &&
99
100
  !searchSubrequests?.loading &&
100
101
  !searchSubrequests?.loaded &&
101
102
  !searchSubrequests?.error &&
@@ -110,11 +111,12 @@ const CclRelatedListingView = (props) => {
110
111
  sort_order: sort_order,
111
112
  b_size: 99999,
112
113
  },
113
- id,
114
+ `${id}-${uid}`,
114
115
  ),
115
116
  );
117
+ return () => {};
116
118
  // eslint-disable-next-line react-hooks/exhaustive-deps
117
- }, [data, id, uid, dispatch, searchSubrequests]);
119
+ }, [data, id, uid, dispatch]);
118
120
 
119
121
  return (
120
122
  <>
@@ -9,6 +9,7 @@ export const portal_types_labels = {
9
9
  TechnicalLibrary: 'Product documentation',
10
10
  Document: 'Other content',
11
11
  FAQ: 'FAQ',
12
+ File: 'Files',
12
13
  };
13
14
 
14
15
  export const category_labels = {
@@ -52,6 +53,7 @@ const rewriteOptions = (name, choices) => {
52
53
  'Tender',
53
54
  'WorkOpportunity',
54
55
  'Document',
56
+ 'File',
55
57
  ];
56
58
 
57
59
  const dataset_geographical_classification = [
@@ -63,7 +63,7 @@ const View = (props) => {
63
63
  );
64
64
  };
65
65
 
66
- const ArrowsGroup = (arrowProps) => {
66
+ /* const ArrowsGroup = (arrowProps) => {
67
67
  return (
68
68
  <div className={'slick-arrows'}>
69
69
  <button
@@ -87,7 +87,7 @@ const View = (props) => {
87
87
  ></button>
88
88
  </div>
89
89
  );
90
- };
90
+ }; */
91
91
 
92
92
  const [showInfo, setShowInfo] = React.useState(false);
93
93
  const panes = tabsList.map((tab, index) => {
@@ -113,7 +113,7 @@ const View = (props) => {
113
113
  <Slider {...settings} ref={slider} className="home-carousel">
114
114
  {panes.length ? panes.map((pane) => pane.renderItem) : ''}
115
115
  </Slider>
116
- <ArrowsGroup activeTab={activeTab} tabsList={tabsList} slider={slider} />
116
+ {/* <ArrowsGroup activeTab={activeTab} tabsList={tabsList} slider={slider} /> */}
117
117
  <Dots
118
118
  dotActiveTab={activeTab}
119
119
  dotTabsList={tabsList}
@@ -10,6 +10,7 @@ div.tabs-block.CCLCarousel {
10
10
  width: 100vw !important;
11
11
  max-width: initial !important;
12
12
  margin-right: -50vw !important;
13
+ margin-bottom: -2rem;
13
14
  margin-left: -50vw !important;
14
15
  }
15
16
  }
@@ -149,7 +149,7 @@
149
149
  padding: 0 2rem;
150
150
  }
151
151
 
152
- @media (max-width:770px) {
152
+ @media (max-width: 770px) {
153
153
  .ccl-banner-top-main img {
154
154
  min-height: 550px;
155
155
  max-height: 550px;
@@ -174,6 +174,12 @@
174
174
  }
175
175
  }
176
176
 
177
+ @media (max-width: 1200px) {
178
+ .home-carousel {
179
+ margin-bottom: -4rem;
180
+ }
181
+ }
182
+
177
183
  .home-carousel .slick-dots {
178
184
  position: absolute;
179
185
  bottom: 3.75rem;
@@ -396,9 +402,32 @@
396
402
  .home-map-container > .ccl-container {
397
403
  position: absolute;
398
404
  bottom: 4rem;
405
+ display: flex;
399
406
  width: 100%;
400
407
  max-width: 1400px;
408
+ flex-wrap: wrap;
409
+ justify-content: center;
401
410
  padding: 0 2rem;
411
+ gap: 1rem;
412
+ }
413
+
414
+ @media (max-width: 990px) {
415
+ .home-map-container img {
416
+ min-height: 320px;
417
+ }
418
+ }
419
+
420
+ @media (max-width: 700px) {
421
+ .home-dataset-banner,
422
+ .home-map-banner {
423
+ min-width: 320px;
424
+ }
425
+
426
+ .home-map-container > .ccl-container {
427
+ bottom: 0;
428
+ height: 100%;
429
+ padding: 1rem 0;
430
+ }
402
431
  }
403
432
 
404
433
  @media (max-width: 480px) {
@@ -407,6 +436,8 @@
407
436
  }
408
437
 
409
438
  .home-map-container > .ccl-container {
439
+ bottom: 4rem;
440
+ height: auto;
410
441
  padding: 0;
411
442
  }
412
443
  }
@@ -424,8 +455,21 @@
424
455
  .home-map-banner {
425
456
  width: 40%;
426
457
  }
458
+
459
+ .home-dataset-banner {
460
+ width: 40%;
461
+ }
427
462
  }
428
463
 
464
+ .home-dataset-banner {
465
+ max-width: 100%;
466
+ padding: 1.5rem;
467
+ background-color: fade(@white, 70%);
468
+ }
469
+
470
+ .home-dataset-banner h4 {
471
+ margin-bottom: 1rem;
472
+ }
429
473
  /* Meet band */
430
474
  .home-meet-container {
431
475
  padding: 3rem 1rem;