@@ -8,7 +8,7 @@ import { GLOBAL_SEARCH_QUERY } from "../../graphql/search.queries";
|
||||
import PhoneNumberFormatter from "../../utils/PhoneFormatter";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import OwnerNameDisplay, {
|
||||
OwnerNameDisplayFunction
|
||||
OwnerNameDisplayFunction,
|
||||
} from "../owner-name-display/owner-name-display.component";
|
||||
import VehicleVinDisplay from "../vehicle-vin-display/vehicle-vin-display.component";
|
||||
export default function GlobalSearch() {
|
||||
@@ -18,11 +18,18 @@ export default function GlobalSearch() {
|
||||
useLazyQuery(GLOBAL_SEARCH_QUERY);
|
||||
|
||||
const executeSearch = (v) => {
|
||||
if (v && v.variables.search && v.variables.search !== "") callSearch(v);
|
||||
if (
|
||||
v &&
|
||||
v.variables.search &&
|
||||
v.variables.search !== "" &&
|
||||
v.variables.search.length >= 3
|
||||
)
|
||||
callSearch(v);
|
||||
};
|
||||
const debouncedExecuteSearch = _.debounce(executeSearch, 750);
|
||||
|
||||
const handleSearch = (value) => {
|
||||
console.log("Handle Search");
|
||||
debouncedExecuteSearch({ variables: { search: value } });
|
||||
};
|
||||
|
||||
@@ -177,6 +184,7 @@ export default function GlobalSearch() {
|
||||
<AutoComplete
|
||||
options={options}
|
||||
onSearch={handleSearch}
|
||||
|
||||
defaultActiveFirstOption
|
||||
onSelect={(val, opt) => {
|
||||
history.push(opt.label.props.to);
|
||||
|
||||
@@ -5231,14 +5231,9 @@
|
||||
- name: job
|
||||
using:
|
||||
foreign_key_constraint_on: jobid
|
||||
array_relationships:
|
||||
- name: tt_approval_queues
|
||||
- name: tt_approval_queue
|
||||
using:
|
||||
foreign_key_constraint_on:
|
||||
column: timeticketid
|
||||
table:
|
||||
name: tt_approval_queue
|
||||
schema: public
|
||||
foreign_key_constraint_on: ttapprovalqueueid
|
||||
insert_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
@@ -5268,6 +5263,7 @@
|
||||
- memo
|
||||
- productivehrs
|
||||
- rate
|
||||
- ttapprovalqueueid
|
||||
- updated_at
|
||||
select_permissions:
|
||||
- role: user
|
||||
@@ -5289,6 +5285,7 @@
|
||||
- memo
|
||||
- productivehrs
|
||||
- rate
|
||||
- ttapprovalqueueid
|
||||
- updated_at
|
||||
filter:
|
||||
bodyshop:
|
||||
@@ -5319,6 +5316,7 @@
|
||||
- memo
|
||||
- productivehrs
|
||||
- rate
|
||||
- ttapprovalqueueid
|
||||
- updated_at
|
||||
filter:
|
||||
bodyshop:
|
||||
@@ -5442,12 +5440,17 @@
|
||||
- name: job
|
||||
using:
|
||||
foreign_key_constraint_on: jobid
|
||||
- name: timeticket
|
||||
using:
|
||||
foreign_key_constraint_on: timeticketid
|
||||
- name: user
|
||||
using:
|
||||
foreign_key_constraint_on: approved_by
|
||||
array_relationships:
|
||||
- name: timetickets
|
||||
using:
|
||||
foreign_key_constraint_on:
|
||||
column: ttapprovalqueueid
|
||||
table:
|
||||
name: timetickets
|
||||
schema: public
|
||||
insert_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
@@ -5461,44 +5464,42 @@
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
columns:
|
||||
- id
|
||||
- created_at
|
||||
- updated_at
|
||||
- bodyshopid
|
||||
- jobid
|
||||
- employeeid
|
||||
- timeticketid
|
||||
- approved_by
|
||||
- approved_at
|
||||
- actualhrs
|
||||
- productivehrs
|
||||
- rate
|
||||
- flat_rate
|
||||
- approved_at
|
||||
- approved_by
|
||||
- bodyshopid
|
||||
- ciecacode
|
||||
- cost_center
|
||||
- created_at
|
||||
- date
|
||||
- employeeid
|
||||
- flat_rate
|
||||
- id
|
||||
- jobid
|
||||
- memo
|
||||
- productivehrs
|
||||
- rate
|
||||
- updated_at
|
||||
select_permissions:
|
||||
- role: user
|
||||
permission:
|
||||
columns:
|
||||
- flat_rate
|
||||
- date
|
||||
- actualhrs
|
||||
- productivehrs
|
||||
- rate
|
||||
- approved_at
|
||||
- approved_by
|
||||
- bodyshopid
|
||||
- ciecacode
|
||||
- cost_center
|
||||
- memo
|
||||
- approved_at
|
||||
- created_at
|
||||
- updated_at
|
||||
- bodyshopid
|
||||
- date
|
||||
- employeeid
|
||||
- flat_rate
|
||||
- id
|
||||
- jobid
|
||||
- timeticketid
|
||||
- memo
|
||||
- productivehrs
|
||||
- rate
|
||||
- updated_at
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
@@ -5513,23 +5514,22 @@
|
||||
- role: user
|
||||
permission:
|
||||
columns:
|
||||
- flat_rate
|
||||
- date
|
||||
- actualhrs
|
||||
- productivehrs
|
||||
- rate
|
||||
- approved_at
|
||||
- approved_by
|
||||
- bodyshopid
|
||||
- ciecacode
|
||||
- cost_center
|
||||
- memo
|
||||
- approved_at
|
||||
- created_at
|
||||
- updated_at
|
||||
- bodyshopid
|
||||
- date
|
||||
- employeeid
|
||||
- flat_rate
|
||||
- id
|
||||
- jobid
|
||||
- timeticketid
|
||||
- memo
|
||||
- productivehrs
|
||||
- rate
|
||||
- updated_at
|
||||
filter:
|
||||
bodyshop:
|
||||
associations:
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
alter table "public"."tt_approval_queue"
|
||||
add constraint "tt_approval_queue_timeticketid_fkey"
|
||||
foreign key ("timeticketid")
|
||||
references "public"."timetickets"
|
||||
("id") on update cascade on delete cascade;
|
||||
@@ -0,0 +1 @@
|
||||
alter table "public"."tt_approval_queue" drop constraint "tt_approval_queue_timeticketid_fkey";
|
||||
@@ -0,0 +1,2 @@
|
||||
alter table "public"."tt_approval_queue" alter column "timeticketid" drop not null;
|
||||
alter table "public"."tt_approval_queue" add column "timeticketid" uuid;
|
||||
@@ -0,0 +1 @@
|
||||
alter table "public"."tt_approval_queue" drop column "timeticketid" cascade;
|
||||
@@ -0,0 +1,4 @@
|
||||
-- Could not auto-generate a down migration.
|
||||
-- Please write an appropriate down migration for the SQL below:
|
||||
-- alter table "public"."timetickets" add column "ttapprovalqueueid" uuid
|
||||
-- null;
|
||||
@@ -0,0 +1,2 @@
|
||||
alter table "public"."timetickets" add column "ttapprovalqueueid" uuid
|
||||
null;
|
||||
@@ -0,0 +1 @@
|
||||
alter table "public"."timetickets" drop constraint "timetickets_ttapprovalqueueid_fkey";
|
||||
@@ -0,0 +1,5 @@
|
||||
alter table "public"."timetickets"
|
||||
add constraint "timetickets_ttapprovalqueueid_fkey"
|
||||
foreign key ("ttapprovalqueueid")
|
||||
references "public"."tt_approval_queue"
|
||||
("id") on update cascade on delete set null;
|
||||
Reference in New Issue
Block a user