bitflicker64 commented on code in PR #824:
URL:
https://github.com/apache/hugegraph-toolchain/pull/824#discussion_r4301038770
##########
hugegraph-hubble/hubble-fe/src/modules/analysis/Home/index.js:
##########
@@ -565,9 +593,10 @@ const AnalysisHome = () => {
setSortMode(sort.order === 'ascend' ? 'asc' : 'desc');
}, []);
- const handleClickLoadContent = useCallback(content => {
+ const handleClickLoadContent = useCallback((content, text) => {
resetCodeEditorContent(content);
- }, [resetCodeEditorContent]);
+ text2gql.loadSource(text);
Review Comment:
Minor: Loading a history or favorite statement in the Gremlin or Cypher tab
now clears the current result.
`handleClickLoadContent` calls `text2gql.loadSource(text)` in every tab, and
`loadSource` calls `clearResult` (`initQueryResult`), which resets the status
to STANDBY, empties the result and closes the panel. Before this change, Load
only replaced the editor content. Example: run `g.V().limit(10)` in the Gremlin
tab, open the history, click Load on an older row, and the graph view is gone.
Call `loadSource` only when `analysisMode === TEXT2GQL`, and add a Home test
that Load in the Gremlin tab keeps the result.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]