[frontend/backend] Use filter interface for conditions (#15067)#15350
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## issue/2484-draft-workflow-feature #15350 +/- ##
=====================================================================
+ Coverage 33.70% 33.71% +0.01%
=====================================================================
Files 3204 3204
Lines 215912 216033 +121
Branches 39681 39710 +29
=====================================================================
+ Hits 72773 72839 +66
- Misses 143139 143194 +55
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d2b7c30 to
d178952
Compare
d068862 to
319747c
Compare
d178952 to
7a9d88d
Compare
5fd4c80 to
050d64a
Compare
7a9d88d to
7f48efd
Compare
050d64a to
51f773d
Compare
70b49a4 to
bf0fc59
Compare
7f48efd to
bbdb2b9
Compare
bf0fc59 to
eb9020f
Compare
eb9020f to
906b6d8
Compare
There was a problem hiding this comment.
Pull request overview
Updates OpenCTI’s workflow transition conditions to use the platform’s filter interface end-to-end (GraphQL/API, backend workflow engine, and frontend workflow editor), adding dedicated workflow-related filter keys for user/group/organization and adjusting UI grouping/labels.
Changes:
- Backend: switch workflow transition
conditionsto a filter-group-based structure and add workflow-specific filter keys (workflow_user,workflow_group,workflow_organization) into filtering infrastructure. - Frontend: update workflow editor to edit/store transition conditions as filters; add entity search support for the new workflow filter keys; improve filter key grouping in UI.
- Tests/translations: update/add tests for the new conditions structure and add i18n strings for new filter group labels and keys.
Reviewed changes
Copilot reviewed 36 out of 37 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| opencti-platform/opencti-graphql/tests/03-integration/02-resolvers/workflow-test.ts | Adds integration coverage for workflow conditions using filter groups and special workflow keys. |
| opencti-platform/opencti-graphql/tests/03-integration/02-resolvers/workflow-conditions-test.ts | Migrates existing workflow-conditions integration tests to the new filter-group conditions format. |
| opencti-platform/opencti-graphql/src/utils/filtering/filtering-utils.ts | Maps new workflow filter keys to internal fields for special-key conversion. |
| opencti-platform/opencti-graphql/src/utils/filtering/filtering-constants.ts | Defines and registers new workflow filter key constants. |
| opencti-platform/opencti-graphql/src/utils/filtering/filtering-activity-event/activity-event-testers.ts | Adds activity-event testers for workflow_* keys by reusing members_* testers. |
| opencti-platform/opencti-graphql/src/modules/workflow/types/workflow-types.ts | Updates workflow transition serialized typings to reference filter group types. |
| opencti-platform/opencti-graphql/src/modules/workflow/engine/workflow-schema.ts | Changes serialized transition schema to use filter-group-based conditions. |
| opencti-platform/opencti-graphql/src/modules/workflow/engine/workflow-factory.ts | Implements filter-group evaluation for workflow transition guards. |
| opencti-platform/opencti-graphql/src/modules/workflow/api/workflow.graphql | Changes transition conditions GraphQL field to JSON. |
| opencti-platform/opencti-graphql/src/generated/graphql.ts | Updates generated types to reflect GraphQL schema changes. |
| opencti-platform/opencti-graphql/src/domain/filterKeysSchema.ts | Exposes workflow_* filter definitions in the filter keys schema for UI usage. |
| opencti-platform/opencti-front/src/utils/filters/useSearchEntities.tsx | Adds entity search option builders for workflow_* filter keys. |
| opencti-platform/opencti-front/src/schema/relay.schema.graphql | Updates Relay schema for workflow transition conditions JSON field. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/utils.ts | Updates workflow transition typing and serialization paths for conditions changes. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/hooks/useWorkflowInitialElements.ts | Sets default transition conditions shape when building initial graph nodes. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/hooks/useWorkflowInitialElements.test.ts | Updates tests to reflect new default conditions structure. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/hooks/useWorkflowForm.ts | Updates form “add condition” behavior to create an empty filter group. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/hooks/useWorkflowForm.test.ts | Updates tests for the new condition object created by the form hook. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/hooks/useStatusConnection.ts | Updates new transition node default conditions shape. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/hooks/useAddStatus.ts | Updates created transition nodes to use the new default conditions shape. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/WorkflowFieldList.tsx | Adjusts rendering logic for conditions vs actions in the editor UI. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/WorkflowFieldItem.tsx | Switches condition editing UI from raw fields to filter UI component. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/WorkflowEditionDrawer.tsx | Minor formatting update. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/WorkflowConditionFilters.tsx | New component to edit workflow transition conditions via the shared Filters UI. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/Workflow.tsx | Updates placeholder node default conditions shape. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/NodeTypes/TransitionNode.tsx | Updates condition count display to the new conditions structure. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/SubTypeWorkflow.tsx | Updates Relay query to fetch transition conditions as JSON. |
| opencti-platform/opencti-front/src/private/components/common/lists/ListFilters.tsx | Adds grouping logic/labels for workflow and draft-related filters. |
| opencti-platform/opencti-front/lang/front/zh.json | Adds i18n strings for new filter group labels and workflow_* keys. |
| opencti-platform/opencti-front/lang/front/ru.json | Adds i18n strings for new filter group labels and workflow_* keys. |
| opencti-platform/opencti-front/lang/front/ko.json | Adds i18n strings for new filter group labels and workflow_* keys. |
| opencti-platform/opencti-front/lang/front/ja.json | Adds i18n strings for new filter group labels and workflow_* keys. |
| opencti-platform/opencti-front/lang/front/it.json | Adds i18n strings for new filter group labels and workflow_* keys. |
| opencti-platform/opencti-front/lang/front/fr.json | Adds i18n strings for new filter group labels and workflow_* keys. |
| opencti-platform/opencti-front/lang/front/es.json | Adds i18n strings for new filter group labels and workflow_* keys. |
| opencti-platform/opencti-front/lang/front/en.json | Adds i18n strings for new filter group labels and workflow_* keys. |
| opencti-platform/opencti-front/lang/front/de.json | Adds i18n strings for new filter group labels and workflow_* keys. |
OctaveLaventure
left a comment
There was a problem hiding this comment.
amazing work 👏🏻 🚀
Proposed changes
Related issues
Checklist
Further comments