diff --git a/src/components/FieldWithHelp.tsx b/src/components/FieldWithHelp.tsx index cf52635..046c039 100644 --- a/src/components/FieldWithHelp.tsx +++ b/src/components/FieldWithHelp.tsx @@ -23,6 +23,7 @@ interface FieldWithHelpProps { max?: number; step?: number; className?: string; + nodeType?: string; } export const FieldWithHelp: React.FC = ({ @@ -37,9 +38,10 @@ export const FieldWithHelp: React.FC = ({ max, step, className = "", + nodeType, }) => { const [showHelp, setShowHelp] = useState(false); - const fieldConfig = getFieldConfig(fieldName); + const fieldConfig = getFieldConfig(fieldName, nodeType); if (!fieldConfig) { // Fallback for unknown fields diff --git a/src/components/NodeConfiguration.tsx b/src/components/NodeConfiguration.tsx index e452bd4..bc34ce6 100644 --- a/src/components/NodeConfiguration.tsx +++ b/src/components/NodeConfiguration.tsx @@ -526,6 +526,7 @@ Return only the optimized prompt:`, min={field.min} max={field.max} step={field.step} + nodeType={data.type} /> {data.type === "llmTask" && field.key === "prompt" && (
@@ -577,6 +578,7 @@ Return only the optimized prompt:`, onChange={handleLabelChange} type="text" placeholder="Enter node label" + nodeType={data.type} /> {config.fields.map((field) => ( diff --git a/src/config/fieldConfigs.ts b/src/config/fieldConfigs.ts index aaaeedd..1d36bc5 100644 --- a/src/config/fieldConfigs.ts +++ b/src/config/fieldConfigs.ts @@ -220,7 +220,8 @@ export const fieldConfigs: Record = { required: true, }, }, - operation: { + // Database operation field + "database.operation": { technicalName: "operation", userFriendlyName: "Database operation", description: "Choose what type of database operation to perform", @@ -238,6 +239,25 @@ export const fieldConfigs: Record = { required: true, }, }, + // Slack operation field + "slack.operation": { + technicalName: "operation", + userFriendlyName: "Slack operation", + description: "Choose what type of Slack operation to perform", + helpText: + "Select the type of Slack operation you want to perform. Each operation has different configuration options.", + examples: [ + "Message - Send messages to channels or users", + "Channel - Create, archive, or manage channels", + "User - Invite, remove, or manage users", + "File - Upload and manage files", + "Reaction - Add/remove reactions to messages", + "Reminder - Set reminders for users", + ], + validation: { + required: true, + }, + }, // Output Fields format: { @@ -350,7 +370,19 @@ export const fieldConfigs: Record = { }, }; -export const getFieldConfig = (fieldName: string): FieldConfig | null => { +export const getFieldConfig = ( + fieldName: string, + nodeType?: string +): FieldConfig | null => { + // First try to get node-specific field config + if (nodeType) { + const nodeSpecificKey = `${nodeType}.${fieldName}`; + if (fieldConfigs[nodeSpecificKey]) { + return fieldConfigs[nodeSpecificKey]; + } + } + + // Fallback to generic field config return fieldConfigs[fieldName] || null; };