volto-searchblocks 0.3.0 → 0.4.0
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 +12 -0
- package/locales/de/LC_MESSAGES/volto.po +10 -6
- package/locales/en/LC_MESSAGES/volto.po +10 -6
- package/locales/es/LC_MESSAGES/volto.po +10 -6
- package/locales/it/LC_MESSAGES/volto.po +10 -6
- package/locales/pt_BR/LC_MESSAGES/volto.po +10 -6
- package/locales/volto.pot +11 -7
- package/package.json +9 -9
- package/src/components/SearchBlocks/SearchBlocks.jsx +18 -12
- package/src/components/manage/toolbar/ToolbarUserMenu.jsx +31 -0
- package/src/index.ts +9 -3
- package/.changelog.draft +0 -3
- package/README.md +0 -201
- package/src/config/settings.ts +0 -26
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,18 @@
|
|
|
8
8
|
|
|
9
9
|
<!-- towncrier release notes start -->
|
|
10
10
|
|
|
11
|
+
## 0.4.0 (2026-10-20)
|
|
12
|
+
|
|
13
|
+
### Bugfix
|
|
14
|
+
|
|
15
|
+
- Show a translated label ("Empty block (placeholder)") for the `empty` block type, the placeholder Volto gives to unfilled cells of container blocks such as the grid, instead of the raw type name. @cekk
|
|
16
|
+
|
|
17
|
+
## 0.3.1 (2026-10-07)
|
|
18
|
+
|
|
19
|
+
### Feature
|
|
20
|
+
|
|
21
|
+
- Reach the search blocks page from the user menu of the toolbar instead of the site control panel, where the "Search blocks" entry is gone. The link is shown only to the users the backend lists the `collective-searchblocks` user action for, and its label is that action's title, so it reads in the site's language. The back button of the page now leads to the site home rather than to the control panel.
|
|
22
|
+
|
|
11
23
|
## 0.3.0 (2026-06-19)
|
|
12
24
|
|
|
13
25
|
## 0.3.0-alpha.7 (2026-04-21)
|
|
@@ -11,11 +11,6 @@ msgstr ""
|
|
|
11
11
|
"Content-Transfer-Encoding: \n"
|
|
12
12
|
"Plural-Forms: \n"
|
|
13
13
|
|
|
14
|
-
#. Default: "Back to Control Panel"
|
|
15
|
-
#: components/SearchBlocks/SearchBlocks
|
|
16
|
-
msgid "Back to Control Panel"
|
|
17
|
-
msgstr ""
|
|
18
|
-
|
|
19
14
|
#. Default: "Block Type"
|
|
20
15
|
#: components/SearchBlocks/SearchBlocks
|
|
21
16
|
msgid "Block Type"
|
|
@@ -31,6 +26,16 @@ msgstr ""
|
|
|
31
26
|
msgid "Created"
|
|
32
27
|
msgstr ""
|
|
33
28
|
|
|
29
|
+
#. Default: "Empty block (placeholder)"
|
|
30
|
+
#: components/SearchBlocks/SearchBlocks
|
|
31
|
+
msgid "Empty block (placeholder)"
|
|
32
|
+
msgstr ""
|
|
33
|
+
|
|
34
|
+
#. Default: "Home"
|
|
35
|
+
#: components/SearchBlocks/SearchBlocks
|
|
36
|
+
msgid "Home"
|
|
37
|
+
msgstr ""
|
|
38
|
+
|
|
34
39
|
#. Default: "Loading..."
|
|
35
40
|
#: components/SearchBlocks/SearchBlocks
|
|
36
41
|
msgid "Loading"
|
|
@@ -63,7 +68,6 @@ msgstr ""
|
|
|
63
68
|
|
|
64
69
|
#. Default: "Search blocks"
|
|
65
70
|
#: components/SearchBlocks/SearchBlocks
|
|
66
|
-
#: config/settings
|
|
67
71
|
msgid "Search blocks"
|
|
68
72
|
msgstr ""
|
|
69
73
|
|
|
@@ -11,11 +11,6 @@ msgstr ""
|
|
|
11
11
|
"Content-Transfer-Encoding: \n"
|
|
12
12
|
"Plural-Forms: \n"
|
|
13
13
|
|
|
14
|
-
#. Default: "Back to Control Panel"
|
|
15
|
-
#: components/SearchBlocks/SearchBlocks
|
|
16
|
-
msgid "Back to Control Panel"
|
|
17
|
-
msgstr ""
|
|
18
|
-
|
|
19
14
|
#. Default: "Block Type"
|
|
20
15
|
#: components/SearchBlocks/SearchBlocks
|
|
21
16
|
msgid "Block Type"
|
|
@@ -31,6 +26,16 @@ msgstr ""
|
|
|
31
26
|
msgid "Created"
|
|
32
27
|
msgstr ""
|
|
33
28
|
|
|
29
|
+
#. Default: "Empty block (placeholder)"
|
|
30
|
+
#: components/SearchBlocks/SearchBlocks
|
|
31
|
+
msgid "Empty block (placeholder)"
|
|
32
|
+
msgstr ""
|
|
33
|
+
|
|
34
|
+
#. Default: "Home"
|
|
35
|
+
#: components/SearchBlocks/SearchBlocks
|
|
36
|
+
msgid "Home"
|
|
37
|
+
msgstr ""
|
|
38
|
+
|
|
34
39
|
#. Default: "Loading..."
|
|
35
40
|
#: components/SearchBlocks/SearchBlocks
|
|
36
41
|
msgid "Loading"
|
|
@@ -63,7 +68,6 @@ msgstr ""
|
|
|
63
68
|
|
|
64
69
|
#. Default: "Search blocks"
|
|
65
70
|
#: components/SearchBlocks/SearchBlocks
|
|
66
|
-
#: config/settings
|
|
67
71
|
msgid "Search blocks"
|
|
68
72
|
msgstr ""
|
|
69
73
|
|
|
@@ -18,11 +18,6 @@ msgstr ""
|
|
|
18
18
|
"X-Is-Fallback-For: es-ar es-bo es-cl es-co es-cr es-do es-ec es-es es-sv es-gt es-hn es-mx es-ni es-pa es-py es-pe es-pr es-us es-uy es-ve\n"
|
|
19
19
|
"X-Generator: Poedit 2.2.1\n"
|
|
20
20
|
|
|
21
|
-
#. Default: "Back to Control Panel"
|
|
22
|
-
#: components/SearchBlocks/SearchBlocks
|
|
23
|
-
msgid "Back to Control Panel"
|
|
24
|
-
msgstr ""
|
|
25
|
-
|
|
26
21
|
#. Default: "Block Type"
|
|
27
22
|
#: components/SearchBlocks/SearchBlocks
|
|
28
23
|
msgid "Block Type"
|
|
@@ -38,6 +33,16 @@ msgstr ""
|
|
|
38
33
|
msgid "Created"
|
|
39
34
|
msgstr ""
|
|
40
35
|
|
|
36
|
+
#. Default: "Empty block (placeholder)"
|
|
37
|
+
#: components/SearchBlocks/SearchBlocks
|
|
38
|
+
msgid "Empty block (placeholder)"
|
|
39
|
+
msgstr ""
|
|
40
|
+
|
|
41
|
+
#. Default: "Home"
|
|
42
|
+
#: components/SearchBlocks/SearchBlocks
|
|
43
|
+
msgid "Home"
|
|
44
|
+
msgstr ""
|
|
45
|
+
|
|
41
46
|
#. Default: "Loading..."
|
|
42
47
|
#: components/SearchBlocks/SearchBlocks
|
|
43
48
|
msgid "Loading"
|
|
@@ -70,7 +75,6 @@ msgstr ""
|
|
|
70
75
|
|
|
71
76
|
#. Default: "Search blocks"
|
|
72
77
|
#: components/SearchBlocks/SearchBlocks
|
|
73
|
-
#: config/settings
|
|
74
78
|
msgid "Search blocks"
|
|
75
79
|
msgstr ""
|
|
76
80
|
|
|
@@ -12,11 +12,6 @@ msgstr ""
|
|
|
12
12
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
13
13
|
"MIME-Version: 1.0\n"
|
|
14
14
|
|
|
15
|
-
#. Default: "Back to Control Panel"
|
|
16
|
-
#: components/SearchBlocks/SearchBlocks
|
|
17
|
-
msgid "Back to Control Panel"
|
|
18
|
-
msgstr "Torna al Pannello di Controllo"
|
|
19
|
-
|
|
20
15
|
#. Default: "Block Type"
|
|
21
16
|
#: components/SearchBlocks/SearchBlocks
|
|
22
17
|
msgid "Block Type"
|
|
@@ -32,6 +27,16 @@ msgstr "Scegli un tipo di blocco"
|
|
|
32
27
|
msgid "Created"
|
|
33
28
|
msgstr "Creato"
|
|
34
29
|
|
|
30
|
+
#. Default: "Empty block (placeholder)"
|
|
31
|
+
#: components/SearchBlocks/SearchBlocks
|
|
32
|
+
msgid "Empty block (placeholder)"
|
|
33
|
+
msgstr "Blocco vuoto (segnaposto)"
|
|
34
|
+
|
|
35
|
+
#. Default: "Home"
|
|
36
|
+
#: components/SearchBlocks/SearchBlocks
|
|
37
|
+
msgid "Home"
|
|
38
|
+
msgstr "Home"
|
|
39
|
+
|
|
35
40
|
#. Default: "Loading..."
|
|
36
41
|
#: components/SearchBlocks/SearchBlocks
|
|
37
42
|
msgid "Loading"
|
|
@@ -64,7 +69,6 @@ msgstr "Stato di Revisione"
|
|
|
64
69
|
|
|
65
70
|
#. Default: "Search blocks"
|
|
66
71
|
#: components/SearchBlocks/SearchBlocks
|
|
67
|
-
#: config/settings
|
|
68
72
|
msgid "Search blocks"
|
|
69
73
|
msgstr "Ricerca blocchi"
|
|
70
74
|
|
|
@@ -16,11 +16,6 @@ msgstr ""
|
|
|
16
16
|
"Preferred-Encodings: utf-8\n"
|
|
17
17
|
"Domain: volto\n"
|
|
18
18
|
|
|
19
|
-
#. Default: "Back to Control Panel"
|
|
20
|
-
#: components/SearchBlocks/SearchBlocks
|
|
21
|
-
msgid "Back to Control Panel"
|
|
22
|
-
msgstr ""
|
|
23
|
-
|
|
24
19
|
#. Default: "Block Type"
|
|
25
20
|
#: components/SearchBlocks/SearchBlocks
|
|
26
21
|
msgid "Block Type"
|
|
@@ -36,6 +31,16 @@ msgstr ""
|
|
|
36
31
|
msgid "Created"
|
|
37
32
|
msgstr ""
|
|
38
33
|
|
|
34
|
+
#. Default: "Empty block (placeholder)"
|
|
35
|
+
#: components/SearchBlocks/SearchBlocks
|
|
36
|
+
msgid "Empty block (placeholder)"
|
|
37
|
+
msgstr ""
|
|
38
|
+
|
|
39
|
+
#. Default: "Home"
|
|
40
|
+
#: components/SearchBlocks/SearchBlocks
|
|
41
|
+
msgid "Home"
|
|
42
|
+
msgstr ""
|
|
43
|
+
|
|
39
44
|
#. Default: "Loading..."
|
|
40
45
|
#: components/SearchBlocks/SearchBlocks
|
|
41
46
|
msgid "Loading"
|
|
@@ -68,7 +73,6 @@ msgstr ""
|
|
|
68
73
|
|
|
69
74
|
#. Default: "Search blocks"
|
|
70
75
|
#: components/SearchBlocks/SearchBlocks
|
|
71
|
-
#: config/settings
|
|
72
76
|
msgid "Search blocks"
|
|
73
77
|
msgstr ""
|
|
74
78
|
|
package/locales/volto.pot
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
msgid ""
|
|
2
2
|
msgstr ""
|
|
3
3
|
"Project-Id-Version: Plone\n"
|
|
4
|
-
"POT-Creation-Date: 2026-
|
|
4
|
+
"POT-Creation-Date: 2026-10-20T09:28:08.400Z\n"
|
|
5
5
|
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
6
6
|
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
7
7
|
"Content-Type: text/plain; charset=utf-8\n"
|
|
@@ -13,11 +13,6 @@ msgstr ""
|
|
|
13
13
|
"Preferred-Encodings: utf-8\n"
|
|
14
14
|
"Domain: volto\n"
|
|
15
15
|
|
|
16
|
-
#. Default: "Back to Control Panel"
|
|
17
|
-
#: components/SearchBlocks/SearchBlocks
|
|
18
|
-
msgid "Back to Control Panel"
|
|
19
|
-
msgstr ""
|
|
20
|
-
|
|
21
16
|
#. Default: "Block Type"
|
|
22
17
|
#: components/SearchBlocks/SearchBlocks
|
|
23
18
|
msgid "Block Type"
|
|
@@ -33,6 +28,16 @@ msgstr ""
|
|
|
33
28
|
msgid "Created"
|
|
34
29
|
msgstr ""
|
|
35
30
|
|
|
31
|
+
#. Default: "Empty block (placeholder)"
|
|
32
|
+
#: components/SearchBlocks/SearchBlocks
|
|
33
|
+
msgid "Empty block (placeholder)"
|
|
34
|
+
msgstr ""
|
|
35
|
+
|
|
36
|
+
#. Default: "Home"
|
|
37
|
+
#: components/SearchBlocks/SearchBlocks
|
|
38
|
+
msgid "Home"
|
|
39
|
+
msgstr ""
|
|
40
|
+
|
|
36
41
|
#. Default: "Loading..."
|
|
37
42
|
#: components/SearchBlocks/SearchBlocks
|
|
38
43
|
msgid "Loading"
|
|
@@ -65,7 +70,6 @@ msgstr ""
|
|
|
65
70
|
|
|
66
71
|
#. Default: "Search blocks"
|
|
67
72
|
#: components/SearchBlocks/SearchBlocks
|
|
68
|
-
#: config/settings
|
|
69
73
|
msgid "Search blocks"
|
|
70
74
|
msgstr ""
|
|
71
75
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "volto-searchblocks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Additional control-panel that allow users to search which contents using a specific block",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,6 +20,13 @@
|
|
|
20
20
|
"access": "public",
|
|
21
21
|
"registry": "https://registry.npmjs.org/"
|
|
22
22
|
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"i18n": "rm -rf build/messages && NODE_ENV=production i18n --addon",
|
|
25
|
+
"dry-release": "release-it --dry-run",
|
|
26
|
+
"release": "release-it",
|
|
27
|
+
"release-major-alpha": "release-it major --preRelease=alpha",
|
|
28
|
+
"release-alpha": "release-it --preRelease=alpha"
|
|
29
|
+
},
|
|
23
30
|
"addons": [],
|
|
24
31
|
"theme": "",
|
|
25
32
|
"peerDependencies": {
|
|
@@ -32,12 +39,5 @@
|
|
|
32
39
|
"release-it": "^19.0.5",
|
|
33
40
|
"typescript": "^5.7.3",
|
|
34
41
|
"@plone/scripts": "^3.10.3"
|
|
35
|
-
},
|
|
36
|
-
"scripts": {
|
|
37
|
-
"i18n": "rm -rf build/messages && NODE_ENV=production i18n --addon",
|
|
38
|
-
"dry-release": "release-it --dry-run",
|
|
39
|
-
"release": "release-it",
|
|
40
|
-
"release-major-alpha": "release-it major --preRelease=alpha",
|
|
41
|
-
"release-alpha": "release-it --preRelease=alpha"
|
|
42
42
|
}
|
|
43
|
-
}
|
|
43
|
+
}
|
|
@@ -70,9 +70,9 @@ const messages = defineMessages({
|
|
|
70
70
|
id: 'No results found for',
|
|
71
71
|
defaultMessage: 'No results found for',
|
|
72
72
|
},
|
|
73
|
-
|
|
74
|
-
id: '
|
|
75
|
-
defaultMessage: '
|
|
73
|
+
backToHome: {
|
|
74
|
+
id: 'Home',
|
|
75
|
+
defaultMessage: 'Home',
|
|
76
76
|
},
|
|
77
77
|
private: {
|
|
78
78
|
id: 'private',
|
|
@@ -94,6 +94,10 @@ const messages = defineMessages({
|
|
|
94
94
|
id: 'draft',
|
|
95
95
|
defaultMessage: 'Draft',
|
|
96
96
|
},
|
|
97
|
+
emptyBlock: {
|
|
98
|
+
id: 'Empty block (placeholder)',
|
|
99
|
+
defaultMessage: 'Empty block (placeholder)',
|
|
100
|
+
},
|
|
97
101
|
});
|
|
98
102
|
|
|
99
103
|
const SearchBlocks = (props) => {
|
|
@@ -125,6 +129,13 @@ const SearchBlocks = (props) => {
|
|
|
125
129
|
return <Error error={error} />;
|
|
126
130
|
}
|
|
127
131
|
|
|
132
|
+
// 'empty' is the placeholder @type Volto gives to unfilled container
|
|
133
|
+
// (e.g. grid) cells: it has no blocksConfig entry, so translate it here.
|
|
134
|
+
const getBlockTitle = (type) =>
|
|
135
|
+
type === 'empty'
|
|
136
|
+
? intl.formatMessage(messages.emptyBlock)
|
|
137
|
+
: config.blocks.blocksConfig[type]?.title || type;
|
|
138
|
+
|
|
128
139
|
const handleSelect = (key) => {
|
|
129
140
|
setSelectedBlockType(key);
|
|
130
141
|
setCurrentPage(0);
|
|
@@ -185,10 +196,7 @@ const SearchBlocks = (props) => {
|
|
|
185
196
|
value={selectedBlockType || ''}
|
|
186
197
|
onChange={(id, value) => handleSelect(value)}
|
|
187
198
|
choices={
|
|
188
|
-
block_types?.map((type) => [
|
|
189
|
-
type,
|
|
190
|
-
config.blocks.blocksConfig[type]?.title || type,
|
|
191
|
-
]) || []
|
|
199
|
+
block_types?.map((type) => [type, getBlockTitle(type)]) || []
|
|
192
200
|
}
|
|
193
201
|
wrapped={false}
|
|
194
202
|
isClearable={false}
|
|
@@ -286,9 +294,7 @@ const SearchBlocks = (props) => {
|
|
|
286
294
|
{...messages.noResults}
|
|
287
295
|
values={{ blockType: selectedBlockType }}
|
|
288
296
|
/>{' '}
|
|
289
|
-
{
|
|
290
|
-
selectedBlockType}
|
|
291
|
-
.
|
|
297
|
+
{getBlockTitle(selectedBlockType)}.
|
|
292
298
|
</p>
|
|
293
299
|
)}
|
|
294
300
|
</div>
|
|
@@ -302,12 +308,12 @@ const SearchBlocks = (props) => {
|
|
|
302
308
|
hideDefaultViewButtons
|
|
303
309
|
inner={
|
|
304
310
|
<>
|
|
305
|
-
<Link to="/
|
|
311
|
+
<Link to="/" className="item">
|
|
306
312
|
<Icon
|
|
307
313
|
name={backSVG}
|
|
308
314
|
className="contents circled"
|
|
309
315
|
size="30px"
|
|
310
|
-
title={intl.formatMessage(messages.
|
|
316
|
+
title={intl.formatMessage(messages.backToHome)}
|
|
311
317
|
/>
|
|
312
318
|
</Link>
|
|
313
319
|
</>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
import { Link } from 'react-router-dom';
|
|
4
|
+
|
|
5
|
+
import { Icon } from '@plone/volto/components';
|
|
6
|
+
import rightArrowSVG from '@plone/volto/icons/right-key.svg';
|
|
7
|
+
import { Plug } from '@plone/volto/components/manage/Pluggable';
|
|
8
|
+
|
|
9
|
+
export const ToolbarUserMenu = () => {
|
|
10
|
+
const searchBlocksAction = useSelector((state) =>
|
|
11
|
+
(state.actions?.actions?.user ?? []).find(
|
|
12
|
+
(action) => action.id === 'collective-searchblocks',
|
|
13
|
+
),
|
|
14
|
+
);
|
|
15
|
+
return searchBlocksAction ? (
|
|
16
|
+
<Plug pluggable="toolbar-user-menu" id="collective-searchblocks-toolbar">
|
|
17
|
+
<li>
|
|
18
|
+
<Link
|
|
19
|
+
to="/controlpanel/search-blocks"
|
|
20
|
+
tabIndex={0}
|
|
21
|
+
className="deleteBlocks"
|
|
22
|
+
id="toolbar-search-blocks"
|
|
23
|
+
>
|
|
24
|
+
{searchBlocksAction.title} <Icon name={rightArrowSVG} size="24px" />
|
|
25
|
+
</Link>
|
|
26
|
+
</li>
|
|
27
|
+
</Plug>
|
|
28
|
+
) : null;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default ToolbarUserMenu;
|
package/src/index.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import type { ConfigType } from '@plone/registry';
|
|
2
|
-
import installSettings from './config/settings';
|
|
3
2
|
|
|
4
3
|
import { searchBlocks } from './actions/searchBlocks';
|
|
5
4
|
import searchBlocksReducer from './reducers/searchBlocks';
|
|
6
5
|
import SearchBlocks from './components/SearchBlocks/SearchBlocks';
|
|
6
|
+
import ToolbarUserMenu from './components/manage/toolbar/ToolbarUserMenu';
|
|
7
7
|
|
|
8
8
|
function applyConfig(config: ConfigType) {
|
|
9
|
-
installSettings(config);
|
|
10
|
-
|
|
11
9
|
config.addonReducers = {
|
|
12
10
|
...config.addonReducers,
|
|
13
11
|
searchBlocks: searchBlocksReducer,
|
|
@@ -20,6 +18,14 @@ function applyConfig(config: ConfigType) {
|
|
|
20
18
|
component: SearchBlocks,
|
|
21
19
|
},
|
|
22
20
|
];
|
|
21
|
+
config.settings.appExtras = [
|
|
22
|
+
...config.settings.appExtras,
|
|
23
|
+
{
|
|
24
|
+
match: '',
|
|
25
|
+
component: ToolbarUserMenu,
|
|
26
|
+
props: {},
|
|
27
|
+
},
|
|
28
|
+
];
|
|
23
29
|
|
|
24
30
|
return config;
|
|
25
31
|
}
|
package/.changelog.draft
DELETED
package/README.md
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
# Search blocks (volto-searchblocks)
|
|
2
|
-
|
|
3
|
-
A Volto add-on that provides a control panel for searching and managing content that uses specific blocks.
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/volto-searchblocks)
|
|
6
|
-
[](https://collective.github.io/volto-searchblocks/)
|
|
7
|
-
[](https://github.com/collective/collective-searchblocks/actions/workflows/main.yml)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## Features ✨
|
|
11
|
-
|
|
12
|
-
- **Search Blocks Control Panel**: Dedicated control panel view for searching content by block types
|
|
13
|
-
- **Table Display**: Results displayed in a sortable table with key metadata
|
|
14
|
-
- **Pagination**: Navigate through results with configurable page sizes (default, 50, or all)
|
|
15
|
-
- **Block Type Selection**: Dropdown selector for choosing which block type to search for
|
|
16
|
-
- **Multilingual Support**: Full i18n support with Italian translation included
|
|
17
|
-
- **Error Handling**: Comprehensive error displays for API failures
|
|
18
|
-
- **Semantic UI Integration**: Uses Volto's standard Semantic UI components for consistent styling
|
|
19
|
-
|
|
20
|
-
## Installation
|
|
21
|
-
|
|
22
|
-
To install your project, you must choose the method appropriate to your version of Volto.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
### Volto 18 and later
|
|
26
|
-
|
|
27
|
-
Add `volto-searchblocks` to your `package.json`.
|
|
28
|
-
|
|
29
|
-
```json
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"volto-searchblocks": "*"
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Add `volto-searchblocks` to your `volto.config.js`.
|
|
36
|
-
|
|
37
|
-
```javascript
|
|
38
|
-
const addons = ['volto-searchblocks'];
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
If this package provides a Volto theme, and you want to activate it, then add the following to your `volto.config.js`.
|
|
42
|
-
|
|
43
|
-
```javascript
|
|
44
|
-
const theme = 'volto-searchblocks';
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Volto 17 and earlier
|
|
48
|
-
|
|
49
|
-
Create a new Volto project.
|
|
50
|
-
You can skip this step if you already have one.
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
npm install -g yo @plone/generator-volto
|
|
54
|
-
yo @plone/volto my-volto-project --addon volto-searchblocks
|
|
55
|
-
cd my-volto-project
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Add `volto-searchblocks` to your `package.json`.
|
|
59
|
-
|
|
60
|
-
```JSON
|
|
61
|
-
"addons": [
|
|
62
|
-
"volto-searchblocks"
|
|
63
|
-
],
|
|
64
|
-
|
|
65
|
-
"dependencies": {
|
|
66
|
-
"volto-searchblocks": "*"
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Download and install the new add-on.
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
yarn install
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Start Volto.
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
yarn start
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Test installation
|
|
83
|
-
|
|
84
|
-
Visit http://localhost:3000/ in a browser, login, and check the awesome new features.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
## Development
|
|
88
|
-
|
|
89
|
-
The development of this add-on is done in isolation using pnpm workspaces, the latest `mrs-developer`, and other Volto core improvements.
|
|
90
|
-
For these reasons, it only works with pnpm and Volto 18.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
### Prerequisites ✅
|
|
94
|
-
|
|
95
|
-
- An [operating system](https://6.docs.plone.org/install/create-project-cookieplone.html#prerequisites-for-installation) that runs all the requirements mentioned.
|
|
96
|
-
- [nvm](https://6.docs.plone.org/install/create-project-cookieplone.html#nvm)
|
|
97
|
-
- [Node.js and pnpm](https://6.docs.plone.org/install/create-project.html#node-js) 22
|
|
98
|
-
- [Make](https://6.docs.plone.org/install/create-project-cookieplone.html#make)
|
|
99
|
-
- [Git](https://6.docs.plone.org/install/create-project-cookieplone.html#git)
|
|
100
|
-
- [Docker](https://docs.docker.com/get-started/get-docker/) (optional)
|
|
101
|
-
|
|
102
|
-
### Installation 🔧
|
|
103
|
-
|
|
104
|
-
1. Clone this repository, then change your working directory.
|
|
105
|
-
|
|
106
|
-
```shell
|
|
107
|
-
git clone git@github.com:collective/collective-searchblocks.git
|
|
108
|
-
cd collective-searchblocks/frontend
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
2. Install this code base.
|
|
112
|
-
|
|
113
|
-
```shell
|
|
114
|
-
make install
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
### Make convenience commands
|
|
119
|
-
|
|
120
|
-
Run `make help` to list the available Make commands.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
### Set up development environment
|
|
124
|
-
|
|
125
|
-
Install package requirements.
|
|
126
|
-
|
|
127
|
-
```shell
|
|
128
|
-
make install
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### Start developing
|
|
132
|
-
|
|
133
|
-
Start the backend.
|
|
134
|
-
|
|
135
|
-
```shell
|
|
136
|
-
make backend-docker-start
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
In a separate terminal session, start the frontend.
|
|
140
|
-
|
|
141
|
-
```shell
|
|
142
|
-
make start
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Lint code
|
|
146
|
-
|
|
147
|
-
Run ESlint, Prettier, and Stylelint in analyze mode.
|
|
148
|
-
|
|
149
|
-
```shell
|
|
150
|
-
make lint
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
### Format code
|
|
154
|
-
|
|
155
|
-
Run ESlint, Prettier, and Stylelint in fix mode.
|
|
156
|
-
|
|
157
|
-
```shell
|
|
158
|
-
make format
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### i18n
|
|
162
|
-
|
|
163
|
-
Extract the i18n messages to locales.
|
|
164
|
-
|
|
165
|
-
```shell
|
|
166
|
-
make i18n
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Unit tests
|
|
170
|
-
|
|
171
|
-
Run unit tests.
|
|
172
|
-
|
|
173
|
-
```shell
|
|
174
|
-
make test
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
### Run Cypress tests
|
|
178
|
-
|
|
179
|
-
Run each of these steps in separate terminal sessions.
|
|
180
|
-
|
|
181
|
-
In the first session, start the frontend in development mode.
|
|
182
|
-
|
|
183
|
-
```shell
|
|
184
|
-
make acceptance-frontend-dev-start
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
In the second session, start the backend acceptance server.
|
|
188
|
-
|
|
189
|
-
```shell
|
|
190
|
-
make acceptance-backend-start
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
In the third session, start the Cypress interactive test runner.
|
|
194
|
-
|
|
195
|
-
```shell
|
|
196
|
-
make acceptance-test
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
## License
|
|
200
|
-
|
|
201
|
-
The project is licensed under the MIT license.
|
package/src/config/settings.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ConfigType } from '@plone/registry';
|
|
2
|
-
import { defineMessages } from 'react-intl';
|
|
3
|
-
import cardsSVG from '@plone/volto/icons/cards.svg';
|
|
4
|
-
|
|
5
|
-
const messages = defineMessages({
|
|
6
|
-
controlPanelTitle: {
|
|
7
|
-
id: 'Search blocks',
|
|
8
|
-
defaultMessage: 'Search blocks',
|
|
9
|
-
},
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export default function install(config: ConfigType) {
|
|
13
|
-
config.settings.controlpanels = [
|
|
14
|
-
...config.settings.controlpanels,
|
|
15
|
-
{
|
|
16
|
-
'@id': '/search-blocks',
|
|
17
|
-
group: 'General',
|
|
18
|
-
title: messages.controlPanelTitle.defaultMessage,
|
|
19
|
-
},
|
|
20
|
-
];
|
|
21
|
-
config.settings.controlPanelsIcons = {
|
|
22
|
-
...config.settings.controlPanelsIcons,
|
|
23
|
-
'blocks-search': cardsSVG,
|
|
24
|
-
};
|
|
25
|
-
return config;
|
|
26
|
-
}
|