Fix workflow with manual triggers and no selection not appearing in the command menu (#11544)

Fix workflow with manual triggers and no selection not appearing in the
command menu

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Raphaël Bosi
2025-04-14 11:03:29 +02:00
committed by GitHub
parent b5a1d1a895
commit ace515eea7
13 changed files with 86 additions and 70 deletions

View File

@ -3,7 +3,7 @@ import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
import { Workflow, WorkflowVersion } from '@/workflow/types/Workflow';
export const useActiveWorkflowVersion = (workflowId: string) => {
const { records: workflowVersions } = useFindManyRecords<
const { records: workflowVersions, loading } = useFindManyRecords<
WorkflowVersion & {
workflow: Omit<Workflow, 'versions'> & {
versions: Array<{ __typename: string }>;
@ -39,5 +39,8 @@ export const useActiveWorkflowVersion = (workflowId: string) => {
},
});
return workflowVersions?.[0];
return {
workflowVersion: workflowVersions?.[0],
loading,
};
};

View File

@ -8,8 +8,10 @@ import { isDefined } from 'twenty-shared/utils';
export const useActiveWorkflowVersionsWithManualTrigger = ({
objectMetadataItem,
skip,
}: {
objectMetadataItem?: ObjectMetadataItem;
skip?: boolean;
}) => {
const filters = [
{
@ -50,6 +52,7 @@ export const useActiveWorkflowVersionsWithManualTrigger = ({
}),
workflow: true,
},
skip,
});
// TODO: refactor when we can use 'not like' in the RawJson filter