diff --git a/src/pages/Cluster/functions.jsx b/src/pages/Cluster/functions.jsx
index e92d316..8aba6b7 100644
--- a/src/pages/Cluster/functions.jsx
+++ b/src/pages/Cluster/functions.jsx
@@ -3,7 +3,7 @@ import { OperationStatService } from '@api'
const maxPrefix = 'isMax'
const minPrefix = 'isMin'
-export const getPrecision = (number) => Number.isNaN(number ?? NaN) ? '-' : number.toFixed(2)
+export const getPrecision = (number) => Number.isFinite(number) ? number.toFixed(2) : '-'
export const getOperations = async (idWell) => {
const ops = await OperationStatService.getTvd(idWell)
diff --git a/src/pages/Deposit.jsx b/src/pages/Deposit.jsx
index 463438c..f337ed3 100644
--- a/src/pages/Deposit.jsx
+++ b/src/pages/Deposit.jsx
@@ -3,6 +3,7 @@ import { Link } from 'react-router-dom'
import { useState, useEffect, memo } from 'react'
import { ClusterService } from '@api'
+import { arrayOrDefault } from '@utils'
import { PointerIcon } from '@components/icons'
import LoaderPortal from '@components/LoaderPortal'
import { invokeWebApiWrapperAsync } from '@components/factory'
@@ -43,7 +44,7 @@ export const Deposit = memo(() => {
useEffect(() => invokeWebApiWrapperAsync(
async () => {
const data = await ClusterService.getClusters()
- setClustersData(data)
+ setClustersData(arrayOrDefault(data))
setViewParams(calcViewParams(data))
},
setShowLoader,
@@ -54,7 +55,7 @@ export const Deposit = memo(() => {
diff --git a/src/pages/Login.jsx b/src/pages/Login.jsx
index 09432fe..31e30a8 100644
--- a/src/pages/Login.jsx
+++ b/src/pages/Login.jsx
@@ -1,20 +1,20 @@
+import { memo, useState } from 'react'
+import { Link, useHistory } from 'react-router-dom'
import { Card, Form, Input, Button } from 'antd'
import { UserOutlined, LockOutlined } from '@ant-design/icons'
-import { useState } from 'react'
-import { Link, useHistory } from 'react-router-dom'
import { AuthService } from '@api'
+import { setUser } from '@utils/storage'
import LoaderPortal from '@components/LoaderPortal'
import { invokeWebApiWrapperAsync } from '@components/factory'
import { loginRules, passwordRules } from '@utils/validationRules'
-import { setUser } from '@utils/storage'
import '@styles/index.css'
import logo from '@images/logo_32.png'
const logoIcon =
-export const Login = () => {
+export const Login = memo(() => {
const history = useHistory()
const [showLoader, setShowLoader] = useState(false)
@@ -51,6 +51,6 @@ export const Login = () => {
)
-}
+})
export default Login
diff --git a/src/pages/Measure/MeasureTable.jsx b/src/pages/Measure/MeasureTable.jsx
index 191afc8..5d31991 100644
--- a/src/pages/Measure/MeasureTable.jsx
+++ b/src/pages/Measure/MeasureTable.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react'
+import { useState, useEffect, memo } from 'react'
import { Button, Form, Input, Popconfirm, Timeline } from 'antd'
import {
CheckSquareOutlined,
@@ -9,20 +9,20 @@ import {
DeleteOutlined
} from '@ant-design/icons'
-import LoaderPortal from '../../components/LoaderPortal'
-import { MeasureService } from '../../services/api'
-import { invokeWebApiWrapperAsync } from '../../components/factory'
+import LoaderPortal from '@components/LoaderPortal'
+import { invokeWebApiWrapperAsync } from '@components/factory'
+import { MeasureService } from '@api'
+import { formatDate } from '@utils'
import { View } from './View'
-import '../../styles/index.css'
-import '../../styles/measure.css'
-import { formatDate } from '../../utils'
+import '@styles/index.css'
+import '@styles/measure.css'
const createEditingColumns = (cols, renderDelegate) =>
cols.map(col => ({ render: renderDelegate, ...col }))
-export const MeasureTable = ({idWell, group, updateMeasuresFunc, additionalButtons}) => {
+export const MeasureTable = memo(({idWell, group, updateMeasuresFunc, additionalButtons}) => {
const [showLoader, setShowLoader] = useState(false)
const [displayedValues, setDisplayedValues] = useState({})
const [editingColumns, setEditingColumns] = useState(group.columns)
@@ -160,4 +160,6 @@ export const MeasureTable = ({idWell, group, updateMeasuresFunc, additionalButto
>
)
-}
+})
+
+export default MeasureTable
diff --git a/src/pages/Measure/index.jsx b/src/pages/Measure/index.jsx
index 06beb48..104b3ad 100644
--- a/src/pages/Measure/index.jsx
+++ b/src/pages/Measure/index.jsx
@@ -1,5 +1,5 @@
import { Button } from 'antd'
-import { useState, useEffect } from 'react'
+import { useState, useEffect, memo } from 'react'
import { TableOutlined } from '@ant-design/icons'
import { MeasureService } from '@api'
@@ -41,7 +41,7 @@ const defaultData = [
}
]
-export const Measure = ({ idWell }) => {
+export const Measure = memo(({ idWell }) => {
const [showLoader, setShowLoader] = useState(false)
const [isMeasuresUpdating, setIsMeasuresUpdating] = useState(true)
const [data, setData] = useState(defaultData)
@@ -85,6 +85,6 @@ export const Measure = ({ idWell }) => {
/>
)
-}
+})
export default Measure
diff --git a/src/pages/Messages.jsx b/src/pages/Messages.jsx
index a3664c5..5e80d6a 100644
--- a/src/pages/Messages.jsx
+++ b/src/pages/Messages.jsx
@@ -3,8 +3,8 @@ import { useState, useEffect, memo } from 'react'
import { Table, Select, DatePicker, Input } from 'antd'
import { MessageService } from '@api'
-import { invokeWebApiWrapperAsync } from '@components/factory'
import LoaderPortal from '@components/LoaderPortal'
+import { invokeWebApiWrapperAsync } from '@components/factory'
import '@styles/message.css'
@@ -103,8 +103,8 @@ export const Messages = memo(({ idWell }) => {
return (
<>
-
-
Фильтр сообщений
+
+
Фильтр сообщений
)
-}
+})
+
+export default Report
diff --git a/src/pages/TelemetryView/SetpointSender.jsx b/src/pages/TelemetryView/SetpointSender.jsx
index 0bc26d1..95ca499 100644
--- a/src/pages/TelemetryView/SetpointSender.jsx
+++ b/src/pages/TelemetryView/SetpointSender.jsx
@@ -2,11 +2,11 @@ import { useState } from 'react'
import { Select, Modal, Input, InputNumber } from 'antd'
import { SetpointsService } from '@api'
+import { Grid, GridItem } from '@components/Grid'
import LoaderPortal from '@components/LoaderPortal'
import { invokeWebApiWrapperAsync } from '@components/factory'
import { makeNumericRender, EditableTable } from '@components/Table'
import { PeriodPicker, defaultPeriod } from '@components/PeriodPicker'
-import { Grid, GridItem } from '@components/Grid'
export const SetpointSender = ({ idWell, onClose, visible, setpointNames }) => {
const [expirePeriod, setExpirePeriod] = useState(defaultPeriod)
diff --git a/src/pages/TelemetryView/Setpoints.jsx b/src/pages/TelemetryView/Setpoints.jsx
index 093acc9..77563f3 100644
--- a/src/pages/TelemetryView/Setpoints.jsx
+++ b/src/pages/TelemetryView/Setpoints.jsx
@@ -2,12 +2,12 @@ import moment from 'moment'
import { Button, Modal } from 'antd'
import { useState, useEffect } from 'react'
-import { Table } from '../../components/Table'
-import { UserView } from '../../components/views'
-import LoaderPortal from '../../components/LoaderPortal'
-import { invokeWebApiWrapperAsync } from '../../components/factory'
-import { makeStringCutter } from '../../utils/string'
-import { SetpointsService } from '../../services/api'
+import { Table } from '@components/Table'
+import { UserView } from '@components/views'
+import LoaderPortal from '@components/LoaderPortal'
+import { invokeWebApiWrapperAsync } from '@components/factory'
+import { makeStringCutter } from '@utils/string'
+import { SetpointsService } from '@api'
import { SetpointSender } from './SetpointSender'
import { SetpointViewer, getSetpointStatus } from './SetpointViewer'
diff --git a/src/pages/WellOperations/ImportOperations.jsx b/src/pages/WellOperations/ImportOperations.jsx
index d396661..76e74e8 100644
--- a/src/pages/WellOperations/ImportOperations.jsx
+++ b/src/pages/WellOperations/ImportOperations.jsx
@@ -1,12 +1,13 @@
import { Switch } from 'antd'
-import { useState } from 'react'
+import { memo, useState } from 'react'
+
import { ErrorFetch } from '@components/ErrorFetch'
import { UploadForm } from '@components/UploadForm'
const errorTextStyle = { color: 'red', fontWeight: 'bold' }
const uploadFormStyle = { marginTop: '24px' }
-export const ImportOperations = ({ idWell, onDone }) =>{
+export const ImportOperations = memo(({ idWell, onDone }) =>{
const [deleteBeforeImport, setDeleteBeforeImport] = useState(false)
const [errorText, setErrorText] = useState('')
@@ -38,4 +39,6 @@ export const ImportOperations = ({ idWell, onDone }) =>{
{errorText}
)
-}
+})
+
+export default ImportOperations
diff --git a/src/pages/WellOperations/WellSectionsStat.jsx b/src/pages/WellOperations/WellSectionsStat.jsx
index fe1da03..f300d51 100644
--- a/src/pages/WellOperations/WellSectionsStat.jsx
+++ b/src/pages/WellOperations/WellSectionsStat.jsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react'
+import { useState, useEffect, memo } from 'react'
import LoaderPortal from '@components/LoaderPortal'
import { invokeWebApiWrapperAsync } from '@components/factory'
@@ -19,7 +19,7 @@ const columns = [
makeColumnsPlanFact('Спуск ОК, м/ч' ,'casingDownSpeed', { render: numericRender }),
]
-export const WellSectionsStat = ({idWell}) => {
+export const WellSectionsStat = memo(({ idWell }) => {
const [sections, setSections] = useState([])
const [showLoader, setShowLoader] = useState(false)
@@ -64,4 +64,6 @@ export const WellSectionsStat = ({idWell}) => {
/>
)
-}
+})
+
+export default WellSectionsStat