- fixed preview of the application;

This commit is contained in:
Vitalii Kiiko
2025-01-27 12:51:27 +01:00
parent cb62f651d7
commit 2a501aa89d
3 changed files with 56 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ import { head, isEmpty, isNil, pathOr, sum } from 'ramda';
// components
import DefaultCell from './components/DefaultCell';
import LastRowCell from './components/LastRowCell';
import getNumberFormatted from '../../../../../helpers/getNumberFormatted';
const RenderTable = ({ tableValue = {}, columnsCfg, lastRowCfg, setTableValueFn, disabled }) => {
const rows = pathOr([], ['rows'], tableValue)
@@ -31,7 +32,7 @@ const RenderTable = ({ tableValue = {}, columnsCfg, lastRowCfg, setTableValueFn,
.map(v => isEmpty(v) || isNil(v) ? 0 : v);
if (cellValue === 'sum') {
total = sum(getAllRowsValues);
total = getNumberFormatted(sum(getAllRowsValues));
} else {
total = 0;
}

View File

@@ -1,4 +1,5 @@
import { head, isEmpty, isNil, sum } from 'ramda';
import getNumberFormatted from '../../../../../../../helpers/getNumberFormatted';
const LastRowCell = ({columnId, lastRowCfg, columnMeta = {}, getColumnDataFn}) => {
const cellData = head(lastRowCfg.filter(o => !isNil(o[columnId])));
@@ -9,7 +10,7 @@ const LastRowCell = ({columnId, lastRowCfg, columnMeta = {}, getColumnDataFn}) =
.map(v => isEmpty(v) || isNil(v) ? 0 : v);
if (cellValue === 'sum') {
cellValue = sum(getAllRowsValues);
cellValue = getNumberFormatted(sum(getAllRowsValues));
} else {
cellValue = 0;
}