Skip to content

Commit

Permalink
Merge branch 'master' into maxage
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Mar 9, 2023
2 parents cdc52b0 + a4766a7 commit f52ec01
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 27 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Expand Up @@ -31,6 +31,31 @@
- Use a universal static path for both documentation and volto repos. @stevepiercy [#4376](https://github.com/plone/volto/issues/4376)


## 16.15.0 (2023-03-08)

### Feature

- Improvements to the dev API proxy:
- Prefer RAZZLE_INTERNAL_API_PATH over RAZZLE_API_PATH as the target of the proxy.
The target of the API proxy is now always logged on startup, even in production mode.
- Support proxying to a backend served over https. For this configuration it
might be necessary to set RAZZLE_DEV_PROXY_INSECURE=1 if the backend
certificate can't be verified.

[davisagli] [#4434](https://github.com/plone/volto/issues/4434)

### Bugfix

- fix: newsitem and event views wrapper classNames @nzambello [#4443](https://github.com/plone/volto/issues/4443)
- Fix weird GHA failure on config option not supported @sneridagh [#4466](https://github.com/plone/volto/issues/4466)
- Fix history view dropdown for first entry, showing 'Revert to this version option' always @sneridagh [#4471](https://github.com/plone/volto/issues/4471)
- Fix order of row of long table in edit and view mode @iFlameing [#4473](https://github.com/plone/volto/issues/4473)

### Documentation

- Complete teaser docs, add new section in `Blocks`: `Core Blocks developers notes` @sneridagh [#4461](https://github.com/plone/volto/issues/4461)


## 16.14.0 (2023-03-03)

### Feature
Expand Down
8 changes: 8 additions & 0 deletions news/4434.feature
@@ -0,0 +1,8 @@
Improvements to the dev API proxy:
- Prefer RAZZLE_INTERNAL_API_PATH over RAZZLE_API_PATH as the target of the proxy.
The target of the API proxy is now always logged on startup, even in production mode.
- Support proxying to a backend served over https. For this configuration it
might be necessary to set RAZZLE_DEV_PROXY_INSECURE=1 if the backend
certificate can't be verified.

[davisagli]
1 change: 1 addition & 0 deletions news/4443.bugfix
@@ -0,0 +1 @@
fix: newsitem and event views wrapper classNames @nzambello
1 change: 1 addition & 0 deletions news/4471.bugfix
@@ -0,0 +1 @@
Fix history view dropdown for first entry, showing 'Revert to this version option' always @sneridagh
53 changes: 35 additions & 18 deletions src/components/manage/History/History.jsx
Expand Up @@ -116,22 +116,37 @@ class History extends Component {
this.props.revertHistory(getBaseUrl(this.props.pathname), value);
}

/**
* Render method.
* @method render
* @returns {string} Markup for the component.
*/
render() {
processHistoryEntries = () => {
// Getting the history entries from the props
// No clue why the reverse(concat()) is necessary
const entries = reverse(concat(this.props.entries));
let title = entries.length > 0 ? entries[0].state_title : '';
for (let x = 1; x < entries.length; x += 1) {
entries[x].prev_state_title = title;
title = entries[x].state_title || title;
}
// We reverse them again
reverse(entries);

// We identify the latest 'versioning' entry and mark it
const current_version = find(entries, (item) => item.type === 'versioning');
if (current_version) {
current_version.is_current = true;
}
return entries;
};

/**
* Render method.
* @method render
* @returns {string} Markup for the component.
*/
render() {
const historyAction = find(this.props.objectActions, {
id: 'history',
});
const entries = this.processHistoryEntries();

return !historyAction ? (
<>
{this.props.token ? (
Expand Down Expand Up @@ -266,18 +281,20 @@ class History extends Component {
/>
</Link>
)}
{'version' in entry && (
<Dropdown.Item
value={entry.version}
onClick={this.onRevert}
>
<Icon name="undo" />{' '}
<FormattedMessage
id="Revert to this revision"
defaultMessage="Revert to this revision"
/>
</Dropdown.Item>
)}
{'version' in entry &&
entry.may_revert &&
!entry.is_current && (
<Dropdown.Item
value={entry.version}
onClick={this.onRevert}
>
<Icon name="undo" />{' '}
<FormattedMessage
id="Revert to this revision"
defaultMessage="Revert to this revision"
/>
</Dropdown.Item>
)}
</Dropdown.Menu>
</Dropdown>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/theme/View/EventView.jsx
Expand Up @@ -43,7 +43,7 @@ const EventView = (props) => {
const { content } = props;

return (
<div id="page-document" className="ui container viewwrapper event-view">
<div id="page-document" className="ui container view-wrapper event-view">
<Grid>
<Grid.Column width={7} className="mobile hidden">
{hasBlocksData(content) ? (
Expand Down
2 changes: 1 addition & 1 deletion src/components/theme/View/NewsItemView.jsx
Expand Up @@ -21,7 +21,7 @@ import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks';
*/
const NewsItemView = ({ content }) =>
hasBlocksData(content) ? (
<div id="page-document" className="ui container viewwrapper event-view">
<div id="page-document" className="ui container view-wrapper newsitem-view">
<RenderBlocks content={content} />
</div>
) : (
Expand Down
Expand Up @@ -2,7 +2,7 @@

exports[`renders an event view component with all props 1`] = `
<div
className="ui container viewwrapper event-view"
className="ui container view-wrapper event-view"
id="page-document"
>
<div
Expand Down Expand Up @@ -287,7 +287,7 @@ exports[`renders an event view component with all props 1`] = `

exports[`renders an event view component with only required props 1`] = `
<div
className="ui container viewwrapper event-view"
className="ui container view-wrapper event-view"
id="page-document"
>
<div
Expand Down Expand Up @@ -381,7 +381,7 @@ exports[`renders an event view component with only required props 1`] = `

exports[`renders an event view component without links to api in the text 1`] = `
<div
className="ui container viewwrapper event-view"
className="ui container view-wrapper event-view"
id="page-document"
>
<div
Expand Down
1 change: 1 addition & 0 deletions src/config/index.js
Expand Up @@ -89,6 +89,7 @@ let config = {
// https://6.docs.plone.org/volto/deploying/seamless-mode.html
devProxyToApiPath:
process.env.RAZZLE_DEV_PROXY_API_PATH ||
process.env.RAZZLE_INTERNAL_API_PATH ||
process.env.RAZZLE_API_PATH ||
'http://localhost:8080/Plone', // Set it to '' for disabling the proxy
// proxyRewriteTarget Set it for set a custom target for the proxy or overide the internal VHM rewrite
Expand Down
6 changes: 4 additions & 2 deletions src/express-middleware/devproxy.js
Expand Up @@ -75,12 +75,14 @@ export default function () {
const { apiPathURL, instancePath } = getEnv();
const target =
config.settings.proxyRewriteTarget ||
`/VirtualHostBase/http/${apiPathURL.hostname}:${apiPathURL.port}${instancePath}/++api++/VirtualHostRoot`;
`/VirtualHostBase/${apiPathURL.protocol.slice(0, -1)}/${
apiPathURL.hostname
}:${apiPathURL.port}${instancePath}/++api++/VirtualHostRoot`;

return `${target}${path.replace('/++api++', '')}`;
},
logLevel: process.env.DEBUG_HPM ? 'debug' : 'silent',
...(config.settings?.proxyRewriteTarget?.startsWith('https') && {
...(process.env.RAZZLE_DEV_PROXY_INSECURE && {
changeOrigin: true,
secure: false,
}),
Expand Down
1 change: 1 addition & 0 deletions src/server.jsx
Expand Up @@ -322,6 +322,7 @@ export const defaultReadCriticalCss = () => {
// Exposed for the console bootstrap info messages
server.apiPath = config.settings.apiPath;
server.devProxyToApiPath = config.settings.devProxyToApiPath;
server.proxyRewriteTarget = config.settings.proxyRewriteTarget;
server.publicURL = config.settings.publicURL;

export default server;
6 changes: 4 additions & 2 deletions src/start-server.js
Expand Up @@ -19,9 +19,11 @@ export default () => {
} else {
console.log(`API server (API_PATH) is set to: ${app.apiPath}`);
}
if (__DEVELOPMENT__ && app.devProxyToApiPath)
if (app.devProxyToApiPath)
console.log(
`Using internal proxy: ${app.publicURL} -> ${app.devProxyToApiPath}`,
`Proxying API requests from ${app.publicURL}/++api++ to ${
app.devProxyToApiPath
}${app.proxyRewriteTarget || ''}`,
);
console.log(`🎭 Volto started at ${bind_address}:${port} 🚀`);

Expand Down

0 comments on commit f52ec01

Please sign in to comment.