From f6269662238b9f5d7b50492eda58f5fe5e8eed82 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 23 Jan 2020 10:29:14 -0800 Subject: [PATCH 01/23] Changed firebase to use ENV variable for staging. --- README.MD | 3 +++ client/src/firebase/firebase.utils.js | 16 +++------------- hasura/config.yaml | 1 + 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/README.MD b/README.MD index 832eb149d..560bb2d4b 100644 --- a/README.MD +++ b/README.MD @@ -7,3 +7,6 @@ ALL CHANGES MUST BE MADE USING LOCAL CONSOLE TO ENSURE DATABASE MIGRATION FILES To Start Hasura CLI: npx hasura console --admin-secret Dev-BodyShopAppBySnaptSoftware! + +Migrating to Staging: +npx hasura migrate apply --endpoint https://bodyshop-staging-db.herokuapp.com/ --admin-secret Staging-BodyShopAppBySnaptSoftware! \ No newline at end of file diff --git a/client/src/firebase/firebase.utils.js b/client/src/firebase/firebase.utils.js index a15d39c7d..4a2a8fae7 100644 --- a/client/src/firebase/firebase.utils.js +++ b/client/src/firebase/firebase.utils.js @@ -1,23 +1,13 @@ import firebase from "firebase/app"; import "firebase/firestore"; import "firebase/auth"; -import "firebase/database" - -const config = { - apiKey: "AIzaSyDV9MsSHZmpLtjoaTK_ObvjFaJ-nMSd2KA", - authDomain: "bodyshop-dev-b1cb6.firebaseapp.com", - databaseURL: "https://bodyshop-dev-b1cb6.firebaseio.com", - projectId: "bodyshop-dev-b1cb6", - storageBucket: "bodyshop-dev-b1cb6.appspot.com", - messagingSenderId: "922785209028", - appId: "1:922785209028:web:96e9df15401eee5d784791", - measurementId: "G-2D5378VCHE" -}; +import "firebase/database"; +const config = JSON.parse(process.env.REACT_APP_FIREBASE_CONFIG); firebase.initializeApp(config); export const createUserProfileDocument = async (userAuth, additionalData) => { - //Needs to be redone to write to GQL database. + //Needs to be redone to write to GQL database. console.log("userAuth from firebase Utils", userAuth); if (!userAuth) return; diff --git a/hasura/config.yaml b/hasura/config.yaml index d6da9ae7f..da0fc5e72 100644 --- a/hasura/config.yaml +++ b/hasura/config.yaml @@ -1 +1,2 @@ endpoint: https://bodyshop-dev-db.herokuapp.com +#endpoint: https://bodyshop-staging-db.herokuapp.com/ \ No newline at end of file From d1323bed7f3dcb29bc431522b0b4cc7936c7af5f Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 23 Jan 2020 12:12:04 -0800 Subject: [PATCH 02/23] Added job card functionality + new fields. --- bodyshop_translations.babel | 84 ++++++++++++++----- .../job-detail-cards.customer.component.jsx | 23 +++-- .../job-detail-cards.documents.component.jsx | 26 ++++-- .../job-detail-cards.documents.styles.scss | 11 +++ .../job-tombstone/job-tombstone.component.jsx | 2 +- ....page.jsx => jobs-documents.component.jsx} | 8 -- .../jobs-documents.container.jsx | 2 +- client/src/graphql/apollo-error-handling.js | 77 +++++++++-------- client/src/graphql/jobs.queries.js | 4 + client/src/translations/en_us/common.json | 6 +- client/src/translations/es/common.json | 6 +- client/src/translations/fr/common.json | 6 +- .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 36 ++++++++ .../up.yaml | 37 ++++++++ .../down.yaml | 34 ++++++++ .../up.yaml | 35 ++++++++ .../down.yaml | 36 ++++++++ .../up.yaml | 37 ++++++++ 20 files changed, 390 insertions(+), 86 deletions(-) create mode 100644 client/src/components/job-detail-cards/job-detail-cards.documents.styles.scss rename client/src/components/jobs-documents/{jobs-documents.page.jsx => jobs-documents.component.jsx} (96%) create mode 100644 hasura/migrations/1579808199913_alter_table_public_documents_add_column_key/down.yaml create mode 100644 hasura/migrations/1579808199913_alter_table_public_documents_add_column_key/up.yaml create mode 100644 hasura/migrations/1579808226020_update_permission_user_public_table_documents/down.yaml create mode 100644 hasura/migrations/1579808226020_update_permission_user_public_table_documents/up.yaml create mode 100644 hasura/migrations/1579808232227_update_permission_user_public_table_documents/down.yaml create mode 100644 hasura/migrations/1579808232227_update_permission_user_public_table_documents/up.yaml create mode 100644 hasura/migrations/1579808237403_update_permission_user_public_table_documents/down.yaml create mode 100644 hasura/migrations/1579808237403_update_permission_user_public_table_documents/up.yaml diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 5e4230e5f..ab02b5e27 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -374,6 +374,27 @@ + + convert + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + postInvoices false @@ -720,6 +741,27 @@ + + ownr_ea + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + phone1 false @@ -741,6 +783,27 @@ + + phoneshort + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + ro_number false @@ -1066,27 +1129,6 @@ - - convert - false - - - - - - en-US - false - - - es-MX - false - - - fr-CA - false - - - documents false diff --git a/client/src/components/job-detail-cards/job-detail-cards.customer.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.customer.component.jsx index ffb3fc607..4c46fd8fb 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.customer.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.customer.component.jsx @@ -13,16 +13,23 @@ export default function JobDetailCardsCustomerComponent({ loading, data }) { extraLink={data?.owner ? `/manage/owners/${data?.owner?.id}` : null}> {data ? ( -
{`${data?.ownr_fn ?? - ""} ${data.ownr_ln ?? ""}`}
+
{`${data?.ownr_fn ?? ""} ${data.ownr_ln ?? ""}`}
- {`${data?.ownr_ph1 ?? ""}`} + {t("jobs.fields.phoneshort")}: + {`${data?.ownr_ph1 ?? + t("general.labels.na")}`} +
+ +
+ {t("jobs.fields.ownr_ea")}: + {data?.ownr_ea ? ( + + {`${data?.ownr_ea ?? ""}`} + + ) : ( + t("general.labels.na") + )}
- {data?.ownr_ea ? ( - -
{`${data?.ownr_ea ?? ""}`}
-
- ) : null}
{`${data?.owner?.preferred_contact ?? ""}`}
diff --git a/client/src/components/job-detail-cards/job-detail-cards.documents.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.documents.component.jsx index d09d4f241..bb726091b 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.documents.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.documents.component.jsx @@ -1,16 +1,32 @@ import React from "react"; import { useTranslation } from "react-i18next"; import CardTemplate from "./job-detail-cards.template.component"; +import { Carousel } from "antd"; +import "./job-detail-cards.styles.scss"; export default function JobDetailCardsDocumentsComponent({ loading, data }) { const { t } = useTranslation(); + if (!data) + return ( + + null + + ); + return ( - - {data ? ( - - Documents stuff here. - + + {data.documents ? ( + + {data.documents.map(item => ( +
+ +
+ ))} +
) : null}
); diff --git a/client/src/components/job-detail-cards/job-detail-cards.documents.styles.scss b/client/src/components/job-detail-cards/job-detail-cards.documents.styles.scss new file mode 100644 index 000000000..d6df79a10 --- /dev/null +++ b/client/src/components/job-detail-cards/job-detail-cards.documents.styles.scss @@ -0,0 +1,11 @@ +.ant-carousel .slick-slide { + text-align: center; + height: 160px; + line-height: 160px; + background: #364d79; + overflow: hidden; + } + + .ant-carousel .slick-slide h3 { + color: #fff; + } \ No newline at end of file diff --git a/client/src/components/job-tombstone/job-tombstone.component.jsx b/client/src/components/job-tombstone/job-tombstone.component.jsx index 2f8b4b69d..3d6d2ba75 100644 --- a/client/src/components/job-tombstone/job-tombstone.component.jsx +++ b/client/src/components/job-tombstone/job-tombstone.component.jsx @@ -124,7 +124,7 @@ function JobTombstone({ job, ...otherProps }) { }); }); }}> - {t("jobs.labels.convert")} + {t("jobs.actions.convert")} , - test { let access_token = window.localStorage.getItem("token"); - console.log("graphQLErrors", graphQLErrors); - console.log("networkError", networkError); - console.log("operation", operation); - console.log("forward", forward); + // console.log("graphQLErrors", graphQLErrors); + // console.log("networkError", networkError); + // console.log("operation", operation); + // console.log("forward", forward); let expired = false; @@ -29,40 +29,45 @@ const errorLink = onError( if (access_token && access_token !== "undefined") { // Let's refresh token through async request return new Observable(observer => { - auth.currentUser - .getIdToken(true) - .then(function(idToken) { - if (!idToken) { - window.localStorage.removeItem("token"); - return console.log("Refresh token has expired"); - } - console.log("Got a new token", idToken); - window.localStorage.setItem("token", idToken); + const unsubscribeFromAuth = auth.onAuthStateChanged(async user => { + console.log("Auth change in error handling."); + if (user) { + user + .getIdToken(true) + .then(function(idToken) { + if (!idToken) { + window.localStorage.removeItem("token"); + return console.log("Refresh token has expired"); + } + console.log("Got a new token", idToken); + window.localStorage.setItem("token", idToken); - // reset the headers - operation.setContext(({ headers = {} }) => ({ - headers: { - // Re-add old headers - ...headers, - // Switch out old access token for new one - authorization: idToken ? `Bearer ${idToken}` : "" - } - })); + // reset the headers + operation.setContext(({ headers = {} }) => ({ + headers: { + // Re-add old headers + ...headers, + // Switch out old access token for new one + authorization: idToken ? `Bearer ${idToken}` : "" + } + })); - const subscriber = { - next: observer.next.bind(observer), - error: observer.error.bind(observer), - complete: observer.complete.bind(observer) - }; - console.log("About to resend the request."); - // Retry last failed request - forward(operation).subscribe(subscriber); - }) - .catch(error => { - // No refresh or client token available, we force user to login - console.log("Hit an error."); - observer.error(error); - }); + const subscriber = { + next: observer.next.bind(observer), + error: observer.error.bind(observer), + complete: observer.complete.bind(observer) + }; + console.log("About to resend the request."); + // Retry last failed request + forward(operation).subscribe(subscriber); + }) + .catch(error => { + // No refresh or client token available, we force user to login + console.log("Hit an error."); + observer.error(error); + }); + } + }); }); } } diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 9441ff3ee..c74240b52 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -246,6 +246,10 @@ export const QUERY_JOB_CARD_DETAILS = gql` updated_at claim_total ded_amt + documents(limit: 3, order_by: { created_at: desc }) { + id + thumb_url + } vehicle { id plate_no diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 1fe0badc2..1f05f4fca 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -31,6 +31,7 @@ "actions": { "addDocuments": "Add Job Documents", "addNote": "Add Note", + "convert": "Convert", "postInvoices": "Post Invoices", "printCenter": "Print Center" }, @@ -51,7 +52,9 @@ "est_number": "Estimate Number", "owner": "Owner", "owner_owing": "Cust. Owes", + "ownr_ea": "Email", "phone1": "Phone 1", + "phoneshort": "PH", "ro_number": "RO #", "status": "Job Status", "vehicle": "Vehicle" @@ -62,7 +65,7 @@ "customer": "Customer Information", "damage": "Area of Damage", "dates": "Dates", - "documents": "Documents", + "documents": "Recent Documents", "estimator": "Estimator", "filehandler": "File Handler", "insurance": "Insurance Details", @@ -71,7 +74,6 @@ "totals": "Totals", "vehicle": "Vehicle" }, - "convert": "Convert", "documents": "Documents", "lines": "Estimate Lines", "notes": "Notes", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 217435473..69a689ff9 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -31,6 +31,7 @@ "actions": { "addDocuments": "Agregar documentos de trabajo", "addNote": "Añadir la nota", + "convert": "Convertir", "postInvoices": "Contabilizar facturas", "printCenter": "Centro de impresión" }, @@ -51,7 +52,9 @@ "est_number": "Numero Estimado", "owner": "Propietario", "owner_owing": "Cust. Debe", + "ownr_ea": "Email", "phone1": "Teléfono 1", + "phoneshort": "PH", "ro_number": "RO #", "status": "Estado del trabajo", "vehicle": "Vehículo" @@ -62,7 +65,7 @@ "customer": "Información al cliente", "damage": "Área de Daño", "dates": "fechas", - "documents": "documentos", + "documents": "Documentos recientes", "estimator": "Estimador", "filehandler": "File Handler", "insurance": "detalles del seguro", @@ -71,7 +74,6 @@ "totals": "Totales", "vehicle": "Vehículo" }, - "convert": "Convertir", "documents": "documentos", "lines": "Líneas estimadas", "notes": "Notas", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index a3bdce8aa..01c49457b 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -31,6 +31,7 @@ "actions": { "addDocuments": "Ajouter des documents de travail", "addNote": "Ajouter une note", + "convert": "Convertir", "postInvoices": "Poster des factures", "printCenter": "Centre d'impression" }, @@ -51,7 +52,9 @@ "est_number": "Numéro d'estimation", "owner": "Propriétaire", "owner_owing": "Cust. Owes", + "ownr_ea": "Email", "phone1": "Téléphone 1", + "phoneshort": "PH", "ro_number": "RO #", "status": "Statut de l'emploi", "vehicle": "Véhicule" @@ -62,7 +65,7 @@ "customer": "Informations client", "damage": "Zone de dommages", "dates": "Rendez-vous", - "documents": "Les documents", + "documents": "Documents récents", "estimator": "Estimateur", "filehandler": "Gestionnaire de fichiers", "insurance": "Détails de l'assurance", @@ -71,7 +74,6 @@ "totals": "Totaux", "vehicle": "Véhicule" }, - "convert": "Convertir", "documents": "Les documents", "lines": "Estimer les lignes", "notes": "Remarques", diff --git a/hasura/migrations/1579808199913_alter_table_public_documents_add_column_key/down.yaml b/hasura/migrations/1579808199913_alter_table_public_documents_add_column_key/down.yaml new file mode 100644 index 000000000..796bf37da --- /dev/null +++ b/hasura/migrations/1579808199913_alter_table_public_documents_add_column_key/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."documents" DROP COLUMN "key"; + type: run_sql diff --git a/hasura/migrations/1579808199913_alter_table_public_documents_add_column_key/up.yaml b/hasura/migrations/1579808199913_alter_table_public_documents_add_column_key/up.yaml new file mode 100644 index 000000000..7684d4abc --- /dev/null +++ b/hasura/migrations/1579808199913_alter_table_public_documents_add_column_key/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."documents" ADD COLUMN "key" text NOT NULL DEFAULT '0'; + type: run_sql diff --git a/hasura/migrations/1579808226020_update_permission_user_public_table_documents/down.yaml b/hasura/migrations/1579808226020_update_permission_user_public_table_documents/down.yaml new file mode 100644 index 000000000..727382dec --- /dev/null +++ b/hasura/migrations/1579808226020_update_permission_user_public_table_documents/down.yaml @@ -0,0 +1,36 @@ +- args: + role: user + table: + name: documents + schema: public + type: drop_insert_permission +- args: + permission: + check: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - name + - thumb_url + - uploaded_by + - url + - created_at + - updated_at + - id + - jobid + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: documents + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1579808226020_update_permission_user_public_table_documents/up.yaml b/hasura/migrations/1579808226020_update_permission_user_public_table_documents/up.yaml new file mode 100644 index 000000000..2c0ca6648 --- /dev/null +++ b/hasura/migrations/1579808226020_update_permission_user_public_table_documents/up.yaml @@ -0,0 +1,37 @@ +- args: + role: user + table: + name: documents + schema: public + type: drop_insert_permission +- args: + permission: + check: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - created_at + - id + - jobid + - key + - name + - thumb_url + - updated_at + - uploaded_by + - url + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: documents + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1579808232227_update_permission_user_public_table_documents/down.yaml b/hasura/migrations/1579808232227_update_permission_user_public_table_documents/down.yaml new file mode 100644 index 000000000..18e6b72a5 --- /dev/null +++ b/hasura/migrations/1579808232227_update_permission_user_public_table_documents/down.yaml @@ -0,0 +1,34 @@ +- args: + role: user + table: + name: documents + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - name + - thumb_url + - uploaded_by + - url + - created_at + - updated_at + - id + - jobid + computed_fields: [] + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: documents + schema: public + type: create_select_permission diff --git a/hasura/migrations/1579808232227_update_permission_user_public_table_documents/up.yaml b/hasura/migrations/1579808232227_update_permission_user_public_table_documents/up.yaml new file mode 100644 index 000000000..3d103eca5 --- /dev/null +++ b/hasura/migrations/1579808232227_update_permission_user_public_table_documents/up.yaml @@ -0,0 +1,35 @@ +- args: + role: user + table: + name: documents + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - created_at + - id + - jobid + - key + - name + - thumb_url + - updated_at + - uploaded_by + - url + computed_fields: [] + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: documents + schema: public + type: create_select_permission diff --git a/hasura/migrations/1579808237403_update_permission_user_public_table_documents/down.yaml b/hasura/migrations/1579808237403_update_permission_user_public_table_documents/down.yaml new file mode 100644 index 000000000..085d3dac8 --- /dev/null +++ b/hasura/migrations/1579808237403_update_permission_user_public_table_documents/down.yaml @@ -0,0 +1,36 @@ +- args: + role: user + table: + name: documents + schema: public + type: drop_update_permission +- args: + permission: + columns: + - name + - thumb_url + - uploaded_by + - url + - created_at + - updated_at + - id + - jobid + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: documents + schema: public + type: create_update_permission diff --git a/hasura/migrations/1579808237403_update_permission_user_public_table_documents/up.yaml b/hasura/migrations/1579808237403_update_permission_user_public_table_documents/up.yaml new file mode 100644 index 000000000..515730b23 --- /dev/null +++ b/hasura/migrations/1579808237403_update_permission_user_public_table_documents/up.yaml @@ -0,0 +1,37 @@ +- args: + role: user + table: + name: documents + schema: public + type: drop_update_permission +- args: + permission: + columns: + - created_at + - id + - jobid + - key + - name + - thumb_url + - updated_at + - uploaded_by + - url + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: documents + schema: public + type: create_update_permission From fbf8931f68531aa23b57fe1b0703876a87d21858 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 23 Jan 2020 17:20:26 -0800 Subject: [PATCH 03/23] Hasura changes to add searching + indexing. Header and card changes. --- bodyshop_translations.babel | 21 ++ .../current-user-dropdown.component.jsx | 16 +- .../components/header/header.component.jsx | 15 +- .../job-detail-cards.component.jsx | 16 +- .../job-detail-cards.documents.component.jsx | 12 +- .../jobs-documents.component.jsx | 4 +- .../jobs-list/jobs-list.component.jsx | 6 +- .../sign-out/sign-out.component.jsx | 32 +-- client/src/graphql/apollo-error-handling.js | 87 +++---- client/src/pages/jobs/jobs.page.jsx | 1 - client/src/translations/en_us/common.json | 3 +- client/src/translations/es/common.json | 3 +- client/src/translations/fr/common.json | 3 +- .../1579818641451_enable_pg_trm/down.yaml | 1 + .../1579818641451_enable_pg_trm/up.yaml | 4 + .../down.yaml | 1 + .../up.yaml | 7 + .../down.yaml | 1 + .../up.yaml | 16 ++ .../1579820833038_run_sql_migration/down.yaml | 1 + .../1579820833038_run_sql_migration/up.yaml | 4 + .../1579820853826_run_sql_migration/down.yaml | 1 + .../1579820853826_run_sql_migration/up.yaml | 4 + .../1579821113991_new_jobs_index/down.yaml | 1 + .../1579821113991_new_jobs_index/up.yaml | 7 + .../1579823064149_drop_index/down.yaml | 1 + .../1579823064149_drop_index/up.yaml | 4 + .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 1 + .../1579825076007_job_search_function/up.yaml | 15 ++ .../down.yaml | 6 + .../up.yaml | 3 + .../down.yaml | 212 ++++++++++++++++++ .../up.yaml | 211 +++++++++++++++++ .../down.yaml | 210 +++++++++++++++++ .../up.yaml | 209 +++++++++++++++++ .../down.yaml | 212 ++++++++++++++++++ .../up.yaml | 211 +++++++++++++++++ .../down.yaml | 6 + .../up.yaml | 3 + .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 211 +++++++++++++++++ .../up.yaml | 212 ++++++++++++++++++ .../down.yaml | 209 +++++++++++++++++ .../up.yaml | 210 +++++++++++++++++ .../down.yaml | 211 +++++++++++++++++ .../up.yaml | 212 ++++++++++++++++++ 49 files changed, 2756 insertions(+), 92 deletions(-) create mode 100644 hasura/migrations/1579818641451_enable_pg_trm/down.yaml create mode 100644 hasura/migrations/1579818641451_enable_pg_trm/up.yaml create mode 100644 hasura/migrations/1579819352860_create_gin_index_jobs/down.yaml create mode 100644 hasura/migrations/1579819352860_create_gin_index_jobs/up.yaml create mode 100644 hasura/migrations/1579819439525_search_jobs_function/down.yaml create mode 100644 hasura/migrations/1579819439525_search_jobs_function/up.yaml create mode 100644 hasura/migrations/1579820833038_run_sql_migration/down.yaml create mode 100644 hasura/migrations/1579820833038_run_sql_migration/up.yaml create mode 100644 hasura/migrations/1579820853826_run_sql_migration/down.yaml create mode 100644 hasura/migrations/1579820853826_run_sql_migration/up.yaml create mode 100644 hasura/migrations/1579821113991_new_jobs_index/down.yaml create mode 100644 hasura/migrations/1579821113991_new_jobs_index/up.yaml create mode 100644 hasura/migrations/1579823064149_drop_index/down.yaml create mode 100644 hasura/migrations/1579823064149_drop_index/up.yaml create mode 100644 hasura/migrations/1579824162431_alter_table_public_jobs_add_column_search_idx_col/down.yaml create mode 100644 hasura/migrations/1579824162431_alter_table_public_jobs_add_column_search_idx_col/up.yaml create mode 100644 hasura/migrations/1579825076007_job_search_function/down.yaml create mode 100644 hasura/migrations/1579825076007_job_search_function/up.yaml create mode 100644 hasura/migrations/1579825091344_alter_table_public_jobs_drop_column_search_idx_col/down.yaml create mode 100644 hasura/migrations/1579825091344_alter_table_public_jobs_drop_column_search_idx_col/up.yaml create mode 100644 hasura/migrations/1579828405600_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1579828405600_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1579828420568_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1579828420568_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1579828431423_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1579828431423_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1579828444855_alter_table_public_jobs_drop_column_est_number/down.yaml create mode 100644 hasura/migrations/1579828444855_alter_table_public_jobs_drop_column_est_number/up.yaml create mode 100644 hasura/migrations/1579828512176_alter_table_public_jobs_add_column_est_number/down.yaml create mode 100644 hasura/migrations/1579828512176_alter_table_public_jobs_add_column_est_number/up.yaml create mode 100644 hasura/migrations/1579828599348_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1579828599348_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1579828619557_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1579828619557_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1579828627607_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1579828627607_update_permission_user_public_table_jobs/up.yaml diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index ab02b5e27..bde400703 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -66,6 +66,27 @@
+ + nodocuments + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + diff --git a/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx b/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx index c23626ac7..10ce89da3 100644 --- a/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx +++ b/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx @@ -1,12 +1,13 @@ -import React from "react"; -import { Link } from "react-router-dom"; -import { Dropdown, Menu, Icon, Avatar, Row, Col } from "antd"; -import { useTranslation } from "react-i18next"; -import i18next from "i18next"; import { useQuery } from "@apollo/react-hooks"; -import { GET_CURRENT_USER } from "../../graphql/local.queries"; +import { Avatar, Col, Dropdown, Icon, Menu, Row } from "antd"; +import i18next from "i18next"; +import React from "react"; +import { useTranslation } from "react-i18next"; +import { Link } from "react-router-dom"; import UserImage from "../../assets/User.svg"; +import { GET_CURRENT_USER } from "../../graphql/local.queries"; import AlertComponent from "../alert/alert.component"; +import SignOut from "../sign-out/sign-out.component"; export default function CurrentUserDropdown() { const { t } = useTranslation(); @@ -23,6 +24,9 @@ export default function CurrentUserDropdown() { }; const menu = ( + + + {t("menus.currentuser.profile")} diff --git a/client/src/components/header/header.component.jsx b/client/src/components/header/header.component.jsx index 052543a23..d5f942178 100644 --- a/client/src/components/header/header.component.jsx +++ b/client/src/components/header/header.component.jsx @@ -1,13 +1,12 @@ +import { useApolloClient } from "@apollo/react-hooks"; +import { Col, Icon, Menu, Row } from "antd"; import React from "react"; import { Link } from "react-router-dom"; -import { useApolloClient } from "@apollo/react-hooks"; -import { Menu, Icon, Row, Col } from "antd"; +import CurrentUserDropdown from "../current-user-dropdown/current-user-dropdown.component"; +import GlobalSearch from "../global-search/global-search.component"; +import ManageSignInButton from "../manage-sign-in-button/manage-sign-in-button.component"; import "./header.styles.scss"; -import SignOut from "../sign-out/sign-out.component"; -import ManageSignInButton from "../manage-sign-in-button/manage-sign-in-button.component"; -import GlobalSearch from "../global-search/global-search.component"; -import CurrentUserDropdown from "../current-user-dropdown/current-user-dropdown.component"; export default ({ landingHeader, navItems, selectedNavItem }) => { const apolloClient = useApolloClient(); @@ -38,9 +37,7 @@ export default ({ landingHeader, navItems, selectedNavItem }) => { ))} {!landingHeader ? ( - - - + null ) : ( diff --git a/client/src/components/job-detail-cards/job-detail-cards.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.component.jsx index 1aff30402..2b868a860 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.component.jsx @@ -56,11 +56,17 @@ export default function JobDetailCards({ selectedJob }) { } title={ - loading - ? t("general.labels.loading") - : data.jobs_by_pk.ro_number - ? `${t("jobs.fields.ro_number")} ${data.jobs_by_pk.ro_number}` - : `${t("jobs.fields.est_number")} ${data.jobs_by_pk.est_number}` + loading ? ( + t("general.labels.loading") + ) : ( + + {data.jobs_by_pk.ro_number + ? `${t("jobs.fields.ro_number")} ${data.jobs_by_pk.ro_number}` + : `${t("jobs.fields.est_number")} ${ + data.jobs_by_pk.est_number + }`}{" "} + + ) } extra={[ - {data.documents ? ( + {data.documents.count > 0 ? ( {data.documents.map(item => (
- + {item.name}
))}
- ) : null} + ) : ( +
{t("documents.errors.nodocuments")}
+ )} ); } diff --git a/client/src/components/jobs-documents/jobs-documents.component.jsx b/client/src/components/jobs-documents/jobs-documents.component.jsx index 7ccf166ef..7e72b4d22 100644 --- a/client/src/components/jobs-documents/jobs-documents.component.jsx +++ b/client/src/components/jobs-documents/jobs-documents.component.jsx @@ -1,4 +1,4 @@ -import { Button, Icon, Modal, notification, Upload } from "antd"; +import { Icon, Modal, notification, Upload } from "antd"; import axios from "axios"; import React, { useState } from "react"; import { useMutation } from "react-apollo"; @@ -165,7 +165,7 @@ function JobsDocumentsComponent({ shopId, jobId, loading, data }) { }); const CloudFrontUrl = "https://d18fc493a0fm4o.cloudfront.net"; const url = `${CloudFrontUrl}/${btoa(imageRequest)}`; - + console.log("url", url); return (
( - {record.ro_number ? record.ro_number : t("general.labels.na")} + {record.ro_number ? record.ro_number : "EST-" + record.est_number} ) @@ -202,7 +202,9 @@ export default withRouter(function JobsList({ return ( console.log(value)} + onSearch={value => { + console.log(value); + }} enterButton /> ); diff --git a/client/src/components/sign-out/sign-out.component.jsx b/client/src/components/sign-out/sign-out.component.jsx index 5b8b31203..2ed476ef7 100644 --- a/client/src/components/sign-out/sign-out.component.jsx +++ b/client/src/components/sign-out/sign-out.component.jsx @@ -1,12 +1,9 @@ -import React, { Component } from "react"; -//import { Redirect } from "react-router-dom"; +import React from "react"; +import { useTranslation } from "react-i18next"; import firebase from "../../firebase/firebase.utils"; -export default class SignOut extends Component { - state = { - redirect: false - }; - signOut = async () => { +export default function SignoutComponent() { + const signOut = async () => { try { await firebase.auth().signOut(); // this.setState({ @@ -17,17 +14,12 @@ export default class SignOut extends Component { } }; - renderRedirect = () => { - if (this.state.redirect) { - //return ; - } - }; - render() { - return ( -
- {this.renderRedirect()} -
Sign Out
-
- ); - } + const { t } = useTranslation(); + + return ( +
+ {this.renderRedirect()} +
{t("user.actions.signout")}
+
+ ); } diff --git a/client/src/graphql/apollo-error-handling.js b/client/src/graphql/apollo-error-handling.js index a5cd921cc..271052f78 100644 --- a/client/src/graphql/apollo-error-handling.js +++ b/client/src/graphql/apollo-error-handling.js @@ -28,47 +28,56 @@ const errorLink = onError( console.log("We need a new token!"); if (access_token && access_token !== "undefined") { // Let's refresh token through async request - return new Observable(observer => { - const unsubscribeFromAuth = auth.onAuthStateChanged(async user => { - console.log("Auth change in error handling."); - if (user) { - user - .getIdToken(true) - .then(function(idToken) { - if (!idToken) { - window.localStorage.removeItem("token"); - return console.log("Refresh token has expired"); - } - console.log("Got a new token", idToken); - window.localStorage.setItem("token", idToken); - // reset the headers - operation.setContext(({ headers = {} }) => ({ - headers: { - // Re-add old headers - ...headers, - // Switch out old access token for new one - authorization: idToken ? `Bearer ${idToken}` : "" - } - })); - - const subscriber = { - next: observer.next.bind(observer), - error: observer.error.bind(observer), - complete: observer.complete.bind(observer) - }; - console.log("About to resend the request."); - // Retry last failed request - forward(operation).subscribe(subscriber); - }) - .catch(error => { - // No refresh or client token available, we force user to login - console.log("Hit an error."); - observer.error(error); - }); - } - }); + auth.currentUser.getIdToken(true).then(token => { + if (token) { + window.localStorage.setItem("token", token); + operation.setContext(({ headers = {} }) => ({ + headers: { + ...headers, + authorization: token ? `Bearer ${token}` : "" + } + })); + return forward(operation); + } }); + + // return new Observable(observer => { + // auth.currentUser + // .getIdToken(true) + // .then(function(idToken) { + // if (!idToken) { + // window.localStorage.removeItem("token"); + // return console.log("Refresh token has expired"); + // } + // console.log("Got a new token", idToken); + // window.localStorage.setItem("token", idToken); + + // // reset the headers + // operation.setContext(({ headers = {} }) => ({ + // headers: { + // // Re-add old headers + // ...headers, + // // Switch out old access token for new one + // authorization: idToken ? `Bearer ${idToken}` : "" + // } + // })); + + // const subscriber = { + // next: observer.next.bind(observer), + // error: observer.error.bind(observer), + // complete: observer.complete.bind(observer) + // }; + // console.log("About to resend the request."); + // // Retry last failed request + // forward(operation).subscribe(subscriber); + // }) + // .catch(error => { + // // No refresh or client token available, we force user to login + // console.log("Hit an error."); + // observer.error(error); + // }); + // }); } } } diff --git a/client/src/pages/jobs/jobs.page.jsx b/client/src/pages/jobs/jobs.page.jsx index ee640a0e6..636a1010b 100644 --- a/client/src/pages/jobs/jobs.page.jsx +++ b/client/src/pages/jobs/jobs.page.jsx @@ -20,7 +20,6 @@ export default function JobsPage({ match, location }) { const { hash } = location; const [selectedJob, setSelectedJob] = useState(hash ? hash.substr(1) : null); - console.log("Jobs Page Render."); if (error) return ; return ( diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 1f05f4fca..bff05c3e1 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -3,7 +3,8 @@ "documents": { "errors": { "getpresignurl": "Error obtaining presigned URL for document. ", - "insert": "Unable to upload file." + "insert": "Unable to upload file.", + "nodocuments": "There are no documents." }, "labels": { "upload": "Upload" diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 69a689ff9..ff81af7c1 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -3,7 +3,8 @@ "documents": { "errors": { "getpresignurl": "Error al obtener la URL prescrita para el documento.", - "insert": "Incapaz de cargar el archivo." + "insert": "Incapaz de cargar el archivo.", + "nodocuments": "No hay documentos" }, "labels": { "upload": "Subir" diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 01c49457b..dad791091 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -3,7 +3,8 @@ "documents": { "errors": { "getpresignurl": "Erreur lors de l'obtention de l'URL présignée pour le document.", - "insert": "Incapable de télécharger le fichier." + "insert": "Incapable de télécharger le fichier.", + "nodocuments": "Il n'y a pas de documents." }, "labels": { "upload": "Télécharger" diff --git a/hasura/migrations/1579818641451_enable_pg_trm/down.yaml b/hasura/migrations/1579818641451_enable_pg_trm/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations/1579818641451_enable_pg_trm/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1579818641451_enable_pg_trm/up.yaml b/hasura/migrations/1579818641451_enable_pg_trm/up.yaml new file mode 100644 index 000000000..501ce8467 --- /dev/null +++ b/hasura/migrations/1579818641451_enable_pg_trm/up.yaml @@ -0,0 +1,4 @@ +- args: + cascade: true + sql: "CREATE EXTENSION pg_trgm;\r\n" + type: run_sql diff --git a/hasura/migrations/1579819352860_create_gin_index_jobs/down.yaml b/hasura/migrations/1579819352860_create_gin_index_jobs/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations/1579819352860_create_gin_index_jobs/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1579819352860_create_gin_index_jobs/up.yaml b/hasura/migrations/1579819352860_create_gin_index_jobs/up.yaml new file mode 100644 index 000000000..17188248a --- /dev/null +++ b/hasura/migrations/1579819352860_create_gin_index_jobs/up.yaml @@ -0,0 +1,7 @@ +- args: + cascade: true + sql: "CREATE INDEX jobs_gin_idx ON jobs\r\nUSING GIN ((est_number || ' ' || ro_number + \ || ' ' || clm_no || ' ' || ownr_ln || ' ' || ownr_fn || ' ' || ownr_ph1 + \r\n|| ' ' || ownr_ea \r\n|| ' ' || insd_ln \r\n|| ' ' || insd_fn \r\n|| ' ' + || insd_ea \r\n|| ' ' || insd_ph1 ) gin_trgm_ops);" + type: run_sql diff --git a/hasura/migrations/1579819439525_search_jobs_function/down.yaml b/hasura/migrations/1579819439525_search_jobs_function/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations/1579819439525_search_jobs_function/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1579819439525_search_jobs_function/up.yaml b/hasura/migrations/1579819439525_search_jobs_function/up.yaml new file mode 100644 index 000000000..9639ba95c --- /dev/null +++ b/hasura/migrations/1579819439525_search_jobs_function/up.yaml @@ -0,0 +1,16 @@ +- args: + cascade: true + sql: "CREATE FUNCTION search_jobs(search text)\r\nRETURNS SETOF jobs AS $$\r\n + \ SELECT *\r\n FROM jobs\r\n WHERE\r\n search <% (est_number || + ' ' || ro_number || ' ' || clm_no || ' ' || ownr_ln || ' ' || ownr_fn || + ' ' || ownr_ph1 \r\n|| ' ' || ownr_ea \r\n|| ' ' || insd_ln \r\n|| ' ' || insd_fn + \r\n|| ' ' || insd_ea \r\n|| ' ' || insd_ph1 )\r\n ORDER BY\r\n similarity(search, + (est_number || ' ' || ro_number || ' ' || clm_no || ' ' || ownr_ln || ' + ' || ownr_fn || ' ' || ownr_ph1 \r\n|| ' ' || ownr_ea \r\n|| ' ' || insd_ln + \r\n|| ' ' || insd_fn \r\n|| ' ' || insd_ea \r\n|| ' ' || insd_ph1 )) DESC\r\n + \ LIMIT 50;\r\n$$ LANGUAGE sql STABLE;" + type: run_sql +- args: + name: search_jobs + schema: public + type: track_function diff --git a/hasura/migrations/1579820833038_run_sql_migration/down.yaml b/hasura/migrations/1579820833038_run_sql_migration/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations/1579820833038_run_sql_migration/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1579820833038_run_sql_migration/up.yaml b/hasura/migrations/1579820833038_run_sql_migration/up.yaml new file mode 100644 index 000000000..d6dc6c697 --- /dev/null +++ b/hasura/migrations/1579820833038_run_sql_migration/up.yaml @@ -0,0 +1,4 @@ +- args: + cascade: true + sql: 'drop index jobs_gin_idx ' + type: run_sql diff --git a/hasura/migrations/1579820853826_run_sql_migration/down.yaml b/hasura/migrations/1579820853826_run_sql_migration/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations/1579820853826_run_sql_migration/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1579820853826_run_sql_migration/up.yaml b/hasura/migrations/1579820853826_run_sql_migration/up.yaml new file mode 100644 index 000000000..984059595 --- /dev/null +++ b/hasura/migrations/1579820853826_run_sql_migration/up.yaml @@ -0,0 +1,4 @@ +- args: + cascade: true + sql: drop function search_jobs + type: run_sql diff --git a/hasura/migrations/1579821113991_new_jobs_index/down.yaml b/hasura/migrations/1579821113991_new_jobs_index/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations/1579821113991_new_jobs_index/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1579821113991_new_jobs_index/up.yaml b/hasura/migrations/1579821113991_new_jobs_index/up.yaml new file mode 100644 index 000000000..6e29d97d4 --- /dev/null +++ b/hasura/migrations/1579821113991_new_jobs_index/up.yaml @@ -0,0 +1,7 @@ +- args: + cascade: true + sql: CREATE INDEX jobs_search_idx ON jobs USING gin (est_number gin_trgm_ops, + ro_number gin_trgm_ops, clm_no gin_trgm_ops, ownr_ln gin_trgm_ops, ownr_fn gin_trgm_ops, + ownr_ph1 gin_trgm_ops, ownr_ea gin_trgm_ops, insd_ln gin_trgm_ops, insd_fn gin_trgm_ops, + insd_ea gin_trgm_ops, insd_ph1 gin_trgm_ops); + type: run_sql diff --git a/hasura/migrations/1579823064149_drop_index/down.yaml b/hasura/migrations/1579823064149_drop_index/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations/1579823064149_drop_index/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1579823064149_drop_index/up.yaml b/hasura/migrations/1579823064149_drop_index/up.yaml new file mode 100644 index 000000000..4f54ab178 --- /dev/null +++ b/hasura/migrations/1579823064149_drop_index/up.yaml @@ -0,0 +1,4 @@ +- args: + cascade: true + sql: 'drop INDEX jobs_search_idx ' + type: run_sql diff --git a/hasura/migrations/1579824162431_alter_table_public_jobs_add_column_search_idx_col/down.yaml b/hasura/migrations/1579824162431_alter_table_public_jobs_add_column_search_idx_col/down.yaml new file mode 100644 index 000000000..e62a6046e --- /dev/null +++ b/hasura/migrations/1579824162431_alter_table_public_jobs_add_column_search_idx_col/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "search_idx_col"; + type: run_sql diff --git a/hasura/migrations/1579824162431_alter_table_public_jobs_add_column_search_idx_col/up.yaml b/hasura/migrations/1579824162431_alter_table_public_jobs_add_column_search_idx_col/up.yaml new file mode 100644 index 000000000..26b51996a --- /dev/null +++ b/hasura/migrations/1579824162431_alter_table_public_jobs_add_column_search_idx_col/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "search_idx_col" tsvector NULL; + type: run_sql diff --git a/hasura/migrations/1579825076007_job_search_function/down.yaml b/hasura/migrations/1579825076007_job_search_function/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations/1579825076007_job_search_function/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1579825076007_job_search_function/up.yaml b/hasura/migrations/1579825076007_job_search_function/up.yaml new file mode 100644 index 000000000..70f68249e --- /dev/null +++ b/hasura/migrations/1579825076007_job_search_function/up.yaml @@ -0,0 +1,15 @@ +- args: + cascade: true + sql: "CREATE FUNCTION search_jobs(search text)\r\nRETURNS SETOF jobs AS $$\r\n + \ SELECT *\r\n FROM jobs\r\n WHERE\r\n ownr_fn ilike ('%' || search + || '%')\r\n OR ownr_ln ilike ('%' || search || '%')\r\n OR ro_number + ilike ('%' || search || '%')\r\n OR est_number ilike ('%' || search || + '%')\r\n OR clm_no ilike ('%' || search || '%')\r\n OR ownr_ph1 ilike + ('%' || search || '%')\r\n OR ownr_ea ilike ('%' || search || '%')\r\n + \ OR insd_ln ilike ('%' || search || '%')\r\n OR insd_fn ilike ('%' + || search || '%')\r\n$$ LANGUAGE sql STABLE;\r\n" + type: run_sql +- args: + name: search_jobs + schema: public + type: track_function diff --git a/hasura/migrations/1579825091344_alter_table_public_jobs_drop_column_search_idx_col/down.yaml b/hasura/migrations/1579825091344_alter_table_public_jobs_drop_column_search_idx_col/down.yaml new file mode 100644 index 000000000..969a340c5 --- /dev/null +++ b/hasura/migrations/1579825091344_alter_table_public_jobs_drop_column_search_idx_col/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "search_idx_col" tsvector + type: run_sql +- args: + sql: ALTER TABLE "public"."jobs" ALTER COLUMN "search_idx_col" DROP NOT NULL + type: run_sql diff --git a/hasura/migrations/1579825091344_alter_table_public_jobs_drop_column_search_idx_col/up.yaml b/hasura/migrations/1579825091344_alter_table_public_jobs_drop_column_search_idx_col/up.yaml new file mode 100644 index 000000000..ce1071e44 --- /dev/null +++ b/hasura/migrations/1579825091344_alter_table_public_jobs_drop_column_search_idx_col/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "search_idx_col" CASCADE + type: run_sql diff --git a/hasura/migrations/1579828405600_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1579828405600_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..cdb202414 --- /dev/null +++ b/hasura/migrations/1579828405600_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,212 @@ +- 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 + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - ciecaid + - claim_total + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - 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 + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - invoice_date + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - policy_no + - 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 + - theft_ind + - tlos_ind + - updated_at + - vehicleid + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1579828405600_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1579828405600_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..802868c66 --- /dev/null +++ b/hasura/migrations/1579828405600_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,211 @@ +- 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 + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - ciecaid + - claim_total + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deductible + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - federal_tax_rate + - id + - inproduction + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - invoice_date + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - policy_no + - 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 + - theft_ind + - tlos_ind + - updated_at + - vehicleid + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1579828420568_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1579828420568_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..931e8b9ab --- /dev/null +++ b/hasura/migrations/1579828420568_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,210 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - actual_completion + - actual_delivery + - actual_in + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - ciecaid + - claim_total + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - 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 + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - invoice_date + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - policy_no + - 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 + - theft_ind + - tlos_ind + - 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/1579828420568_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1579828420568_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..0a96c063d --- /dev/null +++ b/hasura/migrations/1579828420568_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,209 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - actual_completion + - actual_delivery + - actual_in + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - ciecaid + - claim_total + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deductible + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - federal_tax_rate + - id + - inproduction + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - invoice_date + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - policy_no + - 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 + - theft_ind + - tlos_ind + - 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/1579828431423_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1579828431423_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..3945c7115 --- /dev/null +++ b/hasura/migrations/1579828431423_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,212 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - actual_completion + - actual_delivery + - actual_in + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - ciecaid + - claim_total + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - 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 + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - invoice_date + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - policy_no + - 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 + - theft_ind + - tlos_ind + - 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/1579828431423_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1579828431423_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..a3b61010f --- /dev/null +++ b/hasura/migrations/1579828431423_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,211 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - actual_completion + - actual_delivery + - actual_in + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - ciecaid + - claim_total + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deductible + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - federal_tax_rate + - id + - inproduction + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - invoice_date + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - policy_no + - 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 + - theft_ind + - tlos_ind + - 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/1579828444855_alter_table_public_jobs_drop_column_est_number/down.yaml b/hasura/migrations/1579828444855_alter_table_public_jobs_drop_column_est_number/down.yaml new file mode 100644 index 000000000..742d6cd31 --- /dev/null +++ b/hasura/migrations/1579828444855_alter_table_public_jobs_drop_column_est_number/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "est_number" text + type: run_sql +- args: + sql: ALTER TABLE "public"."jobs" ALTER COLUMN "est_number" DROP NOT NULL + type: run_sql diff --git a/hasura/migrations/1579828444855_alter_table_public_jobs_drop_column_est_number/up.yaml b/hasura/migrations/1579828444855_alter_table_public_jobs_drop_column_est_number/up.yaml new file mode 100644 index 000000000..0a7b343e7 --- /dev/null +++ b/hasura/migrations/1579828444855_alter_table_public_jobs_drop_column_est_number/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "est_number" CASCADE + type: run_sql diff --git a/hasura/migrations/1579828512176_alter_table_public_jobs_add_column_est_number/down.yaml b/hasura/migrations/1579828512176_alter_table_public_jobs_add_column_est_number/down.yaml new file mode 100644 index 000000000..10b08cae0 --- /dev/null +++ b/hasura/migrations/1579828512176_alter_table_public_jobs_add_column_est_number/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "est_number"; + type: run_sql diff --git a/hasura/migrations/1579828512176_alter_table_public_jobs_add_column_est_number/up.yaml b/hasura/migrations/1579828512176_alter_table_public_jobs_add_column_est_number/up.yaml new file mode 100644 index 000000000..1c6632831 --- /dev/null +++ b/hasura/migrations/1579828512176_alter_table_public_jobs_add_column_est_number/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "est_number" bigserial NOT NULL; + type: run_sql diff --git a/hasura/migrations/1579828599348_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1579828599348_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..802868c66 --- /dev/null +++ b/hasura/migrations/1579828599348_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,211 @@ +- 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 + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - ciecaid + - claim_total + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deductible + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - federal_tax_rate + - id + - inproduction + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - invoice_date + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - policy_no + - 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 + - theft_ind + - tlos_ind + - updated_at + - vehicleid + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1579828599348_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1579828599348_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..cdb202414 --- /dev/null +++ b/hasura/migrations/1579828599348_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,212 @@ +- 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 + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - ciecaid + - claim_total + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - 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 + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - invoice_date + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - policy_no + - 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 + - theft_ind + - tlos_ind + - updated_at + - vehicleid + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1579828619557_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1579828619557_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..0a96c063d --- /dev/null +++ b/hasura/migrations/1579828619557_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,209 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - actual_completion + - actual_delivery + - actual_in + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - ciecaid + - claim_total + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deductible + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - federal_tax_rate + - id + - inproduction + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - invoice_date + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - policy_no + - 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 + - theft_ind + - tlos_ind + - 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/1579828619557_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1579828619557_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..915f8c6b9 --- /dev/null +++ b/hasura/migrations/1579828619557_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,210 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - converted + - inproduction + - asgn_date + - invoice_date + - loss_date + - pay_date + - est_number + - area_of_damage + - claim_total + - clm_total + - ded_amt + - deductible + - federal_tax_rate + - local_tax_rate + - owner_owing + - pay_amt + - 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 + - state_tax_rate + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - regie_number + - ro_number + - theft_ind + - tlos_ind + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - 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/1579828627607_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1579828627607_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..a3b61010f --- /dev/null +++ b/hasura/migrations/1579828627607_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,211 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - actual_completion + - actual_delivery + - actual_in + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - ciecaid + - claim_total + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - deductible + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - federal_tax_rate + - id + - inproduction + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - invoice_date + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - policy_no + - 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 + - theft_ind + - tlos_ind + - 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/1579828627607_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1579828627607_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..a1c550dec --- /dev/null +++ b/hasura/migrations/1579828627607_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,212 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - converted + - inproduction + - asgn_date + - invoice_date + - loss_date + - pay_date + - est_number + - area_of_damage + - claim_total + - clm_total + - ded_amt + - deductible + - federal_tax_rate + - local_tax_rate + - owner_owing + - pay_amt + - 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 + - state_tax_rate + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - regie_number + - ro_number + - theft_ind + - tlos_ind + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - 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 From 32ce90ec9cf17c20c8d91f4a4b41f51e04c5d041 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 24 Jan 2020 09:41:35 -0800 Subject: [PATCH 04/23] Replaced null coalescence. Updated dates components. --- _business_logic/documents.md | 2 +- bodyshop_translations.babel | 304 ++++++++++++++++++ client/src/App/App.js | 1 + .../current-user-dropdown.component.jsx | 2 +- .../job-detail-cards.component.jsx | 77 ++--- .../job-detail-cards.customer.component.jsx | 25 +- .../job-detail-cards.dates.component.jsx | 113 ++++++- .../job-detail-cards.insurance.component.jsx | 16 +- .../job-detail-cards.vehicle.component.jsx | 6 +- .../job-tombstone/job-tombstone.component.jsx | 12 +- .../jobs-list/jobs-list.component.jsx | 2 +- .../sign-out/sign-out.component.jsx | 7 +- .../white-board-card.component.jsx | 14 +- client/src/graphql/apollo-error-handling.js | 2 +- client/src/translations/en_us/common.json | 18 ++ client/src/translations/es/common.json | 18 ++ client/src/translations/fr/common.json | 18 ++ 17 files changed, 550 insertions(+), 87 deletions(-) diff --git a/_business_logic/documents.md b/_business_logic/documents.md index 7291c0a58..9641363eb 100644 --- a/_business_logic/documents.md +++ b/_business_logic/documents.md @@ -5,4 +5,4 @@ 1. Get a presigned URL by hitting our own express server with a unique key. 2. Use this presigned URL to upload an individual file. 3. Store the key + the bucket name to the documents record. -4. ???Figure out how to add thumbnails. \ No newline at end of file +4. \ No newline at end of file diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index bde400703..8c606e919 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -484,6 +484,27 @@ + + nodates + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + nojobselected false @@ -615,6 +636,69 @@ fields + + actual_completion + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + actual_delivery + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + actual_in + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + claim_total false @@ -678,6 +762,132 @@ + + date_closed + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + date_estimated + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + date_exported + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + date_invoiced + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + date_open + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + date_scheduled + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + deductible false @@ -846,6 +1056,69 @@ + + scheduled_completion + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + scheduled_delivery + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + scheduled_in + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + status false @@ -1886,6 +2159,37 @@ + + user + + + actions + + + signout + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + + + vehicles diff --git a/client/src/App/App.js b/client/src/App/App.js index b9eeb58cc..3fa93e5d1 100644 --- a/client/src/App/App.js +++ b/client/src/App/App.js @@ -30,6 +30,7 @@ export default () => { useEffect(() => { //Run the auth code only on the first render. const unsubscribeFromAuth = auth.onAuthStateChanged(async user => { + console.log("Auth State Changed.") if (user) { let token; token = await user.getIdToken(); diff --git a/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx b/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx index 10ce89da3..177a1cb97 100644 --- a/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx +++ b/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx @@ -63,7 +63,7 @@ export default function CurrentUserDropdown() { - {currentUser?.displayName ?? t("general.labels.unknown")} + {currentUser?.displayName || t("general.labels.unknown")} diff --git a/client/src/components/job-detail-cards/job-detail-cards.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.component.jsx index 2b868a860..5c900483d 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.component.jsx @@ -1,26 +1,24 @@ -import React, { useState } from "react"; -import { Link } from "react-router-dom"; -import { useTranslation } from "react-i18next"; import { useQuery } from "@apollo/react-hooks"; -import AlertComponent from "../alert/alert.component"; +import { Button, Icon, PageHeader, Tag } from "antd"; +import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; +import { Link } from "react-router-dom"; import { QUERY_JOB_CARD_DETAILS } from "../../graphql/jobs.queries"; -import { PageHeader, Button, Descriptions, Tag, Icon } from "antd"; - +import AlertComponent from "../alert/alert.component"; +import LoadingSpinner from "../loading-spinner/loading-spinner.component"; +import NoteUpsertModal from "../note-upsert-modal/note-upsert-modal.container"; //import JobDetailCardsHeaderComponent from "./job-detail-cards.header.component"; import JobDetailCardsCustomerComponent from "./job-detail-cards.customer.component"; -import JobDetailCardsVehicleComponent from "./job-detail-cards.vehicle.component"; -import JobDetailCardsInsuranceComponent from "./job-detail-cards.insurance.component"; -import JobDetailCardsDatesComponent from "./job-detail-cards.dates.component"; -import JobDetailCardsPartsComponent from "./job-detail-cards.parts.component"; -import JobDetailCardsNotesComponent from "./job-detail-cards.notes.component"; import JobDetailCardsDamageComponent from "./job-detail-cards.damage.component"; -import JobDetailCardsTotalsComponent from "./job-detail-cards.totals.component"; +import JobDetailCardsDatesComponent from "./job-detail-cards.dates.component"; import JobDetailCardsDocumentsComponent from "./job-detail-cards.documents.component"; -import LoadingSpinner from "../loading-spinner/loading-spinner.component"; - +import JobDetailCardsInsuranceComponent from "./job-detail-cards.insurance.component"; +import JobDetailCardsNotesComponent from "./job-detail-cards.notes.component"; +import JobDetailCardsPartsComponent from "./job-detail-cards.parts.component"; import "./job-detail-cards.styles.scss"; -import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component"; -import NoteUpsertModal from "../note-upsert-modal/note-upsert-modal.container"; +import JobDetailCardsTotalsComponent from "./job-detail-cards.totals.component"; + + export default function JobDetailCards({ selectedJob }) { const { loading, error, data, refetch } = useQuery(QUERY_JOB_CARD_DETAILS, { @@ -95,33 +93,38 @@ export default function JobDetailCards({ selectedJob }) { {t("jobs.actions.postInvoices")} ]}> - {loading ? ( - - ) : ( - - Lili Qu - 421421 - - 2017-01-10 - - - 2017-10-10 - - - Gonghu Road, Xihu District, Hangzhou, Zhejiang, China - - - )} + { + // loading ? ( + // + // ) : ( + // + // Lili Qu + // 421421 + // + // 2017-01-10 + // + // + // 2017-10-10 + // + // + // Gonghu Road, Xihu District, Hangzhou, Zhejiang, China + // + // + // ) + }
- + { + // + } + + extraLink={data && data.owner ? `/manage/owners/${data.owner.id}` : null}> {data ? ( -
{`${data?.ownr_fn ?? ""} ${data.ownr_ln ?? ""}`}
+
{`${data.ownr_fn || ""} ${data.ownr_ln || ""}`}
{t("jobs.fields.phoneshort")}: - {`${data?.ownr_ph1 ?? + {`${data.ownr_ph1 || t("general.labels.na")}`}
-
{t("jobs.fields.ownr_ea")}: - {data?.ownr_ea ? ( + {data.ownr_ea ? ( - {`${data?.ownr_ea ?? ""}`} + {`${data.ownr_ea || ""}`} ) : ( t("general.labels.na") )}
- -
{`${data?.owner?.preferred_contact ?? ""}`}
+
{`${(data.owner && data.owner.preferred_contact) || ""}`}
+ {data.vehicle ? ( + + {`${data.vehicle.v_model_yr || ""} ${data.vehicle.v_make_desc || + ""} ${data.vehicle.v_model_desc || ""}`} + + ) : ( + {t("jobs.errors.novehicle")} + )}
) : null} diff --git a/client/src/components/job-detail-cards/job-detail-cards.dates.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.dates.component.jsx index d329d1f58..a6c17e793 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.dates.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.dates.component.jsx @@ -11,13 +11,112 @@ export default function JobDetailCardsDatesComponent({ loading, data }) { {data ? ( - - Actual In {data?.actual_in} - - - Scheduled Completion - {data?.scheduled_completion} - + {!( + data.actual_in || + data.scheduled_completion || + data.scheduled_in || + data.actual_completion || + data.scheduled_delivery || + data.actual_delivery || + data.date_estimated || + data.date_open || + data.date_scheduled || + data.date_invoiced || + data.date_closed || + data.date_exported + ) ? ( +
{t("jobs.errors.nodates")}
+ ) : null} + + {data.actual_in ? ( + + {t("jobs.fields.actual_in")} + {data.actual_in || ""} + + ) : null} + + {data.scheduled_completion ? ( + + {t("jobs.fields.scheduled_completion")} + + {data.scheduled_completion || ""} + + + ) : null} + + {data.scheduled_in ? ( + + {t("jobs.fields.scheduled_in")} + {data.scheduled_in || ""} + + ) : null} + + {data.actual_completion ? ( + + {t("jobs.fields.actual_completion")} + + {data.actual_completion || ""} + + + ) : null} + + {data.scheduled_delivery ? ( + + {t("jobs.fields.scheduled_delivery")} + + {data.scheduled_delivery || ""} + + + ) : null} + + {data.actual_delivery ? ( + + {t("jobs.fields.actual_delivery")} + {data.actual_delivery || ""} + + ) : null} + + {data.date_estimated ? ( + + {t("jobs.fields.date_estimated")} + {data.date_estimated || ""} + + ) : null} + + {data.date_open ? ( + + {t("jobs.fields.date_open")} + {data.date_open || ""} + + ) : null} + + {data.date_scheduled ? ( + + {t("jobs.fields.date_scheduled")} + {data.date_scheduled || ""} + + ) : null} + + {data.date_invoiced ? ( + + {t("jobs.fields.date_invoiced")} + {data.date_invoiced || ""} + + ) : null} + + {data.date_closed ? ( + + {t("jobs.fields.date_closed")} + {data.date_closed || ""} + + ) : null} + + {data.date_exported ? ( + + {t("jobs.fields.date_exported")} + {data.date_exported || ""} + + ) : null}
) : null}
diff --git a/client/src/components/job-detail-cards/job-detail-cards.insurance.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.insurance.component.jsx index 5dd73988c..54602f2d8 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.insurance.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.insurance.component.jsx @@ -10,16 +10,16 @@ export default function JobDetailCardsInsuranceComponent({ loading, data }) { {data ? ( -
{data?.ins_co_nm ?? t("general.labels.unknown")}
-
{data?.clm_no ?? t("general.labels.unknown")}
+
{data?.ins_co_nm || t("general.labels.unknown")}
+
{data?.clm_no || t("general.labels.unknown")}
{t("jobs.labels.cards.filehandler")} {data?.ins_ea ? ( -
{`${data?.ins_ct_fn ?? ""} ${data?.ins_ct_ln ?? ""}`}
+
{`${data?.ins_ct_fn || ""} ${data?.ins_ct_ln || ""}`}
) : ( -
{`${data?.ins_ct_fn ?? ""} ${data?.ins_ct_ln ?? ""}`}
+
{`${data?.ins_ct_fn || ""} ${data?.ins_ct_ln || ""}`}
)} {data?.ins_ph1 ? ( {data?.ins_ph1} @@ -31,10 +31,10 @@ export default function JobDetailCardsInsuranceComponent({ loading, data }) { {t("jobs.labels.cards.appraiser")} {data?.est_ea ? ( -
{`${data?.ins_ct_fn ?? ""} ${data?.ins_ct_ln ?? ""}`}
+
{`${data?.ins_ct_fn || ""} ${data?.ins_ct_ln || ""}`}
) : ( -
{`${data?.ins_ct_fn ?? ""} ${data?.ins_ct_ln ?? ""}`}
+
{`${data?.ins_ct_fn || ""} ${data?.ins_ct_ln || ""}`}
)}
@@ -42,10 +42,10 @@ export default function JobDetailCardsInsuranceComponent({ loading, data }) { {t("jobs.labels.cards.estimator")} {data?.est_ea ? ( -
{`${data?.est_ct_fn ?? ""} ${data?.est_ct_ln ?? ""}`}
+
{`${data?.est_ct_fn || ""} ${data?.est_ct_ln || ""}`}
) : ( -
{`${data?.est_ct_fn ?? ""} ${data?.est_ct_ln ?? ""}`}
+
{`${data?.est_ct_fn || ""} ${data?.est_ct_ln || ""}`}
)} {data?.est_ph1 ? ( {data?.est_ph1} diff --git a/client/src/components/job-detail-cards/job-detail-cards.vehicle.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.vehicle.component.jsx index ed58b3f81..3cf89b0ed 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.vehicle.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.vehicle.component.jsx @@ -13,9 +13,9 @@ export default function JobDetailCardsVehicleComponent({ loading, data }) { > {data ? ( - {data.vehicle?.v_model_yr ?? t("general.labels.na")}{" "} - {data.vehicle?.v_make_desc ?? t("general.labels.na")}{" "} - {data.vehicle?.v_model_desc ?? t("general.labels.na")} + {data.vehicle?.v_model_yr || t("general.labels.na")}{" "} + {data.vehicle?.v_make_desc || t("general.labels.na")}{" "} + {data.vehicle?.v_model_desc || t("general.labels.na")} ) : null}
diff --git a/client/src/components/job-tombstone/job-tombstone.component.jsx b/client/src/components/job-tombstone/job-tombstone.component.jsx index 3d6d2ba75..0bb478743 100644 --- a/client/src/components/job-tombstone/job-tombstone.component.jsx +++ b/client/src/components/job-tombstone/job-tombstone.component.jsx @@ -91,9 +91,9 @@ function JobTombstone({ job, ...otherProps }) { title={tombstoneTitle} subTitle={ jobContext.owner - ? (jobContext.owner?.first_name ?? "") + + ? (jobContext.owner?.first_name || "") + " " + - (jobContext.owner?.last_name ?? "") + (jobContext.owner?.last_name || "") : t("jobs.errors.noowner") } tags={ @@ -133,10 +133,10 @@ function JobTombstone({ job, ...otherProps }) { - {jobContext.vehicle?.v_model_yr ?? t("general.labels.na")}{" "} - {jobContext.vehicle?.v_make_desc ?? t("general.labels.na")}{" "} - {jobContext.vehicle?.v_model_desc ?? t("general.labels.na")} |{" "} - {jobContext.vehicle?.plate_no ?? t("general.labels.na")} + {jobContext.vehicle?.v_model_yr || t("general.labels.na")}{" "} + {jobContext.vehicle?.v_make_desc || t("general.labels.na")}{" "} + {jobContext.vehicle?.v_model_desc || t("general.labels.na")} |{" "} + {jobContext.vehicle?.plate_no || t("general.labels.na")} diff --git a/client/src/components/jobs-list/jobs-list.component.jsx b/client/src/components/jobs-list/jobs-list.component.jsx index 5cf9bec8b..f92279eee 100644 --- a/client/src/components/jobs-list/jobs-list.component.jsx +++ b/client/src/components/jobs-list/jobs-list.component.jsx @@ -91,7 +91,7 @@ export default withRouter(function JobsList({ sortOrder: state.sortedInfo.columnKey === "status" && state.sortedInfo.order, render: (text, record) => { - return record.job_status?.name ?? t("general.labels.na"); + return record.job_status?.name || t("general.labels.na"); } }, diff --git a/client/src/components/sign-out/sign-out.component.jsx b/client/src/components/sign-out/sign-out.component.jsx index 2ed476ef7..9e995d819 100644 --- a/client/src/components/sign-out/sign-out.component.jsx +++ b/client/src/components/sign-out/sign-out.component.jsx @@ -16,10 +16,5 @@ export default function SignoutComponent() { const { t } = useTranslation(); - return ( -
- {this.renderRedirect()} -
{t("user.actions.signout")}
-
- ); + return
{t("user.actions.signout")}
; } diff --git a/client/src/components/white-board-card/white-board-card.component.jsx b/client/src/components/white-board-card/white-board-card.component.jsx index e5367c085..393878f8f 100644 --- a/client/src/components/white-board-card/white-board-card.component.jsx +++ b/client/src/components/white-board-card/white-board-card.component.jsx @@ -63,11 +63,11 @@ export default function WhiteBoardCard({ metadata }) {
- {metadata.vehicle?.v_model_yr ?? t("general.labels.na")}{" "} - {metadata.vehicle?.v_make_desc ?? t("general.labels.na")}{" "} - {metadata.vehicle?.v_model_desc ?? t("general.labels.na")} + {metadata.vehicle?.v_model_yr || t("general.labels.na")}{" "} + {metadata.vehicle?.v_make_desc || t("general.labels.na")}{" "} + {metadata.vehicle?.v_model_desc || t("general.labels.na")} {metadata.vehicle?.v_vin ? ( - VIN: {metadata.vehicle?.v_vin ?? t("general.labels.na")} + VIN: {metadata.vehicle?.v_vin || t("general.labels.na")} ) : null} diff --git a/client/src/graphql/apollo-error-handling.js b/client/src/graphql/apollo-error-handling.js index 271052f78..6b5b74677 100644 --- a/client/src/graphql/apollo-error-handling.js +++ b/client/src/graphql/apollo-error-handling.js @@ -1,5 +1,5 @@ import { onError } from "apollo-link-error"; -import { Observable } from "apollo-link"; +//import { Observable } from "apollo-link"; import { auth } from "../firebase/firebase.utils"; //https://stackoverflow.com/questions/57163454/refreshing-a-token-with-apollo-client-firebase-auth const errorLink = onError( diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index bff05c3e1..7a6db6841 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -38,6 +38,7 @@ }, "errors": { "noaccess": "This job does not exist or you do not have access to it.", + "nodates": "No dates specified for this job.", "nojobselected": "No job is selected.", "noowner": "No owner associated.", "novehicle": "No vehicle associated.", @@ -46,9 +47,18 @@ "validationtitle": "Validation Error" }, "fields": { + "actual_completion": "Actual Completion", + "actual_delivery": "Actual Delivery", + "actual_in": "Actual In", "claim_total": "Claim Total", "clm_no": "Claim #", "clm_total": "Claim Total", + "date_closed": "Closed", + "date_estimated": "Date Estimated", + "date_exported": "Exported", + "date_invoiced": "Invoiced", + "date_open": "Open", + "date_scheduled": "Scheduled", "deductible": "Deductible", "est_number": "Estimate Number", "owner": "Owner", @@ -57,6 +67,9 @@ "phone1": "Phone 1", "phoneshort": "PH", "ro_number": "RO #", + "scheduled_completion": "Scheduled Completion", + "scheduled_delivery": "Scheduled Delivery", + "scheduled_in": "Scheduled In", "status": "Job Status", "vehicle": "Vehicle" }, @@ -133,6 +146,11 @@ "jobsdocuments": "Job Documents {{ro_number}} | $t(titles.app)", "profile": "My Profile | $t(titles.app)" }, + "user": { + "actions": { + "signout": "Sign Out" + } + }, "vehicles": { "fields": { "plate_no": "License Plate" diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index ff81af7c1..fda17bd90 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -38,6 +38,7 @@ }, "errors": { "noaccess": "Este trabajo no existe o no tiene acceso a él.", + "nodates": "No hay fechas especificadas para este trabajo.", "nojobselected": "No hay trabajo seleccionado.", "noowner": "Ningún propietario asociado.", "novehicle": "No hay vehículo asociado.", @@ -46,9 +47,18 @@ "validationtitle": "Error de validacion" }, "fields": { + "actual_completion": "Realización real", + "actual_delivery": "Entrega real", + "actual_in": "Real en", "claim_total": "Reclamar total", "clm_no": "Reclamación #", "clm_total": "Reclamar total", + "date_closed": "Cerrado", + "date_estimated": "Fecha estimada", + "date_exported": "Exportado", + "date_invoiced": "Facturado", + "date_open": "Abierto", + "date_scheduled": "Programado", "deductible": "Deducible", "est_number": "Numero Estimado", "owner": "Propietario", @@ -57,6 +67,9 @@ "phone1": "Teléfono 1", "phoneshort": "PH", "ro_number": "RO #", + "scheduled_completion": "Finalización programada", + "scheduled_delivery": "Entrega programada", + "scheduled_in": "Programado en", "status": "Estado del trabajo", "vehicle": "Vehículo" }, @@ -133,6 +146,11 @@ "jobsdocuments": "Documentos de trabajo {{ro_number}} | $ t (títulos.app)", "profile": "Mi perfil | $t(titles.app)" }, + "user": { + "actions": { + "signout": "desconectar" + } + }, "vehicles": { "fields": { "plate_no": "Placa" diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index dad791091..53926ea54 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -38,6 +38,7 @@ }, "errors": { "noaccess": "Ce travail n'existe pas ou vous n'y avez pas accès.", + "nodates": "Aucune date spécifiée pour ce travail.", "nojobselected": "Aucun travail n'est sélectionné.", "noowner": "Aucun propriétaire associé.", "novehicle": "Aucun véhicule associé.", @@ -46,9 +47,18 @@ "validationtitle": "Erreur de validation" }, "fields": { + "actual_completion": "Achèvement réel", + "actual_delivery": "Livraison réelle", + "actual_in": "En réel", "claim_total": "Total réclamation", "clm_no": "Prétendre #", "clm_total": "Total réclamation", + "date_closed": "Fermé", + "date_estimated": "Date estimée", + "date_exported": "Exportés", + "date_invoiced": "Facturé", + "date_open": "Ouvrir", + "date_scheduled": "Prévu", "deductible": "Déductible", "est_number": "Numéro d'estimation", "owner": "Propriétaire", @@ -57,6 +67,9 @@ "phone1": "Téléphone 1", "phoneshort": "PH", "ro_number": "RO #", + "scheduled_completion": "Achèvement planifié", + "scheduled_delivery": "Livraison programmée", + "scheduled_in": "Planifié dans", "status": "Statut de l'emploi", "vehicle": "Véhicule" }, @@ -133,6 +146,11 @@ "jobsdocuments": "Documents de travail {{ro_number}} | $ t (titres.app)", "profile": "Mon profil | $t(titles.app)" }, + "user": { + "actions": { + "signout": "Déconnexion" + } + }, "vehicles": { "fields": { "plate_no": "Plaque d'immatriculation" From 5f256c204ddefb74e924c1c36be743259379ead6 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 24 Jan 2020 11:03:33 -0800 Subject: [PATCH 05/23] Added CDN thumb generation. --- .../jobs-documents.component.jsx | 205 +++++++++--------- .../jobs-documents.container.jsx | 16 +- .../pages/jobs-detail/jobs-detail.page.jsx | 1 - client/src/utils/DocHelpers.js | 13 ++ 4 files changed, 130 insertions(+), 105 deletions(-) create mode 100644 client/src/utils/DocHelpers.js diff --git a/client/src/components/jobs-documents/jobs-documents.component.jsx b/client/src/components/jobs-documents/jobs-documents.component.jsx index 7e72b4d22..d3a092682 100644 --- a/client/src/components/jobs-documents/jobs-documents.component.jsx +++ b/client/src/components/jobs-documents/jobs-documents.component.jsx @@ -6,6 +6,7 @@ import { useTranslation } from "react-i18next"; import Resizer from "react-image-file-resizer"; import { INSERT_NEW_DOCUMENT } from "../../graphql/documents.queries"; import "./jobs-documents.styles.scss"; +import { generateCdnThumb } from "../../utils/DocHelpers"; function getBase64(file) { return new Promise((resolve, reject) => { @@ -16,7 +17,7 @@ function getBase64(file) { }); } -function JobsDocumentsComponent({ shopId, jobId, loading, data }) { +function JobsDocumentsComponent({ shopId, jobId, loading, data, currentUser }) { const { t } = useTranslation(); const [insertNewDocument] = useMutation(INSERT_NEW_DOCUMENT); @@ -29,98 +30,108 @@ function JobsDocumentsComponent({ shopId, jobId, loading, data }) { data.reduce((acc, value) => { acc.push({ uid: value.id, - url: value.url, + url: value.thumb_url, name: value.name, - status: "done", - thumUrl: - "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png" + status: "done" }); return acc; }, []) ); - const handleUpload = ev => { - const { onError, onSuccess, onProgress } = ev; + const uploadToS3 = ( + fileName, + fileType, + file, + onError, + onSuccess, + onProgress + ) => { + axios + .post("/sign_s3", { + fileName, + fileType + }) + .then(response => { + var returnData = response.data.data.returnData; + var signedRequest = returnData.signedRequest; + var url = returnData.url; + setState({ ...state, url: url }); + // Put the fileType in the headers for the upload + var options = { + headers: { + "Content-Type": fileType + }, + onUploadProgress: e => { + onProgress({ percent: (e.loaded / e.total) * 100 }); + } + }; - Resizer.imageFileResizer( - ev.file, - 3000, - 3000, - "JPEG", - 75, - 0, - uri => { - let file = new File([uri], ev.file.name, {}); - file.uid = ev.file.uid; - // Split the filename to get the name and type - let fileName = file.name; - let fileType = file.type; - let key = `${shopId}/${jobId}/${fileName}`; - //URL is using the proxy set in pacakges.json. axios - .post("/sign_s3", { - fileName: key, - fileType - }) + .put(signedRequest, file, options) .then(response => { - var returnData = response.data.data.returnData; - var signedRequest = returnData.signedRequest; - var url = returnData.url; - setState({ ...state, url: url }); - // Put the fileType in the headers for the upload - var options = { - headers: { - "Content-Type": fileType - }, - onUploadProgress: e => { - onProgress({ percent: (e.loaded / e.total) * 100 }); - } - }; - - axios - .put(signedRequest, file, options) - .then(response => { - onSuccess(response.body); - insertNewDocument({ - variables: { - docInput: [ - { - jobid: jobId, - uploaded_by: "patrick@bodyshop.app", - url, - thumb_url: url - } - ] + onSuccess(response.body); + insertNewDocument({ + variables: { + docInput: [ + { + jobid: jobId, + uploaded_by: currentUser.email, + url, + thumb_url: generateCdnThumb(fileName), + key: fileName } - }).then(r => { - console.log(r); - notification["success"]({ - message: t("documents.successes.insert") - }); - }); - - setState({ ...state, success: true }); - }) - .catch(error => { - console.log("Error uploading to S3", error); - onError(error); - notification["error"]({ - message: t("documents.errors.insert") + JSON.stringify(error) - }); + ] + } + }).then(r => { + console.log(r); + notification["success"]({ + message: t("documents.successes.insert") }); + }); + + setState({ ...state, success: true }); }) .catch(error => { - console.log("Outside Error here.", error); + console.log("Error uploading to S3", error); + onError(error); notification["error"]({ - message: - t("documents.errors.getpresignurl") + JSON.stringify(error) + message: t("documents.errors.insert") + JSON.stringify(error) }); }); - }, - "blob" - ); + }) + .catch(error => { + console.log("Outside Error here.", error); + notification["error"]({ + message: t("documents.errors.getpresignurl") + JSON.stringify(error) + }); + }); }; + const handleUpload = ev => { + const { onError, onSuccess, onProgress } = ev; + //If PDF, upload directly. + //If JPEG, resize and upload. + let key = `${shopId}/${jobId}/${ev.file.name}`; + if (ev.file.type === "application/pdf") { + console.log("It's a PDF."); + uploadToS3(key, ev.file.type, ev.file, onError, onSuccess, onProgress); + } else { + Resizer.imageFileResizer( + ev.file, + 3000, + 3000, + "JPEG", + 75, + 0, + uri => { + let file = new File([uri], ev.file.name, {}); + file.uid = ev.file.uid; + uploadToS3(key, file.type, file, onError, onSuccess, onProgress); + }, + "blob" + ); + } + }; const handleCancel = () => setState({ ...state, previewVisible: false }); const handlePreview = async file => { @@ -136,38 +147,32 @@ function JobsDocumentsComponent({ shopId, jobId, loading, data }) { }; const handleChange = props => { const { fileList } = props; - console.log("New fileList", fileList); setFileList(fileList); }; const { previewVisible, previewImage } = state; - // const uploadButton = ( - //
- // - //
{t("documents.labels.upload")}
- //
- // ); - console.log( - "process.env.REACT_APP_S3_BUCKET", - process.env.REACT_APP_S3_BUCKET - ); - const imageRequest = JSON.stringify({ - bucket: process.env.REACT_APP_S3_BUCKET, - key: - "52b7357c-0edd-4c95-85c3-dfdbcdfad9ac/f11e92a4-8a7d-4ec0-86ac-2f46b631e438/thumb-1920-459857.jpg", - edits: { - resize: { - height: 100, - width: 100 - } - } - }); - const CloudFrontUrl = "https://d18fc493a0fm4o.cloudfront.net"; - const url = `${CloudFrontUrl}/${btoa(imageRequest)}`; - console.log("url", url); return (
+ ; - if (error) return ; - if (shopData.error) - return ; + const user = useQuery(GET_CURRENT_USER); + + if (loading || shopData.loading || user.loading) return ; + if (error || shopData.error || user.error) + return ( + + ); return ( diff --git a/client/src/utils/DocHelpers.js b/client/src/utils/DocHelpers.js new file mode 100644 index 000000000..be8d28632 --- /dev/null +++ b/client/src/utils/DocHelpers.js @@ -0,0 +1,13 @@ +export const generateCdnThumb = key => { + const imageRequest = JSON.stringify({ + bucket: process.env.REACT_APP_S3_BUCKET, + key: key, + edits: { + resize: { + height: 100, + width: 100 + } + } + }); + return `${process.env.REACT_APP_S3_CDN}/${btoa(imageRequest)}`; +}; From 066b9004095a2a5fbf5c4120972ae9e6f8a16c18 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 24 Jan 2020 12:52:13 -0800 Subject: [PATCH 06/23] Added document delete + refined document upload --- bodyshop_translations.babel | 42 ++++++++++ .../jobs-documents.component.jsx | 78 +++++++++++++++---- client/src/graphql/documents.queries.js | 15 ++++ client/src/translations/en_us/common.json | 2 + client/src/translations/es/common.json | 2 + client/src/translations/fr/common.json | 2 + s3upload.js | 22 ++++++ server.js | 7 +- 8 files changed, 152 insertions(+), 18 deletions(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 8c606e919..8b29804b6 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -24,6 +24,27 @@ errors + + deletes3 + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + getpresignurl false @@ -118,6 +139,27 @@ successes + + delete + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + insert false diff --git a/client/src/components/jobs-documents/jobs-documents.component.jsx b/client/src/components/jobs-documents/jobs-documents.component.jsx index d3a092682..1bbd68d12 100644 --- a/client/src/components/jobs-documents/jobs-documents.component.jsx +++ b/client/src/components/jobs-documents/jobs-documents.component.jsx @@ -4,7 +4,10 @@ import React, { useState } from "react"; import { useMutation } from "react-apollo"; import { useTranslation } from "react-i18next"; import Resizer from "react-image-file-resizer"; -import { INSERT_NEW_DOCUMENT } from "../../graphql/documents.queries"; +import { + INSERT_NEW_DOCUMENT, + DELETE_DOCUMENT +} from "../../graphql/documents.queries"; import "./jobs-documents.styles.scss"; import { generateCdnThumb } from "../../utils/DocHelpers"; @@ -20,6 +23,7 @@ function getBase64(file) { function JobsDocumentsComponent({ shopId, jobId, loading, data, currentUser }) { const { t } = useTranslation(); const [insertNewDocument] = useMutation(INSERT_NEW_DOCUMENT); + const [deleteDocument] = useMutation(DELETE_DOCUMENT); const [state, setState] = useState({ previewVisible: false, @@ -32,7 +36,9 @@ function JobsDocumentsComponent({ shopId, jobId, loading, data, currentUser }) { uid: value.id, url: value.thumb_url, name: value.name, - status: "done" + status: "done", + full_url: value.url, + key: value.key }); return acc; }, []) @@ -69,7 +75,7 @@ function JobsDocumentsComponent({ shopId, jobId, loading, data, currentUser }) { axios .put(signedRequest, file, options) .then(response => { - onSuccess(response.body); + console.log("response from axios", response); insertNewDocument({ variables: { docInput: [ @@ -83,7 +89,14 @@ function JobsDocumentsComponent({ shopId, jobId, loading, data, currentUser }) { ] } }).then(r => { - console.log(r); + onSuccess({ + uid: r.data.insert_documents.returning[0].id, + url: r.data.insert_documents.returning[0].thumb_url, + name: r.data.insert_documents.returning[0].name, + status: "done", + full_url: r.data.insert_documents.returning[0].url, + key: r.data.insert_documents.returning[0].key + }); notification["success"]({ message: t("documents.successes.insert") }); @@ -135,23 +148,62 @@ function JobsDocumentsComponent({ shopId, jobId, loading, data, currentUser }) { const handleCancel = () => setState({ ...state, previewVisible: false }); const handlePreview = async file => { - if (!file.url && !file.preview) { + if (!file.full_url && !file.url) { file.preview = await getBase64(file.originFileObj); } setState({ ...state, - previewImage: file.url || file.preview, + previewImage: file.full_url || file.url, previewVisible: true }); }; const handleChange = props => { - const { fileList } = props; - setFileList(fileList); + const { event, fileList, file } = props; + //Required to ensure that the state accurately reflects new data and that images can be deleted in feeded. + if (!event) { + //SPread the new file in where the old one was. + const newFileList = fileList.map(i => + i.uid === file.uid ? Object.assign({}, i, file.response) : i + ); + setFileList(newFileList); + } else { + setFileList(fileList); + } }; const { previewVisible, previewImage } = state; + const handleRemove = file => { + console.log("file", file); + + //Remove the file on S3 + axios + .post("/delete_s3", { fileName: file.key }) + .then(response => { + //Delete the record in our database. + if (response.status === 200) { + deleteDocument({ variables: { id: file.uid } }).then(r => { + notification["success"]({ + message: t("documents.successes.delete") + }); + }); + } else { + notification["error"]({ + message: + 1 + + t("documents.errors.deletes3") + + JSON.stringify(response.message) + }); + } + }) + .catch(error => { + notification["error"]({ + message: "2" + t("documents.errors.deletes3") + JSON.stringify(error) + }); + }); + }; + return (

diff --git a/client/src/graphql/documents.queries.js b/client/src/graphql/documents.queries.js index 5a2cc937d..58c22a411 100644 --- a/client/src/graphql/documents.queries.js +++ b/client/src/graphql/documents.queries.js @@ -7,6 +7,7 @@ export const GET_DOCUMENTS_BY_JOB = gql` url thumb_url name + key } } `; @@ -14,6 +15,20 @@ export const GET_DOCUMENTS_BY_JOB = gql` export const INSERT_NEW_DOCUMENT = gql` mutation INSERT_NEW_DOCUMENT($docInput: [documents_insert_input!]!) { insert_documents(objects: $docInput) { + returning { + id + url + thumb_url + name + key + } + } + } +`; + +export const DELETE_DOCUMENT = gql` + mutation DELETE_DOCUMENT($id: uuid) { + delete_documents(where: { id: { _eq: $id } }) { returning { id } diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 7a6db6841..a657b41eb 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -2,6 +2,7 @@ "translation": { "documents": { "errors": { + "deletes3": "Error deleting document from storage. ", "getpresignurl": "Error obtaining presigned URL for document. ", "insert": "Unable to upload file.", "nodocuments": "There are no documents." @@ -10,6 +11,7 @@ "upload": "Upload" }, "successes": { + "delete": "Document deleted successfully.", "insert": "Uploaded document successfully. " } }, diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index fda17bd90..c102ca788 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -2,6 +2,7 @@ "translation": { "documents": { "errors": { + "deletes3": "Error al eliminar el documento del almacenamiento.", "getpresignurl": "Error al obtener la URL prescrita para el documento.", "insert": "Incapaz de cargar el archivo.", "nodocuments": "No hay documentos" @@ -10,6 +11,7 @@ "upload": "Subir" }, "successes": { + "delete": "Documento eliminado con éxito.", "insert": "Documento cargado con éxito." } }, diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 53926ea54..bca75b8ae 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -2,6 +2,7 @@ "translation": { "documents": { "errors": { + "deletes3": "Erreur lors de la suppression du document du stockage.", "getpresignurl": "Erreur lors de l'obtention de l'URL présignée pour le document.", "insert": "Incapable de télécharger le fichier.", "nodocuments": "Il n'y a pas de documents." @@ -10,6 +11,7 @@ "upload": "Télécharger" }, "successes": { + "delete": "Le document a bien été supprimé.", "insert": "Document téléchargé avec succès." } }, diff --git a/s3upload.js b/s3upload.js index c5e5ad221..1091873b2 100644 --- a/s3upload.js +++ b/s3upload.js @@ -71,3 +71,25 @@ exports.get_s3 = (req, res) => { res.json({ success: true, data: { returnData } }); }); }; + +exports.delete_s3 = (req, res) => { + const s3 = new aws.S3(); // Create a new instance of S3 + const fileName = req.body.fileName; + //const fileType = req.body.fileType; + // Set up the payload of what we are sending to the S3 api + console.log("fileName", req.body); + const s3Params = { + Bucket: S3_BUCKET, + Key: fileName + }; + + s3.deleteObject(s3Params, function(err, data) { + if (err) { + res.json({ success: false, message: err.message }); + } + // error + else { + res.json({ success: true, data }); + } // deleted + }); +}; diff --git a/server.js b/server.js index 2648a0659..7acc0a49d 100644 --- a/server.js +++ b/server.js @@ -21,10 +21,11 @@ app.use(cors()); var s3upload = require("./s3upload"); app.post("/sign_s3", s3upload.sign_s3); app.get("/sign_s3", s3upload.get_s3); +app.post("/delete_s3", s3upload.delete_s3); -app.get("/test", function(req, res) { - res.json({ success: true }); -}); +// app.get("/test", function(req, res) { +// res.json({ success: true }); +// }); if (process.env.NODE_ENV === "production") { app.use(express.static(path.join(__dirname, "client/build"))); From 5ed1c55458833942c1678158fb83434925c2b022 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 24 Jan 2020 13:22:22 -0800 Subject: [PATCH 07/23] Added delay to app load to ensure firebase connection established. --- client/src/App/App.container.jsx | 1 - client/src/App/App.js | 13 ++++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/client/src/App/App.container.jsx b/client/src/App/App.container.jsx index 15eb73548..b9d91afa1 100644 --- a/client/src/App/App.container.jsx +++ b/client/src/App/App.container.jsx @@ -109,7 +109,6 @@ class AppContainer extends Component { }); try { - // See above for additional options, including other storage providers. await persistCache({ cache, storage: window.sessionStorage, diff --git a/client/src/App/App.js b/client/src/App/App.js index 3fa93e5d1..8ff98d835 100644 --- a/client/src/App/App.js +++ b/client/src/App/App.js @@ -1,4 +1,4 @@ -import React, { useEffect, Suspense, lazy } from "react"; +import React, { useEffect, Suspense, lazy, useState } from "react"; import { useApolloClient, useQuery } from "@apollo/react-hooks"; import { Switch, Route, Redirect } from "react-router-dom"; import firebase from "../firebase/firebase.utils"; @@ -26,11 +26,12 @@ const Unauthorized = lazy(() => export default () => { const apolloClient = useApolloClient(); - + const [loaded, setloaded] = useState(false); useEffect(() => { //Run the auth code only on the first render. const unsubscribeFromAuth = auth.onAuthStateChanged(async user => { - console.log("Auth State Changed.") + console.log("Auth State Changed."); + setloaded(true); if (user) { let token; token = await user.getIdToken(); @@ -87,16 +88,18 @@ export default () => { unsubscribeFromAuth(); }; }, [apolloClient]); - const HookCurrentUser = useQuery(GET_CURRENT_USER); + + if (!loaded) return ; if (HookCurrentUser.loading) return ; if (HookCurrentUser.error) return ; + return (

- TODO: Suspense Loading
}> + }> Date: Fri, 24 Jan 2020 16:35:29 -0800 Subject: [PATCH 08/23] Added rates containers + cached language selection --- client/src/App/App.js | 21 ++++++++++++--- .../current-user-dropdown.component.jsx | 5 ++-- .../jobs-list/jobs-list.component.jsx | 19 +++++++++---- .../jobs-rates/jobs-rates.component.jsx | 5 ++++ .../jobs-rates/jobs-rates.container.jsx | 6 +++++ .../langauge-selector.component.jsx | 27 ------------------- client/src/graphql/initial-state.js | 3 ++- client/src/graphql/jobs.queries.js | 4 +-- client/src/graphql/local.queries.js | 22 +++------------ .../pages/jobs-detail/jobs-detail.page.jsx | 3 ++- client/src/pages/jobs/jobs.page.jsx | 6 ++--- 11 files changed, 57 insertions(+), 64 deletions(-) create mode 100644 client/src/components/jobs-rates/jobs-rates.component.jsx create mode 100644 client/src/components/jobs-rates/jobs-rates.container.jsx delete mode 100644 client/src/components/language-selector/langauge-selector.component.jsx diff --git a/client/src/App/App.js b/client/src/App/App.js index 8ff98d835..5ff998489 100644 --- a/client/src/App/App.js +++ b/client/src/App/App.js @@ -2,6 +2,7 @@ import React, { useEffect, Suspense, lazy, useState } from "react"; import { useApolloClient, useQuery } from "@apollo/react-hooks"; import { Switch, Route, Redirect } from "react-router-dom"; import firebase from "../firebase/firebase.utils"; +import i18next from "i18next"; import "./App.css"; @@ -12,7 +13,7 @@ import ErrorBoundary from "../components/error-boundary/error-boundary.component import { auth } from "../firebase/firebase.utils"; import { UPSERT_USER } from "../graphql/user.queries"; -import { GET_CURRENT_USER } from "../graphql/local.queries"; +import { GET_CURRENT_USER, GET_LANGUAGE } from "../graphql/local.queries"; // import { QUERY_BODYSHOP } from "../graphql/bodyshop.queries"; import PrivateRoute from "../utils/private-route"; @@ -89,11 +90,23 @@ export default () => { }; }, [apolloClient]); const HookCurrentUser = useQuery(GET_CURRENT_USER); + const HookLanguage = useQuery(GET_LANGUAGE); if (!loaded) return ; - if (HookCurrentUser.loading) return ; - if (HookCurrentUser.error) - return ; + if (HookCurrentUser.loading || HookLanguage.loading) + return ; + if (HookCurrentUser.error || HookLanguage.error) + return ( + + ); + + if (HookLanguage.data.language) + i18next.changeLanguage(HookLanguage.data.language, (err, t) => { + if (err) + return console.log("Error encountered when changing languages.", err); + }); return (
diff --git a/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx b/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx index 177a1cb97..d2bb617b3 100644 --- a/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx +++ b/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx @@ -1,4 +1,4 @@ -import { useQuery } from "@apollo/react-hooks"; +import { useQuery, useApolloClient } from "@apollo/react-hooks"; import { Avatar, Col, Dropdown, Icon, Menu, Row } from "antd"; import i18next from "i18next"; import React from "react"; @@ -12,13 +12,14 @@ import SignOut from "../sign-out/sign-out.component"; export default function CurrentUserDropdown() { const { t } = useTranslation(); const { loading, error, data } = useQuery(GET_CURRENT_USER); + const client = useApolloClient(); const handleMenuClick = e => { - console.log("e", e); if (e.item.props.actiontype === "lang-select") { i18next.changeLanguage(e.key, (err, t) => { if (err) return console.log("Error encountered when changing languages.", err); + client.writeData({ data: { language: e.key } }); }); } }; diff --git a/client/src/components/jobs-list/jobs-list.component.jsx b/client/src/components/jobs-list/jobs-list.component.jsx index f92279eee..17635845d 100644 --- a/client/src/components/jobs-list/jobs-list.component.jsx +++ b/client/src/components/jobs-list/jobs-list.component.jsx @@ -25,6 +25,7 @@ export default withRouter(function JobsList({ title: t("jobs.fields.ro_number"), dataIndex: "ro_number", key: "ro_number", + width: "8%", // onFilter: (value, record) => record.ro_number.includes(value), // filteredValue: state.filteredInfo.text || null, sorter: (a, b) => alphaSort(a, b), @@ -45,6 +46,7 @@ export default withRouter(function JobsList({ key: "owner", ellipsis: true, sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln), + width: "25%", sortOrder: state.sortedInfo.columnKey === "owner" && state.sortedInfo.order, render: (text, record) => { @@ -64,6 +66,7 @@ export default withRouter(function JobsList({ title: t("jobs.fields.phone1"), dataIndex: "ownr_ph1", key: "ownr_ph1", + width: "12%", ellipsis: true, render: (text, record) => { return record.ownr_ph1 ? ( @@ -86,6 +89,7 @@ export default withRouter(function JobsList({ title: t("jobs.fields.status"), dataIndex: "status", key: "status", + width: "10%", ellipsis: true, sorter: (a, b) => alphaSort(a, b), sortOrder: @@ -99,6 +103,7 @@ export default withRouter(function JobsList({ title: t("jobs.fields.vehicle"), dataIndex: "vehicle", key: "vehicle", + width: "15%", ellipsis: true, render: (text, record) => { return record.vehicle ? ( @@ -115,6 +120,7 @@ export default withRouter(function JobsList({ title: t("vehicles.fields.plate_no"), dataIndex: "plate_no", key: "plate_no", + width: "8%", ellipsis: true, sorter: (a, b) => alphaSort(a, b), sortOrder: @@ -131,6 +137,7 @@ export default withRouter(function JobsList({ title: t("jobs.fields.clm_no"), dataIndex: "clm_no", key: "clm_no", + width: "12%", ellipsis: true, sorter: (a, b) => alphaSort(a, b), sortOrder: @@ -147,11 +154,12 @@ export default withRouter(function JobsList({ title: t("jobs.fields.clm_total"), dataIndex: "clm_total", key: "clm_total", - sorter: (a, b) => { - return a > b; - }, - sortOrder: - state.sortedInfo.columnKey === "clm_total" && state.sortedInfo.order, + width: "8%", + // sorter: (a, b) => { + // return a > b; + // }, + // sortOrder: + // state.sortedInfo.columnKey === "clm_total" && state.sortedInfo.order, render: (text, record) => { return record.clm_total ? ( {record.clm_total} @@ -164,6 +172,7 @@ export default withRouter(function JobsList({ title: t("jobs.fields.owner_owing"), dataIndex: "owner_owing", key: "owner_owing", + width: "8%", render: (text, record) => { return record.owner_owing ? ( {record.owner_owing} diff --git a/client/src/components/jobs-rates/jobs-rates.component.jsx b/client/src/components/jobs-rates/jobs-rates.component.jsx new file mode 100644 index 000000000..338a8eb9e --- /dev/null +++ b/client/src/components/jobs-rates/jobs-rates.component.jsx @@ -0,0 +1,5 @@ +import React from "react"; + +export default function JobsRatesComponent() { + return
Jobs Rates Comp
; +} diff --git a/client/src/components/jobs-rates/jobs-rates.container.jsx b/client/src/components/jobs-rates/jobs-rates.container.jsx new file mode 100644 index 000000000..c952d752a --- /dev/null +++ b/client/src/components/jobs-rates/jobs-rates.container.jsx @@ -0,0 +1,6 @@ +import React from "react"; +import JobsRatesComponent from "./jobs-rates.component"; + +export default function JobsRatesContainer() { + return ; +} diff --git a/client/src/components/language-selector/langauge-selector.component.jsx b/client/src/components/language-selector/langauge-selector.component.jsx deleted file mode 100644 index 177c51d4f..000000000 --- a/client/src/components/language-selector/langauge-selector.component.jsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from "react"; -import { useTranslation } from "react-i18next"; -import i18next from "i18next"; -import { Dropdown, Menu, Icon } from "antd"; - -export default function LanguageSelector() { - const { t } = useTranslation(); - - const handleMenuClick = e => { - i18next.changeLanguage(e.key, (err, t) => { - if (err) - return console.log("Error encountered when changing languages.", err); - }); - }; - const menu = ( - - {t("general.languages.english")} - {t("general.languages.french")} - {t("general.languages.spanish")} - - ); - return ( - - - - ); -} diff --git a/client/src/graphql/initial-state.js b/client/src/graphql/initial-state.js index 671221c8b..fc69d4836 100644 --- a/client/src/graphql/initial-state.js +++ b/client/src/graphql/initial-state.js @@ -3,5 +3,6 @@ export default { currentUser: null, selectedNavItem: "Home", recentItems: [], - bodyShopData: null + bodyShopData: null, + language: "en_us" }; diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index c74240b52..c70285e9b 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -27,8 +27,8 @@ export const GET_ALL_OPEN_JOBS = gql` } `; -export const SUBSCRIPTION_ALL_OPEN_JOBS = gql` - subscription SUBSCRIPTION_ALL_OPEN_JOBS { +export const QUERY_ALL_OPEN_JOBS = gql` + query QUERY_ALL_OPEN_JOBS { jobs { ownr_fn ownr_ln diff --git a/client/src/graphql/local.queries.js b/client/src/graphql/local.queries.js index 88ae13c4f..7611dfd32 100644 --- a/client/src/graphql/local.queries.js +++ b/client/src/graphql/local.queries.js @@ -1,13 +1,5 @@ import { gql } from "apollo-boost"; -export const SET_CURRENT_USER = gql` - mutation SetCurrentUser($user: User!) { - setCurrentUser(user: $user) @client { - email - } - } -`; - export const GET_CURRENT_USER = gql` query GET_CURRENT_USER { currentUser @client { @@ -26,16 +18,8 @@ export const GET_CURRENT_SELECTED_NAV_ITEM = gql` } `; -export const GET_WHITE_BOARD_LEFT_SIDER_VISIBLE = gql` - { - whiteBoardLeftSiderVisible @client - } -`; - -export const GET_BODYSHOP = gql` - query LOCAL_GET_BODY_SHOP { - bodyShopData @client { - shopname - } +export const GET_LANGUAGE = gql` + query GET_USER_LANGUAGE { + language @client } `; diff --git a/client/src/pages/jobs-detail/jobs-detail.page.jsx b/client/src/pages/jobs-detail/jobs-detail.page.jsx index a87c8f93e..ecc689b03 100644 --- a/client/src/pages/jobs-detail/jobs-detail.page.jsx +++ b/client/src/pages/jobs-detail/jobs-detail.page.jsx @@ -7,6 +7,7 @@ import JobLinesContainer from "../../components/job-lines/job-lines.container.co import JobTombstone from "../../components/job-tombstone/job-tombstone.component"; import JobsDocumentsContainer from "../../components/jobs-documents/jobs-documents.container"; import JobNotesContainer from "../../components/jobs-notes/jobs-notes.container"; +import JobsRatesContainer from "../../components/jobs-rates/jobs-rates.container"; function JobsDetailPage({ jobId, hash, data, match, history }) { const { t } = useTranslation(); @@ -39,7 +40,7 @@ function JobsDetailPage({ jobId, hash, data, match, history }) { } key='#rates'> - Estimate Rates + Date: Sat, 25 Jan 2020 09:33:17 -0800 Subject: [PATCH 09/23] Adding chat window. --- client/src/App/App.css | 28 ++++++++++++++++++- .../chat-window/chat-window.component.jsx | 5 ++++ .../chat-window/chat-window.container.jsx | 18 ++++++++++++ .../components/footer/footer.component.jsx | 5 ++-- client/src/pages/manage/manage.page.jsx | 12 ++++---- 5 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 client/src/components/chat-window/chat-window.component.jsx create mode 100644 client/src/components/chat-window/chat-window.container.jsx diff --git a/client/src/App/App.css b/client/src/App/App.css index 3cb918ee2..a4b0e7a43 100644 --- a/client/src/App/App.css +++ b/client/src/App/App.css @@ -1 +1,27 @@ -@import '~antd/dist/antd.css'; \ No newline at end of file +@import "~antd/dist/antd.css"; + +.ant-layout-header { + position: absolute; + top: 0px; + left: 0px; + height: 5vh; + right: 0px; + overflow: hidden; +} +.ant-layout-content { + position: absolute; + top: 5vh; + bottom: 3vh; + left: 0px; + right: 0px; + overflow: auto; +} + +.ant-layout-footer { + position: absolute; + bottom: 0px; + height: 3vh; + left: 0px; + right: 0px; + overflow: hidden; +} diff --git a/client/src/components/chat-window/chat-window.component.jsx b/client/src/components/chat-window/chat-window.component.jsx new file mode 100644 index 000000000..e4fd51848 --- /dev/null +++ b/client/src/components/chat-window/chat-window.component.jsx @@ -0,0 +1,5 @@ +import React from "react"; + +export default function ChatWindowComponent() { + return
Chat Windows and more
; +} diff --git a/client/src/components/chat-window/chat-window.container.jsx b/client/src/components/chat-window/chat-window.container.jsx new file mode 100644 index 000000000..cd70e1060 --- /dev/null +++ b/client/src/components/chat-window/chat-window.container.jsx @@ -0,0 +1,18 @@ +import React, { useState } from "react"; +import ChatWindowComponent from "./chat-window.component"; +import { Button } from "antd"; + +export default function ChatWindowContainer() { + const [visible, setVisible] = useState(false); + return ( +
+ {visible ? : null} + +
+ ); +} diff --git a/client/src/components/footer/footer.component.jsx b/client/src/components/footer/footer.component.jsx index 36532e88d..9061616ef 100644 --- a/client/src/components/footer/footer.component.jsx +++ b/client/src/components/footer/footer.component.jsx @@ -1,5 +1,6 @@ -import React from "react"; -import { Row, Col } from "antd"; +import React, { useState } from "react"; +import { Row, Col, Button } from "antd"; +import ChatWindowContainer from "../chat-window/chat-window.container"; export default function FooterComponent() { return ( diff --git a/client/src/pages/manage/manage.page.jsx b/client/src/pages/manage/manage.page.jsx index 56f4e47f0..9e450f058 100644 --- a/client/src/pages/manage/manage.page.jsx +++ b/client/src/pages/manage/manage.page.jsx @@ -8,18 +8,19 @@ import HeaderContainer from "../../components/header/header.container"; import FooterComponent from "../../components/footer/footer.component"; import ErrorBoundary from "../../components/error-boundary/error-boundary.component"; -import './manage.page.styles.scss' +import "./manage.page.styles.scss"; +import ChatWindowContainer from "../../components/chat-window/chat-window.container"; const WhiteBoardPage = lazy(() => import("../white-board/white-board.page")); const JobsPage = lazy(() => import("../jobs/jobs.page")); -const JobsDetailPage = lazy(() => import("../jobs-detail/jobs-detail.page.container")); +const JobsDetailPage = lazy(() => + import("../jobs-detail/jobs-detail.page.container") +); const ProfilePage = lazy(() => import("../profile/profile.container.page")); const JobsDocumentsPage = lazy(() => import("../../components/jobs-documents/jobs-documents.container") ); - - const { Header, Content, Footer } = Layout; //This page will handle all routing for the entire application. export default function Manage({ match }) { @@ -35,7 +36,7 @@ export default function Manage({ match }) { - + TODO: Suspended Loading in Manage Page...
}> @@ -62,6 +63,7 @@ export default function Manage({ match }) {
+
From b5e9c65aee6b83d44cdcd0068d844bd0420b818b Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 27 Jan 2020 16:20:33 -0800 Subject: [PATCH 10/23] Complete refactor of jobs detail screen. --- bodyshop_translations.babel | 327 +++++++++++++++++- client/src/App/App.css | 4 +- .../current-user-dropdown.component.jsx | 10 +- .../components/footer/footer.component.jsx | 5 +- .../components/header/header.component.jsx | 53 ++- .../job-lines.container.component.jsx | 3 +- .../job-tombstone/job-tombstone.component.jsx | 217 ------------ .../jobs-detail-header.component.jsx | 117 +++++++ .../note-upsert-modal.container.jsx | 4 +- client/src/graphql/jobs.queries.js | 54 +-- .../jobs-available.page.component.jsx | 9 + .../jobs-available.page.container.jsx | 10 + .../jobs-detail.page.component.jsx | 181 ++++++++++ .../jobs-detail.page.container.jsx | 77 ++++- .../pages/jobs-detail/jobs-detail.page.jsx | 80 ----- client/src/pages/manage/manage.page.jsx | 10 + client/src/translations/en_us/common.json | 21 +- client/src/translations/es/common.json | 21 +- client/src/translations/fr/common.json | 21 +- client/src/utils/CurrencyFormatter.jsx | 13 + .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 212 ++++++++++++ .../up.yaml | 213 ++++++++++++ .../down.yaml | 210 +++++++++++ .../up.yaml | 211 +++++++++++ .../down.yaml | 212 ++++++++++++ .../up.yaml | 213 ++++++++++++ .../down.yaml | 6 + .../up.yaml | 6 + .../down.yaml | 3 + .../up.yaml | 4 + .../down.yaml | 213 ++++++++++++ .../up.yaml | 214 ++++++++++++ .../down.yaml | 211 +++++++++++ .../up.yaml | 212 ++++++++++++ .../down.yaml | 213 ++++++++++++ .../up.yaml | 214 ++++++++++++ 38 files changed, 3409 insertions(+), 401 deletions(-) delete mode 100644 client/src/components/job-tombstone/job-tombstone.component.jsx create mode 100644 client/src/components/jobs-detail-header/jobs-detail-header.component.jsx create mode 100644 client/src/pages/jobs-available/jobs-available.page.component.jsx create mode 100644 client/src/pages/jobs-available/jobs-available.page.container.jsx create mode 100644 client/src/pages/jobs-detail/jobs-detail.page.component.jsx delete mode 100644 client/src/pages/jobs-detail/jobs-detail.page.jsx create mode 100644 client/src/utils/CurrencyFormatter.jsx create mode 100644 hasura/migrations/1580169338033_alter_table_public_jobs_add_column_service_Car/down.yaml create mode 100644 hasura/migrations/1580169338033_alter_table_public_jobs_add_column_service_Car/up.yaml create mode 100644 hasura/migrations/1580169357455_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580169357455_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1580169365397_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580169365397_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1580169373151_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580169373151_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1580169467694_alter_table_public_jobs_alter_column_service_Car/down.yaml create mode 100644 hasura/migrations/1580169467694_alter_table_public_jobs_alter_column_service_Car/up.yaml create mode 100644 hasura/migrations/1580169565651_alter_table_public_jobs_add_column_special_coverage_policy/down.yaml create mode 100644 hasura/migrations/1580169565651_alter_table_public_jobs_add_column_special_coverage_policy/up.yaml create mode 100644 hasura/migrations/1580169609143_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580169609143_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1580169617954_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580169617954_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1580169626079_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580169626079_update_permission_user_public_table_jobs/up.yaml diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 8b29804b6..ee4afc6cf 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -804,6 +804,27 @@ + + customerowing + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + date_closed false @@ -1077,6 +1098,27 @@ + + repairtotal + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + ro_number false @@ -1161,6 +1203,48 @@ + + servicecar + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + specialcoveragepolicy + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + status false @@ -1713,6 +1797,247 @@ + + header + + + activejobs + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + availablejobs + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + home + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + jobs + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + + + jobsdetail + + + claimdetail + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + dates + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + financials + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + insurance + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + labor + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + partssublet + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + repairdata + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + profilesidebar @@ -1994,7 +2319,7 @@ successes - created + create false diff --git a/client/src/App/App.css b/client/src/App/App.css index a4b0e7a43..e497f630b 100644 --- a/client/src/App/App.css +++ b/client/src/App/App.css @@ -1,6 +1,6 @@ @import "~antd/dist/antd.css"; -.ant-layout-header { +/* .ant-layout-header { position: absolute; top: 0px; left: 0px; @@ -24,4 +24,4 @@ left: 0px; right: 0px; overflow: hidden; -} +} */ diff --git a/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx b/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx index d2bb617b3..5f23bca64 100644 --- a/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx +++ b/client/src/components/current-user-dropdown/current-user-dropdown.component.jsx @@ -1,4 +1,4 @@ -import { useQuery, useApolloClient } from "@apollo/react-hooks"; +import { useApolloClient, useQuery } from "@apollo/react-hooks"; import { Avatar, Col, Dropdown, Icon, Menu, Row } from "antd"; import i18next from "i18next"; import React from "react"; @@ -52,7 +52,7 @@ export default function CurrentUserDropdown() { ); if (loading) return null; - if (error) return ; + if (error) return ; const { currentUser } = data; @@ -62,10 +62,8 @@ export default function CurrentUserDropdown() { - - - {currentUser?.displayName || t("general.labels.unknown")} - + + {currentUser.displayName || t("general.labels.unknown")} diff --git a/client/src/components/footer/footer.component.jsx b/client/src/components/footer/footer.component.jsx index 9061616ef..a8be82b23 100644 --- a/client/src/components/footer/footer.component.jsx +++ b/client/src/components/footer/footer.component.jsx @@ -1,6 +1,5 @@ -import React, { useState } from "react"; -import { Row, Col, Button } from "antd"; -import ChatWindowContainer from "../chat-window/chat-window.container"; +import { Col, Row } from "antd"; +import React from "react"; export default function FooterComponent() { return ( diff --git a/client/src/components/header/header.component.jsx b/client/src/components/header/header.component.jsx index d5f942178..217977bee 100644 --- a/client/src/components/header/header.component.jsx +++ b/client/src/components/header/header.component.jsx @@ -1,44 +1,65 @@ import { useApolloClient } from "@apollo/react-hooks"; import { Col, Icon, Menu, Row } from "antd"; import React from "react"; +import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; import CurrentUserDropdown from "../current-user-dropdown/current-user-dropdown.component"; import GlobalSearch from "../global-search/global-search.component"; import ManageSignInButton from "../manage-sign-in-button/manage-sign-in-button.component"; import "./header.styles.scss"; - export default ({ landingHeader, navItems, selectedNavItem }) => { const apolloClient = useApolloClient(); - + const { t } = useTranslation(); const handleClick = e => { apolloClient.writeData({ data: { selectedNavItem: e.key } }); }; return ( - + + mode='horizontal'> - {navItems.map(navItem => ( - - - {navItem.icontype ? : null} - {navItem.title} + + + + + {t("menus.header.home")} + + + + + + + {t("menus.header.activejobs")} - ))} + + + + {t("menus.header.availablejobs")} + + + - {!landingHeader ? ( - null - ) : ( + { + // navItems.map(navItem => ( + // + // + // {navItem.icontype ? : null} + // {navItem.title} + // + // + // )) + } + + {!landingHeader ? null : ( diff --git a/client/src/components/job-lines/job-lines.container.component.jsx b/client/src/components/job-lines/job-lines.container.component.jsx index c5f4a994a..70e74c7c5 100644 --- a/client/src/components/job-lines/job-lines.container.component.jsx +++ b/client/src/components/job-lines/job-lines.container.component.jsx @@ -5,8 +5,7 @@ import AlertComponent from "../../components/alert/alert.component"; import { GET_JOB_LINES_BY_PK } from "../../graphql/jobs-lines.queries"; -export default function JobLinesContainer({ match }) { - const { jobId } = match.params; +export default function JobLinesContainer({ jobId }) { const { loading, error, data } = useQuery(GET_JOB_LINES_BY_PK, { variables: { id: jobId }, diff --git a/client/src/components/job-tombstone/job-tombstone.component.jsx b/client/src/components/job-tombstone/job-tombstone.component.jsx deleted file mode 100644 index 0bb478743..000000000 --- a/client/src/components/job-tombstone/job-tombstone.component.jsx +++ /dev/null @@ -1,217 +0,0 @@ -import React, { useState } from "react"; -import { Link } from "react-router-dom"; -import AlertComponent from "../alert/alert.component"; -import { - Form, - Input, - Row, - Col, - Button, - Typography, - PageHeader, - Descriptions, - Tag, - notification, - Avatar, - Layout -} from "antd"; -import { UPDATE_JOB, CONVERT_JOB_TO_RO } from "../../graphql/jobs.queries"; -import { useMutation } from "@apollo/react-hooks"; -import FormItemPhone from "../form-items-formatted/phone-form-item.component"; -import { useTranslation } from "react-i18next"; -import CarImage from "../../assets/car.svg"; - -const { Content } = Layout; -const formItemLayout = { - // labelCol: { - // xs: { span: 12 }, - // sm: { span: 5 } - // }, - // wrapperCol: { - // xs: { span: 24 }, - // sm: { span: 12 } - // } -}; - -function JobTombstone({ job, ...otherProps }) { - const [jobContext, setJobContext] = useState(job); - const [mutationUpdateJob] = useMutation(UPDATE_JOB); - const [mutationConvertJob] = useMutation(CONVERT_JOB_TO_RO); - const { t } = useTranslation(); - - if (!job) { - return ; - } - - const handleSubmit = e => { - e.preventDefault(); - - otherProps.form.validateFieldsAndScroll((err, values) => { - if (err) { - notification["error"]({ - message: t("jobs.errors.validationtitle"), - description: t("jobs.errors.validation") - }); - } - if (!err) { - mutationUpdateJob({ - variables: { jobId: jobContext.id, job: values } - }).then(r => - notification["success"]({ - message: t("jobs.successes.savetitle") - }) - ); - } - }); - }; - - const handleChange = event => { - const { name, value } = event.target ? event.target : event; - setJobContext({ ...jobContext, [name]: value }); - }; - - const { getFieldDecorator } = otherProps.form; - - const tombstoneTitle = ( -
- - {`${t("jobs.fields.ro_number")} ${ - jobContext.ro_number ? jobContext.ro_number : t("general.labels.na") - }`} -
- ); - - return ( - -
- - {jobContext.job_status ? ( - {jobContext.job_status.name} - ) : null} - - } - extra={[ - , - - ]}> - - - - {jobContext.vehicle?.v_model_yr || t("general.labels.na")}{" "} - {jobContext.vehicle?.v_make_desc || t("general.labels.na")}{" "} - {jobContext.vehicle?.v_model_desc || t("general.labels.na")} |{" "} - {jobContext.vehicle?.plate_no || t("general.labels.na")} - - - - - {jobContext.est_number} - - - - $ {jobContext.claim_total?.toFixed(2)} - - - - $ {jobContext.deductible?.toFixed(2)} - - - - - - Information - { - // - // {getFieldDecorator("est_number", { - // initialValue: jobContext.est_number - // })()} - // - } - - - - Insurance Information - - {getFieldDecorator("est_co_nm", { - initialValue: jobContext.est_co_nm - })()} - - - - {getFieldDecorator("est_ct_ln", { - initialValue: jobContext.est_ct_ln - })()} - - - {getFieldDecorator("est_ct_fn", { - initialValue: jobContext.est_ct_fn - })()} - - - - - {getFieldDecorator("est_ph1", { - initialValue: jobContext.est_ph1 - })( - - )} - - - {getFieldDecorator("est_ea", { - initialValue: jobContext.est_ea, - rules: [ - { - type: "email", - message: "This is not a valid email address." - } - ] - })()} - - - -
-
- ); -} - -export default Form.create({ name: "JobTombstone" })(JobTombstone); diff --git a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx new file mode 100644 index 000000000..82d420c6c --- /dev/null +++ b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx @@ -0,0 +1,117 @@ +import { + Avatar, + Button, + Descriptions, + notification, + PageHeader, + Tag, + Input, + Form, + Checkbox +} from "antd"; +import React from "react"; +import { useTranslation } from "react-i18next"; +import Moment from "react-moment"; +import { Link } from "react-router-dom"; +import CarImage from "../../assets/car.svg"; +import CurrencyFormatter from "../../utils/CurrencyFormatter"; + +export default function JobsDetailHeader({ + job, + mutationConvertJob, + refetch, + getFieldDecorator +}) { + const { t } = useTranslation(); + + const tombstoneTitle = ( +
+ + {`${t("jobs.fields.ro_number")} ${ + job.ro_number ? job.ro_number : t("general.labels.na") + }`} +
+ ); + + const tombstoneSubtitle = ( +
+ {job.owner + ? (job.owner.first_name || "") + " " + (job.owner.last_name || "") + : t("jobs.errors.noowner")} + + {job.vehicle ? ( + + {job.vehicle.v_model_yr || t("general.labels.na")}{" "} + {job.vehicle.v_make_desc || t("general.labels.na")}{" "} + {job.vehicle.v_model_desc || t("general.labels.na")} |{" "} + {job.vehicle.plate_no || t("general.labels.na")} |{" "} + {job.vehicle.v_vin || t("general.labels.na")} + + ) : null} +
+ ); + + const menuExtra = [ + , + + ]; + + return ( + + {job.job_status ? ( + {job.job_status.name} + ) : null} + + } + extra={menuExtra}> + + + {job.claim_total} + + + + $NO BINDING YET + + + + + + + + {job.scheduled_completion ? ( + {job.scheduled_completion} + ) : null} + + + + {job.service_car} + + + + ); +} diff --git a/client/src/components/note-upsert-modal/note-upsert-modal.container.jsx b/client/src/components/note-upsert-modal/note-upsert-modal.container.jsx index 79287a033..ba7e46422 100644 --- a/client/src/components/note-upsert-modal/note-upsert-modal.container.jsx +++ b/client/src/components/note-upsert-modal/note-upsert-modal.container.jsx @@ -37,12 +37,12 @@ export default function NoteUpsertModalContainer({ ] } }).then(r => { + refetch(); + changeVisibility(!visible); notification["success"]({ message: t("notes.successes.create") }); }); - refetch(); - changeVisibility(!visible); }; const updateExistingNote = () => { diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index c70285e9b..33f56e24b 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -1,32 +1,5 @@ import { gql } from "apollo-boost"; -export const GET_ALL_OPEN_JOBS = gql` - query GET_ALL_OPEN_JOBS { - jobs { - id - est_number - ro_number - job_status { - id - name - } - scheduled_completion - scheduled_delivery - vehicle { - id - v_model_yr - v_make_desc - v_model_desc - plate_no - } - owner { - first_name - last_name - } - } - } -`; - export const QUERY_ALL_OPEN_JOBS = gql` query QUERY_ALL_OPEN_JOBS { jobs { @@ -89,30 +62,6 @@ export const QUERY_ALL_OPEN_JOBS = gql` } `; -export const QUERY_JOBS_IN_PRODUCTION = gql` - query QUERY_JOBS_IN_PRODUCTION { - jobs { - id - updated_at - est_number - ro_number - scheduled_completion - scheduled_delivery - vehicle { - id - 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 { job_status( @@ -149,6 +98,7 @@ export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql` export const GET_JOB_BY_PK = gql` query GET_JOB_BY_PK($id: uuid!) { jobs_by_pk(id: $id) { + converted actual_completion actual_delivery actual_in @@ -171,6 +121,8 @@ export const GET_JOB_BY_PK = gql` ro_number scheduled_completion scheduled_in + service_car + special_coverage_policy scheduled_delivery job_status { id diff --git a/client/src/pages/jobs-available/jobs-available.page.component.jsx b/client/src/pages/jobs-available/jobs-available.page.component.jsx new file mode 100644 index 000000000..9dc5b81fe --- /dev/null +++ b/client/src/pages/jobs-available/jobs-available.page.component.jsx @@ -0,0 +1,9 @@ +import React from 'react' + +export default function JobsAvailablePageComponent() { + return ( +
+ JobsAvailablePageComponent +
+ ) +} diff --git a/client/src/pages/jobs-available/jobs-available.page.container.jsx b/client/src/pages/jobs-available/jobs-available.page.container.jsx new file mode 100644 index 000000000..6a146ea6a --- /dev/null +++ b/client/src/pages/jobs-available/jobs-available.page.container.jsx @@ -0,0 +1,10 @@ +import React from 'react' +import JobsAvailablePageComponent from './jobs-available.page.component' + +export default function JobsAvailablePageContainer() { + return ( +
+ +
+ ) +} diff --git a/client/src/pages/jobs-detail/jobs-detail.page.component.jsx b/client/src/pages/jobs-detail/jobs-detail.page.component.jsx new file mode 100644 index 000000000..7e3afddd3 --- /dev/null +++ b/client/src/pages/jobs-detail/jobs-detail.page.component.jsx @@ -0,0 +1,181 @@ +import { Form, Icon, Tabs } from "antd"; +import React from "react"; +import { useTranslation } from "react-i18next"; +import { FaRegStickyNote } from "react-icons/fa"; +import JobLinesContainer from "../../components/job-lines/job-lines.container.component"; +import JobsDetailHeader from "../../components/jobs-detail-header/jobs-detail-header.component"; +import JobsDocumentsContainer from "../../components/jobs-documents/jobs-documents.container"; +import JobNotesContainer from "../../components/jobs-notes/jobs-notes.container"; +import JobsRatesContainer from "../../components/jobs-rates/jobs-rates.container"; + +export default function JobsDetailPage({ + job, + mutationUpdateJob, + mutationConvertJob, + handleSubmit, + handleChange, + getFieldDecorator, + refetch +}) { + const { t } = useTranslation(); + + const formItemLayout = { + labelCol: { + xs: { span: 12 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 12 } + } + }; + + // const TEMP = ( + //
+ // {" "} + // + // {getFieldDecorator("est_ct_ln", { + // initialValue: jobContext.est_ct_ln + // })()} + // + // + // {getFieldDecorator("est_ct_fn", { + // initialValue: jobContext.est_ct_fn + // })()} + // + // + // {getFieldDecorator("est_ph1", { + // initialValue: jobContext.est_ph1 + // })( + // + // )} + // + // + // {getFieldDecorator("est_ea", { + // initialValue: jobContext.est_ea, + // rules: [ + // { + // type: "email", + // message: "This is not a valid email address." + // } + // ] + // })()} + // + //
+ // ); + + return ( +
+ + + + + + {t("menus.jobsdetail.claimdetail")} + + } + key='claimdetail'> + Claim detail + + + + + {t("menus.jobsdetail.insurance")} + + } + key='insurance'> + Insurance + + + + + {t("menus.jobsdetail.repairdata")} + + } + key='repairdata'> + + + + + + {t("menus.jobsdetail.financials")} + + } + key='financials'> + + + + + + {t("menus.jobsdetail.partssublet")} + + } + key='partssublet'> + Partssublet + + + + + {t("menus.jobsdetail.labor")} + + } + key='labor'> + Labor + + + + + {t("menus.jobsdetail.dates")} + + } + key='dates'> + Dates + + + + + {t("jobs.labels.documents")} + + } + key='#documents'> + + + + + {t("jobs.labels.notes")} + + } + key='#notes'> + + + + + ); +} diff --git a/client/src/pages/jobs-detail/jobs-detail.page.container.jsx b/client/src/pages/jobs-detail/jobs-detail.page.container.jsx index 9b6cc6f3f..3d6691f66 100644 --- a/client/src/pages/jobs-detail/jobs-detail.page.container.jsx +++ b/client/src/pages/jobs-detail/jobs-detail.page.container.jsx @@ -1,38 +1,79 @@ -import { useQuery } from "@apollo/react-hooks"; +import { Form, notification } from "antd"; import React, { useEffect } from "react"; +import { useMutation, useQuery } from "react-apollo"; import { useTranslation } from "react-i18next"; import AlertComponent from "../../components/alert/alert.component"; import SpinComponent from "../../components/loading-spinner/loading-spinner.component"; -import { GET_JOB_BY_PK } from "../../graphql/jobs.queries"; -import JobsDetailPage from "./jobs-detail.page"; +import { + GET_JOB_BY_PK, + UPDATE_JOB, + CONVERT_JOB_TO_RO +} from "../../graphql/jobs.queries"; +import JobsDetailPage from "./jobs-detail.page.component"; -function JobsDetailPageContainer({ match, location }) { +function JobsDetailPageContainer({ match, form }) { const { jobId } = match.params; - const { hash } = location; const { t } = useTranslation(); - const { loading, error, data } = useQuery(GET_JOB_BY_PK, { + + const { loading, error, data, refetch } = useQuery(GET_JOB_BY_PK, { variables: { id: jobId }, fetchPolicy: "network-only" }); + const [mutationUpdateJob] = useMutation(UPDATE_JOB); + const [mutationConvertJob] = useMutation(CONVERT_JOB_TO_RO); useEffect(() => { - document.title = loading - ? "..." - : t("titles.jobsdetail", { - ro_number: data.jobs_by_pk.ro_number + document.title = + loading && !error + ? "..." + : t("titles.jobsdetail", { + ro_number: data.jobs_by_pk.ro_number + }); + }, [loading, data, t, error]); + + const handleSubmit = e => { + e.preventDefault(); + + form.validateFieldsAndScroll((err, values) => { + if (err) { + notification["error"]({ + message: t("jobs.errors.validationtitle"), + description: t("jobs.errors.validation") }); - }, [loading, data, t]); + } + if (!err) { + mutationUpdateJob({ + variables: { jobId: data.jobs_by_pk.id, job: values } + }).then(r => + notification["success"]({ + message: t("jobs.successes.savetitle") + }) + ); + } + }); + }; + + const handleChange = event => { + //const { name, value } = event.target ? event.target : event; + //setJobContext({ ...jobContext, [name]: value }); + }; if (loading) return ; if (error) return ; - - return ( + return data.jobs_by_pk ? ( + ) : ( + ); } -export default JobsDetailPageContainer; +export default Form.create({ name: "JobsDetailPageContainer" })( + JobsDetailPageContainer +); diff --git a/client/src/pages/jobs-detail/jobs-detail.page.jsx b/client/src/pages/jobs-detail/jobs-detail.page.jsx deleted file mode 100644 index ecc689b03..000000000 --- a/client/src/pages/jobs-detail/jobs-detail.page.jsx +++ /dev/null @@ -1,80 +0,0 @@ -import { Icon, Row, Tabs } from "antd"; -import React from "react"; -import { useTranslation } from "react-i18next"; -import { FaRegStickyNote } from "react-icons/fa"; -import { withRouter } from "react-router-dom"; -import JobLinesContainer from "../../components/job-lines/job-lines.container.component"; -import JobTombstone from "../../components/job-tombstone/job-tombstone.component"; -import JobsDocumentsContainer from "../../components/jobs-documents/jobs-documents.container"; -import JobNotesContainer from "../../components/jobs-notes/jobs-notes.container"; -import JobsRatesContainer from "../../components/jobs-rates/jobs-rates.container"; - -function JobsDetailPage({ jobId, hash, data, match, history }) { - const { t } = useTranslation(); - return ( -
- - - - - { - history.push(p); - }}> - - - {t("jobs.labels.lines")} - - } - key='#lines'> - - - - - {t("jobs.labels.rates")} - - } - key='#rates'> - - - - - {t("jobs.labels.parts")} - - } - key='#parts'> - Estimate Parts - - - - {t("jobs.labels.documents")} - - } - key='#documents'> - - - - - {t("jobs.labels.notes")} - - } - key='#notes'> - - - - -
- ); -} -export default withRouter(JobsDetailPage); diff --git a/client/src/pages/manage/manage.page.jsx b/client/src/pages/manage/manage.page.jsx index 9e450f058..93245792f 100644 --- a/client/src/pages/manage/manage.page.jsx +++ b/client/src/pages/manage/manage.page.jsx @@ -20,6 +20,9 @@ const ProfilePage = lazy(() => import("../profile/profile.container.page")); const JobsDocumentsPage = lazy(() => import("../../components/jobs-documents/jobs-documents.container") ); +const JobsAvailablePage = lazy(() => + import("../jobs-available/jobs-available.page.container") +); const { Header, Content, Footer } = Layout; //This page will handle all routing for the entire application. @@ -43,6 +46,7 @@ export default function Manage({ match }) { + + + diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index a657b41eb..8584f8721 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -55,6 +55,7 @@ "claim_total": "Claim Total", "clm_no": "Claim #", "clm_total": "Claim Total", + "customerowing": "Customer Owing", "date_closed": "Closed", "date_estimated": "Date Estimated", "date_exported": "Exported", @@ -68,10 +69,13 @@ "ownr_ea": "Email", "phone1": "Phone 1", "phoneshort": "PH", + "repairtotal": "Repair Total", "ro_number": "RO #", "scheduled_completion": "Scheduled Completion", "scheduled_delivery": "Scheduled Delivery", "scheduled_in": "Scheduled In", + "servicecar": "Service Car", + "specialcoveragepolicy": "Special Coverage Policy", "status": "Job Status", "vehicle": "Vehicle" }, @@ -108,6 +112,21 @@ "languageselector": "Language", "profile": "Profile" }, + "header": { + "activejobs": "Active Jobs", + "availablejobs": "Available Jobs", + "home": "Home", + "jobs": "Jobs" + }, + "jobsdetail": { + "claimdetail": "Claim Details", + "dates": "Dates", + "financials": "Financials", + "insurance": "Insurance", + "labor": "Labor", + "partssublet": "Parts/Sublet", + "repairdata": "Repair Data" + }, "profilesidebar": { "profile": "My Profile", "shops": "My Shops" @@ -131,7 +150,7 @@ "newnoteplaceholder": "Add a note..." }, "successes": { - "created": "Note created successfully.", + "create": "Note created successfully.", "deleted": "Note deleted successfully.", "updated": "Note updated successfully." } diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index c102ca788..869653e41 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -55,6 +55,7 @@ "claim_total": "Reclamar total", "clm_no": "Reclamación #", "clm_total": "Reclamar total", + "customerowing": "Cliente debido", "date_closed": "Cerrado", "date_estimated": "Fecha estimada", "date_exported": "Exportado", @@ -68,10 +69,13 @@ "ownr_ea": "Email", "phone1": "Teléfono 1", "phoneshort": "PH", + "repairtotal": "Reparación total", "ro_number": "RO #", "scheduled_completion": "Finalización programada", "scheduled_delivery": "Entrega programada", "scheduled_in": "Programado en", + "servicecar": "Auto de servicio", + "specialcoveragepolicy": "Política de cobertura especial", "status": "Estado del trabajo", "vehicle": "Vehículo" }, @@ -108,6 +112,21 @@ "languageselector": "idioma", "profile": "Perfil" }, + "header": { + "activejobs": "Empleos activos", + "availablejobs": "Trabajos disponibles", + "home": "Casa", + "jobs": "Trabajos" + }, + "jobsdetail": { + "claimdetail": "Detalles de la reclamación", + "dates": "fechas", + "financials": "finanzas", + "insurance": "Seguro", + "labor": "Labor", + "partssublet": "Piezas / Subarrendamiento", + "repairdata": "Datos de reparación" + }, "profilesidebar": { "profile": "Mi perfil", "shops": "Mis tiendas" @@ -131,7 +150,7 @@ "newnoteplaceholder": "Agrega una nota..." }, "successes": { - "created": "Nota creada con éxito.", + "create": "Nota creada con éxito.", "deleted": "Nota eliminada con éxito.", "updated": "Nota actualizada con éxito." } diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index bca75b8ae..f067a76a3 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -55,6 +55,7 @@ "claim_total": "Total réclamation", "clm_no": "Prétendre #", "clm_total": "Total réclamation", + "customerowing": "Client propriétaire", "date_closed": "Fermé", "date_estimated": "Date estimée", "date_exported": "Exportés", @@ -68,10 +69,13 @@ "ownr_ea": "Email", "phone1": "Téléphone 1", "phoneshort": "PH", + "repairtotal": "Réparation totale", "ro_number": "RO #", "scheduled_completion": "Achèvement planifié", "scheduled_delivery": "Livraison programmée", "scheduled_in": "Planifié dans", + "servicecar": "Voiture de service", + "specialcoveragepolicy": "Politique de couverture spéciale", "status": "Statut de l'emploi", "vehicle": "Véhicule" }, @@ -108,6 +112,21 @@ "languageselector": "La langue", "profile": "Profil" }, + "header": { + "activejobs": "Emplois actifs", + "availablejobs": "Emplois disponibles", + "home": "Accueil", + "jobs": "Emplois" + }, + "jobsdetail": { + "claimdetail": "Détails de la réclamation", + "dates": "Rendez-vous", + "financials": "Financiers", + "insurance": "Assurance", + "labor": "La main d'oeuvre", + "partssublet": "Pièces / Sous-location", + "repairdata": "Données de réparation" + }, "profilesidebar": { "profile": "Mon profil", "shops": "Mes boutiques" @@ -131,7 +150,7 @@ "newnoteplaceholder": "Ajouter une note..." }, "successes": { - "created": "Remarque créée avec succès.", + "create": "Remarque créée avec succès.", "deleted": "Remarque supprimée avec succès.", "updated": "Remarque mise à jour avec succès." } diff --git a/client/src/utils/CurrencyFormatter.jsx b/client/src/utils/CurrencyFormatter.jsx new file mode 100644 index 000000000..083c2cf70 --- /dev/null +++ b/client/src/utils/CurrencyFormatter.jsx @@ -0,0 +1,13 @@ +import React from "react"; +import NumberFormat from "react-number-format"; + +export default function CurrencyFormatter(props) { + return ( + + ); +} diff --git a/hasura/migrations/1580169338033_alter_table_public_jobs_add_column_service_Car/down.yaml b/hasura/migrations/1580169338033_alter_table_public_jobs_add_column_service_Car/down.yaml new file mode 100644 index 000000000..0af0647d9 --- /dev/null +++ b/hasura/migrations/1580169338033_alter_table_public_jobs_add_column_service_Car/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "service_Car"; + type: run_sql diff --git a/hasura/migrations/1580169338033_alter_table_public_jobs_add_column_service_Car/up.yaml b/hasura/migrations/1580169338033_alter_table_public_jobs_add_column_service_Car/up.yaml new file mode 100644 index 000000000..c0dcd1261 --- /dev/null +++ b/hasura/migrations/1580169338033_alter_table_public_jobs_add_column_service_Car/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "service_Car" text NULL; + type: run_sql diff --git a/hasura/migrations/1580169357455_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1580169357455_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..cdb202414 --- /dev/null +++ b/hasura/migrations/1580169357455_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,212 @@ +- 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 + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - area_of_damage + - asgn_date + - asgn_no + - asgn_type + - cat_no + - ciecaid + - claim_total + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_total + - clm_zip + - converted + - created_at + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - 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 + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - invoice_date + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - owner_owing + - ownerid + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_amt + - pay_chknm + - pay_date + - pay_type + - payee_nms + - policy_no + - 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 + - theft_ind + - tlos_ind + - updated_at + - vehicleid + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1580169357455_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1580169357455_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..8a6eca121 --- /dev/null +++ b/hasura/migrations/1580169357455_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,213 @@ +- 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: + - id + - created_at + - updated_at + - shopid + - ro_number + - ownerid + - vehicleid + - labor_rate_id + - labor_rate_desc + - rate_lab + - rate_lad + - rate_lae + - rate_lar + - rate_las + - rate_laf + - rate_lam + - rate_lag + - rate_atp + - rate_lau + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_mapa + - rate_mash + - rate_mahw + - rate_ma2s + - rate_ma3s + - rate_ma2t + - rate_mabl + - rate_macs + - rate_matd + - federal_tax_rate + - state_tax_rate + - local_tax_rate + - est_co_nm + - est_addr1 + - est_addr2 + - est_city + - est_st + - est_zip + - est_ctry + - est_ph1 + - est_ea + - est_ct_ln + - est_ct_fn + - scheduled_in + - actual_in + - scheduled_completion + - actual_completion + - scheduled_delivery + - actual_delivery + - regie_number + - invoice_date + - claim_total + - deductible + - inproduction + - statusid + - ins_co_id + - ins_co_nm + - ins_addr1 + - ins_addr2 + - ins_city + - ins_st + - ins_zip + - ins_ctry + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_fax + - ins_faxx + - ins_ct_ln + - ins_ct_fn + - ins_title + - ins_ct_ph + - ins_ct_phx + - ins_ea + - ins_memo + - policy_no + - ded_amt + - ded_status + - asgn_no + - asgn_date + - asgn_type + - clm_no + - clm_ofc_id + - date_estimated + - date_open + - date_scheduled + - date_invoiced + - date_closed + - date_exported + - clm_total + - owner_owing + - converted + - ciecaid + - loss_date + - clm_ofc_nm + - clm_addr1 + - clm_addr2 + - clm_city + - clm_st + - clm_zip + - clm_ctry + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_fax + - clm_faxx + - clm_ct_ln + - clm_ct_fn + - clm_title + - clm_ct_ph + - clm_ct_phx + - clm_ea + - payee_nms + - pay_type + - pay_date + - pay_chknm + - pay_amt + - agt_co_id + - agt_co_nm + - agt_addr1 + - agt_addr2 + - agt_city + - agt_st + - agt_zip + - agt_ctry + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_fax + - agt_faxx + - agt_ct_ln + - agt_ct_fn + - agt_ct_ph + - agt_ct_phx + - agt_ea + - agt_lic_no + - loss_type + - loss_desc + - theft_ind + - cat_no + - tlos_ind + - cust_pr + - insd_ln + - insd_fn + - insd_title + - insd_co_nm + - insd_addr1 + - insd_addr2 + - insd_city + - insd_st + - insd_zip + - insd_ctry + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_fax + - insd_faxx + - insd_ea + - ownr_ln + - ownr_fn + - ownr_title + - ownr_co_nm + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_st + - ownr_zip + - ownr_ctry + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_fax + - ownr_faxx + - ownr_ea + - area_of_damage + - loss_cat + - est_number + - service_Car + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1580169365397_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1580169365397_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..915f8c6b9 --- /dev/null +++ b/hasura/migrations/1580169365397_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,210 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - converted + - inproduction + - asgn_date + - invoice_date + - loss_date + - pay_date + - est_number + - area_of_damage + - claim_total + - clm_total + - ded_amt + - deductible + - federal_tax_rate + - local_tax_rate + - owner_owing + - pay_amt + - 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 + - state_tax_rate + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - regie_number + - ro_number + - theft_ind + - tlos_ind + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - 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/1580169365397_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1580169365397_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..5f1089b37 --- /dev/null +++ b/hasura/migrations/1580169365397_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,211 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - converted + - inproduction + - asgn_date + - invoice_date + - loss_date + - pay_date + - est_number + - area_of_damage + - claim_total + - clm_total + - ded_amt + - deductible + - federal_tax_rate + - local_tax_rate + - owner_owing + - pay_amt + - 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 + - state_tax_rate + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - regie_number + - ro_number + - service_Car + - theft_ind + - tlos_ind + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - 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/1580169373151_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1580169373151_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..a1c550dec --- /dev/null +++ b/hasura/migrations/1580169373151_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,212 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - converted + - inproduction + - asgn_date + - invoice_date + - loss_date + - pay_date + - est_number + - area_of_damage + - claim_total + - clm_total + - ded_amt + - deductible + - federal_tax_rate + - local_tax_rate + - owner_owing + - pay_amt + - 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 + - state_tax_rate + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - regie_number + - ro_number + - theft_ind + - tlos_ind + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - 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/1580169373151_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1580169373151_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..4f2b760c0 --- /dev/null +++ b/hasura/migrations/1580169373151_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,213 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - converted + - inproduction + - asgn_date + - invoice_date + - loss_date + - pay_date + - est_number + - area_of_damage + - claim_total + - clm_total + - ded_amt + - deductible + - federal_tax_rate + - local_tax_rate + - owner_owing + - pay_amt + - 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 + - state_tax_rate + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - regie_number + - ro_number + - service_Car + - theft_ind + - tlos_ind + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - 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/1580169467694_alter_table_public_jobs_alter_column_service_Car/down.yaml b/hasura/migrations/1580169467694_alter_table_public_jobs_alter_column_service_Car/down.yaml new file mode 100644 index 000000000..f39fc6f03 --- /dev/null +++ b/hasura/migrations/1580169467694_alter_table_public_jobs_alter_column_service_Car/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."service_Car" IS E'null' + type: run_sql +- args: + sql: alter table "public"."jobs" rename column "service_car" to "service_Car"; + type: run_sql diff --git a/hasura/migrations/1580169467694_alter_table_public_jobs_alter_column_service_Car/up.yaml b/hasura/migrations/1580169467694_alter_table_public_jobs_alter_column_service_Car/up.yaml new file mode 100644 index 000000000..3321b91b3 --- /dev/null +++ b/hasura/migrations/1580169467694_alter_table_public_jobs_alter_column_service_Car/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: COMMENT ON COLUMN "public"."jobs"."service_Car" IS E'' + type: run_sql +- args: + sql: alter table "public"."jobs" rename column "service_Car" to "service_car"; + type: run_sql diff --git a/hasura/migrations/1580169565651_alter_table_public_jobs_add_column_special_coverage_policy/down.yaml b/hasura/migrations/1580169565651_alter_table_public_jobs_add_column_special_coverage_policy/down.yaml new file mode 100644 index 000000000..d0660650b --- /dev/null +++ b/hasura/migrations/1580169565651_alter_table_public_jobs_add_column_special_coverage_policy/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "special_coverage_policy"; + type: run_sql diff --git a/hasura/migrations/1580169565651_alter_table_public_jobs_add_column_special_coverage_policy/up.yaml b/hasura/migrations/1580169565651_alter_table_public_jobs_add_column_special_coverage_policy/up.yaml new file mode 100644 index 000000000..353cc12bd --- /dev/null +++ b/hasura/migrations/1580169565651_alter_table_public_jobs_add_column_special_coverage_policy/up.yaml @@ -0,0 +1,4 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "special_coverage_policy" boolean + NOT NULL DEFAULT false; + type: run_sql diff --git a/hasura/migrations/1580169609143_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1580169609143_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..3717c3ed4 --- /dev/null +++ b/hasura/migrations/1580169609143_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,213 @@ +- 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: + - id + - created_at + - updated_at + - shopid + - ro_number + - ownerid + - vehicleid + - labor_rate_id + - labor_rate_desc + - rate_lab + - rate_lad + - rate_lae + - rate_lar + - rate_las + - rate_laf + - rate_lam + - rate_lag + - rate_atp + - rate_lau + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_mapa + - rate_mash + - rate_mahw + - rate_ma2s + - rate_ma3s + - rate_ma2t + - rate_mabl + - rate_macs + - rate_matd + - federal_tax_rate + - state_tax_rate + - local_tax_rate + - est_co_nm + - est_addr1 + - est_addr2 + - est_city + - est_st + - est_zip + - est_ctry + - est_ph1 + - est_ea + - est_ct_ln + - est_ct_fn + - scheduled_in + - actual_in + - scheduled_completion + - actual_completion + - scheduled_delivery + - actual_delivery + - regie_number + - invoice_date + - claim_total + - deductible + - inproduction + - statusid + - ins_co_id + - ins_co_nm + - ins_addr1 + - ins_addr2 + - ins_city + - ins_st + - ins_zip + - ins_ctry + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_fax + - ins_faxx + - ins_ct_ln + - ins_ct_fn + - ins_title + - ins_ct_ph + - ins_ct_phx + - ins_ea + - ins_memo + - policy_no + - ded_amt + - ded_status + - asgn_no + - asgn_date + - asgn_type + - clm_no + - clm_ofc_id + - date_estimated + - date_open + - date_scheduled + - date_invoiced + - date_closed + - date_exported + - clm_total + - owner_owing + - converted + - ciecaid + - loss_date + - clm_ofc_nm + - clm_addr1 + - clm_addr2 + - clm_city + - clm_st + - clm_zip + - clm_ctry + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_fax + - clm_faxx + - clm_ct_ln + - clm_ct_fn + - clm_title + - clm_ct_ph + - clm_ct_phx + - clm_ea + - payee_nms + - pay_type + - pay_date + - pay_chknm + - pay_amt + - agt_co_id + - agt_co_nm + - agt_addr1 + - agt_addr2 + - agt_city + - agt_st + - agt_zip + - agt_ctry + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_fax + - agt_faxx + - agt_ct_ln + - agt_ct_fn + - agt_ct_ph + - agt_ct_phx + - agt_ea + - agt_lic_no + - loss_type + - loss_desc + - theft_ind + - cat_no + - tlos_ind + - cust_pr + - insd_ln + - insd_fn + - insd_title + - insd_co_nm + - insd_addr1 + - insd_addr2 + - insd_city + - insd_st + - insd_zip + - insd_ctry + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_fax + - insd_faxx + - insd_ea + - ownr_ln + - ownr_fn + - ownr_title + - ownr_co_nm + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_st + - ownr_zip + - ownr_ctry + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_fax + - ownr_faxx + - ownr_ea + - area_of_damage + - loss_cat + - est_number + - service_car + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1580169609143_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1580169609143_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..0e582a2c4 --- /dev/null +++ b/hasura/migrations/1580169609143_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,214 @@ +- 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: + - id + - created_at + - updated_at + - shopid + - ro_number + - ownerid + - vehicleid + - labor_rate_id + - labor_rate_desc + - rate_lab + - rate_lad + - rate_lae + - rate_lar + - rate_las + - rate_laf + - rate_lam + - rate_lag + - rate_atp + - rate_lau + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_mapa + - rate_mash + - rate_mahw + - rate_ma2s + - rate_ma3s + - rate_ma2t + - rate_mabl + - rate_macs + - rate_matd + - federal_tax_rate + - state_tax_rate + - local_tax_rate + - est_co_nm + - est_addr1 + - est_addr2 + - est_city + - est_st + - est_zip + - est_ctry + - est_ph1 + - est_ea + - est_ct_ln + - est_ct_fn + - scheduled_in + - actual_in + - scheduled_completion + - actual_completion + - scheduled_delivery + - actual_delivery + - regie_number + - invoice_date + - claim_total + - deductible + - inproduction + - statusid + - ins_co_id + - ins_co_nm + - ins_addr1 + - ins_addr2 + - ins_city + - ins_st + - ins_zip + - ins_ctry + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_fax + - ins_faxx + - ins_ct_ln + - ins_ct_fn + - ins_title + - ins_ct_ph + - ins_ct_phx + - ins_ea + - ins_memo + - policy_no + - ded_amt + - ded_status + - asgn_no + - asgn_date + - asgn_type + - clm_no + - clm_ofc_id + - date_estimated + - date_open + - date_scheduled + - date_invoiced + - date_closed + - date_exported + - clm_total + - owner_owing + - converted + - ciecaid + - loss_date + - clm_ofc_nm + - clm_addr1 + - clm_addr2 + - clm_city + - clm_st + - clm_zip + - clm_ctry + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_fax + - clm_faxx + - clm_ct_ln + - clm_ct_fn + - clm_title + - clm_ct_ph + - clm_ct_phx + - clm_ea + - payee_nms + - pay_type + - pay_date + - pay_chknm + - pay_amt + - agt_co_id + - agt_co_nm + - agt_addr1 + - agt_addr2 + - agt_city + - agt_st + - agt_zip + - agt_ctry + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_fax + - agt_faxx + - agt_ct_ln + - agt_ct_fn + - agt_ct_ph + - agt_ct_phx + - agt_ea + - agt_lic_no + - loss_type + - loss_desc + - theft_ind + - cat_no + - tlos_ind + - cust_pr + - insd_ln + - insd_fn + - insd_title + - insd_co_nm + - insd_addr1 + - insd_addr2 + - insd_city + - insd_st + - insd_zip + - insd_ctry + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_fax + - insd_faxx + - insd_ea + - ownr_ln + - ownr_fn + - ownr_title + - ownr_co_nm + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_st + - ownr_zip + - ownr_ctry + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_fax + - ownr_faxx + - ownr_ea + - area_of_damage + - loss_cat + - est_number + - service_car + - special_coverage_policy + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1580169617954_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1580169617954_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..c4be28150 --- /dev/null +++ b/hasura/migrations/1580169617954_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,211 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - converted + - inproduction + - asgn_date + - invoice_date + - loss_date + - pay_date + - est_number + - area_of_damage + - claim_total + - clm_total + - ded_amt + - deductible + - federal_tax_rate + - local_tax_rate + - owner_owing + - pay_amt + - 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 + - state_tax_rate + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - regie_number + - ro_number + - service_car + - theft_ind + - tlos_ind + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - 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/1580169617954_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1580169617954_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..cb7febe8c --- /dev/null +++ b/hasura/migrations/1580169617954_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,212 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - id + - created_at + - updated_at + - shopid + - ro_number + - ownerid + - vehicleid + - labor_rate_id + - labor_rate_desc + - rate_lab + - rate_lad + - rate_lae + - rate_lar + - rate_las + - rate_laf + - rate_lam + - rate_lag + - rate_atp + - rate_lau + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_mapa + - rate_mash + - rate_mahw + - rate_ma2s + - rate_ma3s + - rate_ma2t + - rate_mabl + - rate_macs + - rate_matd + - federal_tax_rate + - state_tax_rate + - local_tax_rate + - est_co_nm + - est_addr1 + - est_addr2 + - est_city + - est_st + - est_zip + - est_ctry + - est_ph1 + - est_ea + - est_ct_ln + - est_ct_fn + - scheduled_in + - actual_in + - scheduled_completion + - actual_completion + - scheduled_delivery + - actual_delivery + - regie_number + - invoice_date + - claim_total + - deductible + - inproduction + - statusid + - ins_co_id + - ins_co_nm + - ins_addr1 + - ins_addr2 + - ins_city + - ins_st + - ins_zip + - ins_ctry + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_fax + - ins_faxx + - ins_ct_ln + - ins_ct_fn + - ins_title + - ins_ct_ph + - ins_ct_phx + - ins_ea + - ins_memo + - policy_no + - ded_amt + - ded_status + - asgn_no + - asgn_date + - asgn_type + - clm_no + - clm_ofc_id + - date_estimated + - date_open + - date_scheduled + - date_invoiced + - date_closed + - date_exported + - clm_total + - owner_owing + - converted + - ciecaid + - loss_date + - clm_ofc_nm + - clm_addr1 + - clm_addr2 + - clm_city + - clm_st + - clm_zip + - clm_ctry + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_fax + - clm_faxx + - clm_ct_ln + - clm_ct_fn + - clm_title + - clm_ct_ph + - clm_ct_phx + - clm_ea + - payee_nms + - pay_type + - pay_date + - pay_chknm + - pay_amt + - agt_co_id + - agt_co_nm + - agt_addr1 + - agt_addr2 + - agt_city + - agt_st + - agt_zip + - agt_ctry + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_fax + - agt_faxx + - agt_ct_ln + - agt_ct_fn + - agt_ct_ph + - agt_ct_phx + - agt_ea + - agt_lic_no + - loss_type + - loss_desc + - theft_ind + - cat_no + - tlos_ind + - cust_pr + - insd_ln + - insd_fn + - insd_title + - insd_co_nm + - insd_addr1 + - insd_addr2 + - insd_city + - insd_st + - insd_zip + - insd_ctry + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_fax + - insd_faxx + - insd_ea + - ownr_ln + - ownr_fn + - ownr_title + - ownr_co_nm + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_st + - ownr_zip + - ownr_ctry + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_fax + - ownr_faxx + - ownr_ea + - area_of_damage + - loss_cat + - est_number + - service_car + - special_coverage_policy + 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/1580169626079_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1580169626079_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..c66a2d708 --- /dev/null +++ b/hasura/migrations/1580169626079_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,213 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - converted + - inproduction + - asgn_date + - invoice_date + - loss_date + - pay_date + - est_number + - area_of_damage + - claim_total + - clm_total + - ded_amt + - deductible + - federal_tax_rate + - local_tax_rate + - owner_owing + - pay_amt + - 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 + - state_tax_rate + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - regie_number + - ro_number + - service_car + - theft_ind + - tlos_ind + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - 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/1580169626079_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1580169626079_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..0d44decf8 --- /dev/null +++ b/hasura/migrations/1580169626079_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,214 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - converted + - inproduction + - special_coverage_policy + - asgn_date + - invoice_date + - loss_date + - pay_date + - est_number + - area_of_damage + - claim_total + - clm_total + - ded_amt + - deductible + - federal_tax_rate + - local_tax_rate + - owner_owing + - pay_amt + - 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 + - state_tax_rate + - agt_addr1 + - agt_addr2 + - agt_city + - agt_co_id + - agt_co_nm + - agt_ct_fn + - agt_ct_ln + - agt_ct_ph + - agt_ct_phx + - agt_ctry + - agt_ea + - agt_fax + - agt_faxx + - agt_lic_no + - agt_ph1 + - agt_ph1x + - agt_ph2 + - agt_ph2x + - agt_st + - agt_zip + - asgn_no + - asgn_type + - cat_no + - ciecaid + - clm_addr1 + - clm_addr2 + - clm_city + - clm_ct_fn + - clm_ct_ln + - clm_ct_ph + - clm_ct_phx + - clm_ctry + - clm_ea + - clm_fax + - clm_faxx + - clm_no + - clm_ofc_id + - clm_ofc_nm + - clm_ph1 + - clm_ph1x + - clm_ph2 + - clm_ph2x + - clm_st + - clm_title + - clm_zip + - cust_pr + - ded_status + - est_addr1 + - est_addr2 + - est_city + - est_co_nm + - est_ct_fn + - est_ct_ln + - est_ctry + - est_ea + - est_ph1 + - est_st + - est_zip + - ins_addr1 + - ins_addr2 + - ins_city + - ins_co_id + - ins_co_nm + - ins_ct_fn + - ins_ct_ln + - ins_ct_ph + - ins_ct_phx + - ins_ctry + - insd_addr1 + - insd_addr2 + - insd_city + - insd_co_nm + - insd_ctry + - insd_ea + - insd_fax + - insd_faxx + - insd_fn + - insd_ln + - insd_ph1 + - insd_ph1x + - insd_ph2 + - insd_ph2x + - insd_st + - insd_title + - insd_zip + - ins_ea + - ins_fax + - ins_faxx + - ins_memo + - ins_ph1 + - ins_ph1x + - ins_ph2 + - ins_ph2x + - ins_st + - ins_title + - ins_zip + - labor_rate_desc + - labor_rate_id + - loss_cat + - loss_desc + - loss_type + - ownr_addr1 + - ownr_addr2 + - ownr_city + - ownr_co_nm + - ownr_ctry + - ownr_ea + - ownr_fax + - ownr_faxx + - ownr_fn + - ownr_ln + - ownr_ph1 + - ownr_ph1x + - ownr_ph2 + - ownr_ph2x + - ownr_st + - ownr_title + - ownr_zip + - pay_chknm + - payee_nms + - pay_type + - policy_no + - regie_number + - ro_number + - service_car + - theft_ind + - tlos_ind + - actual_completion + - actual_delivery + - actual_in + - created_at + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - scheduled_completion + - scheduled_delivery + - scheduled_in + - updated_at + - id + - ownerid + - shopid + - statusid + - 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 From 265bc7d486369cb8db69d66c46864d02b50ef3d0 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 27 Jan 2020 18:18:55 -0800 Subject: [PATCH 11/23] Refactored some of the job detail form to use context. Created claims component. --- bodyshop_translations.babel | 52 ++++++++++++ .../jobs-detail-claims.component.jsx | 44 ++++++++++ .../jobs-detail-header.component.jsx | 14 +--- .../jobs-detail.page.component.jsx | 82 ++++++++----------- .../jobs-detail.page.container.jsx | 37 ++++----- .../jobs-detail/jobs-detail.page.context.jsx | 3 + client/src/translations/en_us/common.json | 6 ++ client/src/translations/es/common.json | 6 ++ client/src/translations/fr/common.json | 6 ++ 9 files changed, 169 insertions(+), 81 deletions(-) create mode 100644 client/src/components/jobs-detail-claims/jobs-detail-claims.component.jsx create mode 100644 client/src/pages/jobs-detail/jobs-detail.page.context.jsx diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index ee4afc6cf..6af655c07 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -188,6 +188,32 @@ general + + actions + + + reset + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + labels @@ -387,6 +413,32 @@ + + messages + + + unsavedchanges + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + diff --git a/client/src/components/jobs-detail-claims/jobs-detail-claims.component.jsx b/client/src/components/jobs-detail-claims/jobs-detail-claims.component.jsx new file mode 100644 index 000000000..3aec766b1 --- /dev/null +++ b/client/src/components/jobs-detail-claims/jobs-detail-claims.component.jsx @@ -0,0 +1,44 @@ +import React, { useContext } from "react"; +import { Form, Input } from "antd"; +import FormItemPhone from "../form-items-formatted/phone-form-item.component"; +import JobDetailFormContext from "../../pages/jobs-detail/jobs-detail.page.context"; + +export default function JobsDetailClaims({ job }) { + const form = useContext(JobDetailFormContext); + const { getFieldDecorator, isFieldTouched } = form; + + return ( +
+
+ + {isFieldTouched("est_ct_ln") ? "Yes" : "No"} + {getFieldDecorator("est_ct_ln", { + initialValue: job.est_ct_ln + })()} + + + {getFieldDecorator("est_ct_fn", { + initialValue: job.est_ct_fn + })()} + + + {getFieldDecorator("est_ph1", { + initialValue: job.est_ph1 + })()} + + + {getFieldDecorator("est_ea", { + initialValue: job.est_ea, + + rules: [ + { + type: "email", + message: "This is not a valid email address." + } + ] + })()} + +
+
+ ); +} diff --git a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx index 82d420c6c..4d8148ac6 100644 --- a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx +++ b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx @@ -1,14 +1,4 @@ -import { - Avatar, - Button, - Descriptions, - notification, - PageHeader, - Tag, - Input, - Form, - Checkbox -} from "antd"; +import { Avatar, Button, Checkbox, Descriptions, notification, PageHeader, Tag } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import Moment from "react-moment"; @@ -95,7 +85,7 @@ export default function JobsDetailHeader({ - $NO BINDING YET + ##NO BINDING YET## diff --git a/client/src/pages/jobs-detail/jobs-detail.page.component.jsx b/client/src/pages/jobs-detail/jobs-detail.page.component.jsx index 7e3afddd3..9faa7bdcc 100644 --- a/client/src/pages/jobs-detail/jobs-detail.page.component.jsx +++ b/client/src/pages/jobs-detail/jobs-detail.page.component.jsx @@ -1,24 +1,31 @@ -import { Form, Icon, Tabs } from "antd"; -import React from "react"; +import { Form, Icon, Tabs, Alert, Button } from "antd"; +import React, { useContext } from "react"; import { useTranslation } from "react-i18next"; -import { FaRegStickyNote } from "react-icons/fa"; +import { + FaInfo, + FaRegStickyNote, + FaShieldAlt, + FaHardHat +} from "react-icons/fa"; import JobLinesContainer from "../../components/job-lines/job-lines.container.component"; +import JobsDetailClaims from "../../components/jobs-detail-claims/jobs-detail-claims.component"; import JobsDetailHeader from "../../components/jobs-detail-header/jobs-detail-header.component"; import JobsDocumentsContainer from "../../components/jobs-documents/jobs-documents.container"; import JobNotesContainer from "../../components/jobs-notes/jobs-notes.container"; import JobsRatesContainer from "../../components/jobs-rates/jobs-rates.container"; +import JobDetailFormContext from "./jobs-detail.page.context"; export default function JobsDetailPage({ job, mutationUpdateJob, mutationConvertJob, handleSubmit, - handleChange, - getFieldDecorator, refetch }) { const { t } = useTranslation(); + const { isFieldsTouched, resetFields } = useContext(JobDetailFormContext); + const formItemLayout = { labelCol: { xs: { span: 12 }, @@ -30,69 +37,44 @@ export default function JobsDetailPage({ } }; - // const TEMP = ( - //
- // {" "} - // - // {getFieldDecorator("est_ct_ln", { - // initialValue: jobContext.est_ct_ln - // })()} - // - // - // {getFieldDecorator("est_ct_fn", { - // initialValue: jobContext.est_ct_fn - // })()} - // - // - // {getFieldDecorator("est_ph1", { - // initialValue: jobContext.est_ph1 - // })( - // - // )} - // - // - // {getFieldDecorator("est_ea", { - // initialValue: jobContext.est_ea, - // rules: [ - // { - // type: "email", - // message: "This is not a valid email address." - // } - // ] - // })()} - // - //
- // ); - return (
+ {isFieldsTouched() ? ( + + {t("general.messages.unsavedchanges")} + +
+ } + closable + /> + ) : null} + - + {t("menus.jobsdetail.claimdetail")} } key='claimdetail'> - Claim detail + - + {t("menus.jobsdetail.insurance")} } @@ -125,7 +107,7 @@ export default function JobsDetailPage({ - + {t("menus.jobsdetail.partssublet")} } @@ -136,7 +118,7 @@ export default function JobsDetailPage({ - + {t("menus.jobsdetail.labor")} } @@ -147,7 +129,7 @@ export default function JobsDetailPage({ - + {t("menus.jobsdetail.dates")} } diff --git a/client/src/pages/jobs-detail/jobs-detail.page.container.jsx b/client/src/pages/jobs-detail/jobs-detail.page.container.jsx index 3d6691f66..7003ea7f0 100644 --- a/client/src/pages/jobs-detail/jobs-detail.page.container.jsx +++ b/client/src/pages/jobs-detail/jobs-detail.page.container.jsx @@ -5,11 +5,12 @@ import { useTranslation } from "react-i18next"; import AlertComponent from "../../components/alert/alert.component"; import SpinComponent from "../../components/loading-spinner/loading-spinner.component"; import { + CONVERT_JOB_TO_RO, GET_JOB_BY_PK, - UPDATE_JOB, - CONVERT_JOB_TO_RO + UPDATE_JOB } from "../../graphql/jobs.queries"; import JobsDetailPage from "./jobs-detail.page.component"; +import JobDetailFormContext from "./jobs-detail.page.context"; function JobsDetailPageContainer({ match, form }) { const { jobId } = match.params; @@ -44,32 +45,30 @@ function JobsDetailPageContainer({ match, form }) { if (!err) { mutationUpdateJob({ variables: { jobId: data.jobs_by_pk.id, job: values } - }).then(r => + }).then(r => { notification["success"]({ message: t("jobs.successes.savetitle") - }) - ); + }); + //TODO: Better way to reset the field decorators? + refetch().then(r => form.resetFields()); + }); } }); }; - const handleChange = event => { - //const { name, value } = event.target ? event.target : event; - //setJobContext({ ...jobContext, [name]: value }); - }; - if (loading) return ; if (error) return ; return data.jobs_by_pk ? ( - + + + ) : ( ); diff --git a/client/src/pages/jobs-detail/jobs-detail.page.context.jsx b/client/src/pages/jobs-detail/jobs-detail.page.context.jsx new file mode 100644 index 000000000..60056c8de --- /dev/null +++ b/client/src/pages/jobs-detail/jobs-detail.page.context.jsx @@ -0,0 +1,3 @@ +import React from "react"; +const JobDetailFormContext = React.createContext(null); +export default JobDetailFormContext; diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 8584f8721..49b3b7c52 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -16,6 +16,9 @@ } }, "general": { + "actions": { + "reset": "Reset to original." + }, "labels": { "in": "In", "loading": "Loading...", @@ -28,6 +31,9 @@ "english": "English", "french": "French", "spanish": "Spanish" + }, + "messages": { + "unsavedchanges": "You have unsaved changes." } }, "jobs": { diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 869653e41..365a7846c 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -16,6 +16,9 @@ } }, "general": { + "actions": { + "reset": "Restablecer a original." + }, "labels": { "in": "en", "loading": "Cargando...", @@ -28,6 +31,9 @@ "english": "Inglés", "french": "francés", "spanish": "español" + }, + "messages": { + "unsavedchanges": "Usted tiene cambios no guardados." } }, "jobs": { diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index f067a76a3..222e5ce94 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -16,6 +16,9 @@ } }, "general": { + "actions": { + "reset": "Rétablir l'original." + }, "labels": { "in": "dans", "loading": "Chargement...", @@ -28,6 +31,9 @@ "english": "Anglais", "french": "Francais", "spanish": "Espanol" + }, + "messages": { + "unsavedchanges": "Vous avez des changements non enregistrés." } }, "jobs": { From e8ea15a1a5d61dbb97981684ff5b7a19b9078e7e Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 27 Jan 2020 19:08:43 -0800 Subject: [PATCH 12/23] Added fields to claim data page. --- bodyshop_translations.babel | 147 ++++++++++++ .../jobs-detail-claims.component.jsx | 103 +++++--- client/src/graphql/jobs.queries.js | 7 + .../jobs-detail.page.container.jsx | 20 +- client/src/translations/en_us/common.json | 7 + client/src/translations/es/common.json | 7 + client/src/translations/fr/common.json | 7 + .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 214 +++++++++++++++++ .../up.yaml | 215 +++++++++++++++++ .../down.yaml | 212 +++++++++++++++++ .../up.yaml | 213 +++++++++++++++++ .../down.yaml | 214 +++++++++++++++++ .../up.yaml | 215 +++++++++++++++++ .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 215 +++++++++++++++++ .../up.yaml | 219 +++++++++++++++++ .../down.yaml | 213 +++++++++++++++++ .../up.yaml | 217 +++++++++++++++++ .../down.yaml | 215 +++++++++++++++++ .../up.yaml | 219 +++++++++++++++++ .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 219 +++++++++++++++++ .../up.yaml | 220 ++++++++++++++++++ .../down.yaml | 217 +++++++++++++++++ .../up.yaml | 218 +++++++++++++++++ .../down.yaml | 219 +++++++++++++++++ .../up.yaml | 220 ++++++++++++++++++ 37 files changed, 4184 insertions(+), 44 deletions(-) create mode 100644 hasura/migrations/1580178912137_alter_table_public_jobs_add_column_csr/down.yaml create mode 100644 hasura/migrations/1580178912137_alter_table_public_jobs_add_column_csr/up.yaml create mode 100644 hasura/migrations/1580178922902_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580178922902_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1580178929598_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580178929598_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1580178936376_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580178936376_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1580179243363_alter_table_public_jobs_add_column_po_number/down.yaml create mode 100644 hasura/migrations/1580179243363_alter_table_public_jobs_add_column_po_number/up.yaml create mode 100644 hasura/migrations/1580179295432_alter_table_public_jobs_add_column_unit_number/down.yaml create mode 100644 hasura/migrations/1580179295432_alter_table_public_jobs_add_column_unit_number/up.yaml create mode 100644 hasura/migrations/1580179755901_alter_table_public_jobs_add_column_kmin/down.yaml create mode 100644 hasura/migrations/1580179755901_alter_table_public_jobs_add_column_kmin/up.yaml create mode 100644 hasura/migrations/1580179762327_alter_table_public_jobs_add_column_kmout/down.yaml create mode 100644 hasura/migrations/1580179762327_alter_table_public_jobs_add_column_kmout/up.yaml create mode 100644 hasura/migrations/1580180067779_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580180067779_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1580180073360_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580180073360_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1580180078983_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580180078983_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1580180567863_alter_table_public_jobs_add_column_referral_source/down.yaml create mode 100644 hasura/migrations/1580180567863_alter_table_public_jobs_add_column_referral_source/up.yaml create mode 100644 hasura/migrations/1580180688551_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580180688551_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1580180694341_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580180694341_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1580180700206_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580180700206_update_permission_user_public_table_jobs/up.yaml diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 6af655c07..c50ae7d4a 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -856,6 +856,27 @@
+ + csr + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + customerowing false @@ -1045,6 +1066,69 @@ + + kmin + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + kmout + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + loss_desc + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + owner false @@ -1150,6 +1234,48 @@ + + ponumber + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + referralsource + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + repairtotal false @@ -1318,6 +1444,27 @@ + + unitnumber + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + vehicle false diff --git a/client/src/components/jobs-detail-claims/jobs-detail-claims.component.jsx b/client/src/components/jobs-detail-claims/jobs-detail-claims.component.jsx index 3aec766b1..5d607eee3 100644 --- a/client/src/components/jobs-detail-claims/jobs-detail-claims.component.jsx +++ b/client/src/components/jobs-detail-claims/jobs-detail-claims.component.jsx @@ -1,44 +1,81 @@ +import { Form, Input, Switch } from "antd"; import React, { useContext } from "react"; -import { Form, Input } from "antd"; -import FormItemPhone from "../form-items-formatted/phone-form-item.component"; +import { useTranslation } from "react-i18next"; import JobDetailFormContext from "../../pages/jobs-detail/jobs-detail.page.context"; +import FormItemPhone from "../form-items-formatted/phone-form-item.component"; export default function JobsDetailClaims({ job }) { const form = useContext(JobDetailFormContext); - const { getFieldDecorator, isFieldTouched } = form; + const { getFieldDecorator } = form; + const { t } = useTranslation(); return (
-
- - {isFieldTouched("est_ct_ln") ? "Yes" : "No"} - {getFieldDecorator("est_ct_ln", { - initialValue: job.est_ct_ln - })()} - - - {getFieldDecorator("est_ct_fn", { - initialValue: job.est_ct_fn - })()} - - - {getFieldDecorator("est_ph1", { - initialValue: job.est_ph1 - })()} - - - {getFieldDecorator("est_ea", { - initialValue: job.est_ea, - - rules: [ - { - type: "email", - message: "This is not a valid email address." - } - ] - })()} - -
+ + {getFieldDecorator("csr", { + initialValue: job.csr + })()} + + + {getFieldDecorator("loss_desc", { + initialValue: job.loss_desc + })()} + + TODO: How to handle different taxes and marking them as exempt? + { + // + // {getFieldDecorator("exempt", { + // initialValue: job.exempt + // })()} + // + } + + {getFieldDecorator("po_number", { + initialValue: job.po_number + })()} + + + {getFieldDecorator("unit_number", { + initialValue: job.unit_number + })()} + + + {getFieldDecorator("special_coverage_policy", { + initialValue: job.special_coverage_policy, + valuePropName: "checked" + })()} + + + {getFieldDecorator("kmin", { + initialValue: job.kmin + })()} + + + {getFieldDecorator("kmout", { + initialValue: job.kmout + })()} + + + {getFieldDecorator("referral_source", { + initialValue: job.referral_source + })()} + + + {getFieldDecorator("est_ph1", { + initialValue: job.est_ph1 + })()} + + + {getFieldDecorator("est_ea", { + initialValue: job.est_ea, + rules: [ + { + type: "email", + message: "This is not a valid email address." + } + ] + })()} +
); } diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 33f56e24b..93c36d10c 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -122,6 +122,13 @@ export const GET_JOB_BY_PK = gql` scheduled_completion scheduled_in service_car + csr + loss_desc + kmin + kmout + referral_source + unit_number + po_number special_coverage_policy scheduled_delivery job_status { diff --git a/client/src/pages/jobs-detail/jobs-detail.page.container.jsx b/client/src/pages/jobs-detail/jobs-detail.page.container.jsx index 7003ea7f0..e0c49840b 100644 --- a/client/src/pages/jobs-detail/jobs-detail.page.container.jsx +++ b/client/src/pages/jobs-detail/jobs-detail.page.container.jsx @@ -4,11 +4,7 @@ import { useMutation, useQuery } from "react-apollo"; import { useTranslation } from "react-i18next"; import AlertComponent from "../../components/alert/alert.component"; import SpinComponent from "../../components/loading-spinner/loading-spinner.component"; -import { - CONVERT_JOB_TO_RO, - GET_JOB_BY_PK, - UPDATE_JOB -} from "../../graphql/jobs.queries"; +import { CONVERT_JOB_TO_RO, GET_JOB_BY_PK, UPDATE_JOB } from "../../graphql/jobs.queries"; import JobsDetailPage from "./jobs-detail.page.component"; import JobDetailFormContext from "./jobs-detail.page.context"; @@ -24,12 +20,13 @@ function JobsDetailPageContainer({ match, form }) { const [mutationConvertJob] = useMutation(CONVERT_JOB_TO_RO); useEffect(() => { - document.title = - loading && !error - ? "..." - : t("titles.jobsdetail", { - ro_number: data.jobs_by_pk.ro_number - }); + document.title = loading + ? "..." + : error + ? t("titles.app") + : t("titles.jobsdetail", { + ro_number: data.jobs_by_pk.ro_number + }); }, [loading, data, t, error]); const handleSubmit = e => { @@ -58,6 +55,7 @@ function JobsDetailPageContainer({ match, form }) { if (loading) return ; if (error) return ; + return data.jobs_by_pk ? ( Date: Mon, 27 Jan 2020 19:32:48 -0800 Subject: [PATCH 13/23] Fields for insurance tab on claim detail. --- bodyshop_translations.babel | 231 ++++++++++++++++++ .../jobs-detail-insurance.component.jsx | 101 ++++++++ client/src/graphql/jobs.queries.js | 59 +++-- .../jobs-detail.page.component.jsx | 3 +- client/src/translations/en_us/common.json | 11 + client/src/translations/es/common.json | 11 + client/src/translations/fr/common.json | 11 + 7 files changed, 405 insertions(+), 22 deletions(-) create mode 100644 client/src/components/jobs-detail-insurance/jobs-detail-insurance.component.jsx diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index c50ae7d4a..8b3adf828 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -1066,6 +1066,174 @@
+ + ins_addr1 + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ins_city + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ins_co_id + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ins_co_nm + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ins_ct_fn + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ins_ct_ln + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ins_ea + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ins_ph1 + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + kmin false @@ -1108,6 +1276,27 @@ + + loss_date + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + loss_desc false @@ -1234,6 +1423,27 @@ + + policy_no + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + ponumber false @@ -1276,6 +1486,27 @@ + + regie_number + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + repairtotal false diff --git a/client/src/components/jobs-detail-insurance/jobs-detail-insurance.component.jsx b/client/src/components/jobs-detail-insurance/jobs-detail-insurance.component.jsx new file mode 100644 index 000000000..15d39bad5 --- /dev/null +++ b/client/src/components/jobs-detail-insurance/jobs-detail-insurance.component.jsx @@ -0,0 +1,101 @@ +import { Form, Input, Button, Icon } from "antd"; +import React, { useContext } from "react"; +import { useTranslation } from "react-i18next"; +import JobDetailFormContext from "../../pages/jobs-detail/jobs-detail.page.context"; +import FormItemPhone from "../form-items-formatted/phone-form-item.component"; + +export default function JobsDetailInsurance({ job }) { + const form = useContext(JobDetailFormContext); + const { getFieldDecorator } = form; + const { t } = useTranslation(); + + return ( +
+ + {getFieldDecorator("ins_co_id", { + initialValue: job.ins_co_id + })()} + + + {getFieldDecorator("policy_no", { + initialValue: job.policy_no + })()} + + + {getFieldDecorator("clm_no", { + initialValue: job.clm_no + })()} + + + {getFieldDecorator("regie_number", { + initialValue: job.regie_number + })()} + + TODO: missing KOL field??? + + {getFieldDecorator("loss_date", { + initialValue: job.loss_date + })()} + + DAMAGE {JSON.stringify(job.area_of_damage)} + CAA # seems not correct based on field mapping Class seems not correct + based on field mapping + + {getFieldDecorator("ins_co_nm", { + initialValue: job.ins_co_nm + })()} + + + {getFieldDecorator("ins_addr1", { + initialValue: job.ins_addr1 + })()} + + + {getFieldDecorator("ins_city", { + initialValue: job.ins_city + })()} + + + {getFieldDecorator("ins_ct_ln", { + initialValue: job.ins_ct_ln + })()} + + + {getFieldDecorator("ins_ct_fn", { + initialValue: job.ins_ct_fn + })()} + + + {getFieldDecorator("ins_ph1", { + initialValue: job.ins_ph1 + })()} + + + {getFieldDecorator("ins_ea", { + initialValue: job.ins_ea, + rules: [ + { + type: "email", + message: "This is not a valid email address." + } + ] + })()} + + + {getFieldDecorator("est_ea", { + initialValue: job.est_ea, + rules: [ + { + type: "email", + message: "This is not a valid email address." + } + ] + })()} + + + +
+ ); +} diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 93c36d10c..2024332b7 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -98,12 +98,46 @@ export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql` export const GET_JOB_BY_PK = gql` query GET_JOB_BY_PK($id: uuid!) { jobs_by_pk(id: $id) { + service_car + csr + loss_desc + kmin + kmout + referral_source + unit_number + po_number + special_coverage_policy + scheduled_delivery converted + est_number + ro_number + vehicle { + id + plate_no + v_vin + v_model_yr + v_model_desc + v_make_desc + v_color + } +ins_co_id +policy_no +loss_date +area_of_damage +ins_co_nm +ins_addr1 +ins_city +ins_ct_ln +ins_ct_fn +ins_ea +ins_ph1 + + actual_completion actual_delivery actual_in created_at - est_number + id local_tax_rate owner { @@ -118,19 +152,10 @@ export const GET_JOB_BY_PK = gql` est_ct_fn est_ct_ln regie_number - ro_number + scheduled_completion scheduled_in - service_car - csr - loss_desc - kmin - kmout - referral_source - unit_number - po_number - special_coverage_policy - scheduled_delivery + job_status { id name @@ -138,15 +163,7 @@ export const GET_JOB_BY_PK = gql` updated_at claim_total deductible - vehicle { - id - plate_no - v_vin - v_model_yr - v_model_desc - v_make_desc - v_color - } + } } `; diff --git a/client/src/pages/jobs-detail/jobs-detail.page.component.jsx b/client/src/pages/jobs-detail/jobs-detail.page.component.jsx index 9faa7bdcc..512f5b130 100644 --- a/client/src/pages/jobs-detail/jobs-detail.page.component.jsx +++ b/client/src/pages/jobs-detail/jobs-detail.page.component.jsx @@ -14,6 +14,7 @@ import JobsDocumentsContainer from "../../components/jobs-documents/jobs-documen import JobNotesContainer from "../../components/jobs-notes/jobs-notes.container"; import JobsRatesContainer from "../../components/jobs-rates/jobs-rates.container"; import JobDetailFormContext from "./jobs-detail.page.context"; +import JobsDetailInsurance from "../../components/jobs-detail-insurance/jobs-detail-insurance.component"; export default function JobsDetailPage({ job, @@ -79,7 +80,7 @@ export default function JobsDetailPage({ } key='insurance'> - Insurance + Date: Tue, 28 Jan 2020 09:33:47 -0800 Subject: [PATCH 14/23] Finished job detail insurance component --- bodyshop_translations.babel | 233 +++++++++++++++++- .../email-form-item.component.jsx | 16 ++ .../jobs-detail-claims.component.jsx | 17 -- .../jobs-detail-insurance.component.jsx | 65 ++++- client/src/graphql/jobs.queries.js | 58 ++--- client/src/translations/en_us/common.json | 11 + client/src/translations/es/common.json | 11 + client/src/translations/fr/common.json | 11 + .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 220 +++++++++++++++++ .../up.yaml | 224 +++++++++++++++++ .../down.yaml | 218 ++++++++++++++++ .../up.yaml | 222 +++++++++++++++++ .../down.yaml | 220 +++++++++++++++++ .../up.yaml | 224 +++++++++++++++++ 22 files changed, 1707 insertions(+), 67 deletions(-) create mode 100644 client/src/components/form-items-formatted/email-form-item.component.jsx create mode 100644 hasura/migrations/1580232207896_alter_table_public_jobs_add_column_selling_dealer/down.yaml create mode 100644 hasura/migrations/1580232207896_alter_table_public_jobs_add_column_selling_dealer/up.yaml create mode 100644 hasura/migrations/1580232216402_alter_table_public_jobs_add_column_servicing_dealer/down.yaml create mode 100644 hasura/migrations/1580232216402_alter_table_public_jobs_add_column_servicing_dealer/up.yaml create mode 100644 hasura/migrations/1580232321960_alter_table_public_jobs_add_column_servicing_dealer_contact/down.yaml create mode 100644 hasura/migrations/1580232321960_alter_table_public_jobs_add_column_servicing_dealer_contact/up.yaml create mode 100644 hasura/migrations/1580232395019_alter_table_public_jobs_add_column_selling_dealer_contact/down.yaml create mode 100644 hasura/migrations/1580232395019_alter_table_public_jobs_add_column_selling_dealer_contact/up.yaml create mode 100644 hasura/migrations/1580232453942_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580232453942_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1580232464001_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580232464001_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1580232469614_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1580232469614_update_permission_user_public_table_jobs/up.yaml diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 8b3adf828..f264b41e4 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -1,4 +1,4 @@ - +