-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: unnecessary background refresh on query page (#1256)
- Loading branch information
Showing
21 changed files
with
239 additions
and
241 deletions.
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 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 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 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 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 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 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 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 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.