diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 1621a7dac..00748dce8 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -24450,6 +24450,27 @@ + + shop-vendors + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + timetickets false diff --git a/client/public/logo1024.png b/client/public/logo1024.png index ad7634169..29354e759 100644 Binary files a/client/public/logo1024.png and b/client/public/logo1024.png differ diff --git a/client/public/logo192.png b/client/public/logo192.png index fa313abf5..d14882bea 100644 Binary files a/client/public/logo192.png and b/client/public/logo192.png differ diff --git a/client/public/logo240.png b/client/public/logo240.png deleted file mode 100644 index 07fffbeee..000000000 Binary files a/client/public/logo240.png and /dev/null differ diff --git a/client/public/logo512.png b/client/public/logo512.png index bd5d4b5e2..b203938b8 100644 Binary files a/client/public/logo512.png and b/client/public/logo512.png differ diff --git a/client/public/logo600.png b/client/public/logo600.png deleted file mode 100644 index 912e6e2ce..000000000 Binary files a/client/public/logo600.png and /dev/null differ diff --git a/client/public/vorfahrt.png b/client/public/vorfahrt.png new file mode 100644 index 000000000..ef8ea8215 Binary files /dev/null and b/client/public/vorfahrt.png differ diff --git a/client/src/components/header/header.component.jsx b/client/src/components/header/header.component.jsx index 86a62e5a7..fb6884e6b 100644 --- a/client/src/components/header/header.component.jsx +++ b/client/src/components/header/header.component.jsx @@ -69,6 +69,7 @@ function Header({ - - + + + + + + + + + + + + + + + + + + + + + + + + + {" "} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {(fields, { add, remove }) => { @@ -65,72 +146,6 @@ export default function VendorsFormComponent({ ); }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); } diff --git a/client/src/components/vendors-form/vendors-form.container.jsx b/client/src/components/vendors-form/vendors-form.container.jsx index 8a11875ec..d845d87bf 100644 --- a/client/src/components/vendors-form/vendors-form.container.jsx +++ b/client/src/components/vendors-form/vendors-form.container.jsx @@ -1,12 +1,17 @@ import { useMutation, useQuery } from "@apollo/react-hooks"; import { Form, notification } from "antd"; import queryString from "query-string"; -import React, { useEffect } from "react"; +import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { useLocation } from "react-router-dom"; import { createStructuredSelector } from "reselect"; -import { DELETE_VENDOR, INSERT_NEW_VENDOR, QUERY_VENDOR_BY_ID, UPDATE_VENDOR } from "../../graphql/vendors.queries"; +import { + DELETE_VENDOR, + INSERT_NEW_VENDOR, + QUERY_VENDOR_BY_ID, + UPDATE_VENDOR, +} from "../../graphql/vendors.queries"; import { selectBodyshop } from "../../redux/user/user.selectors"; import AlertComponent from "../alert/alert.component"; import LoadingSpinner from "../loading-spinner/loading-spinner.component"; @@ -19,7 +24,7 @@ const mapStateToProps = createStructuredSelector({ function VendorsFormContainer({ refetch, bodyshop }) { const search = queryString.parse(useLocation().search); const { selectedvendor } = search; - + const [formLoading, setFormLoading] = useState(false); const [form] = Form.useForm(); const { t } = useTranslation(); const { loading, error, data } = useQuery(QUERY_VENDOR_BY_ID, { @@ -32,6 +37,7 @@ function VendorsFormContainer({ refetch, bodyshop }) { const [insertvendor] = useMutation(INSERT_NEW_VENDOR); const [deleteVendor] = useMutation(DELETE_VENDOR); const handleDelete = () => { + setFormLoading(true); deleteVendor({ variables: { id: selectedvendor } }) .then((r) => { notification["success"]({ @@ -45,9 +51,11 @@ function VendorsFormContainer({ refetch, bodyshop }) { message: t("vendors.errors.deleting"), }); }); + setFormLoading(false); }; const handleFinish = (values) => { + setFormLoading(true); if (selectedvendor && selectedvendor !== "new") { //It's a vendor to update. updateVendor({ @@ -85,6 +93,7 @@ function VendorsFormContainer({ refetch, bodyshop }) { }); }); } + setFormLoading(false); }; useEffect(() => { @@ -92,16 +101,19 @@ function VendorsFormContainer({ refetch, bodyshop }) { }, [data, form, selectedvendor]); if (loading) return ; - if (error) return ; + if (error) return ; return (
+ layout="vertical" + autoComplete="new-password" + initialValues={data ? data.vendors_by_pk : null} + > {selectedvendor ? ( diff --git a/client/src/graphql/vendors.queries.js b/client/src/graphql/vendors.queries.js index 163c96a48..dff1ad6eb 100644 --- a/client/src/graphql/vendors.queries.js +++ b/client/src/graphql/vendors.queries.js @@ -14,7 +14,6 @@ export const QUERY_VENDOR_BY_ID = gql` favorite email due_date - display_name discount country cost_center diff --git a/client/src/pages/manage/manage.page.component.jsx b/client/src/pages/manage/manage.page.component.jsx index bd236572c..d95a38847 100644 --- a/client/src/pages/manage/manage.page.component.jsx +++ b/client/src/pages/manage/manage.page.component.jsx @@ -158,7 +158,7 @@ export function Manage({ match, conflict }) { return ( -
+
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 00eaf3274..c0166034e 100644 --- a/client/src/pages/shop-vendor/shop-vendor.page.component.jsx +++ b/client/src/pages/shop-vendor/shop-vendor.page.component.jsx @@ -1,12 +1,28 @@ +import { Col, Row } from "antd"; import React from "react"; -import VendorsListContainer from "../../components/vendors-list/vendors-list.container"; import VendorsFormContainer from "../../components/vendors-form/vendors-form.container"; +import VendorsListContainer from "../../components/vendors-list/vendors-list.container"; + +const listSpan = { + md: { span: 24 }, + lg: { span: 8 }, +}; +const formSapn = { + md: { span: 24 }, + lg: { span: 16 }, +}; export default function ShopVendorPageComponent() { return (
- - + + + + + + + +
); } diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index d1beb1238..7d3b470ed 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1514,6 +1514,7 @@ "shop": "Manage my Shop ({{shopname}})", "shop-csi": "CSI Responses", "shop-templates": "Shop Templates", + "shop-vendors": "Vendors", "timetickets": "Time Tickets", "vehicle-details": "Vehicle: {{vehicle}}", "vehicles": "Vehicles" diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index a0963bf1d..460b57ddc 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1514,6 +1514,7 @@ "shop": "", "shop-csi": "", "shop-templates": "", + "shop-vendors": "", "timetickets": "", "vehicle-details": "", "vehicles": "" diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index effbd37d0..afde919ba 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1514,6 +1514,7 @@ "shop": "", "shop-csi": "", "shop-templates": "", + "shop-vendors": "", "timetickets": "", "vehicle-details": "", "vehicles": "" diff --git a/hasura/migrations/1601941700206_alter_table_public_vendors_drop_column_display_name/down.yaml b/hasura/migrations/1601941700206_alter_table_public_vendors_drop_column_display_name/down.yaml new file mode 100644 index 000000000..291ea9573 --- /dev/null +++ b/hasura/migrations/1601941700206_alter_table_public_vendors_drop_column_display_name/down.yaml @@ -0,0 +1,10 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."vendors" ADD COLUMN "display_name" text; + type: run_sql +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."vendors" ALTER COLUMN "display_name" DROP NOT NULL; + type: run_sql diff --git a/hasura/migrations/1601941700206_alter_table_public_vendors_drop_column_display_name/up.yaml b/hasura/migrations/1601941700206_alter_table_public_vendors_drop_column_display_name/up.yaml new file mode 100644 index 000000000..a5cdda1f4 --- /dev/null +++ b/hasura/migrations/1601941700206_alter_table_public_vendors_drop_column_display_name/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: true + read_only: false + sql: ALTER TABLE "public"."vendors" DROP COLUMN "display_name" CASCADE; + type: run_sql