Skip to content

Commit

Permalink
Feat: When saving the canvas, other dls parameters passed from the ba…
Browse files Browse the repository at this point in the history
…ckend are spliced ​​into the dsl parameters #3355 (#3558)

### What problem does this PR solve?

Feat: When saving the canvas, other dls parameters passed from the
backend are spliced ​​into the dsl parameters #3355
#3556

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
  • Loading branch information
cike8899 authored Nov 21, 2024
1 parent 13ff463 commit d47ee88
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/src/pages/flow/canvas/node/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ export function NextNodePopover({ children, nodeId, name }: IProps) {

const inputs: Array<{ component_id: string; content: string }> = get(
component,
['obj', 'params', 'inputs'],
['obj', 'inputs'],
[],
);
const output = get(component, ['obj', 'params', 'output'], {});
const output = get(component, ['obj', 'output'], {});
const { replacedOutput } = useReplaceIdWithText(output);
const stopPropagation: MouseEventHandler = useCallback((e) => {
e.stopPropagation();
Expand Down
1 change: 1 addition & 0 deletions web/src/pages/flow/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ export const useSaveGraph = () => {
const dslComponents = buildDslComponentsByGraph(
currentNodes ?? nodes,
edges,
data.dsl.components,
);
return setFlow({
id,
Expand Down
2 changes: 2 additions & 0 deletions web/src/pages/flow/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const buildOperatorParams = (operatorName: string) =>
export const buildDslComponentsByGraph = (
nodes: Node<NodeData>[],
edges: Edge[],
oldDslComponents: DSLComponents,
): DSLComponents => {
const components: DSLComponents = {};

Expand All @@ -129,6 +130,7 @@ export const buildDslComponentsByGraph = (
const operatorName = x.data.label;
components[id] = {
obj: {
...(oldDslComponents[id]?.obj ?? {}),
component_name: operatorName,
params:
buildOperatorParams(operatorName)(
Expand Down

0 comments on commit d47ee88

Please sign in to comment.