Fixed WellOperations table cell renderer

This commit is contained in:
KharchenkoVV 2021-09-16 16:33:03 +05:00
parent dd9c49c626
commit a437972fc5
2 changed files with 4 additions and 6 deletions

View File

@ -135,7 +135,7 @@ export const makeTextColumn = (
...other ...other
}) })
const defaultNumericRender = (value: any, row: object) => { export const defaultNumericRender = (value: any, row: object) => {
const placeholder = '-' const placeholder = '-'
if((value === null) || if((value === null) ||
(value === undefined) || (value === undefined) ||

View File

@ -8,7 +8,8 @@ import {
makeColumn, makeColumn,
numericColumnOptions, numericColumnOptions,
makeNumericSorter, makeNumericSorter,
makeDateSorter } from "../../components/Table" makeDateSorter,
defaultNumericRender } from "../../components/Table"
import LoaderPortal from '../../components/LoaderPortal' import LoaderPortal from '../../components/LoaderPortal'
import { invokeWebApiWrapperAsync } from '../../components/factory' import { invokeWebApiWrapperAsync } from '../../components/factory'
import { WellOperationService} from '../../services/api' import { WellOperationService} from '../../services/api'
@ -30,10 +31,7 @@ const numericSortColumnOptions = {
const durationFormattedColumnOptions = { const durationFormattedColumnOptions = {
...numericColumnOptions, ...numericColumnOptions,
render:(value) => render: defaultNumericRender
<div className='text-align-r-container'>
<span>{Number.isNaN(+value) ? "-" : value.toFixed(2)}</span>
</div>
} }
export const WellOperationsEditor = ({idWell, idType}) => { export const WellOperationsEditor = ({idWell, idType}) => {