Skip to content

Commit

Permalink
Moved DATA_INTERVAL and useRecurringCall from backups to shared/core
Browse files Browse the repository at this point in the history
  • Loading branch information
doracretu3pillar committed Nov 13, 2024
1 parent e275a5f commit 479f8f5
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export const DATA_INTERVAL = 5000;
export const LIST_ARTIFACTS_CANCEL_TOKEN = 'listArtifacts';
export const BACKUP_CANCEL_TOKEN = 'backup';
export const RESTORE_CANCEL_TOKEN = 'restore';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { DeleteModal } from 'app/percona/shared/components/Elements/DeleteModal'
import { FeatureLoader } from 'app/percona/shared/components/Elements/FeatureLoader';
import { ExtendedColumn, FilterFieldTypes, Table } from 'app/percona/shared/components/Elements/Table';
import { useCancelToken } from 'app/percona/shared/components/hooks/cancelToken.hook';
import { ApiVerboseError, Databases, DATABASE_LABELS } from 'app/percona/shared/core';
import { ApiVerboseError, Databases, DATABASE_LABELS, DATA_INTERVAL } from 'app/percona/shared/core';
import { useRecurringCall } from 'app/percona/shared/core/hooks/recurringCall.hook';
import { fetchStorageLocations } from 'app/percona/shared/core/reducers/backups/backupLocations';
import { getBackupLocations, getPerconaSettingFlag } from 'app/percona/shared/core/selectors';
import { apiErrorParser, isApiCancelError } from 'app/percona/shared/helpers/api';
Expand All @@ -24,12 +25,11 @@ import { useSelector } from 'app/types';
import { NEW_BACKUP_URL, RESTORES_URL } from '../../Backup.constants';
import { Messages } from '../../Backup.messages';
import { BackupModeMap, formatBackupMode } from '../../Backup.utils';
import { useRecurringCall } from '../../hooks/recurringCall.hook';
import { DetailedDate } from '../DetailedDate';
import { Status } from '../Status';
import { LocationType } from '../StorageLocations/StorageLocations.types';

import { DATA_INTERVAL, LIST_ARTIFACTS_CANCEL_TOKEN, RESTORE_CANCEL_TOKEN } from './BackupInventory.constants';
import { LIST_ARTIFACTS_CANCEL_TOKEN, RESTORE_CANCEL_TOKEN } from './BackupInventory.constants';
import { BackupInventoryService } from './BackupInventory.service';
import { getStyles } from './BackupInventory.styles';
import { BackupRow } from './BackupInventory.types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import React, { FC, useCallback, useEffect, useState, useRef } from 'react';

import { ClipboardButton, useStyles } from '@grafana/ui';
import { useCancelToken } from 'app/percona/shared/components/hooks/cancelToken.hook';
import { useRecurringCall } from 'app/percona/shared/core/hooks/recurringCall.hook';
import { isApiCancelError } from 'app/percona/shared/helpers/api';
import { logger } from 'app/percona/shared/helpers/logger';

import { BackupLogChunk } from '../../Backup.types';
import { useRecurringCall } from '../../hooks/recurringCall.hook';

import { LIMIT, LOGS_CANCEL_TOKEN, STREAM_INTERVAL } from './ChunkedLogsViewer.constants';
import { Messages } from './ChunkedLogsViewer.messages';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { FeatureLoader } from 'app/percona/shared/components/Elements/FeatureLoa
import { ExtendedColumn, FilterFieldTypes, Table } from 'app/percona/shared/components/Elements/Table';
import { useCancelToken } from 'app/percona/shared/components/hooks/cancelToken.hook';
import { Databases, DATABASE_LABELS } from 'app/percona/shared/core';
import { useRecurringCall } from 'app/percona/shared/core/hooks/recurringCall.hook';
import { fetchStorageLocations } from 'app/percona/shared/core/reducers/backups/backupLocations';
import { getBackupLocations, getPerconaSettingFlag } from 'app/percona/shared/core/selectors';
import { isApiCancelError } from 'app/percona/shared/helpers/api';
Expand All @@ -18,7 +19,6 @@ import { useSelector } from 'app/types';

