IO-2451 Non Converted Jobs in Lists
These lists should be converted jobs only
This commit is contained in:
@@ -2,10 +2,10 @@ import { useQuery } from "@apollo/client";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { QUERY_ALL_ACTIVE_JOBS } from "../../graphql/jobs.queries";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import ContractJobsComponent from "./contract-jobs.component";
|
import ContractJobsComponent from "./contract-jobs.component";
|
||||||
import { QUERY_ALL_ACTIVE_JOBS } from "../../graphql/jobs.queries";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
@@ -15,6 +15,7 @@ export function ContractJobsContainer({ selectedJobState, bodyshop }) {
|
|||||||
const { loading, error, data } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
const { loading, error, data } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
||||||
variables: {
|
variables: {
|
||||||
statuses: bodyshop.md_ro_statuses.active_statuses || ["Open"],
|
statuses: bodyshop.md_ro_statuses.active_statuses || ["Open"],
|
||||||
|
isConverted: true,
|
||||||
},
|
},
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only",
|
nextFetchPolicy: "network-only",
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
|
BranchesOutlined,
|
||||||
ExclamationCircleFilled,
|
ExclamationCircleFilled,
|
||||||
PauseCircleOutlined,
|
PauseCircleOutlined,
|
||||||
SyncOutlined,
|
SyncOutlined,
|
||||||
BranchesOutlined,
|
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import { Button, Card, Grid, Input, Space, Table, Tooltip } from "antd";
|
import { Button, Card, Grid, Input, Space, Table, Tooltip } from "antd";
|
||||||
@@ -14,8 +14,8 @@ import { Link, useHistory, useLocation } from "react-router-dom";
|
|||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { QUERY_ALL_ACTIVE_JOBS } from "../../graphql/jobs.queries";
|
import { QUERY_ALL_ACTIVE_JOBS } from "../../graphql/jobs.queries";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import { onlyUnique } from "../../utils/arrayHelper";
|
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
|
import { onlyUnique } from "../../utils/arrayHelper";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import ChatOpenButton from "../chat-open-button/chat-open-button.component";
|
import ChatOpenButton from "../chat-open-button/chat-open-button.component";
|
||||||
@@ -46,6 +46,7 @@ export function JobsReadyList({ bodyshop }) {
|
|||||||
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
||||||
variables: {
|
variables: {
|
||||||
statuses: readyStatuses,
|
statuses: readyStatuses,
|
||||||
|
isConverted: true,
|
||||||
},
|
},
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only",
|
nextFetchPolicy: "network-only",
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ export function TechLookupJobsList({ bodyshop }) {
|
|||||||
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
||||||
variables: {
|
variables: {
|
||||||
statuses: bodyshop.md_ro_statuses.active_statuses || ["Open", "Open*"],
|
statuses: bodyshop.md_ro_statuses.active_statuses || ["Open", "Open*"],
|
||||||
|
isConverted: true,
|
||||||
},
|
},
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only",
|
nextFetchPolicy: "network-only",
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { gql } from "@apollo/client";
|
import { gql } from "@apollo/client";
|
||||||
|
|
||||||
export const QUERY_ALL_ACTIVE_JOBS = gql`
|
export const QUERY_ALL_ACTIVE_JOBS = gql`
|
||||||
query QUERY_ALL_ACTIVE_JOBS($statuses: [String!]!) {
|
query QUERY_ALL_ACTIVE_JOBS($statuses: [String!]!, $isConverted: Boolean) {
|
||||||
jobs(
|
jobs(
|
||||||
where: { status: { _in: $statuses } }
|
where: { status: { _in: $statuses }, converted: { _eq: $isConverted } }
|
||||||
order_by: { created_at: desc }
|
order_by: { created_at: desc }
|
||||||
) {
|
) {
|
||||||
iouparent
|
iouparent
|
||||||
@@ -432,7 +432,6 @@ export const QUERY_JOB_COSTING_DETAILS = gql`
|
|||||||
status
|
status
|
||||||
ca_bc_pvrt
|
ca_bc_pvrt
|
||||||
ca_customer_gst
|
ca_customer_gst
|
||||||
|
|
||||||
joblines(where: { removed: { _eq: false } }) {
|
joblines(where: { removed: { _eq: false } }) {
|
||||||
id
|
id
|
||||||
unq_seq
|
unq_seq
|
||||||
@@ -1001,7 +1000,6 @@ export const QUERY_TECH_JOB_DETAILS = gql`
|
|||||||
actual_completion
|
actual_completion
|
||||||
actual_delivery
|
actual_delivery
|
||||||
actual_in
|
actual_in
|
||||||
|
|
||||||
id
|
id
|
||||||
ins_co_nm
|
ins_co_nm
|
||||||
clm_no
|
clm_no
|
||||||
@@ -1586,7 +1584,6 @@ export const QUERY_ALL_JOB_FIELDS = gql`
|
|||||||
clm_title
|
clm_title
|
||||||
clm_total
|
clm_total
|
||||||
clm_zip
|
clm_zip
|
||||||
|
|
||||||
cust_pr
|
cust_pr
|
||||||
ded_amt
|
ded_amt
|
||||||
ded_status
|
ded_status
|
||||||
@@ -1669,7 +1666,6 @@ export const QUERY_ALL_JOB_FIELDS = gql`
|
|||||||
parts_tax_rates
|
parts_tax_rates
|
||||||
pay_amt
|
pay_amt
|
||||||
pay_chknm
|
pay_chknm
|
||||||
|
|
||||||
pay_type
|
pay_type
|
||||||
payee_nms
|
payee_nms
|
||||||
plate_no
|
plate_no
|
||||||
@@ -2077,6 +2073,7 @@ export const QUERY_JOB_EXPORT_DMS = gql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const QUERY_RELATED_ROS = gql`
|
export const QUERY_RELATED_ROS = gql`
|
||||||
query QUERY_RELATED_ROS($jobid: uuid!) {
|
query QUERY_RELATED_ROS($jobid: uuid!) {
|
||||||
relatedjobs(
|
relatedjobs(
|
||||||
@@ -2098,6 +2095,7 @@ export const QUERY_RELATED_ROS = gql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const INSERT_RELATED_ROS = gql`
|
export const INSERT_RELATED_ROS = gql`
|
||||||
mutation INSERT_RELATED_ROS($relationship: relatedjobs_insert_input!) {
|
mutation INSERT_RELATED_ROS($relationship: relatedjobs_insert_input!) {
|
||||||
insert_relatedjobs_one(object: $relationship) {
|
insert_relatedjobs_one(object: $relationship) {
|
||||||
@@ -2115,6 +2113,7 @@ export const INSERT_RELATED_ROS = gql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const DELETE_RELATED_RO = gql`
|
export const DELETE_RELATED_RO = gql`
|
||||||
mutation DELETE_RELATED_RO($relationshipid: uuid!) {
|
mutation DELETE_RELATED_RO($relationshipid: uuid!) {
|
||||||
delete_relatedjobs_by_pk(id: $relationshipid) {
|
delete_relatedjobs_by_pk(id: $relationshipid) {
|
||||||
@@ -2122,6 +2121,7 @@ export const DELETE_RELATED_RO = gql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const GET_JOB_LINE_ORDERS = gql`
|
export const GET_JOB_LINE_ORDERS = gql`
|
||||||
query GET_JOB_LINE_ORDERS($joblineid: uuid!) {
|
query GET_JOB_LINE_ORDERS($joblineid: uuid!) {
|
||||||
billlines(where: { joblineid: { _eq: $joblineid } }) {
|
billlines(where: { joblineid: { _eq: $joblineid } }) {
|
||||||
|
|||||||
Reference in New Issue
Block a user