diff --git a/src/components/Private/PrivateMenu.tsx b/src/components/Private/PrivateMenu.tsx index 6894518..8ecc6ab 100644 --- a/src/components/Private/PrivateMenu.tsx +++ b/src/components/Private/PrivateMenu.tsx @@ -3,8 +3,8 @@ import { Menu, MenuItemProps, MenuProps } from 'antd' import { Children, cloneElement, memo, ReactElement, useContext, useMemo } from 'react' import { Link, useLocation } from 'react-router-dom' +import { RootPathContext } from '@asb/context' import { isURLAvailable } from '@utils/permissions' -import { RootPathContext } from '@pages/Main' export type PrivateMenuProps = MenuProps & { root?: string } diff --git a/src/components/Private/PrivateSwitch.tsx b/src/components/Private/PrivateSwitch.tsx index 57911ed..1be3dff 100644 --- a/src/components/Private/PrivateSwitch.tsx +++ b/src/components/Private/PrivateSwitch.tsx @@ -1,12 +1,12 @@ import { join } from 'path' import { Location } from 'history' import { Children, cloneElement, memo, ReactElement, ReactNode, useCallback, useContext, useMemo } from 'react' - import { Redirect, Route, Switch, SwitchProps, useLocation } from 'react-router-dom' + +import { RootPathContext } from '@asb/context' import { isURLAvailable } from '@utils/permissions' import { getUserId } from '@utils/storage' -import { RootPathContext } from '@pages/Main' export type PrivateSwitchProps = SwitchProps & { root?: string diff --git a/src/context.ts b/src/context.ts new file mode 100644 index 0000000..06311dc --- /dev/null +++ b/src/context.ts @@ -0,0 +1,4 @@ +import { createContext } from 'react' + +export const IdWellContext = createContext(null) +export const RootPathContext = createContext('') diff --git a/src/pages/AdminPanel/Telemetry/index.jsx b/src/pages/AdminPanel/Telemetry/index.jsx index 9a145e0..7d97fda 100755 --- a/src/pages/AdminPanel/Telemetry/index.jsx +++ b/src/pages/AdminPanel/Telemetry/index.jsx @@ -2,10 +2,10 @@ import { Layout } from 'antd' import { lazy, memo, Suspense, useContext, useMemo } from 'react' import { useParams } from 'react-router-dom' +import { RootPathContext } from '@asb/context' import { PrivateMenu, PrivateSwitch } from '@components/Private' import { SuspenseFallback } from '@pages/SuspenseFallback' -import { RootPathContext } from '@pages/Main' const TelemetryViewer = lazy(() => import('./TelemetryViewer')) const TelemetryMerger = lazy(() => import('./TelemetryMerger')) diff --git a/src/pages/AdminPanel/index.jsx b/src/pages/AdminPanel/index.jsx index 8963f67..c704c99 100755 --- a/src/pages/AdminPanel/index.jsx +++ b/src/pages/AdminPanel/index.jsx @@ -2,9 +2,9 @@ import { Layout } from 'antd' import { lazy, memo, Suspense, useContext, useMemo } from 'react' import { useParams } from 'react-router-dom' +import { RootPathContext } from '@asb/context' import { PrivateMenu, PrivateSwitch } from '@components/Private' -import { RootPathContext } from '@pages/Main' import { SuspenseFallback } from '@pages/SuspenseFallback' const ClusterController = lazy(() => import( './ClusterController')) diff --git a/src/pages/Analytics/WellCompositeEditor/NewParamsTable.jsx b/src/pages/Analytics/WellCompositeEditor/NewParamsTable.jsx index c353e4d..d01c9f5 100755 --- a/src/pages/Analytics/WellCompositeEditor/NewParamsTable.jsx +++ b/src/pages/Analytics/WellCompositeEditor/NewParamsTable.jsx @@ -1,12 +1,12 @@ import { memo, useCallback, useContext, useEffect, useState } from 'react' import { Button, Modal, Popconfirm } from 'antd' +import { IdWellContext } from '@asb/context' import { Table } from '@components/Table' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { DrillParamsService } from '@api' -import { IdWellContext } from '@pages/Well' import { getColumns } from '@pages/WellOperations/WellDrillParams' export const NewParamsTable = memo(({ selectedWellsKeys }) => { diff --git a/src/pages/Analytics/WellCompositeEditor/WellCompositeSections.jsx b/src/pages/Analytics/WellCompositeEditor/WellCompositeSections.jsx index 38aa452..228e8f3 100755 --- a/src/pages/Analytics/WellCompositeEditor/WellCompositeSections.jsx +++ b/src/pages/Analytics/WellCompositeEditor/WellCompositeSections.jsx @@ -3,6 +3,7 @@ import { useState, useEffect, memo, useMemo, useContext } from 'react' import { LineChartOutlined, ProfileOutlined } from '@ant-design/icons' import { Table, Tag, Button, Badge, Divider, Modal, Row, Col } from 'antd' +import { IdWellContext } from '@asb/context' import { CompanyView } from '@components/views' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' @@ -15,7 +16,6 @@ import { getOperations } from '@utils/functions' -import { IdWellContext } from '@pages/Well' import { Tvd } from '@pages/WellOperations/Tvd' import WellOperationsTable from '@pages/Cluster/WellOperationsTable' import NewParamsTable from './NewParamsTable' diff --git a/src/pages/Analytics/WellCompositeEditor/index.jsx b/src/pages/Analytics/WellCompositeEditor/index.jsx index 8cecd33..9725994 100755 --- a/src/pages/Analytics/WellCompositeEditor/index.jsx +++ b/src/pages/Analytics/WellCompositeEditor/index.jsx @@ -2,14 +2,14 @@ import { useState, useEffect, memo, useContext } from 'react' import { useParams } from 'react-router-dom' import { Col, Layout, Row } from 'antd' -import { arrayOrDefault } from '@utils' +import { IdWellContext } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import WellSelector from '@components/selectors/WellSelector' import { invokeWebApiWrapperAsync } from '@components/factory' import { PrivateMenu, PrivateSwitch } from '@components/Private' +import { arrayOrDefault } from '@utils' import { OperationStatService, WellCompositeService } from '@api' -import { IdWellContext } from '@pages/Well' import ClusterWells from '@pages/Cluster/ClusterWells' import { WellCompositeSections } from './WellCompositeSections' diff --git a/src/pages/Analytics/index.jsx b/src/pages/Analytics/index.jsx index 1a38c6a..33834a4 100755 --- a/src/pages/Analytics/index.jsx +++ b/src/pages/Analytics/index.jsx @@ -2,11 +2,11 @@ import { memo, useContext, useMemo } from 'react' import { useParams } from 'react-router-dom' import { Layout } from 'antd' +import { RootPathContext } from '@asb/context' import { PrivateMenu, PrivateSwitch } from '@components/Private' import Statistics from './Statistics' import WellCompositeEditor from './WellCompositeEditor' -import { RootPathContext } from '@pages/Main' export const Analytics = memo(() => { const { tab } = useParams() diff --git a/src/pages/Documents/DocumentsTemplate.jsx b/src/pages/Documents/DocumentsTemplate.jsx index dc98a2e..479ac5b 100755 --- a/src/pages/Documents/DocumentsTemplate.jsx +++ b/src/pages/Documents/DocumentsTemplate.jsx @@ -1,15 +1,15 @@ import { useState, useEffect, useMemo, useCallback, useContext } from 'react' import { DatePicker, Button, Input } from 'antd' -import { FileService } from '@api' +import { IdWellContext } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import { UploadForm } from '@components/UploadForm' import { CompanyView, UserView } from '@components/views' -import { EditableTable, makeColumn, makeDateColumn, makeNumericColumn, makePaginationObject } from '@components/Table' import { invokeWebApiWrapperAsync, downloadFile, formatBytes } from '@components/factory' +import { EditableTable, makeColumn, makeDateColumn, makeNumericColumn, makePaginationObject } from '@components/Table' import { hasPermission } from '@utils/permissions' +import { FileService } from '@api's -import { IdWellContext } from '@pages/Well' const pageSize = 12 const { RangePicker } = DatePicker diff --git a/src/pages/Documents/index.jsx b/src/pages/Documents/index.jsx index 3c79213..4711d81 100755 --- a/src/pages/Documents/index.jsx +++ b/src/pages/Documents/index.jsx @@ -3,10 +3,10 @@ import { memo, useContext, useMemo } from 'react' import { FolderOutlined } from '@ant-design/icons' import { Layout } from 'antd' +import { RootPathContext } from '@asb/context' import { PrivateMenu, PrivateSwitch } from '@components/Private' import DocumentsTemplate from './DocumentsTemplate' -import { RootPathContext } from '@pages/Main' const { Content } = Layout diff --git a/src/pages/DrillingProgram/CategoryAdder.jsx b/src/pages/DrillingProgram/CategoryAdder.jsx index 66534e7..23c5118 100755 --- a/src/pages/DrillingProgram/CategoryAdder.jsx +++ b/src/pages/DrillingProgram/CategoryAdder.jsx @@ -2,11 +2,11 @@ import { Form, Select } from 'antd' import { FileAddOutlined } from '@ant-design/icons' import { memo, useCallback, useContext, useEffect, useState } from 'react' +import { IdWellContext } from '@asb/context' import Poprompt from '@components/selectors/Poprompt' import { invokeWebApiWrapperAsync } from '@components/factory' import { DrillingProgramService } from '@api' -import { IdWellContext } from '@pages/Well' import '@styles/drilling_program.less' diff --git a/src/pages/DrillingProgram/CategoryEditor.jsx b/src/pages/DrillingProgram/CategoryEditor.jsx index 4bedc5e..13f0ddf 100755 --- a/src/pages/DrillingProgram/CategoryEditor.jsx +++ b/src/pages/DrillingProgram/CategoryEditor.jsx @@ -2,6 +2,7 @@ import { Input, Modal, Radio } from 'antd' import { memo, useCallback, useContext, useEffect, useMemo, useState } from 'react' import { BehaviorSubject, debounceTime, distinctUntilChanged, filter, map } from 'rxjs' +import { IdWellContext } from '@asb/context' import { UserView } from '@components/views' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' @@ -9,7 +10,6 @@ import { makeColumn, makeNumericSorter, Table } from '@components/Table' import { DrillingProgramService } from '@api' import { arrayOrDefault } from '@utils' -import { IdWellContext } from '@pages/Well' const userRules = [ { label: 'Нет', value: 0 }, diff --git a/src/pages/DrillingProgram/CategoryHistory.jsx b/src/pages/DrillingProgram/CategoryHistory.jsx index b9f1424..a89df43 100755 --- a/src/pages/DrillingProgram/CategoryHistory.jsx +++ b/src/pages/DrillingProgram/CategoryHistory.jsx @@ -1,6 +1,7 @@ import { useCallback, useContext, useEffect, useState } from 'react' import { Button, DatePicker, Input, Modal } from 'antd' +import { IdWellContext } from '@asb/context' import { CompanyView } from '@components/views' import DownloadLink from '@components/DownloadLink' import LoaderPortal from '@components/LoaderPortal' @@ -10,7 +11,6 @@ import { arrayOrDefault, formatDate } from '@utils' import { FileService } from '@api' import MarksCard from './MarksCard' -import { IdWellContext } from '@pages/Well' import '@styles/drilling_program.less' diff --git a/src/pages/DrillingProgram/CategoryRender.jsx b/src/pages/DrillingProgram/CategoryRender.jsx index 92f6e27..770c7c2 100755 --- a/src/pages/DrillingProgram/CategoryRender.jsx +++ b/src/pages/DrillingProgram/CategoryRender.jsx @@ -6,6 +6,7 @@ import { TableOutlined, } from '@ant-design/icons' +import { IdWellContext } from '@asb/context' import { UserView } from '@components/views' import UploadForm from '@components/UploadForm' import DownloadLink from '@components/DownloadLink' @@ -16,7 +17,6 @@ import { DrillingProgramService } from '@api' import { formatDate } from '@utils' import MarksCard from './MarksCard' -import { IdWellContext } from '@pages/Well' import '@styles/drilling_program.less' diff --git a/src/pages/DrillingProgram/index.jsx b/src/pages/DrillingProgram/index.jsx index 1b08c73..ae3a530 100755 --- a/src/pages/DrillingProgram/index.jsx +++ b/src/pages/DrillingProgram/index.jsx @@ -10,6 +10,7 @@ import { } from '@ant-design/icons' import { memo, useCallback, useContext, useEffect, useMemo, useState } from 'react' +import { IdWellContext } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import { downloadFile, formatBytes, invokeWebApiWrapperAsync } from '@components/factory' import { arrayOrDefault, formatDate } from '@utils' @@ -19,7 +20,6 @@ import CategoryAdder from './CategoryAdder' import CategoryRender from './CategoryRender' import CategoryEditor from './CategoryEditor' import CategoryHistory from './CategoryHistory' -import { IdWellContext } from '@pages/Well' import '@styles/drilling_program.less' diff --git a/src/pages/Main.jsx b/src/pages/Main.jsx index 183da19..67a39fb 100755 --- a/src/pages/Main.jsx +++ b/src/pages/Main.jsx @@ -1,6 +1,7 @@ -import { createContext, memo } from 'react' +import { memo } from 'react' import { Route, Switch } from 'react-router-dom' +import { RootPathContext } from '@asb/context' import { AdminLayoutPortal, LayoutPortal } from '@components/Layout' import { PrivateDefaultRoute, PrivateRoute } from '@components/Private' @@ -10,8 +11,6 @@ import Deposit from './Deposit' import AdminPanel from './AdminPanel' import AccessDenied from './AccessDenied' -export const RootPathContext = createContext('') - export const Main = memo(() => ( diff --git a/src/pages/Measure/MeasureTable.jsx b/src/pages/Measure/MeasureTable.jsx index 32bd830..6f858dd 100755 --- a/src/pages/Measure/MeasureTable.jsx +++ b/src/pages/Measure/MeasureTable.jsx @@ -9,6 +9,7 @@ import { DeleteOutlined } from '@ant-design/icons' +import { IdWellContext } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { hasPermission } from '@utils/permissions' @@ -16,7 +17,6 @@ import { formatDate } from '@utils' import { MeasureService } from '@api' import { View } from './View' -import { IdWellContext } from '@pages/Well' import '@styles/index.css' import '@styles/measure.css' diff --git a/src/pages/Measure/index.jsx b/src/pages/Measure/index.jsx index af15e53..ecc1e6d 100755 --- a/src/pages/Measure/index.jsx +++ b/src/pages/Measure/index.jsx @@ -2,16 +2,16 @@ import { Button } from 'antd' import { useState, useEffect, memo, useContext } from 'react' import { TableOutlined } from '@ant-design/icons' -import { MeasureService } from '@api' +import { IdWellContext } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' +import { MeasureService } from '@api' import { MeasureTable } from './MeasureTable' import { InclinometryTable } from './InclinometryTable' import { columnsNnb, nnbDefaultData } from './nnbData' import { columnsMudDiagram, mudDiagramDefaultData } from './mudDiagramData' import { columnsDrillingFluid, drillingFluidDefaultData } from './drillingFluidData' -import { IdWellContext } from '@pages/Well' const defaultData = [ { diff --git a/src/pages/Report/Reports.jsx b/src/pages/Report/Reports.jsx index c5fb7ca..9d0609f 100755 --- a/src/pages/Report/Reports.jsx +++ b/src/pages/Report/Reports.jsx @@ -2,12 +2,12 @@ import { Button, Tooltip } from 'antd' import { useState, useEffect, memo, useContext } from 'react' import { FilePdfOutlined, FileTextOutlined } from '@ant-design/icons' -import { ReportService } from '@api' -import { formatDate, periodToString } from '@utils' +import { IdWellContext } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import { Table, makeDateSorter, makeNumericSorter } from '@components/Table' import { invokeWebApiWrapperAsync, downloadFile } from '@components/factory' -import { IdWellContext } from '@pages/Well' +import { formatDate, periodToString } from '@utils' +import { ReportService } from '@api' const imgPaths = { '.pdf': , diff --git a/src/pages/Telemetry/Archive/index.jsx b/src/pages/Telemetry/Archive/index.jsx index 1a45d4e..fe37028 100755 --- a/src/pages/Telemetry/Archive/index.jsx +++ b/src/pages/Telemetry/Archive/index.jsx @@ -1,6 +1,7 @@ /* eslint-disable react-hooks/exhaustive-deps */ import { useState, useEffect, memo, useCallback, useContext } from 'react' +import { IdWellContext } from '@asb/context' import { Flex } from '@components/Grid' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' @@ -8,7 +9,6 @@ import { DatePickerWrapper, makeDateSorter } from '@components/Table' import { PeriodPicker, defaultPeriod } from '@components/selectors/PeriodPicker' import { TelemetryDataSaubService } from '@api' -import { IdWellContext } from '@pages/Well' import { normalizeData } from '../TelemetryView' import { ArchiveDisplay, cutData } from './ArchiveDisplay' diff --git a/src/pages/Telemetry/DashboardNNB/index.jsx b/src/pages/Telemetry/DashboardNNB/index.jsx index cf16bcf..5fd2e6c 100644 --- a/src/pages/Telemetry/DashboardNNB/index.jsx +++ b/src/pages/Telemetry/DashboardNNB/index.jsx @@ -3,6 +3,7 @@ import { useHistory, useParams } from 'react-router-dom' import { CloseOutlined } from '@ant-design/icons' import { Button, Menu, Popconfirm } from 'antd' +import { IdWellContext, RootPathContext } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { BaseWidget, WidgetSettingsWindow } from '@components/widgets' @@ -19,8 +20,6 @@ import { WitsRecord61Service, } from '@api' -import { IdWellContext } from '@pages/Well' -import { RootPathContext } from '@pages/Main' import AddGroupWindow from './AddGroupWindow' import AddWidgetWindow, { makeWidgetFromWits } from './AddWidgetWindow' diff --git a/src/pages/Telemetry/Operations/index.jsx b/src/pages/Telemetry/Operations/index.jsx new file mode 100644 index 0000000..ee25cae --- /dev/null +++ b/src/pages/Telemetry/Operations/index.jsx @@ -0,0 +1,28 @@ +import { memo, useContext, useEffect, useState } from 'react' + +import { IdWellContext } from '@asb/context' +import LoaderPortal from '@components/LoaderPortal' +import { invokeWebApiWrapperAsync } from '@components/factory' + + +export const Operations = memo(() => { + const idWell = useContext(IdWellContext) + const [isLoading, setIsLoading] = useState(false) + + useEffect(() => invokeWebApiWrapperAsync( + async () => { + // + }, + setIsLoading, + 'Не удалось загрузить список определённых операций', + 'Получение списка определённых операций', + )) + + return ( + + + + ) +}) + +export default Operations diff --git a/src/pages/Telemetry/TelemetryView/ActiveMessagesOnline.jsx b/src/pages/Telemetry/TelemetryView/ActiveMessagesOnline.jsx index f839c02..3e9ea0b 100755 --- a/src/pages/Telemetry/TelemetryView/ActiveMessagesOnline.jsx +++ b/src/pages/Telemetry/TelemetryView/ActiveMessagesOnline.jsx @@ -1,13 +1,13 @@ import { Table } from 'antd' import { useState, useEffect, useCallback, memo, useContext } from 'react' +import { IdWellContext } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { Subscribe } from '@services/signalr' import { MessageService } from '@api' import { columns } from '../Messages' -import { IdWellContext } from '@pages/Well' import '@styles/message.css' diff --git a/src/pages/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx b/src/pages/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx index 985dd96..d98f91c 100755 --- a/src/pages/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx +++ b/src/pages/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx @@ -1,14 +1,14 @@ import { memo, useCallback, useContext, useMemo, useState } from 'react' import { Select, Modal, Input, InputNumber } from 'antd' -import { SetpointsService } from '@api' +import { IdWellContext } from '@asb/context' 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/selectors/PeriodPicker' +import { SetpointsService } from '@api' -import { IdWellContext } from '@pages/Well' export const SetpointSender = memo(({ onClose, visible, setpointNames }) => { const [expirePeriod, setExpirePeriod] = useState(defaultPeriod) diff --git a/src/pages/Telemetry/TelemetryView/Setpoints/index.jsx b/src/pages/Telemetry/TelemetryView/Setpoints/index.jsx index bf54c98..7cf4901 100755 --- a/src/pages/Telemetry/TelemetryView/Setpoints/index.jsx +++ b/src/pages/Telemetry/TelemetryView/Setpoints/index.jsx @@ -1,6 +1,7 @@ import { Button, Modal } from 'antd' import { useState, useEffect, memo, useCallback, useMemo, useContext } from 'react' +import { IdWellContext } from '@asb/context' import { Table } from '@components/Table' import { UserView } from '@components/views' import LoaderPortal from '@components/LoaderPortal' @@ -10,7 +11,6 @@ import { makeStringCutter } from '@utils/string' import { formatDate } from '@utils' import { SetpointsService } from '@api' -import { IdWellContext } from '@pages/Well' import SetpointSender from './SetpointSender' import { SetpointViewer, getSetpointStatus } from './SetpointViewer' diff --git a/src/pages/Telemetry/TelemetryView/WirelineRunOut.jsx b/src/pages/Telemetry/TelemetryView/WirelineRunOut.jsx index ec5a9f6..a6fc188 100644 --- a/src/pages/Telemetry/TelemetryView/WirelineRunOut.jsx +++ b/src/pages/Telemetry/TelemetryView/WirelineRunOut.jsx @@ -1,10 +1,10 @@ import { memo, useCallback, useContext, useEffect, useState } from 'react' -import { TelemetryWirelineRunOutService } from '@api' -import { invokeWebApiWrapperAsync } from '@components/factory' +import { IdWellContext } from '@asb/context' import { WirelineView } from '@components/views' +import { invokeWebApiWrapperAsync } from '@components/factory' +import { TelemetryWirelineRunOutService } from '@api' -import { IdWellContext } from '@pages/Well' export const WirelineRunOut = memo(() => { const [twro, setTwro] = useState({}) diff --git a/src/pages/Telemetry/TelemetryView/index.jsx b/src/pages/Telemetry/TelemetryView/index.jsx index aa0083a..2189da5 100755 --- a/src/pages/Telemetry/TelemetryView/index.jsx +++ b/src/pages/Telemetry/TelemetryView/index.jsx @@ -8,6 +8,7 @@ import { TelemetryDataSpinService, WellService } from '@api' +import { IdWellContext } from '@asb/context' import { makeDateSorter } from '@components/Table' import LoaderPortal from '@components/LoaderPortal' import { Grid, GridItem, Flex } from '@components/Grid' @@ -23,7 +24,6 @@ import { ModeDisplay } from './ModeDisplay' import { UserOfWell } from './UserOfWells' import { Setpoints } from './Setpoints' import WirelineRunOut from './WirelineRunOut' -import { IdWellContext } from '@pages/Well' import MomentStabPicEnabled from '@images/DempherOn.png' import MomentStabPicDisabled from '@images/DempherOff.png' diff --git a/src/pages/Telemetry/index.jsx b/src/pages/Telemetry/index.jsx index 85189ba..3cc7336 100755 --- a/src/pages/Telemetry/index.jsx +++ b/src/pages/Telemetry/index.jsx @@ -3,13 +3,13 @@ import { memo, useContext, useMemo } from 'react' import { Layout } from 'antd' import { AlertOutlined, FundViewOutlined, DatabaseOutlined } from '@ant-design/icons' +import { RootPathContext } from '@asb/context' import { PrivateSwitch, PrivateMenu } from '@components/Private' import Archive from './Archive' import Messages from './Messages' import DashboardNNB from './DashboardNNB' import TelemetryView from './TelemetryView' -import { RootPathContext } from '@pages/Main' import '@styles/index.css' diff --git a/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToDay.jsx b/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToDay.jsx index f679a67..b2f3c6e 100755 --- a/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToDay.jsx +++ b/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToDay.jsx @@ -1,11 +1,11 @@ import { useState, useEffect, memo, useContext } from 'react' -import { TelemetryAnalyticsService } from '@api' +import { IdWellContext } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { ChartTelemetryDepthToDay } from '@components/charts/ChartTelemetryDepthToDay' +import { TelemetryAnalyticsService } from '@api' -import { IdWellContext } from '@pages/Well' export const TelemetryAnalysisDepthToDay = memo(() => { const [depthData, setDepthData] = useState([]) diff --git a/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToInterval.jsx b/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToInterval.jsx index c5cb90e..f2a6f6c 100755 --- a/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToInterval.jsx +++ b/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToInterval.jsx @@ -1,13 +1,13 @@ import { Select } from 'antd' import { useState, useEffect, memo, useContext } from 'react' +import { IdWellContext } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { ChartTelemetryDepthToInterval } from '@components/charts/ChartTelemetryDepthToInterval' import { TelemetryAnalyticsService } from '@api' import { arrayOrDefault } from '@utils' -import { IdWellContext } from '@pages/Well' const timePeriodCollection = [ { value: '3600', label: '1 час' }, diff --git a/src/pages/TelemetryAnalysis/TelemetryAnalysisOperationsSummary.jsx b/src/pages/TelemetryAnalysis/TelemetryAnalysisOperationsSummary.jsx index 37e35b5..d5b88f6 100755 --- a/src/pages/TelemetryAnalysis/TelemetryAnalysisOperationsSummary.jsx +++ b/src/pages/TelemetryAnalysis/TelemetryAnalysisOperationsSummary.jsx @@ -2,12 +2,12 @@ import moment from 'moment' import { Form, DatePicker } from 'antd' import { useState, useEffect, memo, useContext } from 'react' -import { TelemetryAnalyticsService } from '@api' +import { IdWellContext } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { ChartTelemetryOperationsSummary } from '@components/charts/ChartTelemetryOperationsSummary' +import { TelemetryAnalyticsService } from '@api' -import { IdWellContext } from '@pages/Well' const { RangePicker } = DatePicker diff --git a/src/pages/TelemetryAnalysis/index.jsx b/src/pages/TelemetryAnalysis/index.jsx index 54bae03..4b24fea 100755 --- a/src/pages/TelemetryAnalysis/index.jsx +++ b/src/pages/TelemetryAnalysis/index.jsx @@ -3,13 +3,13 @@ import { memo, useContext, useMemo } from 'react' import { FolderOutlined } from '@ant-design/icons' import { Layout } from 'antd' +import { RootPathContext } from '@asb/context' import { PrivateMenu, PrivateSwitch } from '@components/Private' import TelemetryAnalysisDepthToDay from './TelemetryAnalysisDepthToDay' import TelemetryAnalysisDepthToInterval from './TelemetryAnalysisDepthToInterval' import TelemetryAnalysisOperationsSummary from './TelemetryAnalysisOperationsSummary' import TelemetryAnalysisOperationsToInterval from './TelemetryAnalysisOperationsToInterval' -import { RootPathContext } from '@pages/Main' const { Content } = Layout diff --git a/src/pages/Well.jsx b/src/pages/Well.jsx index f3aa58c..3f998f0 100755 --- a/src/pages/Well.jsx +++ b/src/pages/Well.jsx @@ -1,4 +1,4 @@ -import { createContext, memo, useContext, useMemo } from 'react' +import { memo, useContext, useMemo } from 'react' import { FolderOutlined, FundViewOutlined, @@ -9,6 +9,7 @@ import { import { Layout } from 'antd' import { useParams } from 'react-router-dom' +import { IdWellContext, RootPathContext } from '@asb/context' import { PrivateMenu, PrivateSwitch } from '@components/Private' import Report from './Report' @@ -19,14 +20,11 @@ import Telemetry from './Telemetry' import WellOperations from './WellOperations' import DrillingProgram from './DrillingProgram' import TelemetryAnalysis from './TelemetryAnalysis' -import { RootPathContext } from './Main' import '@styles/index.css' const { Content } = Layout -export const IdWellContext = createContext(null) - export const Well = memo(() => { const { idWell, tab } = useParams() const root = useContext(RootPathContext) diff --git a/src/pages/WellOperations/index.jsx b/src/pages/WellOperations/index.jsx index c807f08..c77a3c6 100755 --- a/src/pages/WellOperations/index.jsx +++ b/src/pages/WellOperations/index.jsx @@ -9,6 +9,7 @@ import { TableOutlined, } from '@ant-design/icons' +import { IdWellContext, RootPathContext } from '@asb/context' import { PrivateMenu, PrivateSwitch } from '@components/Private' import { Tvd } from './Tvd' @@ -19,8 +20,6 @@ import { WellSectionsStat } from './WellSectionsStat' import { WellOperationsEditor } from './WellOperationsEditor' import { Flex } from '@components/Grid' -import { RootPathContext } from '@pages/Main' -import { IdWellContext } from '@pages/Well' const { Content } = Layout