import { Messages } from '../../Backup.messages';
import { formatLocationsToMap } from '../../Backup.utils';
import { useRecurringCall } from '../../hooks/recurringCall.hook';
import { DetailedDate } from '../DetailedDate';
import { Status } from '../Status';

Expand Down
4 changes: 2 additions & 2 deletions public/app/percona/inventory/Tabs/Services.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { useLocalStorage } from 'react-use';

import { locationService } from '@grafana/runtime';
import { Button, HorizontalGroup, Icon, InlineSwitch, Tooltip, useStyles2 } from '@grafana/ui';
import { DATA_INTERVAL } from 'app/percona/backup/components/BackupInventory/BackupInventory.constants';
import { useRecurringCall } from 'app/percona/backup/hooks/recurringCall.hook';
import { FeatureLoader } from 'app/percona/shared/components/Elements/FeatureLoader';
import { ReadMoreLink } from 'app/percona/shared/components/Elements/TechnicalPreview/TechnicalPreview';
import { TabbedPage, TabbedPageContents } from 'app/percona/shared/components/TabbedPage';
import { useCancelToken } from 'app/percona/shared/components/hooks/cancelToken.hook';
import { usePerconaNavModel } from 'app/percona/shared/components/hooks/perconaNavModel';
import { DATA_INTERVAL } from 'app/percona/shared/core';
import { useRecurringCall } from 'app/percona/shared/core/hooks/recurringCall.hook';
import { fetchActiveServiceTypesAction, fetchServicesAction } from 'app/percona/shared/core/reducers/services';
import { getServices } from 'app/percona/shared/core/selectors';
import { isApiCancelError } from 'app/percona/shared/helpers/api';
Expand Down
5 changes: 3 additions & 2 deletions public/app/percona/pmm-dump/PMMDump.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { Row } from 'react-table';
import { HorizontalGroup, Icon, useStyles2, Badge, BadgeColor, LinkButton, Button } from '@grafana/ui';
import appEvents from 'app/core/app_events';
import { Page } from 'app/core/components/Page/Page';
import { DATA_INTERVAL } from 'app/percona/backup/components/BackupInventory/BackupInventory.constants';
import { DetailedDate } from 'app/percona/backup/components/DetailedDate';
import { useRecurringCall } from 'app/percona/backup/hooks/recurringCall.hook';
import { DumpStatus, DumpStatusColor, DumpStatusText, PMMDumpServices } from 'app/percona/pmm-dump/PmmDump.types';
import { DetailsRow } from 'app/percona/shared/components/Elements/DetailsRow/DetailsRow';
import { Action } from 'app/percona/shared/components/Elements/MultipleActions';
import { ExtendedColumn, FilterFieldTypes, Table } from 'app/percona/shared/components/Elements/Table';
import { PMM_DUMP_PAGE } from 'app/percona/shared/components/PerconaBootstrapper/PerconaNavigation';
import { DATA_INTERVAL } from 'app/percona/shared/core';
import { useRecurringCall } from 'app/percona/shared/core/hooks/recurringCall.hook';
import {
deletePmmDumpAction,
downloadPmmDumpAction,
Expand All @@ -32,6 +32,7 @@ import { Messages } from './PMMDump.messages';
import { getStyles } from './PmmDump.styles';
import { SendToSupportModal } from './SendToSupportModal';
import { PmmDumpLogsModal } from './components/PmmDumpLogsModal/PmmDumpLogsModal';

export const NEW_BACKUP_URL = '/pmm-dump/new';

export const PMMDump = () => {
Expand Down
1 change: 1 addition & 0 deletions public/app/percona/shared/core/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Databases } from './types';

export const DATA_INTERVAL = 5000;
export const API = {
ALERTMANAGER: '/alertmanager/api/v2',
SETTINGS: '/v1/Settings/Get',
Expand Down

0 comments on commit 479f8f5

Please sign in to comment.