@eeacms/volto-arcgis-block 0.1.72 → 0.1.74
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,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.
|
|
7
|
+
### [0.1.74](https://github.com/eea/volto-arcgis-block/compare/0.1.73...0.1.74) - 27 October 2022
|
|
8
|
+
|
|
9
|
+
### [0.1.73](https://github.com/eea/volto-arcgis-block/compare/0.1.72...0.1.73) - 26 October 2022
|
|
10
|
+
|
|
11
|
+
#### :rocket: New Features
|
|
12
|
+
|
|
13
|
+
- feat: CLMS-1489 use cases viewer now saves dropdown expanded state and scroll position when navigating backwards from either a specific use case or a list of use cases (when clicking a cluster on the map) [joewdavies - [`6f821f4`](https://github.com/eea/volto-arcgis-block/commit/6f821f43fe9f31ccba4547cf01078eab8c2cead9)]
|
|
14
|
+
- feat: CLMS-1489 use cases viewer now saves dropdown expanded state and scroll position when navigating backwards from either a specific use case or a list of use cases (when clicking a cluster on the map) [joewdavies - [`0e4e940`](https://github.com/eea/volto-arcgis-block/commit/0e4e940a7d16674d625f62fe70abca74649d5f52)]
|
|
15
|
+
- feat: CLMS-1489 use cases viewer now saves dropdown expanded state and scroll position when navigating backwards from a specific use case to the product list [joewdavies - [`a7a7255`](https://github.com/eea/volto-arcgis-block/commit/a7a7255ccc9246e0eaf3b9cfa68b83920468d1ee)]
|
|
16
|
+
|
|
17
|
+
### [0.1.72](https://github.com/eea/volto-arcgis-block/compare/0.1.71...0.1.72) - 26 October 2022
|
|
8
18
|
|
|
9
19
|
### [0.1.71](https://github.com/eea/volto-arcgis-block/compare/0.1.70...0.1.71) - 13 October 2022
|
|
10
20
|
|
package/package.json
CHANGED
|
@@ -71,8 +71,10 @@ class InfoWidget extends React.Component {
|
|
|
71
71
|
<div className="use-case-detail-info">
|
|
72
72
|
<b>{UseCase.Copernicus_Land_Monitoring_Service_products_used}</b>
|
|
73
73
|
</div>
|
|
74
|
-
<div
|
|
75
|
-
|
|
74
|
+
<div
|
|
75
|
+
className="use-case-detail-description"
|
|
76
|
+
dangerouslySetInnerHTML={{ __html: UseCase.Use_case_summary }}
|
|
77
|
+
>
|
|
76
78
|
{UseCase.Links_to_web_sites && (
|
|
77
79
|
<div className="use-case-detail-link">
|
|
78
80
|
<p>
|
|
@@ -141,6 +143,22 @@ class InfoWidget extends React.Component {
|
|
|
141
143
|
className="use-case-element"
|
|
142
144
|
aria-hidden="true"
|
|
143
145
|
onClick={() => {
|
|
146
|
+
//save scroll position CLMS-1489
|
|
147
|
+
let productsScrollPosition;
|
|
148
|
+
let pl = document.getElementById('use-cases-product-list');
|
|
149
|
+
if (pl) {
|
|
150
|
+
productsScrollPosition = pl.scrollTop;
|
|
151
|
+
} else {
|
|
152
|
+
productsScrollPosition = null;
|
|
153
|
+
}
|
|
154
|
+
let casesScrollPosition;
|
|
155
|
+
let ucl = document.getElementById('use-cases-list');
|
|
156
|
+
if (ucl) {
|
|
157
|
+
casesScrollPosition = ucl.scrollTop;
|
|
158
|
+
} else {
|
|
159
|
+
casesScrollPosition = null;
|
|
160
|
+
}
|
|
161
|
+
|
|
144
162
|
view.popup.close();
|
|
145
163
|
layerControl.getGeometry(val.Spatial_coverage, layerHighlight);
|
|
146
164
|
layerControl.showLayer(layerHighlight.id);
|
|
@@ -148,6 +166,10 @@ class InfoWidget extends React.Component {
|
|
|
148
166
|
useCaseLevel: 4,
|
|
149
167
|
selectedUseCase: val,
|
|
150
168
|
previousState: prevState.useCaseLevel,
|
|
169
|
+
productsScrollPosition: productsScrollPosition,
|
|
170
|
+
casesScrollPosition: casesScrollPosition
|
|
171
|
+
? casesScrollPosition
|
|
172
|
+
: prevState,
|
|
151
173
|
}));
|
|
152
174
|
}}
|
|
153
175
|
id={`use_case_${val.OBJECTID}`}
|
|
@@ -208,7 +230,7 @@ class InfoWidget extends React.Component {
|
|
|
208
230
|
See all use cases
|
|
209
231
|
</button>
|
|
210
232
|
</div>
|
|
211
|
-
<div className="use-cases-products-list">
|
|
233
|
+
<div className="use-cases-products-list" id="use-cases-list">
|
|
212
234
|
<div key={selectedRegion} className="use-cases-dropdown">
|
|
213
235
|
{this.getDataBrief(regionFeatures)}
|
|
214
236
|
</div>
|
|
@@ -244,7 +266,7 @@ class InfoWidget extends React.Component {
|
|
|
244
266
|
Back
|
|
245
267
|
</button>
|
|
246
268
|
</div>
|
|
247
|
-
<div className="use-cases-products-list">
|
|
269
|
+
<div className="use-cases-products-list" id="specific-use-cases-list">
|
|
248
270
|
<div key={selectedRegion} className="use-cases-dropdown">
|
|
249
271
|
{this.getDataBrief(regionFeatures)}
|
|
250
272
|
</div>
|
|
@@ -286,7 +308,8 @@ class InfoWidget extends React.Component {
|
|
|
286
308
|
<div key={topic_name} className="use-cases-dropdown">
|
|
287
309
|
<div
|
|
288
310
|
className="ccl-expandable__button"
|
|
289
|
-
aria-expanded=
|
|
311
|
+
aria-expanded={mapViewer.state.activeDropdowns.includes(topic_name)}
|
|
312
|
+
id={topic_name}
|
|
290
313
|
onClick={this.toggleDropdownContent.bind(this)}
|
|
291
314
|
onKeyDown={this.toggleDropdownContent.bind(this)}
|
|
292
315
|
tabIndex="0"
|
|
@@ -306,13 +329,32 @@ class InfoWidget extends React.Component {
|
|
|
306
329
|
toggleDropdownContent(e) {
|
|
307
330
|
let aria = e.target.getAttribute('aria-expanded');
|
|
308
331
|
e.target.setAttribute('aria-expanded', aria === 'true' ? 'false' : 'true');
|
|
332
|
+
|
|
333
|
+
// dropdown expanded
|
|
309
334
|
if (aria === 'false') {
|
|
335
|
+
//save for reload
|
|
336
|
+
mapViewer.state.activeDropdowns.push(e.target.getAttribute('id'));
|
|
337
|
+
|
|
338
|
+
//scroll position
|
|
310
339
|
document.querySelector('.use-cases-products-list').scrollTo({
|
|
311
340
|
top:
|
|
312
341
|
e.currentTarget.offsetTop -
|
|
313
342
|
document.querySelector('.use-cases-products-list').offsetTop,
|
|
314
343
|
behavior: 'smooth',
|
|
315
344
|
});
|
|
345
|
+
} else {
|
|
346
|
+
if (
|
|
347
|
+
//remove for reload
|
|
348
|
+
mapViewer.state.activeDropdowns.includes(e.target.getAttribute('id'))
|
|
349
|
+
) {
|
|
350
|
+
const index = mapViewer.state.activeDropdowns.indexOf(
|
|
351
|
+
e.target.getAttribute('id'),
|
|
352
|
+
);
|
|
353
|
+
if (index > -1) {
|
|
354
|
+
// only splice array when item is found
|
|
355
|
+
mapViewer.state.activeDropdowns.splice(index, 1);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
316
358
|
}
|
|
317
359
|
}
|
|
318
360
|
|
|
@@ -414,7 +456,10 @@ class InfoWidget extends React.Component {
|
|
|
414
456
|
</span>
|
|
415
457
|
use cases
|
|
416
458
|
</div>
|
|
417
|
-
<div
|
|
459
|
+
<div
|
|
460
|
+
className="use-cases-products-list"
|
|
461
|
+
id="use-cases-product-list"
|
|
462
|
+
>
|
|
418
463
|
{this.setDOMSummary()}
|
|
419
464
|
</div>
|
|
420
465
|
</>
|
|
@@ -460,6 +505,27 @@ class InfoWidget extends React.Component {
|
|
|
460
505
|
}
|
|
461
506
|
}
|
|
462
507
|
|
|
508
|
+
componentDidUpdate() {
|
|
509
|
+
// code to run after initial render goes here
|
|
510
|
+
try {
|
|
511
|
+
// go to saved scroll position(s)
|
|
512
|
+
let pl = document.getElementById('use-cases-product-list');
|
|
513
|
+
if (pl) {
|
|
514
|
+
pl.scrollTo({
|
|
515
|
+
top: mapViewer.state.productsScrollPosition,
|
|
516
|
+
behavior: 'auto',
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
let ucl = document.getElementById('use-cases-list');
|
|
520
|
+
if (ucl) {
|
|
521
|
+
ucl.scrollTo({
|
|
522
|
+
top: mapViewer.state.casesScrollPosition,
|
|
523
|
+
behavior: 'auto',
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
} catch {}
|
|
527
|
+
}
|
|
528
|
+
|
|
463
529
|
/**
|
|
464
530
|
* This method renders the component
|
|
465
531
|
* @returns jsx
|
|
@@ -83,7 +83,21 @@ class NavigationControl extends React.Component {
|
|
|
83
83
|
*/
|
|
84
84
|
returnToPrevious() {
|
|
85
85
|
// this.layerControl.hideLayer(layerHighlight.id);
|
|
86
|
-
|
|
86
|
+
// CLMS-1489
|
|
87
|
+
let productsScrollPosition;
|
|
88
|
+
let pl = document.getElementById('use-cases-product-list');
|
|
89
|
+
if (pl) {
|
|
90
|
+
productsScrollPosition = pl.scrollTop;
|
|
91
|
+
} else {
|
|
92
|
+
productsScrollPosition = null;
|
|
93
|
+
}
|
|
94
|
+
let casesScrollPosition;
|
|
95
|
+
let ucl = document.getElementById('use-cases-list');
|
|
96
|
+
if (ucl) {
|
|
97
|
+
casesScrollPosition = ucl.scrollTop;
|
|
98
|
+
} else {
|
|
99
|
+
casesScrollPosition = null;
|
|
100
|
+
}
|
|
87
101
|
switch (
|
|
88
102
|
mapViewer.state.previousState === mapViewer.state.useCaseLevel
|
|
89
103
|
? mapViewer.state.useCaseLevel - 1
|
|
@@ -101,14 +115,26 @@ class NavigationControl extends React.Component {
|
|
|
101
115
|
mapViewer.state.selectedUseCase.Region,
|
|
102
116
|
layerSpatial,
|
|
103
117
|
);
|
|
104
|
-
mapViewer.setState(() => ({
|
|
118
|
+
mapViewer.setState((prevState) => ({
|
|
105
119
|
useCaseLevel: 2,
|
|
106
120
|
region: mapViewer.state.selectedUseCase.Region,
|
|
121
|
+
productsScrollPosition: productsScrollPosition
|
|
122
|
+
? productsScrollPosition
|
|
123
|
+
: prevState.productsScrollPosition,
|
|
124
|
+
casesScrollPosition: casesScrollPosition
|
|
125
|
+
? casesScrollPosition
|
|
126
|
+
: prevState.casesScrollPosition,
|
|
107
127
|
}));
|
|
108
128
|
break;
|
|
109
129
|
case 3:
|
|
110
|
-
mapViewer.setState(() => ({
|
|
130
|
+
mapViewer.setState((prevState) => ({
|
|
111
131
|
useCaseLevel: 3,
|
|
132
|
+
productsScrollPosition: productsScrollPosition
|
|
133
|
+
? productsScrollPosition
|
|
134
|
+
: prevState.productsScrollPosition,
|
|
135
|
+
casesScrollPosition: casesScrollPosition
|
|
136
|
+
? casesScrollPosition
|
|
137
|
+
: prevState.casesScrollPosition,
|
|
112
138
|
}));
|
|
113
139
|
break;
|
|
114
140
|
default:
|
|
@@ -61,6 +61,9 @@ class UseCasesMapViewer extends React.Component {
|
|
|
61
61
|
selectedUseCases: [],
|
|
62
62
|
previousState: 1,
|
|
63
63
|
showMapMenu: false,
|
|
64
|
+
activeDropdowns: [],
|
|
65
|
+
productsScrollPosition: 0,
|
|
66
|
+
casesScrollPosition: 0,
|
|
64
67
|
};
|
|
65
68
|
}
|
|
66
69
|
|
|
@@ -245,6 +248,21 @@ class UseCasesMapViewer extends React.Component {
|
|
|
245
248
|
});
|
|
246
249
|
view.on('click', (e) => {
|
|
247
250
|
let screenPoint = { x: e.x, y: e.y };
|
|
251
|
+
// CLMS-1489
|
|
252
|
+
let productsScrollPosition;
|
|
253
|
+
let pl = document.getElementById('use-cases-product-list');
|
|
254
|
+
if (pl) {
|
|
255
|
+
productsScrollPosition = pl.scrollTop;
|
|
256
|
+
} else {
|
|
257
|
+
productsScrollPosition = null;
|
|
258
|
+
}
|
|
259
|
+
let casesScrollPosition;
|
|
260
|
+
let ucl = document.getElementById('use-cases-list');
|
|
261
|
+
if (ucl) {
|
|
262
|
+
casesScrollPosition = ucl.scrollTop;
|
|
263
|
+
} else {
|
|
264
|
+
casesScrollPosition = null;
|
|
265
|
+
}
|
|
248
266
|
|
|
249
267
|
(async () => {
|
|
250
268
|
let selectedPoint = await layerControl.getPointInfo(screenPoint);
|
|
@@ -259,12 +277,26 @@ class UseCasesMapViewer extends React.Component {
|
|
|
259
277
|
selectedRegion,
|
|
260
278
|
layerSpatial,
|
|
261
279
|
);
|
|
280
|
+
// CLMS-1489
|
|
281
|
+
let productsScrollPosition;
|
|
282
|
+
let pl = document.getElementById('use-cases-product-list');
|
|
283
|
+
if (pl) {
|
|
284
|
+
productsScrollPosition = pl.scrollTop;
|
|
285
|
+
} else {
|
|
286
|
+
productsScrollPosition = 0;
|
|
287
|
+
}
|
|
262
288
|
this.setState((prevState) => {
|
|
263
289
|
return {
|
|
264
290
|
useCaseLevel: 2,
|
|
265
291
|
selectedUseCase: selectedPoint,
|
|
266
292
|
region: selectedRegion,
|
|
267
293
|
previousState: prevState.useCaseLevel,
|
|
294
|
+
productsScrollPosition: productsScrollPosition
|
|
295
|
+
? productsScrollPosition
|
|
296
|
+
: prevState.productsScrollPosition,
|
|
297
|
+
casesScrollPosition: casesScrollPosition
|
|
298
|
+
? casesScrollPosition
|
|
299
|
+
: prevState.casesScrollPosition,
|
|
268
300
|
};
|
|
269
301
|
});
|
|
270
302
|
} else if (
|
|
@@ -288,6 +320,12 @@ class UseCasesMapViewer extends React.Component {
|
|
|
288
320
|
selectedUseCase: data,
|
|
289
321
|
region: data.Region,
|
|
290
322
|
previousState: prevState.useCaseLevel,
|
|
323
|
+
productsScrollPosition: productsScrollPosition
|
|
324
|
+
? productsScrollPosition
|
|
325
|
+
: prevState.productsScrollPosition,
|
|
326
|
+
casesScrollPosition: casesScrollPosition
|
|
327
|
+
? casesScrollPosition
|
|
328
|
+
: prevState.casesScrollPosition,
|
|
291
329
|
};
|
|
292
330
|
});
|
|
293
331
|
},
|
|
@@ -307,6 +345,12 @@ class UseCasesMapViewer extends React.Component {
|
|
|
307
345
|
selectedUseCase: selectedPoint,
|
|
308
346
|
selectedUseCases: data.features,
|
|
309
347
|
previousState: prevState.useCaseLevel,
|
|
348
|
+
productsScrollPosition: productsScrollPosition
|
|
349
|
+
? productsScrollPosition
|
|
350
|
+
: prevState.productsScrollPosition,
|
|
351
|
+
casesScrollPosition: casesScrollPosition
|
|
352
|
+
? casesScrollPosition
|
|
353
|
+
: prevState.casesScrollPosition,
|
|
310
354
|
};
|
|
311
355
|
});
|
|
312
356
|
} else {
|
|
@@ -322,6 +366,12 @@ class UseCasesMapViewer extends React.Component {
|
|
|
322
366
|
useCaseLevel: 4,
|
|
323
367
|
selectedUseCase: selectedPoint,
|
|
324
368
|
previousState: prevState.useCaseLevel,
|
|
369
|
+
productsScrollPosition: productsScrollPosition
|
|
370
|
+
? productsScrollPosition
|
|
371
|
+
: prevState.productsScrollPosition,
|
|
372
|
+
casesScrollPosition: casesScrollPosition
|
|
373
|
+
? casesScrollPosition
|
|
374
|
+
: prevState.casesScrollPosition,
|
|
325
375
|
};
|
|
326
376
|
});
|
|
327
377
|
}
|