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:
@@ -1,7 +1,7 @@
|
||||
import { z } from 'zod';
|
||||
import { baseTriggerSchema } from './base-trigger-schema';
|
||||
|
||||
export const workflowManualTriggerSchema = baseTriggerSchema
|
||||
export const workflowManualTriggerSchema = baseTriggerSchema
|
||||
.extend({
|
||||
type: z.literal('MANUAL'),
|
||||
settings: z.object({
|
||||
@@ -13,8 +13,25 @@ export const workflowManualTriggerSchema = baseTriggerSchema
|
||||
),
|
||||
icon: z.string().optional(),
|
||||
isPinned: z.boolean().optional(),
|
||||
availability: z
|
||||
.discriminatedUnion('type', [
|
||||
z.object({
|
||||
type: z.literal('GLOBAL'),
|
||||
locations: z.array(z.string()).optional(),
|
||||
}),
|
||||
z.object({
|
||||
type: z.literal('SINGLE_RECORD'),
|
||||
objectNameSingular: z.string(),
|
||||
}),
|
||||
z.object({
|
||||
type: z.literal('BULK_RECORDS'),
|
||||
objectNameSingular: z.string(),
|
||||
}),
|
||||
])
|
||||
.optional()
|
||||
.nullable(),
|
||||
}),
|
||||
})
|
||||
.describe(
|
||||
'Manual trigger that can be launched by the user. If a record is selected when launched, it is accessible via {{trigger.record.fieldName}}. If no record is selected, no data context is available.',
|
||||
);
|
||||
);
|
||||
Reference in New Issue
Block a user