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