Add production repolling once an hr.
This commit is contained in:
@@ -2,7 +2,8 @@ import { useApolloClient } from "@apollo/client";
|
||||
import Board, { moveCard } from "@asseinfo/react-kanban";
|
||||
//import "@asseinfo/react-kanban/dist/styles.css";
|
||||
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 { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
@@ -33,6 +34,7 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
export function ProductionBoardKanbanComponent({
|
||||
data,
|
||||
bodyshop,
|
||||
refetch,
|
||||
technician,
|
||||
insertAuditTrail,
|
||||
associationSettings,
|
||||
@@ -192,6 +194,9 @@ export function ProductionBoardKanbanComponent({
|
||||
}
|
||||
extra={
|
||||
<Space wrap>
|
||||
<Button onClick={() => refetch && refetch()}>
|
||||
<SyncOutlined />
|
||||
</Button>
|
||||
<ProductionBoardFilters
|
||||
filter={filter}
|
||||
setFilter={setFilter}
|
||||
|
||||
@@ -20,7 +20,9 @@ const mapStateToProps = createStructuredSelector({
|
||||
currentUser: selectCurrentUser,
|
||||
});
|
||||
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 [joblist, setJoblist] = useState([]);
|
||||
const { data: updatedJobs } = useSubscription(
|
||||
@@ -69,6 +71,7 @@ export function ProductionBoardKanbanContainer({ bodyshop, currentUser }) {
|
||||
<ProductionBoardKanbanComponent
|
||||
loading={loading || associationSettingsLoading}
|
||||
data={data ? data.jobs : []}
|
||||
refetch={refetch}
|
||||
associationSettings={
|
||||
associationSettings && associationSettings.associations[0]
|
||||
? associationSettings.associations[0]
|
||||
|
||||
Reference in New Issue
Block a user