IO-1508 Add # of jobs in production.
This commit is contained in:
@@ -26,8 +26,7 @@ export function ProductionBoardFilters({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageHeader
|
|
||||||
extra={
|
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
{loading && <Spin />}
|
{loading && <Spin />}
|
||||||
<Input.Search
|
<Input.Search
|
||||||
@@ -46,7 +45,6 @@ export function ProductionBoardFilters({
|
|||||||
allowClear
|
allowClear
|
||||||
/>
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
}
|
|
||||||
></PageHeader>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useApolloClient } from "@apollo/client";
|
import { useApolloClient } from "@apollo/client";
|
||||||
import Board, { moveCard } from "@lourenci/react-kanban";
|
import Board, { moveCard } from "@lourenci/react-kanban";
|
||||||
import "@lourenci/react-kanban/dist/styles.css";
|
import "@lourenci/react-kanban/dist/styles.css";
|
||||||
import { notification } from "antd";
|
import { notification, PageHeader, Space, Statistic } from "antd";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -130,15 +130,40 @@ export function ProductionBoardKanbanComponent({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const totalHrs = data
|
||||||
|
.reduce(
|
||||||
|
(acc, val) =>
|
||||||
|
acc +
|
||||||
|
(val.labhrs?.aggregate?.sum?.mod_lb_hrs || 0) +
|
||||||
|
(val.larhrs?.aggregate?.sum?.mod_lb_hrs || 0),
|
||||||
|
0
|
||||||
|
)
|
||||||
|
.toFixed(1);
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<IndefiniteLoading loading={isMoving} />
|
<IndefiniteLoading loading={isMoving} />
|
||||||
<ProductionBoardFilters
|
<PageHeader
|
||||||
filter={filter}
|
title={
|
||||||
setFilter={setFilter}
|
<Space>
|
||||||
loading={isMoving}
|
<Statistic
|
||||||
|
title={t("dashboard.titles.productionhours")}
|
||||||
|
value={totalHrs}
|
||||||
|
/>
|
||||||
|
<Statistic
|
||||||
|
title={t("appointments.labels.inproduction")}
|
||||||
|
value={data && data.length}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
|
extra={
|
||||||
|
<ProductionBoardFilters
|
||||||
|
filter={filter}
|
||||||
|
setFilter={setFilter}
|
||||||
|
loading={isMoving}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Board
|
<Board
|
||||||
children={boardLanes}
|
children={boardLanes}
|
||||||
disableCardDrag={isMoving}
|
disableCardDrag={isMoving}
|
||||||
|
|||||||
@@ -182,10 +182,16 @@ export function ProductionListTable({
|
|||||||
<div>
|
<div>
|
||||||
<PageHeader
|
<PageHeader
|
||||||
title={
|
title={
|
||||||
<Statistic
|
<Space>
|
||||||
title={t("dashboard.titles.productionhours")}
|
<Statistic
|
||||||
value={totalHrs}
|
title={t("dashboard.titles.productionhours")}
|
||||||
/>
|
value={totalHrs}
|
||||||
|
/>
|
||||||
|
<Statistic
|
||||||
|
title={t("appointments.labels.inproduction")}
|
||||||
|
value={dataSource && dataSource.length}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
}
|
}
|
||||||
extra={
|
extra={
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
|
|||||||
Reference in New Issue
Block a user