Allow bulk records for manual trigger (#14725)
https://github.com/user-attachments/assets/d6c565eb-9a29-4830-9396-5f979c8caa7b - Added a new component for manual trigger (mostly duplicated from previous one). Will remove the old one once all data are migrated - Updated schema output so the current item of the iterator can be typed Todo left: - migrate old triggers - add an util to search iterator output. Today current item fields will be displayed as not found - set new manual triggers for workflow runs
This commit is contained in:
+21
-2
@@ -18,9 +18,12 @@ import { WorkflowEditActionHttpRequest } from '@/workflow/workflow-steps/workflo
|
||||
import { WorkflowEditActionIterator } from '@/workflow/workflow-steps/workflow-actions/iterator-action/WorkflowEditActionIterator';
|
||||
import { WorkflowEditTriggerCronForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerCronForm';
|
||||
import { WorkflowEditTriggerDatabaseEventForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm';
|
||||
import { WorkflowEditTriggerManualForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerManualForm';
|
||||
import { WorkflowEditTriggerManual } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerManual';
|
||||
import { WorkflowEditTriggerManualDeprecated } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerManualDeprecated';
|
||||
import { WorkflowEditTriggerWebhookForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerWebhookForm';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { assertUnreachable, isDefined } from 'twenty-shared/utils';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
|
||||
type WorkflowRunStepNodeDetailProps = {
|
||||
stepId: string;
|
||||
@@ -41,6 +44,10 @@ export const WorkflowRunStepNodeDetail = ({
|
||||
steps,
|
||||
});
|
||||
|
||||
const isIteratorEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IS_WORKFLOW_ITERATOR_ENABLED,
|
||||
);
|
||||
|
||||
if (!isDefined(stepDefinition) || !isDefined(stepDefinition.definition)) {
|
||||
return null;
|
||||
}
|
||||
@@ -60,8 +67,20 @@ export const WorkflowRunStepNodeDetail = ({
|
||||
);
|
||||
}
|
||||
case 'MANUAL': {
|
||||
if (isIteratorEnabled) {
|
||||
return (
|
||||
<WorkflowEditTriggerManual
|
||||
key={stepId}
|
||||
trigger={stepDefinition.definition}
|
||||
triggerOptions={{
|
||||
readonly: true,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<WorkflowEditTriggerManualForm
|
||||
<WorkflowEditTriggerManualDeprecated
|
||||
key={stepId}
|
||||
trigger={stepDefinition.definition}
|
||||
triggerOptions={{
|
||||
|
||||
+18
-2
@@ -17,9 +17,12 @@ import { WorkflowEditActionHttpRequest } from '@/workflow/workflow-steps/workflo
|
||||
import { WorkflowEditActionIterator } from '@/workflow/workflow-steps/workflow-actions/iterator-action/WorkflowEditActionIterator';
|
||||
import { WorkflowEditTriggerCronForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerCronForm';
|
||||
import { WorkflowEditTriggerDatabaseEventForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm';
|
||||
import { WorkflowEditTriggerManualForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerManualForm';
|
||||
import { WorkflowEditTriggerManual } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerManual';
|
||||
import { WorkflowEditTriggerManualDeprecated } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerManualDeprecated';
|
||||
import { WorkflowEditTriggerWebhookForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerWebhookForm';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { assertUnreachable, isDefined } from 'twenty-shared/utils';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
|
||||
type WorkflowStepDetailProps = {
|
||||
stepId: string;
|
||||
@@ -45,6 +48,9 @@ export const WorkflowStepDetail = ({
|
||||
steps,
|
||||
...props
|
||||
}: WorkflowStepDetailProps) => {
|
||||
const isIteratorEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IS_WORKFLOW_ITERATOR_ENABLED,
|
||||
);
|
||||
const stepDefinition = getStepDefinitionOrThrow({
|
||||
stepId,
|
||||
trigger,
|
||||
@@ -68,8 +74,18 @@ export const WorkflowStepDetail = ({
|
||||
);
|
||||
}
|
||||
case 'MANUAL': {
|
||||
if (isIteratorEnabled) {
|
||||
return (
|
||||
<WorkflowEditTriggerManual
|
||||
key={stepId}
|
||||
trigger={stepDefinition.definition}
|
||||
triggerOptions={props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<WorkflowEditTriggerManualForm
|
||||
<WorkflowEditTriggerManualDeprecated
|
||||
key={stepId}
|
||||
trigger={stepDefinition.definition}
|
||||
triggerOptions={props}
|
||||
|
||||
Reference in New Issue
Block a user