-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: duration & endtime in queries history #1169
Changes from 1 commit
d936243
0b1ad4d
bca3ec8
25f1deb
7c277a9
48a5ad9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ import { | |
goToPreviousQuery, | ||
saveQueryToHistory, | ||
setTenantPath, | ||
updateQueryInHistory, | ||
} from '../../../../store/reducers/executeQuery'; | ||
import {explainQueryApi} from '../../../../store/reducers/explainQuery/explainQuery'; | ||
import type {PreparedExplainResponse} from '../../../../store/reducers/explainQuery/types'; | ||
|
@@ -84,6 +85,7 @@ interface QueryEditorProps { | |
showPreview: boolean; | ||
setShowPreview: (...args: Parameters<typeof setShowPreview>) => void; | ||
saveQueryToHistory: (...args: Parameters<typeof saveQueryToHistory>) => void; | ||
updateQueryInHistory: (...args: Parameters<typeof updateQueryInHistory>) => void; | ||
} | ||
|
||
function QueryEditor(props: QueryEditorProps) { | ||
|
@@ -170,6 +172,10 @@ function QueryEditor(props: QueryEditorProps) { | |
schema, | ||
enableTracingLevel, | ||
queryId, | ||
}).then((res) => { | ||
if ('data' in res) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. better avoid this logic here and make bindings in redux, but I didn't find the may to mix rtk and our reducer without full refactoring There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a |
||
props.updateQueryInHistory(res.data.stats, queryId); | ||
} | ||
}); | ||
setIsResultLoaded(true); | ||
props.setShowPreview(false); | ||
|
@@ -179,7 +185,7 @@ function QueryEditor(props: QueryEditorProps) { | |
if (!text) { | ||
const {queries, currentIndex} = history; | ||
if (query !== queries[currentIndex]?.queryText) { | ||
props.saveQueryToHistory(input); | ||
props.saveQueryToHistory(input, queryId); | ||
} | ||
} | ||
dispatchResultVisibilityState(PaneVisibilityActionTypes.triggerExpand); | ||
|
@@ -413,6 +419,7 @@ const mapStateToProps = (state: RootState) => { | |
|
||
const mapDispatchToProps = { | ||
saveQueryToHistory, | ||
updateQueryInHistory, | ||
goToPreviousQuery, | ||
goToNextQuery, | ||
setShowPreview, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
row.endTime.toString()
instead ofrow.endTime as string
, it more error proof