diff --git a/client_v2/src/actions/dnsConfig.ts b/client_v2/src/actions/dnsConfig.ts index 9b9b996c..8cce77a7 100644 --- a/client_v2/src/actions/dnsConfig.ts +++ b/client_v2/src/actions/dnsConfig.ts @@ -1,11 +1,10 @@ import { createAction } from 'redux-actions'; -import i18next from 'i18next'; +import intl from 'panel/common/intl'; import { apiClient } from '../api/Api'; import { splitByNewLine } from '../helpers/helpers'; import { addErrorToast, addSuccessToast } from './toasts'; -import intl from 'panel/common/intl'; export const getDnsConfigRequest = createAction('GET_DNS_CONFIG_REQUEST'); export const getDnsConfigFailure = createAction('GET_DNS_CONFIG_FAILURE'); diff --git a/client_v2/src/actions/encryption.ts b/client_v2/src/actions/encryption.ts index d3bbd90c..ac75b54a 100644 --- a/client_v2/src/actions/encryption.ts +++ b/client_v2/src/actions/encryption.ts @@ -1,9 +1,9 @@ import { createAction } from 'redux-actions'; +import intl from 'panel/common/intl'; import { apiClient } from '../api/Api'; import { redirectToCurrentProtocol } from '../helpers/helpers'; import { addErrorToast, addSuccessToast } from './toasts'; -import intl from 'panel/common/intl'; export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST'); export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE'); diff --git a/client_v2/src/actions/index.tsx b/client_v2/src/actions/index.tsx index 677cbde3..a4049cc5 100644 --- a/client_v2/src/actions/index.tsx +++ b/client_v2/src/actions/index.tsx @@ -6,6 +6,8 @@ import endsWith from 'lodash/endsWith'; import escapeRegExp from 'lodash/escapeRegExp'; import React from 'react'; import { compose } from 'redux'; +import type { Dispatch } from 'redux'; +import intl from 'panel/common/intl'; import { splitByNewLine, sortClients, @@ -27,18 +29,16 @@ import { getTlsStatus } from './encryption'; import { apiClient } from '../api/Api'; import { addErrorToast, addNoticeToast, addSuccessToast } from './toasts'; import { getFilteringStatus, setRules } from './filtering'; -import type { Dispatch } from 'redux'; -import intl from 'panel/common/intl'; - -export const toggleSettingStatus = createAction<{ - settingKey: keyof typeof SETTINGS_NAMES; - value?: boolean | SafeSearchConfig; -}>('SETTING_STATUS_TOGGLE'); -export const showSettingsFailure = createAction('SETTINGS_FAILURE_SHOW'); type SafeSearchConfig = Record & { enabled: boolean }; type ToggleSettingKey = keyof typeof SETTINGS_NAMES; +export const toggleSettingStatus = createAction<{ + settingKey: ToggleSettingKey; + value?: boolean | SafeSearchConfig; +}>('SETTING_STATUS_TOGGLE'); +export const showSettingsFailure = createAction('SETTINGS_FAILURE_SHOW'); + /** * * @param {*} settingKey = SETTINGS_NAMES diff --git a/client_v2/src/actions/queryLogs.ts b/client_v2/src/actions/queryLogs.ts index 6b0688d9..480a1a02 100644 --- a/client_v2/src/actions/queryLogs.ts +++ b/client_v2/src/actions/queryLogs.ts @@ -1,11 +1,11 @@ import { createAction } from 'redux-actions'; +import intl from 'panel/common/intl'; import { apiClient } from '../api/Api'; import { normalizeLogs } from '../helpers/helpers'; import { DEFAULT_LOGS_FILTER, QUERY_LOGS_PAGE_LIMIT } from '../helpers/constants'; import { addErrorToast, addSuccessToast } from './toasts'; -import intl from 'panel/common/intl'; type SearchFormValues = { search: string; diff --git a/client_v2/src/actions/stats.ts b/client_v2/src/actions/stats.ts index f7caa3a6..731baad0 100644 --- a/client_v2/src/actions/stats.ts +++ b/client_v2/src/actions/stats.ts @@ -1,9 +1,9 @@ import { createAction } from 'redux-actions'; +import intl from 'panel/common/intl'; import { apiClient } from '../api/Api'; import { normalizeTopStats, secondsToMilliseconds, getParamsForClientsSearch, addClientInfo } from '../helpers/helpers'; import { addErrorToast, addSuccessToast } from './toasts'; -import intl from 'panel/common/intl'; export const getStatsConfigRequest = createAction('GET_STATS_CONFIG_REQUEST'); export const getStatsConfigFailure = createAction('GET_STATS_CONFIG_FAILURE'); diff --git a/client_v2/src/common/controls/Checkbox/Checkbox.tsx b/client_v2/src/common/controls/Checkbox/Checkbox.tsx index 6dc90b8d..0ae0eb3a 100644 --- a/client_v2/src/common/controls/Checkbox/Checkbox.tsx +++ b/client_v2/src/common/controls/Checkbox/Checkbox.tsx @@ -1,4 +1,4 @@ -import React, { ChangeEvent, ComponentProps, MouseEvent, ReactNode } from 'react'; +import React, { ComponentProps, MouseEvent, ReactNode } from 'react'; import cn from 'clsx'; import theme from 'panel/lib/theme'; import { Icon } from 'panel/common/ui/Icon'; diff --git a/client_v2/src/common/controls/Input/Input.tsx b/client_v2/src/common/controls/Input/Input.tsx index 8d9f6141..10dfc86e 100644 --- a/client_v2/src/common/controls/Input/Input.tsx +++ b/client_v2/src/common/controls/Input/Input.tsx @@ -1,4 +1,4 @@ -import React, { ChangeEvent, ComponentProps, forwardRef, type ReactNode, useState } from 'react'; +import React, { ComponentProps, forwardRef, type ReactNode, useState } from 'react'; import cn from 'clsx'; import s from './Input.module.pcss'; diff --git a/client_v2/src/common/controls/Radio/Radio.tsx b/client_v2/src/common/controls/Radio/Radio.tsx index 22355ae4..64650896 100644 --- a/client_v2/src/common/controls/Radio/Radio.tsx +++ b/client_v2/src/common/controls/Radio/Radio.tsx @@ -1,8 +1,8 @@ import React from 'react'; import cn from 'clsx'; -import s from './Radio.module.pcss'; import { Icon } from 'panel/common/ui/Icon'; +import s from './Radio.module.pcss'; type Props = { className?: string; diff --git a/client_v2/src/common/controls/Select/Select.tsx b/client_v2/src/common/controls/Select/Select.tsx index d62fbf65..afe84ceb 100644 --- a/client_v2/src/common/controls/Select/Select.tsx +++ b/client_v2/src/common/controls/Select/Select.tsx @@ -22,8 +22,8 @@ export type ISelectValue = Multi extends true ? IOptio const CustomMenuList = < T, Multi extends boolean, - Group extends GroupBase & ExtendOption>, ExtendOption extends Record, + Group extends GroupBase & ExtendOption>, >( props: MenuListProps & ExtendOption, Multi, Group>, ): React.ReactElement => { @@ -45,8 +45,8 @@ const CustomMenuList = < interface SelectProps< T, Multi extends boolean, - Group extends GroupBase & ExtendOption>, ExtendOption extends Record, + Group extends GroupBase & ExtendOption>, > { size?: ISelectSize; height?: ISelectHeight; @@ -84,7 +84,7 @@ interface SelectProps< export const Select = < T, Multi extends boolean = false, - ExtendOption extends Record = {}, + ExtendOption extends Record = object, Group extends GroupBase & ExtendOption> = GroupBase & ExtendOption>, >({ autoFocus, @@ -118,7 +118,7 @@ export const Select = < isDropdownSelect, onMenuOpen, onMenuClose, -}: SelectProps) => { +}: SelectProps) => { const selectClass = cn( { 'desktop-select-always': mobile === false }, { 'mobile-select-always': mobile }, diff --git a/client_v2/src/common/controls/Switch/Switch.tsx b/client_v2/src/common/controls/Switch/Switch.tsx index 4f4e1d95..159a70d6 100644 --- a/client_v2/src/common/controls/Switch/Switch.tsx +++ b/client_v2/src/common/controls/Switch/Switch.tsx @@ -51,4 +51,4 @@ export const Switch = forwardRef( }, ); -export default Switch; +Switch.displayName = 'Switch'; diff --git a/client_v2/src/common/controls/Textarea/Textarea.tsx b/client_v2/src/common/controls/Textarea/Textarea.tsx index f59df52c..20767550 100644 --- a/client_v2/src/common/controls/Textarea/Textarea.tsx +++ b/client_v2/src/common/controls/Textarea/Textarea.tsx @@ -53,3 +53,5 @@ export const Textarea = forwardRef( ), ); + +Textarea.displayName = 'Textarea'; diff --git a/client_v2/src/common/ui/Footer/Footer.tsx b/client_v2/src/common/ui/Footer/Footer.tsx index 5e9c4995..fefb548c 100644 --- a/client_v2/src/common/ui/Footer/Footer.tsx +++ b/client_v2/src/common/ui/Footer/Footer.tsx @@ -5,6 +5,7 @@ import cn from 'clsx'; import theme from 'panel/lib/theme'; import { Dropdown } from 'panel/common/ui/Dropdown'; import { Icon } from 'panel/common/ui/Icon'; +import intl, { LocalesType } from 'panel/common/intl'; import { REPOSITORY, PRIVACY_POLICY_LINK, THEMES } from '../../../helpers/constants'; import { LANGUAGES } from '../../../helpers/twosky'; @@ -13,7 +14,6 @@ import { changeTheme, changeLanguage as changeLanguageAction } from '../../../ac import { RootState } from '../../../initialState'; import s from './styles.module.pcss'; -import intl, { LocalesType } from 'panel/common/intl'; const linksData = [ { diff --git a/client_v2/src/common/ui/Icons/index.tsx b/client_v2/src/common/ui/Icons/index.tsx index 5d7b1a86..1bdafcb9 100644 --- a/client_v2/src/common/ui/Icons/index.tsx +++ b/client_v2/src/common/ui/Icons/index.tsx @@ -328,23 +328,23 @@ export const Icons = memo(() => ( r="9" transform="matrix(1 0 0 -1 3 21)" stroke="currentColor" - stroke-width="1.5" - stroke-linecap="round" - stroke-linejoin="round" + strokeWidth="1.5" + strokeLinecap="round" + strokeLinejoin="round" /> diff --git a/client_v2/src/common/ui/Menu/Menu.tsx b/client_v2/src/common/ui/Menu/Menu.tsx index fe4fef00..3880b9ba 100644 --- a/client_v2/src/common/ui/Menu/Menu.tsx +++ b/client_v2/src/common/ui/Menu/Menu.tsx @@ -36,7 +36,7 @@ export const Menu = ({ headerMenu }: Props) => { return false; } - const normalizedPath = p.endsWith('/') ? p : p + '/'; + const normalizedPath = p.endsWith('/') ? p : `${p}/`; return currentPath.startsWith(normalizedPath); }); }; diff --git a/client_v2/src/components/App/index.tsx b/client_v2/src/components/App/index.tsx index 162ffbcb..3991b7c3 100644 --- a/client_v2/src/components/App/index.tsx +++ b/client_v2/src/components/App/index.tsx @@ -7,18 +7,16 @@ import { Sidebar } from 'panel/common/ui/Sidebar'; import { Icons } from 'panel/common/ui/Icons'; import { Footer } from 'panel/common/ui/Footer'; import { Header } from 'panel/common/ui/Header'; +import Settings from 'panel/containers/Settings'; import Toasts from '../Toasts'; import i18n from '../../i18n'; - import { THEMES } from '../../helpers/constants'; import { setHtmlLangAttr, setUITheme } from '../../helpers/helpers'; import { changeLanguage, getDnsStatus, getTimerStatus } from '../../actions'; - import { RootState } from '../../initialState'; import s from './styles.module.pcss'; -import Settings from 'panel/containers/Settings'; type RouteConfig = { path: string; diff --git a/client_v2/src/components/Settings/IgnoredDomains/IgnoredDomains.tsx b/client_v2/src/components/Settings/IgnoredDomains/IgnoredDomains.tsx index 8d9faeb9..bed3e309 100644 --- a/client_v2/src/components/Settings/IgnoredDomains/IgnoredDomains.tsx +++ b/client_v2/src/components/Settings/IgnoredDomains/IgnoredDomains.tsx @@ -3,16 +3,15 @@ import { Controller, type Control, type UseFormSetValue } from 'react-hook-form' import cn from 'clsx'; import { Textarea } from 'panel/common/controls/Textarea'; -import { SwitchGroup } from '../SettingsGroup'; import intl from 'panel/common/intl'; - import { trimLinesAndRemoveEmpty } from 'panel/helpers/helpers'; - -import s from './styles.module.pcss'; import { Dropdown } from 'panel/common/ui/Dropdown'; import theme from 'panel/lib/theme'; import { Icon } from 'panel/common/ui/Icon'; +import s from './styles.module.pcss'; +import { SwitchGroup } from '../SettingsGroup'; + type Props = { control: Control; processing: boolean; diff --git a/client_v2/src/components/Settings/LogsConfig/LogsConfig.tsx b/client_v2/src/components/Settings/LogsConfig/LogsConfig.tsx index ecdb2efa..c58674b5 100644 --- a/client_v2/src/components/Settings/LogsConfig/LogsConfig.tsx +++ b/client_v2/src/components/Settings/LogsConfig/LogsConfig.tsx @@ -1,10 +1,10 @@ import React, { useState } from 'react'; -import { Form, FormValues } from './Form'; import { ConfirmDialog } from 'panel/common/ui/ConfirmDialog'; import intl from 'panel/common/intl'; import { HOUR } from 'panel/helpers/constants'; import { formatIntervalText } from 'panel/components/Settings/helpers'; +import { Form, FormValues } from './Form'; export type LogsConfigPayload = { enabled: boolean; diff --git a/client_v2/src/components/Settings/StatsConfig/Form.tsx b/client_v2/src/components/Settings/StatsConfig/Form.tsx index 143d21d3..ff356d61 100644 --- a/client_v2/src/components/Settings/StatsConfig/Form.tsx +++ b/client_v2/src/components/Settings/StatsConfig/Form.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { getIntervalTitle } from '../helpers'; import { Controller, useForm } from 'react-hook-form'; import { Button } from 'panel/common/ui/Button'; import intl from 'panel/common/intl'; import theme from 'panel/lib/theme'; +import { getIntervalTitle } from '../helpers'; import { STATS_INTERVALS_DAYS, DAY, RETENTION_CUSTOM } from '../../../helpers/constants'; import { RadioGroup, SwitchGroup } from '../SettingsGroup'; diff --git a/client_v2/src/components/Toasts/Toast.tsx b/client_v2/src/components/Toasts/Toast.tsx index 0991c13c..7cdaf558 100644 --- a/client_v2/src/components/Toasts/Toast.tsx +++ b/client_v2/src/components/Toasts/Toast.tsx @@ -1,11 +1,11 @@ import React, { useEffect, useState } from 'react'; import { useDispatch } from 'react-redux'; +import { Icon } from 'panel/common/ui/Icon'; +import cn from 'clsx'; import { TOAST_TIMEOUTS } from '../../helpers/constants'; import { removeToast } from '../../actions'; -import { Icon } from 'panel/common/ui/Icon'; import s from './styles.module.pcss'; -import cn from 'clsx'; interface ToastProps { id: string; diff --git a/client_v2/src/install/Setup/AddressList.tsx b/client_v2/src/install/Setup/AddressList.tsx index 48a900ee..e31d450d 100644 --- a/client_v2/src/install/Setup/AddressList.tsx +++ b/client_v2/src/install/Setup/AddressList.tsx @@ -1,9 +1,9 @@ import React from 'react'; +import theme from 'panel/lib/theme'; import { getIpList, getDnsAddress, getWebAddress } from '../../helpers/helpers'; import { ALL_INTERFACES_IP } from '../../helpers/constants'; import { InstallInterface } from '../../initialState'; -import theme from 'panel/lib/theme'; interface renderItemProps { ip: string; diff --git a/client_v2/src/install/Setup/Auth.tsx b/client_v2/src/install/Setup/Auth.tsx index d75a81c8..afef3990 100644 --- a/client_v2/src/install/Setup/Auth.tsx +++ b/client_v2/src/install/Setup/Auth.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { Controller, useForm } from 'react-hook-form'; import { Trans, useTranslation } from 'react-i18next'; +import { Input } from 'panel/common/controls/Input'; import Controls from './Controls'; import { validatePasswordLength, validateRequiredValue } from '../../helpers/validators'; -import { Input } from 'panel/common/controls/Input'; type AuthFormValues = { username: string; diff --git a/client_v2/src/install/Setup/Controls.tsx b/client_v2/src/install/Setup/Controls.tsx index 6e13f7ab..8a142262 100644 --- a/client_v2/src/install/Setup/Controls.tsx +++ b/client_v2/src/install/Setup/Controls.tsx @@ -2,8 +2,8 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; import { Trans } from 'react-i18next'; -import * as actionCreators from '../../actions/install'; import { Button } from 'panel/common/ui/Button'; +import * as actionCreators from '../../actions/install'; interface ControlsProps { install: { diff --git a/client_v2/src/install/Setup/Settings.tsx b/client_v2/src/install/Setup/Settings.tsx index c7848bf4..ba435476 100644 --- a/client_v2/src/install/Setup/Settings.tsx +++ b/client_v2/src/install/Setup/Settings.tsx @@ -3,6 +3,7 @@ import { useForm, Controller } from 'react-hook-form'; import { Trans, useTranslation } from 'react-i18next'; import i18n from 'i18next'; +import { Input } from 'panel/common/controls/Input'; import Controls from './Controls'; import AddressList from './AddressList'; @@ -21,7 +22,6 @@ import { import { validateRequiredValue } from '../../helpers/validators'; import { InstallInterface } from '../../initialState'; import { toNumber } from '../../helpers/form'; -import { Input } from 'panel/common/controls/Input'; const validateInstallPort = (value: number) => { if (value < MIN_PORT || value > MAX_PORT) {