Skip to content

Commit 0a8dba7

Browse files
committed
feat: enhance suggestion handling by updating types and grouping logic for improved data representation
1 parent 1846340 commit 0a8dba7

11 files changed

Lines changed: 73 additions & 325 deletions

src/packages/ce/src/flow/components/panels/FlowPanelControlComponent.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import {Flow, NodeFunction} from "@code0-tech/sagittarius-graphql-types";
2+
import {Flow, LiteralValue, NodeFunction, ReferenceValue} from "@code0-tech/sagittarius-graphql-types";
33
import {
44
Badge,
55
Button,
@@ -15,7 +15,6 @@ import {Panel} from "@xyflow/react";
1515
import {ButtonGroup} from "@code0-tech/pictor/dist/components/button-group/ButtonGroup";
1616
import {FlowService} from "@edition/flow/services/Flow.service";
1717
import {SuggestionDialogComponent} from "@edition/function/components/suggestion/SuggestionDialogComponent";
18-
import {FunctionSuggestion} from "@edition/function/components/suggestion/FunctionSuggestionComponent.view";
1918
import {Suggestion} from "@edition/function/components/suggestion/Suggestion.util";
2019
import {useHotkeys} from "react-hotkeys-hook";
2120
import {useSelectedFunctionNode} from "@edition/function/hooks/FunctionNode.selected.hook";
@@ -51,14 +50,14 @@ export const FlowPanelControlComponent: React.FC<FlowPanelControlComponentProps>
5150
})
5251
}, [selectedNode, flowService, flowStore])
5352

54-
const addNodeToFlow = React.useCallback((suggestion: FunctionSuggestion | Suggestion) => {
55-
if (flowId && suggestion.value.__typename === "NodeFunction" && selectedNode?.id.includes("NodeFunction")) {
53+
const addNodeToFlow = React.useCallback((suggestion: NodeFunction | ReferenceValue | LiteralValue) => {
54+
if (flowId && suggestion.__typename === "NodeFunction" && selectedNode?.id.includes("NodeFunction")) {
5655
startTransition(async () => {
57-
await flowService.addNextNodeById(flowId, selectedNode?.id as NodeFunction['id'], suggestion.value as NodeFunction)
56+
await flowService.addNextNodeById(flowId, selectedNode?.id as NodeFunction['id'], suggestion as NodeFunction)
5857
})
59-
} else if (suggestion.value.__typename === "NodeFunction") {
58+
} else if (suggestion.__typename === "NodeFunction") {
6059
startTransition(async () => {
61-
await flowService.addNextNodeById(flowId, null, suggestion.value as NodeFunction)
60+
await flowService.addNextNodeById(flowId, null, suggestion as NodeFunction)
6261
})
6362
}
6463
}, [flowId, flowService, flowStore, selectedNode])

src/packages/ce/src/function/components/suggestion/FunctionSuggestionComponent.view.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/packages/ce/src/function/components/suggestion/FunctionSuggestionMenuComponent.tsx

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/packages/ce/src/function/components/suggestion/FunctionSuggestionMenuComponent.util.tsx

Lines changed: 0 additions & 69 deletions
This file was deleted.

src/packages/ce/src/function/components/suggestion/FunctionSuggestionMenuFooterComponent.tsx

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/packages/ce/src/function/components/suggestion/FunctionSuggestionSearchBarComponent.tsx

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/packages/ce/src/function/components/suggestion/FunctionSuggestionSearchInput.style.scss

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/packages/ce/src/function/components/suggestion/FunctionSuggestionSearchInputComponent.tsx

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)