Removed productionview view from Hasura and replaced with standard GQL queries. BOD-243

This commit is contained in:
Patrick Fic
2020-08-03 13:43:39 -07:00
parent 3a8b4ddf5a
commit 75b1ed44e8
8 changed files with 68 additions and 135 deletions

View File

@@ -7,35 +7,54 @@ import { Link } from "react-router-dom";
import "./production-board-card.styles.scss";
export default function ProductionBoardCard(card) {
// console.log("card", card);
return (
<Card
className='react-kanban-card imex-kanban-card tight-antd-rows'
className="react-kanban-card imex-kanban-card tight-antd-rows"
style={{ margin: ".2rem 0rem" }}
size='small'
size="small"
title={`${card.ro_number || card.est_number} - ${card.v_model_yr} ${
card.v_make_desc || ""
} ${card.v_model_desc || ""}`}>
} ${card.v_model_desc || ""}`}
>
<Row>
<Col span={24}>
<div className='ellipses'>{`${card.ownr_fn || ""} ${
<div className="ellipses">{`${card.ownr_fn || ""} ${
card.ownr_ln || ""
} ${card.ownr_co_nm || ""}`}</div>
</Col>
</Row>
<Row>
<Col span={12}>
<div className='ellipses'>{card.clm_no || ""}</div>
<div className="ellipses">{card.clm_no || ""}</div>
</Col>
<Col span={12}>
<div className='ellipses'>{card.ins_co_nm || ""}</div>
<div className="ellipses">{card.ins_co_nm || ""}</div>
</Col>
</Row>
<Row>
<Col span={24}>
<div className='imex-flex-row imex-flex-row__flex-space-around'>
<div>{`B: ${card.labhrs || "?"}`}</div>
<div>{`R: ${card.labhrs || "?"}`}</div>
<div className="imex-flex-row imex-flex-row__flex-space-around">
<div className="mex-flex-row__margin">
<div>{`B: ${card.labhrs.aggregate.sum.mod_lb_hrs || "?"}`}</div>
<div>{`R: ${card.labhrs.aggregate.sum.mod_lb_hrs || "?"}`}</div>
</div>
<div className="mex-flex-row__margin">
<div>{`B: ${
card.employee_body_rel
? `${card.employee_body_rel.first_name} ${card.employee_body_rel.last_name}`
: ""
}`}</div>
<div>{`P: ${
card.employee_prep_rel
? `${card.employee_prep_rel.first_name} ${card.employee_prep_rel.last_name}`
: ""
}`}</div>
<div>{`R: ${
card.employee_refinish_rel
? `${card.employee_refinish_rel.first_name} ${card.employee_refinish_rel.last_name}`
: ""
}`}</div>
</div>
</div>
</Col>
</Row>
@@ -44,10 +63,10 @@ export default function ProductionBoardCard(card) {
<DateTimeFormatter>{card.scheduled_completion}</DateTimeFormatter>
</Col>
</Row>
<div className='imex-flex-row imex-flex-row__flex-space-around'>
<ProductionAlert record={card} key='alert' />
<div className="imex-flex-row imex-flex-row__flex-space-around">
<ProductionAlert record={card} key="alert" />
<Link to={`/manage/jobs/${card.id}`}>
<EyeFilled key='setting' />
<EyeFilled key="setting" />
</Link>
</div>
</Card>

View File

@@ -20,7 +20,7 @@ export function ProductionBoardKanbanContainer({ bodyshop }) {
return (
<ProductionBoardKanbanComponent
loading={loading}
data={data ? data.productionview : []}
data={data ? data.jobs : []}
/>
);
}

View File

@@ -13,7 +13,7 @@ export default function ProductionListColumnAlert({ record }) {
const handleAlertToggle = (e) => {
logImEXEvent("production_toggle_alert");
e.stopPropagation();
//e.stopPropagation();
updateAlert({
variables: {
jobId: record.id,
@@ -36,21 +36,23 @@ export default function ProductionListColumnAlert({ record }) {
<Dropdown
overlay={
<Menu>
<Menu.Item key='toggleAlert' onClick={handleAlertToggle}>
<Menu.Item key="toggleAlert" onClick={handleAlertToggle}>
{record.production_vars && record.production_vars.alert
? t("production.labels.alertoff")
: t("production.labels.alerton")}
</Menu.Item>
</Menu>
}
trigger={["contextMenu"]}>
trigger={["contextMenu"]}
>
<div
style={{
//width: "100%",
height: "19px",
}}>
}}
>
{record.production_vars && record.production_vars.alert ? (
<ExclamationCircleFilled className='production-alert' />
<ExclamationCircleFilled className="production-alert" />
) : null}
</div>
</Dropdown>

View File

@@ -34,7 +34,7 @@ export function ProductionListTableContainer({ bodyshop }) {
return (
<ProductionListTable
loading={loading}
data={data ? data.productionview : []}
data={data ? data.jobs : []}
columnState={columnState}
/>
);