Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified screenshots/truth/node-type-selector/split-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 24 additions & 2 deletions src/flow/NodeEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,18 @@ export class NodeEditor extends RapidElement {
const actionConfig = ACTION_CONFIG[this.action.type];

if (actionConfig?.toFormData) {
this.formData = actionConfig.toFormData(this.action);
const formDataOrPromise = actionConfig.toFormData(this.action);
if (formDataOrPromise instanceof Promise) {
formDataOrPromise.then((formData) => {
this.formData = formData;
this.processFormDataForEditing();
this.originalFormData = JSON.parse(JSON.stringify(this.formData));
this.requestUpdate();
});
return; // Exit early, will update when promise resolves
} else {
this.formData = formDataOrPromise;
}
} else {
this.formData = { ...this.action };
}
Expand All @@ -385,7 +396,18 @@ export class NodeEditor extends RapidElement {
// Node editing mode - use node config
const nodeConfig = this.getNodeConfig();
if (nodeConfig?.toFormData) {
this.formData = nodeConfig.toFormData(this.node, this.nodeUI);
const formDataOrPromise = nodeConfig.toFormData(this.node, this.nodeUI);
if (formDataOrPromise instanceof Promise) {
formDataOrPromise.then((formData) => {
this.formData = formData;
this.processFormDataForEditing();
this.originalFormData = JSON.parse(JSON.stringify(this.formData));
this.requestUpdate();
});
return; // Exit early, will update when promise resolves
} else {
this.formData = formDataOrPromise;
}
} else {
this.formData = { ...this.node };
}
Expand Down
2 changes: 1 addition & 1 deletion src/flow/actions/set_contact_language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const set_contact_language: ActionConfig = {
valueKey: 'value',
nameKey: 'name',
helpText: 'Select the language to set for the contact',
getDynamicOptions: () => {
getDynamicOptions: (_formData?: Record<string, any>) => {
const store = getStore();
const workspace = store?.getState().workspace;
if (workspace?.languages && Array.isArray(workspace.languages)) {
Expand Down
2 changes: 1 addition & 1 deletion src/flow/actions/set_run_result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const set_run_result: ActionConfig = {
},
searchable: true,
clearable: false,
getDynamicOptions: () => {
getDynamicOptions: (_formData?: Record<string, any>) => {
const store = getStore();
return store
? store
Expand Down
3 changes: 2 additions & 1 deletion src/flow/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { split_by_subflow } from './nodes/split_by_subflow';
import { split_by_ticket } from './nodes/split_by_ticket';
import { split_by_webhook } from './nodes/split_by_webhook';
import { split_by_resthook } from './nodes/split_by_resthook';
import { split_by_intent } from './nodes/split_by_intent';
import { split_by_llm } from './nodes/split_by_llm';
import { split_by_llm_categorize } from './nodes/split_by_llm_categorize';
import { wait_for_audio } from './nodes/wait_for_audio';
Expand Down Expand Up @@ -71,7 +72,6 @@ export const NODE_CONFIG: {
[key: string]: NodeConfig;
} = {
execute_actions,

split_by_contact_field,
split_by_expression,
split_by_groups,
Expand All @@ -84,6 +84,7 @@ export const NODE_CONFIG: {
split_by_ticket,
split_by_webhook,
split_by_resthook,
split_by_intent,
wait_for_audio,
wait_for_digits,
wait_for_image,
Expand Down
Loading