Skip to content

Commit

Permalink
fix: store types should be stored separately (#1005)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raubzeug authored Jul 10, 2024
1 parent e341325 commit 8c2949e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/containers/Tenant/Query/QueryEditor/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '../../../../store/reducers/executeQuery';
import {explainQueryApi} from '../../../../store/reducers/explainQuery/explainQuery';
import type {PreparedExplainResponse} from '../../../../store/reducers/explainQuery/types';
import {setQueryAction} from '../../../../store/reducers/queryActions';
import {setQueryAction} from '../../../../store/reducers/queryActions/queryActions';
import {setShowPreview} from '../../../../store/reducers/schema/schema';
import type {EPathType} from '../../../../types/api/schema';
import type {ValueOf} from '../../../../types/common';
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Tenant/Query/SaveQuery/SaveQuery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
selectQueryAction,
selectQueryName,
setQueryAction,
} from '../../../../store/reducers/queryActions';
} from '../../../../store/reducers/queryActions/queryActions';
import {cn} from '../../../../utils/cn';
import {useTypedDispatch, useTypedSelector} from '../../../../utils/hooks';
import {useSavedQueries} from '../utils/useSavedQueries';
Expand Down
5 changes: 4 additions & 1 deletion src/containers/Tenant/Query/SavedQueries/SavedQueries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import {Button, Dialog, Icon} from '@gravity-ui/uikit';

import {ResizeableDataTable} from '../../../../components/ResizeableDataTable/ResizeableDataTable';
import {TruncatedQuery} from '../../../../components/TruncatedQuery/TruncatedQuery';
import {deleteSavedQuery, setQueryNameToEdit} from '../../../../store/reducers/queryActions';
import {
deleteSavedQuery,
setQueryNameToEdit,
} from '../../../../store/reducers/queryActions/queryActions';
import {TENANT_QUERY_TABS_ID} from '../../../../store/reducers/tenant/constants';
import {setQueryTab} from '../../../../store/reducers/tenant/tenant';
import type {SavedQuery} from '../../../../types/store/query';
Expand Down
2 changes: 1 addition & 1 deletion src/store/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import fullscreen from './fullscreen';
import header from './header/header';
import heatmap from './heatmap';
import partitions from './partitions/partitions';
import queryActions from './queryActions';
import queryActions from './queryActions/queryActions';
import schema from './schema/schema';
import settings from './settings/settings';
import shardsWorkload from './shardsWorkload/shardsWorkload';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
import type {PayloadAction} from '@reduxjs/toolkit';
import {createSlice} from '@reduxjs/toolkit';

import {SAVED_QUERIES_KEY} from '../../../src/utils/constants';
import type {SavedQuery} from '../../types/store/query';
import type {AppDispatch, GetState} from '../defaultStore';
import type {SavedQuery} from '../../../types/store/query';
import {SAVED_QUERIES_KEY} from '../../../utils/constants';
import type {AppDispatch, GetState} from '../../defaultStore';
import {getSettingValue, setSettingValue} from '../settings/settings';

import {getSettingValue, setSettingValue} from './settings/settings';

type QueryActions = 'save' | 'idle';

interface QueryActionsState {
queryName: string | null;
queryAction: QueryActions;
}
import type {QueryActions, QueryActionsState} from './types';

const initialState: QueryActionsState = {
queryName: null,
Expand Down
6 changes: 6 additions & 0 deletions src/store/reducers/queryActions/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export type QueryActions = 'save' | 'idle';

export interface QueryActionsState {
queryName: string | null;
queryAction: QueryActions;
}

0 comments on commit 8c2949e

Please sign in to comment.