|
4 | 4 | ExecutionError, |
5 | 5 | ExecutionParameterResult, |
6 | 6 | ExecutionResult, |
7 | | - Flow, |
| 7 | + Flow, FunctionDefinition, |
8 | 8 | Maybe, |
9 | 9 | Namespace, |
10 | 10 | NamespaceProject, |
@@ -57,7 +57,7 @@ export interface NodeGanttItem extends GanttItem { |
57 | 57 | data?: { |
58 | 58 | displayMessage: string |
59 | 59 | color: string |
60 | | - payload?: Maybe<NodeFunction> | Maybe<Flow> |
| 60 | + payload?: Maybe<NodeFunction> | Maybe<FunctionDefinition> | Maybe<Flow> |
61 | 61 | input?: ExecutionParameterResult[] | object |
62 | 62 | success?: object |
63 | 63 | error?: Maybe<ExecutionError> |
@@ -142,6 +142,25 @@ export const FlowExecutionResultView: React.FC = () => { |
142 | 142 | }, |
143 | 143 | ...(result?.nodeResults?.nodes?.map?.(nodeResult => { |
144 | 144 |
|
| 145 | + if (nodeResult?.functionDefinition) { |
| 146 | + const funktion = functions.find(f => f.id === nodeResult?.functionDefinition?.id) |
| 147 | + |
| 148 | + return { |
| 149 | + id: nodeResult?.id as string, |
| 150 | + type: "function", |
| 151 | + start: (nodeResult?.startedAt ?? 0) - (result?.startedAt ?? 0), |
| 152 | + end: (nodeResult?.finishedAt ?? 0) - (result?.startedAt ?? 0), |
| 153 | + data: { |
| 154 | + displayMessage: funktion?.names?.[0].content ?? FALLBACK_FUNCTION_NAME, |
| 155 | + color: hashToColor(funktion?.identifier ?? ""), |
| 156 | + payload: funktion, |
| 157 | + success: nodeResult?.success, |
| 158 | + input: nodeResult?.parameterResults ?? [], |
| 159 | + error: nodeResult?.error, |
| 160 | + } |
| 161 | + } |
| 162 | + } |
| 163 | + |
145 | 164 | const node = flow?.nodes?.nodes?.find(n => n?.id === nodeResult?.nodeFunction?.id) |
146 | 165 | const funktion = functions.find(f => f.id === nodeResult?.nodeFunction?.functionDefinition?.id) |
147 | 166 |
|
@@ -252,7 +271,7 @@ export const FlowExecutionResultView: React.FC = () => { |
252 | 271 | } else { |
253 | 272 |
|
254 | 273 | const DisplayIcon = icon( |
255 | | - item.type === "node" ? item?.data?.payload?.functionDefinition?.displayIcon : item?.data?.payload?.type?.displayIcon, |
| 274 | + item.type === "node" ? item?.data?.payload?.functionDefinition?.displayIcon : item.type === "function" ? item?.data?.payload?.displayIcon : item?.data?.payload?.type?.displayIcon, |
256 | 275 | ) |
257 | 276 |
|
258 | 277 | return <Tooltip key={item.id}> |
|
0 commit comments