Merged in release/2021-12-10 (pull request #291)
release/2021-12-10 Approved-by: Patrick Fic
This commit is contained in:
@@ -2,7 +2,8 @@ import { useApolloClient } from "@apollo/client";
|
|||||||
import Board, { moveCard } from "@asseinfo/react-kanban";
|
import Board, { moveCard } from "@asseinfo/react-kanban";
|
||||||
//import "@asseinfo/react-kanban/dist/styles.css";
|
//import "@asseinfo/react-kanban/dist/styles.css";
|
||||||
import "./production-board-kanban.styles.scss";
|
import "./production-board-kanban.styles.scss";
|
||||||
import { Grid, notification, PageHeader, Space, Statistic } from "antd";
|
import { SyncOutlined } from '@ant-design/icons'
|
||||||
|
import { Grid, notification, Button, 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";
|
||||||
@@ -33,6 +34,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
export function ProductionBoardKanbanComponent({
|
export function ProductionBoardKanbanComponent({
|
||||||
data,
|
data,
|
||||||
bodyshop,
|
bodyshop,
|
||||||
|
refetch,
|
||||||
technician,
|
technician,
|
||||||
insertAuditTrail,
|
insertAuditTrail,
|
||||||
associationSettings,
|
associationSettings,
|
||||||
@@ -192,6 +194,9 @@ export function ProductionBoardKanbanComponent({
|
|||||||
}
|
}
|
||||||
extra={
|
extra={
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
|
<Button onClick={() => refetch && refetch()}>
|
||||||
|
<SyncOutlined />
|
||||||
|
</Button>
|
||||||
<ProductionBoardFilters
|
<ProductionBoardFilters
|
||||||
filter={filter}
|
filter={filter}
|
||||||
setFilter={setFilter}
|
setFilter={setFilter}
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
});
|
});
|
||||||
export function ProductionBoardKanbanContainer({ bodyshop, currentUser }) {
|
export function ProductionBoardKanbanContainer({ bodyshop, currentUser }) {
|
||||||
const { loading, data } = useQuery(QUERY_JOBS_IN_PRODUCTION);
|
const { refetch, loading, data } = useQuery(QUERY_JOBS_IN_PRODUCTION, {
|
||||||
|
pollInterval: 3600000,
|
||||||
|
});
|
||||||
const client = useApolloClient();
|
const client = useApolloClient();
|
||||||
const [joblist, setJoblist] = useState([]);
|
const [joblist, setJoblist] = useState([]);
|
||||||
const { data: updatedJobs } = useSubscription(
|
const { data: updatedJobs } = useSubscription(
|
||||||
@@ -69,6 +71,7 @@ export function ProductionBoardKanbanContainer({ bodyshop, currentUser }) {
|
|||||||
<ProductionBoardKanbanComponent
|
<ProductionBoardKanbanComponent
|
||||||
loading={loading || associationSettingsLoading}
|
loading={loading || associationSettingsLoading}
|
||||||
data={data ? data.jobs : []}
|
data={data ? data.jobs : []}
|
||||||
|
refetch={refetch}
|
||||||
associationSettings={
|
associationSettings={
|
||||||
associationSettings && associationSettings.associations[0]
|
associationSettings && associationSettings.associations[0]
|
||||||
? associationSettings.associations[0]
|
? associationSettings.associations[0]
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
|
import { SyncOutlined } from "@ant-design/icons";
|
||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
import {
|
import {
|
||||||
|
Button,
|
||||||
Dropdown,
|
Dropdown,
|
||||||
Input,
|
Input,
|
||||||
Menu,
|
Menu,
|
||||||
@@ -24,7 +27,6 @@ import ProductionListSaveConfigButton from "../production-list-save-config-butto
|
|||||||
import ProductionListPrint from "./production-list-print.component";
|
import ProductionListPrint from "./production-list-print.component";
|
||||||
import ProductionListTableViewSelect from "./production-list-table-view-select.component";
|
import ProductionListTableViewSelect from "./production-list-table-view-select.component";
|
||||||
import ResizeableTitle from "./production-list-table.resizeable.component";
|
import ResizeableTitle from "./production-list-table.resizeable.component";
|
||||||
import { useTreatments } from "@splitsoftware/splitio-react";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -35,6 +37,7 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
export function ProductionListTable({
|
export function ProductionListTable({
|
||||||
loading,
|
loading,
|
||||||
data,
|
data,
|
||||||
|
refetch,
|
||||||
bodyshop,
|
bodyshop,
|
||||||
technician,
|
technician,
|
||||||
currentUser,
|
currentUser,
|
||||||
@@ -196,6 +199,9 @@ export function ProductionListTable({
|
|||||||
}
|
}
|
||||||
extra={
|
extra={
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
|
<Button onClick={() => refetch && refetch()}>
|
||||||
|
<SyncOutlined />
|
||||||
|
</Button>
|
||||||
<ProductionListColumnsAdd
|
<ProductionListColumnsAdd
|
||||||
columnState={[columns, setColumns]}
|
columnState={[columns, setColumns]}
|
||||||
tableState={state}
|
tableState={state}
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ import ProductionListTable from "./production-list-table.component";
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
|
||||||
export default function ProductionListTableContainer() {
|
export default function ProductionListTableContainer() {
|
||||||
const { loading, data } = useQuery(QUERY_JOBS_IN_PRODUCTION);
|
const { refetch, loading, data } = useQuery(QUERY_JOBS_IN_PRODUCTION, {
|
||||||
|
pollInterval: 3600000,
|
||||||
|
});
|
||||||
const client = useApolloClient();
|
const client = useApolloClient();
|
||||||
const [joblist, setJoblist] = useState([]);
|
const [joblist, setJoblist] = useState([]);
|
||||||
const { data: updatedJobs } = useSubscription(
|
const { data: updatedJobs } = useSubscription(
|
||||||
@@ -49,5 +51,11 @@ export default function ProductionListTableContainer() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return <ProductionListTable loading={loading} data={data ? data.jobs : []} />;
|
return (
|
||||||
|
<ProductionListTable
|
||||||
|
loading={loading}
|
||||||
|
data={data ? data.jobs : []}
|
||||||
|
refetch={refetch}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,10 @@ import { WebSocketLink } from "@apollo/client/link/ws";
|
|||||||
import { getMainDefinition } from "@apollo/client/utilities";
|
import { getMainDefinition } from "@apollo/client/utilities";
|
||||||
//import { split } from "apollo-link";
|
//import { split } from "apollo-link";
|
||||||
import apolloLogger from "apollo-link-logger";
|
import apolloLogger from "apollo-link-logger";
|
||||||
|
import axios from "axios";
|
||||||
import { auth } from "../firebase/firebase.utils";
|
import { auth } from "../firebase/firebase.utils";
|
||||||
import errorLink from "../graphql/apollo-error-handling";
|
import errorLink from "../graphql/apollo-error-handling";
|
||||||
|
import { store } from "../redux/store";
|
||||||
const httpLink = new HttpLink({
|
const httpLink = new HttpLink({
|
||||||
uri: process.env.REACT_APP_GRAPHQL_ENDPOINT,
|
uri: process.env.REACT_APP_GRAPHQL_ENDPOINT,
|
||||||
});
|
});
|
||||||
@@ -47,7 +48,19 @@ const roundTripLink = new ApolloLink((operation, forward) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const TrackExecutionTime = async (operationName, time) => {
|
const TrackExecutionTime = async (operationName, time) => {
|
||||||
//await axios.post("/ioevent", { operationName, time, dbevent: true });
|
const rdxStore = store.getState();
|
||||||
|
try {
|
||||||
|
console.log("trying");
|
||||||
|
axios.post("/ioevent", {
|
||||||
|
operationName,
|
||||||
|
time,
|
||||||
|
dbevent: true,
|
||||||
|
user: rdxStore.user.currentUser.email,
|
||||||
|
imexshopid: rdxStore.user.bodyshop.imexshopid,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.log("IOEvent Error", error);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const subscriptionMiddleware = {
|
const subscriptionMiddleware = {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
const client = require("../graphql-client/graphql-client").client;
|
const client = require("../graphql-client/graphql-client").client;
|
||||||
const queries = require("../graphql-client/queries");
|
const queries = require("../graphql-client/queries");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
const logger = require("../utils/logger");
|
||||||
|
|
||||||
require("dotenv").config({
|
require("dotenv").config({
|
||||||
path: path.resolve(
|
path: path.resolve(
|
||||||
@@ -10,15 +11,22 @@ require("dotenv").config({
|
|||||||
});
|
});
|
||||||
|
|
||||||
exports.default = async (req, res) => {
|
exports.default = async (req, res) => {
|
||||||
const { operationName, time, dbevent } = req.body;
|
const { operationName, time, dbevent, user, imexshopid } = req.body;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await client.request(queries.INSERT_IOEVENT, {
|
// await client.request(queries.INSERT_IOEVENT, {
|
||||||
event: {
|
// event: {
|
||||||
operationname: operationName,
|
// operationname: operationName,
|
||||||
time,
|
// time,
|
||||||
dbevent,
|
// dbevent,
|
||||||
},
|
// },
|
||||||
|
// });
|
||||||
|
console.log("IOEVENT", operationName, time, dbevent, user, imexshopid);
|
||||||
|
logger.log("ioevent", "trace", user, null, {
|
||||||
|
imexshopid,
|
||||||
|
operationName,
|
||||||
|
time,
|
||||||
|
dbevent,
|
||||||
});
|
});
|
||||||
|
|
||||||
res.sendStatus(200);
|
res.sendStatus(200);
|
||||||
|
|||||||
Reference in New Issue
Block a user