@eeacms/volto-clms-theme 1.1.288 → 1.1.290
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 +15 -0
- package/package.json +1 -1
- package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/FilterList.jsx +33 -2
- package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/RightModalFacets.jsx +233 -89
- package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/SearchInput.jsx +84 -7
- package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/icons/search.svg +3 -0
- package/src/components/Blocks/CustomTemplates/VoltoSearchBlock/searchDesign.js +8 -0
- package/src/components/CclCard/CclCard.jsx +26 -12
- package/src/customizations/@eeacms/volto-embed/PrivacyProtection/PrivacyProtection.jsx +3 -80
- package/src/customizations/volto/components/manage/Blocks/Search/SearchBlockView.jsx +27 -4
- package/src/customizations/volto/components/manage/Blocks/Search/hocs/withSearch.jsx +80 -12
- package/theme/site/extras/menu.less +457 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@ 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.290](https://github.com/eea/volto-clms-theme/compare/1.1.289...1.1.290) - 21 May 2026
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: unify the design of technical library search with global search and dataset catalogue -refs #291483 [ana-oprea - [`8e1c755`](https://github.com/eea/volto-clms-theme/commit/8e1c7555b35fbeb49c3d78a8b47ad65b51b98e33)]
|
|
12
|
+
|
|
13
|
+
#### :hammer_and_wrench: Others
|
|
14
|
+
|
|
15
|
+
- fix icon and jest [ana-oprea - [`2566588`](https://github.com/eea/volto-clms-theme/commit/256658849faedcbfb406edd2d4bad2d1c4a287b7)]
|
|
16
|
+
- fix jest [ana-oprea - [`1c1d529`](https://github.com/eea/volto-clms-theme/commit/1c1d529940cb43bc02afe77686578cc181473a55)]
|
|
17
|
+
### [1.1.289](https://github.com/eea/volto-clms-theme/compare/1.1.288...1.1.289) - 21 May 2026
|
|
18
|
+
|
|
19
|
+
#### :hammer_and_wrench: Others
|
|
20
|
+
|
|
21
|
+
- fix ESlint [Teodor Voicu - [`2b285af`](https://github.com/eea/volto-clms-theme/commit/2b285afa78aa2a2458d8eb2e4a0c8af481767240)]
|
|
7
22
|
### [1.1.288](https://github.com/eea/volto-clms-theme/compare/1.1.287...1.1.288) - 19 May 2026
|
|
8
23
|
|
|
9
24
|
#### :house: Internal changes
|
package/package.json
CHANGED
|
@@ -12,6 +12,10 @@ const messages = defineMessages({
|
|
|
12
12
|
id: 'Clear filters',
|
|
13
13
|
defaultMessage: 'Clear filters',
|
|
14
14
|
},
|
|
15
|
+
applied: {
|
|
16
|
+
id: 'Applied',
|
|
17
|
+
defaultMessage: 'Applied',
|
|
18
|
+
},
|
|
15
19
|
});
|
|
16
20
|
|
|
17
21
|
const FilterList = (props) => {
|
|
@@ -93,7 +97,34 @@ const FilterList = (props) => {
|
|
|
93
97
|
.length;
|
|
94
98
|
|
|
95
99
|
const intl = useIntl();
|
|
96
|
-
|
|
100
|
+
if (!showFilterList || !Object.keys(currentFilters).length) return null;
|
|
101
|
+
|
|
102
|
+
if (props.variant === 'globalSearch') {
|
|
103
|
+
if (!totalFilters) return null;
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<div className="global-search-applied-filters">
|
|
107
|
+
<span>
|
|
108
|
+
{intl.formatMessage(messages.applied)}: {totalFilters}
|
|
109
|
+
</span>
|
|
110
|
+
<Button
|
|
111
|
+
icon
|
|
112
|
+
basic
|
|
113
|
+
compact
|
|
114
|
+
size="small"
|
|
115
|
+
aria-label={intl.formatMessage(messages.clearFilters)}
|
|
116
|
+
onClick={(e) => {
|
|
117
|
+
e.stopPropagation();
|
|
118
|
+
!isEditMode && setFacets({});
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
121
|
+
<Icon name="trash" />
|
|
122
|
+
</Button>
|
|
123
|
+
</div>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return (
|
|
97
128
|
<div className="accordion ui filter-listing">
|
|
98
129
|
<div
|
|
99
130
|
className="filter-list-header"
|
|
@@ -118,7 +149,7 @@ const FilterList = (props) => {
|
|
|
118
149
|
</Button>
|
|
119
150
|
</div>
|
|
120
151
|
</div>
|
|
121
|
-
)
|
|
152
|
+
);
|
|
122
153
|
};
|
|
123
154
|
|
|
124
155
|
export default FilterList;
|
|
@@ -12,6 +12,7 @@ import { Icon } from '@plone/volto/components';
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import filterSVG from '@plone/volto/icons/filter.svg';
|
|
14
14
|
import { flushSync } from 'react-dom';
|
|
15
|
+
import { usesGlobalSearchDesign } from './searchDesign';
|
|
15
16
|
|
|
16
17
|
const messages = defineMessages({
|
|
17
18
|
searchButtonText: {
|
|
@@ -26,6 +27,76 @@ const FacetWrapper = ({ children }) => (
|
|
|
26
27
|
</Segment>
|
|
27
28
|
);
|
|
28
29
|
|
|
30
|
+
const getSortLabel = (value, querystring) => {
|
|
31
|
+
const title = querystring?.sortable_indexes?.[value]?.title || value;
|
|
32
|
+
if (
|
|
33
|
+
['effective', 'publication_date', 'modified'].includes(value) ||
|
|
34
|
+
/publication date/i.test(title)
|
|
35
|
+
) {
|
|
36
|
+
return 'Time';
|
|
37
|
+
}
|
|
38
|
+
if (value === 'sortable_title') {
|
|
39
|
+
return 'Title';
|
|
40
|
+
}
|
|
41
|
+
if (value === 'relevance') {
|
|
42
|
+
return 'Relevance';
|
|
43
|
+
}
|
|
44
|
+
return title?.replace(/^Sort by /, '') || value;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const GlobalSortOn = ({
|
|
48
|
+
data,
|
|
49
|
+
querystring,
|
|
50
|
+
isEditMode,
|
|
51
|
+
sortOn,
|
|
52
|
+
sortOrder,
|
|
53
|
+
onChange,
|
|
54
|
+
}) => {
|
|
55
|
+
const configuredOptions = data.sortOnOptions || [];
|
|
56
|
+
const concreteOptions = configuredOptions.filter(
|
|
57
|
+
(option) => !['SearchableText', 'relevance'].includes(option),
|
|
58
|
+
);
|
|
59
|
+
const options = ['relevance', ...concreteOptions];
|
|
60
|
+
const activeSortOn = sortOn && options.includes(sortOn) ? sortOn : options[0];
|
|
61
|
+
|
|
62
|
+
if (!options.length) return null;
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<div className="sorting global-search-sorting">
|
|
66
|
+
<span className="global-search-sort-label">Sort by:</span>
|
|
67
|
+
{options.map((option) => {
|
|
68
|
+
const isActive = activeSortOn === option;
|
|
69
|
+
return (
|
|
70
|
+
<button
|
|
71
|
+
key={option}
|
|
72
|
+
type="button"
|
|
73
|
+
className={isActive ? 'active' : ''}
|
|
74
|
+
onClick={() => {
|
|
75
|
+
if (isEditMode) return;
|
|
76
|
+
if (option === 'relevance') {
|
|
77
|
+
onChange(null, null);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const nextOrder =
|
|
81
|
+
isActive && sortOrder === 'ascending'
|
|
82
|
+
? 'descending'
|
|
83
|
+
: 'ascending';
|
|
84
|
+
onChange(option, nextOrder);
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
{getSortLabel(option, querystring)}
|
|
88
|
+
{isActive && option !== 'relevance' && (
|
|
89
|
+
<span className="global-search-sort-direction">
|
|
90
|
+
{sortOrder === 'descending' ? '▼' : '▲'}
|
|
91
|
+
</span>
|
|
92
|
+
)}
|
|
93
|
+
</button>
|
|
94
|
+
);
|
|
95
|
+
})}
|
|
96
|
+
</div>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
|
|
29
100
|
function setFacetsHandler(setFacets, onTriggerSearch, searchedText) {
|
|
30
101
|
return (f) => {
|
|
31
102
|
flushSync(() => {
|
|
@@ -57,6 +128,7 @@ const RightModalFacets = (props) => {
|
|
|
57
128
|
} = props;
|
|
58
129
|
const { showSearchButton } = data;
|
|
59
130
|
const isLive = !showSearchButton;
|
|
131
|
+
const hasGlobalSearchDesign = usesGlobalSearchDesign(props);
|
|
60
132
|
const intl = useIntl();
|
|
61
133
|
// Should we generalize this to an external function?
|
|
62
134
|
if (querystring?.sortable_indexes?.effective?.title) {
|
|
@@ -75,8 +147,64 @@ const RightModalFacets = (props) => {
|
|
|
75
147
|
querystring.sortable_indexes.version.title = 'Version';
|
|
76
148
|
}
|
|
77
149
|
|
|
150
|
+
const updateFacets = setFacetsHandler(
|
|
151
|
+
setFacets,
|
|
152
|
+
onTriggerSearch,
|
|
153
|
+
searchedText,
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
const facetsModal = data.facets?.length ? (
|
|
157
|
+
<CclFiltersModal
|
|
158
|
+
trigger={
|
|
159
|
+
<div className="filters-element">
|
|
160
|
+
<div className="filters-title">
|
|
161
|
+
{hasGlobalSearchDesign ? (
|
|
162
|
+
<span
|
|
163
|
+
className="global-search-categories-icon"
|
|
164
|
+
aria-hidden="true"
|
|
165
|
+
>
|
|
166
|
+
<Icon
|
|
167
|
+
className="global-search-categories-filter-icon"
|
|
168
|
+
name={filterSVG}
|
|
169
|
+
size="10px"
|
|
170
|
+
color="#fff"
|
|
171
|
+
/>
|
|
172
|
+
</span>
|
|
173
|
+
) : (
|
|
174
|
+
<Icon className="ui" name={filterSVG} size={'20'} />
|
|
175
|
+
)}
|
|
176
|
+
<span className="filters-title-bold">
|
|
177
|
+
{hasGlobalSearchDesign ? 'Show Categories' : data.facetsTitle}
|
|
178
|
+
</span>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
}
|
|
182
|
+
data={data}
|
|
183
|
+
setFacets={updateFacets}
|
|
184
|
+
>
|
|
185
|
+
<div id="right-modal-facets" className="facets">
|
|
186
|
+
<Facets
|
|
187
|
+
querystring={querystring}
|
|
188
|
+
data={data}
|
|
189
|
+
facets={facets}
|
|
190
|
+
isEditMode={isEditMode}
|
|
191
|
+
setFacets={updateFacets}
|
|
192
|
+
facetWrapper={FacetWrapper}
|
|
193
|
+
/>
|
|
194
|
+
</div>
|
|
195
|
+
</CclFiltersModal>
|
|
196
|
+
) : null;
|
|
197
|
+
|
|
78
198
|
return (
|
|
79
|
-
<Grid
|
|
199
|
+
<Grid
|
|
200
|
+
className={[
|
|
201
|
+
'searchBlock-facets right-column-facets',
|
|
202
|
+
hasGlobalSearchDesign ? 'global-search-facets' : '',
|
|
203
|
+
]
|
|
204
|
+
.filter(Boolean)
|
|
205
|
+
.join(' ')}
|
|
206
|
+
stackable
|
|
207
|
+
>
|
|
80
208
|
{data?.headline && (
|
|
81
209
|
<Grid.Row>
|
|
82
210
|
<Grid.Column>
|
|
@@ -91,21 +219,29 @@ const RightModalFacets = (props) => {
|
|
|
91
219
|
? data.showSearchInput
|
|
92
220
|
: true) && (
|
|
93
221
|
<>
|
|
94
|
-
|
|
95
|
-
<SearchInput
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
222
|
+
{hasGlobalSearchDesign ? (
|
|
223
|
+
<SearchInput
|
|
224
|
+
{...props}
|
|
225
|
+
isLive={isLive}
|
|
226
|
+
useSearchlibSearchDesign={hasGlobalSearchDesign}
|
|
227
|
+
/>
|
|
228
|
+
) : (
|
|
229
|
+
<div className="search-wrapper">
|
|
230
|
+
<SearchInput {...props} isLive={isLive} />
|
|
231
|
+
{data.showSearchButton && (
|
|
232
|
+
<Button
|
|
233
|
+
primary
|
|
234
|
+
onClick={() => onTriggerSearch(searchText)}
|
|
235
|
+
aria-label={
|
|
236
|
+
data.searchButtonLabel ||
|
|
237
|
+
intl.formatMessage(messages.searchButtonText)
|
|
238
|
+
}
|
|
239
|
+
>
|
|
240
|
+
<span className="ccl-icon-zoom"></span>
|
|
241
|
+
</Button>
|
|
242
|
+
)}
|
|
243
|
+
</div>
|
|
244
|
+
)}
|
|
109
245
|
<div className="search-box-hint">
|
|
110
246
|
<p>
|
|
111
247
|
Hint: you can use double quotes to search for exact phrases.
|
|
@@ -115,84 +251,92 @@ const RightModalFacets = (props) => {
|
|
|
115
251
|
</>
|
|
116
252
|
)}
|
|
117
253
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
254
|
+
{hasGlobalSearchDesign ? (
|
|
255
|
+
<>
|
|
256
|
+
<div className="global-search-count">
|
|
257
|
+
<SearchDetails total={totalItems} data={data} as="div" />
|
|
258
|
+
</div>
|
|
259
|
+
<div className="above-results global-search-above-results">
|
|
260
|
+
<div className="global-search-filters-left">
|
|
261
|
+
{facetsModal}
|
|
262
|
+
<FilterList
|
|
263
|
+
{...props}
|
|
264
|
+
variant="globalSearch"
|
|
265
|
+
isEditMode={isEditMode}
|
|
266
|
+
setFacets={updateFacets}
|
|
267
|
+
/>
|
|
268
|
+
</div>
|
|
269
|
+
{data.showSortOn && (
|
|
270
|
+
<GlobalSortOn
|
|
271
|
+
data={data}
|
|
272
|
+
querystring={querystring}
|
|
273
|
+
isEditMode={isEditMode}
|
|
274
|
+
sortOrder={sortOrder}
|
|
275
|
+
sortOn={sortOn}
|
|
276
|
+
onChange={(sortOnParam, sortOrderParam) => {
|
|
277
|
+
flushSync(() => {
|
|
278
|
+
setSortOn(sortOnParam || undefined);
|
|
279
|
+
setSortOrder(sortOrderParam || undefined);
|
|
280
|
+
onTriggerSearch(
|
|
281
|
+
searchedText || '',
|
|
282
|
+
facets,
|
|
283
|
+
sortOnParam,
|
|
284
|
+
sortOrderParam,
|
|
285
|
+
);
|
|
286
|
+
});
|
|
287
|
+
}}
|
|
288
|
+
/>
|
|
289
|
+
)}
|
|
290
|
+
</div>
|
|
291
|
+
</>
|
|
292
|
+
) : (
|
|
293
|
+
<>
|
|
294
|
+
<div>
|
|
295
|
+
<FilterList
|
|
296
|
+
{...props}
|
|
137
297
|
isEditMode={isEditMode}
|
|
138
|
-
|
|
139
|
-
sortOn={sortOn}
|
|
140
|
-
setSortOn={(sortOnParam) => {
|
|
141
|
-
flushSync(() => {
|
|
142
|
-
setSortOn(sortOnParam);
|
|
143
|
-
onTriggerSearch(searchedText || '', facets, sortOnParam);
|
|
144
|
-
});
|
|
145
|
-
}}
|
|
146
|
-
setSortOrder={(sortOrderParam) => {
|
|
147
|
-
flushSync(() => {
|
|
148
|
-
setSortOrder(sortOrderParam);
|
|
149
|
-
onTriggerSearch(
|
|
150
|
-
searchedText || '',
|
|
151
|
-
facets,
|
|
152
|
-
sortOn,
|
|
153
|
-
sortOrderParam,
|
|
154
|
-
);
|
|
155
|
-
});
|
|
156
|
-
}}
|
|
298
|
+
setFacets={updateFacets}
|
|
157
299
|
/>
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
<span className="filters-title-bold">
|
|
166
|
-
{data.facetsTitle}
|
|
167
|
-
</span>
|
|
168
|
-
</div>
|
|
169
|
-
</div>
|
|
170
|
-
}
|
|
171
|
-
data={data}
|
|
172
|
-
setFacets={setFacetsHandler(
|
|
173
|
-
setFacets,
|
|
174
|
-
onTriggerSearch,
|
|
175
|
-
searchedText,
|
|
176
|
-
)}
|
|
177
|
-
>
|
|
178
|
-
<div id="right-modal-facets" className="facets">
|
|
179
|
-
<Facets
|
|
180
|
-
querystring={querystring}
|
|
300
|
+
</div>
|
|
301
|
+
|
|
302
|
+
<div className="search-results-count-sort search-filters">
|
|
303
|
+
<SearchDetails total={totalItems} data={data} />
|
|
304
|
+
<div className="filters-container">
|
|
305
|
+
{data.showSortOn && (
|
|
306
|
+
<SortOn
|
|
181
307
|
data={data}
|
|
182
|
-
|
|
308
|
+
querystring={querystring}
|
|
183
309
|
isEditMode={isEditMode}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
310
|
+
sortOrder={sortOrder}
|
|
311
|
+
sortOn={sortOn}
|
|
312
|
+
setSortOn={(sortOnParam) => {
|
|
313
|
+
flushSync(() => {
|
|
314
|
+
setSortOn(sortOnParam);
|
|
315
|
+
onTriggerSearch(
|
|
316
|
+
searchedText || '',
|
|
317
|
+
facets,
|
|
318
|
+
sortOnParam,
|
|
319
|
+
);
|
|
320
|
+
});
|
|
321
|
+
}}
|
|
322
|
+
setSortOrder={(sortOrderParam) => {
|
|
323
|
+
flushSync(() => {
|
|
324
|
+
setSortOrder(sortOrderParam);
|
|
325
|
+
onTriggerSearch(
|
|
326
|
+
searchedText || '',
|
|
327
|
+
facets,
|
|
328
|
+
sortOn,
|
|
329
|
+
sortOrderParam,
|
|
330
|
+
);
|
|
331
|
+
});
|
|
332
|
+
}}
|
|
190
333
|
/>
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
334
|
+
)}
|
|
335
|
+
{facetsModal}
|
|
336
|
+
</div>
|
|
337
|
+
</div>
|
|
338
|
+
</>
|
|
339
|
+
)}
|
|
196
340
|
{children}
|
|
197
341
|
</Grid.Column>
|
|
198
342
|
</Grid.Row>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Button, Input } from 'semantic-ui-react';
|
|
2
|
+
import { Button, Icon as SemanticIcon, Input } from 'semantic-ui-react';
|
|
3
3
|
import { defineMessages, useIntl } from 'react-intl';
|
|
4
|
-
import { Icon } from '@plone/volto/components';
|
|
4
|
+
import { Icon as VoltoIcon } from '@plone/volto/components';
|
|
5
5
|
import clearSVG from '@plone/volto/icons/clear.svg';
|
|
6
|
+
import searchSVG from './icons/search.svg';
|
|
6
7
|
|
|
7
8
|
const messages = defineMessages({
|
|
8
9
|
search: {
|
|
@@ -12,8 +13,86 @@ const messages = defineMessages({
|
|
|
12
13
|
});
|
|
13
14
|
|
|
14
15
|
const SearchInput = (props) => {
|
|
15
|
-
const {
|
|
16
|
+
const {
|
|
17
|
+
data,
|
|
18
|
+
searchText,
|
|
19
|
+
setSearchText,
|
|
20
|
+
isLive,
|
|
21
|
+
isGlobalSearch,
|
|
22
|
+
useSearchlibSearchDesign = isGlobalSearch,
|
|
23
|
+
onTriggerSearch,
|
|
24
|
+
} = props;
|
|
16
25
|
const intl = useIntl();
|
|
26
|
+
const placeholder =
|
|
27
|
+
data.searchInputPrompt || intl.formatMessage(messages.search);
|
|
28
|
+
|
|
29
|
+
if (useSearchlibSearchDesign) {
|
|
30
|
+
return (
|
|
31
|
+
<div className="sui-search-box">
|
|
32
|
+
<div className="search-input">
|
|
33
|
+
<div className="terms-box">
|
|
34
|
+
<input
|
|
35
|
+
maxLength="200"
|
|
36
|
+
id={`${props.id}-searchtext`}
|
|
37
|
+
value={searchText}
|
|
38
|
+
className=""
|
|
39
|
+
placeholder={placeholder}
|
|
40
|
+
enterKeyHint="search"
|
|
41
|
+
onKeyDown={(event) => {
|
|
42
|
+
if (event.key === 'Enter') {
|
|
43
|
+
onTriggerSearch(searchText);
|
|
44
|
+
}
|
|
45
|
+
}}
|
|
46
|
+
onChange={(event) => {
|
|
47
|
+
setSearchText(event.target.value);
|
|
48
|
+
if (isLive) {
|
|
49
|
+
onTriggerSearch(event.target.value);
|
|
50
|
+
}
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
|
|
54
|
+
<div className="terms-box-left">
|
|
55
|
+
<div className="input-controls">
|
|
56
|
+
{searchText && (
|
|
57
|
+
<div className="ui button basic clear-button">
|
|
58
|
+
<SemanticIcon
|
|
59
|
+
tabIndex={0}
|
|
60
|
+
name="close"
|
|
61
|
+
role="button"
|
|
62
|
+
onClick={() => {
|
|
63
|
+
setSearchText('');
|
|
64
|
+
onTriggerSearch('');
|
|
65
|
+
}}
|
|
66
|
+
onKeyDown={(event) => {
|
|
67
|
+
if (event.key === 'Enter') {
|
|
68
|
+
setSearchText('');
|
|
69
|
+
onTriggerSearch('');
|
|
70
|
+
}
|
|
71
|
+
}}
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
)}
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div
|
|
78
|
+
tabIndex={0}
|
|
79
|
+
role="button"
|
|
80
|
+
className="search-icon"
|
|
81
|
+
onClick={() => onTriggerSearch(searchText)}
|
|
82
|
+
onKeyDown={(event) => {
|
|
83
|
+
if (event.key === 'Enter') {
|
|
84
|
+
onTriggerSearch(searchText);
|
|
85
|
+
}
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
<VoltoIcon name={searchSVG} size="29px" />
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
17
96
|
|
|
18
97
|
return (
|
|
19
98
|
<div className="search-input">
|
|
@@ -21,9 +100,7 @@ const SearchInput = (props) => {
|
|
|
21
100
|
maxLength="200"
|
|
22
101
|
id={`${props.id}-searchtext`}
|
|
23
102
|
value={searchText}
|
|
24
|
-
placeholder={
|
|
25
|
-
data.searchInputPrompt || intl.formatMessage(messages.search)
|
|
26
|
-
}
|
|
103
|
+
placeholder={placeholder}
|
|
27
104
|
fluid
|
|
28
105
|
onKeyPress={(event) => {
|
|
29
106
|
if (isLive || event.key === 'Enter') onTriggerSearch(searchText);
|
|
@@ -46,7 +123,7 @@ const SearchInput = (props) => {
|
|
|
46
123
|
onTriggerSearch('');
|
|
47
124
|
}}
|
|
48
125
|
>
|
|
49
|
-
<
|
|
126
|
+
<VoltoIcon name={clearSVG}></VoltoIcon>
|
|
50
127
|
</Button>
|
|
51
128
|
)}
|
|
52
129
|
</div>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="38" height="38" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M37.3757 34.3789L30.2003 27.2246C32.5154 24.2751 33.7716 20.633 33.7669 16.8835C33.7669 13.5442 32.7767 10.28 30.9215 7.50351C29.0663 4.72705 26.4295 2.56305 23.3445 1.28518C20.2594 0.00731515 16.8647 -0.327033 13.5897 0.324418C10.3146 0.97587 7.30625 2.58386 4.94506 4.94506C2.58386 7.30625 0.97587 10.3146 0.324418 13.5897C-0.327033 16.8647 0.00731528 20.2594 1.28518 23.3445C2.56305 26.4295 4.72705 29.0664 7.50351 30.9215C10.28 32.7767 13.5442 33.7669 16.8835 33.7669C20.633 33.7716 24.2751 32.5154 27.2246 30.2003L34.3789 37.3757C34.5751 37.5735 34.8085 37.7306 35.0657 37.8377C35.3229 37.9448 35.5987 38 35.8773 38C36.1559 38 36.4318 37.9448 36.689 37.8377C36.9461 37.7306 37.1795 37.5735 37.3757 37.3757C37.5735 37.1795 37.7305 36.9461 37.8377 36.689C37.9448 36.4318 38 36.1559 38 35.8773C38 35.5987 37.9448 35.3229 37.8377 35.0657C37.7305 34.8085 37.5735 34.5751 37.3757 34.3789ZM4.22087 16.8835C4.22087 14.379 4.96352 11.9309 6.3549 9.8485C7.74628 7.76615 9.72391 6.14315 12.0377 5.18475C14.3515 4.22635 16.8975 3.97559 19.3538 4.46418C21.8101 4.95277 24.0664 6.15876 25.8373 7.92966C27.6081 9.70055 28.8141 11.9568 29.3027 14.4131C29.7913 16.8694 29.5406 19.4154 28.5822 21.7292C27.6238 24.043 26.0008 26.0206 23.9184 27.412C21.8361 28.8034 19.3879 29.546 16.8835 29.546C13.5251 29.546 10.3043 28.2119 7.92966 25.8373C5.55496 23.4626 4.22087 20.2418 4.22087 16.8835Z" />
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const usesGlobalSearchDesign = ({ data, location, path }) => {
|
|
2
|
+
const currentPath = location?.pathname || path || '';
|
|
3
|
+
const normalizedPath = currentPath.replace(/\/$/, '');
|
|
4
|
+
return (
|
|
5
|
+
data?.listingBodyTemplate === 'CclGlobalSearch' ||
|
|
6
|
+
normalizedPath.endsWith('/dataset-catalog')
|
|
7
|
+
);
|
|
8
|
+
};
|
|
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
|
|
|
2
2
|
import { FormattedMessage } from 'react-intl';
|
|
3
3
|
import { useSelector } from 'react-redux';
|
|
4
4
|
import { Link } from 'react-router-dom';
|
|
5
|
-
import { Icon
|
|
5
|
+
import { Icon } from 'semantic-ui-react';
|
|
6
6
|
|
|
7
7
|
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
|
|
8
8
|
import { UniversalLink, Icon as VoltoIcon } from '@plone/volto/components';
|
|
@@ -59,7 +59,7 @@ const CardLink = ({ url, children, className, condition = true }) => {
|
|
|
59
59
|
);
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
const DocCard = ({ card, url, showEditor, children }) => {
|
|
62
|
+
const DocCard = ({ card, url, showEditor, hideSize = false, children }) => {
|
|
63
63
|
return (
|
|
64
64
|
<>
|
|
65
65
|
<div className="card-doc-header">
|
|
@@ -104,7 +104,7 @@ const DocCard = ({ card, url, showEditor, children }) => {
|
|
|
104
104
|
</Link>
|
|
105
105
|
)}
|
|
106
106
|
</div>
|
|
107
|
-
{card?.['@type'] === 'TechnicalLibrary' && (
|
|
107
|
+
{card?.['@type'] === 'TechnicalLibrary' && !hideSize && (
|
|
108
108
|
<div className="card-doc-size">{card.getObjSize || ''}</div>
|
|
109
109
|
)}
|
|
110
110
|
</div>
|
|
@@ -317,16 +317,30 @@ function CclCard(props) {
|
|
|
317
317
|
</>
|
|
318
318
|
)}
|
|
319
319
|
{type === 'globalSearch' && (
|
|
320
|
-
|
|
321
|
-
<
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
320
|
+
<div className="global-search-result-row">
|
|
321
|
+
<div className="global-search-result-main">
|
|
322
|
+
<DocCard
|
|
323
|
+
card={card}
|
|
324
|
+
url={url}
|
|
325
|
+
showEditor={showEditor}
|
|
326
|
+
hideSize
|
|
327
|
+
>
|
|
328
|
+
{children}
|
|
326
329
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
+
<SearchResultExtras content={card} />
|
|
331
|
+
</DocCard>
|
|
332
|
+
</div>
|
|
333
|
+
<div className="global-search-result-side">
|
|
334
|
+
<span className="global-search-result-type">
|
|
335
|
+
{content_type}
|
|
336
|
+
</span>
|
|
337
|
+
{card?.['@type'] === 'TechnicalLibrary' && (
|
|
338
|
+
<span className="global-search-result-size">
|
|
339
|
+
{card.getObjSize || ''}
|
|
340
|
+
</span>
|
|
341
|
+
)}
|
|
342
|
+
</div>
|
|
343
|
+
</div>
|
|
330
344
|
)}
|
|
331
345
|
{(type === 'block' || type === 'threeColumns') && (
|
|
332
346
|
<>
|