Merged in release/2023-04-28 (pull request #720)

Release/2023 04 28
This commit is contained in:
Patrick Fic
2023-04-24 21:45:57 +00:00
10 changed files with 71 additions and 42 deletions

View File

@@ -8,7 +8,7 @@ import { GLOBAL_SEARCH_QUERY } from "../../graphql/search.queries";
import PhoneNumberFormatter from "../../utils/PhoneFormatter"; import PhoneNumberFormatter from "../../utils/PhoneFormatter";
import AlertComponent from "../alert/alert.component"; import AlertComponent from "../alert/alert.component";
import OwnerNameDisplay, { import OwnerNameDisplay, {
OwnerNameDisplayFunction OwnerNameDisplayFunction,
} from "../owner-name-display/owner-name-display.component"; } from "../owner-name-display/owner-name-display.component";
import VehicleVinDisplay from "../vehicle-vin-display/vehicle-vin-display.component"; import VehicleVinDisplay from "../vehicle-vin-display/vehicle-vin-display.component";
export default function GlobalSearch() { export default function GlobalSearch() {
@@ -18,11 +18,18 @@ export default function GlobalSearch() {
useLazyQuery(GLOBAL_SEARCH_QUERY); useLazyQuery(GLOBAL_SEARCH_QUERY);
const executeSearch = (v) => { 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 debouncedExecuteSearch = _.debounce(executeSearch, 750);
const handleSearch = (value) => { const handleSearch = (value) => {
console.log("Handle Search");
debouncedExecuteSearch({ variables: { search: value } }); debouncedExecuteSearch({ variables: { search: value } });
}; };
@@ -177,6 +184,7 @@ export default function GlobalSearch() {
<AutoComplete <AutoComplete
options={options} options={options}
onSearch={handleSearch} onSearch={handleSearch}
defaultActiveFirstOption defaultActiveFirstOption
onSelect={(val, opt) => { onSelect={(val, opt) => {
history.push(opt.label.props.to); history.push(opt.label.props.to);

View File

@@ -5231,14 +5231,9 @@
- name: job - name: job
using: using:
foreign_key_constraint_on: jobid foreign_key_constraint_on: jobid
array_relationships: - name: tt_approval_queue
- name: tt_approval_queues
using: using:
foreign_key_constraint_on: foreign_key_constraint_on: ttapprovalqueueid
column: timeticketid
table:
name: tt_approval_queue
schema: public
insert_permissions: insert_permissions:
- role: user - role: user
permission: permission:
@@ -5268,6 +5263,7 @@
- memo - memo
- productivehrs - productivehrs
- rate - rate
- ttapprovalqueueid
- updated_at - updated_at
select_permissions: select_permissions:
- role: user - role: user
@@ -5289,6 +5285,7 @@
- memo - memo
- productivehrs - productivehrs
- rate - rate
- ttapprovalqueueid
- updated_at - updated_at
filter: filter:
bodyshop: bodyshop:
@@ -5319,6 +5316,7 @@
- memo - memo
- productivehrs - productivehrs
- rate - rate
- ttapprovalqueueid
- updated_at - updated_at
filter: filter:
bodyshop: bodyshop:
@@ -5442,12 +5440,17 @@
- name: job - name: job
using: using:
foreign_key_constraint_on: jobid foreign_key_constraint_on: jobid
- name: timeticket
using:
foreign_key_constraint_on: timeticketid
- name: user - name: user
using: using:
foreign_key_constraint_on: approved_by foreign_key_constraint_on: approved_by
array_relationships:
- name: timetickets
using:
foreign_key_constraint_on:
column: ttapprovalqueueid
table:
name: timetickets
schema: public
insert_permissions: insert_permissions:
- role: user - role: user
permission: permission:
@@ -5461,44 +5464,42 @@
authid: authid:
_eq: X-Hasura-User-Id _eq: X-Hasura-User-Id
columns: columns:
- id
- created_at
- updated_at
- bodyshopid
- jobid
- employeeid
- timeticketid
- approved_by
- approved_at
- actualhrs - actualhrs
- productivehrs - approved_at
- rate - approved_by
- flat_rate - bodyshopid
- ciecacode - ciecacode
- cost_center - cost_center
- created_at
- date - date
- employeeid
- flat_rate
- id
- jobid
- memo - memo
- productivehrs
- rate
- updated_at
select_permissions: select_permissions:
- role: user - role: user
permission: permission:
columns: columns:
- flat_rate
- date
- actualhrs - actualhrs
- productivehrs - approved_at
- rate
- approved_by - approved_by
- bodyshopid
- ciecacode - ciecacode
- cost_center - cost_center
- memo
- approved_at
- created_at - created_at
- updated_at - date
- bodyshopid
- employeeid - employeeid
- flat_rate
- id - id
- jobid - jobid
- timeticketid - memo
- productivehrs
- rate
- updated_at
filter: filter:
bodyshop: bodyshop:
associations: associations:
@@ -5513,23 +5514,22 @@
- role: user - role: user
permission: permission:
columns: columns:
- flat_rate
- date
- actualhrs - actualhrs
- productivehrs - approved_at
- rate
- approved_by - approved_by
- bodyshopid
- ciecacode - ciecacode
- cost_center - cost_center
- memo
- approved_at
- created_at - created_at
- updated_at - date
- bodyshopid
- employeeid - employeeid
- flat_rate
- id - id
- jobid - jobid
- timeticketid - memo
- productivehrs
- rate
- updated_at
filter: filter:
bodyshop: bodyshop:
associations: associations:

View File

@@ -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;

View File

@@ -0,0 +1 @@
alter table "public"."tt_approval_queue" drop constraint "tt_approval_queue_timeticketid_fkey";

View File

@@ -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;

View File

@@ -0,0 +1 @@
alter table "public"."tt_approval_queue" drop column "timeticketid" cascade;

View File

@@ -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;

View File

@@ -0,0 +1,2 @@
alter table "public"."timetickets" add column "ttapprovalqueueid" uuid
null;

View File

@@ -0,0 +1 @@
alter table "public"."timetickets" drop constraint "timetickets_ttapprovalqueueid_fkey";

View File

@@ -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;