Added job_status object. Reverted yarn upgrade as there is a breaking change in react-scripts 0.3.3.

This commit is contained in:
Patrick Fic
2019-12-30 17:07:04 -08:00
parent b1175c0f98
commit c46b2a301e
37 changed files with 1442 additions and 559 deletions

View File

@@ -1,13 +1,11 @@
import React from "react";
import { useSubscription, useQuery } from "@apollo/react-hooks";
import { useSubscription } from "@apollo/react-hooks";
import { SUBSCRIPTION_JOBS_IN_PRODUCTION } from "../../graphql/jobs.queries";
import { GET_BODYSHOP } from "../../graphql/local.queries";
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
import Alert from "../../components/alert/alert.component";
import WhiteBoardKanBan from "./white-board-kanban.component";
export default function WhiteBoardKanBanContainer() {
// const HookBodyshopData = useQuery(GET_BODYSHOP);
const { loading, error, data } = useSubscription(
SUBSCRIPTION_JOBS_IN_PRODUCTION,
{
@@ -46,12 +44,8 @@ export default function WhiteBoardKanBanContainer() {
]
};
// if (HookBodyshopData.loading) return "Local query loading";
// if (HookBodyshopData.error) return "Local query error" + error.message;
// console.log("HookBodyshopData.data", HookBodyshopData.data);
if (loading) return <LoadingSpinner />;
if (error) return <Alert message={error.message} />;
let eventBus;
console.log("Sub data", data);
return <WhiteBoardKanBan eventBus={eventBus} data={static_data} />;
}

View File

@@ -73,7 +73,7 @@ export const QUERY_JOBS_IN_PRODUCTION = gql`
export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql`
subscription SUBSCRIPTION_JOBS_IN_PRODUCTION {
jobs {
jobs(limit: 1, order_by: {updated_at: desc }) {
id
updated_at
est_number

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
- args:
sql: DROP TABLE "public"."job_status"
type: run_sql

View File

@@ -0,0 +1,21 @@
- args:
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
type: run_sql
- args:
sql: "CREATE TABLE \"public\".\"job_status\"(\"id\" uuid NOT NULL DEFAULT gen_random_uuid(),
\"created_at\" timestamptz NOT NULL DEFAULT now(), \"updated_at\" timestamptz
NOT NULL DEFAULT now(), \"shopid\" uuid NOT NULL, \"name\" text NOT NULL, \"isproductionstatus\"
boolean DEFAULT true, PRIMARY KEY (\"id\") , FOREIGN KEY (\"shopid\") REFERENCES
\"public\".\"bodyshops\"(\"id\") ON UPDATE cascade ON DELETE cascade);\nCREATE
OR REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS
TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\"
= NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_job_status_updated_at\"\nBEFORE
UPDATE ON \"public\".\"job_status\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT
ON TRIGGER \"set_public_job_status_updated_at\" ON \"public\".\"job_status\"
\nIS 'trigger to set value of column \"updated_at\" to current timestamp on
row update';\n"
type: run_sql
- args:
name: job_status
schema: public
type: add_existing_table_or_view

View File

@@ -0,0 +1,12 @@
- args:
relationship: job_statuses
table:
name: bodyshops
schema: public
type: drop_relationship
- args:
relationship: bodyshop
table:
name: job_status
schema: public
type: drop_relationship

View File

@@ -0,0 +1,20 @@
- args:
name: job_statuses
table:
name: bodyshops
schema: public
using:
foreign_key_constraint_on:
column: shopid
table:
name: job_status
schema: public
type: create_array_relationship
- args:
name: bodyshop
table:
name: job_status
schema: public
using:
foreign_key_constraint_on: shopid
type: create_object_relationship

View File

@@ -0,0 +1,6 @@
- args:
role: user
table:
name: job_status
schema: public
type: drop_insert_permission

View File

@@ -0,0 +1,28 @@
- args:
permission:
allow_upsert: true
check:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- id
- created_at
- updated_at
- shopid
- name
- isproductionstatus
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: job_status
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,6 @@
- args:
role: user
table:
name: job_status
schema: public
type: drop_select_permission

View File

@@ -0,0 +1,25 @@
- args:
permission:
allow_aggregations: false
columns:
- isproductionstatus
- name
- created_at
- updated_at
- id
- shopid
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
limit: null
role: user
table:
name: job_status
schema: public
type: create_select_permission

View File

@@ -0,0 +1,6 @@
- args:
role: user
table:
name: job_status
schema: public
type: drop_update_permission

View File

@@ -0,0 +1,27 @@
- args:
permission:
columns:
- isproductionstatus
- name
- created_at
- updated_at
- id
- shopid
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: job_status
schema: public
type: create_update_permission

View File

@@ -0,0 +1,6 @@
- args:
role: user
table:
name: job_status
schema: public
type: drop_delete_permission

View File

@@ -0,0 +1,16 @@
- args:
permission:
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: job_status
schema: public
type: create_delete_permission

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."job_status" DROP COLUMN "order";
type: run_sql

View File

@@ -0,0 +1,4 @@
- args:
sql: ALTER TABLE "public"."job_status" ADD COLUMN "order" integer NOT NULL DEFAULT
0;
type: run_sql

View File

@@ -0,0 +1,33 @@
- args:
role: user
table:
name: job_status
schema: public
type: drop_insert_permission
- args:
permission:
check:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- id
- created_at
- updated_at
- shopid
- name
- isproductionstatus
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: job_status
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,34 @@
- args:
role: user
table:
name: job_status
schema: public
type: drop_insert_permission
- args:
permission:
check:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- id
- created_at
- updated_at
- shopid
- name
- isproductionstatus
- order
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: job_status
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,31 @@
- args:
role: user
table:
name: job_status
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- isproductionstatus
- name
- created_at
- updated_at
- id
- shopid
computed_fields: []
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: job_status
schema: public
type: create_select_permission

View File

@@ -0,0 +1,32 @@
- args:
role: user
table:
name: job_status
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- isproductionstatus
- order
- name
- created_at
- updated_at
- id
- shopid
computed_fields: []
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: job_status
schema: public
type: create_select_permission

View File

@@ -0,0 +1,33 @@
- args:
role: user
table:
name: job_status
schema: public
type: drop_update_permission
- args:
permission:
columns:
- isproductionstatus
- name
- created_at
- updated_at
- id
- shopid
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: job_status
schema: public
type: create_update_permission

View File

@@ -0,0 +1,34 @@
- args:
role: user
table:
name: job_status
schema: public
type: drop_update_permission
- args:
permission:
columns:
- isproductionstatus
- order
- name
- created_at
- updated_at
- id
- shopid
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: job_status
schema: public
type: create_update_permission

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."jobs" DROP COLUMN "statusid";
type: run_sql

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."jobs" ADD COLUMN "statusid" uuid NULL;
type: run_sql

View File

@@ -0,0 +1,4 @@
- args:
sql: "\n alter table \"public\".\"jobs\" drop constraint \"jobs_statusid_fkey\"\n
\ "
type: run_sql

View File

@@ -0,0 +1,6 @@
- args:
sql: "\n alter table \"public\".\"jobs\"\n add constraint
\"jobs_statusid_fkey\"\n foreign key (\"statusid\")\n references
\"public\".\"job_status\"\n (\"id\") on update restrict on delete
restrict;\n "
type: run_sql

View File

@@ -0,0 +1,12 @@
- args:
relationship: job_status
table:
name: jobs
schema: public
type: drop_relationship
- args:
relationship: jobs
table:
name: job_status
schema: public
type: drop_relationship

View File

@@ -0,0 +1,20 @@
- args:
name: job_status
table:
name: jobs
schema: public
using:
foreign_key_constraint_on: statusid
type: create_object_relationship
- args:
name: jobs
table:
name: job_status
schema: public
using:
foreign_key_constraint_on:
column: statusid
table:
name: jobs
schema: public
type: create_array_relationship

View File

@@ -0,0 +1,85 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_insert_permission
- args:
permission:
check:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- actual_completion
- actual_delivery
- actual_in
- claim_total
- created_at
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- inproduction
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- ownerid
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- status
- updated_at
- vehicleid
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,86 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_insert_permission
- args:
permission:
check:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- actual_completion
- actual_delivery
- actual_in
- claim_total
- created_at
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- id
- inproduction
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- ownerid
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- statusid
- updated_at
- vehicleid
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_insert_permission

View File

@@ -0,0 +1,84 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- actual_completion
- actual_delivery
- actual_in
- claim_total
- created_at
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- id
- inproduction
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- ownerid
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- status
- updated_at
- vehicleid
computed_fields: []
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: jobs
schema: public
type: create_select_permission

View File

@@ -0,0 +1,84 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- actual_completion
- actual_delivery
- actual_in
- claim_total
- created_at
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- id
- inproduction
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- ownerid
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- statusid
- updated_at
- vehicleid
computed_fields: []
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
role: user
table:
name: jobs
schema: public
type: create_select_permission

View File

@@ -0,0 +1,85 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_update_permission
- args:
permission:
columns:
- actual_completion
- actual_delivery
- actual_in
- claim_total
- created_at
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- inproduction
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- ownerid
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- status
- updated_at
- vehicleid
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_update_permission

View File

@@ -0,0 +1,86 @@
- args:
role: user
table:
name: jobs
schema: public
type: drop_update_permission
- args:
permission:
columns:
- actual_completion
- actual_delivery
- actual_in
- claim_total
- created_at
- deductible
- est_addr1
- est_addr2
- est_city
- est_co_nm
- est_ct_fn
- est_ct_ln
- est_ctry
- est_ea
- est_number
- est_ph1
- est_st
- est_zip
- federal_tax_rate
- id
- inproduction
- invoice_date
- labor_rate_desc
- labor_rate_id
- local_tax_rate
- ownerid
- rate_atp
- rate_la1
- rate_la2
- rate_la3
- rate_la4
- rate_lab
- rate_lad
- rate_lae
- rate_laf
- rate_lag
- rate_lam
- rate_lar
- rate_las
- rate_lau
- rate_ma2s
- rate_ma2t
- rate_ma3s
- rate_mabl
- rate_macs
- rate_mahw
- rate_mapa
- rate_mash
- rate_matd
- regie_number
- ro_number
- scheduled_completion
- scheduled_delivery
- scheduled_in
- shopid
- state_tax_rate
- statusid
- updated_at
- vehicleid
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
localPresets:
- key: ""
value: ""
set: {}
role: user
table:
name: jobs
schema: public
type: create_update_permission

View File

@@ -0,0 +1,6 @@
- args:
sql: ALTER TABLE "public"."jobs" ADD COLUMN "status" text
type: run_sql
- args:
sql: ALTER TABLE "public"."jobs" ALTER COLUMN "status" DROP NOT NULL
type: run_sql

View File

@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."jobs" DROP COLUMN "status" CASCADE
type: run_sql