From b6ae539c364e65f2777be68e9d00f708e2fcda89 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Fri, 5 Apr 2019 14:32:56 +0300 Subject: [PATCH] * client: rename constant --- client/src/components/Settings/Dhcp/index.js | 14 +++++++------- client/src/helpers/constants.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/src/components/Settings/Dhcp/index.js b/client/src/components/Settings/Dhcp/index.js index c152b7f0..18dd4901 100644 --- a/client/src/components/Settings/Dhcp/index.js +++ b/client/src/components/Settings/Dhcp/index.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import classnames from 'classnames'; import { Trans, withNamespaces } from 'react-i18next'; -import { RESPONSE_STATUS } from '../../../helpers/constants'; +import { DHCP_STATUS_RESPONSE } from '../../../helpers/constants'; import Form from './Form'; import Leases from './Leases'; import Interface from './Interface'; @@ -24,7 +24,7 @@ class Dhcp extends Component { config, check, processingDhcp, processingConfig, } = this.props.dhcp; const otherDhcpFound = - check && check.otherServer && check.otherServer.found === RESPONSE_STATUS.YES; + check && check.otherServer && check.otherServer.found === DHCP_STATUS_RESPONSE.YES; const filledConfig = Object.keys(config).every((key) => { if (key === 'enabled' || key === 'icmp_timeout_msec') { return true; @@ -67,7 +67,7 @@ class Dhcp extends Component { getActiveDhcpMessage = (t, check) => { const { found } = check.otherServer; - if (found === RESPONSE_STATUS.ERROR) { + if (found === DHCP_STATUS_RESPONSE.ERROR) { return (
dhcp_error @@ -82,7 +82,7 @@ class Dhcp extends Component { return (
- {found === RESPONSE_STATUS.YES ? ( + {found === DHCP_STATUS_RESPONSE.YES ? (
dhcp_found
@@ -96,7 +96,7 @@ class Dhcp extends Component { } getDhcpWarning = (check) => { - if (check.otherServer.found === RESPONSE_STATUS.NO) { + if (check.otherServer.found === DHCP_STATUS_RESPONSE.NO) { return ''; } @@ -108,7 +108,7 @@ class Dhcp extends Component { } getStaticIpWarning = (t, check, interfaceName) => { - if (check.staticIP.static === RESPONSE_STATUS.ERROR) { + if (check.staticIP.static === DHCP_STATUS_RESPONSE.ERROR) { return (
@@ -123,7 +123,7 @@ class Dhcp extends Component { ); } else if ( - check.staticIP.static === RESPONSE_STATUS.YES + check.staticIP.static === DHCP_STATUS_RESPONSE.YES && check.staticIP.ip && interfaceName ) { diff --git a/client/src/helpers/constants.js b/client/src/helpers/constants.js index bbe5a5fc..703a8dff 100644 --- a/client/src/helpers/constants.js +++ b/client/src/helpers/constants.js @@ -158,7 +158,7 @@ export const UNSAFE_PORTS = [ export const ALL_INTERFACES_IP = '0.0.0.0'; -export const RESPONSE_STATUS = { +export const DHCP_STATUS_RESPONSE = { YES: 'yes', NO: 'no', ERROR: 'error',