@@ -1265,7 +1265,6 @@ export enum FeatureFlagKey {
|
||||
IS_RELATION_CONNECT_ENABLED = 'IS_RELATION_CONNECT_ENABLED',
|
||||
IS_STRIPE_INTEGRATION_ENABLED = 'IS_STRIPE_INTEGRATION_ENABLED',
|
||||
IS_UNIQUE_INDEXES_ENABLED = 'IS_UNIQUE_INDEXES_ENABLED',
|
||||
IS_WORKFLOW_ITERATOR_ENABLED = 'IS_WORKFLOW_ITERATOR_ENABLED',
|
||||
IS_WORKSPACE_MIGRATION_V2_ENABLED = 'IS_WORKSPACE_MIGRATION_V2_ENABLED'
|
||||
}
|
||||
|
||||
|
||||
@@ -1229,7 +1229,6 @@ export enum FeatureFlagKey {
|
||||
IS_RELATION_CONNECT_ENABLED = 'IS_RELATION_CONNECT_ENABLED',
|
||||
IS_STRIPE_INTEGRATION_ENABLED = 'IS_STRIPE_INTEGRATION_ENABLED',
|
||||
IS_UNIQUE_INDEXES_ENABLED = 'IS_UNIQUE_INDEXES_ENABLED',
|
||||
IS_WORKFLOW_ITERATOR_ENABLED = 'IS_WORKFLOW_ITERATOR_ENABLED',
|
||||
IS_WORKSPACE_MIGRATION_V2_ENABLED = 'IS_WORKSPACE_MIGRATION_V2_ENABLED'
|
||||
}
|
||||
|
||||
|
||||
+1
-7
@@ -11,11 +11,9 @@ import { useRunWorkflowVersion } from '@/workflow/hooks/useRunWorkflowVersion';
|
||||
|
||||
import { type WorkflowVersion } from '@/workflow/types/Workflow';
|
||||
import { COMMAND_MENU_DEFAULT_ICON } from '@/workflow/workflow-trigger/constants/CommandMenuDefaultIcon';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { useRecoilCallback } from 'recoil';
|
||||
import { capitalize, isDefined } from 'twenty-shared/utils';
|
||||
import { useIcons } from 'twenty-ui/display';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
|
||||
export const useRunWorkflowRecordActions = ({
|
||||
objectMetadataItem,
|
||||
@@ -25,9 +23,6 @@ export const useRunWorkflowRecordActions = ({
|
||||
skip?: boolean;
|
||||
}) => {
|
||||
const { getIcon } = useIcons();
|
||||
const isIteratorEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IS_WORKFLOW_ITERATOR_ENABLED,
|
||||
);
|
||||
const contextStoreTargetedRecordsRule = useRecoilComponentValue(
|
||||
contextStoreTargetedRecordsRuleComponentState,
|
||||
);
|
||||
@@ -55,7 +50,6 @@ export const useRunWorkflowRecordActions = ({
|
||||
>,
|
||||
) => {
|
||||
if (
|
||||
isIteratorEnabled &&
|
||||
isDefined(activeWorkflowVersion?.trigger) &&
|
||||
isBulkRecordsManualTrigger(activeWorkflowVersion.trigger)
|
||||
) {
|
||||
@@ -91,7 +85,7 @@ export const useRunWorkflowRecordActions = ({
|
||||
}
|
||||
}
|
||||
},
|
||||
[runWorkflowVersion, isIteratorEnabled, objectMetadataItem],
|
||||
[runWorkflowVersion, objectMetadataItem],
|
||||
);
|
||||
|
||||
return activeWorkflowVersions
|
||||
|
||||
+5
-7
@@ -1,17 +1,15 @@
|
||||
import { type WorkflowTrigger } from '@/workflow/types/Workflow';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
export const isGlobalManualTrigger = (
|
||||
trigger: WorkflowTrigger,
|
||||
isIteratorEnabled: boolean,
|
||||
) => {
|
||||
export const isGlobalManualTrigger = (trigger: WorkflowTrigger) => {
|
||||
if (trigger.type !== 'MANUAL') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isIteratorEnabled && isDefined(trigger.settings?.availability)) {
|
||||
return trigger.settings.availability.type === 'GLOBAL';
|
||||
// Legacy support for manual triggers without availability
|
||||
if (!isDefined(trigger.settings?.availability)) {
|
||||
return !isDefined(trigger.settings?.objectType);
|
||||
}
|
||||
|
||||
return !isDefined(trigger.settings.objectType);
|
||||
return trigger.settings.availability.type === 'GLOBAL';
|
||||
};
|
||||
|
||||
+1
-6
@@ -17,9 +17,6 @@ export const CommandMenuWorkflowSelectAction = ({
|
||||
onActionSelected: (actionType: WorkflowActionType) => void;
|
||||
}) => {
|
||||
const isAiEnabled = useIsFeatureEnabled(FeatureFlagKey.IS_AI_ENABLED);
|
||||
const isIteratorEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IS_WORKFLOW_ITERATOR_ENABLED,
|
||||
);
|
||||
|
||||
const { t } = useLingui();
|
||||
|
||||
@@ -49,9 +46,7 @@ export const CommandMenuWorkflowSelectAction = ({
|
||||
{t`Flow`}
|
||||
</RightDrawerWorkflowSelectStepTitle>
|
||||
<WorkflowActionMenuItems
|
||||
actions={FLOW_ACTIONS.filter(
|
||||
(action) => action.type !== 'ITERATOR' || isIteratorEnabled,
|
||||
)}
|
||||
actions={FLOW_ACTIONS}
|
||||
onClick={onActionSelected}
|
||||
/>
|
||||
|
||||
|
||||
-6
@@ -12,12 +12,10 @@ import { DATABASE_TRIGGER_TYPES } from '@/workflow/workflow-trigger/constants/Da
|
||||
import { OTHER_TRIGGER_TYPES } from '@/workflow/workflow-trigger/constants/OtherTriggerTypes';
|
||||
import { useUpdateWorkflowVersionTrigger } from '@/workflow/workflow-trigger/hooks/useUpdateWorkflowVersionTrigger';
|
||||
import { getTriggerDefaultDefinition } from '@/workflow/workflow-trigger/utils/getTriggerDefaultDefinition';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { useTheme } from '@emotion/react';
|
||||
import { TRIGGER_STEP_ID } from 'twenty-shared/workflow';
|
||||
import { useIcons } from 'twenty-ui/display';
|
||||
import { MenuItem } from 'twenty-ui/navigation';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
|
||||
export const CommandMenuWorkflowSelectTriggerTypeContent = ({
|
||||
workflow,
|
||||
@@ -34,9 +32,6 @@ export const CommandMenuWorkflowSelectTriggerTypeContent = ({
|
||||
workflowSelectedNodeComponentState,
|
||||
);
|
||||
const { openWorkflowEditStepInCommandMenu } = useWorkflowCommandMenu();
|
||||
const isIteratorEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IS_WORKFLOW_ITERATOR_ENABLED,
|
||||
);
|
||||
|
||||
const handleTriggerTypeClick = ({
|
||||
type,
|
||||
@@ -53,7 +48,6 @@ export const CommandMenuWorkflowSelectTriggerTypeContent = ({
|
||||
defaultLabel,
|
||||
type,
|
||||
activeNonSystemObjectMetadataItems,
|
||||
isIteratorEnabled,
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
+6
-20
@@ -6,9 +6,7 @@ import {
|
||||
type ManualTriggerWorkflowVersion,
|
||||
type Workflow,
|
||||
} from '@/workflow/types/Workflow';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
|
||||
export const useActiveWorkflowVersionsWithManualTrigger = ({
|
||||
objectMetadataItem,
|
||||
@@ -17,10 +15,6 @@ export const useActiveWorkflowVersionsWithManualTrigger = ({
|
||||
objectMetadataItem?: ObjectMetadataItem;
|
||||
skip?: boolean;
|
||||
}) => {
|
||||
const isIteratorEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IS_WORKFLOW_ITERATOR_ENABLED,
|
||||
);
|
||||
|
||||
const filters = [
|
||||
{
|
||||
status: {
|
||||
@@ -34,20 +28,12 @@ export const useActiveWorkflowVersionsWithManualTrigger = ({
|
||||
},
|
||||
];
|
||||
|
||||
const objectTypeFilter = isIteratorEnabled
|
||||
? {
|
||||
trigger: {
|
||||
like: `%"objectNameSingular": "${objectMetadataItem?.nameSingular}"%`,
|
||||
},
|
||||
}
|
||||
: {
|
||||
trigger: {
|
||||
like: `%"objectType": "${objectMetadataItem?.nameSingular}"%`,
|
||||
},
|
||||
};
|
||||
|
||||
if (isDefined(objectMetadataItem)) {
|
||||
filters.push(objectTypeFilter);
|
||||
filters.push({
|
||||
trigger: {
|
||||
like: `%"objectNameSingular": "${objectMetadataItem?.nameSingular}"%`,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const { records } = useFindManyRecords<
|
||||
@@ -79,7 +65,7 @@ export const useActiveWorkflowVersionsWithManualTrigger = ({
|
||||
(record) =>
|
||||
record.status === 'ACTIVE' &&
|
||||
isDefined(record.trigger) &&
|
||||
isGlobalManualTrigger(record.trigger, isIteratorEnabled),
|
||||
isGlobalManualTrigger(record.trigger),
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,47 +1,18 @@
|
||||
import { stepsOutputSchemaFamilyState } from '@/workflow/states/stepsOutputSchemaFamilyState';
|
||||
import {
|
||||
type WorkflowActionType,
|
||||
type WorkflowVersion,
|
||||
} from '@/workflow/types/Workflow';
|
||||
import { type WorkflowVersion } from '@/workflow/types/Workflow';
|
||||
import { getStepOutputSchemaFamilyStateKey } from '@/workflow/utils/getStepOutputSchemaFamilyStateKey';
|
||||
import { getActionIcon } from '@/workflow/workflow-steps/workflow-actions/utils/getActionIcon';
|
||||
import { getTriggerDefaultLabel } from '@/workflow/workflow-trigger/utils/getTriggerDefaultLabel';
|
||||
import { getTriggerIcon } from '@/workflow/workflow-trigger/utils/getTriggerIcon';
|
||||
import { isFindRecordsOutputSchema } from '@/workflow/workflow-variables/types/guards/isFindRecordsOutputSchema';
|
||||
import {
|
||||
type OutputSchemaV2,
|
||||
type StepOutputSchemaV2,
|
||||
} from '@/workflow/workflow-variables/types/StepOutputSchemaV2';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { useRecoilCallback } from 'recoil';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { TRIGGER_STEP_ID } from 'twenty-shared/workflow';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
|
||||
const getFilteredOutputSchema = ({
|
||||
stepType,
|
||||
outputSchema,
|
||||
isIteratorEnabled,
|
||||
}: {
|
||||
stepType: WorkflowActionType;
|
||||
outputSchema: OutputSchemaV2;
|
||||
isIteratorEnabled: boolean;
|
||||
}) => {
|
||||
if (!isIteratorEnabled && isFindRecordsOutputSchema(stepType, outputSchema)) {
|
||||
const filteredOutputSchema = {
|
||||
...outputSchema,
|
||||
all: undefined,
|
||||
};
|
||||
|
||||
return filteredOutputSchema;
|
||||
}
|
||||
|
||||
return outputSchema;
|
||||
};
|
||||
export const useStepsOutputSchema = () => {
|
||||
const isIteratorEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IS_WORKFLOW_ITERATOR_ENABLED,
|
||||
);
|
||||
const populateStepsOutputSchema = useRecoilCallback(
|
||||
({ set }) =>
|
||||
(workflowVersion: WorkflowVersion) => {
|
||||
@@ -51,11 +22,7 @@ export const useStepsOutputSchema = () => {
|
||||
name: step.name,
|
||||
type: step.type,
|
||||
icon: getActionIcon(step.type),
|
||||
outputSchema: getFilteredOutputSchema({
|
||||
stepType: step.type,
|
||||
outputSchema: step.settings?.outputSchema as OutputSchemaV2,
|
||||
isIteratorEnabled,
|
||||
}),
|
||||
outputSchema: step.settings?.outputSchema as OutputSchemaV2,
|
||||
};
|
||||
|
||||
set(
|
||||
@@ -92,7 +59,7 @@ export const useStepsOutputSchema = () => {
|
||||
);
|
||||
}
|
||||
},
|
||||
[isIteratorEnabled],
|
||||
[],
|
||||
);
|
||||
|
||||
const deleteStepsOutputSchema = useRecoilCallback(
|
||||
|
||||
+1
-20
@@ -19,11 +19,8 @@ import { WorkflowEditActionIterator } from '@/workflow/workflow-steps/workflow-a
|
||||
import { WorkflowEditTriggerCronForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerCronForm';
|
||||
import { WorkflowEditTriggerDatabaseEventForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm';
|
||||
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;
|
||||
@@ -44,10 +41,6 @@ export const WorkflowRunStepNodeDetail = ({
|
||||
steps,
|
||||
});
|
||||
|
||||
const isIteratorEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IS_WORKFLOW_ITERATOR_ENABLED,
|
||||
);
|
||||
|
||||
if (!isDefined(stepDefinition) || !isDefined(stepDefinition.definition)) {
|
||||
return null;
|
||||
}
|
||||
@@ -67,20 +60,8 @@ export const WorkflowRunStepNodeDetail = ({
|
||||
);
|
||||
}
|
||||
case 'MANUAL': {
|
||||
if (isIteratorEnabled) {
|
||||
return (
|
||||
<WorkflowEditTriggerManual
|
||||
key={stepId}
|
||||
trigger={stepDefinition.definition}
|
||||
triggerOptions={{
|
||||
readonly: true,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<WorkflowEditTriggerManualDeprecated
|
||||
<WorkflowEditTriggerManual
|
||||
key={stepId}
|
||||
trigger={stepDefinition.definition}
|
||||
triggerOptions={{
|
||||
|
||||
+1
-17
@@ -18,11 +18,8 @@ import { WorkflowEditActionIterator } from '@/workflow/workflow-steps/workflow-a
|
||||
import { WorkflowEditTriggerCronForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerCronForm';
|
||||
import { WorkflowEditTriggerDatabaseEventForm } from '@/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm';
|
||||
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;
|
||||
@@ -48,9 +45,6 @@ export const WorkflowStepDetail = ({
|
||||
steps,
|
||||
...props
|
||||
}: WorkflowStepDetailProps) => {
|
||||
const isIteratorEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IS_WORKFLOW_ITERATOR_ENABLED,
|
||||
);
|
||||
const stepDefinition = getStepDefinitionOrThrow({
|
||||
stepId,
|
||||
trigger,
|
||||
@@ -74,18 +68,8 @@ export const WorkflowStepDetail = ({
|
||||
);
|
||||
}
|
||||
case 'MANUAL': {
|
||||
if (isIteratorEnabled) {
|
||||
return (
|
||||
<WorkflowEditTriggerManual
|
||||
key={stepId}
|
||||
trigger={stepDefinition.definition}
|
||||
triggerOptions={props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<WorkflowEditTriggerManualDeprecated
|
||||
<WorkflowEditTriggerManual
|
||||
key={stepId}
|
||||
trigger={stepDefinition.definition}
|
||||
triggerOptions={props}
|
||||
|
||||
-244
@@ -1,244 +0,0 @@
|
||||
import { SidePanelHeader } from '@/command-menu/components/SidePanelHeader';
|
||||
import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilteredObjectMetadataItems';
|
||||
import { IconPicker } from '@/ui/input/components/IconPicker';
|
||||
import { Select } from '@/ui/input/components/Select';
|
||||
import { SelectControl } from '@/ui/input/components/SelectControl';
|
||||
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
|
||||
import {
|
||||
type WorkflowManualTrigger,
|
||||
type WorkflowManualTriggerAvailability,
|
||||
} from '@/workflow/types/Workflow';
|
||||
import { WorkflowStepBody } from '@/workflow/workflow-steps/components/WorkflowStepBody';
|
||||
import { MANUAL_TRIGGER_AVAILABILITY_OPTIONS } from '@/workflow/workflow-trigger/constants/ManualTriggerAvailabilityOptions';
|
||||
import { MANUAL_TRIGGER_IS_PINNED_OPTIONS } from '@/workflow/workflow-trigger/constants/ManualTriggerIsPinnedOptions';
|
||||
import { getManualTriggerDefaultSettingsDeprecated } from '@/workflow/workflow-trigger/utils/getManualTriggerDefaultSettingsDeprecated';
|
||||
import { getTriggerDefaultLabel } from '@/workflow/workflow-trigger/utils/getTriggerDefaultLabel';
|
||||
import { getTriggerHeaderType } from '@/workflow/workflow-trigger/utils/getTriggerHeaderType';
|
||||
import { getTriggerIcon } from '@/workflow/workflow-trigger/utils/getTriggerIcon';
|
||||
import { getTriggerIconColor } from '@/workflow/workflow-trigger/utils/getTriggerIconColor';
|
||||
import { useTheme } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { useIcons } from 'twenty-ui/display';
|
||||
import { type SelectOption } from 'twenty-ui/input';
|
||||
|
||||
type WorkflowEditTriggerManualDeprecatedProps = {
|
||||
trigger: WorkflowManualTrigger;
|
||||
triggerOptions:
|
||||
| {
|
||||
readonly: true;
|
||||
onTriggerUpdate?: undefined;
|
||||
}
|
||||
| {
|
||||
readonly?: false;
|
||||
onTriggerUpdate: (trigger: WorkflowManualTrigger) => void;
|
||||
};
|
||||
};
|
||||
|
||||
const StyledLabel = styled.span`
|
||||
color: ${({ theme }) => theme.font.color.light};
|
||||
font-size: ${({ theme }) => theme.font.size.xs};
|
||||
font-weight: ${({ theme }) => theme.font.weight.semiBold};
|
||||
margin-bottom: ${({ theme }) => theme.spacing(1)};
|
||||
`;
|
||||
|
||||
const StyledDescription = styled.span`
|
||||
color: ${({ theme }) => theme.font.color.light};
|
||||
font-size: ${({ theme }) => theme.font.size.sm};
|
||||
margin-top: ${({ theme }) => theme.spacing(0.25)};
|
||||
`;
|
||||
|
||||
const StyledIconPickerContainer = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
`;
|
||||
|
||||
export const WorkflowEditTriggerManualDeprecated = ({
|
||||
trigger,
|
||||
triggerOptions,
|
||||
}: WorkflowEditTriggerManualDeprecatedProps) => {
|
||||
const theme = useTheme();
|
||||
|
||||
const { t } = useLingui();
|
||||
|
||||
const { getIcon } = useIcons();
|
||||
|
||||
const { activeNonSystemObjectMetadataItems } =
|
||||
useFilteredObjectMetadataItems();
|
||||
|
||||
const availableMetadata: Array<SelectOption<string>> =
|
||||
activeNonSystemObjectMetadataItems.map((item) => ({
|
||||
label: item.labelPlural,
|
||||
value: item.nameSingular,
|
||||
Icon: getIcon(item.icon),
|
||||
}));
|
||||
|
||||
const objectType = trigger.settings.objectType;
|
||||
|
||||
const manualTriggerAvailability: WorkflowManualTriggerAvailability =
|
||||
isDefined(objectType) ? 'WHEN_RECORD_SELECTED' : 'EVERYWHERE';
|
||||
|
||||
const headerTitle = trigger.name ?? getTriggerDefaultLabel(trigger);
|
||||
|
||||
const headerIcon = getTriggerIcon(trigger);
|
||||
|
||||
const headerType = getTriggerHeaderType(trigger);
|
||||
|
||||
const availabilityDescriptions = {
|
||||
WHEN_RECORD_SELECTED: t`The selected record(s) will be passed to your workflow`,
|
||||
EVERYWHERE: t`Open the ⌘K to trigger this workflow`,
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<SidePanelHeader
|
||||
onTitleChange={(newName: string) => {
|
||||
if (triggerOptions.readonly === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
triggerOptions.onTriggerUpdate({
|
||||
...trigger,
|
||||
name: newName,
|
||||
});
|
||||
}}
|
||||
Icon={getIcon(headerIcon)}
|
||||
iconColor={getTriggerIconColor({ theme, triggerType: trigger.type })}
|
||||
initialTitle={headerTitle}
|
||||
headerType={headerType}
|
||||
disabled={triggerOptions.readonly}
|
||||
/>
|
||||
<WorkflowStepBody>
|
||||
<IconPicker
|
||||
dropdownId="workflow-edit-manual-trigger-icon"
|
||||
selectedIconKey={trigger.settings.icon}
|
||||
dropdownOffset={{ y: -parseInt(theme.spacing(3), 10) }}
|
||||
dropdownWidth={GenericDropdownContentWidth.ExtraLarge}
|
||||
maxIconsVisible={9 * 8} // 9 columns * 8 lines
|
||||
disabled={triggerOptions.readonly}
|
||||
clickableComponent={
|
||||
<StyledIconPickerContainer
|
||||
onClick={(e) => {
|
||||
if (triggerOptions.readonly === true) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<StyledLabel>{t`Command Icon`}</StyledLabel>
|
||||
<SelectControl
|
||||
isDisabled={triggerOptions.readonly}
|
||||
selectedOption={{
|
||||
Icon: getIcon(trigger.settings.icon),
|
||||
value: trigger.settings.icon || null,
|
||||
label: '',
|
||||
}}
|
||||
/>
|
||||
<StyledDescription>{t`The icon your workflow trigger will display in the command menu`}</StyledDescription>
|
||||
</StyledIconPickerContainer>
|
||||
}
|
||||
onChange={({ iconKey }) => {
|
||||
if (triggerOptions.readonly === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
triggerOptions.onTriggerUpdate({
|
||||
...trigger,
|
||||
settings: {
|
||||
...trigger.settings,
|
||||
icon: iconKey,
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
||||
<Select
|
||||
dropdownId="workflow-edit-manual-trigger-availability"
|
||||
label={t`Availability`}
|
||||
description={availabilityDescriptions[manualTriggerAvailability]}
|
||||
fullWidth
|
||||
disabled={triggerOptions.readonly}
|
||||
value={manualTriggerAvailability}
|
||||
options={MANUAL_TRIGGER_AVAILABILITY_OPTIONS}
|
||||
onChange={(updatedTriggerType) => {
|
||||
if (triggerOptions.readonly === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
triggerOptions.onTriggerUpdate({
|
||||
...trigger,
|
||||
settings: getManualTriggerDefaultSettingsDeprecated({
|
||||
availability: updatedTriggerType,
|
||||
activeNonSystemObjectMetadataItems,
|
||||
icon: trigger.settings.icon,
|
||||
}),
|
||||
});
|
||||
}}
|
||||
dropdownOffset={{ y: parseInt(theme.spacing(1), 10) }}
|
||||
dropdownWidth={GenericDropdownContentWidth.ExtraLarge}
|
||||
/>
|
||||
|
||||
{manualTriggerAvailability === 'WHEN_RECORD_SELECTED' ? (
|
||||
<Select
|
||||
dropdownId="workflow-edit-manual-trigger-object"
|
||||
label={t`Object`}
|
||||
description={t`On which object(s) should this trigger be available`}
|
||||
fullWidth
|
||||
value={objectType}
|
||||
options={availableMetadata}
|
||||
disabled={triggerOptions.readonly}
|
||||
onChange={(updatedObject) => {
|
||||
if (triggerOptions.readonly === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
triggerOptions.onTriggerUpdate({
|
||||
...trigger,
|
||||
settings: {
|
||||
...trigger.settings,
|
||||
availability: {
|
||||
objectNameSingular: updatedObject,
|
||||
type: 'SINGLE_RECORD',
|
||||
},
|
||||
objectType: updatedObject,
|
||||
outputSchema: {},
|
||||
},
|
||||
});
|
||||
}}
|
||||
dropdownOffset={{ y: parseInt(theme.spacing(1), 10) }}
|
||||
dropdownWidth={GenericDropdownContentWidth.ExtraLarge}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{manualTriggerAvailability === 'WHEN_RECORD_SELECTED' ? (
|
||||
<Select
|
||||
dropdownId="workflow-edit-manual-trigger-navbar"
|
||||
label={t`Navbar`}
|
||||
description={t`Display a button in the top navbar to trigger this workflow`}
|
||||
fullWidth
|
||||
value={trigger.settings.isPinned}
|
||||
options={MANUAL_TRIGGER_IS_PINNED_OPTIONS}
|
||||
disabled={triggerOptions.readonly}
|
||||
onChange={(updatedValue) => {
|
||||
if (triggerOptions.readonly === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
triggerOptions.onTriggerUpdate({
|
||||
...trigger,
|
||||
settings: {
|
||||
...trigger.settings,
|
||||
isPinned: updatedValue,
|
||||
outputSchema: {},
|
||||
},
|
||||
});
|
||||
}}
|
||||
dropdownOffset={{ y: parseInt(theme.spacing(1), 10) }}
|
||||
dropdownWidth={GenericDropdownContentWidth.ExtraLarge}
|
||||
/>
|
||||
) : null}
|
||||
</WorkflowStepBody>
|
||||
</>
|
||||
);
|
||||
};
|
||||
-73
@@ -1,73 +0,0 @@
|
||||
import { type WorkflowManualTriggerAvailability } from '@/workflow/types/Workflow';
|
||||
import { COMMAND_MENU_DEFAULT_ICON } from '@/workflow/workflow-trigger/constants/CommandMenuDefaultIcon';
|
||||
import { generatedMockObjectMetadataItems } from '~/testing/utils/generatedMockObjectMetadataItems';
|
||||
import { getManualTriggerDefaultSettingsDeprecated } from '../getManualTriggerDefaultSettingsDeprecated';
|
||||
|
||||
describe('getManualTriggerDefaultSettingsDeprecated', () => {
|
||||
it('returns settings for a manual trigger that can be activated from any where', () => {
|
||||
expect(
|
||||
getManualTriggerDefaultSettingsDeprecated({
|
||||
availability: 'EVERYWHERE',
|
||||
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
|
||||
}),
|
||||
).toStrictEqual({
|
||||
objectType: undefined,
|
||||
outputSchema: {},
|
||||
icon: COMMAND_MENU_DEFAULT_ICON,
|
||||
isPinned: false,
|
||||
availability: {
|
||||
type: 'GLOBAL',
|
||||
locations: [],
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('returns settings for a manual trigger that can be activated from any where', () => {
|
||||
expect(
|
||||
getManualTriggerDefaultSettingsDeprecated({
|
||||
availability: 'WHEN_RECORD_SELECTED',
|
||||
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
|
||||
icon: 'IconTest',
|
||||
}),
|
||||
).toStrictEqual({
|
||||
objectType: generatedMockObjectMetadataItems[0].nameSingular,
|
||||
outputSchema: {},
|
||||
icon: 'IconTest',
|
||||
isPinned: false,
|
||||
availability: {
|
||||
type: 'SINGLE_RECORD',
|
||||
objectNameSingular: generatedMockObjectMetadataItems[0].nameSingular,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('returns settings for WHEN_RECORD_SELECTED with default icon when no custom icon provided', () => {
|
||||
expect(
|
||||
getManualTriggerDefaultSettingsDeprecated({
|
||||
availability: 'WHEN_RECORD_SELECTED',
|
||||
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
|
||||
}),
|
||||
).toStrictEqual({
|
||||
objectType: generatedMockObjectMetadataItems[0].nameSingular,
|
||||
outputSchema: {},
|
||||
icon: COMMAND_MENU_DEFAULT_ICON,
|
||||
isPinned: false,
|
||||
availability: {
|
||||
type: 'SINGLE_RECORD',
|
||||
objectNameSingular: generatedMockObjectMetadataItems[0].nameSingular,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('throws error for unsupported availability type', () => {
|
||||
const invalidAvailability =
|
||||
'INVALID_AVAILABILITY' as WorkflowManualTriggerAvailability;
|
||||
|
||||
expect(() =>
|
||||
getManualTriggerDefaultSettingsDeprecated({
|
||||
availability: invalidAvailability,
|
||||
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
|
||||
}),
|
||||
).toThrow("Didn't expect to get here.");
|
||||
});
|
||||
});
|
||||
+3
-33
@@ -10,7 +10,6 @@ describe('getTriggerDefaultDefinition', () => {
|
||||
defaultLabel: DatabaseTriggerDefaultLabel.RECORD_IS_CREATED,
|
||||
type: 'DATABASE_EVENT',
|
||||
activeNonSystemObjectMetadataItems: [],
|
||||
isIteratorEnabled: false,
|
||||
});
|
||||
}).toThrow();
|
||||
});
|
||||
@@ -21,7 +20,6 @@ describe('getTriggerDefaultDefinition', () => {
|
||||
defaultLabel: DatabaseTriggerDefaultLabel.RECORD_IS_CREATED,
|
||||
type: 'DATABASE_EVENT',
|
||||
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
|
||||
isIteratorEnabled: false,
|
||||
}),
|
||||
).toStrictEqual({
|
||||
type: 'DATABASE_EVENT',
|
||||
@@ -43,7 +41,6 @@ describe('getTriggerDefaultDefinition', () => {
|
||||
defaultLabel: DatabaseTriggerDefaultLabel.RECORD_IS_UPDATED,
|
||||
type: 'DATABASE_EVENT',
|
||||
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
|
||||
isIteratorEnabled: false,
|
||||
}),
|
||||
).toStrictEqual({
|
||||
type: 'DATABASE_EVENT',
|
||||
@@ -65,7 +62,6 @@ describe('getTriggerDefaultDefinition', () => {
|
||||
defaultLabel: DatabaseTriggerDefaultLabel.RECORD_IS_DELETED,
|
||||
type: 'DATABASE_EVENT',
|
||||
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
|
||||
isIteratorEnabled: false,
|
||||
}),
|
||||
).toStrictEqual({
|
||||
type: 'DATABASE_EVENT',
|
||||
@@ -81,48 +77,25 @@ describe('getTriggerDefaultDefinition', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('returns a valid configuration for DATABASE_EVENT trigger type creation', () => {
|
||||
expect(
|
||||
getTriggerDefaultDefinition({
|
||||
defaultLabel: DatabaseTriggerDefaultLabel.RECORD_IS_CREATED,
|
||||
type: 'DATABASE_EVENT',
|
||||
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
|
||||
isIteratorEnabled: false,
|
||||
}),
|
||||
).toStrictEqual({
|
||||
type: 'DATABASE_EVENT',
|
||||
name: 'Record is created',
|
||||
settings: {
|
||||
eventName: `${generatedMockObjectMetadataItems[0].nameSingular}.created`,
|
||||
outputSchema: {},
|
||||
},
|
||||
position: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('returns a valid configuration for MANUAL trigger type', () => {
|
||||
expect(
|
||||
getTriggerDefaultDefinition({
|
||||
defaultLabel: 'Launch manually',
|
||||
type: 'MANUAL',
|
||||
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
|
||||
isIteratorEnabled: false,
|
||||
}),
|
||||
).toStrictEqual({
|
||||
type: 'MANUAL',
|
||||
name: 'Launch manually',
|
||||
settings: {
|
||||
objectType: generatedMockObjectMetadataItems[0].nameSingular,
|
||||
availability: {
|
||||
objectNameSingular: generatedMockObjectMetadataItems[0].nameSingular,
|
||||
type: 'SINGLE_RECORD',
|
||||
type: 'GLOBAL',
|
||||
locations: undefined,
|
||||
},
|
||||
outputSchema: {},
|
||||
icon: COMMAND_MENU_DEFAULT_ICON,
|
||||
isPinned: false,
|
||||
objectType: undefined,
|
||||
},
|
||||
position: {
|
||||
x: 0,
|
||||
@@ -137,7 +110,6 @@ describe('getTriggerDefaultDefinition', () => {
|
||||
defaultLabel: 'On a schedule',
|
||||
type: 'CRON',
|
||||
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
|
||||
isIteratorEnabled: false,
|
||||
}),
|
||||
).toStrictEqual({
|
||||
type: 'CRON',
|
||||
@@ -160,7 +132,6 @@ describe('getTriggerDefaultDefinition', () => {
|
||||
defaultLabel: 'Webhook',
|
||||
type: 'WEBHOOK',
|
||||
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
|
||||
isIteratorEnabled: false,
|
||||
}),
|
||||
).toStrictEqual({
|
||||
type: 'WEBHOOK',
|
||||
@@ -183,7 +154,6 @@ describe('getTriggerDefaultDefinition', () => {
|
||||
defaultLabel: DatabaseTriggerDefaultLabel.RECORD_IS_CREATED,
|
||||
type: 'unknown' as any,
|
||||
activeNonSystemObjectMetadataItems: generatedMockObjectMetadataItems,
|
||||
isIteratorEnabled: false,
|
||||
});
|
||||
}).toThrow('Unknown type: unknown');
|
||||
});
|
||||
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
import { type ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
||||
import {
|
||||
type WorkflowManualTriggerAvailability,
|
||||
type WorkflowManualTriggerSettings,
|
||||
} from '@/workflow/types/Workflow';
|
||||
import { COMMAND_MENU_DEFAULT_ICON } from '@/workflow/workflow-trigger/constants/CommandMenuDefaultIcon';
|
||||
import { assertUnreachable } from 'twenty-shared/utils';
|
||||
|
||||
export const getManualTriggerDefaultSettingsDeprecated = ({
|
||||
availability,
|
||||
activeNonSystemObjectMetadataItems,
|
||||
icon,
|
||||
isPinned,
|
||||
}: {
|
||||
availability: WorkflowManualTriggerAvailability;
|
||||
activeNonSystemObjectMetadataItems: ObjectMetadataItem[];
|
||||
icon?: string;
|
||||
isPinned?: boolean;
|
||||
}): WorkflowManualTriggerSettings => {
|
||||
switch (availability) {
|
||||
case 'EVERYWHERE': {
|
||||
return {
|
||||
objectType: undefined,
|
||||
outputSchema: {},
|
||||
icon: icon || COMMAND_MENU_DEFAULT_ICON,
|
||||
isPinned: isPinned || false,
|
||||
availability: {
|
||||
type: 'GLOBAL',
|
||||
locations: [],
|
||||
},
|
||||
};
|
||||
}
|
||||
case 'WHEN_RECORD_SELECTED': {
|
||||
return {
|
||||
objectType: activeNonSystemObjectMetadataItems[0].nameSingular,
|
||||
outputSchema: {},
|
||||
icon: icon || COMMAND_MENU_DEFAULT_ICON,
|
||||
isPinned: isPinned || false,
|
||||
availability: {
|
||||
type: 'SINGLE_RECORD',
|
||||
objectNameSingular:
|
||||
activeNonSystemObjectMetadataItems[0].nameSingular,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return assertUnreachable(availability);
|
||||
};
|
||||
+2
-15
@@ -5,7 +5,6 @@ import {
|
||||
} from '@/workflow/types/Workflow';
|
||||
import { DATABASE_TRIGGER_TYPES } from '@/workflow/workflow-trigger/constants/DatabaseTriggerTypes';
|
||||
import { getManualTriggerDefaultSettings } from '@/workflow/workflow-trigger/utils/getManualTriggerDefaultSettings';
|
||||
import { getManualTriggerDefaultSettingsDeprecated } from '@/workflow/workflow-trigger/utils/getManualTriggerDefaultSettingsDeprecated';
|
||||
import { assertUnreachable } from 'twenty-shared/utils';
|
||||
|
||||
// TODO: This needs to be migrated to the server
|
||||
@@ -13,12 +12,10 @@ export const getTriggerDefaultDefinition = ({
|
||||
defaultLabel,
|
||||
type,
|
||||
activeNonSystemObjectMetadataItems,
|
||||
isIteratorEnabled,
|
||||
}: {
|
||||
defaultLabel: string;
|
||||
type: WorkflowTriggerType;
|
||||
activeNonSystemObjectMetadataItems: ObjectMetadataItem[];
|
||||
isIteratorEnabled: boolean;
|
||||
}): WorkflowTrigger => {
|
||||
if (activeNonSystemObjectMetadataItems.length === 0) {
|
||||
throw new Error(
|
||||
@@ -47,21 +44,11 @@ export const getTriggerDefaultDefinition = ({
|
||||
};
|
||||
}
|
||||
case 'MANUAL': {
|
||||
if (isIteratorEnabled) {
|
||||
return {
|
||||
...baseTriggerDefinition,
|
||||
type,
|
||||
settings: getManualTriggerDefaultSettings({
|
||||
availabilityType: 'GLOBAL',
|
||||
activeNonSystemObjectMetadataItems,
|
||||
}),
|
||||
};
|
||||
}
|
||||
return {
|
||||
...baseTriggerDefinition,
|
||||
type,
|
||||
settings: getManualTriggerDefaultSettingsDeprecated({
|
||||
availability: 'WHEN_RECORD_SELECTED',
|
||||
settings: getManualTriggerDefaultSettings({
|
||||
availabilityType: 'GLOBAL',
|
||||
activeNonSystemObjectMetadataItems,
|
||||
}),
|
||||
};
|
||||
|
||||
-9
@@ -31,15 +31,6 @@ export const PUBLIC_FEATURE_FLAGS: PublicFeatureFlag[] = [
|
||||
'https://twenty.com/images/lab/is-message-folder-control-enabled.png',
|
||||
},
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IS_WORKFLOW_ITERATOR_ENABLED,
|
||||
metadata: {
|
||||
label: 'Workflow Iterator',
|
||||
description: 'Iterate over a list of items in a workflow',
|
||||
imagePath:
|
||||
'https://twenty.com/images/lab/is-workflow-iterator-enabled.png',
|
||||
},
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IS_CALENDAR_VIEW_ENABLED,
|
||||
metadata: {
|
||||
|
||||
-1
@@ -15,7 +15,6 @@ export enum FeatureFlagKey {
|
||||
IS_PAGE_LAYOUT_ENABLED = 'IS_PAGE_LAYOUT_ENABLED',
|
||||
IS_RECORD_PAGE_LAYOUT_ENABLED = 'IS_RECORD_PAGE_LAYOUT_ENABLED',
|
||||
IS_MESSAGE_FOLDER_CONTROL_ENABLED = 'IS_MESSAGE_FOLDER_CONTROL_ENABLED',
|
||||
IS_WORKFLOW_ITERATOR_ENABLED = 'IS_WORKFLOW_ITERATOR_ENABLED',
|
||||
IS_CALENDAR_VIEW_ENABLED = 'IS_CALENDAR_VIEW_ENABLED',
|
||||
IS_GROUP_BY_ENABLED = 'IS_GROUP_BY_ENABLED',
|
||||
IS_PUBLIC_DOMAIN_ENABLED = 'IS_PUBLIC_DOMAIN_ENABLED',
|
||||
|
||||
-2
@@ -138,7 +138,6 @@ describe('WorkspaceEntityManager', () => {
|
||||
IS_PAGE_LAYOUT_ENABLED: false,
|
||||
IS_RECORD_PAGE_LAYOUT_ENABLED: false,
|
||||
IS_MESSAGE_FOLDER_CONTROL_ENABLED: false,
|
||||
IS_WORKFLOW_ITERATOR_ENABLED: false,
|
||||
IS_CALENDAR_VIEW_ENABLED: false,
|
||||
IS_GROUP_BY_ENABLED: true,
|
||||
IS_PUBLIC_DOMAIN_ENABLED: false,
|
||||
@@ -177,7 +176,6 @@ describe('WorkspaceEntityManager', () => {
|
||||
IS_EMAILING_DOMAIN_ENABLED: false,
|
||||
IS_DYNAMIC_SEARCH_FIELDS_ENABLED: false,
|
||||
IS_COMMON_API_ENABLED: false,
|
||||
IS_WORKFLOW_ITERATOR_ENABLED: false,
|
||||
},
|
||||
permissionsPerRoleId: {},
|
||||
} as WorkspaceDataSource;
|
||||
|
||||
-5
@@ -76,11 +76,6 @@ export const seedFeatureFlags = async (
|
||||
workspaceId: workspaceId,
|
||||
value: false,
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IS_WORKFLOW_ITERATOR_ENABLED,
|
||||
workspaceId: workspaceId,
|
||||
value: false,
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IS_CALENDAR_VIEW_ENABLED,
|
||||
workspaceId: workspaceId,
|
||||
|
||||
+5
-1
@@ -87,7 +87,11 @@ export const prefillWorkflows = async (
|
||||
trigger: JSON.stringify({
|
||||
name: 'Launch manually',
|
||||
type: 'MANUAL',
|
||||
settings: { outputSchema: {}, icon: 'IconUserPlus' },
|
||||
settings: {
|
||||
outputSchema: {},
|
||||
icon: 'IconUserPlus',
|
||||
availability: { type: 'GLOBAL', locations: undefined },
|
||||
},
|
||||
nextStepIds: ['6e089bc9-aabd-435f-865f-f31c01c8f4a7'],
|
||||
}),
|
||||
steps: JSON.stringify([
|
||||
|
||||
+2
-19
@@ -14,8 +14,6 @@ import {
|
||||
|
||||
import { type DatabaseEventAction } from 'src/engine/api/graphql/graphql-query-runner/enums/database-event-action';
|
||||
import { checkStringIsDatabaseEventAction } from 'src/engine/api/graphql/graphql-query-runner/utils/check-string-is-database-event-action';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
|
||||
import { generateFakeValue } from 'src/engine/utils/generate-fake-value';
|
||||
import { WorkflowCommonWorkspaceService } from 'src/modules/workflow/common/workspace-services/workflow-common.workspace-service';
|
||||
import { DEFAULT_ITERATOR_CURRENT_ITEM } from 'src/modules/workflow/workflow-builder/workflow-schema/constants/default-iterator-current-item.const';
|
||||
@@ -44,7 +42,6 @@ import {
|
||||
export class WorkflowSchemaWorkspaceService {
|
||||
constructor(
|
||||
private readonly workflowCommonWorkspaceService: WorkflowCommonWorkspaceService,
|
||||
private readonly featureFlagService: FeatureFlagService,
|
||||
) {}
|
||||
|
||||
async computeStepOutputSchema({
|
||||
@@ -66,29 +63,15 @@ export class WorkflowSchemaWorkspaceService {
|
||||
});
|
||||
}
|
||||
case WorkflowTriggerType.MANUAL: {
|
||||
const isIteratorEnabled =
|
||||
await this.featureFlagService.isFeatureEnabled(
|
||||
FeatureFlagKey.IS_WORKFLOW_ITERATOR_ENABLED,
|
||||
workspaceId,
|
||||
);
|
||||
const { availability } = step.settings;
|
||||
|
||||
const { objectType, availability } = step.settings;
|
||||
|
||||
if (isDefined(availability) && isIteratorEnabled) {
|
||||
if (isDefined(availability)) {
|
||||
return this.computeTriggerOutputSchemaFromAvailability({
|
||||
availability,
|
||||
workspaceId,
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: to be deprecated once all triggers are migrated to the new availability type
|
||||
if (isDefined(objectType)) {
|
||||
return this.computeRecordOutputSchema({
|
||||
objectType,
|
||||
workspaceId,
|
||||
});
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
case WorkflowTriggerType.WEBHOOK:
|
||||
|
||||
Reference in New Issue
Block a user