@plone/volto 16.14.0 → 16.15.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.draft CHANGED
@@ -1,6 +1,24 @@
1
- ## 16.14.0 (2023-03-03)
1
+ ## 16.15.0 (2023-03-08)
2
2
 
3
3
  ### Feature
4
4
 
5
- - Add `Teaser` block @sneridagh [#3706](https://github.com/plone/volto/issues/3706)
5
+ - Improvements to the dev API proxy:
6
+ - Prefer RAZZLE_INTERNAL_API_PATH over RAZZLE_API_PATH as the target of the proxy.
7
+ The target of the API proxy is now always logged on startup, even in production mode.
8
+ - Support proxying to a backend served over https. For this configuration it
9
+ might be necessary to set RAZZLE_DEV_PROXY_INSECURE=1 if the backend
10
+ certificate can't be verified.
11
+
12
+ [davisagli] [#4434](https://github.com/plone/volto/issues/4434)
13
+
14
+ ### Bugfix
15
+
16
+ - fix: newsitem and event views wrapper classNames @nzambello [#4443](https://github.com/plone/volto/issues/4443)
17
+ - Fix weird GHA failure on config option not supported @sneridagh [#4466](https://github.com/plone/volto/issues/4466)
18
+ - Fix history view dropdown for first entry, showing 'Revert to this version option' always @sneridagh [#4471](https://github.com/plone/volto/issues/4471)
19
+ - Fix order of row of long table in edit and view mode @iFlameing [#4473](https://github.com/plone/volto/issues/4473)
20
+
21
+ ### Documentation
22
+
23
+ - Complete teaser docs, add new section in `Blocks`: `Core Blocks developers notes` @sneridagh [#4461](https://github.com/plone/volto/issues/4461)
6
24
 
Binary file
package/CHANGELOG.md CHANGED
@@ -8,6 +8,31 @@
8
8
 
9
9
  <!-- towncrier release notes start -->
10
10
 
11
+ ## 16.15.0 (2023-03-08)
12
+
13
+ ### Feature
14
+
15
+ - Improvements to the dev API proxy:
16
+ - Prefer RAZZLE_INTERNAL_API_PATH over RAZZLE_API_PATH as the target of the proxy.
17
+ The target of the API proxy is now always logged on startup, even in production mode.
18
+ - Support proxying to a backend served over https. For this configuration it
19
+ might be necessary to set RAZZLE_DEV_PROXY_INSECURE=1 if the backend
20
+ certificate can't be verified.
21
+
22
+ [davisagli] [#4434](https://github.com/plone/volto/issues/4434)
23
+
24
+ ### Bugfix
25
+
26
+ - fix: newsitem and event views wrapper classNames @nzambello [#4443](https://github.com/plone/volto/issues/4443)
27
+ - Fix weird GHA failure on config option not supported @sneridagh [#4466](https://github.com/plone/volto/issues/4466)
28
+ - Fix history view dropdown for first entry, showing 'Revert to this version option' always @sneridagh [#4471](https://github.com/plone/volto/issues/4471)
29
+ - Fix order of row of long table in edit and view mode @iFlameing [#4473](https://github.com/plone/volto/issues/4473)
30
+
31
+ ### Documentation
32
+
33
+ - Complete teaser docs, add new section in `Blocks`: `Core Blocks developers notes` @sneridagh [#4461](https://github.com/plone/volto/issues/4461)
34
+
35
+
11
36
  ## 16.14.0 (2023-03-03)
12
37
 
13
38
  ### Feature
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "16.14.0",
12
+ "version": "16.15.0",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git@github.com:plone/volto.git"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plone/volto-slate",
3
- "version": "16.14.0",
3
+ "version": "16.15.0",
4
4
  "description": "Slate.js integration with Volto",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -33,13 +33,13 @@ const View = ({ data }) => {
33
33
  }, [data.table.rows]);
34
34
 
35
35
  const rows = useMemo(() => {
36
- const items = {};
37
- if (!data.table.rows) return {};
36
+ const items = [];
37
+ if (!data.table.rows) return [];
38
38
  data.table.rows.forEach((row, index) => {
39
39
  if (index > 0) {
40
- items[row.key] = [];
40
+ items[index] = [];
41
41
  row.cells.forEach((cell, cellIndex) => {
42
- items[row.key][cellIndex] = {
42
+ items[index][cellIndex] = {
43
43
  ...cell,
44
44
  value:
45
45
  cell.value && Node.string({ children: cell.value }).length > 0
@@ -116,22 +116,37 @@ class History extends Component {
116
116
  this.props.revertHistory(getBaseUrl(this.props.pathname), value);
117
117
  }
118
118
 
119
- /**
120
- * Render method.
121
- * @method render
122
- * @returns {string} Markup for the component.
123
- */
124
- render() {
119
+ processHistoryEntries = () => {
120
+ // Getting the history entries from the props
121
+ // No clue why the reverse(concat()) is necessary
125
122
  const entries = reverse(concat(this.props.entries));
126
123
  let title = entries.length > 0 ? entries[0].state_title : '';
127
124
  for (let x = 1; x < entries.length; x += 1) {
128
125
  entries[x].prev_state_title = title;
129
126
  title = entries[x].state_title || title;
130
127
  }
128
+ // We reverse them again
131
129
  reverse(entries);
130
+
131
+ // We identify the latest 'versioning' entry and mark it
132
+ const current_version = find(entries, (item) => item.type === 'versioning');
133
+ if (current_version) {
134
+ current_version.is_current = true;
135
+ }
136
+ return entries;
137
+ };
138
+
139
+ /**
140
+ * Render method.
141
+ * @method render
142
+ * @returns {string} Markup for the component.
143
+ */
144
+ render() {
132
145
  const historyAction = find(this.props.objectActions, {
133
146
  id: 'history',
134
147
  });
148
+ const entries = this.processHistoryEntries();
149
+
135
150
  return !historyAction ? (
136
151
  <>
137
152
  {this.props.token ? (
@@ -266,18 +281,20 @@ class History extends Component {
266
281
  />
267
282
  </Link>
268
283
  )}
269
- {'version' in entry && (
270
- <Dropdown.Item
271
- value={entry.version}
272
- onClick={this.onRevert}
273
- >
274
- <Icon name="undo" />{' '}
275
- <FormattedMessage
276
- id="Revert to this revision"
277
- defaultMessage="Revert to this revision"
278
- />
279
- </Dropdown.Item>
280
- )}
284
+ {'version' in entry &&
285
+ entry.may_revert &&
286
+ !entry.is_current && (
287
+ <Dropdown.Item
288
+ value={entry.version}
289
+ onClick={this.onRevert}
290
+ >
291
+ <Icon name="undo" />{' '}
292
+ <FormattedMessage
293
+ id="Revert to this revision"
294
+ defaultMessage="Revert to this revision"
295
+ />
296
+ </Dropdown.Item>
297
+ )}
281
298
  </Dropdown.Menu>
282
299
  </Dropdown>
283
300
  )}
@@ -43,7 +43,7 @@ const EventView = (props) => {
43
43
  const { content } = props;
44
44
 
45
45
  return (
46
- <div id="page-document" className="ui container viewwrapper event-view">
46
+ <div id="page-document" className="ui container view-wrapper event-view">
47
47
  <Grid>
48
48
  <Grid.Column width={7} className="mobile hidden">
49
49
  {hasBlocksData(content) ? (
@@ -21,7 +21,7 @@ import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks';
21
21
  */
22
22
  const NewsItemView = ({ content }) =>
23
23
  hasBlocksData(content) ? (
24
- <div id="page-document" className="ui container viewwrapper event-view">
24
+ <div id="page-document" className="ui container view-wrapper newsitem-view">
25
25
  <RenderBlocks content={content} />
26
26
  </div>
27
27
  ) : (
@@ -89,6 +89,7 @@ let config = {
89
89
  // https://6.docs.plone.org/volto/deploying/seamless-mode.html
90
90
  devProxyToApiPath:
91
91
  process.env.RAZZLE_DEV_PROXY_API_PATH ||
92
+ process.env.RAZZLE_INTERNAL_API_PATH ||
92
93
  process.env.RAZZLE_API_PATH ||
93
94
  'http://localhost:8080/Plone', // Set it to '' for disabling the proxy
94
95
  // proxyRewriteTarget Set it for set a custom target for the proxy or overide the internal VHM rewrite
@@ -75,12 +75,14 @@ export default function () {
75
75
  const { apiPathURL, instancePath } = getEnv();
76
76
  const target =
77
77
  config.settings.proxyRewriteTarget ||
78
- `/VirtualHostBase/http/${apiPathURL.hostname}:${apiPathURL.port}${instancePath}/++api++/VirtualHostRoot`;
78
+ `/VirtualHostBase/${apiPathURL.protocol.slice(0, -1)}/${
79
+ apiPathURL.hostname
80
+ }:${apiPathURL.port}${instancePath}/++api++/VirtualHostRoot`;
79
81
 
80
82
  return `${target}${path.replace('/++api++', '')}`;
81
83
  },
82
84
  logLevel: process.env.DEBUG_HPM ? 'debug' : 'silent',
83
- ...(config.settings?.proxyRewriteTarget?.startsWith('https') && {
85
+ ...(process.env.RAZZLE_DEV_PROXY_INSECURE && {
84
86
  changeOrigin: true,
85
87
  secure: false,
86
88
  }),
package/src/server.jsx CHANGED
@@ -329,6 +329,7 @@ export const defaultReadCriticalCss = () => {
329
329
  // Exposed for the console bootstrap info messages
330
330
  server.apiPath = config.settings.apiPath;
331
331
  server.devProxyToApiPath = config.settings.devProxyToApiPath;
332
+ server.proxyRewriteTarget = config.settings.proxyRewriteTarget;
332
333
  server.publicURL = config.settings.publicURL;
333
334
 
334
335
  export default server;
@@ -19,9 +19,11 @@ export default () => {
19
19
  } else {
20
20
  console.log(`API server (API_PATH) is set to: ${app.apiPath}`);
21
21
  }
22
- if (__DEVELOPMENT__ && app.devProxyToApiPath)
22
+ if (app.devProxyToApiPath)
23
23
  console.log(
24
- `Using internal proxy: ${app.publicURL} -> ${app.devProxyToApiPath}`,
24
+ `Proxying API requests from ${app.publicURL}/++api++ to ${
25
+ app.devProxyToApiPath
26
+ }${app.proxyRewriteTarget || ''}`,
25
27
  );
26
28
  console.log(`🎭 Volto started at ${bind_address}:${port} 🚀`);
27
29