From 81961a92d0912416339efa553442cfbf93faefe3 Mon Sep 17 00:00:00 2001 From: goodmice Date: Wed, 15 Jun 2022 09:20:59 +0500 Subject: [PATCH] =?UTF-8?q?*=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20DrillFlowChart=20*=20?= =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D1=85=D0=BE=D0=B4=20=D0=BD=D0=B0=20=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=83=20=D0=B2=D1=85=D0=BE=D0=B4?= =?UTF-8?q?=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D0=BD=D0=B5=D0=B0=D0=B2=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B8=D0=B7=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=BD=D1=8B=D1=85=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D1=82=D0=B5=D0=BB=D0=B5=D0=B9=20(=D0=B2=D0=BC=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=BE=20AccessDenied)=20*=20=D0=98=D1=81=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE=20=D0=BE=D1=82=D0=BE?= =?UTF-8?q?=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D1=81?= =?UTF-8?q?=D1=8B=D0=BB=D0=BE=D0=BA=20=D0=B2=20UserMenu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UserMenu.tsx | 10 +++++----- src/pages/Telemetry/TelemetryView/index.jsx | 2 +- src/pages/WellOperations/DrillProcessFlow.jsx | 2 +- src/utils/functions/permissions.tsx | 9 +++++---- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/components/UserMenu.tsx b/src/components/UserMenu.tsx index 04d0765..98aaba4 100755 --- a/src/components/UserMenu.tsx +++ b/src/components/UserMenu.tsx @@ -33,14 +33,14 @@ export const UserMenu = memo(({ isAdmin, ...other }) => { {...other} placement={'bottomRight'} overlay={( - + {isAdmin ? ( - + ) : ( - + )} - - + + )} > diff --git a/src/pages/Telemetry/TelemetryView/index.jsx b/src/pages/Telemetry/TelemetryView/index.jsx index 076e3f9..7071e2b 100755 --- a/src/pages/Telemetry/TelemetryView/index.jsx +++ b/src/pages/Telemetry/TelemetryView/index.jsx @@ -333,7 +333,7 @@ const TelemetryView = memo(() => { ) invokeWebApiWrapperAsync( async () => { - const flowChart = await DrillFlowChartService.get(idWell) + const flowChart = await DrillFlowChartService.getByIdWell(idWell) const dataSaub = await TelemetryDataSaubService.getData(idWell, null, chartInterval) const dataSpin = await TelemetryDataSpinService.getData(idWell, null, chartInterval) setFlowChartData(flowChart ?? []) diff --git a/src/pages/WellOperations/DrillProcessFlow.jsx b/src/pages/WellOperations/DrillProcessFlow.jsx index be53286..4643057 100755 --- a/src/pages/WellOperations/DrillProcessFlow.jsx +++ b/src/pages/WellOperations/DrillProcessFlow.jsx @@ -25,7 +25,7 @@ export const DrillProcessFlow = memo(() => { const updateFlows = () => invokeWebApiWrapperAsync( async () => { - const flows = await DrillFlowChartService.get(idWell) + const flows = await DrillFlowChartService.getByIdWell(idWell) setFlows(arrayOrDefault(flows)) }, setShowLoader, diff --git a/src/utils/functions/permissions.tsx b/src/utils/functions/permissions.tsx index 5b9f869..a8067b0 100644 --- a/src/utils/functions/permissions.tsx +++ b/src/utils/functions/permissions.tsx @@ -1,5 +1,5 @@ import { memo, NamedExoticComponent, ReactElement, ReactNode, useMemo } from 'react' -import { useParams } from 'react-router-dom' +import { Navigate, useParams } from 'react-router-dom' import { getUserLogin, getUserPermissions, getUserRoles } from '@utils' import { isDev } from '@utils' @@ -109,9 +109,10 @@ export type PrivateComponent

= NamedExoticComponent

& Priva getKey: () => string } -export const NoAccessComponent = memo(() => ( - - // +export const NoAccessComponent = memo(() => getUserLogin() ? ( + // +) : ( + )) export const wrapPrivateComponent =

(