diff --git a/src/components/Private/PrivateMenuItem.tsx b/src/components/Private/PrivateMenuItem.tsx index dc6fe32..e764522 100644 --- a/src/components/Private/PrivateMenuItem.tsx +++ b/src/components/Private/PrivateMenuItem.tsx @@ -10,4 +10,4 @@ type PrivateMenuItemProps = { } export const PrivateMenuItem: React.FC = ({ roles, permission, mixing, ...props }) => - hasPermission(permission) || isInRole(roles) ? : null + hasPermission(permission) && isInRole(roles) ? : null diff --git a/src/components/UserMenu.tsx b/src/components/UserMenu.tsx index 0877eb2..aefba66 100644 --- a/src/components/UserMenu.tsx +++ b/src/components/UserMenu.tsx @@ -53,7 +53,7 @@ export const UserMenu: React.FC = ({ isAdmin }) => { placement={'bottomRight'} overlay={( - + {isAdmin ? ( Вернуться на сайт ) : ( diff --git a/src/components/Views/TelemetryView.tsx b/src/components/Views/TelemetryView.tsx index bc0c229..3d4170c 100644 --- a/src/components/Views/TelemetryView.tsx +++ b/src/components/Views/TelemetryView.tsx @@ -4,20 +4,27 @@ import { TelemetryInfoDto } from '../../services/api' import { Grid, GridItem } from '../Grid' const lables: { [labelKey: string]: string } = { + timeZoneId: 'Временная зона', timeZoneOffsetTotalHours: 'Сдвиг временной зоны', drillingStartDate: 'Начало бурения', deposit: 'Месторождение', cluster: 'Куст', well: 'Скважина', customer: 'Заказчик', + comment: 'Комментарий', + hmiVersion: 'Версия HMI', + saubPlcVersion: 'Версия САУБ', + spinPlcVersion: 'Версия Спин Мастер', } +export const getTelemetryLabel = (info?: TelemetryInfoDto) => info ? `${info.deposit} / ${info.cluster} / ${info.well}` : '---' + export type TelemetryViewProps = { info?: TelemetryInfoDto } export const TelemetryView = memo(({ info }) => info ? ( - {(Object.keys(info) as Array).map((key, i) => ( <> @@ -27,7 +34,7 @@ export const TelemetryView = memo(({ info }) => info ? ( ))} }> - {info.deposit}/{info.cluster}/{info.well} + {getTelemetryLabel(info)} ) : ( - diff --git a/src/components/icons/index.ts b/src/components/icons/index.ts index 3dce827..b290f4a 100644 --- a/src/components/icons/index.ts +++ b/src/components/icons/index.ts @@ -1,5 +1,5 @@ export type { PointerIconColors, PointerIconProps } from './PointerIcon' -export type { WellIconColors, WellIconProps } from './WellIcon' +export type { WellIconColors, WellIconProps, WellIconState } from './WellIcon' export { PointerIcon } from './PointerIcon' export { WellIcon } from './WellIcon'