6.1/gsoc workflow - #138
Conversation
…x method (ApiController not configured yet)
…ccessibility improved
This reverts commit cd68c7b.
# Conflicts: # package-lock.json
# Conflicts: # package-lock.json
…and 'disabled' and changed back button to close
…tion and update trash item language strings for clarity
There was a problem hiding this comment.
Pull request overview
This PR introduces a graphical “Workflow Graph” UI for com_workflow, including new build targets/assets, a new Graph view/API endpoints, and persistence of stage node positions in the database.
Changes:
- Add a new Workflow Graph view + supporting API endpoints and UI assets (Vue/Vue Flow + client graph modal).
- Persist workflow stage node positions via new
#__workflow_stages.positioncolumn (MySQL/PostgreSQL install + update SQL). - Extend the existing workflow transition field rendering to use a new layout that can launch the graph UI.
Reviewed changes
Copilot reviewed 59 out of 60 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds build/watch scripts for com_workflow and new JS deps (@vue-flow/*). |
| package-lock.json | Locks the added Vue Flow dependency tree. |
| build/build.mjs | Adds CLI flags and prepare pipeline hook for compiling workflow graph assets. |
| build/build-modules-js/javascript/build-com_workflow-js.mjs | New Rollup build pipeline for workflow graph JS bundle. |
| build/media_source/com_workflow/joomla.asset.json | Registers new com_workflow assets (graph + graph client). |
| build/media_source/com_workflow/js/workflow-graph-client.es6.js | Adds a non-Vue “graph client” script for modal-based graph viewing. |
| build/media_source/com_workflow/scss/workflow-graph*.scss | Adds styling for graph editor/client. |
| libraries/src/MVC/Model/WorkflowBehaviorTrait.php | Sets a custom layout for the transition field when workflow is enabled. |
| libraries/src/Form/Field/TransitionField.php | Looks up and injects workflow_id into the transition field attributes. |
| layouts/joomla/form/field/groupedlist-transition.php | New field layout that renders the groupedlist + “view graph” dialog UI. |
| installation/sql/*/base.sql | Adds position column to #__workflow_stages schema. |
| administrator/components/com_admin/sql/updates/*/6.1.0-2026-02-06.sql | Adds schema update for the new position column. |
| administrator/language/en-GB/com_workflow.ini | Adds many new translation keys for the workflow graph UI. |
| administrator/components/com_workflow/workflow.xml | Includes new folders (layouts, resources) in the component package. |
| administrator/components/com_workflow/tmpl/workflows/default.php | Adds a “Graph” column/link in workflows list. |
| administrator/components/com_workflow/src/View/Graph/HtmlView.php | New Graph view for rendering the workflow graph editor page. |
| administrator/components/com_workflow/src/Model/GraphModel.php | New model backing the graph view. |
| administrator/components/com_workflow/src/Controller/GraphController.php | New controller providing JSON endpoints + publish/delete APIs for graph UI. |
| administrator/components/com_workflow/src/Model/StagesModel.php | Adds selection of position + adds bulk position update method. |
| administrator/components/com_workflow/src/Model/StagesModel.php / TransitionsModel.php | Expands selected fields to include workflow_id (and position for stages). |
| administrator/components/com_workflow/src/Controller/StagesController.php | Adds an endpoint to persist stage positions. |
| administrator/components/com_workflow/src/Controller/StageController.php / TransitionController.php | Adds modal save/cancel redirects to modalreturn layouts. |
| administrator/components/com_workflow/tmpl/graph/default*.php | New graph template + translation bootstrap for JS. |
| administrator/components/com_workflow/layouts/toolbar/shortcuts.php | Adds a toolbar button/dialog to show keyboard shortcuts. |
| administrator/components/com_workflow/resources/scripts/** | Introduces the Vue/Vuex workflow graph editor application code. |
| components/com_workflow/src/Dispatcher/Dispatcher.php | Adds a Site dispatcher that proxies graph tasks to Administrator controllers with access checks. |
| administrator/components/com_workflow/src/Dispatcher/Dispatcher.php | Adjusts access handling to allow graph JSON tasks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Zoom & Pan Logic | ||
| let isPanning = false, panStart = {}; | ||
| container.addEventListener("mousedown", e => { | ||
| if (e.target.closest('.stage') || e.target.closest('.zoom-controls') || e.button !== 0) return; | ||
| isPanning = true; | ||
| panStart = { x: e.clientX - state.panX, y: e.clientY - state.panY }; | ||
| graph.classList.add('dragging'); | ||
| }); | ||
| document.addEventListener("mousemove", e => { | ||
| if (!isPanning) return; | ||
| state.panX = e.clientX - panStart.x; | ||
| state.panY = e.clientY - panStart.y; | ||
| renderGraph(modal); | ||
| }); | ||
| const stopPanning = () => { isPanning = false; graph.classList.remove('dragging'); }; | ||
| document.addEventListener("mouseup", stopPanning); | ||
| container.addEventListener("mouseleave", stopPanning); | ||
| container.addEventListener("wheel", e => { |
There was a problem hiding this comment.
In init(), graph is referenced in the pan handlers (graph.classList.add/remove('dragging')), but there is no graph variable in scope. This will throw at runtime when starting/stopping panning. Define const graph = modal.querySelector('#graph') (and guard for null) before using it, or reference the already-selected element used in renderGraph().
| }, {}), | ||
| ); | ||
|
|
||
| if (response) { |
There was a problem hiding this comment.
Missing await. The value 'response' is always a promise.
| const uri = `${baseUri}?option=com_workflow&extension=com_content&layout=modal&view=graph${url}`; | ||
| const response = await fetch(uri, { credentials: 'same-origin' }); | ||
| if (!response.ok) { | ||
| let message = 'COM_WORKFLOW_GRAPH_ERROR_UNKNOWN'; |
There was a problem hiding this comment.
The initial value of message is unused, since it is always overwritten.
| // Compile the Workflow Graph | ||
| if (cliOptions.comWorkflow) { | ||
| // false indicates "no watch" | ||
| workflowGraph(false); |
There was a problem hiding this comment.
Superfluous argument passed to function workflowGraph.
|
|
||
| // Watch & Compile the Workflow Graph | ||
| if (cliOptions.watchComWorkflow) { | ||
| watchWorkflowGraph(true); |
There was a problem hiding this comment.
Superfluous argument passed to function watchWorkflowGraph.
| stages.unshift({ id: 'From Any', title: 'From Any', position: null }); | ||
| } | ||
| state.stages = stages.map(s => ({ ...s, position: s.position || { x: NaN, y: NaN } })); | ||
| state.stages = calculateAutoLayout(state.stages, state.transitions); |
There was a problem hiding this comment.
Superfluous argument passed to function calculateAutoLayout.
Pull Request for Issue # .
Summary of Changes
Testing Instructions
Actual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed