@@ -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 (
|
||||
<Card title={t("job_lifecycle.titles.dashboard")} {...cardProps}>
|
||||
<Card title={t("job_lifecycle.titles.dashboard")} {...cardProps}>
|
||||
<LoadingSkeleton loading={loading}>
|
||||
<div style={{overflow: 'scroll', height: "100%"}}>
|
||||
<div id="bar-container" style={{
|
||||
@@ -149,7 +149,8 @@ export default function JobLifecycleDashboardComponent({data, bodyshop, ...cardP
|
||||
</div>
|
||||
</Card>
|
||||
<Card style={{marginTop: "5px"}} type='inner' title={t("job_lifecycle.titles.top_durations")}>
|
||||
<Table size="small" pagination={false} columns={columns} dataSource={ lifecycleData.summations.sort((a, b) => b.value - a.value).slice(0, 3)}/>
|
||||
<Table size="small" pagination={false} columns={columns}
|
||||
dataSource={lifecycleData.summations.sort((a, b) => b.value - a.value).slice(0, 3)}/>
|
||||
</Card>
|
||||
</div>
|
||||
</LoadingSkeleton>
|
||||
|
||||
Reference in New Issue
Block a user