volto-searchblocks 0.3.0-alpha.3 → 0.3.0-alpha.7

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.draft CHANGED
@@ -1,7 +1,3 @@
1
- ## 0.3.0-alpha.3 (2026-04-14)
2
-
3
- ### Bugfix
4
-
5
- - Fixed table layout/css. @giulio-red-turtle
1
+ ## 0.3.0-alpha.7 (2026-04-21)
6
2
 
7
3
 
package/.release-it.json CHANGED
@@ -13,7 +13,8 @@
13
13
  "after:release": "rm .changelog.draft README.md"
14
14
  },
15
15
  "npm": {
16
- "publish": false
16
+ "publish": false,
17
+ "versionArgs": ["--workspaces-update=false"]
17
18
  },
18
19
  "plonePrePublish": {
19
20
  "publish": true
package/CHANGELOG.md CHANGED
@@ -8,6 +8,10 @@
8
8
 
9
9
  <!-- towncrier release notes start -->
10
10
 
11
+ ## 0.3.0-alpha.7 (2026-04-21)
12
+
13
+ ## 0.3.0-alpha.6 (2026-04-17)
14
+
11
15
  ## 0.3.0-alpha.3 (2026-04-14)
12
16
 
13
17
  ### Bugfix
@@ -81,3 +81,28 @@ msgstr ""
81
81
  #: components/SearchBlocks/SearchBlocks
82
82
  msgid "Type"
83
83
  msgstr ""
84
+
85
+ #. Default: "Draft"
86
+ #: components/SearchBlocks/SearchBlocks
87
+ msgid "draft"
88
+ msgstr ""
89
+
90
+ #. Default: "Intranet"
91
+ #: components/SearchBlocks/SearchBlocks
92
+ msgid "intranet"
93
+ msgstr ""
94
+
95
+ #. Default: "Pending"
96
+ #: components/SearchBlocks/SearchBlocks
97
+ msgid "pending"
98
+ msgstr ""
99
+
100
+ #. Default: "Private"
101
+ #: components/SearchBlocks/SearchBlocks
102
+ msgid "private"
103
+ msgstr ""
104
+
105
+ #. Default: "Published"
106
+ #: components/SearchBlocks/SearchBlocks
107
+ msgid "published"
108
+ msgstr ""
@@ -81,3 +81,28 @@ msgstr ""
81
81
  #: components/SearchBlocks/SearchBlocks
82
82
  msgid "Type"
83
83
  msgstr ""
84
+
85
+ #. Default: "Draft"
86
+ #: components/SearchBlocks/SearchBlocks
87
+ msgid "draft"
88
+ msgstr ""
89
+
90
+ #. Default: "Intranet"
91
+ #: components/SearchBlocks/SearchBlocks
92
+ msgid "intranet"
93
+ msgstr ""
94
+
95
+ #. Default: "Pending"
96
+ #: components/SearchBlocks/SearchBlocks
97
+ msgid "pending"
98
+ msgstr ""
99
+
100
+ #. Default: "Private"
101
+ #: components/SearchBlocks/SearchBlocks
102
+ msgid "private"
103
+ msgstr ""
104
+
105
+ #. Default: "Published"
106
+ #: components/SearchBlocks/SearchBlocks
107
+ msgid "published"
108
+ msgstr ""
@@ -88,3 +88,28 @@ msgstr ""
88
88
  #: components/SearchBlocks/SearchBlocks
89
89
  msgid "Type"
90
90
  msgstr ""
91
+
92
+ #. Default: "Draft"
93
+ #: components/SearchBlocks/SearchBlocks
94
+ msgid "draft"
95
+ msgstr ""
96
+
97
+ #. Default: "Intranet"
98
+ #: components/SearchBlocks/SearchBlocks
99
+ msgid "intranet"
100
+ msgstr ""
101
+
102
+ #. Default: "Pending"
103
+ #: components/SearchBlocks/SearchBlocks
104
+ msgid "pending"
105
+ msgstr ""
106
+
107
+ #. Default: "Private"
108
+ #: components/SearchBlocks/SearchBlocks
109
+ msgid "private"
110
+ msgstr ""
111
+
112
+ #. Default: "Published"
113
+ #: components/SearchBlocks/SearchBlocks
114
+ msgid "published"
115
+ msgstr ""
@@ -82,3 +82,28 @@ msgstr "Titolo"
82
82
  #: components/SearchBlocks/SearchBlocks
83
83
  msgid "Type"
84
84
  msgstr "Tipo"
85
+
86
+ #. Default: "Draft"
87
+ #: components/SearchBlocks/SearchBlocks
88
+ msgid "draft"
89
+ msgstr "Bozza"
90
+
91
+ #. Default: "Intranet"
92
+ #: components/SearchBlocks/SearchBlocks
93
+ msgid "intranet"
94
+ msgstr "Intranet"
95
+
96
+ #. Default: "Pending"
97
+ #: components/SearchBlocks/SearchBlocks
98
+ msgid "pending"
99
+ msgstr "In attesa"
100
+
101
+ #. Default: "Private"
102
+ #: components/SearchBlocks/SearchBlocks
103
+ msgid "private"
104
+ msgstr "Privato"
105
+
106
+ #. Default: "Published"
107
+ #: components/SearchBlocks/SearchBlocks
108
+ msgid "published"
109
+ msgstr "Pubblicato"
@@ -86,3 +86,28 @@ msgstr ""
86
86
  #: components/SearchBlocks/SearchBlocks
87
87
  msgid "Type"
88
88
  msgstr ""
89
+
90
+ #. Default: "Draft"
91
+ #: components/SearchBlocks/SearchBlocks
92
+ msgid "draft"
93
+ msgstr ""
94
+
95
+ #. Default: "Intranet"
96
+ #: components/SearchBlocks/SearchBlocks
97
+ msgid "intranet"
98
+ msgstr ""
99
+
100
+ #. Default: "Pending"
101
+ #: components/SearchBlocks/SearchBlocks
102
+ msgid "pending"
103
+ msgstr ""
104
+
105
+ #. Default: "Private"
106
+ #: components/SearchBlocks/SearchBlocks
107
+ msgid "private"
108
+ msgstr ""
109
+
110
+ #. Default: "Published"
111
+ #: components/SearchBlocks/SearchBlocks
112
+ msgid "published"
113
+ msgstr ""
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-01-27T12:21:38.702Z\n"
4
+ "POT-Creation-Date: 2026-04-21T10:14:53.092Z\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"
@@ -83,3 +83,28 @@ msgstr ""
83
83
  #: components/SearchBlocks/SearchBlocks
84
84
  msgid "Type"
85
85
  msgstr ""
86
+
87
+ #. Default: "Draft"
88
+ #: components/SearchBlocks/SearchBlocks
89
+ msgid "draft"
90
+ msgstr ""
91
+
92
+ #. Default: "Intranet"
93
+ #: components/SearchBlocks/SearchBlocks
94
+ msgid "intranet"
95
+ msgstr ""
96
+
97
+ #. Default: "Pending"
98
+ #: components/SearchBlocks/SearchBlocks
99
+ msgid "pending"
100
+ msgstr ""
101
+
102
+ #. Default: "Private"
103
+ #: components/SearchBlocks/SearchBlocks
104
+ msgid "private"
105
+ msgstr ""
106
+
107
+ #. Default: "Published"
108
+ #: components/SearchBlocks/SearchBlocks
109
+ msgid "published"
110
+ msgstr ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volto-searchblocks",
3
- "version": "0.3.0-alpha.3",
3
+ "version": "0.3.0-alpha.7",
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",
@@ -3,7 +3,7 @@ import { SEARCH_BLOCKS } from '../constants/ActionTypes';
3
3
  export function searchBlocks(options = {}) {
4
4
  const params = {
5
5
  sort_on: 'sortable_title',
6
- metadata_fields: ['modified', 'created'],
6
+ metadata_fields: ['modified', 'created', 'Type'],
7
7
  };
8
8
 
9
9
  if (options.block_types) {
@@ -15,6 +15,6 @@
15
15
  white-space: nowrap;
16
16
  }
17
17
 
18
- .blocks-search-results .ui.table td:nth-child(n+2) {
18
+ .blocks-search-results .ui.table td:nth-child(n + 2) {
19
19
  white-space: nowrap;
20
20
  }
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
2
2
  import { useDispatch, useSelector } from 'react-redux';
3
3
  import { createPortal } from 'react-dom';
4
4
  import { Link } from 'react-router-dom';
5
- import { Container, Segment, Header, Table } from 'semantic-ui-react';
5
+ import { Container, Segment, Header, Table, Loader } from 'semantic-ui-react';
6
6
  import { Helmet } from '@plone/volto/helpers';
7
7
  import { SelectWidget } from '@plone/volto/components';
8
8
  import Toolbar from '@plone/volto/components/manage/Toolbar/Toolbar';
@@ -74,6 +74,26 @@ const messages = defineMessages({
74
74
  id: 'Back to Control Panel',
75
75
  defaultMessage: 'Back to Control Panel',
76
76
  },
77
+ private: {
78
+ id: 'private',
79
+ defaultMessage: 'Private',
80
+ },
81
+ pending: {
82
+ id: 'pending',
83
+ defaultMessage: 'Pending',
84
+ },
85
+ published: {
86
+ id: 'published',
87
+ defaultMessage: 'Published',
88
+ },
89
+ intranet: {
90
+ id: 'intranet',
91
+ defaultMessage: 'Intranet',
92
+ },
93
+ draft: {
94
+ id: 'draft',
95
+ defaultMessage: 'Draft',
96
+ },
77
97
  });
78
98
 
79
99
  const SearchBlocks = (props) => {
@@ -164,7 +184,12 @@ const SearchBlocks = (props) => {
164
184
  required={false}
165
185
  value={selectedBlockType || ''}
166
186
  onChange={(id, value) => handleSelect(value)}
167
- choices={block_types?.map((type) => [type, type]) || []}
187
+ choices={
188
+ block_types?.map((type) => [
189
+ type,
190
+ config.blocks.blocksConfig[type]?.title || type,
191
+ ]) || []
192
+ }
168
193
  wrapped={false}
169
194
  isClearable={false}
170
195
  />
@@ -174,9 +199,9 @@ const SearchBlocks = (props) => {
174
199
  <Segment>
175
200
  <div className="blocks-search-results">
176
201
  {loading && (
177
- <div className="loader">
202
+ <Loader active inline="centered" size="medium">
178
203
  <FormattedMessage {...messages.loading} />
179
- </div>
204
+ </Loader>
180
205
  )}
181
206
 
182
207
  {!loading && items && items.length > 0 && (
@@ -214,8 +239,14 @@ const SearchBlocks = (props) => {
214
239
  <Table.Cell>
215
240
  <a href={item['@id']}>{item.title}</a>
216
241
  </Table.Cell>
217
- <Table.Cell>{item['@type']}</Table.Cell>
218
- <Table.Cell>{item.review_state}</Table.Cell>
242
+ <Table.Cell>{item['Type'] || item['@type']}</Table.Cell>
243
+ <Table.Cell>
244
+ {item.review_title ||
245
+ (messages[item.review_state]
246
+ ? intl.formatMessage(messages[item.review_state])
247
+ : item.review_state) ||
248
+ '-'}
249
+ </Table.Cell>
219
250
  <Table.Cell>
220
251
  {item.created
221
252
  ? new Date(item.created).toLocaleDateString()
@@ -255,7 +286,9 @@ const SearchBlocks = (props) => {
255
286
  {...messages.noResults}
256
287
  values={{ blockType: selectedBlockType }}
257
288
  />{' '}
258
- {selectedBlockType}.
289
+ {config.blocks.blocksConfig[selectedBlockType]?.title ||
290
+ selectedBlockType}
291
+ .
259
292
  </p>
260
293
  )}
261
294
  </div>
@@ -1,3 +1,4 @@
1
1
  export const SEARCH_BLOCKS = 'SEARCH_BLOCKS';
2
+ export const SEARCH_BLOCKS_PENDING = 'SEARCH_BLOCKS_PENDING';
2
3
  export const SEARCH_BLOCKS_SUCCESS = 'SEARCH_BLOCKS_SUCCESS';
3
4
  export const SEARCH_BLOCKS_FAIL = 'SEARCH_BLOCKS_FAIL';
@@ -1,5 +1,5 @@
1
1
  import {
2
- SEARCH_BLOCKS,
2
+ SEARCH_BLOCKS_PENDING,
3
3
  SEARCH_BLOCKS_SUCCESS,
4
4
  SEARCH_BLOCKS_FAIL,
5
5
  } from '../constants/ActionTypes';
@@ -17,7 +17,7 @@ const initialState = {
17
17
 
18
18
  export default function searchBlocks(state = initialState, action = {}) {
19
19
  switch (action.type) {
20
- case SEARCH_BLOCKS:
20
+ case SEARCH_BLOCKS_PENDING:
21
21
  return {
22
22
  ...state,
23
23
  error: null,