diff --git a/backend/src/workflow/manager/api/services/workflow/transition.py b/backend/src/workflow/manager/api/services/workflow/transition.py index e73af89..2e7cb84 100644 --- a/backend/src/workflow/manager/api/services/workflow/transition.py +++ b/backend/src/workflow/manager/api/services/workflow/transition.py @@ -1,5 +1,6 @@ import json from Products.DCWorkflow.Transitions import TRIGGER_AUTOMATIC, TRIGGER_USER_ACTION +from Products.DCWorkflow.Expression import Expression from plone.protect.interfaces import IDisableCSRFProtection from plone.restapi.deserializer import json_body from plone.restapi.services import Service @@ -279,13 +280,21 @@ def reply(self): guard = transition.getGuard() guard_data = body['guard'] if 'permissions' in guard_data: - guard.permissions = tuple(guard_data['permissions']) + guard.permissions = tuple( + Expression('string:%s' % p) for p in guard_data['permissions'] + ) if 'roles' in guard_data: - guard.roles = tuple(guard_data['roles']) + guard.roles = tuple( + Expression('string:%s' % r) for r in guard_data['roles'] + ) if 'groups' in guard_data: - guard.groups = tuple(guard_data['groups']) - if 'expr' in guard_data: - guard.expr = guard_data['expr'] + guard.groups = tuple( + Expression('string:%s' % g) for g in guard_data['groups'] + ) + if 'expr' in guard_data and guard_data['expr']: + guard.expr = Expression(guard_data['expr']) + else: + guard.expr = Expression('') transition.guard = guard if 'states_with_this_transition' in body: diff --git a/backend/src/workflow/manager/api/services/workflow/workflow.py b/backend/src/workflow/manager/api/services/workflow/workflow.py index 02e7f27..f6bdcf0 100644 --- a/backend/src/workflow/manager/api/services/workflow/workflow.py +++ b/backend/src/workflow/manager/api/services/workflow/workflow.py @@ -150,7 +150,8 @@ def reply(self): self.request.response.setStatus(404) return {"error": f"Workflow '{workflow_id}' not found."} - assigned_types = base.get_assigned_types_for(workflow_id) + # Safety Check: Prevent deletion if workflow is in use. + assigned_types = base._get_assigned_types_for(workflow_id) if assigned_types: self.request.response.setStatus(400) return {"error": f"Cannot delete workflow. It is still assigned to: {', '.join(assigned_types)}"} diff --git a/frontend/packages/volto-workflow-manager/locales/de/LC_MESSAGES/volto.po b/frontend/packages/volto-workflow-manager/locales/de/LC_MESSAGES/volto.po index 504b27b..40ff3ae 100644 --- a/frontend/packages/volto-workflow-manager/locales/de/LC_MESSAGES/volto.po +++ b/frontend/packages/volto-workflow-manager/locales/de/LC_MESSAGES/volto.po @@ -11,11 +11,36 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. Default: "Assign" +#: components/Workflow/AssignWorkflow +msgid "Assign" +msgstr "" + +#. Default: "Assign Workflow" +#: components/Workflow/AssignWorkflow +msgid "Assign Workflow" +msgstr "" + +#. Default: "Assigning..." +#: components/Workflow/AssignWorkflow +msgid "Assigning..." +msgstr "" + +#. Default: "Assignment Failed" +#: components/Workflow/AssignWorkflow +msgid "Assignment Failed" +msgstr "" + #. Default: "Block" #: components/Workflow/WorkflowSidebar msgid "Block" msgstr "" +#. Default: "Cancel" +#: components/Workflow/AssignWorkflow +msgid "Cancel" +msgstr "" + #. Default: "Document" #: components/Workflow/WorkflowSidebar msgid "Document" @@ -31,6 +56,16 @@ msgstr "" msgid "Expand sidebar" msgstr "" +#. Default: "Failed to delete workflow." +#: components/Controlpanel/WorkflowTable +msgid "Failed to delete workflow." +msgstr "" + +#. Default: "Failed to rename workflow." +#: components/Controlpanel/WorkflowTable +msgid "Failed to rename workflow." +msgstr "" + #. Default: "No errors found in the workflow." #: components/Workflow/ActionsToolbar msgid "No errors found in the workflow." @@ -41,6 +76,16 @@ msgstr "" msgid "Order" msgstr "" +#. Default: "Select a content type..." +#: components/Workflow/AssignWorkflow +msgid "Select a content type..." +msgstr "" + +#. Default: "Select the content type you would like to assign this workflow to." +#: components/Workflow/AssignWorkflow +msgid "Select the content type you would like to assign this workflow to." +msgstr "" + #. Default: "Settings" #: components/Workflow/WorkflowSidebar msgid "Settings" @@ -76,6 +121,11 @@ msgstr "" msgid "The new transition has been added successfully." msgstr "" +#. Default: "The workflow has been assigned successfully." +#: components/Workflow/AssignWorkflow +msgid "The workflow has been assigned successfully." +msgstr "" + #. Default: "Transition Created" #: components/Transitions/CreateTransition msgid "Transition Created" @@ -105,3 +155,23 @@ msgstr "" #: components/Workflow/WorkflowSidebar msgid "Workflow" msgstr "" + +#. Default: "Workflow Assigned" +#: components/Workflow/AssignWorkflow +msgid "Workflow Assigned" +msgstr "" + +#. Default: "Workflow Manager" +#: components/Controlpanel/WorkflowPanel +msgid "Workflow Manager" +msgstr "" + +#. Default: "Workflow deleted successfully." +#: components/Controlpanel/WorkflowTable +msgid "Workflow deleted successfully." +msgstr "" + +#. Default: "Workflow renamed successfully." +#: components/Controlpanel/WorkflowTable +msgid "Workflow renamed successfully." +msgstr "" diff --git a/frontend/packages/volto-workflow-manager/locales/en/LC_MESSAGES/volto.po b/frontend/packages/volto-workflow-manager/locales/en/LC_MESSAGES/volto.po index 85ece95..5e3fa43 100644 --- a/frontend/packages/volto-workflow-manager/locales/en/LC_MESSAGES/volto.po +++ b/frontend/packages/volto-workflow-manager/locales/en/LC_MESSAGES/volto.po @@ -11,11 +11,36 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. Default: "Assign" +#: components/Workflow/AssignWorkflow +msgid "Assign" +msgstr "" + +#. Default: "Assign Workflow" +#: components/Workflow/AssignWorkflow +msgid "Assign Workflow" +msgstr "" + +#. Default: "Assigning..." +#: components/Workflow/AssignWorkflow +msgid "Assigning..." +msgstr "" + +#. Default: "Assignment Failed" +#: components/Workflow/AssignWorkflow +msgid "Assignment Failed" +msgstr "" + #. Default: "Block" #: components/Workflow/WorkflowSidebar msgid "Block" msgstr "" +#. Default: "Cancel" +#: components/Workflow/AssignWorkflow +msgid "Cancel" +msgstr "" + #. Default: "Document" #: components/Workflow/WorkflowSidebar msgid "Document" @@ -31,6 +56,16 @@ msgstr "" msgid "Expand sidebar" msgstr "" +#. Default: "Failed to delete workflow." +#: components/Controlpanel/WorkflowTable +msgid "Failed to delete workflow." +msgstr "" + +#. Default: "Failed to rename workflow." +#: components/Controlpanel/WorkflowTable +msgid "Failed to rename workflow." +msgstr "" + #. Default: "No errors found in the workflow." #: components/Workflow/ActionsToolbar msgid "No errors found in the workflow." @@ -41,6 +76,16 @@ msgstr "" msgid "Order" msgstr "" +#. Default: "Select a content type..." +#: components/Workflow/AssignWorkflow +msgid "Select a content type..." +msgstr "" + +#. Default: "Select the content type you would like to assign this workflow to." +#: components/Workflow/AssignWorkflow +msgid "Select the content type you would like to assign this workflow to." +msgstr "" + #. Default: "Settings" #: components/Workflow/WorkflowSidebar msgid "Settings" @@ -76,6 +121,11 @@ msgstr "" msgid "The new transition has been added successfully." msgstr "" +#. Default: "The workflow has been assigned successfully." +#: components/Workflow/AssignWorkflow +msgid "The workflow has been assigned successfully." +msgstr "" + #. Default: "Transition Created" #: components/Transitions/CreateTransition msgid "Transition Created" @@ -105,3 +155,23 @@ msgstr "" #: components/Workflow/WorkflowSidebar msgid "Workflow" msgstr "" + +#. Default: "Workflow Assigned" +#: components/Workflow/AssignWorkflow +msgid "Workflow Assigned" +msgstr "" + +#. Default: "Workflow Manager" +#: components/Controlpanel/WorkflowPanel +msgid "Workflow Manager" +msgstr "" + +#. Default: "Workflow deleted successfully." +#: components/Controlpanel/WorkflowTable +msgid "Workflow deleted successfully." +msgstr "" + +#. Default: "Workflow renamed successfully." +#: components/Controlpanel/WorkflowTable +msgid "Workflow renamed successfully." +msgstr "" diff --git a/frontend/packages/volto-workflow-manager/locales/es/LC_MESSAGES/volto.po b/frontend/packages/volto-workflow-manager/locales/es/LC_MESSAGES/volto.po index 4efdb4d..5f156a7 100644 --- a/frontend/packages/volto-workflow-manager/locales/es/LC_MESSAGES/volto.po +++ b/frontend/packages/volto-workflow-manager/locales/es/LC_MESSAGES/volto.po @@ -18,11 +18,36 @@ msgstr "" "X-Is-Fallback-For: es-ar es-bo es-cl es-co es-cr es-do es-ec es-es es-sv es-gt es-hn es-mx es-ni es-pa es-py es-pe es-pr es-us es-uy es-ve\n" "X-Generator: Poedit 2.2.1\n" +#. Default: "Assign" +#: components/Workflow/AssignWorkflow +msgid "Assign" +msgstr "" + +#. Default: "Assign Workflow" +#: components/Workflow/AssignWorkflow +msgid "Assign Workflow" +msgstr "" + +#. Default: "Assigning..." +#: components/Workflow/AssignWorkflow +msgid "Assigning..." +msgstr "" + +#. Default: "Assignment Failed" +#: components/Workflow/AssignWorkflow +msgid "Assignment Failed" +msgstr "" + #. Default: "Block" #: components/Workflow/WorkflowSidebar msgid "Block" msgstr "" +#. Default: "Cancel" +#: components/Workflow/AssignWorkflow +msgid "Cancel" +msgstr "" + #. Default: "Document" #: components/Workflow/WorkflowSidebar msgid "Document" @@ -38,6 +63,16 @@ msgstr "" msgid "Expand sidebar" msgstr "" +#. Default: "Failed to delete workflow." +#: components/Controlpanel/WorkflowTable +msgid "Failed to delete workflow." +msgstr "" + +#. Default: "Failed to rename workflow." +#: components/Controlpanel/WorkflowTable +msgid "Failed to rename workflow." +msgstr "" + #. Default: "No errors found in the workflow." #: components/Workflow/ActionsToolbar msgid "No errors found in the workflow." @@ -48,6 +83,16 @@ msgstr "" msgid "Order" msgstr "" +#. Default: "Select a content type..." +#: components/Workflow/AssignWorkflow +msgid "Select a content type..." +msgstr "" + +#. Default: "Select the content type you would like to assign this workflow to." +#: components/Workflow/AssignWorkflow +msgid "Select the content type you would like to assign this workflow to." +msgstr "" + #. Default: "Settings" #: components/Workflow/WorkflowSidebar msgid "Settings" @@ -83,6 +128,11 @@ msgstr "" msgid "The new transition has been added successfully." msgstr "" +#. Default: "The workflow has been assigned successfully." +#: components/Workflow/AssignWorkflow +msgid "The workflow has been assigned successfully." +msgstr "" + #. Default: "Transition Created" #: components/Transitions/CreateTransition msgid "Transition Created" @@ -112,3 +162,23 @@ msgstr "" #: components/Workflow/WorkflowSidebar msgid "Workflow" msgstr "" + +#. Default: "Workflow Assigned" +#: components/Workflow/AssignWorkflow +msgid "Workflow Assigned" +msgstr "" + +#. Default: "Workflow Manager" +#: components/Controlpanel/WorkflowPanel +msgid "Workflow Manager" +msgstr "" + +#. Default: "Workflow deleted successfully." +#: components/Controlpanel/WorkflowTable +msgid "Workflow deleted successfully." +msgstr "" + +#. Default: "Workflow renamed successfully." +#: components/Controlpanel/WorkflowTable +msgid "Workflow renamed successfully." +msgstr "" diff --git a/frontend/packages/volto-workflow-manager/locales/pt_BR/LC_MESSAGES/volto.po b/frontend/packages/volto-workflow-manager/locales/pt_BR/LC_MESSAGES/volto.po index 002d68d..1346522 100644 --- a/frontend/packages/volto-workflow-manager/locales/pt_BR/LC_MESSAGES/volto.po +++ b/frontend/packages/volto-workflow-manager/locales/pt_BR/LC_MESSAGES/volto.po @@ -16,11 +16,36 @@ msgstr "" "Preferred-Encodings: utf-8\n" "Domain: volto\n" +#. Default: "Assign" +#: components/Workflow/AssignWorkflow +msgid "Assign" +msgstr "" + +#. Default: "Assign Workflow" +#: components/Workflow/AssignWorkflow +msgid "Assign Workflow" +msgstr "" + +#. Default: "Assigning..." +#: components/Workflow/AssignWorkflow +msgid "Assigning..." +msgstr "" + +#. Default: "Assignment Failed" +#: components/Workflow/AssignWorkflow +msgid "Assignment Failed" +msgstr "" + #. Default: "Block" #: components/Workflow/WorkflowSidebar msgid "Block" msgstr "" +#. Default: "Cancel" +#: components/Workflow/AssignWorkflow +msgid "Cancel" +msgstr "" + #. Default: "Document" #: components/Workflow/WorkflowSidebar msgid "Document" @@ -36,6 +61,16 @@ msgstr "" msgid "Expand sidebar" msgstr "" +#. Default: "Failed to delete workflow." +#: components/Controlpanel/WorkflowTable +msgid "Failed to delete workflow." +msgstr "" + +#. Default: "Failed to rename workflow." +#: components/Controlpanel/WorkflowTable +msgid "Failed to rename workflow." +msgstr "" + #. Default: "No errors found in the workflow." #: components/Workflow/ActionsToolbar msgid "No errors found in the workflow." @@ -46,6 +81,16 @@ msgstr "" msgid "Order" msgstr "" +#. Default: "Select a content type..." +#: components/Workflow/AssignWorkflow +msgid "Select a content type..." +msgstr "" + +#. Default: "Select the content type you would like to assign this workflow to." +#: components/Workflow/AssignWorkflow +msgid "Select the content type you would like to assign this workflow to." +msgstr "" + #. Default: "Settings" #: components/Workflow/WorkflowSidebar msgid "Settings" @@ -81,6 +126,11 @@ msgstr "" msgid "The new transition has been added successfully." msgstr "" +#. Default: "The workflow has been assigned successfully." +#: components/Workflow/AssignWorkflow +msgid "The workflow has been assigned successfully." +msgstr "" + #. Default: "Transition Created" #: components/Transitions/CreateTransition msgid "Transition Created" @@ -110,3 +160,23 @@ msgstr "" #: components/Workflow/WorkflowSidebar msgid "Workflow" msgstr "" + +#. Default: "Workflow Assigned" +#: components/Workflow/AssignWorkflow +msgid "Workflow Assigned" +msgstr "" + +#. Default: "Workflow Manager" +#: components/Controlpanel/WorkflowPanel +msgid "Workflow Manager" +msgstr "" + +#. Default: "Workflow deleted successfully." +#: components/Controlpanel/WorkflowTable +msgid "Workflow deleted successfully." +msgstr "" + +#. Default: "Workflow renamed successfully." +#: components/Controlpanel/WorkflowTable +msgid "Workflow renamed successfully." +msgstr "" diff --git a/frontend/packages/volto-workflow-manager/locales/volto.pot b/frontend/packages/volto-workflow-manager/locales/volto.pot index 131add9..f355a88 100644 --- a/frontend/packages/volto-workflow-manager/locales/volto.pot +++ b/frontend/packages/volto-workflow-manager/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2025-08-27T07:49:22.899Z\n" +"POT-Creation-Date: 2025-09-01T07:05:58.822Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "Content-Type: text/plain; charset=utf-8\n" @@ -13,11 +13,36 @@ msgstr "" "Preferred-Encodings: utf-8\n" "Domain: volto\n" +#. Default: "Assign" +#: components/Workflow/AssignWorkflow +msgid "Assign" +msgstr "" + +#. Default: "Assign Workflow" +#: components/Workflow/AssignWorkflow +msgid "Assign Workflow" +msgstr "" + +#. Default: "Assigning..." +#: components/Workflow/AssignWorkflow +msgid "Assigning..." +msgstr "" + +#. Default: "Assignment Failed" +#: components/Workflow/AssignWorkflow +msgid "Assignment Failed" +msgstr "" + #. Default: "Block" #: components/Workflow/WorkflowSidebar msgid "Block" msgstr "" +#. Default: "Cancel" +#: components/Workflow/AssignWorkflow +msgid "Cancel" +msgstr "" + #. Default: "Document" #: components/Workflow/WorkflowSidebar msgid "Document" @@ -33,6 +58,16 @@ msgstr "" msgid "Expand sidebar" msgstr "" +#. Default: "Failed to delete workflow." +#: components/Controlpanel/WorkflowTable +msgid "Failed to delete workflow." +msgstr "" + +#. Default: "Failed to rename workflow." +#: components/Controlpanel/WorkflowTable +msgid "Failed to rename workflow." +msgstr "" + #. Default: "No errors found in the workflow." #: components/Workflow/ActionsToolbar msgid "No errors found in the workflow." @@ -43,6 +78,16 @@ msgstr "" msgid "Order" msgstr "" +#. Default: "Select a content type..." +#: components/Workflow/AssignWorkflow +msgid "Select a content type..." +msgstr "" + +#. Default: "Select the content type you would like to assign this workflow to." +#: components/Workflow/AssignWorkflow +msgid "Select the content type you would like to assign this workflow to." +msgstr "" + #. Default: "Settings" #: components/Workflow/WorkflowSidebar msgid "Settings" @@ -78,6 +123,11 @@ msgstr "" msgid "The new transition has been added successfully." msgstr "" +#. Default: "The workflow has been assigned successfully." +#: components/Workflow/AssignWorkflow +msgid "The workflow has been assigned successfully." +msgstr "" + #. Default: "Transition Created" #: components/Transitions/CreateTransition msgid "Transition Created" @@ -107,3 +157,23 @@ msgstr "" #: components/Workflow/WorkflowSidebar msgid "Workflow" msgstr "" + +#. Default: "Workflow Assigned" +#: components/Workflow/AssignWorkflow +msgid "Workflow Assigned" +msgstr "" + +#. Default: "Workflow Manager" +#: components/Controlpanel/WorkflowPanel +msgid "Workflow Manager" +msgstr "" + +#. Default: "Workflow deleted successfully." +#: components/Controlpanel/WorkflowTable +msgid "Workflow deleted successfully." +msgstr "" + +#. Default: "Workflow renamed successfully." +#: components/Controlpanel/WorkflowTable +msgid "Workflow renamed successfully." +msgstr "" diff --git a/frontend/packages/volto-workflow-manager/src/actions/transition.ts b/frontend/packages/volto-workflow-manager/src/actions/transition.ts index bf296fc..4df8f14 100644 --- a/frontend/packages/volto-workflow-manager/src/actions/transition.ts +++ b/frontend/packages/volto-workflow-manager/src/actions/transition.ts @@ -6,7 +6,7 @@ import { DELETE_TRANSITION, } from '../constants'; import { updateState } from './state'; -import { getWorkflows } from './workflow'; +import { getWorkflow } from './workflow'; export interface AddTransitionPayload { title: string; @@ -178,7 +178,7 @@ export const createAndLinkTransition = ( } } - await dispatch(getWorkflows()); + await dispatch(getWorkflow(workflowId)); return result; } catch (error) { diff --git a/frontend/packages/volto-workflow-manager/src/components/Controlpanel/WorkflowPanel.tsx b/frontend/packages/volto-workflow-manager/src/components/Controlpanel/WorkflowPanel.tsx index b7715e8..89c4f0f 100644 --- a/frontend/packages/volto-workflow-manager/src/components/Controlpanel/WorkflowPanel.tsx +++ b/frontend/packages/volto-workflow-manager/src/components/Controlpanel/WorkflowPanel.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react'; import { useAppSelector, useAppDispatch } from '../../types'; import { useLocation, useHistory, Link } from 'react-router-dom'; +import { useIntl, defineMessages } from 'react-intl'; import { Button, Heading, @@ -17,6 +18,7 @@ import CreateWorkflow from '../Workflow/CreateWorkflow'; import WorkflowView from '../Workflow/WorkflowView'; import WorkflowTable from './WorkflowTable'; import ThemeProvider from '../../Provider'; +import Helmet from '@plone/volto/helpers/Helmet/Helmet'; import Icon from '@plone/volto/components/theme/Icon/Icon'; import add from '@plone/volto/icons/add.svg'; import back from '@plone/volto/icons/back.svg'; @@ -37,7 +39,15 @@ const plone_shipped_workflows = [ 'comment_one_state_workflow', ]; +const messages = defineMessages({ + workflowManager: { + id: 'Workflow Manager', + defaultMessage: 'Workflow Manager', + }, +}); + const WorkflowControlPanel = (props) => { + const intl = useIntl(); const dispatch = useAppDispatch(); const history = useHistory(); const location = useLocation(); @@ -92,17 +102,17 @@ const WorkflowControlPanel = (props) => { }, [error]); useEffect(() => { - if (operationError) { + if (operationError && isProcessingCreation) { toast.error( , ); setIsProcessingCreation(false); } - }, [operationError]); + }, [operationError, isProcessingCreation]); const handleCreateWorkflow = (cloneFromWorkflow, workflowName) => { setIsProcessingCreation(true); @@ -129,6 +139,7 @@ const WorkflowControlPanel = (props) => { return (
+
Workflow Manager diff --git a/frontend/packages/volto-workflow-manager/src/components/States/State.tsx b/frontend/packages/volto-workflow-manager/src/components/States/State.tsx index 3dc5bb7..a3a9a9d 100644 --- a/frontend/packages/volto-workflow-manager/src/components/States/State.tsx +++ b/frontend/packages/volto-workflow-manager/src/components/States/State.tsx @@ -62,13 +62,17 @@ const State: React.FC = ({ null, ); - const { statesInfo, transitionsInfo, isLoadingData, selectedItem } = - useSelector((state: GlobalRootState) => ({ - statesInfo: state.state.list, - transitionsInfo: state.transition.list, - isLoadingData: state.state.list.loading || state.transition.list.loading, - selectedItem: state.workflow.selectedItem, - })); + const statesInfo = useSelector((state: GlobalRootState) => state.state.list); + const transitionsInfo = useSelector( + (state: GlobalRootState) => state.transition.list, + ); + const isLoadingData = useSelector( + (state: GlobalRootState) => + state.state.list.loading || state.transition.list.loading, + ); + const selectedItem = useSelector( + (state: GlobalRootState) => state.workflow.selectedItem, + ); useEffect(() => { if (workflowId) { @@ -149,7 +153,7 @@ const State: React.FC = ({ ); if (isLoadingData && !statesInfo.loaded) { - return ; + return ; } const areTabsDisabled = isDisabled || !localStateData; @@ -164,6 +168,7 @@ const State: React.FC = ({ > Configure a State = ({ items={roleItems} selectedKeys={new Set(data.roles)} onSelectionChange={(keys) => handleSelectionChange(keys, 'roles')} - isDisabled={isDisabled} height="size-2000" > {(item) => {item.name}} @@ -62,7 +61,6 @@ const GuardsTab: React.FC = ({ items={availableGroups} selectedKeys={new Set(data.groups)} onSelectionChange={(keys) => handleSelectionChange(keys, 'groups')} - isDisabled={isDisabled} height="size-2000" > {(item) => {item.title}} @@ -79,7 +77,6 @@ const GuardsTab: React.FC = ({ onSelectionChange={(keys) => handleSelectionChange(keys, 'permissions') } - isDisabled={isDisabled} height="size-2000" > {(item) => {item.name}} diff --git a/frontend/packages/volto-workflow-manager/src/components/Transitions/Transition.tsx b/frontend/packages/volto-workflow-manager/src/components/Transitions/Transition.tsx index 2cb3790..bfe803e 100644 --- a/frontend/packages/volto-workflow-manager/src/components/Transitions/Transition.tsx +++ b/frontend/packages/volto-workflow-manager/src/components/Transitions/Transition.tsx @@ -35,13 +35,16 @@ const Transition: React.FC = ({ const [initialTransitionData, setInitialTransitionData] = useState(null); - const { transitionsInfo, statesInfo, isLoading, selectedItem } = useSelector( - (state: GlobalRootState) => ({ - transitionsInfo: state.transition.list, - statesInfo: state.state.list, - isLoading: state.transition.list.loading || state.state.list.loading, - selectedItem: state.workflow.selectedItem, - }), + const transitionsInfo = useSelector( + (state: GlobalRootState) => state.transition.list, + ); + const statesInfo = useSelector((state: GlobalRootState) => state.state.list); + const isLoading = useSelector( + (state: GlobalRootState) => + state.transition.list.loading || state.state.list.loading, + ); + const selectedItem = useSelector( + (state: GlobalRootState) => state.workflow.selectedItem, ); useEffect(() => { @@ -187,7 +190,9 @@ const Transition: React.FC = ({ ); if (isLoading && !transitionsInfo.loaded) { - return ; + return ( + + ); } const isPickerDisabled = isDisabled || !transitionsInfo.loaded; @@ -203,6 +208,7 @@ const Transition: React.FC = ({ > Configure a Transition