-
Notifications
You must be signed in to change notification settings - Fork 14
fix: unnecessary background refresh on query page #1256
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
fix: unnecessary background refresh on query page #1256
Conversation
651730c
to
e16eb71
Compare
|
||
return ( | ||
<React.Fragment> | ||
<ElapsedTime className={b('elapsed-time')} /> |
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.
As for me ElapsedTime
should not be a part of CancelQueryButton
.
import ElapsedTime from '../../../../components/ElapsedTime/ElapsedTime'; | ||
import {cancelQueryApi} from '../../../../store/reducers/cancelQuery'; | ||
import {cn} from '../../../../utils/cn'; | ||
import i18n from '../i18n'; |
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.
lets do i18n
for this component separately
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.
if (resultType === RESULT_TYPES.EXPLAIN) { | ||
const {plan, ast, simplifiedPlan} = explainQueryData || {}; | ||
if (result?.type === ResultType.EXPLAIN) { | ||
const {plan, ast, simplifiedPlan} = result.data || {}; |
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.
if we pass result
as a property, whats the use is passing it's attributes one more time?
showPreview, | ||
} = props; | ||
const {tenantPath: savedPath} = executeQuery; | ||
|
||
const [resultType, setResultType] = React.useState<ValueOf<typeof RESULT_TYPES>>(); | ||
const [isResultLoaded, setIsResultLoaded] = React.useState(false); | ||
const isResultLoaded = Boolean(executeQuery.result); |
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.
why only executeQuery.result
?
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.
executeQuery.result can be both execute or explain type
@@ -335,7 +325,7 @@ function QueryEditor(props: QueryEditorProps) { | |||
<QueryEditorControls | |||
handleSendExecuteClick={handleSendExecuteClick} | |||
onSettingsButtonClick={handleSettingsClick} | |||
isLoading={explainQueryResult.isLoading || executeQueryResult.isLoading} | |||
isLoading={Boolean(executeQuery.result?.isLoading)} |
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.
why only executeQuery
?
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.
executeQuery.result can be both execute or explain type
Stand
Closes #1210
need to redo #1198
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
Bundle Size: ✅
Current: 78.86 MB | Main: 78.86 MB
Diff: 0.00 MB (-0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information