diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 5f3dc9799..ccb2a8790 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -416,6 +416,27 @@ fields + + color + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + time false @@ -2311,6 +2332,53 @@ + + appt_colors + + + color + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + label + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + appt_length false diff --git a/client/package.json b/client/package.json index 7e4462775..142242e44 100644 --- a/client/package.json +++ b/client/package.json @@ -40,6 +40,7 @@ "react-barcode": "^1.4.0", "react-big-calendar": "^0.26.1", "react-codemirror2": "^7.2.1", + "react-color": "^2.18.1", "react-dom": "^16.13.1", "react-drag-listview": "^0.1.7", "react-email-editor": "^1.1.1", diff --git a/client/src/components/form-items-formatted/colorpicker-form-item.component.jsx b/client/src/components/form-items-formatted/colorpicker-form-item.component.jsx new file mode 100644 index 000000000..41de4e995 --- /dev/null +++ b/client/src/components/form-items-formatted/colorpicker-form-item.component.jsx @@ -0,0 +1,20 @@ +import React, { forwardRef } from "react"; +import { BlockPicker } from "react-color"; +//To be used as a form element only. + +const ColorPickerFormItem = ({ value, onChange, style, ...restProps }, ref) => { + const handleChangeComplete = (color) => { + if (onChange) onChange(color); + }; + + return ( + + ); +}; +export default forwardRef(ColorPickerFormItem); diff --git a/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx b/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx index d13035e1b..3aa8352b0 100644 --- a/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx +++ b/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx @@ -38,6 +38,14 @@ export function ScheduleCalendarWrapperComponent({ // )[0]; return { + ...(event.color + ? { + style: { + backgroundColor: + event.color && event.color.hex ? event.color.hex : event.color, + }, + } + : {}), className: `${event.arrived ? "imex-event-arrived" : ""} ${ event.block ? "imex-event-block" : "" }`, diff --git a/client/src/components/schedule-event/schedule-event.color.component.jsx b/client/src/components/schedule-event/schedule-event.color.component.jsx new file mode 100644 index 000000000..0d33863ea --- /dev/null +++ b/client/src/components/schedule-event/schedule-event.color.component.jsx @@ -0,0 +1,55 @@ +import React from "react"; +import { useMutation } from "react-apollo"; +import { UPDATE_APPOINTMENT } from "../../graphql/appointments.queries"; +import { useTranslation } from "react-i18next"; +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { Dropdown, Menu, notification } from "antd"; +import { DownOutlined } from "@ant-design/icons"; +import { selectBodyshop } from "../../redux/user/user.selectors"; + +const mapStateToProps = createStructuredSelector({ + bodyshop: selectBodyshop, +}); +const mapDispatchToProps = (dispatch) => ({ + //setUserLanguage: language => dispatch(setUserLanguage(language)) +}); + +export function ScheduleEventColor({ bodyshop, event }) { + const [updateAppointment] = useMutation(UPDATE_APPOINTMENT); + const { t } = useTranslation(); + + const onClick = async ({ key }) => { + const result = await updateAppointment({ + variables: { appid: event.id, app: { color: key } }, + }); + + if (!!!result.errors) { + notification["success"]({ message: t("appointments.successes.saved") }); + } else { + notification["error"]({ + message: t("appointments.errors.saving", { + error: JSON.stringify(result.errors), + }), + }); + } + }; + const menu = ( + + {bodyshop.appt_colors && + bodyshop.appt_colors.map((color) => ( + + {color.label} + + ))} + + ); + return ( + + e.preventDefault()}> + + + + ); +} +export default connect(mapStateToProps, mapDispatchToProps)(ScheduleEventColor); diff --git a/client/src/components/schedule-event/schedule-event.component.jsx b/client/src/components/schedule-event/schedule-event.component.jsx index e439852e0..82600aa7a 100644 --- a/client/src/components/schedule-event/schedule-event.component.jsx +++ b/client/src/components/schedule-event/schedule-event.component.jsx @@ -7,6 +7,7 @@ import { setModalContext } from "../../redux/modals/modals.actions"; import CurrencyFormatter from "../../utils/CurrencyFormatter"; import PhoneFormatter from "../../utils/PhoneFormatter"; import DataLabel from "../data-label/data-label.component"; +import ScheduleEventColor from "./schedule-event.color.component"; const mapDispatchToProps = (dispatch) => ({ setScheduleContext: (context) => @@ -34,6 +35,7 @@ export function ScheduleEventComponent({ (event.job && event.job.v_make_desc) || "" } ${(event.job && event.job.v_model_desc) || ""}`} + )} diff --git a/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx b/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx index 0c932662c..bf97c151e 100644 --- a/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx +++ b/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx @@ -1,4 +1,4 @@ -import { Button, Col, Form, Row, Switch } from "antd"; +import { Button, Col, Form, Row, Select, Switch } from "antd"; import axios from "axios"; import moment from "moment"; import React, { useState } from "react"; @@ -120,6 +120,20 @@ export function ScheduleJobModalComponent({ + + + {t("appointments.labels.history")} {t("bodyshop.labels.orderstatuses")} + + {(fields, { add, remove, move }) => { + return ( +
+ {fields.map((field, index) => ( + + + + + + + + + { + remove(field.name); + }} + /> + + + + ))} + + + +
+ ); + }} +
+ {(fields, { add, remove, move }) => { return ( diff --git a/client/src/graphql/appointments.queries.js b/client/src/graphql/appointments.queries.js index 2d3e99a7d..f461896c7 100644 --- a/client/src/graphql/appointments.queries.js +++ b/client/src/graphql/appointments.queries.js @@ -19,6 +19,7 @@ export const QUERY_ALL_ACTIVE_APPOINTMENTS = gql` title isintake block + color job { ro_number ownr_ln @@ -112,6 +113,24 @@ export const QUERY_APPOINTMENT_BY_DATE = gql` } `; +export const UPDATE_APPOINTMENT = gql` + mutation UPDATE_APPOINTMENT($appid: uuid!, $app: appointments_set_input) { + update_appointments(where: { id: { _eq: $appid } }, _set: $app) { + returning { + id + start + id + end + arrived + title + isintake + block + color + } + } + } +`; + export const CANCEL_APPOINTMENT_BY_ID = gql` mutation CANCEL_APPOINTMENT_BY_ID($appid: uuid!) { update_appointments( diff --git a/client/src/graphql/bodyshop.queries.js b/client/src/graphql/bodyshop.queries.js index f785df942..ebcbd4fbe 100644 --- a/client/src/graphql/bodyshop.queries.js +++ b/client/src/graphql/bodyshop.queries.js @@ -70,6 +70,7 @@ export const QUERY_BODYSHOP = gql` md_labor_rates deliverchecklist target_touchtime + appt_colors employees { id first_name @@ -138,6 +139,7 @@ export const UPDATE_SHOP = gql` md_labor_rates deliverchecklist target_touchtime + appt_colors employees { id first_name diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 6eda9d1ff..a4f3f51d3 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -33,6 +33,7 @@ "saving": "Error scheduling appointment. {{message}}" }, "fields": { + "color": "Color", "time": "Appointment Time", "title": "Title" }, @@ -162,6 +163,10 @@ "fields": { "address1": "Address 1", "address2": "Address 2", + "appt_colors": { + "color": "Color", + "label": "Label" + }, "appt_length": "Default Appointment Length", "bill_federal_tax_rate": "Bills - Federal Tax Rate %", "bill_local_tax_rate": "Bill - State Tax Rate %", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 340b968ca..8034d6ec1 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -33,6 +33,7 @@ "saving": "Error al programar la cita. {{message}}" }, "fields": { + "color": "", "time": "", "title": "Título" }, @@ -162,6 +163,10 @@ "fields": { "address1": "", "address2": "", + "appt_colors": { + "color": "", + "label": "" + }, "appt_length": "", "bill_federal_tax_rate": "", "bill_local_tax_rate": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index e297525ef..36204e738 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -33,6 +33,7 @@ "saving": "Erreur lors de la planification du rendez-vous. {{message}}" }, "fields": { + "color": "", "time": "", "title": "Titre" }, @@ -162,6 +163,10 @@ "fields": { "address1": "", "address2": "", + "appt_colors": { + "color": "", + "label": "" + }, "appt_length": "", "bill_federal_tax_rate": "", "bill_local_tax_rate": "", diff --git a/client/yarn.lock b/client/yarn.lock index bce5ca1a8..2cf98e3b3 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -1560,6 +1560,11 @@ dependencies: "@hapi/hoek" "^8.3.0" +"@icons/material@^0.2.4": + version "0.2.4" + resolved "https://registry.yarnpkg.com/@icons/material/-/material-0.2.4.tgz#e90c9f71768b3736e76d7dd6783fc6c2afa88bc8" + integrity sha512-QPcGmICAPbGLGb6F/yNf/KzKqvFx8z5qx3D1yFqVAjoFmXK35EgyW+cJ57Te3CNsmzblwtzakLGFqHPqrfb4Tw== + "@jest/console@^24.7.1", "@jest/console@^24.9.0": version "24.9.0" resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.9.0.tgz#79b1bc06fb74a8cfb01cbdedf945584b1b9707f0" @@ -8442,7 +8447,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== -lodash@^4.17.20: +lodash@^4.0.1, lodash@^4.17.20: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== @@ -8543,6 +8548,11 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" +material-colors@^1.2.1: + version "1.2.6" + resolved "https://registry.yarnpkg.com/material-colors/-/material-colors-1.2.6.tgz#6d1958871126992ceecc72f4bcc4d8f010865f46" + integrity sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg== + math-expression-evaluator@^1.2.14: version "1.2.22" resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.22.tgz#c14dcb3d8b4d150e5dcea9c68c8dad80309b0d5e" @@ -10594,7 +10604,7 @@ prop-types-exact@^1.2.0: object.assign "^4.1.0" reflect.ownkeys "^0.2.0" -prop-types@15.x, prop-types@^15.0.0, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@15.x, prop-types@^15.0.0, prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -11335,6 +11345,18 @@ react-codemirror2@^7.2.1: resolved "https://registry.yarnpkg.com/react-codemirror2/-/react-codemirror2-7.2.1.tgz#38dab492fcbe5fb8ebf5630e5bb7922db8d3a10c" integrity sha512-t7YFmz1AXdlImgHXA9Ja0T6AWuopilub24jRaQdPVbzUJVNKIYuy3uCFZYa7CE5S3UW6SrSa5nAqVQvtzRF9gw== +react-color@^2.18.1: + version "2.18.1" + resolved "https://registry.yarnpkg.com/react-color/-/react-color-2.18.1.tgz#2cda8cc8e06a9e2c52ad391a30ddad31972472f4" + integrity sha512-X5XpyJS6ncplZs74ak0JJoqPi+33Nzpv5RYWWxn17bslih+X7OlgmfpmGC1fNvdkK7/SGWYf1JJdn7D2n5gSuQ== + dependencies: + "@icons/material" "^0.2.4" + lodash "^4.17.11" + material-colors "^1.2.1" + prop-types "^15.5.10" + reactcss "^1.2.0" + tinycolor2 "^1.4.1" + react-dev-utils@^10.2.1: version "10.2.1" resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-10.2.1.tgz#f6de325ae25fa4d546d09df4bb1befdc6dd19c19" @@ -11749,6 +11771,13 @@ react-virtualized@^9.22.2: object-assign "^4.1.1" prop-types "^15.6.2" +reactcss@^1.2.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/reactcss/-/reactcss-1.2.3.tgz#c00013875e557b1cf0dfd9a368a1c3dab3b548dd" + integrity sha512-KiwVUcFu1RErkI97ywr8nvx8dNOpT03rbnma0SSalTYjkrPYaEajR4a/MRt6DZ46K6arDRbWMNHF+xH7G7n/8A== + dependencies: + lodash "^4.0.1" + read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" diff --git a/hasura/migrations/1600878473457_alter_table_public_appointments_add_column_color/down.yaml b/hasura/migrations/1600878473457_alter_table_public_appointments_add_column_color/down.yaml new file mode 100644 index 000000000..9b542b85b --- /dev/null +++ b/hasura/migrations/1600878473457_alter_table_public_appointments_add_column_color/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."appointments" DROP COLUMN "color"; + type: run_sql diff --git a/hasura/migrations/1600878473457_alter_table_public_appointments_add_column_color/up.yaml b/hasura/migrations/1600878473457_alter_table_public_appointments_add_column_color/up.yaml new file mode 100644 index 000000000..49c013814 --- /dev/null +++ b/hasura/migrations/1600878473457_alter_table_public_appointments_add_column_color/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."appointments" ADD COLUMN "color" text NULL; + type: run_sql diff --git a/hasura/migrations/1600878486095_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations/1600878486095_update_permission_user_public_table_appointments/down.yaml new file mode 100644 index 000000000..395eb2282 --- /dev/null +++ b/hasura/migrations/1600878486095_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: + - arrived + - block + - bodyshopid + - canceled + - created_at + - end + - id + - isintake + - jobid + - start + - title + - updated_at + set: {} + role: user + table: + name: appointments + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1600878486095_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations/1600878486095_update_permission_user_public_table_appointments/up.yaml new file mode 100644 index 000000000..6ede145d6 --- /dev/null +++ b/hasura/migrations/1600878486095_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 + - block + - bodyshopid + - canceled + - color + - created_at + - end + - id + - isintake + - jobid + - start + - title + - updated_at + set: {} + role: user + table: + name: appointments + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1600878494450_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations/1600878494450_update_permission_user_public_table_appointments/down.yaml new file mode 100644 index 000000000..493ba4dcc --- /dev/null +++ b/hasura/migrations/1600878494450_update_permission_user_public_table_appointments/down.yaml @@ -0,0 +1,37 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - arrived + - block + - bodyshopid + - canceled + - created_at + - end + - id + - isintake + - jobid + - start + - title + - updated_at + 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/1600878494450_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations/1600878494450_update_permission_user_public_table_appointments/up.yaml new file mode 100644 index 000000000..049d91b6a --- /dev/null +++ b/hasura/migrations/1600878494450_update_permission_user_public_table_appointments/up.yaml @@ -0,0 +1,38 @@ +- args: + role: user + table: + name: appointments + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - arrived + - block + - bodyshopid + - canceled + - color + - created_at + - end + - id + - isintake + - jobid + - start + - title + - updated_at + 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/1600878500075_update_permission_user_public_table_appointments/down.yaml b/hasura/migrations/1600878500075_update_permission_user_public_table_appointments/down.yaml new file mode 100644 index 000000000..ceb8763aa --- /dev/null +++ b/hasura/migrations/1600878500075_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 + - block + - bodyshopid + - canceled + - created_at + - end + - id + - isintake + - jobid + - start + - title + - updated_at + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + set: {} + role: user + table: + name: appointments + schema: public + type: create_update_permission diff --git a/hasura/migrations/1600878500075_update_permission_user_public_table_appointments/up.yaml b/hasura/migrations/1600878500075_update_permission_user_public_table_appointments/up.yaml new file mode 100644 index 000000000..68d734d03 --- /dev/null +++ b/hasura/migrations/1600878500075_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 + - block + - bodyshopid + - canceled + - color + - created_at + - end + - id + - isintake + - jobid + - start + - title + - updated_at + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + set: {} + role: user + table: + name: appointments + schema: public + type: create_update_permission diff --git a/hasura/migrations/1600880138974_alter_table_public_bodyshops_add_column_appt_colors/down.yaml b/hasura/migrations/1600880138974_alter_table_public_bodyshops_add_column_appt_colors/down.yaml new file mode 100644 index 000000000..8e3e479b3 --- /dev/null +++ b/hasura/migrations/1600880138974_alter_table_public_bodyshops_add_column_appt_colors/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."bodyshops" DROP COLUMN "appt_colors"; + type: run_sql diff --git a/hasura/migrations/1600880138974_alter_table_public_bodyshops_add_column_appt_colors/up.yaml b/hasura/migrations/1600880138974_alter_table_public_bodyshops_add_column_appt_colors/up.yaml new file mode 100644 index 000000000..b652f4729 --- /dev/null +++ b/hasura/migrations/1600880138974_alter_table_public_bodyshops_add_column_appt_colors/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."bodyshops" ADD COLUMN "appt_colors" jsonb NULL DEFAULT + jsonb_build_array(); + type: run_sql diff --git a/hasura/migrations/1600880847605_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations/1600880847605_update_permission_user_public_table_bodyshops/down.yaml new file mode 100644 index 000000000..a4430067b --- /dev/null +++ b/hasura/migrations/1600880847605_update_permission_user_public_table_bodyshops/down.yaml @@ -0,0 +1,70 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - accountingconfig + - address1 + - address2 + - appt_length + - city + - country + - created_at + - deliverchecklist + - email + - enforce_class + - federal_tax_id + - id + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - bill_tax_rates + - logo_img_path + - md_categories + - md_classes + - md_ins_cos + - md_labor_rates + - md_messaging_presets + - md_notes_presets + - md_order_statuses + - md_parts_locations + - md_rbac + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - messagingservicesid + - phone + - prodtargethrs + - production_config + - region_config + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - stripe_acct_id + - target_touchtime + - template_header + - textid + - updated_at + - zip_post + computed_fields: [] + filter: + associations: + bodyshop: + associations: + user: + authid: + _eq: X-Hasura-User-Id + role: user + table: + name: bodyshops + schema: public + type: create_select_permission diff --git a/hasura/migrations/1600880847605_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations/1600880847605_update_permission_user_public_table_bodyshops/up.yaml new file mode 100644 index 000000000..86a8318df --- /dev/null +++ b/hasura/migrations/1600880847605_update_permission_user_public_table_bodyshops/up.yaml @@ -0,0 +1,71 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - accountingconfig + - address1 + - address2 + - appt_colors + - appt_length + - bill_tax_rates + - city + - country + - created_at + - deliverchecklist + - email + - enforce_class + - federal_tax_id + - id + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - logo_img_path + - md_categories + - md_classes + - md_ins_cos + - md_labor_rates + - md_messaging_presets + - md_notes_presets + - md_order_statuses + - md_parts_locations + - md_rbac + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - messagingservicesid + - phone + - prodtargethrs + - production_config + - region_config + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - stripe_acct_id + - target_touchtime + - template_header + - textid + - updated_at + - zip_post + computed_fields: [] + filter: + associations: + bodyshop: + associations: + user: + authid: + _eq: X-Hasura-User-Id + role: user + table: + name: bodyshops + schema: public + type: create_select_permission diff --git a/hasura/migrations/1600880860765_update_permission_user_public_table_bodyshops/down.yaml b/hasura/migrations/1600880860765_update_permission_user_public_table_bodyshops/down.yaml new file mode 100644 index 000000000..ad8fc3ab8 --- /dev/null +++ b/hasura/migrations/1600880860765_update_permission_user_public_table_bodyshops/down.yaml @@ -0,0 +1,64 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_update_permission +- args: + permission: + columns: + - accountingconfig + - address1 + - address2 + - appt_length + - city + - country + - created_at + - deliverchecklist + - email + - enforce_class + - federal_tax_id + - id + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - bill_tax_rates + - logo_img_path + - md_categories + - md_classes + - md_ins_cos + - md_labor_rates + - md_messaging_presets + - md_notes_presets + - md_order_statuses + - md_parts_locations + - md_rbac + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - phone + - prodtargethrs + - production_config + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - target_touchtime + - updated_at + - zip_post + filter: + associations: + bodyshop: + associations: + user: + authid: + _eq: X-Hasura-User-Id + set: {} + role: user + table: + name: bodyshops + schema: public + type: create_update_permission diff --git a/hasura/migrations/1600880860765_update_permission_user_public_table_bodyshops/up.yaml b/hasura/migrations/1600880860765_update_permission_user_public_table_bodyshops/up.yaml new file mode 100644 index 000000000..7774e363d --- /dev/null +++ b/hasura/migrations/1600880860765_update_permission_user_public_table_bodyshops/up.yaml @@ -0,0 +1,65 @@ +- args: + role: user + table: + name: bodyshops + schema: public + type: drop_update_permission +- args: + permission: + columns: + - accountingconfig + - address1 + - address2 + - appt_colors + - appt_length + - bill_tax_rates + - city + - country + - created_at + - deliverchecklist + - email + - enforce_class + - federal_tax_id + - id + - inhousevendorid + - insurance_vendor_id + - intakechecklist + - logo_img_path + - md_categories + - md_classes + - md_ins_cos + - md_labor_rates + - md_messaging_presets + - md_notes_presets + - md_order_statuses + - md_parts_locations + - md_rbac + - md_referral_sources + - md_responsibility_centers + - md_ro_statuses + - phone + - prodtargethrs + - production_config + - scoreboard_target + - shopname + - shoprates + - speedprint + - ssbuckets + - state + - state_tax_id + - target_touchtime + - updated_at + - zip_post + filter: + associations: + bodyshop: + associations: + user: + authid: + _eq: X-Hasura-User-Id + set: {} + role: user + table: + name: bodyshops + schema: public + type: create_update_permission diff --git a/hasura/migrations/metadata.yaml b/hasura/migrations/metadata.yaml index 0b98501ee..5142af8ba 100644 --- a/hasura/migrations/metadata.yaml +++ b/hasura/migrations/metadata.yaml @@ -109,6 +109,7 @@ tables: - block - bodyshopid - canceled + - color - created_at - end - id @@ -125,6 +126,7 @@ tables: - block - bodyshopid - canceled + - color - created_at - end - id @@ -151,6 +153,7 @@ tables: - block - bodyshopid - canceled + - color - created_at - end - id @@ -692,7 +695,9 @@ tables: - accountingconfig - address1 - address2 + - appt_colors - appt_length + - bill_tax_rates - city - country - created_at @@ -704,7 +709,6 @@ tables: - inhousevendorid - insurance_vendor_id - intakechecklist - - bill_tax_rates - logo_img_path - md_categories - md_classes @@ -750,7 +754,9 @@ tables: - accountingconfig - address1 - address2 + - appt_colors - appt_length + - bill_tax_rates - city - country - created_at @@ -762,7 +768,6 @@ tables: - inhousevendorid - insurance_vendor_id - intakechecklist - - bill_tax_rates - logo_img_path - md_categories - md_classes