@@ -51,12 +51,23 @@ const Eula = ({currentEula, currentUser, acceptEula}) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const {accepted_terms, ...otherFormValues} = formValues;
|
const {accepted_terms, ...otherFormValues} = formValues;
|
||||||
|
|
||||||
|
// Trim the values of the fields before submitting
|
||||||
|
const trimmedFormValues = {
|
||||||
|
first_name: otherFormValues.first_name.trim(),
|
||||||
|
last_name: otherFormValues.last_name.trim(),
|
||||||
|
business_name: otherFormValues.business_name.trim(),
|
||||||
|
address: otherFormValues.address.trim(),
|
||||||
|
phone_number: otherFormValues.phone_number.trim(),
|
||||||
|
};
|
||||||
|
|
||||||
await insertEulaAcceptance({
|
await insertEulaAcceptance({
|
||||||
variables: {
|
variables: {
|
||||||
eulaAcceptance: {
|
eulaAcceptance: {
|
||||||
eulaid: eulaId,
|
eulaid: eulaId,
|
||||||
useremail,
|
useremail,
|
||||||
...otherFormValues,
|
...otherFormValues,
|
||||||
|
...trimmedFormValues,
|
||||||
date_accepted: new Date(),
|
date_accepted: new Date(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,7 +112,7 @@ const Eula = ({currentEula, currentUser, acceptEula}) => {
|
|||||||
>
|
>
|
||||||
<Card type='inner' className='eula-markdown-card' onScroll={handleScroll} ref={markdownCardRef}>
|
<Card type='inner' className='eula-markdown-card' onScroll={handleScroll} ref={markdownCardRef}>
|
||||||
<div id='markdowndiv' className='eula-markdown-div'>
|
<div id='markdowndiv' className='eula-markdown-div'>
|
||||||
<Markdown children={currentEula?.content?.replace(/\\n/g, '\n')}/>
|
<Markdown children={currentEula?.content?.replace(/\\n|\\r|\\n\\r|\\r\\n/g, '\n')}/>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
|||||||
@@ -344,15 +344,16 @@ export function ScoreboardTimeTicketsStats({ bodyshop }) {
|
|||||||
|
|
||||||
const jobData = {};
|
const jobData = {};
|
||||||
|
|
||||||
data.jobs.forEach((job) => {
|
const dataJobs = data.jobs.map((job) => ({
|
||||||
job.tthrs = job.joblines.reduce((acc, val) => acc + val.mod_lb_hrs, 0);
|
...job,
|
||||||
});
|
tthrs: job.joblines.reduce((acc, val) => acc + val.mod_lb_hrs, 0)
|
||||||
|
}));
|
||||||
|
|
||||||
jobData.tthrs = data.jobs
|
jobData.tthrs = dataJobs
|
||||||
.reduce((acc, val) => acc + val.tthrs, 0)
|
.reduce((acc, val) => acc + val.tthrs, 0)
|
||||||
.toFixed(1);
|
.toFixed(1);
|
||||||
|
|
||||||
jobData.count = data.jobs.length.toFixed(0);
|
jobData.count = dataJobs.length.toFixed(0);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
fixed: ret,
|
fixed: ret,
|
||||||
|
|||||||
Reference in New Issue
Block a user