diff --git a/client/src/components/alert/alert.component.test.js b/client/src/components/alert/alert.component.test.js index 4e850158f..da5d57cb8 100644 --- a/client/src/components/alert/alert.component.test.js +++ b/client/src/components/alert/alert.component.test.js @@ -2,10 +2,12 @@ import React from "react"; import ReactDOM from "react-dom"; import Alert from "./alert.component"; import { MockedProvider } from "@apollo/react-testing"; -import { shallow } from "enzyme"; +import { shallow, mount } from "enzyme"; const div = document.createElement("div"); it("renders without crashing", () => { - shallow(); + const wrapper = mount(); + console.log("wrapper", wrapper); + // expect(wrapper.children()).to.have.lengthOf(1); }); diff --git a/client/src/components/allocations-assignment/allocations-assignment.component.test.js b/client/src/components/allocations-assignment/allocations-assignment.component.test.js new file mode 100644 index 000000000..e69de29bb diff --git a/client/src/components/allocations-assignment/allocations-assignment.container.test.jsx b/client/src/components/allocations-assignment/allocations-assignment.container.test.jsx new file mode 100644 index 000000000..87f6ff8eb --- /dev/null +++ b/client/src/components/allocations-assignment/allocations-assignment.container.test.jsx @@ -0,0 +1,20 @@ +import React from "react"; +import { shallow } from "enzyme"; +import AllocationsAssignmentContainer from "./allocations-assignment.container"; + +describe("LineAllocationsContainer", () => { + let mockRefetch; + let jobLineId; + let wrapper; + beforeEach(() => { + mockRefetch = jest.fn; + jobLineId = "b76e44a8-943f-4c67-b8f4-38d14db8b4b8"; + const mockProps = { + refetch: mockRefetch, + jobLineId, + hours: 5 + }; + + shallow(); + }); +}); diff --git a/client/src/components/vendors-form/vendors-form.component.jsx b/client/src/components/vendors-form/vendors-form.component.jsx index 62c481269..bd076ac89 100644 --- a/client/src/components/vendors-form/vendors-form.component.jsx +++ b/client/src/components/vendors-form/vendors-form.component.jsx @@ -1,8 +1,19 @@ -import { Button, Form, Input, InputNumber, Switch } from "antd"; +import { + Button, + Checkbox, + Col, + Form, + Icon, + Input, + InputNumber, + Row +} from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import FormItemEmail from "../form-items-formatted/email-form-item.component"; import ResetForm from "../form-items-formatted/reset-form-item.component"; +let id = 0; + export default function VendorsFormComponent({ form, vendor, handleDelete }) { const { getFieldDecorator, @@ -11,61 +22,131 @@ export default function VendorsFormComponent({ form, vendor, handleDelete }) { resetFields } = form; + getFieldDecorator("keys", { + initialValue: Array.isArray(vendor.favorite) ? vendor.favorite : [] + }); + + const remove = k => { + // can use data-binding to get + const keys = form.getFieldValue("keys"); + console.log("keys", keys); + // We need at least one passenger + if (keys.length === 1) { + return; + } + // can use data-binding to set + form.setFieldsValue({ + keys: keys.filter(key => key !== k) + }); + }; + + const add = props => { + console.log("props", props); + // can use data-binding to get + const keys = form.getFieldValue("keys"); + console.log("keys", keys); + const nextKeys = keys.concat(id++); + // can use data-binding to set + // important! notify form to detect changes + form.setFieldsValue({ + keys: nextKeys + }); + }; + const { t } = useTranslation(); return (
{isFieldsTouched() ? : null} - - + + {getFieldValue("keys").map((k, index) => ( + + {getFieldDecorator(`favorite[${k}].make`, { + validateTrigger: ["onChange", "onBlur"] + })( + + )} + {getFieldValue("keys").length > 1 ? ( + remove(k)} + /> + ) : null} + + {getFieldDecorator(`favorite[${k}].type`, { + initialValue: null + })( + + + + OEM + + + LKQ + + + AM + + + + )} + + + ))} + + + + {getFieldDecorator("zip", { initialValue: vendor.zip - })()} + })()} {getFieldDecorator("terms", { initialValue: vendor.terms - })()} + })()} {getFieldDecorator("taxid", { initialValue: vendor.taxid - })()} + })()} {getFieldDecorator("street1", { initialValue: vendor.street1 - })()} + })()} {getFieldDecorator("street2", { initialValue: vendor.street2 - })()} + })()} {getFieldDecorator("state", { initialValue: vendor.state - })()} - {" "} + })()} + {getFieldDecorator("prompt_discount", { initialValue: vendor.prompt_discount - })()} + })()} {getFieldDecorator("name", { initialValue: vendor.name - })()} - - - {getFieldDecorator("favorite", { - initialValue: vendor.favorite, - valuePropName: "checked" - })()} + })()} {getFieldDecorator("email", { @@ -76,38 +157,38 @@ export default function VendorsFormComponent({ form, vendor, handleDelete }) { message: t("general.validation.invalidemail") } ] - })()} + })()} {getFieldDecorator("due_date", { initialValue: vendor.due_date - })()} + })()} {getFieldDecorator("display_name", { initialValue: vendor.display_name - })()} + })()} {getFieldDecorator("discount", { initialValue: vendor.discount - })()} + })()} {getFieldDecorator("country", { initialValue: vendor.country - })()} + })()} {getFieldDecorator("cost_center", { initialValue: vendor.cost_center, rules: [{ required: true, message: t("general.validation.required") }] - })()} + })()} {getFieldDecorator("city", { initialValue: vendor.city - })()} + })()}
); diff --git a/client/src/components/vendors-form/vendors-form.container.jsx b/client/src/components/vendors-form/vendors-form.container.jsx index 3ec640c72..05ad0ee5d 100644 --- a/client/src/components/vendors-form/vendors-form.container.jsx +++ b/client/src/components/vendors-form/vendors-form.container.jsx @@ -1,29 +1,36 @@ +import { Form, notification } from "antd"; import React from "react"; -import { Form } from "antd"; -import VendorsFormComponent from "./vendors-form.component"; +import { useMutation, useQuery } from "react-apollo"; import { useTranslation } from "react-i18next"; -import { notification } from "antd"; -import { - UPDATE_VENDOR, - INSERT_NEW_VENDOR, - DELETE_VENDOR -} from "../../graphql/vendors.queries"; -import { useMutation } from "react-apollo"; - import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; +import { + DELETE_VENDOR, + INSERT_NEW_VENDOR, + UPDATE_VENDOR, + QUERY_VENDOR_BY_ID +} from "../../graphql/vendors.queries"; import { selectBodyshop } from "../../redux/user/user.selectors"; +import VendorsFormComponent from "./vendors-form.component"; +import LoadingSpinner from "../loading-spinner/loading-spinner.component"; +import AlertComponent from "../alert/alert.component"; + const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop }); -function VendorsFormContainer({ form, vendor, refetch, bodyshop }) { +function VendorsFormContainer({ form, vendorId, refetch, bodyshop }) { const { t } = useTranslation(); + const { loading, error, data } = useQuery(QUERY_VENDOR_BY_ID, { + variables: { id: vendorId }, + fetchPolicy: "network-only", + skip: !vendorId + }); const [updateVendor] = useMutation(UPDATE_VENDOR); const [insertvendor] = useMutation(INSERT_NEW_VENDOR); const [deleteVendor] = useMutation(DELETE_VENDOR); const handleDelete = () => { - deleteVendor({ variables: { id: vendor.id } }) + deleteVendor({ variables: { id: vendorId } }) .then(r => { notification["success"]({ message: t("vendors.successes.deleted") @@ -48,10 +55,12 @@ function VendorsFormContainer({ form, vendor, refetch, bodyshop }) { }); } if (!err) { - if (vendor.id) { + console.log("Received values of form: ", values); + delete values.keys; + if (vendorId) { //It's a vendor to update. updateVendor({ - variables: { id: vendor.id, vendor: values } + variables: { id: vendorId, vendor: values } }) .then(r => { notification["success"]({ @@ -87,20 +96,20 @@ function VendorsFormContainer({ form, vendor, refetch, bodyshop }) { }); }; + if (loading) return ; + if (error) return ; return ( -
-
- {vendor ? ( - - ) : ( - t("vendors.labels.noneselected") - )} - -
+
+ {data ? ( + + ) : ( + t("vendors.labels.noneselected") + )} + ); } export default connect( diff --git a/client/src/components/vendors-list/vendors-list.component.jsx b/client/src/components/vendors-list/vendors-list.component.jsx index f8b7b5c1c..6f3ef2452 100644 --- a/client/src/components/vendors-list/vendors-list.component.jsx +++ b/client/src/components/vendors-list/vendors-list.component.jsx @@ -26,11 +26,6 @@ export default function VendorsListComponent({ sorter: (a, b) => alphaSort(a.name, b.name), sortOrder: state.sortedInfo.columnKey === "name" && state.sortedInfo.order }, - { - title: t("vendors.fields.favorite"), - dataIndex: "favorite", - key: "favorite" - }, { title: t("vendors.fields.cost_center"), dataIndex: "cost_center", @@ -81,10 +76,10 @@ export default function VendorsListComponent({ ); }} - size='small' + size="small" pagination={{ position: "top" }} columns={columns.map(item => ({ ...item }))} - rowKey='id' + rowKey="id" onChange={handleTableChange} dataSource={vendors} rowSelection={{ diff --git a/client/src/graphql/apollo-error-handling.js b/client/src/graphql/apollo-error-handling.js index a3e067908..ae9aa77e4 100644 --- a/client/src/graphql/apollo-error-handling.js +++ b/client/src/graphql/apollo-error-handling.js @@ -42,7 +42,7 @@ const errorLink = onError( // }); // console.log("forward", forward); // console.log("operation", operation); - return forward(operation).subscribe(); + return forward(operation); // return new Observable(observer => { // const subscriber = { diff --git a/client/src/graphql/vendors.queries.js b/client/src/graphql/vendors.queries.js index c3aa48a1e..4cf45ebd6 100644 --- a/client/src/graphql/vendors.queries.js +++ b/client/src/graphql/vendors.queries.js @@ -39,7 +39,6 @@ export const QUERY_ALL_VENDORS = gql` vendors { name id - favorite street1 cost_center city diff --git a/client/src/pages/landing/landing.page.jsx b/client/src/pages/landing/landing.page.jsx index b9363db1a..c565e4f58 100644 --- a/client/src/pages/landing/landing.page.jsx +++ b/client/src/pages/landing/landing.page.jsx @@ -1,13 +1,19 @@ import React from "react"; -import { Typography } from "antd"; +import { Typography, Layout } from "antd"; import HeaderContainer from "../../components/header/header.container"; export default function LandingPage() { + const { Header, Content } = Layout; return ( -
- - Welcome to bodyshop.app. -
+ +
+ +
+ + + Welcome to bodyshop.app. + +
); } diff --git a/client/src/pages/shop-vendor/shop-vendor.page.component.jsx b/client/src/pages/shop-vendor/shop-vendor.page.component.jsx index 8a5817424..551657fa8 100644 --- a/client/src/pages/shop-vendor/shop-vendor.page.component.jsx +++ b/client/src/pages/shop-vendor/shop-vendor.page.component.jsx @@ -7,7 +7,9 @@ export default function ShopVendorPageComponent({ selectedVendorState }) { return (
- +
); } diff --git a/hasura/migrations/1581709302822_alter_table_public_vendors_alter_column_favorite/down.yaml b/hasura/migrations/1581709302822_alter_table_public_vendors_alter_column_favorite/down.yaml new file mode 100644 index 000000000..8a5cf3c4e --- /dev/null +++ b/hasura/migrations/1581709302822_alter_table_public_vendors_alter_column_favorite/down.yaml @@ -0,0 +1,9 @@ +- args: + sql: ALTER TABLE "public"."vendors" ALTER COLUMN "favorite" TYPE boolean; + type: run_sql +- args: + sql: ALTER TABLE "public"."vendors" ALTER COLUMN "favorite" SET NOT NULL; + type: run_sql +- args: + sql: COMMENT ON COLUMN "public"."vendors"."favorite" IS E'null' + type: run_sql diff --git a/hasura/migrations/1581709302822_alter_table_public_vendors_alter_column_favorite/up.yaml b/hasura/migrations/1581709302822_alter_table_public_vendors_alter_column_favorite/up.yaml new file mode 100644 index 000000000..906eaaded --- /dev/null +++ b/hasura/migrations/1581709302822_alter_table_public_vendors_alter_column_favorite/up.yaml @@ -0,0 +1,9 @@ +- args: + sql: ALTER TABLE "public"."vendors" ALTER COLUMN "favorite" TYPE bool; + type: run_sql +- args: + sql: ALTER TABLE "public"."vendors" ALTER COLUMN "favorite" DROP NOT NULL; + type: run_sql +- args: + sql: COMMENT ON COLUMN "public"."vendors"."favorite" IS E'' + type: run_sql diff --git a/hasura/migrations/1581709971205_update_permission_user_public_table_vendors/down.yaml b/hasura/migrations/1581709971205_update_permission_user_public_table_vendors/down.yaml new file mode 100644 index 000000000..d9f4efe71 --- /dev/null +++ b/hasura/migrations/1581709971205_update_permission_user_public_table_vendors/down.yaml @@ -0,0 +1,47 @@ +- args: + role: user + table: + name: vendors + 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 + - bodyshopid + - name + - street1 + - street2 + - city + - state + - zip + - country + - email + - taxid + - discount + - prompt_discount + - due_date + - terms + - display_name + - cost_center + - favorite + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: vendors + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581709971205_update_permission_user_public_table_vendors/up.yaml b/hasura/migrations/1581709971205_update_permission_user_public_table_vendors/up.yaml new file mode 100644 index 000000000..556607894 --- /dev/null +++ b/hasura/migrations/1581709971205_update_permission_user_public_table_vendors/up.yaml @@ -0,0 +1,46 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - bodyshopid + - city + - cost_center + - country + - created_at + - discount + - display_name + - due_date + - email + - id + - name + - prompt_discount + - state + - street1 + - street2 + - taxid + - terms + - updated_at + - zip + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: vendors + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581709974750_update_permission_user_public_table_vendors/down.yaml b/hasura/migrations/1581709974750_update_permission_user_public_table_vendors/down.yaml new file mode 100644 index 000000000..48f129b36 --- /dev/null +++ b/hasura/migrations/1581709974750_update_permission_user_public_table_vendors/down.yaml @@ -0,0 +1,45 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - favorite + - due_date + - discount + - prompt_discount + - city + - cost_center + - country + - display_name + - email + - name + - state + - street1 + - street2 + - taxid + - terms + - zip + - created_at + - updated_at + - bodyshopid + - id + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: vendors + schema: public + type: create_select_permission diff --git a/hasura/migrations/1581709974750_update_permission_user_public_table_vendors/up.yaml b/hasura/migrations/1581709974750_update_permission_user_public_table_vendors/up.yaml new file mode 100644 index 000000000..d83868cce --- /dev/null +++ b/hasura/migrations/1581709974750_update_permission_user_public_table_vendors/up.yaml @@ -0,0 +1,44 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - bodyshopid + - city + - cost_center + - country + - created_at + - discount + - display_name + - due_date + - email + - id + - name + - prompt_discount + - state + - street1 + - street2 + - taxid + - terms + - updated_at + - zip + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: vendors + schema: public + type: create_select_permission diff --git a/hasura/migrations/1581709977611_update_permission_user_public_table_vendors/down.yaml b/hasura/migrations/1581709977611_update_permission_user_public_table_vendors/down.yaml new file mode 100644 index 000000000..50a77d8ce --- /dev/null +++ b/hasura/migrations/1581709977611_update_permission_user_public_table_vendors/down.yaml @@ -0,0 +1,47 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_update_permission +- args: + permission: + columns: + - favorite + - due_date + - discount + - prompt_discount + - city + - cost_center + - country + - display_name + - email + - name + - state + - street1 + - street2 + - taxid + - terms + - zip + - created_at + - updated_at + - bodyshopid + - id + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: vendors + schema: public + type: create_update_permission diff --git a/hasura/migrations/1581709977611_update_permission_user_public_table_vendors/up.yaml b/hasura/migrations/1581709977611_update_permission_user_public_table_vendors/up.yaml new file mode 100644 index 000000000..d202a5ce4 --- /dev/null +++ b/hasura/migrations/1581709977611_update_permission_user_public_table_vendors/up.yaml @@ -0,0 +1,46 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_update_permission +- args: + permission: + columns: + - bodyshopid + - city + - cost_center + - country + - created_at + - discount + - display_name + - due_date + - email + - id + - name + - prompt_discount + - state + - street1 + - street2 + - taxid + - terms + - updated_at + - zip + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: vendors + schema: public + type: create_update_permission diff --git a/hasura/migrations/1581709987588_alter_table_public_vendors_drop_column_favorite/down.yaml b/hasura/migrations/1581709987588_alter_table_public_vendors_drop_column_favorite/down.yaml new file mode 100644 index 000000000..b47bc0a1a --- /dev/null +++ b/hasura/migrations/1581709987588_alter_table_public_vendors_drop_column_favorite/down.yaml @@ -0,0 +1,9 @@ +- args: + sql: ALTER TABLE "public"."vendors" ADD COLUMN "favorite" bool + type: run_sql +- args: + sql: ALTER TABLE "public"."vendors" ALTER COLUMN "favorite" DROP NOT NULL + type: run_sql +- args: + sql: ALTER TABLE "public"."vendors" ALTER COLUMN "favorite" SET DEFAULT false + type: run_sql diff --git a/hasura/migrations/1581709987588_alter_table_public_vendors_drop_column_favorite/up.yaml b/hasura/migrations/1581709987588_alter_table_public_vendors_drop_column_favorite/up.yaml new file mode 100644 index 000000000..3d0e308e7 --- /dev/null +++ b/hasura/migrations/1581709987588_alter_table_public_vendors_drop_column_favorite/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."vendors" DROP COLUMN "favorite" CASCADE + type: run_sql diff --git a/hasura/migrations/1581710140783_alter_table_public_vendors_add_column_favorite/down.yaml b/hasura/migrations/1581710140783_alter_table_public_vendors_add_column_favorite/down.yaml new file mode 100644 index 000000000..09a6eda1f --- /dev/null +++ b/hasura/migrations/1581710140783_alter_table_public_vendors_add_column_favorite/down.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."vendors" DROP COLUMN "favorite"; + type: run_sql diff --git a/hasura/migrations/1581710140783_alter_table_public_vendors_add_column_favorite/up.yaml b/hasura/migrations/1581710140783_alter_table_public_vendors_add_column_favorite/up.yaml new file mode 100644 index 000000000..d8f51f437 --- /dev/null +++ b/hasura/migrations/1581710140783_alter_table_public_vendors_add_column_favorite/up.yaml @@ -0,0 +1,3 @@ +- args: + sql: ALTER TABLE "public"."vendors" ADD COLUMN "favorite" jsonb NULL; + type: run_sql diff --git a/hasura/migrations/1581710237559_update_permission_user_public_table_vendors/down.yaml b/hasura/migrations/1581710237559_update_permission_user_public_table_vendors/down.yaml new file mode 100644 index 000000000..556607894 --- /dev/null +++ b/hasura/migrations/1581710237559_update_permission_user_public_table_vendors/down.yaml @@ -0,0 +1,46 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - bodyshopid + - city + - cost_center + - country + - created_at + - discount + - display_name + - due_date + - email + - id + - name + - prompt_discount + - state + - street1 + - street2 + - taxid + - terms + - updated_at + - zip + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: vendors + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581710237559_update_permission_user_public_table_vendors/up.yaml b/hasura/migrations/1581710237559_update_permission_user_public_table_vendors/up.yaml new file mode 100644 index 000000000..03e3a58fd --- /dev/null +++ b/hasura/migrations/1581710237559_update_permission_user_public_table_vendors/up.yaml @@ -0,0 +1,47 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - due_date + - favorite + - discount + - prompt_discount + - city + - cost_center + - country + - display_name + - email + - name + - state + - street1 + - street2 + - taxid + - terms + - zip + - created_at + - updated_at + - bodyshopid + - id + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: vendors + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581710252861_update_permission_user_public_table_vendors/down.yaml b/hasura/migrations/1581710252861_update_permission_user_public_table_vendors/down.yaml new file mode 100644 index 000000000..d83868cce --- /dev/null +++ b/hasura/migrations/1581710252861_update_permission_user_public_table_vendors/down.yaml @@ -0,0 +1,44 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - bodyshopid + - city + - cost_center + - country + - created_at + - discount + - display_name + - due_date + - email + - id + - name + - prompt_discount + - state + - street1 + - street2 + - taxid + - terms + - updated_at + - zip + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: vendors + schema: public + type: create_select_permission diff --git a/hasura/migrations/1581710252861_update_permission_user_public_table_vendors/up.yaml b/hasura/migrations/1581710252861_update_permission_user_public_table_vendors/up.yaml new file mode 100644 index 000000000..326b62d07 --- /dev/null +++ b/hasura/migrations/1581710252861_update_permission_user_public_table_vendors/up.yaml @@ -0,0 +1,45 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - due_date + - favorite + - discount + - prompt_discount + - city + - cost_center + - country + - display_name + - email + - name + - state + - street1 + - street2 + - taxid + - terms + - zip + - created_at + - updated_at + - bodyshopid + - id + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: vendors + schema: public + type: create_select_permission diff --git a/hasura/migrations/1581710255645_update_permission_user_public_table_vendors/down.yaml b/hasura/migrations/1581710255645_update_permission_user_public_table_vendors/down.yaml new file mode 100644 index 000000000..d202a5ce4 --- /dev/null +++ b/hasura/migrations/1581710255645_update_permission_user_public_table_vendors/down.yaml @@ -0,0 +1,46 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_update_permission +- args: + permission: + columns: + - bodyshopid + - city + - cost_center + - country + - created_at + - discount + - display_name + - due_date + - email + - id + - name + - prompt_discount + - state + - street1 + - street2 + - taxid + - terms + - updated_at + - zip + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: vendors + schema: public + type: create_update_permission diff --git a/hasura/migrations/1581710255645_update_permission_user_public_table_vendors/up.yaml b/hasura/migrations/1581710255645_update_permission_user_public_table_vendors/up.yaml new file mode 100644 index 000000000..323704732 --- /dev/null +++ b/hasura/migrations/1581710255645_update_permission_user_public_table_vendors/up.yaml @@ -0,0 +1,47 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_update_permission +- args: + permission: + columns: + - due_date + - favorite + - discount + - prompt_discount + - city + - cost_center + - country + - display_name + - email + - name + - state + - street1 + - street2 + - taxid + - terms + - zip + - created_at + - updated_at + - bodyshopid + - id + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: vendors + schema: public + type: create_update_permission diff --git a/hasura/migrations/1581710270792_update_permission_user_public_table_vendors/down.yaml b/hasura/migrations/1581710270792_update_permission_user_public_table_vendors/down.yaml new file mode 100644 index 000000000..556607894 --- /dev/null +++ b/hasura/migrations/1581710270792_update_permission_user_public_table_vendors/down.yaml @@ -0,0 +1,46 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - bodyshopid + - city + - cost_center + - country + - created_at + - discount + - display_name + - due_date + - email + - id + - name + - prompt_discount + - state + - street1 + - street2 + - taxid + - terms + - updated_at + - zip + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: vendors + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581710270792_update_permission_user_public_table_vendors/up.yaml b/hasura/migrations/1581710270792_update_permission_user_public_table_vendors/up.yaml new file mode 100644 index 000000000..03e3a58fd --- /dev/null +++ b/hasura/migrations/1581710270792_update_permission_user_public_table_vendors/up.yaml @@ -0,0 +1,47 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_insert_permission +- args: + permission: + check: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - due_date + - favorite + - discount + - prompt_discount + - city + - cost_center + - country + - display_name + - email + - name + - state + - street1 + - street2 + - taxid + - terms + - zip + - created_at + - updated_at + - bodyshopid + - id + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: vendors + schema: public + type: create_insert_permission diff --git a/hasura/migrations/1581710283854_update_permission_user_public_table_vendors/down.yaml b/hasura/migrations/1581710283854_update_permission_user_public_table_vendors/down.yaml new file mode 100644 index 000000000..d83868cce --- /dev/null +++ b/hasura/migrations/1581710283854_update_permission_user_public_table_vendors/down.yaml @@ -0,0 +1,44 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - bodyshopid + - city + - cost_center + - country + - created_at + - discount + - display_name + - due_date + - email + - id + - name + - prompt_discount + - state + - street1 + - street2 + - taxid + - terms + - updated_at + - zip + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: vendors + schema: public + type: create_select_permission diff --git a/hasura/migrations/1581710283854_update_permission_user_public_table_vendors/up.yaml b/hasura/migrations/1581710283854_update_permission_user_public_table_vendors/up.yaml new file mode 100644 index 000000000..326b62d07 --- /dev/null +++ b/hasura/migrations/1581710283854_update_permission_user_public_table_vendors/up.yaml @@ -0,0 +1,45 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - due_date + - favorite + - discount + - prompt_discount + - city + - cost_center + - country + - display_name + - email + - name + - state + - street1 + - street2 + - taxid + - terms + - zip + - created_at + - updated_at + - bodyshopid + - id + computed_fields: [] + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + role: user + table: + name: vendors + schema: public + type: create_select_permission diff --git a/hasura/migrations/1581710297623_update_permission_user_public_table_vendors/down.yaml b/hasura/migrations/1581710297623_update_permission_user_public_table_vendors/down.yaml new file mode 100644 index 000000000..d202a5ce4 --- /dev/null +++ b/hasura/migrations/1581710297623_update_permission_user_public_table_vendors/down.yaml @@ -0,0 +1,46 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_update_permission +- args: + permission: + columns: + - bodyshopid + - city + - cost_center + - country + - created_at + - discount + - display_name + - due_date + - email + - id + - name + - prompt_discount + - state + - street1 + - street2 + - taxid + - terms + - updated_at + - zip + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: vendors + schema: public + type: create_update_permission diff --git a/hasura/migrations/1581710297623_update_permission_user_public_table_vendors/up.yaml b/hasura/migrations/1581710297623_update_permission_user_public_table_vendors/up.yaml new file mode 100644 index 000000000..323704732 --- /dev/null +++ b/hasura/migrations/1581710297623_update_permission_user_public_table_vendors/up.yaml @@ -0,0 +1,47 @@ +- args: + role: user + table: + name: vendors + schema: public + type: drop_update_permission +- args: + permission: + columns: + - due_date + - favorite + - discount + - prompt_discount + - city + - cost_center + - country + - display_name + - email + - name + - state + - street1 + - street2 + - taxid + - terms + - zip + - created_at + - updated_at + - bodyshopid + - id + filter: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: vendors + schema: public + type: create_update_permission