diff --git a/src/pages/AdminPanel/ClusterController.jsx b/src/pages/AdminPanel/ClusterController.jsx index 9ec8dd6..b73ea37 100644 --- a/src/pages/AdminPanel/ClusterController.jsx +++ b/src/pages/AdminPanel/ClusterController.jsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from 'react' +import { memo, useEffect, useState } from 'react' import { EditableTable, @@ -17,7 +17,7 @@ import { hasPermission } from '@utils/permissions' import { coordsFixed } from './DepositController' -export const ClusterController = () => { +export const ClusterController = memo(() => { const [deposits, setDeposits] = useState([]) const [clusters, setClusters] = useState([]) const [showLoader, setShowLoader] = useState(false) @@ -82,6 +82,6 @@ export const ClusterController = () => { /> ) -} +}) export default ClusterController diff --git a/src/pages/AdminPanel/CompanyController.jsx b/src/pages/AdminPanel/CompanyController.jsx index 4d1c402..1479287 100644 --- a/src/pages/AdminPanel/CompanyController.jsx +++ b/src/pages/AdminPanel/CompanyController.jsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from 'react' +import { memo, useEffect, useState } from 'react' import { EditableTable, @@ -16,7 +16,7 @@ import { min1 } from '@utils/validationRules' import { hasPermission } from '@utils/permissions' -export const CompanyController = () => { +export const CompanyController = memo(() => { const [columns, setColumns] = useState([]) const [companies, setCompanies] = useState([]) const [showLoader, setShowLoader] = useState(false) @@ -79,6 +79,6 @@ export const CompanyController = () => { /> ) -} +}) export default CompanyController diff --git a/src/pages/AdminPanel/CompanyTypeController.jsx b/src/pages/AdminPanel/CompanyTypeController.jsx index 2502994..6ee67bd 100644 --- a/src/pages/AdminPanel/CompanyTypeController.jsx +++ b/src/pages/AdminPanel/CompanyTypeController.jsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from 'react' +import { memo, useEffect, useState } from 'react' import { EditableTable, @@ -12,7 +12,7 @@ import { invokeWebApiWrapperAsync } from '@components/factory' import { AdminCompanyTypeService } from '@api' import { arrayOrDefault } from '@utils' import { min1 } from '@utils/validationRules' -import { hasPermission } from '@asb/utils/permissions' +import { hasPermission } from '@utils/permissions' const columns = [ makeColumn('Название', 'caption', { @@ -23,7 +23,7 @@ const columns = [ }), ] -export const CompanyTypeController = () => { +export const CompanyTypeController = memo(() => { const [companyTypes, setCompanyTypes] = useState([]) const [showLoader, setShowLoader] = useState(false) @@ -60,6 +60,6 @@ export const CompanyTypeController = () => { /> ) -} +}) export default CompanyTypeController diff --git a/src/pages/AdminPanel/DepositController.jsx b/src/pages/AdminPanel/DepositController.jsx index 564cad6..af9180d 100644 --- a/src/pages/AdminPanel/DepositController.jsx +++ b/src/pages/AdminPanel/DepositController.jsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from 'react' +import { memo, useEffect, useState } from 'react' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' @@ -16,7 +16,7 @@ const depositColumns = [ makeColumn('Долгота', 'longitude', { width: 150, editable: true, render: coordsFixed }) ] -export const DepositController = () => { +export const DepositController = memo(() => { const [deposits, setDeposits] = useState([]) const [showLoader, setShowLoader] = useState(false) @@ -53,6 +53,6 @@ export const DepositController = () => { /> ) -} +}) export default DepositController diff --git a/src/pages/AdminPanel/PermissionController.jsx b/src/pages/AdminPanel/PermissionController.jsx index da31202..d55e63a 100644 --- a/src/pages/AdminPanel/PermissionController.jsx +++ b/src/pages/AdminPanel/PermissionController.jsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from 'react' +import { memo, useEffect, useState } from 'react' import { EditableTable, @@ -26,7 +26,7 @@ const columns = [ }), ] -export const PermissionController = () => { +export const PermissionController = memo(() => { const [showLoader, setShowLoader] = useState(false) const [permissions, setPermissions] = useState([]) @@ -63,6 +63,6 @@ export const PermissionController = () => { /> ) -} +}) export default PermissionController diff --git a/src/pages/AdminPanel/TelemetryController.jsx b/src/pages/AdminPanel/TelemetryController.jsx index d64502b..dc65664 100644 --- a/src/pages/AdminPanel/TelemetryController.jsx +++ b/src/pages/AdminPanel/TelemetryController.jsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from 'react' +import { memo, useEffect, useState } from 'react' import { defaultPagination, @@ -29,7 +29,7 @@ const columns = [ makeTextColumn('Версия Спин Мастер', 'spinPlcVersion'), ] -export const TelemetryController = () => { +export const TelemetryController = memo(() => { const [telemetryData, setTelemetryData] = useState([]) const [isLoading, setIsLoading] = useState(false) @@ -59,6 +59,6 @@ export const TelemetryController = () => { /> ) -} +}) export default TelemetryController diff --git a/src/pages/AdminPanel/UserController/index.jsx b/src/pages/AdminPanel/UserController/index.jsx index d6b9177..dc5f87e 100644 --- a/src/pages/AdminPanel/UserController/index.jsx +++ b/src/pages/AdminPanel/UserController/index.jsx @@ -1,6 +1,6 @@ import { Button, Tag } from 'antd' import { UserSwitchOutlined } from '@ant-design/icons' -import { useEffect, useState } from 'react' +import { memo, useEffect, useState } from 'react' import { EditableTable, @@ -17,14 +17,14 @@ import { ChangePassword } from '@components/ChangePassword' import { invokeWebApiWrapperAsync } from '@components/factory' import { AdminCompanyService, AdminUserRoleService, AdminUserService } from '@api' import { createLoginRules, nameRules, phoneRules, emailRules } from '@utils/validationRules' -import { makeTextOnFilter, makeTextFilters, makeObjectOnFilter, makeArrayOnFilter } from '@utils/table' +import { makeTextOnFilter, makeTextFilters, makeArrayOnFilter } from '@utils/table' import { hasPermission } from '@utils/permissions' import { arrayOrDefault } from '@utils' import RoleTag from './RoleTag' -export const UserController = () => { +export const UserController = memo(() => { const [users, setUsers] = useState([]) const [showLoader, setShowLoader] = useState(false) const [columns, setColumns] = useState([]) @@ -174,6 +174,6 @@ export const UserController = () => { /> ) -} +}) export default UserController diff --git a/src/pages/AdminPanel/WellController/index.jsx b/src/pages/AdminPanel/WellController/index.jsx index 3d9b30e..e1317fb 100644 --- a/src/pages/AdminPanel/WellController/index.jsx +++ b/src/pages/AdminPanel/WellController/index.jsx @@ -1,6 +1,6 @@ -import { useEffect, useState } from 'react' import { Button } from 'antd' import { CopyOutlined } from '@ant-design/icons' +import { memo, useEffect, useState } from 'react' import { AdminClusterService, @@ -21,20 +21,20 @@ import { import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { TelemetryView, CompanyView } from '@components/views' +import { hasPermission } from '@utils/permissions' import { arrayOrDefault } from '@utils' import { coordsFixed } from '../DepositController' import TelemetrySelect from './TelemetrySelect' import '@styles/admin.css' -import { hasPermission } from '@asb/utils/permissions' const wellTypes = [ { value: 1, label: 'Наклонно-направленная' }, { value: 2, label: 'Горизонтальная' }, ] -export const WellController = () => { +export const WellController = memo(() => { const [columns, setColumns] = useState([]) const [wells, setWells] = useState([]) const [showLoader, setShowLoader] = useState(false) @@ -135,6 +135,6 @@ export const WellController = () => { /> ) -} +}) export default WellController