From 6fe3d586cda5d078c1927ce5440872305ef5fd57 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 4 Dec 2025 01:16:41 +0530 Subject: [PATCH] fix(workflow): clicking on 'See runs' shows executions from all workflows (#16300) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: #16229 and #16286 This PR fixes the bug where click on 'See All Runs' button for a specific workflow was not filtering the runs for that speciific workflow. **Reason** : The filter logic in `getFilterFilterableFieldMetadataItems` was excluding ALL system fields(except field id) from being filterable, which prevented these essential business relations from being used in filters. **Fix** : Added a targeted exception to allow specific system relation fields (`workflow` and `workflowVersion`) to be filterable, similar to how the `id` system field is already whitelisted. ### Before https://github.com/user-attachments/assets/50b98626-ccdc-468a-96f9-0c911fec9a39 Screenshot 2025-12-03 at 11 52
50 PM ### After https://github.com/user-attachments/assets/856bbd61-4958-43de-8fa5-3f52ca9e7260 Screenshot 2025-12-04 at 12 33 32 AM --- .../utils/getFilterFilterableFieldMetadataItems.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/object-metadata/utils/getFilterFilterableFieldMetadataItems.ts b/packages/twenty-front/src/modules/object-metadata/utils/getFilterFilterableFieldMetadataItems.ts index f4a4371faaf..dc397cb1ece 100644 --- a/packages/twenty-front/src/modules/object-metadata/utils/getFilterFilterableFieldMetadataItems.ts +++ b/packages/twenty-front/src/modules/object-metadata/utils/getFilterFilterableFieldMetadataItems.ts @@ -11,6 +11,10 @@ export const getFilterFilterableFieldMetadataItems = ({ const isFieldActive = field.isActive; const isIdField = field.name === 'id'; + const isWorkflowRelationField = + field.type === FieldMetadataType.RELATION && + (field.name === 'workflow' || field.name === 'workflowVersion'); + const isRelationFieldHandled = !( field.type === FieldMetadataType.RELATION && field.relation?.type !== RelationType.MANY_TO_ONE @@ -39,7 +43,7 @@ export const getFilterFilterableFieldMetadataItems = ({ ].includes(field.type); const isFieldFilterable = - (!isSystemField || isIdField) && + (!isSystemField || isIdField || isWorkflowRelationField) && isFieldActive && isRelationFieldHandled && isFieldTypeFilterable;