Skip to content

Commit

Permalink
feature(query-tracker): hide query history sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
vitshev committed Dec 15, 2023
1 parent 99233e2 commit 01ede77
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 36 deletions.
8 changes: 6 additions & 2 deletions packages/ui/src/shared/constants/settings-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ interface AccountsSettings {
'global::accounts::dashboardVisibilityMode': 'string';
}

interface QueryTrackerSettings {
'global::queryTracker::queriesListSidebarVisibilityMode': boolean;
}

interface OtherSettings {
[key: string]: any;
}
Expand All @@ -82,7 +86,7 @@ export interface DefaultSettings {
A11Y: A11YSettings;
MENU: MenuSettings;
ACCOUNTS: AccountsSettings;
CHYT: ChytSettings;
QUERY_TRACKER: QueryTrackerSettings;
}

type DescribedSettings = GlobalSettings &
Expand All @@ -94,7 +98,7 @@ type DescribedSettings = GlobalSettings &
A11YSettings &
MenuSettings &
AccountsSettings &
ChytSettings;
QueryTrackerSettings;

export type Settings = DescribedSettings & OtherSettings;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
isQueriesListLoading,
} from '../../module/queries_list/selectors';
import {loadNextQueriesList, resetCursor} from '../../module/queries_list/actions';
import {TOGGLE_QUERIES_LIST_SIDEBAR} from '../../module/ui_settings/actions';
import {getSettingQueryTrackerQueriesListSidebarVisibilityMode} from '../../../../store/selectors/settings-ts';
import {SET_SETTING_VALUE} from "../../../../constants";
import {setSetting} from '../../../../store/actions/settings';
import {NAMESPACES, SettingName} from '../../../../../shared/constants/settings';

export function useQueryList(): [QueryItem[], boolean] {
const items = useSelector(getQueriesList);
Expand Down Expand Up @@ -53,7 +53,13 @@ export const useQueriesListSidebarToggle = () => {
);

const toggleQueriesListSideBarToggle = () => {

dispatch(
setSetting<boolean>(
SettingName.QUERY_TRACKER.QUERIES_LIST_SIDEBAR_VISIBILITY_MODE,
NAMESPACES.QUERY_TRACKER,
!isQueriesListSidebarVisible,
),
);
};

return {
Expand Down
31 changes: 0 additions & 31 deletions packages/ui/src/ui/store/reducers/chyt/list-filters.ts

This file was deleted.

0 comments on commit 01ede77

Please sign in to comment.