diff --git a/packages/volto/news/6492.bugfix b/packages/volto/news/6492.bugfix new file mode 100644 index 0000000000..42c9bff724 --- /dev/null +++ b/packages/volto/news/6492.bugfix @@ -0,0 +1 @@ +The Order side panel now renders only when the "Order" tab is active. Previously, the panel would render unnecessarily even when inactive. @Abhishek-17h \ No newline at end of file diff --git a/packages/volto/src/components/manage/Blocks/Block/BlocksForm.jsx b/packages/volto/src/components/manage/Blocks/Block/BlocksForm.jsx index a8fd1e7c05..8e8487eaf1 100644 --- a/packages/volto/src/components/manage/Blocks/Block/BlocksForm.jsx +++ b/packages/volto/src/components/manage/Blocks/Block/BlocksForm.jsx @@ -276,6 +276,7 @@ const BlocksForm = (props) => { <> {isMainForm && isClient && + document.getElementById('sidebar-order') && createPortal(
{ editable, showBlockChooser: selectedBlock === childId, detached: isContainer, - // Properties to pass to the BlocksForm to match the View ones content: properties, history, location, @@ -373,5 +373,4 @@ const BlocksForm = (props) => { ); }; - export default BlocksForm; diff --git a/packages/volto/src/components/manage/Sidebar/Sidebar.jsx b/packages/volto/src/components/manage/Sidebar/Sidebar.jsx index 9e2943b7af..a2fc7cb13c 100644 --- a/packages/volto/src/components/manage/Sidebar/Sidebar.jsx +++ b/packages/volto/src/components/manage/Sidebar/Sidebar.jsx @@ -10,6 +10,7 @@ import BodyClass from '@plone/volto/helpers/BodyClass/BodyClass'; import { getCookieOptions } from '@plone/volto/helpers/Cookies/cookies'; import Icon from '@plone/volto/components/theme/Icon/Icon'; import forbiddenSVG from '@plone/volto/icons/forbidden.svg'; +import loaderSVG from '@plone/volto/icons/loader.svg'; import { setSidebarTab } from '@plone/volto/actions/sidebar/sidebar'; import expandSVG from '@plone/volto/icons/left-key.svg'; import collapseSVG from '@plone/volto/icons/right-key.svg'; @@ -57,6 +58,7 @@ const Sidebar = (props) => { ); const [size] = useState(0); const [showFull, setshowFull] = useState(true); + const [isOrderTabRendered, setIsOrderTabRendered] = useState(false); const tab = useSelector((state) => state.sidebar.tab); const toolbarExpanded = useSelector((state) => state.toolbar.expanded); @@ -101,6 +103,10 @@ const Sidebar = (props) => { const onTabChange = (event, data) => { event.nativeEvent.stopImmediatePropagation(); dispatch(setSidebarTab(data.activeIndex)); + + if (data.activeIndex === 2) { + setIsOrderTabRendered(true); + } }; return ( @@ -186,19 +192,16 @@ const Sidebar = (props) => { }, !!orderTab && { menuItem: intl.formatMessage(messages.order), - pane: ( - - - - ), + pane: + isOrderTabRendered || tab === 2 ? ( + + + + ) : null, }, !!settingsTab && { menuItem: intl.formatMessage(messages.settings), diff --git a/packages/volto/src/components/manage/Sidebar/__snapshots__/Sidebar.test.jsx.snap b/packages/volto/src/components/manage/Sidebar/__snapshots__/Sidebar.test.jsx.snap index 429e9a9d30..f7d1fd2fd9 100644 --- a/packages/volto/src/components/manage/Sidebar/__snapshots__/Sidebar.test.jsx.snap +++ b/packages/volto/src/components/manage/Sidebar/__snapshots__/Sidebar.test.jsx.snap @@ -87,29 +87,6 @@ Array [ xmlns="" />
- ,
+ + + + + + + + + + + + diff --git a/packages/volto/theme/themes/pastanaga/extras/sidebar.less b/packages/volto/theme/themes/pastanaga/extras/sidebar.less index 5931049d89..8e2674a702 100644 --- a/packages/volto/theme/themes/pastanaga/extras/sidebar.less +++ b/packages/volto/theme/themes/pastanaga/extras/sidebar.less @@ -213,6 +213,11 @@ color: #bac5c7; } + .tab-loader { + margin: calc(50% - 24px) auto; + color: #bac5c7; + } + header { display: flex; height: 60px;