From 9a6b25f08b11f463b7d15b3af3a2151aa6b99407 Mon Sep 17 00:00:00 2001 From: wesleybl Date: Thu, 14 Mar 2024 18:28:59 -0300 Subject: [PATCH] Remove use asyncPropExtenders for /controlpanel route when prefixed The problem of not loading properties occurs in more routes, not just in /controlpanel. We need a more generic solution. This reverts part of the commit: https://github.com/plone/volto/pull/3592/commits/3ad97df8467f54d72a1fa1a5c85ce093bef7e3d3 --- packages/volto/src/config/index.js | 44 ------------------------------ 1 file changed, 44 deletions(-) diff --git a/packages/volto/src/config/index.js b/packages/volto/src/config/index.js index 812a5432d5..f819f73131 100644 --- a/packages/volto/src/config/index.js +++ b/packages/volto/src/config/index.js @@ -30,7 +30,6 @@ import { import applyAddonConfiguration, { addonsInfo } from 'load-volto-addons'; import ConfigRegistry from '@plone/volto/registry'; -import { getSystemInformation, listControlpanels } from '@plone/volto/actions'; import { getSiteAsyncPropExtender } from '@plone/volto/helpers'; @@ -48,7 +47,6 @@ const getServerURL = (url) => { apiPathURL.port ? `:${apiPathURL.port}` : '' }`; }; -const prefixPath = process.env.RAZZLE_PREFIX_PATH; // Sensible defaults for publicURL // if RAZZLE_PUBLIC_URL is present, use it @@ -233,48 +231,6 @@ config.settings.apiExpanders = [ }, ]; -if (prefixPath) { - const ControlPanelAsyncPropExtender = { - 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; - }, - }; - config.settings.asyncPropsExtenders = [ - ...(config.settings.asyncPropsExtenders || []), - ControlPanelAsyncPropExtender, - SystemInfoAsyncPropExtender, - ]; -} - ConfigRegistry.settings = config.settings; ConfigRegistry.experimental = config.experimental; ConfigRegistry.blocks = config.blocks;