Merged release/2023-11-17 into feature/io-2283-Add-Plate-Number-To-Global-Search
This commit is contained in:
@@ -2,10 +2,10 @@ import { useQuery } from "@apollo/client";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { QUERY_ALL_ACTIVE_JOBS } from "../../graphql/jobs.queries";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import ContractJobsComponent from "./contract-jobs.component";
|
||||
import { QUERY_ALL_ACTIVE_JOBS } from "../../graphql/jobs.queries";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
@@ -15,6 +15,7 @@ export function ContractJobsContainer({ selectedJobState, bodyshop }) {
|
||||
const { loading, error, data } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
||||
variables: {
|
||||
statuses: bodyshop.md_ro_statuses.active_statuses || ["Open"],
|
||||
isConverted: true,
|
||||
},
|
||||
fetchPolicy: "network-only",
|
||||
nextFetchPolicy: "network-only",
|
||||
|
||||
@@ -4,14 +4,14 @@ import queryString from "query-string";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link, useHistory, useLocation } from "react-router-dom";
|
||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
import ContractsFindModalContainer from "../contracts-find-modal/contracts-find-modal.container";
|
||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||
|
||||
import moment from "moment";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import moment from "moment";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
|
||||
@@ -283,12 +283,6 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
||||
<Form.Item
|
||||
label={t("courtesycars.fields.registrationexpires")}
|
||||
name="registrationexpires"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
//message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<FormDatePicker />
|
||||
</Form.Item>
|
||||
@@ -330,9 +324,7 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
||||
<FormDatePicker />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
shouldUpdate={(p, c) =>
|
||||
p.insuranceexpires !== c.insuranceexpires
|
||||
}
|
||||
shouldUpdate={(p, c) => p.insuranceexpires !== c.insuranceexpires}
|
||||
>
|
||||
{() => {
|
||||
const expires = form.getFieldValue("insuranceexpires");
|
||||
|
||||
@@ -174,6 +174,7 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
||||
(c.year || "").toLowerCase().includes(searchText.toLowerCase()) ||
|
||||
(c.make || "").toLowerCase().includes(searchText.toLowerCase()) ||
|
||||
(c.model || "").toLowerCase().includes(searchText.toLowerCase()) ||
|
||||
(c.plate || "").toLowerCase().includes(searchText.toLowerCase()) ||
|
||||
(t(c.status) || "").toLowerCase().includes(searchText.toLowerCase())
|
||||
)
|
||||
: courtesycars;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { notification, Select } from "antd";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -56,8 +56,10 @@ export function JobLineLocationPopup({ bodyshop, jobline, disabled }) {
|
||||
<LoadingSpinner loading={loading}>
|
||||
<Select
|
||||
autoFocus
|
||||
allowClear
|
||||
dropdownMatchSelectWidth={100}
|
||||
value={location}
|
||||
onClear={() => setLocation(null)}
|
||||
onSelect={handleChange}
|
||||
onBlur={handleSave}
|
||||
>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {
|
||||
BranchesOutlined,
|
||||
ExclamationCircleFilled,
|
||||
PauseCircleOutlined,
|
||||
SyncOutlined,
|
||||
BranchesOutlined,
|
||||
} from "@ant-design/icons";
|
||||
import { useQuery } from "@apollo/client";
|
||||
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 { QUERY_ALL_ACTIVE_JOBS } from "../../graphql/jobs.queries";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import { onlyUnique } from "../../utils/arrayHelper";
|
||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||
import { onlyUnique } from "../../utils/arrayHelper";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
import AlertComponent from "../alert/alert.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, {
|
||||
variables: {
|
||||
statuses: readyStatuses,
|
||||
isConverted: true,
|
||||
},
|
||||
fetchPolicy: "network-only",
|
||||
nextFetchPolicy: "network-only",
|
||||
|
||||
@@ -25,6 +25,7 @@ export function TechLookupJobsList({ bodyshop }) {
|
||||
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
||||
variables: {
|
||||
statuses: bodyshop.md_ro_statuses.active_statuses || ["Open", "Open*"],
|
||||
isConverted: true,
|
||||
},
|
||||
fetchPolicy: "network-only",
|
||||
nextFetchPolicy: "network-only",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { gql } from "@apollo/client";
|
||||
|
||||
export const QUERY_ALL_ACTIVE_JOBS = gql`
|
||||
query QUERY_ALL_ACTIVE_JOBS($statuses: [String!]!) {
|
||||
query QUERY_ALL_ACTIVE_JOBS($statuses: [String!]!, $isConverted: Boolean) {
|
||||
jobs(
|
||||
where: { status: { _in: $statuses } }
|
||||
where: { status: { _in: $statuses }, converted: { _eq: $isConverted } }
|
||||
order_by: { created_at: desc }
|
||||
) {
|
||||
iouparent
|
||||
@@ -432,7 +432,6 @@ export const QUERY_JOB_COSTING_DETAILS = gql`
|
||||
status
|
||||
ca_bc_pvrt
|
||||
ca_customer_gst
|
||||
|
||||
joblines(where: { removed: { _eq: false } }) {
|
||||
id
|
||||
unq_seq
|
||||
@@ -1001,7 +1000,6 @@ export const QUERY_TECH_JOB_DETAILS = gql`
|
||||
actual_completion
|
||||
actual_delivery
|
||||
actual_in
|
||||
|
||||
id
|
||||
ins_co_nm
|
||||
clm_no
|
||||
@@ -1586,7 +1584,6 @@ export const QUERY_ALL_JOB_FIELDS = gql`
|
||||
clm_title
|
||||
clm_total
|
||||
clm_zip
|
||||
|
||||
cust_pr
|
||||
ded_amt
|
||||
ded_status
|
||||
@@ -1669,7 +1666,6 @@ export const QUERY_ALL_JOB_FIELDS = gql`
|
||||
parts_tax_rates
|
||||
pay_amt
|
||||
pay_chknm
|
||||
|
||||
pay_type
|
||||
payee_nms
|
||||
plate_no
|
||||
@@ -2077,6 +2073,7 @@ export const QUERY_JOB_EXPORT_DMS = gql`
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_RELATED_ROS = gql`
|
||||
query QUERY_RELATED_ROS($jobid: uuid!) {
|
||||
relatedjobs(
|
||||
@@ -2098,6 +2095,7 @@ export const QUERY_RELATED_ROS = gql`
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_RELATED_ROS = gql`
|
||||
mutation INSERT_RELATED_ROS($relationship: relatedjobs_insert_input!) {
|
||||
insert_relatedjobs_one(object: $relationship) {
|
||||
@@ -2115,6 +2113,7 @@ export const INSERT_RELATED_ROS = gql`
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_RELATED_RO = gql`
|
||||
mutation DELETE_RELATED_RO($relationshipid: uuid!) {
|
||||
delete_relatedjobs_by_pk(id: $relationshipid) {
|
||||
@@ -2122,6 +2121,7 @@ export const DELETE_RELATED_RO = gql`
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_JOB_LINE_ORDERS = gql`
|
||||
query GET_JOB_LINE_ORDERS($joblineid: uuid!) {
|
||||
billlines(where: { joblineid: { _eq: $joblineid } }) {
|
||||
|
||||
@@ -4089,6 +4089,7 @@
|
||||
- name: event-secret
|
||||
value_from_env: EVENT_SECRET
|
||||
request_transform:
|
||||
method: POST
|
||||
query_params: {}
|
||||
template_engine: Kriti
|
||||
url: '{{$base_url}}/job/statustransition'
|
||||
|
||||
38
hasura/migrations/1699662574943_run_sql_migration/down.sql
Normal file
38
hasura/migrations/1699662574943_run_sql_migration/down.sql
Normal file
@@ -0,0 +1,38 @@
|
||||
-- Could not auto-generate a down migration.
|
||||
-- Please write an appropriate down migration for the SQL below:
|
||||
-- CREATE OR REPLACE FUNCTION public.search_cccontracts(search text)
|
||||
-- RETURNS SETOF cccontracts
|
||||
-- LANGUAGE plpgsql
|
||||
-- STABLE
|
||||
-- AS $function$
|
||||
-- BEGIN
|
||||
-- IF search = '' THEN
|
||||
-- RETURN query
|
||||
-- SELECT
|
||||
-- *
|
||||
-- FROM
|
||||
-- cccontracts c;
|
||||
-- ELSE
|
||||
-- RETURN query
|
||||
-- SELECT
|
||||
-- contracts.*
|
||||
-- FROM
|
||||
-- courtesycars cars,
|
||||
-- jobs jobs,
|
||||
-- cccontracts contracts
|
||||
-- WHERE (jobs.ro_number ILIKE '%' || search || '%'
|
||||
-- OR jobs.ownr_fn ILIKE '%' || search || '%'
|
||||
-- OR jobs.ownr_ln ILIKE '%' || search || '%'
|
||||
-- OR jobs.ownr_co_nm ILIKE '%' || search || '%'
|
||||
-- OR (cast(contracts.agreementnumber as text)) ILIKE '%' || search || '%'
|
||||
-- OR contracts.driver_fn ILIKE '%' || search || '%'
|
||||
-- OR contracts.driver_ln ILIKE '%' || search || '%'
|
||||
-- OR cars.fleetnumber ILIKE '%' || search || '%'
|
||||
-- OR cars.make ILIKE '%' || search || '%'
|
||||
-- OR cars.model ILIKE '%' || search || '%'
|
||||
-- OR cars.plate ILIKE '%' || search || '%')
|
||||
-- AND contracts.jobid = jobs.id
|
||||
-- AND contracts.courtesycarid = cars.id;
|
||||
-- END IF;
|
||||
-- END
|
||||
-- $function$;
|
||||
36
hasura/migrations/1699662574943_run_sql_migration/up.sql
Normal file
36
hasura/migrations/1699662574943_run_sql_migration/up.sql
Normal file
@@ -0,0 +1,36 @@
|
||||
CREATE OR REPLACE FUNCTION public.search_cccontracts(search text)
|
||||
RETURNS SETOF cccontracts
|
||||
LANGUAGE plpgsql
|
||||
STABLE
|
||||
AS $function$
|
||||
BEGIN
|
||||
IF search = '' THEN
|
||||
RETURN query
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
cccontracts c;
|
||||
ELSE
|
||||
RETURN query
|
||||
SELECT
|
||||
contracts.*
|
||||
FROM
|
||||
courtesycars cars,
|
||||
jobs jobs,
|
||||
cccontracts contracts
|
||||
WHERE (jobs.ro_number ILIKE '%' || search || '%'
|
||||
OR jobs.ownr_fn ILIKE '%' || search || '%'
|
||||
OR jobs.ownr_ln ILIKE '%' || search || '%'
|
||||
OR jobs.ownr_co_nm ILIKE '%' || search || '%'
|
||||
OR (cast(contracts.agreementnumber as text)) ILIKE '%' || search || '%'
|
||||
OR contracts.driver_fn ILIKE '%' || search || '%'
|
||||
OR contracts.driver_ln ILIKE '%' || search || '%'
|
||||
OR cars.fleetnumber ILIKE '%' || search || '%'
|
||||
OR cars.make ILIKE '%' || search || '%'
|
||||
OR cars.model ILIKE '%' || search || '%'
|
||||
OR cars.plate ILIKE '%' || search || '%')
|
||||
AND contracts.jobid = jobs.id
|
||||
AND contracts.courtesycarid = cars.id;
|
||||
END IF;
|
||||
END
|
||||
$function$;
|
||||
Reference in New Issue
Block a user