- fix for table value numeric with comma;
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
import React from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
// components
|
||||
import AllBandiTable from './components/AllBandiTable';
|
||||
import { Button } from 'primereact/button';
|
||||
|
||||
const BandiPreInstructor = () => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
return(
|
||||
<div className="appPage">
|
||||
<div className="appPage__pageHeader">
|
||||
|
||||
@@ -53,8 +53,6 @@ const BandoApplication = () => {
|
||||
const [isExpired, setIsExpired] = useState(false);
|
||||
const [formData, setFormData] = useState([]);
|
||||
const [formInitialData, setFormInitialData] = useState(null);
|
||||
const [fieldsWithVars, setFieldsWithVars] = useState({});
|
||||
const [fieldsWithFormula, setFieldsWithFormula] = useState({});
|
||||
const [bandoTitle, setBandoTitle] = useState('');
|
||||
const [bandoId, setBandoId] = useState(0);
|
||||
const [formId, setFormId] = useState('');
|
||||
@@ -364,8 +362,6 @@ const BandoApplication = () => {
|
||||
dynamicData = wrap(dynamicData).set(['custom', 'userFullName'], userFullName).value();
|
||||
const legalRepresentantName = company.isLegalRepresentant ? userFullName : '';
|
||||
dynamicData = wrap(dynamicData).set(['custom', 'legalRepresentant'], legalRepresentantName).value();
|
||||
let allvars = {};
|
||||
let allformulas = {};
|
||||
|
||||
if (data.data.applicationFormResponse.content) {
|
||||
// eslint-disable-next-line array-callback-return
|
||||
@@ -373,14 +369,6 @@ const BandoApplication = () => {
|
||||
if (o.dynamicData && !isEmpty(o.dynamicData)) {
|
||||
formDataInitial[o.id] = pathOr('', o.dynamicData.split('.'), dynamicData);
|
||||
}
|
||||
const variable = head(o.settings.filter(o => o.name === 'variable'));
|
||||
if (variable && !isEmpty(variable.value)) {
|
||||
allvars[o.id] = variable.value[0];
|
||||
}
|
||||
const formula = head(o.settings.filter(o => o.name === 'formula'));
|
||||
if (formula && !isEmpty(formula.value)) {
|
||||
allformulas[o.id] = formula.value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -398,8 +386,6 @@ const BandoApplication = () => {
|
||||
}
|
||||
|
||||
reset();
|
||||
setFieldsWithVars(allvars);
|
||||
setFieldsWithFormula(allformulas);
|
||||
setFormInitialData(formDataInitial);
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
@@ -555,7 +541,7 @@ const BandoApplication = () => {
|
||||
context = getTokens(formula.value)
|
||||
.filter(v => !['false', 'null', 'true'].includes(v))
|
||||
.reduce((acc, cur) => {
|
||||
acc[cur] = isNil(context[cur]) ? 0 : context[cur];
|
||||
acc[cur] = isNil(context[cur]) ? 0 : parseFloat(context[cur]);
|
||||
return acc;
|
||||
}, context);
|
||||
const mathFormula = renderWithDataVars(formula.value, context);
|
||||
|
||||
@@ -272,7 +272,7 @@ const BandoApplicationPreview = () => {
|
||||
context = getTokens(formula.value)
|
||||
.filter(v => !['false', 'null', 'true'].includes(v))
|
||||
.reduce((acc, cur) => {
|
||||
acc[cur] = isNil(context[cur]) ? 0 : context[cur];
|
||||
acc[cur] = isNil(context[cur]) ? 0 : parseFloat(context[cur]);
|
||||
return acc;
|
||||
}, context);
|
||||
const mathFormula = renderWithDataVars(formula.value, context);
|
||||
|
||||
@@ -105,7 +105,7 @@ const BandoFormsPreview = () => {
|
||||
context = getTokens(formula.value)
|
||||
.filter(v => !['false', 'null', 'true'].includes(v))
|
||||
.reduce((acc, cur) => {
|
||||
acc[cur] = isNil(context[cur]) ? 0 : context[cur];
|
||||
acc[cur] = isNil(context[cur]) ? 0 : parseFloat(context[cur]);
|
||||
return acc;
|
||||
}, context);
|
||||
const mathFormula = renderWithDataVars(formula.value, context);
|
||||
|
||||
@@ -32,9 +32,9 @@ const BandoViewPreInstructor = () => {
|
||||
const [newQuestion, setNewQuestion] = useState('');
|
||||
const bandoMsgs = useRef(null);
|
||||
|
||||
const closePreview = () => {
|
||||
/*const closePreview = () => {
|
||||
navigate(`/bandi/${id}`);
|
||||
}
|
||||
}*/
|
||||
|
||||
const getCallback = (data) => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
|
||||
@@ -21,7 +21,6 @@ import { Dropdown } from 'primereact/dropdown';
|
||||
import { Dialog } from 'primereact/dialog';
|
||||
import { Button } from 'primereact/button';
|
||||
import DashboardService from '../../service/dashboard-service';
|
||||
import NumberFlow from '@number-flow/react';
|
||||
|
||||
const DomandeInstructorManager = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -134,10 +133,6 @@ const DomandeInstructorManager = () => {
|
||||
|
||||
const errGetStats = () => {}
|
||||
|
||||
const getStatValue = (key, fallback = '') => {
|
||||
return pathOr(fallback, [key], mainStats);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
DashboardService.getEvaluationsStats(getStats, errGetStats);
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user