[Workflow] Add WorkflowFilter to scope element grids by workflow place#1938
Open
xIrusux wants to merge 3 commits into
Open
[Workflow] Add WorkflowFilter to scope element grids by workflow place#1938xIrusux wants to merge 3 commits into
xIrusux wants to merge 3 commits into
Conversation
* [Workflow] exclude folders from workflow element queries Folders share their element's ctype (asset/object/document) in element_workflow_state, so fetchByWorkflowState listed asset folders alongside real assets in the workflow pending-items widget and the workflow_get_elements click-through list (pimcore/studio-dashboards-bundle#301). Filter out folder subtypes in SQL via the already-present assets/objects/ documents joins. The IS NULL guard per table is required: a plain "type != 'folder'" would drop every non-matching LEFT JOIN row (NULL type) through three-valued logic, emptying the result. Orphaned states (element deleted) are preserved unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Address static-analysis finding: drop unused leftJoin callback params Verify the join count via expects(exactly(3)) instead of a capturing callback with unused $fromAlias/$join parameters (Codacy/PHPMD UnusedFormalParameter). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New search-index filter (type `workflow`, key=workflow name, value=place) that resolves the matching element ids via WorkflowElementsRepository (folders already excluded) and applies the standard searchByIds modifier. Lets the native element listing be filtered to a workflow state server-side — the basis for the state distribution donut drill-down opening the native grid instead of a bespoke list. Element type is derived from the query (data-object / asset / document). Empty id set matches nothing; a MAX_IDS ceiling guards the OpenSearch terms limit (logged). Registered with the pimcore.studio_backend.search_index.filter tag. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Category | Results |
|---|---|
| BestPractice | 1 minor |
| CodeStyle | 11 minor |
🟢 Metrics 24 complexity
Metric Results Complexity 24
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Add the `workflow` column filter to the Grid architecture docs (filters table + example): key = workflow name, value = place (omit/null = all states), folders excluded, ids resolved server-side. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
martineiber
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
Adds a
workflowsearch-index filter so the native Studio element grid can be restricted to the elements in a given workflow place. This is the backend half of the state-distribution donut drill-down → native grid feature (frontend: pimcore/studio-dashboards-bundleworkflow-state-drilldown).How
WorkflowFilter(taggedpimcore.studio_backend.search_index.filter, modeled onMarkFilter/MultipleIdFilter):columnFiltersof typeworkflow(key = workflow name, value = place; no place = all states, for the widget's show-all action).WorkflowElementsRepositoryInterface::fetchByWorkflowState(...)and applies the existingsearchByIds().DataObjectQueryInterface/AssetQueryInterface/DocumentQueryInterface).element_workflow_staterows, e.g.cid=0) — the search index'sIdsFilterrequires strictly positive ids.MAX_IDSceiling guards the OpenSearch terms limit (logged, not user-facing). Permissions are enforced by the native grid query downstream (not duplicated here).@internal,final readonly, DI against interfaces, no Pimcore statics — followspimcore-studio-backend-architecture.Tests
WorkflowFilterTest(Codeception unit): per-place resolution, all-places (null), asset element type, empty-set, and the orphaned-cid=0regression. Verifiedphp -l; Codeception runs in CI.Notes
2025.4per request (runs in the current dev env). Happy to retarget to2026.xif this should land as a feature there first.🤖 Generated with Claude Code