-
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
Merged
astandrik
merged 9 commits into
main
from
astandrik.unnecessary-background-refresh-on-query-page-1210-2
Sep 13, 2024
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e16eb71
fix: unnecessary background refresh on query page
astandrik b5239e6
fix: unnecessary background refresh on query page
astandrik 10168b3
Merge branch 'main' into astandrik.unnecessary-background-refresh-on-…
astandrik 578d445
fix: .
astandrik d5d1914
fix: move opening tab logics
astandrik d1a3422
fix: review fixes
astandrik 648e7d7
Merge branch 'main' into astandrik.unnecessary-background-refresh-on-…
astandrik 99b3a7b
fix: review fixes
astandrik feca6cc
Merge branch 'main' into astandrik.unnecessary-background-refresh-on-…
astandrik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
src/components/NotRenderUntilFirstVisible/NotRenderUntilFirstVisible.scss
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
src/components/NotRenderUntilFirstVisible/NotRenderUntilFirstVisible.tsx
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/containers/Tenant/Query/CancelQueryButton/CancelQueryButton.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@import '../../../../styles/mixins.scss'; | ||
|
||
.cancel-query-button { | ||
&__stop-button { | ||
&_error { | ||
@include query-buttons-animations(); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/containers/Tenant/Query/CancelQueryButton/CancelQueryButton.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
|
||
import {StopFill} from '@gravity-ui/icons'; | ||
import {Button, Icon} from '@gravity-ui/uikit'; | ||
|
||
import {cancelQueryApi} from '../../../../store/reducers/cancelQuery'; | ||
import {cn} from '../../../../utils/cn'; | ||
import i18n from '../i18n'; | ||
|
||
import './CancelQueryButton.scss'; | ||
|
||
const b = cn('cancel-query-button'); | ||
|
||
interface CancelQueryButtonProps { | ||
queryId: string; | ||
tenantName: string; | ||
} | ||
|
||
export function CancelQueryButton({queryId, tenantName}: CancelQueryButtonProps) { | ||
const [sendCancelQuery, cancelQueryResponse] = cancelQueryApi.useCancelQueryMutation(); | ||
|
||
const onStopButtonClick = React.useCallback(() => { | ||
sendCancelQuery({queryId, database: tenantName}); | ||
}, [queryId, sendCancelQuery, tenantName]); | ||
|
||
return ( | ||
<Button | ||
loading={cancelQueryResponse.isLoading} | ||
onClick={onStopButtonClick} | ||
className={b('stop-button', {error: Boolean(cancelQueryResponse.error)})} | ||
> | ||
<Icon data={StopFill} size={16} /> | ||
{i18n('action.stop')} | ||
</Button> | ||
); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 separatelyThere 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?
we have all actions there
