Feat: When saving the canvas, other dls parameters passed from the backend 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)
This commit is contained in:
parent
13ff463845
commit
d47ee88454
@ -35,10 +35,10 @@ export function NextNodePopover({ children, nodeId, name }: IProps) {
|
|||||||
|
|
||||||
const inputs: Array<{ component_id: string; content: string }> = get(
|
const inputs: Array<{ component_id: string; content: string }> = get(
|
||||||
component,
|
component,
|
||||||
['obj', 'params', 'inputs'],
|
['obj', 'inputs'],
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
const output = get(component, ['obj', 'params', 'output'], {});
|
const output = get(component, ['obj', 'output'], {});
|
||||||
const { replacedOutput } = useReplaceIdWithText(output);
|
const { replacedOutput } = useReplaceIdWithText(output);
|
||||||
const stopPropagation: MouseEventHandler = useCallback((e) => {
|
const stopPropagation: MouseEventHandler = useCallback((e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|||||||
@ -268,6 +268,7 @@ export const useSaveGraph = () => {
|
|||||||
const dslComponents = buildDslComponentsByGraph(
|
const dslComponents = buildDslComponentsByGraph(
|
||||||
currentNodes ?? nodes,
|
currentNodes ?? nodes,
|
||||||
edges,
|
edges,
|
||||||
|
data.dsl.components,
|
||||||
);
|
);
|
||||||
return setFlow({
|
return setFlow({
|
||||||
id,
|
id,
|
||||||
|
|||||||
@ -119,6 +119,7 @@ const buildOperatorParams = (operatorName: string) =>
|
|||||||
export const buildDslComponentsByGraph = (
|
export const buildDslComponentsByGraph = (
|
||||||
nodes: Node<NodeData>[],
|
nodes: Node<NodeData>[],
|
||||||
edges: Edge[],
|
edges: Edge[],
|
||||||
|
oldDslComponents: DSLComponents,
|
||||||
): DSLComponents => {
|
): DSLComponents => {
|
||||||
const components: DSLComponents = {};
|
const components: DSLComponents = {};
|
||||||
|
|
||||||
@ -129,6 +130,7 @@ export const buildDslComponentsByGraph = (
|
|||||||
const operatorName = x.data.label;
|
const operatorName = x.data.label;
|
||||||
components[id] = {
|
components[id] = {
|
||||||
obj: {
|
obj: {
|
||||||
|
...(oldDslComponents[id]?.obj ?? {}),
|
||||||
component_name: operatorName,
|
component_name: operatorName,
|
||||||
params:
|
params:
|
||||||
buildOperatorParams(operatorName)(
|
buildOperatorParams(operatorName)(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user