From c5ae3224ba443f4c822f485ad1d20ff2d3821192 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 17 Dec 2019 16:21:17 -0800 Subject: [PATCH] In progress changes for Kanban Board and updated schema migrations. Performed some cleanup. --- apollo.config.js | 11 +++ client/src/App/App.js | 43 +++++++--- .../job-lines/job-lines.component.jsx | 9 +- .../white-board-kanban.component.jsx | 22 +++++ .../white-board-kanban.container.jsx | 57 +++++++++++++ .../white-board-left-sider.container.jsx | 15 +--- client/src/graphql/bodyshop.queries.js | 24 ++++++ client/src/graphql/initial-state.js | 2 +- client/src/graphql/jobs.queries.js | 48 +++++++++++ client/src/graphql/local.queries.js | 8 ++ client/src/pages/jobs/jobs.page.jsx | 8 +- client/src/pages/manage/manage.page.jsx | 13 +-- .../pages/white-board/white-board.page.jsx | 47 +--------- .../down.yaml | 3 + .../up.yaml | 4 + .../down.yaml | 84 ++++++++++++++++++ .../up.yaml | 85 +++++++++++++++++++ .../down.yaml | 83 ++++++++++++++++++ .../up.yaml | 84 ++++++++++++++++++ .../down.yaml | 84 ++++++++++++++++++ .../up.yaml | 85 +++++++++++++++++++ .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 39 +++++++++ .../up.yaml | 40 +++++++++ .../down.yaml | 40 +++++++++ .../up.yaml | 41 +++++++++ 27 files changed, 896 insertions(+), 89 deletions(-) create mode 100644 apollo.config.js create mode 100644 client/src/components/white-board-kanban/white-board-kanban.component.jsx create mode 100644 client/src/components/white-board-kanban/white-board-kanban.container.jsx create mode 100644 client/src/graphql/bodyshop.queries.js create mode 100644 hasura/migrations/1576606149211_alter_table_public_jobs_add_column_inproduction/down.yaml create mode 100644 hasura/migrations/1576606149211_alter_table_public_jobs_add_column_inproduction/up.yaml create mode 100644 hasura/migrations/1576606158614_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1576606158614_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1576606166716_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1576606166716_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1576606172105_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1576606172105_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1576610555668_alter_table_public_bodyshops_add_column_md_ro_statuses/down.yaml create mode 100644 hasura/migrations/1576610555668_alter_table_public_bodyshops_add_column_md_ro_statuses/up.yaml create mode 100644 hasura/migrations/1576610596670_update_permission_user_public_table_bodyshops/down.yaml create mode 100644 hasura/migrations/1576610596670_update_permission_user_public_table_bodyshops/up.yaml create mode 100644 hasura/migrations/1576610605007_update_permission_user_public_table_bodyshops/down.yaml create mode 100644 hasura/migrations/1576610605007_update_permission_user_public_table_bodyshops/up.yaml diff --git a/apollo.config.js b/apollo.config.js new file mode 100644 index 000000000..e949522fb --- /dev/null +++ b/apollo.config.js @@ -0,0 +1,11 @@ +module.exports = { + client: { + service: { + name: "Dev", + url: "https://bodyshop-dev-db.herokuapp.com/v1/graphql", + headers: { + "x-hasura-admin-secret": "Dev-BodyShopAppBySnaptSoftware!" + } + } + } +}; diff --git a/client/src/App/App.js b/client/src/App/App.js index 4d60a8be2..e8609691f 100644 --- a/client/src/App/App.js +++ b/client/src/App/App.js @@ -15,6 +15,7 @@ import Unauthorized from "../pages/unauthorized/unauthorized.component"; import { auth } from "../firebase/firebase.utils"; import { UPSERT_USER } from "../graphql/user.queries"; import { GET_CURRENT_USER } from "../graphql/local.queries"; +import { QUERY_BODYSHOP } from "../graphql/bodyshop.queries"; import LoadingSpinner from "../components/loading-spinner/loading-spinner.component"; import AlertComponent from "../components/alert/alert.component"; @@ -42,18 +43,6 @@ export default () => { }); } - apolloClient.writeData({ - data: { - currentUser: { - email: user.email, - displayName: user.displayName, - token, - uid: user.uid, - photoUrl: user.photoURL, - __typename: "currentUser" - } - } - }); //add the bearer token to the headers. localStorage.setItem("token", token); @@ -66,6 +55,36 @@ export default () => { .catch(error => { console.log("Upsert error!!!!", error); }); + + apolloClient + .query({ + query: QUERY_BODYSHOP, + fetchPolicy: "network-only" + }) + .then(r => { + const bodyShopData = r.data.bodyshops[0]; + apolloClient.writeData({ + data: { + bodyShopData: { ...bodyShopData, __typename: "bodyShopData" } + } + }); + }) + .catch(error => { + console.log("Error getting bodyshop data.", error); + }); + + apolloClient.writeData({ + data: { + currentUser: { + email: user.email, + displayName: user.displayName, + token, + uid: user.uid, + photoUrl: user.photoURL, + __typename: "currentUser" + } + } + }); } else { apolloClient.writeData({ data: { currentUser: null } }); localStorage.removeItem("token"); diff --git a/client/src/components/job-lines/job-lines.component.jsx b/client/src/components/job-lines/job-lines.component.jsx index 3117b4072..7e5fdd320 100644 --- a/client/src/components/job-lines/job-lines.component.jsx +++ b/client/src/components/job-lines/job-lines.component.jsx @@ -35,10 +35,11 @@ export default function JobLinesComponent({ loading, joblines }) { setState({ ...state, filteredInfo: filters, sortedInfo: sorter }); }; - const handleChange = event => { - const { value } = event.target; - setState({ ...state, filterinfo: { text: [value] } }); - }; + // const handleChange = event => { + // const { value } = event.target; + // setState({ ...state, filterinfo: { text: [value] } }); + // }; + console.log('joblines', joblines) return ( { + eventBus = handle; + }; + + return ( + + alert(`Card with id:${cardId} clicked. Has metadata.id: ${metadata.id}`) + } + /> + ); +} diff --git a/client/src/components/white-board-kanban/white-board-kanban.container.jsx b/client/src/components/white-board-kanban/white-board-kanban.container.jsx new file mode 100644 index 000000000..85c6cf640 --- /dev/null +++ b/client/src/components/white-board-kanban/white-board-kanban.container.jsx @@ -0,0 +1,57 @@ +import React from "react"; +import { useSubscription, useQuery } 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, + { + fetchPolicy: "network-only" + } + ); + + const static_data = { + lanes: [ + { + id: "lane1", + title: "Planned Tasks", + label: "2/2", + cards: [ + { + id: "Card1", + title: "Write Blog", + description: "Can AI make memes", + label: "30 mins" + }, + { + id: "Card2", + title: "Pay Rent", + description: "Transfer via NEFT", + label: "5 mins", + metadata: { sha: "be312a1" } + } + ] + }, + { + id: "lane2", + title: "Completed", + label: "0/0", + cards: [] + } + ] + }; + +// 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 ; + if (error) return ; + let eventBus; + console.log("Sub data", data); + return ; +} diff --git a/client/src/components/white-board-left-sider/white-board-left-sider.container.jsx b/client/src/components/white-board-left-sider/white-board-left-sider.container.jsx index 790f3b822..b23aad9b2 100644 --- a/client/src/components/white-board-left-sider/white-board-left-sider.container.jsx +++ b/client/src/components/white-board-left-sider/white-board-left-sider.container.jsx @@ -1,20 +1,7 @@ import React from "react"; -import { Query } from "react-apollo"; import WhiteBoardLeftSiderComponent from "./white-board-left-sider.component"; -import Spin from "../loading-spinner/loading-spinner.component"; -import { GET_WHITE_BOARD_LEFT_SIDER_VISIBLE } from "../../graphql/local.queries"; export default function WhiteBoardPageContainer() { - return ( - - {({ loading, error, data: { whiteBoardLeftSiderVisible } }) => { - if (loading) return ; - if (error) return error.message; - return ( - - ); - }} - - ); + return ; } diff --git a/client/src/graphql/bodyshop.queries.js b/client/src/graphql/bodyshop.queries.js new file mode 100644 index 000000000..82e660930 --- /dev/null +++ b/client/src/graphql/bodyshop.queries.js @@ -0,0 +1,24 @@ +import { gql } from "apollo-boost"; + +export const QUERY_BODYSHOP = gql` + query QUERY_BODYSHOP { + bodyshops(where: { associations: { active: { _eq: true } } }) { + address1 + address2 + city + country + created_at + email + federal_tax_id + id + insurance_vendor_id + logo_img_path + md_ro_statuses + shopname + state + state_tax_id + updated_at + zip_post + } + } +`; diff --git a/client/src/graphql/initial-state.js b/client/src/graphql/initial-state.js index 817a49928..671221c8b 100644 --- a/client/src/graphql/initial-state.js +++ b/client/src/graphql/initial-state.js @@ -3,5 +3,5 @@ export default { currentUser: null, selectedNavItem: "Home", recentItems: [], - whiteBoardLeftSiderVisible: true + bodyShopData: null }; diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index dd8f3bf3b..164c2d215 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -47,6 +47,54 @@ export const SUBSCRIPTION_ALL_OPEN_JOBS = gql` } `; +export const QUERY_JOBS_IN_PRODUCTION = gql` + query QUERY_JOBS_IN_PRODUCTION { + jobs { + id + updated_at + est_number + ro_number + status + scheduled_completion + scheduled_delivery + vehicle { + v_model_yr + v_make_desc + v_model_desc + plate_no + } + owner { + first_name + last_name + } + } + } +`; + +export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql` + subscription SUBSCRIPTION_JOBS_IN_PRODUCTION { + jobs { + id + updated_at + est_number + ro_number + status + scheduled_completion + scheduled_delivery + vehicle { + v_model_yr + v_make_desc + v_model_desc + plate_no + } + owner { + first_name + last_name + } + } + } +`; + export const GET_JOB_BY_PK = gql` query GET_JOB_BY_PK($id: uuid!) { jobs_by_pk(id: $id) { diff --git a/client/src/graphql/local.queries.js b/client/src/graphql/local.queries.js index d0c4298c0..88ae13c4f 100644 --- a/client/src/graphql/local.queries.js +++ b/client/src/graphql/local.queries.js @@ -31,3 +31,11 @@ export const GET_WHITE_BOARD_LEFT_SIDER_VISIBLE = gql` whiteBoardLeftSiderVisible @client } `; + +export const GET_BODYSHOP = gql` + query LOCAL_GET_BODY_SHOP { + bodyShopData @client { + shopname + } + } +`; diff --git a/client/src/pages/jobs/jobs.page.jsx b/client/src/pages/jobs/jobs.page.jsx index 9a488028e..532cf576e 100644 --- a/client/src/pages/jobs/jobs.page.jsx +++ b/client/src/pages/jobs/jobs.page.jsx @@ -1,11 +1,10 @@ import React from "react"; import { useSubscription } from "@apollo/react-hooks"; import AlertComponent from "../../components/alert/alert.component"; - +import { Col } from "antd"; import { SUBSCRIPTION_ALL_OPEN_JOBS } from "../../graphql/jobs.queries"; import JobsList from "../../components/jobs-list/jobs-list.component"; -import Test from "./test"; export default function JobsPage() { const { loading, error, data } = useSubscription(SUBSCRIPTION_ALL_OPEN_JOBS, { @@ -15,9 +14,8 @@ export default function JobsPage() { if (error) return ; return ( -
+
- - + ); } diff --git a/client/src/pages/manage/manage.page.jsx b/client/src/pages/manage/manage.page.jsx index 8239a7475..b4cf8133e 100644 --- a/client/src/pages/manage/manage.page.jsx +++ b/client/src/pages/manage/manage.page.jsx @@ -8,7 +8,7 @@ import JobsDetailPage from "../jobs-detail/jobs-detail.page"; import HeaderContainer from "../../components/header/header.container"; import FooterComponent from "../../components/footer/footer.component"; -import { Layout, BackTop, Col } from "antd"; +import { Layout, BackTop } from "antd"; const { Header, Content, Footer } = Layout; //This page will handle all routing for the entire application. @@ -20,15 +20,10 @@ export default function Manage({ match }) { - - + - - - + +
diff --git a/client/src/pages/white-board/white-board.page.jsx b/client/src/pages/white-board/white-board.page.jsx index d9f74df5a..0da18f3b8 100644 --- a/client/src/pages/white-board/white-board.page.jsx +++ b/client/src/pages/white-board/white-board.page.jsx @@ -1,41 +1,10 @@ import React from "react"; -import Board from "react-trello"; -import WhiteBoardCard from "../../components/white-board-card/white-board-card.component"; + import WhiteBoardLeftSiderContainer from "../../components/white-board-left-sider/white-board-left-sider.container"; +import WhiteBoardKanBanContainer from "../../components/white-board-kanban/white-board-kanban.container"; import { Layout } from "antd"; export default function WhiteBoardPage({ whiteBoardLeftSiderVisible }) { - const data = { - lanes: [ - { - id: "lane1", - title: "Planned Tasks", - label: "2/2", - cards: [ - { - id: "Card1", - title: "Write Blog", - description: "Can AI make memes", - label: "30 mins" - }, - { - id: "Card2", - title: "Pay Rent", - description: "Transfer via NEFT", - label: "5 mins", - metadata: { sha: "be312a1" } - } - ] - }, - { - id: "lane2", - title: "Completed", - label: "0/0", - cards: [] - } - ] - }; - const { Sider, Content } = Layout; return ( @@ -54,17 +23,7 @@ export default function WhiteBoardPage({ whiteBoardLeftSiderVisible }) { - - alert( - `Card with id:${cardId} clicked. Has metadata.id: ${metadata.id}` - ) - } - /> + ); diff --git a/hasura/migrations/1576606149211_alter_table_public_jobs_add_column_inproduction/down.yaml b/hasura/migrations/1576606149211_alter_table_public_jobs_add_column_inproduction/down.yaml new file mode 100644 index 000000000..3a9f7c568 --- /dev/null +++ b/hasura/migrations/1576606149211_alter_table_public_jobs_add_column_inproduction/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "inproduction"; + type: run_sql diff --git a/hasura/migrations/1576606149211_alter_table_public_jobs_add_column_inproduction/up.yaml b/hasura/migrations/1576606149211_alter_table_public_jobs_add_column_inproduction/up.yaml new file mode 100644 index 000000000..3ee249f52 --- /dev/null +++ b/hasura/migrations/1576606149211_alter_table_public_jobs_add_column_inproduction/up.yaml @@ -0,0 +1,4 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "inproduction" boolean NOT NULL DEFAULT + false; + type: run_sql diff --git a/hasura/migrations/1576606158614_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1576606158614_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..25d60dd04 --- /dev/null +++ b/hasura/migrations/1576606158614_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,84 @@ +- 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 + - 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 diff --git a/hasura/migrations/1576606158614_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1576606158614_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..441e6cb60 --- /dev/null +++ b/hasura/migrations/1576606158614_update_permission_user_public_table_jobs/up.yaml @@ -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 diff --git a/hasura/migrations/1576606166716_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1576606166716_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..8639821a4 --- /dev/null +++ b/hasura/migrations/1576606166716_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,83 @@ +- 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 + - 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 diff --git a/hasura/migrations/1576606166716_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1576606166716_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..43909ecda --- /dev/null +++ b/hasura/migrations/1576606166716_update_permission_user_public_table_jobs/up.yaml @@ -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 diff --git a/hasura/migrations/1576606172105_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1576606172105_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..48603a111 --- /dev/null +++ b/hasura/migrations/1576606172105_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,84 @@ +- 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 + - 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 diff --git a/hasura/migrations/1576606172105_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1576606172105_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..4c7f7ed40 --- /dev/null +++ b/hasura/migrations/1576606172105_update_permission_user_public_table_jobs/up.yaml @@ -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 diff --git a/hasura/migrations/1576610555668_alter_table_public_bodyshops_add_column_md_ro_statuses/down.yaml b/hasura/migrations/1576610555668_alter_table_public_bodyshops_add_column_md_ro_statuses/down.yaml new file mode 100644 index 000000000..d76b836ba --- /dev/null +++ b/hasura/migrations/1576610555668_alter_table_public_bodyshops_add_column_md_ro_statuses/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."bodyshops" DROP COLUMN "md_ro_statuses"; + type: run_sql diff --git a/hasura/migrations/1576610555668_alter_table_public_bodyshops_add_column_md_ro_statuses/up.yaml b/hasura/migrations/1576610555668_alter_table_public_bodyshops_add_column_md_ro_statuses/up.yaml new file mode 100644 index 000000000..c2da527b4 --- /dev/null +++ b/hasura/migrations/1576610555668_alter_table_public_bodyshops_add_column_md_ro_statuses/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."bodyshops" ADD COLUMN "md_ro_statuses" jsonb NULL; + type: run_sql diff --git a/hasura/migrations/1576610596670_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations/1576610596670_update_permission_user_public_table_bodyshops/down.yaml new file mode 100644 index 000000000..3cbdf35a3 --- /dev/null +++ b/hasura/migrations/1576610596670_update_permission_user_public_table_bodyshops/down.yaml @@ -0,0 +1,39 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - id + - shopname + - created_at + - updated_at + - address1 + - address2 + - city + - state + - zip_post + - country + - email + - federal_tax_id + - insurance_vendor_id + - state_tax_id + - logo_img_path + computed_fields: [] + filter: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: bodyshops + schema: public + type: create_select_permission diff --git a/hasura/migrations/1576610596670_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations/1576610596670_update_permission_user_public_table_bodyshops/up.yaml new file mode 100644 index 000000000..1b6c6d9db --- /dev/null +++ b/hasura/migrations/1576610596670_update_permission_user_public_table_bodyshops/up.yaml @@ -0,0 +1,40 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - address1 + - address2 + - city + - country + - created_at + - email + - federal_tax_id + - id + - insurance_vendor_id + - logo_img_path + - md_ro_statuses + - shopname + - state + - state_tax_id + - updated_at + - zip_post + computed_fields: [] + filter: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: bodyshops + schema: public + type: create_select_permission diff --git a/hasura/migrations/1576610605007_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations/1576610605007_update_permission_user_public_table_bodyshops/down.yaml new file mode 100644 index 000000000..45ac1635b --- /dev/null +++ b/hasura/migrations/1576610605007_update_permission_user_public_table_bodyshops/down.yaml @@ -0,0 +1,40 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_update_permission +- args: + permission: + columns: + - address1 + - address2 + - city + - country + - created_at + - email + - federal_tax_id + - insurance_vendor_id + - logo_img_path + - shopname + - state + - state_tax_id + - updated_at + - zip_post + filter: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: bodyshops + schema: public + type: create_update_permission diff --git a/hasura/migrations/1576610605007_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations/1576610605007_update_permission_user_public_table_bodyshops/up.yaml new file mode 100644 index 000000000..b5b542a8b --- /dev/null +++ b/hasura/migrations/1576610605007_update_permission_user_public_table_bodyshops/up.yaml @@ -0,0 +1,41 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_update_permission +- args: + permission: + columns: + - address1 + - address2 + - city + - country + - created_at + - email + - federal_tax_id + - insurance_vendor_id + - logo_img_path + - md_ro_statuses + - shopname + - state + - state_tax_id + - updated_at + - zip_post + filter: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: bodyshops + schema: public + type: create_update_permission