diff --git a/packages/volto/news/6515.bugfix b/packages/volto/news/6515.bugfix new file mode 100644 index 0000000000..c55ab658d9 --- /dev/null +++ b/packages/volto/news/6515.bugfix @@ -0,0 +1 @@ +Fixes ICS download in non-public event content. @sneridagh diff --git a/packages/volto/src/components/theme/EventDetails/EventDetails.jsx b/packages/volto/src/components/theme/EventDetails/EventDetails.jsx index e1ba3dfb89..bbc7964c77 100644 --- a/packages/volto/src/components/theme/EventDetails/EventDetails.jsx +++ b/packages/volto/src/components/theme/EventDetails/EventDetails.jsx @@ -6,7 +6,7 @@ import { Recurrence, } from '@plone/volto/components/theme/View/EventDatesInfo'; import Icon from '@plone/volto/components/theme/Icon/Icon'; -import { expandToBackendURL } from '@plone/volto/helpers/Url/Url'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; import calendarSVG from '@plone/volto/icons/calendar.svg'; @@ -147,7 +147,7 @@ const EventDetails = ({ content, display_as = 'aside' }) => { className="ics-download" target="_blank" rel="noreferrer" - href={`${expandToBackendURL(content['@id'])}/ics_view`} + href={`${flattenToAppURL(content['@id'])}/ics_view`} > {intl.formatMessage(messages.downloadEvent)} diff --git a/packages/volto/src/components/theme/EventDetails/__snapshots__/EventDetails.test.jsx.snap b/packages/volto/src/components/theme/EventDetails/__snapshots__/EventDetails.test.jsx.snap index 1d605e546b..a7fad6aa2f 100644 --- a/packages/volto/src/components/theme/EventDetails/__snapshots__/EventDetails.test.jsx.snap +++ b/packages/volto/src/components/theme/EventDetails/__snapshots__/EventDetails.test.jsx.snap @@ -127,7 +127,7 @@ exports[`renders event details component with all props 1`] = ` /> @@ -169,7 +169,7 @@ exports[`renders event details component with only required props 1`] = ` /> @@ -211,7 +211,7 @@ exports[`renders event details component without links to api in the text 1`] = /> diff --git a/packages/volto/src/components/theme/View/__snapshots__/EventView.test.jsx.snap b/packages/volto/src/components/theme/View/__snapshots__/EventView.test.jsx.snap index acf53acafc..269d255c4b 100644 --- a/packages/volto/src/components/theme/View/__snapshots__/EventView.test.jsx.snap +++ b/packages/volto/src/components/theme/View/__snapshots__/EventView.test.jsx.snap @@ -251,7 +251,7 @@ exports[`renders an event view component with all props 1`] = ` /> @@ -357,7 +357,7 @@ exports[`renders an event view component with only required props 1`] = ` /> @@ -458,7 +458,7 @@ exports[`renders an event view component without links to api in the text 1`] = /> diff --git a/packages/volto/src/express-middleware/files.js b/packages/volto/src/express-middleware/files.js index 40f3f5d71a..547165f201 100644 --- a/packages/volto/src/express-middleware/files.js +++ b/packages/volto/src/express-middleware/files.js @@ -30,7 +30,10 @@ function filesMiddlewareFn(req, res, next) { export default function filesMiddleware() { const middleware = express.Router(); - middleware.all(['**/@@download/*', '**/@@display-file/*'], filesMiddlewareFn); + middleware.all( + ['**/@@download/*', '**/@@display-file/*', '**/ics_view'], + filesMiddlewareFn, + ); middleware.id = 'filesResourcesProcessor'; return middleware; }