Merged in feature/IO-2247-Dashboard-Components (pull request #938)
IO-2247 Don't push manual appointments into component if they don't have a job associated.
This commit is contained in:
@@ -23,36 +23,40 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
|||||||
|
|
||||||
const appt = []; // Flatten Data
|
const appt = []; // Flatten Data
|
||||||
data.scheduled_in_today.forEach((item) => {
|
data.scheduled_in_today.forEach((item) => {
|
||||||
var i = {
|
if (item.job) {
|
||||||
canceled: item.canceled,
|
var i = {
|
||||||
id: item.id,
|
canceled: item.canceled,
|
||||||
alt_transport: item.job.alt_transport,
|
id: item.id,
|
||||||
clm_no: item.job.clm_no,
|
alt_transport: item.job.alt_transport,
|
||||||
jobid: item.job.jobid,
|
clm_no: item.job.clm_no,
|
||||||
ins_co_nm: item.job.ins_co_nm,
|
jobid: item.job.jobid,
|
||||||
iouparent: item.job.iouparent,
|
ins_co_nm: item.job.ins_co_nm,
|
||||||
ownerid: item.job.ownerid,
|
iouparent: item.job.iouparent,
|
||||||
ownr_co_nm: item.job.ownr_co_nm,
|
ownerid: item.job.ownerid,
|
||||||
ownr_ea: item.job.ownr_ea,
|
ownr_co_nm: item.job.ownr_co_nm,
|
||||||
ownr_fn: item.job.ownr_fn,
|
ownr_ea: item.job.ownr_ea,
|
||||||
ownr_ln: item.job.ownr_ln,
|
ownr_fn: item.job.ownr_fn,
|
||||||
ownr_ph1: item.job.ownr_ph1,
|
ownr_ln: item.job.ownr_ln,
|
||||||
ownr_ph2: item.job.ownr_ph2,
|
ownr_ph1: item.job.ownr_ph1,
|
||||||
production_vars: item.job.production_vars,
|
ownr_ph2: item.job.ownr_ph2,
|
||||||
ro_number: item.job.ro_number,
|
production_vars: item.job.production_vars,
|
||||||
suspended: item.job.suspended,
|
ro_number: item.job.ro_number,
|
||||||
v_make_desc: item.job.v_make_desc,
|
suspended: item.job.suspended,
|
||||||
v_model_desc: item.job.v_model_desc,
|
v_make_desc: item.job.v_make_desc,
|
||||||
v_model_yr: item.job.v_model_yr,
|
v_model_desc: item.job.v_model_desc,
|
||||||
v_vin: item.job.v_vin,
|
v_model_yr: item.job.v_model_yr,
|
||||||
vehicleid: item.job.vehicleid,
|
v_vin: item.job.v_vin,
|
||||||
note: item.note,
|
vehicleid: item.job.vehicleid,
|
||||||
start: moment(item.start).format("hh:mm a"),
|
note: item.note,
|
||||||
title: item.title,
|
start: moment(item.start).format("hh:mm a"),
|
||||||
};
|
title: item.title,
|
||||||
appt.push(i);
|
};
|
||||||
|
appt.push(i);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
appt.sort(function (a, b) {
|
||||||
|
return new moment(a.start) - new moment(b.start);
|
||||||
});
|
});
|
||||||
appt.sort ( function (a, b) { return new Date(a.start) - new Date(b.start); });
|
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
@@ -182,7 +186,12 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card title={t("dashboard.titles.scheduledintoday", {date: moment().startOf("day").format("MM/DD/YYYY")})} {...cardProps}>
|
<Card
|
||||||
|
title={t("dashboard.titles.scheduledintoday", {
|
||||||
|
date: moment().startOf("day").format("MM/DD/YYYY"),
|
||||||
|
})}
|
||||||
|
{...cardProps}
|
||||||
|
>
|
||||||
<div style={{ height: "100%" }}>
|
<div style={{ height: "100%" }}>
|
||||||
<Table
|
<Table
|
||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
|
|||||||
Reference in New Issue
Block a user