From 5d3382f7a4c69a85e2aabbfa0c2b8b8e3f0574ae Mon Sep 17 00:00:00 2001 From: mufazalov Date: Thu, 13 Feb 2025 15:50:27 +0300 Subject: [PATCH] fix(ObjectSummary): refresh tabs with tree refresh, disable autorefresh --- .../Tenant/ObjectSummary/ObjectSummary.tsx | 16 +++++----------- .../SchemaTree/RefreshTreeButton.tsx | 5 +++++ .../Tenant/Schema/SchemaViewer/SchemaViewer.tsx | 15 +++++++-------- src/containers/Tenant/Tenant.tsx | 10 ++-------- src/store/reducers/api.ts | 11 ++++++++++- src/store/reducers/overview/overview.ts | 2 +- src/store/reducers/preview.ts | 2 +- src/store/reducers/schemaAcl/schemaAcl.ts | 2 +- src/store/reducers/viewSchema/viewSchema.ts | 2 +- 9 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/containers/Tenant/ObjectSummary/ObjectSummary.tsx b/src/containers/Tenant/ObjectSummary/ObjectSummary.tsx index c71112932..313ab718d 100644 --- a/src/containers/Tenant/ObjectSummary/ObjectSummary.tsx +++ b/src/containers/Tenant/ObjectSummary/ObjectSummary.tsx @@ -24,7 +24,7 @@ import { formatNumber, formatSecondsToHours, } from '../../../utils/dataFormatters/dataFormatters'; -import {useAutoRefreshInterval, useTypedDispatch, useTypedSelector} from '../../../utils/hooks'; +import {useTypedDispatch, useTypedSelector} from '../../../utils/hooks'; import {Acl} from '../Acl/Acl'; import {EntityTitle} from '../EntityTitle/EntityTitle'; import {SchemaViewer} from '../Schema/SchemaViewer/SchemaViewer'; @@ -76,7 +76,6 @@ export function ObjectSummary({ onExpandSummary, isCollapsed, }: ObjectSummaryProps) { - const [autoRefreshInterval] = useAutoRefreshInterval(); const dispatch = useTypedDispatch(); const [, setCurrentPath] = useQueryParam('schema', StringParam); const [commonInfoVisibilityState, dispatchCommonInfoVisibilityState] = React.useReducer( @@ -95,15 +94,10 @@ export function ObjectSummary({ ignoreQueryPrefix: true, }); - const {currentData: currentObjectData} = overviewApi.useGetOverviewQuery( - { - path, - database: tenantName, - }, - { - pollingInterval: autoRefreshInterval, - }, - ); + const {currentData: currentObjectData} = overviewApi.useGetOverviewQuery({ + path, + database: tenantName, + }); const currentSchemaData = currentObjectData?.PathDescription?.Self; React.useEffect(() => { diff --git a/src/containers/Tenant/ObjectSummary/SchemaTree/RefreshTreeButton.tsx b/src/containers/Tenant/ObjectSummary/SchemaTree/RefreshTreeButton.tsx index f69bf8e34..34b1afc6b 100644 --- a/src/containers/Tenant/ObjectSummary/SchemaTree/RefreshTreeButton.tsx +++ b/src/containers/Tenant/ObjectSummary/SchemaTree/RefreshTreeButton.tsx @@ -2,11 +2,15 @@ import {ArrowsRotateLeft} from '@gravity-ui/icons'; import {ActionTooltip, Button, Icon} from '@gravity-ui/uikit'; import {nanoid} from '@reduxjs/toolkit'; +import {api} from '../../../../store/reducers/api'; +import {useTypedDispatch} from '../../../../utils/hooks'; import {useDispatchTreeKey} from '../UpdateTreeContext'; import {b} from '../shared'; export function RefreshTreeButton() { const updateTreeKey = useDispatchTreeKey(); + const dispatch = useTypedDispatch(); + return (