From e76a8dbf79aab5cefbade4ad7c268458de7d75a8 Mon Sep 17 00:00:00 2001 From: nileshgulia1 Date: Wed, 20 May 2026 16:46:43 +0200 Subject: [PATCH 1/4] fix(Subpath): dispatch async actions for controlpanels on /controlpanels --- packages/volto/src/config/index.js | 12 +++++- packages/volto/src/helpers/Site/index.js | 49 +++++++++++++++++++++++- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/packages/volto/src/config/index.js b/packages/volto/src/config/index.js index 3fce081f201..b86b572886d 100644 --- a/packages/volto/src/config/index.js +++ b/packages/volto/src/config/index.js @@ -22,7 +22,11 @@ import { installDefaultWidgets } from './Widgets'; import { installDefaultViews } from './Views'; import { installDefaultBlocks } from './Blocks'; -import { getSiteAsyncPropExtender } from '@plone/volto/helpers/Site'; +import { + getSiteAsyncPropExtender, + SystemInfoAsyncPropExtender, + getControlpanelAsyncPropExtender, +} from '@plone/volto/helpers/Site'; import { registerValidators } from './validation'; import languages from '@plone/volto/constants/Languages.cjs'; @@ -124,7 +128,11 @@ let config = { useEmailAsLogin: false, persistentReducers: ['blocksClipboard.cut', 'blocksClipboard.copy'], initialReducersBlacklist: [], // reducers in this list won't be hydrated in windows.__data - asyncPropsExtenders: [getSiteAsyncPropExtender], // per route asyncConnect customizers + asyncPropsExtenders: [ + getSiteAsyncPropExtender, + SystemInfoAsyncPropExtender, + getControlpanelAsyncPropExtender, + ], // per route asyncConnect customizers contentIcons: contentIcons, loadables, lazyBundles: { diff --git a/packages/volto/src/helpers/Site/index.js b/packages/volto/src/helpers/Site/index.js index 18c4b0a2633..4bf60a672b3 100644 --- a/packages/volto/src/helpers/Site/index.js +++ b/packages/volto/src/helpers/Site/index.js @@ -1,5 +1,12 @@ import { GET_SITE } from '@plone/volto/constants/ActionTypes'; import { getSite } from '@plone/volto/actions/site/site'; +import { + listControlpanels, + getSystemInformation, +} from '@plone/volto/actions/controlpanels/controlpanels'; +import config from '@plone/volto/registry'; + +const prefixPath = config.settings.subpathPrefix || ''; const getSiteAsyncPropExtender = { path: '/', @@ -18,4 +25,44 @@ const getSiteAsyncPropExtender = { }, }; -export { getSiteAsyncPropExtender }; +const getControlpanelAsyncPropExtender = { + path: `${prefixPath}/controlpanel`, + extend: (dispatchActions) => { + if ( + dispatchActions.filter( + (asyncAction) => asyncAction.key === 'controlpanels', + ).length === 0 + ) { + dispatchActions.push({ + key: 'controlpanels', + promise: ({ location, store: { dispatch } }) => + __SERVER__ && dispatch(listControlpanels()), + }); + } + return dispatchActions; + }, +}; + +const SystemInfoAsyncPropExtender = { + path: `${prefixPath}/controlpanel`, + extend: (dispatchActions) => { + if ( + dispatchActions.filter( + (asyncAction) => asyncAction.key === 'systemInformation', + ).length === 0 + ) { + dispatchActions.push({ + key: 'systemInformation', + promise: ({ location, store: { dispatch } }) => + __SERVER__ && dispatch(getSystemInformation()), + }); + } + return dispatchActions; + }, +}; + +export { + getSiteAsyncPropExtender, + SystemInfoAsyncPropExtender, + getControlpanelAsyncPropExtender, +}; From c562ebd5b22578ae2c78b39ebcf6a0411f7a2eab Mon Sep 17 00:00:00 2001 From: nileshgulia1 Date: Thu, 21 May 2026 16:36:45 +0200 Subject: [PATCH 2/4] chore: update changelog --- packages/volto/news/8258.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/volto/news/8258.bugfix diff --git a/packages/volto/news/8258.bugfix b/packages/volto/news/8258.bugfix new file mode 100644 index 00000000000..701c56374fe --- /dev/null +++ b/packages/volto/news/8258.bugfix @@ -0,0 +1 @@ +fix(Subpath): dispatch async actions for controlpanels on /controlpanels @nileshgulia1 \ No newline at end of file From a17c944cd4a75222fe1a42d96412c7aa8890e8b3 Mon Sep 17 00:00:00 2001 From: Nilesh Date: Fri, 22 May 2026 14:51:09 +0530 Subject: [PATCH 3/4] Update packages/volto/news/8258.bugfix Co-authored-by: Piero Nicolli --- packages/volto/news/8258.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/volto/news/8258.bugfix b/packages/volto/news/8258.bugfix index 701c56374fe..4890dde7326 100644 --- a/packages/volto/news/8258.bugfix +++ b/packages/volto/news/8258.bugfix @@ -1 +1 @@ -fix(Subpath): dispatch async actions for controlpanels on /controlpanels @nileshgulia1 \ No newline at end of file +Fixed dispatched async actions for controlpanels on /controlpanels in subpath deployments @nileshgulia1 \ No newline at end of file From 2a2755f95a9cb97c8c132f87a581e7b489989666 Mon Sep 17 00:00:00 2001 From: nileshgulia1 Date: Fri, 22 May 2026 11:22:42 +0200 Subject: [PATCH 4/4] refactor: apply naming conventions to variables --- packages/volto/src/config/index.js | 4 ++-- packages/volto/src/helpers/Site/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/volto/src/config/index.js b/packages/volto/src/config/index.js index b86b572886d..73fd4ee07d7 100644 --- a/packages/volto/src/config/index.js +++ b/packages/volto/src/config/index.js @@ -24,7 +24,7 @@ import { installDefaultBlocks } from './Blocks'; import { getSiteAsyncPropExtender, - SystemInfoAsyncPropExtender, + getSystemInfoAsyncPropExtender, getControlpanelAsyncPropExtender, } from '@plone/volto/helpers/Site'; import { registerValidators } from './validation'; @@ -130,7 +130,7 @@ let config = { initialReducersBlacklist: [], // reducers in this list won't be hydrated in windows.__data asyncPropsExtenders: [ getSiteAsyncPropExtender, - SystemInfoAsyncPropExtender, + getSystemInfoAsyncPropExtender, getControlpanelAsyncPropExtender, ], // per route asyncConnect customizers contentIcons: contentIcons, diff --git a/packages/volto/src/helpers/Site/index.js b/packages/volto/src/helpers/Site/index.js index 4bf60a672b3..1eccc4bb4c4 100644 --- a/packages/volto/src/helpers/Site/index.js +++ b/packages/volto/src/helpers/Site/index.js @@ -43,7 +43,7 @@ const getControlpanelAsyncPropExtender = { }, }; -const SystemInfoAsyncPropExtender = { +const getSystemInfoAsyncPropExtender = { path: `${prefixPath}/controlpanel`, extend: (dispatchActions) => { if ( @@ -63,6 +63,6 @@ const SystemInfoAsyncPropExtender = { export { getSiteAsyncPropExtender, - SystemInfoAsyncPropExtender, + getSystemInfoAsyncPropExtender, getControlpanelAsyncPropExtender, };