refactor: Move fetchTimeRange to core package (#27852)

This commit is contained in:
Kamil Gabryjelski
2024-04-03 18:34:23 +02:00
committed by GitHub
parent 30bc8f06dc
commit a498d6d10f
72 changed files with 623 additions and 430 deletions

View File

@@ -23,6 +23,8 @@ import {
SupersetClient,
t,
isFeatureEnabled,
COMMON_ERR_MESSAGES,
getClientErrorObject,
} from '@superset-ui/core';
import { invert, mapKeys } from 'lodash';
@@ -33,8 +35,6 @@ import {
addSuccessToast as addSuccessToastAction,
addWarningToast as addWarningToastAction,
} from 'src/components/MessageToasts/actions';
import { getClientErrorObject } from 'src/utils/getClientErrorObject';
import COMMON_ERR_MESSAGES from 'src/utils/errorMessages';
import { LOG_ACTIONS_SQLLAB_FETCH_FAILED_QUERY } from 'src/logger/LogUtils';
import getBootstrapData from 'src/utils/getBootstrapData';
import { logEvent } from 'src/logger/actions';

View File

@@ -18,13 +18,13 @@
*/
import fetchMock from 'fetch-mock';
import { act, renderHook } from '@testing-library/react-hooks';
import { COMMON_ERR_MESSAGES } from '@superset-ui/core';
import {
createWrapper,
defaultStore as store,
} from 'spec/helpers/testing-library';
import { api } from 'src/hooks/apiResources/queryApi';
import { initialState } from 'src/SqlLab/fixtures';
import COMMON_ERR_MESSAGES from 'src/utils/errorMessages';
import { useAnnotations } from './useAnnotations';
const fakeApiResult = {

View File

@@ -18,16 +18,14 @@
*/
import { useSelector } from 'react-redux';
import { COMMON_ERR_MESSAGES, ClientErrorObject, t } from '@superset-ui/core';
import { SqlLabRootState } from 'src/SqlLab/types';
import COMMON_ERR_MESSAGES from 'src/utils/errorMessages';
import { VALIDATION_DEBOUNCE_MS } from 'src/SqlLab/constants';
import {
FetchValidationQueryParams,
useQueryValidationsQuery,
} from 'src/hooks/apiResources';
import { useDebounceValue } from 'src/hooks/useDebounceValue';
import { ClientErrorObject } from 'src/utils/getClientErrorObject';
import { t } from '@superset-ui/core';
export function useAnnotations(params: FetchValidationQueryParams) {
const { sql, dbId, schema, templateParams } = params;

View File

@@ -23,13 +23,13 @@ import {
t,
useTheme,
isFeatureEnabled,
getClientErrorObject,
} from '@superset-ui/core';
import Button from 'src/components/Button';
import Icons from 'src/components/Icons';
import withToasts from 'src/components/MessageToasts/withToasts';
import CopyToClipboard from 'src/components/CopyToClipboard';
import { storeQuery } from 'src/utils/common';
import { getClientErrorObject } from 'src/utils/getClientErrorObject';
import useQueryEditor from 'src/SqlLab/hooks/useQueryEditor';
interface ShareSqlLabQueryProps {