IO-1911 Add target to tt scoreboard.

This commit is contained in:
Patrick Fic
2022-06-10 10:57:51 -07:00
parent 446bd9035f
commit 2c760948c5
4 changed files with 26 additions and 20 deletions

View File

@@ -6,7 +6,9 @@ import {
Bar, Bar,
CartesianGrid, CartesianGrid,
ComposedChart, ComposedChart,
LabelList,
Legend, Legend,
ReferenceLine,
ResponsiveContainer, ResponsiveContainer,
Tooltip, Tooltip,
XAxis, XAxis,
@@ -48,13 +50,15 @@ export function ScoreboardTicketsBar({ data, bodyshop }) {
<YAxis strokeWidth={graphProps.strokeWidth} /> <YAxis strokeWidth={graphProps.strokeWidth} />
<Tooltip /> <Tooltip />
<Legend /> <Legend />
{/* <Area <ReferenceLine
type="monotone" y={
name="Accumulated Hours" bodyshop.scoreboard_target.dailyBodyTarget +
dataKey="accHrs" bodyshop.scoreboard_target.dailyPaintTarget
fill="lightgreen" }
stroke="green" label="Daily Target"
/> */} stroke="red"
strokeDasharray="3 3"
/>
{data && {data &&
data.employees.map((e, idx) => ( data.employees.map((e, idx) => (
<Bar <Bar
@@ -64,16 +68,10 @@ export function ScoreboardTicketsBar({ data, bodyshop }) {
stackId="productive" stackId="productive"
// barSize={20} // barSize={20}
fill={data.colors[idx]} fill={data.colors[idx]}
/> >
<LabelList position="top" />
</Bar>
))} ))}
{/* <Line
name="Target Hours"
type="monotone"
dataKey="accTargetHrs"
stroke="#ff7300"
strokeWidth={graphProps.strokeWidth}
/> */}
</ComposedChart> </ComposedChart>
</ResponsiveContainer> </ResponsiveContainer>
</Card> </Card>

View File

@@ -19,7 +19,7 @@ export default connect(
export function ScoreboardTicketsStats({ data, bodyshop }) { export function ScoreboardTicketsStats({ data, bodyshop }) {
const { t } = useTranslation(); const { t } = useTranslation();
console.log(data);
const columns = [ const columns = [
{ {
title: t("employees.fields.employee_number"), title: t("employees.fields.employee_number"),
@@ -97,6 +97,14 @@ export function ScoreboardTicketsStats({ data, bodyshop }) {
/> />
</Col> </Col>
</Row> </Row>
<Row gutter={[16, 16]}>
<Col span={12}>
<Statistic
title={t("scoreboard.labels.totaloverperiod")}
value={data.totalOverPeriod.toFixed(1)}
/>
</Col>
</Row>
<Typography.Text type="secondary"> <Typography.Text type="secondary">
{t("scoreboard.labels.calendarperiod")} {t("scoreboard.labels.calendarperiod")}
</Typography.Text> </Typography.Text>

View File

@@ -60,7 +60,7 @@ export const QUERY_TIME_TICKETS_IN_RANGE = gql`
`; `;
export const QUERY_TIME_TICKETS_IN_RANGE_SB = gql` export const QUERY_TIME_TICKETS_IN_RANGE_SB = gql`
query QUERY_TIME_TICKETS_IN_RANGE( query QUERY_TIME_TICKETS_IN_RANGE_SB(
$start: date! $start: date!
$end: date! $end: date!
$fixedStart: date! $fixedStart: date!

View File

@@ -1,4 +1,4 @@
import Icon, { BarsOutlined } from "@ant-design/icons"; import Icon, { FieldTimeOutlined } from "@ant-design/icons";
import { Tabs } from "antd"; import { Tabs } from "antd";
import React, { useEffect } from "react"; import React, { useEffect } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
@@ -70,7 +70,7 @@ export function ScoreboardContainer({ setBreadcrumbs, setSelectedHeader }) {
<Tabs.TabPane <Tabs.TabPane
tab={ tab={
<span> <span>
<BarsOutlined /> <FieldTimeOutlined />
{t("scoreboard.labels.timetickets")} {t("scoreboard.labels.timetickets")}
</span> </span>
} }