IO-233 Minor CDK UI Updates.
This commit is contained in:
@@ -34,7 +34,6 @@ export function DmsCustomerSelector({ bodyshop }) {
|
|||||||
setVisible(true);
|
setVisible(true);
|
||||||
setDmsType("pbs");
|
setDmsType("pbs");
|
||||||
setcustomerList(customerList);
|
setcustomerList(customerList);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onUseSelected = () => {
|
const onUseSelected = () => {
|
||||||
@@ -118,7 +117,6 @@ export function DmsCustomerSelector({ bodyshop }) {
|
|||||||
if (!visible) return null;
|
if (!visible) return null;
|
||||||
return (
|
return (
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
{dmsType}
|
|
||||||
<Table
|
<Table
|
||||||
title={() => (
|
title={() => (
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import {
|
|||||||
Form,
|
Form,
|
||||||
Input,
|
Input,
|
||||||
InputNumber,
|
InputNumber,
|
||||||
|
Menu,
|
||||||
Select,
|
Select,
|
||||||
Space,
|
Space,
|
||||||
Statistic,
|
Statistic,
|
||||||
Menu,
|
|
||||||
Typography,
|
Typography,
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import Dinero from "dinero.js";
|
import Dinero from "dinero.js";
|
||||||
@@ -21,9 +21,9 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { determineDmsType } from "../../pages/dms/dms.container";
|
import { determineDmsType } from "../../pages/dms/dms.container";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import DmsCdkMakes from "../dms-cdk-makes/dms-cdk-makes.component";
|
import DmsCdkMakes from "../dms-cdk-makes/dms-cdk-makes.component";
|
||||||
|
import DmsCdkMakesRefetch from "../dms-cdk-makes/dms-cdk-makes.refetch.component";
|
||||||
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
||||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
import DmsCdkMakesRefetch from "../dms-cdk-makes/dms-cdk-makes.refetch.component";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -33,7 +33,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
});
|
});
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(DmsPostForm);
|
export default connect(mapStateToProps, mapDispatchToProps)(DmsPostForm);
|
||||||
|
|
||||||
export function DmsPostForm({ bodyshop, socket, job }) {
|
export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
@@ -61,6 +61,14 @@ export function DmsPostForm({ bodyshop, socket, job }) {
|
|||||||
jobid: job.id,
|
jobid: job.id,
|
||||||
txEnvelope: values,
|
txEnvelope: values,
|
||||||
});
|
});
|
||||||
|
console.log(logsRef);
|
||||||
|
if (logsRef) {
|
||||||
|
console.log("executing", logsRef);
|
||||||
|
logsRef.curent &&
|
||||||
|
logsRef.current.scrollIntoView({
|
||||||
|
behavior: "smooth",
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ import {
|
|||||||
Result,
|
Result,
|
||||||
Row,
|
Row,
|
||||||
Select,
|
Select,
|
||||||
Space,
|
Space
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useRef, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { useLocation, useHistory } from "react-router-dom";
|
import { useHistory, useLocation } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import SocketIO from "socket.io-client";
|
import SocketIO from "socket.io-client";
|
||||||
import AlertComponent from "../../components/alert/alert.component";
|
import AlertComponent from "../../components/alert/alert.component";
|
||||||
@@ -26,7 +26,7 @@ import { auth } from "../../firebase/firebase.utils";
|
|||||||
import { QUERY_JOB_EXPORT_DMS } from "../../graphql/jobs.queries";
|
import { QUERY_JOB_EXPORT_DMS } from "../../graphql/jobs.queries";
|
||||||
import {
|
import {
|
||||||
setBreadcrumbs,
|
setBreadcrumbs,
|
||||||
setSelectedHeader,
|
setSelectedHeader
|
||||||
} from "../../redux/application/application.actions";
|
} from "../../redux/application/application.actions";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
|
||||||
@@ -66,6 +66,7 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) {
|
|||||||
variables: { id: jobId },
|
variables: { id: jobId },
|
||||||
skip: !jobId,
|
skip: !jobId,
|
||||||
});
|
});
|
||||||
|
const logsRef = useRef(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.title = t("titles.dms");
|
document.title = t("titles.dms");
|
||||||
@@ -151,46 +152,49 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) {
|
|||||||
socket={socket}
|
socket={socket}
|
||||||
jobId={jobId}
|
jobId={jobId}
|
||||||
job={data && data.jobs_by_pk}
|
job={data && data.jobs_by_pk}
|
||||||
|
logsRef={logsRef}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
<DmsCustomerSelector />
|
<DmsCustomerSelector />
|
||||||
|
|
||||||
<Col span={24}>
|
<div ref={logsRef}>
|
||||||
<Card
|
<Col span={24}>
|
||||||
title={t("jobs.labels.dms.logs")}
|
<Card
|
||||||
extra={
|
title={t("jobs.labels.dms.logs")}
|
||||||
<Space wrap>
|
extra={
|
||||||
<Select
|
<Space wrap>
|
||||||
placeholder="Log Level"
|
<Select
|
||||||
value={logLevel}
|
placeholder="Log Level"
|
||||||
onChange={(value) => {
|
value={logLevel}
|
||||||
setLogLevel(value);
|
onChange={(value) => {
|
||||||
socket.emit("set-log-level", value);
|
setLogLevel(value);
|
||||||
}}
|
socket.emit("set-log-level", value);
|
||||||
>
|
}}
|
||||||
<Select.Option key="TRACE">TRACE</Select.Option>
|
>
|
||||||
<Select.Option key="DEBUG">DEBUG</Select.Option>
|
<Select.Option key="TRACE">TRACE</Select.Option>
|
||||||
<Select.Option key="INFO">INFO</Select.Option>
|
<Select.Option key="DEBUG">DEBUG</Select.Option>
|
||||||
<Select.Option key="WARNING">WARNING</Select.Option>
|
<Select.Option key="INFO">INFO</Select.Option>
|
||||||
<Select.Option key="ERROR">ERROR</Select.Option>
|
<Select.Option key="WARNING">WARNING</Select.Option>
|
||||||
</Select>
|
<Select.Option key="ERROR">ERROR</Select.Option>
|
||||||
<Button onClick={() => setLogs([])}>Clear Logs</Button>
|
</Select>
|
||||||
<Button
|
<Button onClick={() => setLogs([])}>Clear Logs</Button>
|
||||||
onClick={() => {
|
<Button
|
||||||
setLogs([]);
|
onClick={() => {
|
||||||
socket.disconnect();
|
setLogs([]);
|
||||||
socket.connect();
|
socket.disconnect();
|
||||||
}}
|
socket.connect();
|
||||||
>
|
}}
|
||||||
Reconnect
|
>
|
||||||
</Button>
|
Reconnect
|
||||||
</Space>
|
</Button>
|
||||||
}
|
</Space>
|
||||||
>
|
}
|
||||||
<DmsLogEvents socket={socket} logs={logs} />
|
>
|
||||||
</Card>
|
<DmsLogEvents socket={socket} logs={logs} />
|
||||||
</Col>
|
</Card>
|
||||||
|
</Col>
|
||||||
|
</div>
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user