diff --git a/src/components/Layout/LayoutPortal.tsx b/src/components/Layout/LayoutPortal.tsx index 438acf9..15de833 100644 --- a/src/components/Layout/LayoutPortal.tsx +++ b/src/components/Layout/LayoutPortal.tsx @@ -2,7 +2,7 @@ import { memo, ReactNode } from 'react' import { Layout, LayoutProps } from 'antd' import PageHeader from '@components/PageHeader' -import WellTreeSelector from '@components/WellTreeSelector' +import WellTreeSelector from '@components/selectors/WellTreeSelector' export type LayoutPortalProps = LayoutProps & { title?: ReactNode diff --git a/src/components/PeriodPicker.tsx b/src/components/selectors/PeriodPicker.tsx similarity index 100% rename from src/components/PeriodPicker.tsx rename to src/components/selectors/PeriodPicker.tsx diff --git a/src/components/Poprompt.tsx b/src/components/selectors/Poprompt.tsx similarity index 100% rename from src/components/Poprompt.tsx rename to src/components/selectors/Poprompt.tsx diff --git a/src/components/selectors/TelemetrySelect.tsx b/src/components/selectors/TelemetrySelect.tsx new file mode 100644 index 0000000..0e8dd4e --- /dev/null +++ b/src/components/selectors/TelemetrySelect.tsx @@ -0,0 +1,34 @@ +import { Select, SelectProps } from 'antd' +import { memo } from 'react' + +import { getTelemetryLabel } from '@components/views' +import { TelemetryDto } from '@api' + +import '@styles/components/telemetry_select.less' + +export type TelemetrySelectProps = SelectProps & { + telemetry?: TelemetryDto[], + value?: TelemetryDto , + onChange?: (value?: TelemetryDto) => void, +} + +export const TelemetrySelect = memo(({ telemetry, value, onChange, ...other }) => ( + +)) + +export default TelemetrySelect diff --git a/src/components/WellSelector.jsx b/src/components/selectors/WellSelector.jsx similarity index 100% rename from src/components/WellSelector.jsx rename to src/components/selectors/WellSelector.jsx diff --git a/src/components/WellTreeSelector.tsx b/src/components/selectors/WellTreeSelector.tsx similarity index 96% rename from src/components/WellTreeSelector.tsx rename to src/components/selectors/WellTreeSelector.tsx index 15f96f2..f354d07 100644 --- a/src/components/WellTreeSelector.tsx +++ b/src/components/selectors/WellTreeSelector.tsx @@ -7,9 +7,9 @@ import { RawValueType } from 'rc-tree-select/lib/TreeSelect' import { LabelInValueType } from 'rc-select/lib/Select' import { isRawDate } from '@utils' -import LoaderPortal from './LoaderPortal' -import { WellIcon, WellIconState } from './icons' -import { invokeWebApiWrapperAsync } from './factory' +import LoaderPortal from '@components/LoaderPortal' +import { WellIcon, WellIconState } from '@components/icons' +import { invokeWebApiWrapperAsync } from '@components/factory' import { DepositService, DepositDto } from '@api' import { ReactComponent as DepositIcon } from '@images/DepositIcon.svg' diff --git a/src/pages/AdminPanel/WellController/TelemetrySelect.jsx b/src/pages/AdminPanel/WellController/TelemetrySelect.jsx deleted file mode 100644 index f33484e..0000000 --- a/src/pages/AdminPanel/WellController/TelemetrySelect.jsx +++ /dev/null @@ -1,23 +0,0 @@ -import { memo } from 'react' -import { Select } from 'antd' - -import { getTelemetryLabel } from '@components/views' - -export const TelemetrySelect = memo(({ telemetry, value, onChange }) => ( - -)) - -export default TelemetrySelect diff --git a/src/pages/AdminPanel/WellController/index.jsx b/src/pages/AdminPanel/WellController/index.jsx index 5b94148..5edd559 100644 --- a/src/pages/AdminPanel/WellController/index.jsx +++ b/src/pages/AdminPanel/WellController/index.jsx @@ -21,13 +21,11 @@ import { } from '@components/Table' import { invokeWebApiWrapperAsync } from '@components/factory' import { TelemetryView, CompanyView } from '@components/views' +import TelemetrySelect from '@components/selectors/TelemetrySelect' import { hasPermission } from '@utils/permissions' import { arrayOrDefault } from '@utils' import { coordsFixed } from '../DepositController' -import TelemetrySelect from './TelemetrySelect' - -import '@styles/admin.css' const wellTypes = [ { value: 1, label: 'Наклонно-направленная' }, diff --git a/src/pages/Analytics/Statistics.jsx b/src/pages/Analytics/Statistics.jsx index 3aabb59..c0ad71d 100644 --- a/src/pages/Analytics/Statistics.jsx +++ b/src/pages/Analytics/Statistics.jsx @@ -2,8 +2,8 @@ import { Table as RawTable, Typography } from 'antd' import { Fragment, memo, useCallback, useEffect, useState } from 'react' import LoaderPortal from '@components/LoaderPortal' -import { WellSelector } from '@components/WellSelector' import { invokeWebApiWrapperAsync } from '@components/factory' +import { WellSelector } from '@components/selectors/WellSelector' import { makeGroupColumn, makeNumericColumn, makeNumericRender, makeTextColumn, Table } from '@components/Table' import { OperationStatService, WellOperationService } from '@api' import { arrayOrDefault } from '@utils' diff --git a/src/pages/Analytics/WellCompositeEditor/index.jsx b/src/pages/Analytics/WellCompositeEditor/index.jsx index 4a56869..cd2de0d 100644 --- a/src/pages/Analytics/WellCompositeEditor/index.jsx +++ b/src/pages/Analytics/WellCompositeEditor/index.jsx @@ -8,7 +8,7 @@ import { } from '@api' import { arrayOrDefault } from '@utils' import LoaderPortal from '@components/LoaderPortal' -import WellSelector from '@components/WellSelector' +import WellSelector from '@components/selectors/WellSelector' import { invokeWebApiWrapperAsync } from '@components/factory' import { PrivateDefaultRoute, PrivateMenuItemLink, PrivateRoute } from '@components/Private' diff --git a/src/pages/Archive/index.jsx b/src/pages/Archive/index.jsx index 7ee7375..f969709 100644 --- a/src/pages/Archive/index.jsx +++ b/src/pages/Archive/index.jsx @@ -5,7 +5,7 @@ import { Flex } from '@components/Grid' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { DatePickerWrapper, makeDateSorter } from '@components/Table' -import { PeriodPicker, defaultPeriod } from '@components/PeriodPicker' +import { PeriodPicker, defaultPeriod } from '@components/selectors/PeriodPicker' import { TelemetryDataSaubService } from '@api' import { normalizeData } from '@pages/TelemetryView' diff --git a/src/pages/DrillingProgram/CategoryAdder.jsx b/src/pages/DrillingProgram/CategoryAdder.jsx index 390f8f9..dd45dad 100644 --- a/src/pages/DrillingProgram/CategoryAdder.jsx +++ b/src/pages/DrillingProgram/CategoryAdder.jsx @@ -2,7 +2,7 @@ import { Form, Select } from 'antd' import { FileAddOutlined } from '@ant-design/icons' import { memo, useCallback, useEffect, useState } from 'react' -import Poprompt from '@components/Poprompt' +import Poprompt from '@components/selectors/Poprompt' import { invokeWebApiWrapperAsync } from '@components/factory' import { DrillingProgramService } from '@api' diff --git a/src/pages/DrillingProgram/CategoryRender.jsx b/src/pages/DrillingProgram/CategoryRender.jsx index 3213c07..50316be 100644 --- a/src/pages/DrillingProgram/CategoryRender.jsx +++ b/src/pages/DrillingProgram/CategoryRender.jsx @@ -6,11 +6,11 @@ import { TableOutlined, } from '@ant-design/icons' -import Poprompt from '@components/Poprompt' import { UserView } from '@components/views' import UploadForm from '@components/UploadForm' import DownloadLink from '@components/DownloadLink' import LoaderPortal from '@components/LoaderPortal' +import Poprompt from '@components/selectors/Poprompt' import { formatBytes, invokeWebApiWrapperAsync, notify } from '@components/factory' import { DrillingProgramService } from '@api' import { formatDate } from '@utils' diff --git a/src/pages/TelemetryView/SetpointSender.jsx b/src/pages/TelemetryView/SetpointSender.jsx index 367191f..27bceae 100644 --- a/src/pages/TelemetryView/SetpointSender.jsx +++ b/src/pages/TelemetryView/SetpointSender.jsx @@ -6,7 +6,7 @@ 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 { PeriodPicker, defaultPeriod } from '@components/selectors/PeriodPicker' export const SetpointSender = ({ idWell, onClose, visible, setpointNames }) => { const [expirePeriod, setExpirePeriod] = useState(defaultPeriod) diff --git a/src/pages/TelemetryView/index.jsx b/src/pages/TelemetryView/index.jsx index b998289..3a9f28e 100644 --- a/src/pages/TelemetryView/index.jsx +++ b/src/pages/TelemetryView/index.jsx @@ -12,7 +12,7 @@ import { makeDateSorter } from '@components/Table' import LoaderPortal from '@components/LoaderPortal' import { Grid, GridItem, Flex } from '@components/Grid' import { invokeWebApiWrapperAsync } from '@components/factory' -import { PeriodPicker, defaultPeriod } from '@components/PeriodPicker' +import { PeriodPicker, defaultPeriod } from '@components/selectors/PeriodPicker' import { hasPermission } from '@utils/permissions' import { Subscribe } from '@services/signalr' diff --git a/src/styles/admin.css b/src/styles/admin.css deleted file mode 100644 index d2f6af7..0000000 --- a/src/styles/admin.css +++ /dev/null @@ -1,12 +0,0 @@ - -.telemetry_select { - min-width: 300px !important; -} - -.telemetry_select .telemetry_used { - color: black; -} - -.telemetry_select .telemetry_unused { - color: gray; -} diff --git a/src/styles/charts.less b/src/styles/charts.less new file mode 100644 index 0000000..5fc5377 --- /dev/null +++ b/src/styles/charts.less @@ -0,0 +1,8 @@ +.d3-chart { + > .d3-chart-tooltip { + position: absolute; + background: #AAAAAAC0; + padding: 5px; + border-radius: 5px; + } +} diff --git a/src/styles/components/telemetry_select.less b/src/styles/components/telemetry_select.less new file mode 100644 index 0000000..405ba6e --- /dev/null +++ b/src/styles/components/telemetry_select.less @@ -0,0 +1,11 @@ +.telemetry_select { + min-width: 300px !important; + + & .telemetry_used { + color: black; + } + + & .telemetry_unused { + color: gray; + } +}