feat: display the debugging results of each operator in a pop-up window #918 (#1445)

### What problem does this PR solve?

feat: display the debugging results of each operator in a pop-up window
#918
### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-07-09 16:34:59 +08:00
committed by GitHub
parent 198a8b6592
commit fb66b1e726
8 changed files with 250 additions and 148 deletions

View File

@ -38,7 +38,11 @@ import {
initialRewriteQuestionValues,
} from './constant';
import useGraphStore, { RFState } from './store';
import { buildDslComponentsByGraph, receiveMessageError } from './utils';
import {
buildDslComponentsByGraph,
receiveMessageError,
replaceIdWithText,
} from './utils';
const selector = (state: RFState) => ({
nodes: state.nodes,
@ -376,3 +380,13 @@ export const useSaveGraphBeforeOpeningDebugDrawer = (show: () => void) => {
return handleRun;
};
export const useReplaceIdWithText = (output: unknown) => {
const getNode = useGraphStore((state) => state.getNode);
const getNameById = (id?: string) => {
return getNode(id)?.data.name;
};
return replaceIdWithText(output, getNameById);
};