Skip to content
Merged
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
9 changes: 6 additions & 3 deletions ui/src/store/workflowStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ const useWorkflowStore = create<WorkflowStore>((set, get) => ({
},

updateNodeConfig: (id, config) => {
get().pushHistory();
set({
nodes: get().nodes.map((n) =>
n.id === id ? { ...n, data: { ...n.data, config: { ...n.data.config, ...config } } } : n
Expand All @@ -190,6 +191,7 @@ const useWorkflowStore = create<WorkflowStore>((set, get) => ({
},

updateNodeName: (id, name) => {
get().pushHistory();
set({
nodes: get().nodes.map((n) =>
n.id === id ? { ...n, data: { ...n.data, label: name } } : n
Expand All @@ -216,14 +218,15 @@ const useWorkflowStore = create<WorkflowStore>((set, get) => ({

function nodeComponentType(moduleType: string): string {
if (moduleType.startsWith('http.middleware.')) return 'middlewareNode';
if (moduleType.startsWith('http.')) return 'httpNode';
if (moduleType === 'api.handler') return 'httpNode';
if (moduleType === 'http.server') return 'httpNode';
if (moduleType.startsWith('http.')) return 'httpRouterNode';
if (moduleType === 'api.handler') return 'httpRouterNode';
if (moduleType.startsWith('messaging.')) return 'messagingNode';
if (moduleType.startsWith('statemachine.') || moduleType.startsWith('state.')) return 'stateMachineNode';
if (moduleType === 'scheduler.modular') return 'schedulerNode';
if (moduleType === 'eventlogger.modular' || moduleType === 'eventbus.modular') return 'eventNode';
if (moduleType === 'httpclient.modular') return 'integrationNode';
if (moduleType === 'chimux.router') return 'httpNode';
if (moduleType === 'chimux.router') return 'httpRouterNode';
return 'infrastructureNode';
}

Expand Down
2 changes: 1 addition & 1 deletion ui/src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export async function listDynamicComponents(): Promise<DynamicComponent[]> {
export async function createDynamicComponent(name: string, source: string, language: string): Promise<void> {
await apiFetch<void>('/dynamic/components', {
method: 'POST',
body: JSON.stringify({ name, source, language }),
body: JSON.stringify({ id: name, source, language }),
});
}

Expand Down
7 changes: 4 additions & 3 deletions ui/src/utils/serialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,15 @@ export function configToNodes(config: WorkflowConfig): {

function nodeComponentType(moduleType: string): string {
if (moduleType.startsWith('http.middleware.')) return 'middlewareNode';
if (moduleType.startsWith('http.')) return 'httpNode';
if (moduleType === 'api.handler') return 'httpNode';
if (moduleType === 'http.server') return 'httpNode';
if (moduleType.startsWith('http.')) return 'httpRouterNode';
if (moduleType === 'api.handler') return 'httpRouterNode';
if (moduleType.startsWith('messaging.')) return 'messagingNode';
if (moduleType.startsWith('statemachine.') || moduleType.startsWith('state.')) return 'stateMachineNode';
if (moduleType === 'scheduler.modular') return 'schedulerNode';
if (moduleType === 'eventlogger.modular' || moduleType === 'eventbus.modular') return 'eventNode';
if (moduleType === 'httpclient.modular') return 'integrationNode';
if (moduleType === 'chimux.router') return 'httpNode';
if (moduleType === 'chimux.router') return 'httpRouterNode';
return 'infrastructureNode';
}

Expand Down
Loading