IO-2708 Lifecycle dashboard component.
This commit is contained in:
@@ -9,6 +9,7 @@ import axios from "axios";
|
||||
const fortyFiveDaysAgo = () => dayjs().subtract(45, 'day').toLocaleString();
|
||||
|
||||
export default function JobLifecycleDashboardComponent({data, bodyshop, ...cardProps}) {
|
||||
console.log("🚀 ~ JobLifecycleDashboardComponent ~ bodyshop:", bodyshop)
|
||||
const {t} = useTranslation();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [lifecycleData, setLifecycleData] = useState(null);
|
||||
@@ -19,7 +20,7 @@ export default function JobLifecycleDashboardComponent({data, bodyshop, ...cardP
|
||||
setLoading(true);
|
||||
const response = await axios.post("/job/lifecycle", {
|
||||
jobids: data.job_lifecycle.map(x => x.id),
|
||||
statuses: bodyshop.md_order_statuses
|
||||
statuses: bodyshop.md_ro_statuses.statuses
|
||||
});
|
||||
setLifecycleData(response.data.durations);
|
||||
setLoading(false);
|
||||
@@ -166,4 +167,4 @@ job_lifecycle: jobs(where: {
|
||||
}) {
|
||||
id
|
||||
actual_in
|
||||
} `;
|
||||
} `;
|
||||
|
||||
@@ -184,7 +184,7 @@ export function DashboardGridComponent({currentUser, bodyshop}) {
|
||||
}}
|
||||
onClick={() => handleRemoveComponent(item.i)}
|
||||
/>
|
||||
<TheComponent className="dashboard-card" data={dashboarddata}/>
|
||||
<TheComponent className="dashboard-card" bodyshop={bodyshop} data={dashboarddata}/>
|
||||
</LoadingSkeleton>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user