Skip to content

Commit

Permalink
fix: code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Standrik committed Jul 30, 2024
1 parent fa604ee commit 3d3c140
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/containers/UserSettings/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"settings.usePaginatedTables.title": "Use paginated tables",
"settings.usePaginatedTables.description": " Use table with data load on scroll for Nodes and Storage tabs. It will increase performance, but could work unstable",

"settings.useHideDomainDatabase.title": "Use hide domain database",
"settings.useHideDomainDatabase.description": "Hide root domain on database list",
"settings.hideDomainDatabase.title": "Hide root domain",
"settings.hideDomainDatabase.description": "Hide root domain on database list",

"settings.useQuerySettings.title": "Use query settings",
"settings.useQuerySettings.description": "Use query settings",
Expand Down
12 changes: 6 additions & 6 deletions src/containers/UserSettings/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import {
AUTOCOMPLETE_ON_ENTER,
BINARY_DATA_IN_PLAIN_TEXT_DISPLAY,
ENABLE_AUTOCOMPLETE,
HIDE_DOMAIN_DATABASE_KEY,
INVERTED_DISKS_KEY,
LANGUAGE_KEY,
QUERY_SETTINGS,
QUERY_USE_MULTI_SCHEMA_KEY,
THEME_KEY,
USE_CLUSTER_BALANCER_AS_BACKEND_KEY,
USE_DIRECTORY_OPERATIONS,
USE_HIDE_DOMAIN_DATABASE_KEY,
USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY,
USE_PAGINATED_TABLES_KEY,
USE_SEPARATE_DISKS_PAGES_KEY,
Expand Down Expand Up @@ -110,10 +110,10 @@ export const usePaginatedTables: SettingProps = {
description: i18n('settings.usePaginatedTables.description'),
};

export const useHideDomainDatabase: SettingProps = {
settingKey: USE_HIDE_DOMAIN_DATABASE_KEY,
title: i18n('settings.useHideDomainDatabase.title'),
description: i18n('settings.useHideDomainDatabase.description'),
export const hideDomainDatabase: SettingProps = {
settingKey: HIDE_DOMAIN_DATABASE_KEY,
title: i18n('settings.hideDomainDatabase.title'),
description: i18n('settings.hideDomainDatabase.description'),
};

export const useQuerySettings: SettingProps = {
Expand Down Expand Up @@ -174,7 +174,7 @@ export const experimentsSection: SettingsSection = {
settings: [
useNodesEndpointSetting,
usePaginatedTables,
useHideDomainDatabase,
hideDomainDatabase,
queryUseMultiSchemaSetting,
useSeparateDisksPagesSetting,
useDirectoryActionsSetting,
Expand Down
4 changes: 2 additions & 2 deletions src/services/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
AUTO_REFRESH_INTERVAL,
BINARY_DATA_IN_PLAIN_TEXT_DISPLAY,
ENABLE_AUTOCOMPLETE,
HIDE_DOMAIN_DATABASE_KEY,
INVERTED_DISKS_KEY,
IS_HOTKEYS_HELP_HIDDEN_KEY,
LANGUAGE_KEY,
Expand All @@ -18,7 +19,6 @@ import {
THEME_KEY,
USE_CLUSTER_BALANCER_AS_BACKEND_KEY,
USE_DIRECTORY_OPERATIONS,
USE_HIDE_DOMAIN_DATABASE_KEY,
USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY,
USE_PAGINATED_TABLES_KEY,
USE_SEPARATE_DISKS_PAGES_KEY,
Expand Down Expand Up @@ -51,7 +51,7 @@ export const DEFAULT_USER_SETTINGS = {
[AUTO_REFRESH_INTERVAL]: 0,
[USE_DIRECTORY_OPERATIONS]: false,
[QUERY_SETTINGS]: false,
[USE_HIDE_DOMAIN_DATABASE_KEY]: true,
[HIDE_DOMAIN_DATABASE_KEY]: true,
} as const satisfies SettingsObject;

class SettingsManager {
Expand Down
4 changes: 2 additions & 2 deletions src/store/reducers/tenants/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createSelector} from '@reduxjs/toolkit';
import escapeRegExp from 'lodash/escapeRegExp';

import type {RootState} from '../..';
import {USE_HIDE_DOMAIN_DATABASE_KEY} from '../../../lib';
import {HIDE_DOMAIN_DATABASE_KEY} from '../../../lib';
import {EFlag} from '../../../types/api/enums';
import {ProblemFilterValues, getSettingValue, selectProblemFilter} from '../settings/settings';
import type {ProblemFilterValue} from '../settings/types';
Expand Down Expand Up @@ -44,7 +44,7 @@ export const selectTenants = createSelector(
export const selectTenantsSearchValue = (state: TenantsStateSlice) => state.tenants.searchValue;

export const selectUseHideDomainDatabase = (state: RootState) =>
getSettingValue(state, USE_HIDE_DOMAIN_DATABASE_KEY);
getSettingValue(state, HIDE_DOMAIN_DATABASE_KEY);

// ==== Complex selectors ====

Expand Down
2 changes: 1 addition & 1 deletion src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const TENANT_INITIAL_PAGE_KEY = 'saved_tenant_initial_tab';
export const USE_PAGINATED_TABLES_KEY = 'useBackendParamsForTables';

// Setting to hide domain in database list
export const USE_HIDE_DOMAIN_DATABASE_KEY = 'useHideDomainDatabase';
export const HIDE_DOMAIN_DATABASE_KEY = 'hideDomainDatabase';

// Enable schema that supports multiple resultsets
export const QUERY_USE_MULTI_SCHEMA_KEY = 'queryUseMultiSchema';
Expand Down

0 comments on commit 3d3c140

Please sign in to comment.