From 457ec16fdc71bd5dfea39b7976cf1006adfc60ac Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 30 Jan 2020 10:19:37 -0800 Subject: [PATCH 01/70] Removed whiteboard from front page. Added dates fields. Added rates fields. Started refactoring lines page. --- bodyshop_translations.babel | 527 +++++++++++++++++- .../job-detail-cards.dates.component.jsx | 36 +- .../job-detail-lines/job-lines.component.jsx | 89 ++- .../job-detail-lines/job-lines.container.jsx | 57 +- .../jobs-detail-dates.component.jsx | 90 +++ .../jobs-detail-financial.component.jsx | 122 +++- .../jobs-detail-insurance.component.jsx | 2 - client/src/graphql/jobs.queries.js | 39 +- .../jobs-available.page.container.jsx | 9 +- .../jobs-detail.page.component.jsx | 11 +- .../jobs-detail.page.container.jsx | 16 +- .../manage-root.page.component.jsx | 9 + .../manage-root.page.container.jsx | 8 + client/src/pages/manage/manage.page.jsx | 28 +- client/src/translations/en_us/common.json | 25 + client/src/translations/es/common.json | 25 + client/src/translations/fr/common.json | 25 + client/src/utils/DateFormatter.jsx | 2 +- 18 files changed, 1013 insertions(+), 107 deletions(-) create mode 100644 client/src/components/jobs-detail-dates/jobs-detail-dates.component.jsx create mode 100644 client/src/pages/manage-root/manage-root.page.component.jsx create mode 100644 client/src/pages/manage-root/manage-root.page.container.jsx diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 319a8d546..152f7805e 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -1,4 +1,4 @@ - + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/src/assets/unfolded_car.svg b/client/src/assets/unfolded_car.svg index 326293fd1..db3a4d87f 100644 --- a/client/src/assets/unfolded_car.svg +++ b/client/src/assets/unfolded_car.svg @@ -1,6 +1,4 @@ - - - - + id="svg166" + sodipodi:docname="unfolded_car.svg" + inkscape:version="0.92.4 (5da689c313, 2019-01-14)"> + id="metadata172"> image/svg+xml - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x diff --git a/client/src/assets/unfolded_car_clean.svg b/client/src/assets/unfolded_car_clean.svg new file mode 100644 index 000000000..3eb1c2892 --- /dev/null +++ b/client/src/assets/unfolded_car_clean.svg @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x + + diff --git a/client/src/components/job-damage-visual/job-damage-visual.component.jsx b/client/src/components/job-damage-visual/job-damage-visual.component.jsx new file mode 100644 index 000000000..3af1910ab --- /dev/null +++ b/client/src/components/job-damage-visual/job-damage-visual.component.jsx @@ -0,0 +1,735 @@ +import React from "react"; +export default ({ dmg1, dmg2 }) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + // + // x + // + } + + +); diff --git a/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx index ac4ed2a59..0535cc9e3 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx @@ -1,7 +1,7 @@ import React from "react"; import { useTranslation } from "react-i18next"; import CardTemplate from "./job-detail-cards.template.component"; -import UnfoldedCar from "../../assets/unfolded_car.svg"; +import Car from "../job-damage-visual/job-damage-visual.component"; export default function JobDetailCardsDamageComponent({ loading, data }) { const { t } = useTranslation(); @@ -10,11 +10,7 @@ export default function JobDetailCardsDamageComponent({ loading, data }) { console.log("area_of_damage", area_of_damage); return ( - {data ? ( - - Damaged Area - - ) : null} + ); } diff --git a/client/yarn.lock b/client/yarn.lock index df377fa34..b48b372f0 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -8221,7 +8221,7 @@ node-notifier@^5.4.2: shellwords "^0.1.1" which "^1.3.0" -node-pre-gyp@*, node-pre-gyp@^0.14.0: +node-pre-gyp@^0.14.0: version "0.14.0" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83" integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA== @@ -10471,7 +10471,7 @@ react-chartjs-2@^2.9.0: lodash "^4.17.4" prop-types "^15.5.8" -"react-click-outside@github:tj/react-click-outside": +react-click-outside@tj/react-click-outside: version "1.1.1" resolved "https://codeload.github.com/tj/react-click-outside/tar.gz/a833ddc5be47490307f9fcc6ed09d8c353108510" @@ -11276,8 +11276,6 @@ rxjs@^6.5.3: version "6.5.4" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.4.tgz#e0777fe0d184cec7872df147f303572d414e211c" integrity sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q== - dependencies: - tslib "^1.9.0" safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" @@ -11606,9 +11604,9 @@ slice-ansi@^2.1.0: astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" -"smooth-dnd@git+https://github.com/rcdexta/smooth-dnd.git": +"smooth-dnd@https://github.com/rcdexta/smooth-dnd": version "0.6.3" - resolved "git+https://github.com/rcdexta/smooth-dnd.git#f13924c67bf6ffe4613d97bb1ee83f11d364eb1e" + resolved "https://github.com/rcdexta/smooth-dnd#f13924c67bf6ffe4613d97bb1ee83f11d364eb1e" snapdragon-node@^2.0.1: version "2.1.1" From c827a770d282951afad8f306c9dc0bd54584d569 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 10 Feb 2020 15:26:21 -0800 Subject: [PATCH 34/70] Missed in last commit --- .../job-detail-cards/job-detail-cards.damage.component.jsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx index 0535cc9e3..ca274dcc7 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx @@ -5,9 +5,7 @@ import Car from "../job-damage-visual/job-damage-visual.component"; export default function JobDetailCardsDamageComponent({ loading, data }) { const { t } = useTranslation(); - console.log("data", data); const { area_of_damage } = data; - console.log("area_of_damage", area_of_damage); return ( From 51a01d452ccd3f4e936b84bfe6db94bbc0c4b3dc Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 10 Feb 2020 15:41:26 -0800 Subject: [PATCH 35/70] Creation of allocations object. --- .../down.yaml | 3 ++ .../up.yaml | 22 ++++++++++ .../down.yaml | 24 +++++++++++ .../up.yaml | 40 +++++++++++++++++++ .../down.yaml | 6 +++ .../up.yaml | 30 ++++++++++++++ .../down.yaml | 6 +++ .../up.yaml | 27 +++++++++++++ .../down.yaml | 6 +++ .../up.yaml | 29 ++++++++++++++ .../down.yaml | 12 ++++++ .../up.yaml | 29 ++++++++++++++ .../down.yaml | 6 +++ .../up.yaml | 18 +++++++++ 14 files changed, 258 insertions(+) create mode 100644 hasura/migrations/1581377678620_create_table_public_allocations/down.yaml create mode 100644 hasura/migrations/1581377678620_create_table_public_allocations/up.yaml create mode 100644 hasura/migrations/1581377762602_track_all_relationships/down.yaml create mode 100644 hasura/migrations/1581377762602_track_all_relationships/up.yaml create mode 100644 hasura/migrations/1581377891854_update_permission_user_public_table_allocations/down.yaml create mode 100644 hasura/migrations/1581377891854_update_permission_user_public_table_allocations/up.yaml create mode 100644 hasura/migrations/1581377911733_update_permission_user_public_table_allocations/down.yaml create mode 100644 hasura/migrations/1581377911733_update_permission_user_public_table_allocations/up.yaml create mode 100644 hasura/migrations/1581377928527_update_permission_user_public_table_allocations/down.yaml create mode 100644 hasura/migrations/1581377928527_update_permission_user_public_table_allocations/up.yaml create mode 100644 hasura/migrations/1581377943700_update_permission_user_public_table_allocations/down.yaml create mode 100644 hasura/migrations/1581377943700_update_permission_user_public_table_allocations/up.yaml create mode 100644 hasura/migrations/1581378054962_update_permission_user_public_table_allocations/down.yaml create mode 100644 hasura/migrations/1581378054962_update_permission_user_public_table_allocations/up.yaml diff --git a/hasura/migrations/1581377678620_create_table_public_allocations/down.yaml b/hasura/migrations/1581377678620_create_table_public_allocations/down.yaml new file mode 100644 index 000000000..f4b507c6a --- /dev/null +++ b/hasura/migrations/1581377678620_create_table_public_allocations/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: DROP TABLE "public"."allocations" + type: run_sql diff --git a/hasura/migrations/1581377678620_create_table_public_allocations/up.yaml b/hasura/migrations/1581377678620_create_table_public_allocations/up.yaml new file mode 100644 index 000000000..9d1eab3eb --- /dev/null +++ b/hasura/migrations/1581377678620_create_table_public_allocations/up.yaml @@ -0,0 +1,22 @@ +- args: + sql: CREATE EXTENSION IF NOT EXISTS pgcrypto; + type: run_sql +- args: + sql: "CREATE TABLE \"public\".\"allocations\"(\"id\" uuid NOT NULL DEFAULT gen_random_uuid(), + \"created_at\" timestamptz NOT NULL DEFAULT now(), \"updated_at\" timestamptz + NOT NULL DEFAULT now(), \"joblineid\" uuid NOT NULL, \"employeeid\" uuid NOT + NULL, \"hours\" numeric NOT NULL DEFAULT 0, PRIMARY KEY (\"id\") , FOREIGN KEY + (\"joblineid\") REFERENCES \"public\".\"joblines\"(\"id\") ON UPDATE cascade + ON DELETE cascade, FOREIGN KEY (\"employeeid\") REFERENCES \"public\".\"employees\"(\"id\") + ON UPDATE cascade ON DELETE cascade);\nCREATE OR REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS + TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\" + = NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_allocations_updated_at\"\nBEFORE + UPDATE ON \"public\".\"allocations\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT + ON TRIGGER \"set_public_allocations_updated_at\" ON \"public\".\"allocations\" + \nIS 'trigger to set value of column \"updated_at\" to current timestamp on + row update';\n" + type: run_sql +- args: + name: allocations + schema: public + type: add_existing_table_or_view diff --git a/hasura/migrations/1581377762602_track_all_relationships/down.yaml b/hasura/migrations/1581377762602_track_all_relationships/down.yaml new file mode 100644 index 000000000..861a6656b --- /dev/null +++ b/hasura/migrations/1581377762602_track_all_relationships/down.yaml @@ -0,0 +1,24 @@ +- args: + relationship: employee + table: + name: allocations + schema: public + type: drop_relationship +- args: + relationship: jobline + table: + name: allocations + schema: public + type: drop_relationship +- args: + relationship: allocations + table: + name: employees + schema: public + type: drop_relationship +- args: + relationship: allocations + table: + name: joblines + schema: public + type: drop_relationship diff --git a/hasura/migrations/1581377762602_track_all_relationships/up.yaml b/hasura/migrations/1581377762602_track_all_relationships/up.yaml new file mode 100644 index 000000000..8db552fb1 --- /dev/null +++ b/hasura/migrations/1581377762602_track_all_relationships/up.yaml @@ -0,0 +1,40 @@ +- args: + name: employee + table: + name: allocations + schema: public + using: + foreign_key_constraint_on: employeeid + type: create_object_relationship +- args: + name: jobline + table: + name: allocations + schema: public + using: + foreign_key_constraint_on: joblineid + type: create_object_relationship +- args: + name: allocations + table: + name: employees + schema: public + using: + foreign_key_constraint_on: + column: employeeid + table: + name: allocations + schema: public + type: create_array_relationship +- args: + name: allocations + table: + name: joblines + schema: public + using: + foreign_key_constraint_on: + column: joblineid + table: + name: allocations + schema: public + type: create_array_relationship diff --git a/hasura/migrations/1581377891854_update_permission_user_public_table_allocations/down.yaml b/hasura/migrations/1581377891854_update_permission_user_public_table_allocations/down.yaml new file mode 100644 index 000000000..a2e882f60 --- /dev/null +++ b/hasura/migrations/1581377891854_update_permission_user_public_table_allocations/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: allocations + schema: public + type: drop_insert_permission diff --git a/hasura/migrations/1581377891854_update_permission_user_public_table_allocations/up.yaml b/hasura/migrations/1581377891854_update_permission_user_public_table_allocations/up.yaml new file mode 100644 index 000000000..e980d01b1 --- /dev/null +++ b/hasura/migrations/1581377891854_update_permission_user_public_table_allocations/up.yaml @@ -0,0 +1,30 @@ +- args: + permission: + allow_upsert: true + check: + jobline: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - hours + - created_at + - updated_at + - employeeid + - id + - joblineid + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: allocations + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581377911733_update_permission_user_public_table_allocations/down.yaml b/hasura/migrations/1581377911733_update_permission_user_public_table_allocations/down.yaml new file mode 100644 index 000000000..8f88611f4 --- /dev/null +++ b/hasura/migrations/1581377911733_update_permission_user_public_table_allocations/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: allocations + schema: public + type: drop_select_permission diff --git a/hasura/migrations/1581377911733_update_permission_user_public_table_allocations/up.yaml b/hasura/migrations/1581377911733_update_permission_user_public_table_allocations/up.yaml new file mode 100644 index 000000000..4135b17a3 --- /dev/null +++ b/hasura/migrations/1581377911733_update_permission_user_public_table_allocations/up.yaml @@ -0,0 +1,27 @@ +- args: + permission: + allow_aggregations: false + columns: + - hours + - created_at + - updated_at + - employeeid + - id + - joblineid + filter: + jobline: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + limit: null + role: user + table: + name: allocations + schema: public + type: create_select_permission diff --git a/hasura/migrations/1581377928527_update_permission_user_public_table_allocations/down.yaml b/hasura/migrations/1581377928527_update_permission_user_public_table_allocations/down.yaml new file mode 100644 index 000000000..86985cb7e --- /dev/null +++ b/hasura/migrations/1581377928527_update_permission_user_public_table_allocations/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: allocations + schema: public + type: drop_update_permission diff --git a/hasura/migrations/1581377928527_update_permission_user_public_table_allocations/up.yaml b/hasura/migrations/1581377928527_update_permission_user_public_table_allocations/up.yaml new file mode 100644 index 000000000..0156cbb97 --- /dev/null +++ b/hasura/migrations/1581377928527_update_permission_user_public_table_allocations/up.yaml @@ -0,0 +1,29 @@ +- args: + permission: + columns: + - hours + - created_at + - updated_at + - employeeid + - id + - joblineid + filter: + jobline: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: allocations + schema: public + type: create_update_permission diff --git a/hasura/migrations/1581377943700_update_permission_user_public_table_allocations/down.yaml b/hasura/migrations/1581377943700_update_permission_user_public_table_allocations/down.yaml new file mode 100644 index 000000000..7027008cb --- /dev/null +++ b/hasura/migrations/1581377943700_update_permission_user_public_table_allocations/down.yaml @@ -0,0 +1,12 @@ +- args: + role: user + table: + name: allocations + schema: public + type: drop_update_permission +- args: + role: user + table: + name: allocations + schema: public + type: create_update_permission diff --git a/hasura/migrations/1581377943700_update_permission_user_public_table_allocations/up.yaml b/hasura/migrations/1581377943700_update_permission_user_public_table_allocations/up.yaml new file mode 100644 index 000000000..ed61f4bd9 --- /dev/null +++ b/hasura/migrations/1581377943700_update_permission_user_public_table_allocations/up.yaml @@ -0,0 +1,29 @@ +- args: + role: user + table: + name: allocations + schema: public + type: drop_update_permission +- args: + permission: + columns: [] + filter: + jobline: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: allocations + schema: public + type: create_update_permission diff --git a/hasura/migrations/1581378054962_update_permission_user_public_table_allocations/down.yaml b/hasura/migrations/1581378054962_update_permission_user_public_table_allocations/down.yaml new file mode 100644 index 000000000..99ab508be --- /dev/null +++ b/hasura/migrations/1581378054962_update_permission_user_public_table_allocations/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: allocations + schema: public + type: drop_delete_permission diff --git a/hasura/migrations/1581378054962_update_permission_user_public_table_allocations/up.yaml b/hasura/migrations/1581378054962_update_permission_user_public_table_allocations/up.yaml new file mode 100644 index 000000000..6f33b6d84 --- /dev/null +++ b/hasura/migrations/1581378054962_update_permission_user_public_table_allocations/up.yaml @@ -0,0 +1,18 @@ +- args: + permission: + filter: + jobline: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: allocations + schema: public + type: create_delete_permission From cf6d51e8963988cf11ef398b335bc0923fbcc245 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 10 Feb 2020 19:19:48 -0800 Subject: [PATCH 36/70] Added allocation adding + basic pull --- bodyshop_translations.babel | 78 +++++++++++++++++++ .../allocations-assignment.component.jsx | 76 ++++++++++++++++++ .../allocations-assignment.container.jsx | 38 +++++++++ .../job-detail-lines/job-lines.component.jsx | 33 ++++++++ client/src/graphql/allocations.queries.js | 11 +++ client/src/graphql/bodyshop.queries.js | 7 ++ client/src/graphql/jobs-lines.queries.js | 9 +++ client/src/translations/en_us/common.json | 9 +++ client/src/translations/es/common.json | 9 +++ client/src/translations/fr/common.json | 9 +++ 10 files changed, 279 insertions(+) create mode 100644 client/src/components/allocations-assignment/allocations-assignment.component.jsx create mode 100644 client/src/components/allocations-assignment/allocations-assignment.container.jsx create mode 100644 client/src/graphql/allocations.queries.js diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index e3f709fc7..17d6e7b03 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -18,6 +18,63 @@ translation + + allocations + + + actions + + + assign + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + + + fields + + + employee + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + + + appointments @@ -1456,6 +1513,27 @@ + + mod_lb_hrs + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + oem_partno false diff --git a/client/src/components/allocations-assignment/allocations-assignment.component.jsx b/client/src/components/allocations-assignment/allocations-assignment.component.jsx new file mode 100644 index 000000000..f3f3a0a8a --- /dev/null +++ b/client/src/components/allocations-assignment/allocations-assignment.component.jsx @@ -0,0 +1,76 @@ +import { Select, Button, Popover, InputNumber } from "antd"; +import React from "react"; +import { useTranslation } from "react-i18next"; +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { selectBodyshop } from "../../redux/user/user.selectors"; + +const mapStateToProps = createStructuredSelector({ + bodyshop: selectBodyshop +}); + +export default connect( + mapStateToProps, + null +)(function AllocationsAssignmentComponent({ + bodyshop, + handleAssignment, + assignment, + setAssignment, + visibilityState, + maxHours +}) { + const { t } = useTranslation(); + + const onChange = e => { + console.log("e", e); + setAssignment({ ...assignment, employeeid: e }); + }; + + const [visibility, setVisibility] = visibilityState; + + const popContent = ( +
+ + setAssignment({ ...assignment, hours: e })} + /> + + + +
+ ); + + return ( + + + + ); +}); diff --git a/client/src/components/allocations-assignment/allocations-assignment.container.jsx b/client/src/components/allocations-assignment/allocations-assignment.container.jsx new file mode 100644 index 000000000..3369d6904 --- /dev/null +++ b/client/src/components/allocations-assignment/allocations-assignment.container.jsx @@ -0,0 +1,38 @@ +import React, { useState } from "react"; +import AllocationsAssignmentComponent from "./allocations-assignment.component"; +import { useMutation } from "react-apollo"; +import { INSERT_ALLOCATION } from "../../graphql/allocations.queries"; +import { useTranslation } from "react-i18next"; +import { notification } from "antd"; + +export default function AllocationsAssignmentContainer({ jobLineId, hours }) { + const visibilityState = useState(false); + const { t } = useTranslation(); + const [assignment, setAssignment] = useState({ + joblineid: jobLineId, + hours: parseFloat(hours), + employeeid: null + }); + const [insertAllocation] = useMutation(INSERT_ALLOCATION); + + const handleAssignment = () => { + insertAllocation({ variables: { alloc: { ...assignment } } }).then(r => { + notification["success"]({ + message: t("employees.successes.save") + }); + //TODO: Better way to reset the field decorators? + visibilityState[1](false); + //refetch().then(r => form.resetFields()); + }); + }; + + return ( + + ); +} diff --git a/client/src/components/job-detail-lines/job-lines.component.jsx b/client/src/components/job-detail-lines/job-lines.component.jsx index a02f0bed8..97ba507a5 100644 --- a/client/src/components/job-detail-lines/job-lines.component.jsx +++ b/client/src/components/job-detail-lines/job-lines.component.jsx @@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next"; import CurrencyFormatter from "../../utils/CurrencyFormatter"; import { alphaSort } from "../../utils/sorters"; //import EditableCell from "./job-lines-cell.component"; +import AllocationsAssignmentContainer from "../allocations-assignment/allocations-assignment.container"; export default function JobLinesComponent({ jobLines, @@ -97,6 +98,38 @@ export default function JobLinesComponent({ render: (text, record) => ( {record.act_price} ) + }, + { + title: t("joblines.fields.mod_lb_hrs"), + dataIndex: "mod_lb_hrs", + key: "mod_lb_hrs", + sorter: (a, b) => a.mod_lb_hrs - b.mod_lb_hrs, + sortOrder: + state.sortedInfo.columnKey === "mod_lb_hrs" && state.sortedInfo.order + }, + { + title: t("allocations.fields.employee"), + dataIndex: "employee", + key: "employee", + sorter: (a, b) => a.act_price - b.act_price, //TODO Fix employee sorting. + sortOrder: + state.sortedInfo.columnKey === "employee" && state.sortedInfo.order, + render: (text, record) => ( + + {record.allocations && record.allocations.length > 0 + ? record.allocations.map(item => ( +
{`${item.employee.first_name} ${item.employee.last_name} (${item.hours})`}
+ )) + : null} + +
+ ) } ]; diff --git a/client/src/graphql/allocations.queries.js b/client/src/graphql/allocations.queries.js new file mode 100644 index 000000000..728f5534c --- /dev/null +++ b/client/src/graphql/allocations.queries.js @@ -0,0 +1,11 @@ +import { gql } from "apollo-boost"; + +export const INSERT_ALLOCATION = gql` + mutation INSERT_ALLOCATION($alloc: [allocations_insert_input!]!) { + insert_allocations(objects: $alloc) { + returning { + id + } + } + } +`; diff --git a/client/src/graphql/bodyshop.queries.js b/client/src/graphql/bodyshop.queries.js index 23081b0cb..facc647a6 100644 --- a/client/src/graphql/bodyshop.queries.js +++ b/client/src/graphql/bodyshop.queries.js @@ -20,6 +20,13 @@ export const QUERY_BODYSHOP = gql` updated_at zip_post region_config + employees { + id + first_name + last_name + employee_number + cost_center + } } } `; diff --git a/client/src/graphql/jobs-lines.queries.js b/client/src/graphql/jobs-lines.queries.js index 334097e37..5efd5ccd0 100644 --- a/client/src/graphql/jobs-lines.queries.js +++ b/client/src/graphql/jobs-lines.queries.js @@ -18,6 +18,15 @@ export const GET_JOB_LINES_BY_PK = gql` lbr_op lbr_amt op_code_desc + allocations { + id + hours + employee { + id + first_name + last_name + } + } } } `; diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index b4832f728..1968bd4bb 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1,5 +1,13 @@ { "translation": { + "allocations": { + "actions": { + "assign": "Assign" + }, + "fields": { + "employee": "Allocated To" + } + }, "appointments": { "actions": { "cancel": "Cancel", @@ -116,6 +124,7 @@ "act_price": "Actual Price", "db_price": "Database Price", "line_desc": "Line Description", + "mod_lb_hrs": "Labor Hours", "oem_partno": "OEM Part #", "part_type": "Part Type", "unq_seq": "Seq #" diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 7bc56c0c8..c33605a43 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1,5 +1,13 @@ { "translation": { + "allocations": { + "actions": { + "assign": "Asignar" + }, + "fields": { + "employee": "Asignado a" + } + }, "appointments": { "actions": { "cancel": "Cancelar", @@ -116,6 +124,7 @@ "act_price": "Precio actual", "db_price": "Precio de base de datos", "line_desc": "Descripción de línea", + "mod_lb_hrs": "Horas laborales", "oem_partno": "OEM parte #", "part_type": "Tipo de parte", "unq_seq": "Seq #" diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 8dfe552f3..b0ef0b149 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1,5 +1,13 @@ { "translation": { + "allocations": { + "actions": { + "assign": "Attribuer" + }, + "fields": { + "employee": "Alloué à" + } + }, "appointments": { "actions": { "cancel": "annuler", @@ -116,6 +124,7 @@ "act_price": "Prix actuel", "db_price": "Prix de la base de données", "line_desc": "Description de la ligne", + "mod_lb_hrs": "Heures de travail", "oem_partno": "Pièce OEM #", "part_type": "Type de pièce", "unq_seq": "Seq #" From 314c9e82d2fc8dbc81aab7a051a45c2766b90fc8 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 12 Feb 2020 10:01:03 -0800 Subject: [PATCH 37/70] Jobs fields updates to handle storage of TTL and STL files. --- .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 244 +++++++++++++++++ .../up.yaml | 245 +++++++++++++++++ .../down.yaml | 242 +++++++++++++++++ .../up.yaml | 243 +++++++++++++++++ .../down.yaml | 244 +++++++++++++++++ .../up.yaml | 245 +++++++++++++++++ .../down.yaml | 3 + .../up.yaml | 4 + .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 245 +++++++++++++++++ .../up.yaml | 246 ++++++++++++++++++ .../down.yaml | 243 +++++++++++++++++ .../up.yaml | 244 +++++++++++++++++ .../down.yaml | 245 +++++++++++++++++ .../up.yaml | 246 ++++++++++++++++++ .../down.yaml | 9 + .../up.yaml | 3 + 20 files changed, 2963 insertions(+) create mode 100644 hasura/migrations/1581527154709_alter_table_public_jobs_add_column_cieca_stl/down.yaml create mode 100644 hasura/migrations/1581527154709_alter_table_public_jobs_add_column_cieca_stl/up.yaml create mode 100644 hasura/migrations/1581528231712_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1581528231712_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1581528238817_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1581528238817_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1581528245337_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1581528245337_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1581528309153_alter_table_public_jobs_add_column_g_bett_amt/down.yaml create mode 100644 hasura/migrations/1581528309153_alter_table_public_jobs_add_column_g_bett_amt/up.yaml create mode 100644 hasura/migrations/1581528565073_alter_table_public_jobs_add_column_cieca_ttl/down.yaml create mode 100644 hasura/migrations/1581528565073_alter_table_public_jobs_add_column_cieca_ttl/up.yaml create mode 100644 hasura/migrations/1581529463377_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1581529463377_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1581529471244_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1581529471244_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1581529480083_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1581529480083_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1581529492693_alter_table_public_jobs_drop_column_deductible/down.yaml create mode 100644 hasura/migrations/1581529492693_alter_table_public_jobs_drop_column_deductible/up.yaml diff --git a/hasura/migrations/1581527154709_alter_table_public_jobs_add_column_cieca_stl/down.yaml b/hasura/migrations/1581527154709_alter_table_public_jobs_add_column_cieca_stl/down.yaml new file mode 100644 index 000000000..3c799734a --- /dev/null +++ b/hasura/migrations/1581527154709_alter_table_public_jobs_add_column_cieca_stl/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "cieca_stl"; + type: run_sql diff --git a/hasura/migrations/1581527154709_alter_table_public_jobs_add_column_cieca_stl/up.yaml b/hasura/migrations/1581527154709_alter_table_public_jobs_add_column_cieca_stl/up.yaml new file mode 100644 index 000000000..f7c4980a9 --- /dev/null +++ b/hasura/migrations/1581527154709_alter_table_public_jobs_add_column_cieca_stl/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "cieca_stl" jsonb NULL; + type: run_sql diff --git a/hasura/migrations/1581528231712_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1581528231712_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..488ed01e7 --- /dev/null +++ b/hasura/migrations/1581528231712_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,244 @@ +- 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 + - 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 + - csr + - po_number + - unit_number + - kmin + - kmout + - referral_source + - selling_dealer + - servicing_dealer + - servicing_dealer_contact + - selling_dealer_contact + - depreciation_taxes + - federal_tax_payable + - other_amount_payable + - towing_payable + - storage_payable + - adjustment_bottom_line + - tax_pstthr + - tax_tow_rt + - tax_sub_rt + - tax_paint_mat_rt + - tax_levies_rt + - tax_prethr + - tax_thramt + - tax_str_rt + - tax_lbr_rt + - adj_g_disc + - adj_towdis + - adj_strdis + - tax_predis + - rate_laa + - status + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581528231712_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1581528231712_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..df87d525d --- /dev/null +++ b/hasura/migrations/1581528231712_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,245 @@ +- 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 + - 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 + - csr + - po_number + - unit_number + - kmin + - kmout + - referral_source + - selling_dealer + - servicing_dealer + - servicing_dealer_contact + - selling_dealer_contact + - depreciation_taxes + - federal_tax_payable + - other_amount_payable + - towing_payable + - storage_payable + - adjustment_bottom_line + - tax_pstthr + - tax_tow_rt + - tax_sub_rt + - tax_paint_mat_rt + - tax_levies_rt + - tax_prethr + - tax_thramt + - tax_str_rt + - tax_lbr_rt + - adj_g_disc + - adj_towdis + - adj_strdis + - tax_predis + - rate_laa + - status + - cieca_stl + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581528238817_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1581528238817_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..a6ed6c817 --- /dev/null +++ b/hasura/migrations/1581528238817_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,242 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - converted + - inproduction + - special_coverage_policy + - theft_ind + - tlos_ind + - asgn_date + - invoice_date + - loss_date + - pay_date + - kmin + - kmout + - est_number + - area_of_damage + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - clm_total + - ded_amt + - deductible + - depreciation_taxes + - federal_tax_payable + - federal_tax_rate + - local_tax_rate + - other_amount_payable + - owner_owing + - pay_amt + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - 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 + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_str_rt + - tax_thramt + - towing_payable + - 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 + - csr + - 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 + - po_number + - referral_source + - regie_number + - ro_number + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - status + - unit_number + - 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 + - tax_pstthr + - tax_sub_rt + - tax_tow_rt + 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/1581528238817_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1581528238817_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..877c16c63 --- /dev/null +++ b/hasura/migrations/1581528238817_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,243 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - converted + - inproduction + - special_coverage_policy + - theft_ind + - tlos_ind + - asgn_date + - invoice_date + - loss_date + - pay_date + - kmin + - kmout + - est_number + - area_of_damage + - cieca_stl + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - clm_total + - ded_amt + - deductible + - depreciation_taxes + - federal_tax_payable + - federal_tax_rate + - local_tax_rate + - other_amount_payable + - owner_owing + - pay_amt + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - 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 + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_str_rt + - tax_thramt + - towing_payable + - 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 + - csr + - 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 + - po_number + - referral_source + - regie_number + - ro_number + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - status + - unit_number + - 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 + - tax_pstthr + - tax_sub_rt + - tax_tow_rt + 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/1581528245337_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1581528245337_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..973b2115c --- /dev/null +++ b/hasura/migrations/1581528245337_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,244 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - converted + - inproduction + - special_coverage_policy + - theft_ind + - tlos_ind + - asgn_date + - invoice_date + - loss_date + - pay_date + - kmin + - kmout + - est_number + - area_of_damage + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - clm_total + - ded_amt + - deductible + - depreciation_taxes + - federal_tax_payable + - federal_tax_rate + - local_tax_rate + - other_amount_payable + - owner_owing + - pay_amt + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - 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 + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_str_rt + - tax_thramt + - towing_payable + - 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 + - csr + - 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 + - po_number + - referral_source + - regie_number + - ro_number + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - status + - unit_number + - 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 + - tax_pstthr + - tax_sub_rt + - tax_tow_rt + 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/1581528245337_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1581528245337_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..bbee90d97 --- /dev/null +++ b/hasura/migrations/1581528245337_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,245 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - converted + - inproduction + - special_coverage_policy + - theft_ind + - tlos_ind + - asgn_date + - invoice_date + - loss_date + - pay_date + - kmin + - kmout + - est_number + - area_of_damage + - cieca_stl + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - clm_total + - ded_amt + - deductible + - depreciation_taxes + - federal_tax_payable + - federal_tax_rate + - local_tax_rate + - other_amount_payable + - owner_owing + - pay_amt + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - 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 + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_str_rt + - tax_thramt + - towing_payable + - 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 + - csr + - 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 + - po_number + - referral_source + - regie_number + - ro_number + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - status + - unit_number + - 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 + - tax_pstthr + - tax_sub_rt + - tax_tow_rt + 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/1581528309153_alter_table_public_jobs_add_column_g_bett_amt/down.yaml b/hasura/migrations/1581528309153_alter_table_public_jobs_add_column_g_bett_amt/down.yaml new file mode 100644 index 000000000..d2ad3b020 --- /dev/null +++ b/hasura/migrations/1581528309153_alter_table_public_jobs_add_column_g_bett_amt/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "g_bett_amt"; + type: run_sql diff --git a/hasura/migrations/1581528309153_alter_table_public_jobs_add_column_g_bett_amt/up.yaml b/hasura/migrations/1581528309153_alter_table_public_jobs_add_column_g_bett_amt/up.yaml new file mode 100644 index 000000000..01322d071 --- /dev/null +++ b/hasura/migrations/1581528309153_alter_table_public_jobs_add_column_g_bett_amt/up.yaml @@ -0,0 +1,4 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "g_bett_amt" numeric NULL DEFAULT + 0; + type: run_sql diff --git a/hasura/migrations/1581528565073_alter_table_public_jobs_add_column_cieca_ttl/down.yaml b/hasura/migrations/1581528565073_alter_table_public_jobs_add_column_cieca_ttl/down.yaml new file mode 100644 index 000000000..20466624d --- /dev/null +++ b/hasura/migrations/1581528565073_alter_table_public_jobs_add_column_cieca_ttl/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "cieca_ttl"; + type: run_sql diff --git a/hasura/migrations/1581528565073_alter_table_public_jobs_add_column_cieca_ttl/up.yaml b/hasura/migrations/1581528565073_alter_table_public_jobs_add_column_cieca_ttl/up.yaml new file mode 100644 index 000000000..4edc58e27 --- /dev/null +++ b/hasura/migrations/1581528565073_alter_table_public_jobs_add_column_cieca_ttl/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "cieca_ttl" jsonb NULL; + type: run_sql diff --git a/hasura/migrations/1581529463377_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1581529463377_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..df87d525d --- /dev/null +++ b/hasura/migrations/1581529463377_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,245 @@ +- 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 + - 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 + - csr + - po_number + - unit_number + - kmin + - kmout + - referral_source + - selling_dealer + - servicing_dealer + - servicing_dealer_contact + - selling_dealer_contact + - depreciation_taxes + - federal_tax_payable + - other_amount_payable + - towing_payable + - storage_payable + - adjustment_bottom_line + - tax_pstthr + - tax_tow_rt + - tax_sub_rt + - tax_paint_mat_rt + - tax_levies_rt + - tax_prethr + - tax_thramt + - tax_str_rt + - tax_lbr_rt + - adj_g_disc + - adj_towdis + - adj_strdis + - tax_predis + - rate_laa + - status + - cieca_stl + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581529463377_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1581529463377_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..de3be1a36 --- /dev/null +++ b/hasura/migrations/1581529463377_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,246 @@ +- 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 + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - 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 + - cieca_stl + - cieca_ttl + - 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_total + - clm_zip + - converted + - created_at + - csr + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - depreciation_taxes + - 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_payable + - federal_tax_rate + - g_bett_amt + - 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 + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - 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 + - po_number + - policy_no + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - 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 + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - statusid + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - updated_at + - vehicleid + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: jobs + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581529471244_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1581529471244_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..877c16c63 --- /dev/null +++ b/hasura/migrations/1581529471244_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,243 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - converted + - inproduction + - special_coverage_policy + - theft_ind + - tlos_ind + - asgn_date + - invoice_date + - loss_date + - pay_date + - kmin + - kmout + - est_number + - area_of_damage + - cieca_stl + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - clm_total + - ded_amt + - deductible + - depreciation_taxes + - federal_tax_payable + - federal_tax_rate + - local_tax_rate + - other_amount_payable + - owner_owing + - pay_amt + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - 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 + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_str_rt + - tax_thramt + - towing_payable + - 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 + - csr + - 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 + - po_number + - referral_source + - regie_number + - ro_number + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - status + - unit_number + - 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 + - tax_pstthr + - tax_sub_rt + - tax_tow_rt + 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/1581529471244_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1581529471244_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..16d2b6fb7 --- /dev/null +++ b/hasura/migrations/1581529471244_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,244 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - 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 + - cieca_stl + - cieca_ttl + - 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_total + - clm_zip + - converted + - created_at + - csr + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - depreciation_taxes + - 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_payable + - federal_tax_rate + - g_bett_amt + - 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 + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - 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 + - po_number + - policy_no + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - 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 + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - statusid + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - 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/1581529480083_update_permission_user_public_table_jobs/down.yaml b/hasura/migrations/1581529480083_update_permission_user_public_table_jobs/down.yaml new file mode 100644 index 000000000..bbee90d97 --- /dev/null +++ b/hasura/migrations/1581529480083_update_permission_user_public_table_jobs/down.yaml @@ -0,0 +1,245 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - converted + - inproduction + - special_coverage_policy + - theft_ind + - tlos_ind + - asgn_date + - invoice_date + - loss_date + - pay_date + - kmin + - kmout + - est_number + - area_of_damage + - cieca_stl + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - clm_total + - ded_amt + - deductible + - depreciation_taxes + - federal_tax_payable + - federal_tax_rate + - local_tax_rate + - other_amount_payable + - owner_owing + - pay_amt + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - 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 + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_str_rt + - tax_thramt + - towing_payable + - 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 + - csr + - 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 + - po_number + - referral_source + - regie_number + - ro_number + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - status + - unit_number + - 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 + - tax_pstthr + - tax_sub_rt + - tax_tow_rt + 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/1581529480083_update_permission_user_public_table_jobs/up.yaml b/hasura/migrations/1581529480083_update_permission_user_public_table_jobs/up.yaml new file mode 100644 index 000000000..90840138f --- /dev/null +++ b/hasura/migrations/1581529480083_update_permission_user_public_table_jobs/up.yaml @@ -0,0 +1,246 @@ +- args: + role: user + table: + name: jobs + schema: public + type: drop_update_permission +- args: + permission: + columns: + - actual_completion + - actual_delivery + - actual_in + - adj_g_disc + - adj_strdis + - adj_towdis + - adjustment_bottom_line + - 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 + - cieca_stl + - cieca_ttl + - 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_total + - clm_zip + - converted + - created_at + - csr + - cust_pr + - date_closed + - date_estimated + - date_exported + - date_invoiced + - date_open + - date_scheduled + - ded_amt + - ded_status + - depreciation_taxes + - 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_payable + - federal_tax_rate + - g_bett_amt + - 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 + - kmin + - kmout + - labor_rate_desc + - labor_rate_id + - local_tax_rate + - loss_cat + - loss_date + - loss_desc + - loss_type + - other_amount_payable + - 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 + - po_number + - policy_no + - rate_atp + - rate_la1 + - rate_la2 + - rate_la3 + - rate_la4 + - rate_laa + - 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 + - referral_source + - regie_number + - ro_number + - scheduled_completion + - scheduled_delivery + - scheduled_in + - selling_dealer + - selling_dealer_contact + - service_car + - servicing_dealer + - servicing_dealer_contact + - shopid + - special_coverage_policy + - state_tax_rate + - status + - statusid + - storage_payable + - tax_lbr_rt + - tax_levies_rt + - tax_paint_mat_rt + - tax_predis + - tax_prethr + - tax_pstthr + - tax_str_rt + - tax_sub_rt + - tax_thramt + - tax_tow_rt + - theft_ind + - tlos_ind + - towing_payable + - unit_number + - 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/1581529492693_alter_table_public_jobs_drop_column_deductible/down.yaml b/hasura/migrations/1581529492693_alter_table_public_jobs_drop_column_deductible/down.yaml new file mode 100644 index 000000000..723e71438 --- /dev/null +++ b/hasura/migrations/1581529492693_alter_table_public_jobs_drop_column_deductible/down.yaml @@ -0,0 +1,9 @@ +- args: + sql: ALTER TABLE "public"."jobs" ADD COLUMN "deductible" numeric + type: run_sql +- args: + sql: ALTER TABLE "public"."jobs" ALTER COLUMN "deductible" DROP NOT NULL + type: run_sql +- args: + sql: ALTER TABLE "public"."jobs" ALTER COLUMN "deductible" SET DEFAULT 0 + type: run_sql diff --git a/hasura/migrations/1581529492693_alter_table_public_jobs_drop_column_deductible/up.yaml b/hasura/migrations/1581529492693_alter_table_public_jobs_drop_column_deductible/up.yaml new file mode 100644 index 000000000..396306235 --- /dev/null +++ b/hasura/migrations/1581529492693_alter_table_public_jobs_drop_column_deductible/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."jobs" DROP COLUMN "deductible" CASCADE + type: run_sql From 63f8267deda3654cae747ed7828930461906f19e Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 12 Feb 2020 12:11:35 -0800 Subject: [PATCH 38/70] Adding of generic appointments to calendar. --- bodyshop_translations.babel | 47 +++++++++ .../schedule-appointment-modal.component.jsx | 67 +++++++++++++ .../schedule-appointment-modal.container.jsx | 74 ++++++++++++++ .../schedule-calendar.component.jsx | 45 +++++++-- .../schedule-calendar.container.jsx | 4 +- .../schedule-event.component.jsx | 99 +++++++++++++------ .../schedule-job-modal.container.jsx | 8 +- client/src/graphql/appointments.queries.js | 9 +- .../pages/manage/manage.page.container.jsx | 22 +++-- client/src/translations/en_us/common.json | 4 + client/src/translations/es/common.json | 4 + client/src/translations/fr/common.json | 4 + .../down.yaml | 3 + .../up.yaml | 4 + .../down.yaml | 36 +++++++ .../up.yaml | 37 +++++++ .../down.yaml | 34 +++++++ .../up.yaml | 35 +++++++ .../down.yaml | 36 +++++++ .../up.yaml | 37 +++++++ .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 4 + .../up.yaml | 6 ++ .../down.yaml | 6 ++ .../up.yaml | 6 ++ .../down.yaml | 12 +++ .../up.yaml | 20 ++++ .../down.yaml | 37 +++++++ .../up.yaml | 36 +++++++ .../down.yaml | 36 +++++++ .../up.yaml | 37 +++++++ .../down.yaml | 35 +++++++ .../up.yaml | 35 +++++++ .../down.yaml | 37 +++++++ .../up.yaml | 37 +++++++ .../down.yaml | 23 +++++ .../up.yaml | 22 +++++ .../down.yaml | 3 + .../up.yaml | 3 + .../down.yaml | 37 +++++++ .../up.yaml | 38 +++++++ .../down.yaml | 35 +++++++ .../up.yaml | 36 +++++++ .../down.yaml | 37 +++++++ .../up.yaml | 38 +++++++ 46 files changed, 1187 insertions(+), 44 deletions(-) create mode 100644 client/src/components/schedule-appointment-modal/schedule-appointment-modal.component.jsx create mode 100644 client/src/components/schedule-appointment-modal/schedule-appointment-modal.container.jsx create mode 100644 hasura/migrations/1581530616257_alter_table_public_appointments_add_column_isintake/down.yaml create mode 100644 hasura/migrations/1581530616257_alter_table_public_appointments_add_column_isintake/up.yaml create mode 100644 hasura/migrations/1581530623178_update_permission_user_public_table_appointments/down.yaml create mode 100644 hasura/migrations/1581530623178_update_permission_user_public_table_appointments/up.yaml create mode 100644 hasura/migrations/1581530628660_update_permission_user_public_table_appointments/down.yaml create mode 100644 hasura/migrations/1581530628660_update_permission_user_public_table_appointments/up.yaml create mode 100644 hasura/migrations/1581530632721_update_permission_user_public_table_appointments/down.yaml create mode 100644 hasura/migrations/1581530632721_update_permission_user_public_table_appointments/up.yaml create mode 100644 hasura/migrations/1581533010996_alter_table_public_appointments_add_column_bodyshopid/down.yaml create mode 100644 hasura/migrations/1581533010996_alter_table_public_appointments_add_column_bodyshopid/up.yaml create mode 100644 hasura/migrations/1581533025791_set_fk_public_appointments_bodyshopid/down.yaml create mode 100644 hasura/migrations/1581533025791_set_fk_public_appointments_bodyshopid/up.yaml create mode 100644 hasura/migrations/1581533035763_alter_table_public_appointments_alter_column_jobid/down.yaml create mode 100644 hasura/migrations/1581533035763_alter_table_public_appointments_alter_column_jobid/up.yaml create mode 100644 hasura/migrations/1581533044908_track_all_relationships/down.yaml create mode 100644 hasura/migrations/1581533044908_track_all_relationships/up.yaml create mode 100644 hasura/migrations/1581533078439_update_permission_user_public_table_appointments/down.yaml create mode 100644 hasura/migrations/1581533078439_update_permission_user_public_table_appointments/up.yaml create mode 100644 hasura/migrations/1581533085254_update_permission_user_public_table_appointments/down.yaml create mode 100644 hasura/migrations/1581533085254_update_permission_user_public_table_appointments/up.yaml create mode 100644 hasura/migrations/1581533092537_update_permission_user_public_table_appointments/down.yaml create mode 100644 hasura/migrations/1581533092537_update_permission_user_public_table_appointments/up.yaml create mode 100644 hasura/migrations/1581533100559_update_permission_user_public_table_appointments/down.yaml create mode 100644 hasura/migrations/1581533100559_update_permission_user_public_table_appointments/up.yaml create mode 100644 hasura/migrations/1581533106127_update_permission_user_public_table_appointments/down.yaml create mode 100644 hasura/migrations/1581533106127_update_permission_user_public_table_appointments/up.yaml create mode 100644 hasura/migrations/1581536337667_alter_table_public_appointments_add_column_title/down.yaml create mode 100644 hasura/migrations/1581536337667_alter_table_public_appointments_add_column_title/up.yaml create mode 100644 hasura/migrations/1581536568049_update_permission_user_public_table_appointments/down.yaml create mode 100644 hasura/migrations/1581536568049_update_permission_user_public_table_appointments/up.yaml create mode 100644 hasura/migrations/1581536573614_update_permission_user_public_table_appointments/down.yaml create mode 100644 hasura/migrations/1581536573614_update_permission_user_public_table_appointments/up.yaml create mode 100644 hasura/migrations/1581536577315_update_permission_user_public_table_appointments/down.yaml create mode 100644 hasura/migrations/1581536577315_update_permission_user_public_table_appointments/up.yaml diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 17d6e7b03..36409c46d 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -123,6 +123,27 @@
+ + new + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + reschedule false @@ -214,6 +235,32 @@
+ + fields + + + title + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + labels diff --git a/client/src/components/schedule-appointment-modal/schedule-appointment-modal.component.jsx b/client/src/components/schedule-appointment-modal/schedule-appointment-modal.component.jsx new file mode 100644 index 000000000..756ab4fba --- /dev/null +++ b/client/src/components/schedule-appointment-modal/schedule-appointment-modal.component.jsx @@ -0,0 +1,67 @@ +import { Checkbox, Col, DatePicker, Modal, Row, TimePicker, Input } from "antd"; +import React from "react"; +import { useTranslation } from "react-i18next"; +import ScheduleDayViewContainer from "../schedule-day-view/schedule-day-view.container"; + +export default function ScheduleJobModalComponent({ + appData, + setAppData, + formData, + setFormData, + ...props +}) { + const { t } = useTranslation(); + //TODO: Existing appointments list only refreshes sometimes after modal close. May have to do with the container class. + return ( + + + + + Manual Job Selection Scheduled Time + { + setAppData({ ...appData, title: e.target.value }); + }} + /> + { + setAppData({ ...appData, start: e }); + }} + /> + { + setAppData({ ...appData, start: e }); + }} + /> + + + { + //TODO: Build out notifications. + } + + setFormData({ ...formData, notifyCustomer: e.target.checked }) + } + > + {t("jobs.labels.appointmentconfirmation")} + + + + + + + + ); +} diff --git a/client/src/components/schedule-appointment-modal/schedule-appointment-modal.container.jsx b/client/src/components/schedule-appointment-modal/schedule-appointment-modal.container.jsx new file mode 100644 index 000000000..e2ca97995 --- /dev/null +++ b/client/src/components/schedule-appointment-modal/schedule-appointment-modal.container.jsx @@ -0,0 +1,74 @@ +import { notification } from "antd"; +import moment from "moment"; +import React, { useState } from "react"; +import { useMutation } from "react-apollo"; +import { useTranslation } from "react-i18next"; +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { INSERT_APPOINTMENT } from "../../graphql/appointments.queries"; +import { selectBodyshop } from "../../redux/user/user.selectors"; +import ScheduleAppointmentModalComponent from "./schedule-appointment-modal.component"; + +const mapStateToProps = createStructuredSelector({ + bodyshop: selectBodyshop +}); + +export default connect( + mapStateToProps, + null +)(function ScheduleAppointmentModalContainer({ + scheduleModalState, + jobId, + bodyshop, + refetch +}) { + const [scheduleModalVisible, setscheduleModalVisible] = scheduleModalState; + const [appData, setAppData] = useState({ + jobid: jobId, + bodyshopid: bodyshop.id, + isintake: false, + start: null + }); + const [insertAppointment] = useMutation(INSERT_APPOINTMENT); + const [formData, setFormData] = useState({ notifyCustomer: false }); + const { t } = useTranslation(); + + return ( + setscheduleModalVisible(false)} + onOk={() => { + //TODO: Customize the amount of minutes it will add. + insertAppointment({ + variables: { + app: { ...appData, end: moment(appData.start).add(60, "minutes") } + } + }) + .then(r => { + notification["success"]({ + message: t("appointments.successes.created") + }); + + if (formData.notifyCustomer) { + //TODO: Implement customer reminder on scheduling. + alert("Chosed to notify the customer somehow!"); + } + setscheduleModalVisible(false); + if (refetch) refetch(); + }) + .catch(error => { + notification["error"]({ + message: t("appointments.errors.saving", { + message: error.message + }) + }); + }); + }} + /> + ); +}); diff --git a/client/src/components/schedule-calendar/schedule-calendar.component.jsx b/client/src/components/schedule-calendar/schedule-calendar.component.jsx index a82231f64..61c3ffe3e 100644 --- a/client/src/components/schedule-calendar/schedule-calendar.component.jsx +++ b/client/src/components/schedule-calendar/schedule-calendar.component.jsx @@ -1,13 +1,46 @@ import React from "react"; //import "react-big-calendar/lib/css/react-big-calendar.css"; import ScheduleCalendarWrapperComponent from "../schedule-calendar-wrapper/scheduler-calendar-wrapper.component"; +import { Button, Icon } from "antd"; +import { useTranslation } from "react-i18next"; +import ScheduleAppointmentModalContainer from "../schedule-appointment-modal/schedule-appointment-modal.container"; + +export default function ScheduleCalendarComponent({ + data, + refetch, + scheduleModalState +}) { + const { t } = useTranslation(); -export default function ScheduleCalendarComponent({ data, refetch }) { return ( - +
+ + + + + + + +
); } diff --git a/client/src/components/schedule-calendar/schedule-calendar.container.jsx b/client/src/components/schedule-calendar/schedule-calendar.container.jsx index 22b2404d9..7d5605044 100644 --- a/client/src/components/schedule-calendar/schedule-calendar.container.jsx +++ b/client/src/components/schedule-calendar/schedule-calendar.container.jsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useState } from "react"; import { useQuery } from "react-apollo"; import ScheduleCalendarComponent from "./schedule-calendar.component"; import { QUERY_ALL_ACTIVE_APPOINTMENTS } from "../../graphql/appointments.queries"; @@ -12,6 +12,7 @@ export default function ScheduleCalendarContainer() { fetchPolicy: "network-only" } ); + const scheduleModalState = useState(false); if (loading) return ; if (error) return ; @@ -27,6 +28,7 @@ export default function ScheduleCalendarContainer() { return ( diff --git a/client/src/components/schedule-event/schedule-event.component.jsx b/client/src/components/schedule-event/schedule-event.component.jsx index e9bcd1918..17cbb8b39 100644 --- a/client/src/components/schedule-event/schedule-event.component.jsx +++ b/client/src/components/schedule-event/schedule-event.component.jsx @@ -9,22 +9,53 @@ export default function ScheduleEventComponent({ event, handleCancel }) { const { t } = useTranslation(); const popoverContent = (
-
{`${t("jobs.fields.ro_number")}: ${event.job.ro_number}`}
-
- {t("jobs.fields.clm_total")}: - {event.job.clm_total} -
-
{`${t("jobs.fields.clm_no")}: ${event.job.clm_no}`}
-
- {t("jobs.fields.ownr_ea")}:{event.job.ownr_ea} -
-
- {t("jobs.fields.ownr_ph1")}: - {event.job.ownr_ph1} -
- - - + {!event.isintake ? ( + {event.title} + ) : ( +
+ {`${(event.job && event.job.ownr_fn) || ""} ${(event.job && + event.job.ownr_ln) || + ""}`} + + {`${(event.job && event.job.vehicle.v_model_yr) || + ""} ${(event.job && event.job.vehicle.v_make_desc) || + ""} ${(event.job && event.job.vehicle.v_model_desc) || ""}`} + +
+ )} + {event.job ? ( +
+
{`${t("jobs.fields.ro_number")}: ${(event.job && + event.job.ro_number) || + ""}`}
+
+ {t("jobs.fields.clm_total")}: + + {(event.job && event.job.clm_total) || ""} + +
+
{`${t("jobs.fields.clm_no")}: ${(event.job && + event.job.clm_no) || + ""}`}
+
+ {t("jobs.fields.ownr_ea")}:{(event.job && event.job.ownr_ea) || ""} +
+
+ {t("jobs.fields.ownr_ph1")}: + + {(event.job && event.job.ownr_ph1) || ""} + +
+
+ ) : null} + { + //TODO Add phone 1 MessagingActionTypes. + } + {event.job ? ( + + + + ) : null} @@ -34,24 +65,36 @@ export default function ScheduleEventComponent({ event, handleCancel }) { } {t("appointments.actions.reschedule")} - + {event.isintake ? ( + + ) : null}
); return (
- {`${event.job.ownr_fn || ""} ${event.job.ownr_ln || - ""}`} - - {`${event.job.vehicle.v_model_yr || ""} ${event.job.vehicle - .v_make_desc || ""} ${event.job.vehicle.v_model_desc || ""}`} - + {event.isintake ? ( +
+ {`${(event.job && event.job.ownr_fn) || ""} ${(event.job && + event.job.ownr_ln) || + ""}`} + + {`${(event.job && event.job.vehicle.v_model_yr) || + ""} ${(event.job && event.job.vehicle.v_make_desc) || + ""} ${(event.job && event.job.vehicle.v_model_desc) || ""}`} + +
+ ) : ( +
+ {`${event.title || ""}`} +
+ )}
); diff --git a/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx b/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx index 9e9d8179b..4729e17dc 100644 --- a/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx +++ b/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx @@ -28,12 +28,16 @@ export default connect( refetch }) { const [scheduleModalVisible, setscheduleModalVisible] = scheduleModalState; - const [appData, setAppData] = useState({ jobid: jobId, start: null }); + const [appData, setAppData] = useState({ + jobid: jobId, + start: null, + bodyshopid: bodyshop.id + }); const [insertAppointment] = useMutation(INSERT_APPOINTMENT); const [updateJobStatus] = useMutation(UPDATE_JOB_STATUS, { variables: { jobId: jobId, - status: bodyshop.md_ro_statuses.default_scheduled + status: bodyshop.md_ro_statuses.default_scheduled } }); const [formData, setFormData] = useState({ notifyCustomer: false }); diff --git a/client/src/graphql/appointments.queries.js b/client/src/graphql/appointments.queries.js index b69d0c967..8a3fe571a 100644 --- a/client/src/graphql/appointments.queries.js +++ b/client/src/graphql/appointments.queries.js @@ -6,6 +6,8 @@ export const QUERY_ALL_ACTIVE_APPOINTMENTS = gql` start id end + title + isintake job { ro_number ownr_ln @@ -38,10 +40,14 @@ export const INSERT_APPOINTMENT = gql` export const QUERY_APPOINTMENT_BY_DATE = gql` query QUERY_APPOINTMENT_BY_DATE($start: timestamptz, $end: timestamptz) { - appointments(where: { start: { _lte: $end, _gte: $start } }) { + appointments( + where: { start: { _lte: $end, _gte: $start }, canceled: { _eq: false } } + ) { start id end + title + isintake job { ro_number ownr_ln @@ -81,6 +87,7 @@ export const QUERY_APPOINTMENTS_BY_JOBID = gql` start id end + isintake arrived canceled created_at diff --git a/client/src/pages/manage/manage.page.container.jsx b/client/src/pages/manage/manage.page.container.jsx index 28f97f3a6..e9af1b033 100644 --- a/client/src/pages/manage/manage.page.container.jsx +++ b/client/src/pages/manage/manage.page.container.jsx @@ -1,20 +1,28 @@ +import { notification } from "antd"; import React, { useEffect } from "react"; -import ManagePage from "./manage.page"; import { useQuery } from "react-apollo"; +import { useTranslation } from "react-i18next"; +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component"; import { QUERY_BODYSHOP } from "../../graphql/bodyshop.queries"; import { setBodyshop } from "../../redux/user/user.actions"; -import { connect } from "react-redux"; -import { notification } from "antd"; -import { useTranslation } from "react-i18next"; +import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors"; +import ManagePage from "./manage.page"; + +const mapStateToProps = createStructuredSelector({ + currentUser: selectCurrentUser, + bodyshop: selectBodyshop +}); const mapDispatchToProps = dispatch => ({ setBodyshop: bs => dispatch(setBodyshop(bs)) }); export default connect( - null, + mapStateToProps, mapDispatchToProps -)(function ManagePageContainer({ match, setBodyshop }) { +)(function ManagePageContainer({ match, setBodyshop, bodyshop }) { const { error, data } = useQuery(QUERY_BODYSHOP, { fetchPolicy: "network-only" }); @@ -30,5 +38,7 @@ export default connect( }; }, [data, setBodyshop]); + //TODO Translate later. + if (!bodyshop) return ; return ; }); diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 1968bd4bb..b93fd4c25 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -12,6 +12,7 @@ "actions": { "cancel": "Cancel", "intake": "Intake", + "new": "New Appointment", "reschedule": "Reschedule", "viewjob": "View Job" }, @@ -19,6 +20,9 @@ "canceling": "Error canceling appointment.", "saving": "Error scheduling appointment. {{message}}" }, + "fields": { + "title": "Title" + }, "labels": { "arrivedon": "Arrived on: ", "cancelledappointment": "Canceled appointment for: ", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index c33605a43..78066a6f7 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -12,6 +12,7 @@ "actions": { "cancel": "Cancelar", "intake": "Consumo", + "new": "Nueva cita", "reschedule": "Reprogramar", "viewjob": "Ver trabajo" }, @@ -19,6 +20,9 @@ "canceling": "Error al cancelar la cita.", "saving": "Error al programar la cita. {{message}}" }, + "fields": { + "title": "Título" + }, "labels": { "arrivedon": "Llegado el:", "cancelledappointment": "Cita cancelada para:", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index b0ef0b149..159b39982 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -12,6 +12,7 @@ "actions": { "cancel": "annuler", "intake": "Admission", + "new": "Nouveau rendez-vous", "reschedule": "Replanifier", "viewjob": "Voir le travail" }, @@ -19,6 +20,9 @@ "canceling": "Erreur lors de l'annulation du rendez-vous.", "saving": "Erreur lors de la planification du rendez-vous. {{message}}" }, + "fields": { + "title": "Titre" + }, "labels": { "arrivedon": "Arrivé le:", "cancelledappointment": "Rendez-vous annulé pour:", diff --git a/hasura/migrations/1581530616257_alter_table_public_appointments_add_column_isintake/down.yaml b/hasura/migrations/1581530616257_alter_table_public_appointments_add_column_isintake/down.yaml new file mode 100644 index 000000000..e02cfe92d --- /dev/null +++ b/hasura/migrations/1581530616257_alter_table_public_appointments_add_column_isintake/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."appointments" DROP COLUMN "isintake"; + type: run_sql diff --git a/hasura/migrations/1581530616257_alter_table_public_appointments_add_column_isintake/up.yaml b/hasura/migrations/1581530616257_alter_table_public_appointments_add_column_isintake/up.yaml new file mode 100644 index 000000000..62dbfbfac --- /dev/null +++ b/hasura/migrations/1581530616257_alter_table_public_appointments_add_column_isintake/up.yaml @@ -0,0 +1,4 @@ +- args: + sql: ALTER TABLE "public"."appointments" ADD COLUMN "isintake" boolean NOT NULL + DEFAULT true; + type: run_sql diff --git a/hasura/migrations/1581530623178_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations/1581530623178_update_permission_user_public_table_appointments/down.yaml new file mode 100644 index 000000000..34cf4841b --- /dev/null +++ b/hasura/migrations/1581530623178_update_permission_user_public_table_appointments/down.yaml @@ -0,0 +1,36 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_insert_permission +- args: + permission: + check: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - arrived + - canceled + - created_at + - end + - start + - updated_at + - id + - jobid + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: appointments + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581530623178_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations/1581530623178_update_permission_user_public_table_appointments/up.yaml new file mode 100644 index 000000000..2d7c6806a --- /dev/null +++ b/hasura/migrations/1581530623178_update_permission_user_public_table_appointments/up.yaml @@ -0,0 +1,37 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_insert_permission +- args: + permission: + check: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - jobid + - start + - end + - canceled + - arrived + - isintake + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: appointments + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581530628660_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations/1581530628660_update_permission_user_public_table_appointments/down.yaml new file mode 100644 index 000000000..7c6811bf8 --- /dev/null +++ b/hasura/migrations/1581530628660_update_permission_user_public_table_appointments/down.yaml @@ -0,0 +1,34 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - arrived + - canceled + - created_at + - end + - start + - 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: appointments + schema: public + type: create_select_permission diff --git a/hasura/migrations/1581530628660_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations/1581530628660_update_permission_user_public_table_appointments/up.yaml new file mode 100644 index 000000000..9b8f53a5b --- /dev/null +++ b/hasura/migrations/1581530628660_update_permission_user_public_table_appointments/up.yaml @@ -0,0 +1,35 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - arrived + - canceled + - isintake + - created_at + - end + - start + - 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: appointments + schema: public + type: create_select_permission diff --git a/hasura/migrations/1581530632721_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations/1581530632721_update_permission_user_public_table_appointments/down.yaml new file mode 100644 index 000000000..1644cd131 --- /dev/null +++ b/hasura/migrations/1581530632721_update_permission_user_public_table_appointments/down.yaml @@ -0,0 +1,36 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_update_permission +- args: + permission: + columns: + - arrived + - canceled + - created_at + - end + - start + - 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: appointments + schema: public + type: create_update_permission diff --git a/hasura/migrations/1581530632721_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations/1581530632721_update_permission_user_public_table_appointments/up.yaml new file mode 100644 index 000000000..bd68314eb --- /dev/null +++ b/hasura/migrations/1581530632721_update_permission_user_public_table_appointments/up.yaml @@ -0,0 +1,37 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_update_permission +- args: + permission: + columns: + - arrived + - canceled + - isintake + - created_at + - end + - start + - 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: appointments + schema: public + type: create_update_permission diff --git a/hasura/migrations/1581533010996_alter_table_public_appointments_add_column_bodyshopid/down.yaml b/hasura/migrations/1581533010996_alter_table_public_appointments_add_column_bodyshopid/down.yaml new file mode 100644 index 000000000..a215f8049 --- /dev/null +++ b/hasura/migrations/1581533010996_alter_table_public_appointments_add_column_bodyshopid/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."appointments" DROP COLUMN "bodyshopid"; + type: run_sql diff --git a/hasura/migrations/1581533010996_alter_table_public_appointments_add_column_bodyshopid/up.yaml b/hasura/migrations/1581533010996_alter_table_public_appointments_add_column_bodyshopid/up.yaml new file mode 100644 index 000000000..3a62d703c --- /dev/null +++ b/hasura/migrations/1581533010996_alter_table_public_appointments_add_column_bodyshopid/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."appointments" ADD COLUMN "bodyshopid" uuid NOT NULL; + type: run_sql diff --git a/hasura/migrations/1581533025791_set_fk_public_appointments_bodyshopid/down.yaml b/hasura/migrations/1581533025791_set_fk_public_appointments_bodyshopid/down.yaml new file mode 100644 index 000000000..d2b5e6acf --- /dev/null +++ b/hasura/migrations/1581533025791_set_fk_public_appointments_bodyshopid/down.yaml @@ -0,0 +1,4 @@ +- args: + sql: "\n alter table \"public\".\"appointments\" drop constraint \"appointments_bodyshopid_fkey\"\n + \ " + type: run_sql diff --git a/hasura/migrations/1581533025791_set_fk_public_appointments_bodyshopid/up.yaml b/hasura/migrations/1581533025791_set_fk_public_appointments_bodyshopid/up.yaml new file mode 100644 index 000000000..1eddc1d61 --- /dev/null +++ b/hasura/migrations/1581533025791_set_fk_public_appointments_bodyshopid/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: "\n alter table \"public\".\"appointments\"\n add constraint + \"appointments_bodyshopid_fkey\"\n foreign key (\"bodyshopid\")\n + \ references \"public\".\"bodyshops\"\n (\"id\") on update + cascade on delete cascade;\n " + type: run_sql diff --git a/hasura/migrations/1581533035763_alter_table_public_appointments_alter_column_jobid/down.yaml b/hasura/migrations/1581533035763_alter_table_public_appointments_alter_column_jobid/down.yaml new file mode 100644 index 000000000..670a8a99f --- /dev/null +++ b/hasura/migrations/1581533035763_alter_table_public_appointments_alter_column_jobid/down.yaml @@ -0,0 +1,6 @@ +- args: + sql: ALTER TABLE "public"."appointments" ALTER COLUMN "jobid" SET NOT NULL; + type: run_sql +- args: + sql: COMMENT ON COLUMN "public"."appointments"."jobid" IS E'null' + type: run_sql diff --git a/hasura/migrations/1581533035763_alter_table_public_appointments_alter_column_jobid/up.yaml b/hasura/migrations/1581533035763_alter_table_public_appointments_alter_column_jobid/up.yaml new file mode 100644 index 000000000..2b5118988 --- /dev/null +++ b/hasura/migrations/1581533035763_alter_table_public_appointments_alter_column_jobid/up.yaml @@ -0,0 +1,6 @@ +- args: + sql: ALTER TABLE "public"."appointments" ALTER COLUMN "jobid" DROP NOT NULL; + type: run_sql +- args: + sql: COMMENT ON COLUMN "public"."appointments"."jobid" IS E'' + type: run_sql diff --git a/hasura/migrations/1581533044908_track_all_relationships/down.yaml b/hasura/migrations/1581533044908_track_all_relationships/down.yaml new file mode 100644 index 000000000..9e9c5e1f4 --- /dev/null +++ b/hasura/migrations/1581533044908_track_all_relationships/down.yaml @@ -0,0 +1,12 @@ +- args: + relationship: bodyshop + table: + name: appointments + schema: public + type: drop_relationship +- args: + relationship: appointments + table: + name: bodyshops + schema: public + type: drop_relationship diff --git a/hasura/migrations/1581533044908_track_all_relationships/up.yaml b/hasura/migrations/1581533044908_track_all_relationships/up.yaml new file mode 100644 index 000000000..4489d60cd --- /dev/null +++ b/hasura/migrations/1581533044908_track_all_relationships/up.yaml @@ -0,0 +1,20 @@ +- args: + name: bodyshop + table: + name: appointments + schema: public + using: + foreign_key_constraint_on: bodyshopid + type: create_object_relationship +- args: + name: appointments + table: + name: bodyshops + schema: public + using: + foreign_key_constraint_on: + column: bodyshopid + table: + name: appointments + schema: public + type: create_array_relationship diff --git a/hasura/migrations/1581533078439_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations/1581533078439_update_permission_user_public_table_appointments/down.yaml new file mode 100644 index 000000000..2d7c6806a --- /dev/null +++ b/hasura/migrations/1581533078439_update_permission_user_public_table_appointments/down.yaml @@ -0,0 +1,37 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_insert_permission +- args: + permission: + check: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - jobid + - start + - end + - canceled + - arrived + - isintake + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: appointments + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581533078439_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations/1581533078439_update_permission_user_public_table_appointments/up.yaml new file mode 100644 index 000000000..80392f155 --- /dev/null +++ b/hasura/migrations/1581533078439_update_permission_user_public_table_appointments/up.yaml @@ -0,0 +1,36 @@ +- args: + role: user + table: + name: appointments + 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 + - jobid + - start + - end + - canceled + - arrived + - isintake + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: appointments + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581533085254_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations/1581533085254_update_permission_user_public_table_appointments/down.yaml new file mode 100644 index 000000000..80392f155 --- /dev/null +++ b/hasura/migrations/1581533085254_update_permission_user_public_table_appointments/down.yaml @@ -0,0 +1,36 @@ +- args: + role: user + table: + name: appointments + 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 + - jobid + - start + - end + - canceled + - arrived + - isintake + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: appointments + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581533085254_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations/1581533085254_update_permission_user_public_table_appointments/up.yaml new file mode 100644 index 000000000..b6a96cd37 --- /dev/null +++ b/hasura/migrations/1581533085254_update_permission_user_public_table_appointments/up.yaml @@ -0,0 +1,37 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - arrived + - canceled + - isintake + - created_at + - end + - start + - updated_at + - bodyshopid + - id + - jobid + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: appointments + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581533092537_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations/1581533092537_update_permission_user_public_table_appointments/down.yaml new file mode 100644 index 000000000..9b8f53a5b --- /dev/null +++ b/hasura/migrations/1581533092537_update_permission_user_public_table_appointments/down.yaml @@ -0,0 +1,35 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - arrived + - canceled + - isintake + - created_at + - end + - start + - 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: appointments + schema: public + type: create_select_permission diff --git a/hasura/migrations/1581533092537_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations/1581533092537_update_permission_user_public_table_appointments/up.yaml new file mode 100644 index 000000000..ea389149c --- /dev/null +++ b/hasura/migrations/1581533092537_update_permission_user_public_table_appointments/up.yaml @@ -0,0 +1,35 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - arrived + - canceled + - isintake + - created_at + - end + - start + - updated_at + - bodyshopid + - id + - jobid + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: appointments + schema: public + type: create_select_permission diff --git a/hasura/migrations/1581533100559_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations/1581533100559_update_permission_user_public_table_appointments/down.yaml new file mode 100644 index 000000000..bd68314eb --- /dev/null +++ b/hasura/migrations/1581533100559_update_permission_user_public_table_appointments/down.yaml @@ -0,0 +1,37 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_update_permission +- args: + permission: + columns: + - arrived + - canceled + - isintake + - created_at + - end + - start + - 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: appointments + schema: public + type: create_update_permission diff --git a/hasura/migrations/1581533100559_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations/1581533100559_update_permission_user_public_table_appointments/up.yaml new file mode 100644 index 000000000..eed14f2a7 --- /dev/null +++ b/hasura/migrations/1581533100559_update_permission_user_public_table_appointments/up.yaml @@ -0,0 +1,37 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_update_permission +- args: + permission: + columns: + - arrived + - canceled + - isintake + - created_at + - end + - start + - updated_at + - bodyshopid + - id + - jobid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: appointments + schema: public + type: create_update_permission diff --git a/hasura/migrations/1581533106127_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations/1581533106127_update_permission_user_public_table_appointments/down.yaml new file mode 100644 index 000000000..e40aecd89 --- /dev/null +++ b/hasura/migrations/1581533106127_update_permission_user_public_table_appointments/down.yaml @@ -0,0 +1,23 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_delete_permission +- args: + permission: + filter: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: appointments + schema: public + type: create_delete_permission diff --git a/hasura/migrations/1581533106127_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations/1581533106127_update_permission_user_public_table_appointments/up.yaml new file mode 100644 index 000000000..c70956bf0 --- /dev/null +++ b/hasura/migrations/1581533106127_update_permission_user_public_table_appointments/up.yaml @@ -0,0 +1,22 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_delete_permission +- args: + permission: + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: appointments + schema: public + type: create_delete_permission diff --git a/hasura/migrations/1581536337667_alter_table_public_appointments_add_column_title/down.yaml b/hasura/migrations/1581536337667_alter_table_public_appointments_add_column_title/down.yaml new file mode 100644 index 000000000..7dcc18afa --- /dev/null +++ b/hasura/migrations/1581536337667_alter_table_public_appointments_add_column_title/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."appointments" DROP COLUMN "title"; + type: run_sql diff --git a/hasura/migrations/1581536337667_alter_table_public_appointments_add_column_title/up.yaml b/hasura/migrations/1581536337667_alter_table_public_appointments_add_column_title/up.yaml new file mode 100644 index 000000000..e12992c92 --- /dev/null +++ b/hasura/migrations/1581536337667_alter_table_public_appointments_add_column_title/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."appointments" ADD COLUMN "title" text NULL; + type: run_sql diff --git a/hasura/migrations/1581536568049_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations/1581536568049_update_permission_user_public_table_appointments/down.yaml new file mode 100644 index 000000000..b6a96cd37 --- /dev/null +++ b/hasura/migrations/1581536568049_update_permission_user_public_table_appointments/down.yaml @@ -0,0 +1,37 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - arrived + - canceled + - isintake + - created_at + - end + - start + - updated_at + - bodyshopid + - id + - jobid + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: appointments + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581536568049_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations/1581536568049_update_permission_user_public_table_appointments/up.yaml new file mode 100644 index 000000000..116c67c2d --- /dev/null +++ b/hasura/migrations/1581536568049_update_permission_user_public_table_appointments/up.yaml @@ -0,0 +1,38 @@ +- args: + role: user + table: + name: appointments + 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 + - jobid + - start + - end + - canceled + - arrived + - isintake + - bodyshopid + - title + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: appointments + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581536573614_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations/1581536573614_update_permission_user_public_table_appointments/down.yaml new file mode 100644 index 000000000..ea389149c --- /dev/null +++ b/hasura/migrations/1581536573614_update_permission_user_public_table_appointments/down.yaml @@ -0,0 +1,35 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - arrived + - canceled + - isintake + - created_at + - end + - start + - updated_at + - bodyshopid + - id + - jobid + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: appointments + schema: public + type: create_select_permission diff --git a/hasura/migrations/1581536573614_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations/1581536573614_update_permission_user_public_table_appointments/up.yaml new file mode 100644 index 000000000..1c74631cf --- /dev/null +++ b/hasura/migrations/1581536573614_update_permission_user_public_table_appointments/up.yaml @@ -0,0 +1,36 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - arrived + - canceled + - isintake + - title + - created_at + - end + - start + - updated_at + - bodyshopid + - id + - jobid + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: appointments + schema: public + type: create_select_permission diff --git a/hasura/migrations/1581536577315_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations/1581536577315_update_permission_user_public_table_appointments/down.yaml new file mode 100644 index 000000000..eed14f2a7 --- /dev/null +++ b/hasura/migrations/1581536577315_update_permission_user_public_table_appointments/down.yaml @@ -0,0 +1,37 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_update_permission +- args: + permission: + columns: + - arrived + - canceled + - isintake + - created_at + - end + - start + - updated_at + - bodyshopid + - id + - jobid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: appointments + schema: public + type: create_update_permission diff --git a/hasura/migrations/1581536577315_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations/1581536577315_update_permission_user_public_table_appointments/up.yaml new file mode 100644 index 000000000..264408ea3 --- /dev/null +++ b/hasura/migrations/1581536577315_update_permission_user_public_table_appointments/up.yaml @@ -0,0 +1,38 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_update_permission +- args: + permission: + columns: + - arrived + - canceled + - isintake + - title + - created_at + - end + - start + - updated_at + - bodyshopid + - id + - jobid + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: appointments + schema: public + type: create_update_permission From e417b1c9c022f4a2395cd2b6127b4757fc1ae6d3 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 12 Feb 2020 14:48:03 -0800 Subject: [PATCH 39/70] Added base logic for seeing jobs to supplement. Supplement import not yet working. --- bodyshop_translations.babel | 63 +++++++ .../jobs-available-new.component.jsx | 5 +- .../jobs-available-new.container.jsx | 7 - .../jobs-available-supplement.component.jsx | 125 ++++++++----- .../jobs-available-supplement.container.jsx | 114 ++++++++++-- .../jobs-find-modal.component.jsx | 172 ++++++++++++++++++ .../jobs-find-modal.container.jsx | 46 +++++ .../owner-find-modal.component.jsx | 3 +- .../owner-find-modal.container.jsx | 1 + client/src/graphql/available-jobs.queries.js | 1 + client/src/translations/en_us/common.json | 3 + client/src/translations/es/common.json | 3 + client/src/translations/fr/common.json | 3 + 13 files changed, 473 insertions(+), 73 deletions(-) create mode 100644 client/src/components/jobs-find-modal/jobs-find-modal.component.jsx create mode 100644 client/src/components/jobs-find-modal/jobs-find-modal.container.jsx diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 36409c46d..b72fcab76 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -4299,6 +4299,27 @@ + + existing_jobs + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + lines false @@ -4341,6 +4362,27 @@ + + override_header + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + parts false @@ -5634,6 +5676,27 @@ labels + + create_new + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + existing_owners false diff --git a/client/src/components/jobs-available-new/jobs-available-new.component.jsx b/client/src/components/jobs-available-new/jobs-available-new.component.jsx index b7dd1d880..07cb073db 100644 --- a/client/src/components/jobs-available-new/jobs-available-new.component.jsx +++ b/client/src/components/jobs-available-new/jobs-available-new.component.jsx @@ -141,7 +141,8 @@ export default function JobsAvailableComponent({ estData.data.available_jobs_by_pk && estData.data.available_jobs_by_pk.est_data && estData.data.available_jobs_by_pk.est_data.owner && - estData.data.available_jobs_by_pk.est_data.owner.data + estData.data.available_jobs_by_pk.est_data.owner.data && + !estData.data.available_jobs_by_pk.issupplement ? estData.data.available_jobs_by_pk.est_data.owner.data : null; @@ -164,7 +165,7 @@ export default function JobsAvailableComponent({ return (
{ console.log(value); }} diff --git a/client/src/components/jobs-available-new/jobs-available-new.container.jsx b/client/src/components/jobs-available-new/jobs-available-new.container.jsx index 7c1932d9d..e6fd1e37b 100644 --- a/client/src/components/jobs-available-new/jobs-available-new.container.jsx +++ b/client/src/components/jobs-available-new/jobs-available-new.container.jsx @@ -29,14 +29,7 @@ export default withRouter(function JobsAvailableContainer({ const onModalOk = () => { setModalVisible(false); - console.log("selectedOwner", selectedOwner); setInsertLoading(true); - console.log( - "logitest", - estData.data && - estData.data.available_jobs_by_pk && - estData.data.available_jobs_by_pk.est_data - ); if ( !( diff --git a/client/src/components/jobs-available-supplement/jobs-available-supplement.component.jsx b/client/src/components/jobs-available-supplement/jobs-available-supplement.component.jsx index a6c44f5df..69d1b7462 100644 --- a/client/src/components/jobs-available-supplement/jobs-available-supplement.component.jsx +++ b/client/src/components/jobs-available-supplement/jobs-available-supplement.component.jsx @@ -3,13 +3,24 @@ import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { alphaSort } from "../../utils/sorters"; import { DateTimeFormatter } from "../../utils/DateFormatter"; +import JobsFindModalContainer from "../jobs-find-modal/jobs-find-modal.container"; + export default function JobsAvailableSupplementComponent({ loading, data, refetch, deleteJob, + updateJob, + onModalOk, + onModalCancel, + modalVisible, + setModalVisible, + selectedJob, + setSelectedJob, deleteAllNewJobs, - estDataLazyLoad + loadEstData, + estData, + importOptionsState }) { const { t } = useTranslation(); @@ -127,7 +138,8 @@ export default function JobsAvailableSupplementComponent({