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,6 +23,7 @@ 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) => {
|
||||||
|
if (item.job) {
|
||||||
var i = {
|
var i = {
|
||||||
canceled: item.canceled,
|
canceled: item.canceled,
|
||||||
id: item.id,
|
id: item.id,
|
||||||
@@ -51,8 +52,11 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
|||||||
title: item.title,
|
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