From 4f7e1b81aca5041163218c954d0c60f2b0fe274a Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Thu, 14 Mar 2024 14:59:06 -0400 Subject: [PATCH 1/2] - Fix bug Signed-off-by: Dave Richer --- .../job-lifecycle-dashboard.component.jsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/client/src/components/dashboard-components/job-lifecycle/job-lifecycle-dashboard.component.jsx b/client/src/components/dashboard-components/job-lifecycle/job-lifecycle-dashboard.component.jsx index 05d855be0..417907eb9 100644 --- a/client/src/components/dashboard-components/job-lifecycle/job-lifecycle-dashboard.component.jsx +++ b/client/src/components/dashboard-components/job-lifecycle/job-lifecycle-dashboard.component.jsx @@ -1,4 +1,4 @@ -import {Badge, Card, Space, Table, Tag} from "antd"; +import {Card, Table, Tag} from "antd"; import LoadingSkeleton from "../../loading-skeleton/loading-skeleton.component"; import {useTranslation} from "react-i18next"; import React, {useEffect, useState} from "react"; @@ -6,7 +6,7 @@ import moment from "moment"; import DashboardRefreshRequired from "../refresh-required.component"; import axios from "axios"; -const fortyFiveDaysAgo = () =>moment().subtract(45, 'days').toLocaleString(); +const fortyFiveDaysAgo = () => moment().subtract(45, 'days').toLocaleString(); export default function JobLifecycleDashboardComponent({data, bodyshop, ...cardProps}) { const {t} = useTranslation(); @@ -29,7 +29,7 @@ export default function JobLifecycleDashboardComponent({data, bodyshop, ...cardP getLifecycleData().catch(e => { console.error(`Error in getLifecycleData: ${e}`); }) - }, [data]); + }, [data, bodyshop]); const columns = [ { @@ -58,7 +58,7 @@ export default function JobLifecycleDashboardComponent({data, bodyshop, ...cardP dataIndex: 'percentage', key: 'percentage', render: (text, record) => { - return record.percentage.toFixed(2)+'%'; + return record.percentage.toFixed(2) + '%'; } }, ]; @@ -70,7 +70,7 @@ export default function JobLifecycleDashboardComponent({data, bodyshop, ...cardP const extra = `${t('job_lifecycle.content.calculated_based_on')} ${lifecycleData.jobs} ${t('job_lifecycle.content.jobs_in_since')} ${fortyFiveDaysAgo()}` return ( - +
- b.value - a.value).slice(0, 3)}/> +
b.value - a.value).slice(0, 3)}/> From f8243aa2b32be19333189cbd542224018c1560c3 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Fri, 15 Mar 2024 10:47:46 -0400 Subject: [PATCH 2/2] - Implement Signed-off-by: Dave Richer --- .../jobs-detail-header/jobs-detail-header.component.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx index 70dbc033a..5e6e019a3 100644 --- a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx +++ b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx @@ -26,6 +26,7 @@ import ProductionListColumnComment from "../production-list-columns/production-l import ProductionListColumnProductionNote from "../production-list-columns/production-list-columns.productionnote.component"; import VehicleVinDisplay from "../vehicle-vin-display/vehicle-vin-display.component"; import "./jobs-detail-header.styles.scss"; +import moment from "moment"; const mapStateToProps = createStructuredSelector({ jobRO: selectJobReadOnly, @@ -93,7 +94,9 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) { {job.status === bodyshop.md_ro_statuses.default_scheduled && job.scheduled_in ? ( - {job.scheduled_in} + + {job.scheduled_in} + ) : null}