@plone/volto 16.14.0 → 16.16.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 +2 -2
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +32 -2
- package/package.json +1 -1
- package/packages/volto-slate/package.json +1 -1
- package/packages/volto-slate/src/blocks/Table/TableBlockView.jsx +4 -4
- package/src/components/manage/History/History.jsx +35 -18
- package/src/components/theme/View/EventView.jsx +1 -1
- package/src/components/theme/View/NewsItemView.jsx +1 -1
- package/src/config/index.js +1 -0
- package/src/config/server.js +19 -0
- package/src/express-middleware/devproxy.js +4 -2
- package/src/express-middleware/static.js +32 -0
- package/src/server.jsx +1 -7
- package/src/start-server.js +4 -2
package/.changelog.draft
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
## 16.
|
|
1
|
+
## 16.16.0 (2023-03-09)
|
|
2
2
|
|
|
3
3
|
### Feature
|
|
4
4
|
|
|
5
|
-
- Add
|
|
5
|
+
- - Add directive to cache stable resources in browser or intermediate server for 365 days by default directly in the SSR Express server, static resource that could change after a new deployment for 1 minute. @mamico [#2216](https://github.com/plone/volto/issues/2216)
|
|
6
6
|
|
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,38 @@
|
|
|
8
8
|
|
|
9
9
|
<!-- towncrier release notes start -->
|
|
10
10
|
|
|
11
|
+
## 16.16.0 (2023-03-09)
|
|
12
|
+
|
|
13
|
+
### Feature
|
|
14
|
+
|
|
15
|
+
- - Add directive to cache stable resources in browser or intermediate server for 365 days by default directly in the SSR Express server, static resource that could change after a new deployment for 1 minute. @mamico [#2216](https://github.com/plone/volto/issues/2216)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 16.15.0 (2023-03-08)
|
|
19
|
+
|
|
20
|
+
### Feature
|
|
21
|
+
|
|
22
|
+
- Improvements to the dev API proxy:
|
|
23
|
+
- Prefer RAZZLE_INTERNAL_API_PATH over RAZZLE_API_PATH as the target of the proxy.
|
|
24
|
+
The target of the API proxy is now always logged on startup, even in production mode.
|
|
25
|
+
- Support proxying to a backend served over https. For this configuration it
|
|
26
|
+
might be necessary to set RAZZLE_DEV_PROXY_INSECURE=1 if the backend
|
|
27
|
+
certificate can't be verified.
|
|
28
|
+
|
|
29
|
+
[davisagli] [#4434](https://github.com/plone/volto/issues/4434)
|
|
30
|
+
|
|
31
|
+
### Bugfix
|
|
32
|
+
|
|
33
|
+
- fix: newsitem and event views wrapper classNames @nzambello [#4443](https://github.com/plone/volto/issues/4443)
|
|
34
|
+
- Fix weird GHA failure on config option not supported @sneridagh [#4466](https://github.com/plone/volto/issues/4466)
|
|
35
|
+
- Fix history view dropdown for first entry, showing 'Revert to this version option' always @sneridagh [#4471](https://github.com/plone/volto/issues/4471)
|
|
36
|
+
- Fix order of row of long table in edit and view mode @iFlameing [#4473](https://github.com/plone/volto/issues/4473)
|
|
37
|
+
|
|
38
|
+
### Documentation
|
|
39
|
+
|
|
40
|
+
- Complete teaser docs, add new section in `Blocks`: `Core Blocks developers notes` @sneridagh [#4461](https://github.com/plone/volto/issues/4461)
|
|
41
|
+
|
|
42
|
+
|
|
11
43
|
## 16.14.0 (2023-03-03)
|
|
12
44
|
|
|
13
45
|
### Feature
|
|
@@ -1062,8 +1094,6 @@ See https://6.dev-docs.plone.org/volto/upgrade-guide/index.html for more informa
|
|
|
1062
1094
|
|
|
1063
1095
|
## 16.0.0-alpha.34 (2022-09-17)
|
|
1064
1096
|
|
|
1065
|
-
### Breaking
|
|
1066
|
-
|
|
1067
1097
|
### Feature
|
|
1068
1098
|
|
|
1069
1099
|
- Added new components `Aliases` for aliases control in Volto. Alias management in both controlpanel and object view. @andreiggr @avoinea
|
package/package.json
CHANGED
|
@@ -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[
|
|
40
|
+
items[index] = [];
|
|
41
41
|
row.cells.forEach((cell, cellIndex) => {
|
|
42
|
-
items[
|
|
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
|
-
|
|
121
|
-
|
|
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
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
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
|
|
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
|
|
24
|
+
<div id="page-document" className="ui container view-wrapper newsitem-view">
|
|
25
25
|
<RenderBlocks content={content} />
|
|
26
26
|
</div>
|
|
27
27
|
) : (
|
package/src/config/index.js
CHANGED
|
@@ -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
|
package/src/config/server.js
CHANGED
|
@@ -2,6 +2,7 @@ import imagesMiddleware from '@plone/volto/express-middleware/images';
|
|
|
2
2
|
import filesMiddleware from '@plone/volto/express-middleware/files';
|
|
3
3
|
import robotstxtMiddleware from '@plone/volto/express-middleware/robotstxt';
|
|
4
4
|
import sitemapMiddleware from '@plone/volto/express-middleware/sitemap';
|
|
5
|
+
import staticsMiddleware from '@plone/volto/express-middleware/static';
|
|
5
6
|
import devProxyMiddleware from '@plone/volto/express-middleware/devproxy';
|
|
6
7
|
|
|
7
8
|
const settings = {
|
|
@@ -11,10 +12,28 @@ const settings = {
|
|
|
11
12
|
imagesMiddleware(),
|
|
12
13
|
robotstxtMiddleware(),
|
|
13
14
|
sitemapMiddleware(),
|
|
15
|
+
staticsMiddleware(),
|
|
14
16
|
],
|
|
15
17
|
criticalCssPath: 'public/critical.css',
|
|
16
18
|
readCriticalCss: null, // so it will be defaultReadCriticalCss
|
|
17
19
|
extractScripts: { errorPages: false },
|
|
20
|
+
staticFiles: [
|
|
21
|
+
{
|
|
22
|
+
id: 'root_static',
|
|
23
|
+
match: /^\/static\/.*/,
|
|
24
|
+
headers: {
|
|
25
|
+
// stable resources never change. 31536000 seconds == 365 days
|
|
26
|
+
'Cache-Control': 'public, max-age=31536000',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'all',
|
|
31
|
+
match: /.*/,
|
|
32
|
+
headers: {
|
|
33
|
+
'Cache-Control': 'public, max-age=60',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
],
|
|
18
37
|
};
|
|
19
38
|
|
|
20
39
|
export default settings;
|
|
@@ -75,12 +75,14 @@ export default function () {
|
|
|
75
75
|
const { apiPathURL, instancePath } = getEnv();
|
|
76
76
|
const target =
|
|
77
77
|
config.settings.proxyRewriteTarget ||
|
|
78
|
-
`/VirtualHostBase
|
|
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
|
-
...(
|
|
85
|
+
...(process.env.RAZZLE_DEV_PROXY_INSECURE && {
|
|
84
86
|
changeOrigin: true,
|
|
85
87
|
secure: false,
|
|
86
88
|
}),
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import config from '@plone/volto/registry';
|
|
4
|
+
|
|
5
|
+
const staticMiddleware = express.static(
|
|
6
|
+
process.env.BUILD_DIR
|
|
7
|
+
? path.join(process.env.BUILD_DIR, 'public')
|
|
8
|
+
: process.env.RAZZLE_PUBLIC_DIR,
|
|
9
|
+
{
|
|
10
|
+
setHeaders: function (res, path) {
|
|
11
|
+
const pathLib = require('path');
|
|
12
|
+
const base = pathLib.resolve(process.env.RAZZLE_PUBLIC_DIR);
|
|
13
|
+
const relpath = path.substr(base.length);
|
|
14
|
+
config.settings.serverConfig.staticFiles.some((elem) => {
|
|
15
|
+
if (relpath.match(elem.match)) {
|
|
16
|
+
for (const name in elem.headers) {
|
|
17
|
+
res.setHeader(name, elem.headers[name] || 'undefined');
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
return false;
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export default function () {
|
|
28
|
+
const middleware = express.Router();
|
|
29
|
+
middleware.all('*', staticMiddleware);
|
|
30
|
+
middleware.id = 'staticResourcesProcessor';
|
|
31
|
+
return middleware;
|
|
32
|
+
}
|
package/src/server.jsx
CHANGED
|
@@ -59,13 +59,6 @@ const supported = new locale.Locales(keys(languages), 'en');
|
|
|
59
59
|
|
|
60
60
|
const server = express()
|
|
61
61
|
.disable('x-powered-by')
|
|
62
|
-
.use(
|
|
63
|
-
express.static(
|
|
64
|
-
process.env.BUILD_DIR
|
|
65
|
-
? path.join(process.env.BUILD_DIR, 'public')
|
|
66
|
-
: process.env.RAZZLE_PUBLIC_DIR,
|
|
67
|
-
),
|
|
68
|
-
)
|
|
69
62
|
.head('/*', function (req, res) {
|
|
70
63
|
// Support for HEAD requests. Required by start-test utility in CI.
|
|
71
64
|
res.send('');
|
|
@@ -329,6 +322,7 @@ export const defaultReadCriticalCss = () => {
|
|
|
329
322
|
// Exposed for the console bootstrap info messages
|
|
330
323
|
server.apiPath = config.settings.apiPath;
|
|
331
324
|
server.devProxyToApiPath = config.settings.devProxyToApiPath;
|
|
325
|
+
server.proxyRewriteTarget = config.settings.proxyRewriteTarget;
|
|
332
326
|
server.publicURL = config.settings.publicURL;
|
|
333
327
|
|
|
334
328
|
export default server;
|
package/src/start-server.js
CHANGED
|
@@ -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 (
|
|
22
|
+
if (app.devProxyToApiPath)
|
|
23
23
|
console.log(
|
|
24
|
-
`
|
|
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
|
|