Merged in test (pull request #63)

Push Minor Bug Fixes to Production
This commit is contained in:
Patrick Fic
2021-05-20 14:55:37 +00:00
35 changed files with 4951 additions and 54 deletions

View File

@@ -8,7 +8,7 @@ const authProvider = {
username,
password
);
const token = await user.getIdToken(true);
const token = await user.getIdToken();
localStorage.setItem("token", token);
return Promise.resolve();
} catch (error) {

View File

@@ -1,4 +1,4 @@
<babeledit_project be_version="2.7.1" version="1.2">
<babeledit_project version="1.2" be_version="2.7.1">
<!--
BabelEdit project file
@@ -6535,6 +6535,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>website</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>zip_post</name>
<definition_loaded>false</definition_loaded>

View File

@@ -75,8 +75,8 @@
"start": "craco start",
"build": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` craco build",
"build:test": "env-cmd -f .env.test npm run build",
"build-deploy:test": "npm run build:test && s3cmd sync build/* s3://imex-online-test && echo '🚀 TESTING Deployed!'",
"buildcra": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` react-scripts build",
"build-deploy": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` craco build && s3cmd sync build/* s3://imex-online-production && echo '🚀 Deployed!'",
"test": "craco test",
"eject": "react-scripts eject",
"madge": "madge --image ./madge-graph.svg --extensions js,jsx,ts,tsx --circular ."

View File

@@ -1,5 +1,5 @@
import { useApolloClient, useMutation } from "@apollo/client";
import { Button, Form, Modal, notification } from "antd";
import { Button, Form, Modal, notification, Space } from "antd";
import _ from "lodash";
import React, { useEffect, useState, useMemo } from "react";
import { useTranslation } from "react-i18next";
@@ -227,7 +227,7 @@ function BillEnterModalContainer({
onCancel={handleCancel}
afterClose={() => form.resetFields()}
footer={
<span>
<Space>
<Button onClick={handleCancel}>{t("general.actions.cancel")}</Button>
<Button loading={loading} onClick={() => form.submit()}>
{t("general.actions.save")}
@@ -243,7 +243,7 @@ function BillEnterModalContainer({
{t("general.actions.saveandnew")}
</Button>
)}
</span>
</Space>
}
destroyOnClose
>
@@ -255,7 +255,6 @@ function BillEnterModalContainer({
onFinishFailed={() => {
setEnterAgain(false);
}}
// initialValues={formValues}
>
<BillFormContainer
form={form}

View File

@@ -1,6 +1,6 @@
import { UploadOutlined } from "@ant-design/icons";
import { useApolloClient } from "@apollo/client";
import {
Button,
Divider,
Form,
Input,
@@ -316,9 +316,21 @@ export function BillFormComponent({
return e && e.fileList;
}}
>
<Upload name="logo" beforeUpload={() => false} listType="picture">
<Button>Click to upload</Button>
</Upload>
<Upload.Dragger
multiple={true}
name="logo"
beforeUpload={() => false}
listType="picture"
>
<>
<p className="ant-upload-drag-icon">
<UploadOutlined />
</p>
<p className="ant-upload-text">
Click or drag files to this area to upload.
</p>
</>
</Upload.Dragger>
</Form.Item>
</div>
);

View File

@@ -47,6 +47,7 @@ export function BillEnterModalLinesComponent({
return {
key: `${field.index}joblinename`,
name: [field.name, "joblineid"],
label: t("billlines.fields.jobline"),
rules: [
{
required: true,
@@ -94,6 +95,7 @@ export function BillEnterModalLinesComponent({
return {
key: `${field.index}line_desc`,
name: [field.name, "line_desc"],
label: t("billlines.fields.line_desc"),
rules: [
{
required: true,
@@ -113,6 +115,7 @@ export function BillEnterModalLinesComponent({
return {
key: `${field.index}quantity`,
name: [field.name, "quantity"],
label: t("billlines.fields.quantity"),
rules: [
{
required: true,
@@ -134,6 +137,7 @@ export function BillEnterModalLinesComponent({
return {
key: `${field.index}actual_price`,
name: [field.name, "actual_price"],
label: t("billlines.fields.actual_price"),
rules: [
{
required: true,
@@ -186,10 +190,12 @@ export function BillEnterModalLinesComponent({
dataIndex: "actual_cost",
editable: true,
width: "8rem",
formItemProps: (field) => {
return {
key: `${field.index}actual_cost`,
name: [field.name, "actual_cost"],
label: t("billlines.fields.actual_cost"),
rules: [
{
required: true,
@@ -221,10 +227,12 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.cost_center"),
dataIndex: "cost_center",
editable: true,
formItemProps: (field) => {
return {
key: `${field.index}cost_center`,
name: [field.name, "cost_center"],
label: t("billlines.fields.cost_center"),
rules: [
{
required: true,
@@ -246,6 +254,7 @@ export function BillEnterModalLinesComponent({
title: t("billlines.fields.location"),
dataIndex: "location",
editable: true,
label: t("billlines.fields.location"),
formItemProps: (field) => {
return {
key: `${field.index}location`,
@@ -488,6 +497,7 @@ const EditableCell = ({
<Space size="small">
<Form.Item
name={dataIndex}
labelCol={{ span: 0 }}
{...(formItemProps && formItemProps(record))}
>
{(formInput && formInput(record, record.key)) || children}
@@ -499,7 +509,11 @@ const EditableCell = ({
return (
<td {...restProps}>
<Form.Item name={dataIndex} {...(formItemProps && formItemProps(record))}>
<Form.Item
labelCol={{ span: 0 }}
name={dataIndex}
{...(formItemProps && formItemProps(record))}
>
{(formInput && formInput(record, record.key)) || children}
</Form.Item>
</td>

View File

@@ -20,7 +20,7 @@ const mapDispatchToProps = (dispatch) => ({
toggleModalVisible: () => dispatch(toggleModalVisible("courtesyCarReturn")),
});
export function BillEnterModalContainer({
export function CCReturnModalContainer({
courtesyCarReturnModal,
toggleModalVisible,
bodyshop,
@@ -85,4 +85,4 @@ export function BillEnterModalContainer({
export default connect(
mapStateToProps,
mapDispatchToProps
)(BillEnterModalContainer);
)(CCReturnModalContainer);

View File

@@ -105,7 +105,7 @@ export function JobLinesComponent({
state.sortedInfo.columnKey === "op_code_desc" && state.sortedInfo.order,
ellipsis: true,
render: (text, record) =>
`${record.op_code_desc||""}${
`${record.op_code_desc || ""}${
record.alt_partm ? ` ${record.alt_partm}` : ""
}`,
},
@@ -120,11 +120,11 @@ export function JobLinesComponent({
filters: [
{
text: t("jobs.labels.partsfilter"),
value: ["PAN", "PAL", "PAA", "PAS", "PASL"],
value: ["PAN", "PAP", "PAL", "PAA", "PAS", "PASL"],
},
{
text: t("joblines.fields.part_types.PAN"),
value: ["PAN"],
value: ["PAN", "PAP"],
},
{
text: t("joblines.fields.part_types.PAL"),

View File

@@ -3,12 +3,12 @@ import { notification } from "antd";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import { UPDATE_JOB_ASSIGNMENTS } from "../../graphql/jobs.queries";
import JobEmployeeAssignmentsComponent from "./job-employee-assignments.component";
export default function JobEmployeeAssignmentsContainer({ job, refetch }) {
const { t } = useTranslation();
const [updateJob] = useMutation(UPDATE_JOB);
const [updateJob] = useMutation(UPDATE_JOB_ASSIGNMENTS);
const [loading, setLoading] = useState(false);
const handleAdd = async (assignment) => {
@@ -20,8 +20,6 @@ export default function JobEmployeeAssignmentsContainer({ job, refetch }) {
const result = await updateJob({
variables: { jobId: job.id, job: { [empAssignment]: employeeid } },
refetchQueries: ["GET_JOB_BY_PK"],
awaitRefetchQueries: true,
});
if (refetch) refetch();
@@ -41,8 +39,6 @@ export default function JobEmployeeAssignmentsContainer({ job, refetch }) {
let empAssignment = determineFieldName(operation);
const result = await updateJob({
variables: { jobId: job.id, job: { [empAssignment]: null } },
refetchQueries: ["GET_JOB_BY_PK"],
awaitRefetchQueries: true,
});
if (!!result.errors) {

View File

@@ -36,10 +36,8 @@ const JobSearchSelect = (
}
);
const [
callIdSearch,
{ loading: idLoading, error: idError, data: idData },
] = useLazyQuery(SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE);
const [callIdSearch, { loading: idLoading, error: idError, data: idData }] =
useLazyQuery(SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE);
const executeSearch = (v) => {
callSearch(v);
@@ -81,7 +79,7 @@ const JobSearchSelect = (
>
{theOptions
? theOptions.map((o) => (
<Option key={o.id} value={o.id}>
<Option key={o.id} value={o.id} status={o.status}>
{`${clm_no ? `${o.clm_no} | ` : ""}${
o.ro_number || t("general.labels.na")
} | ${o.ownr_ln || ""} ${o.ownr_fn || ""} ${

View File

@@ -57,7 +57,7 @@ export function JobAdminMarkReexport({ bodyshop, job }) {
return (
<Button
loading={loading}
disabled={(!job.voided && !job.date_exported) || !job.converted}
disabled={!job.date_exported}
onClick={handleUpdate}
>
{t("jobs.labels.markforreexport")}

View File

@@ -40,7 +40,7 @@ export function JobsCloseExportButton({
{ jobIds: [jobId] },
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);
@@ -64,7 +64,7 @@ export function JobsCloseExportButton({
QbXmlResponse.data,
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);
@@ -86,7 +86,7 @@ export function JobsCloseExportButton({
failedTransactions.forEach((ft) => {
//insert failed export log
notification.open({
// key: "failedexports",
// key: "failedexports",
type: "error",
message: t("jobs.errors.exporting", {
error: ft.errorMessage || "",

View File

@@ -102,9 +102,10 @@ export function JobsCloseLines({ bodyshop, job, jobRO }) {
</td>
<td>
<Form.Item
//label={t("joblines.fields.profitcenter_part")}
label={t("joblines.fields.profitcenter_part")}
key={`${index}profitcenter_part`}
name={[field.name, "profitcenter_part"]}
labelCol={{ span: 0 }}
rules={[
{
required: !!job.joblines[index].act_price,
@@ -135,7 +136,8 @@ export function JobsCloseLines({ bodyshop, job, jobRO }) {
</td>
<td>
<Form.Item
//label={t("joblines.fields.profitcenter_labor")}
label={t("joblines.fields.profitcenter_labor")}
labelCol={{ span: 0 }}
key={`${index}profitcenter_labor`}
name={[field.name, "profitcenter_labor"]}
rules={[

View File

@@ -43,7 +43,7 @@ export function JobsExportAllButton({
{ jobIds: jobIds },
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);
@@ -66,7 +66,7 @@ export function JobsExportAllButton({
QbXmlResponse.data,
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);

View File

@@ -46,7 +46,7 @@ export function PayableExportAll({
{ bills: billids },
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);

View File

@@ -44,7 +44,7 @@ export function PayableExportButton({
{ bills: [billId] },
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);

View File

@@ -43,7 +43,7 @@ export function PaymentExportButton({
{ payments: [paymentId] },
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);

View File

@@ -33,7 +33,7 @@ const mapDispatchToProps = (dispatch) => ({
toggleModalVisible: () => dispatch(toggleModalVisible("payment")),
});
function BillEnterModalContainer({
function PaymentModalContainer({
paymentModal,
toggleModalVisible,
bodyshop,
@@ -237,7 +237,7 @@ function BillEnterModalContainer({
export default connect(
mapStateToProps,
mapDispatchToProps
)(BillEnterModalContainer);
)(PaymentModalContainer);
// const pr = stripe.paymentRequest({
// country: "CA",

View File

@@ -42,7 +42,7 @@ export function PaymentsExportAllButton({
{ payments: paymentIds },
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken(true)}`,
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);

View File

@@ -92,7 +92,9 @@ export default function ShopInfoGeneral({ form }) {
>
<PhoneFormItem />
</Form.Item>
<Form.Item label={t("bodyshop.fields.website")} name="website">
<Input />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.insurance_vendor_id")}
name="insurance_vendor_id"

View File

@@ -32,14 +32,7 @@ export default function VendorsListComponent({
sortOrder:
state.sortedInfo.columnKey === "name" && state.sortedInfo.order,
},
{
title: t("vendors.fields.cost_center"),
dataIndex: "cost_center",
key: "cost_center",
sorter: (a, b) => alphaSort(a.cost_center, b.cost_center),
sortOrder:
state.sortedInfo.columnKey === "cost_center" && state.sortedInfo.order,
},
{
title: t("vendors.fields.phone"),
dataIndex: "phone",

View File

@@ -86,6 +86,7 @@ export const QUERY_BODYSHOP = gql`
jobsizelimit
md_ccc_rates
enforce_referral
website
employees {
id
active
@@ -169,6 +170,7 @@ export const UPDATE_SHOP = gql`
jobsizelimit
md_ccc_rates
enforce_referral
website
employees {
id
first_name

View File

@@ -864,6 +864,36 @@ export const UPDATE_JOB = gql`
}
`;
export const UPDATE_JOB_ASSIGNMENTS = gql`
mutation UPDATE_JOB_ASSIGNMENTS($jobId: uuid!, $job: jobs_set_input!) {
update_jobs(where: { id: { _eq: $jobId } }, _set: $job) {
returning {
id
employee_body_rel {
id
first_name
last_name
}
employee_refinish_rel {
id
first_name
last_name
}
employee_prep_rel {
id
first_name
last_name
}
employee_csr_rel {
id
first_name
last_name
}
}
}
}
`;
export const VOID_JOB = gql`
mutation VOID_JOB(
$jobId: uuid!
@@ -1009,6 +1039,7 @@ export const SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE = gql`
v_make_desc
v_model_desc
v_model_yr
status
}
}
`;

View File

@@ -53,7 +53,7 @@ export function JobsCloseContainer({ setBreadcrumbs, setSelectedHeader }) {
setBreadcrumbs([
{
link: `/manage/jobs/${jobId}/`,
link: `/manage/jobs/`,
label: t("titles.bc.jobs"),
},
{

View File

@@ -416,6 +416,7 @@
},
"target_touchtime": "Target Touch Time",
"use_fippa": "Use FIPPA for Names on Generated Documents?",
"website": "Website",
"zip_post": "Zip/Postal Code"
},
"labels": {

View File

@@ -416,6 +416,7 @@
},
"target_touchtime": "",
"use_fippa": "",
"website": "",
"zip_post": ""
},
"labels": {

View File

@@ -416,6 +416,7 @@
},
"target_touchtime": "",
"use_fippa": "",
"website": "",
"zip_post": ""
},
"labels": {

View File

@@ -9,8 +9,7 @@ if (process.env.NODE_ENV === "production") {
export const axiosAuthInterceptorId = axios.interceptors.request.use(
async (config) => {
if (!config.headers.Authorization) {
const token =
auth.currentUser && (await auth.currentUser.getIdToken(true));
const token = auth.currentUser && (await auth.currentUser.getIdToken());
if (token) {
config.headers.Authorization = `Bearer ${token}`;
}

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."bodyshops" DROP COLUMN "website";
type: run_sql

View File

@@ -0,0 +1,5 @@
- args:
cascade: false
read_only: false
sql: ALTER TABLE "public"."bodyshops" ADD COLUMN "website" text NULL;
type: run_sql

View File

@@ -0,0 +1,82 @@
- args:
role: user
table:
name: bodyshops
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- accountingconfig
- address1
- address2
- appt_alt_transport
- appt_colors
- appt_length
- bill_tax_rates
- city
- country
- created_at
- default_adjustment_rate
- deliverchecklist
- email
- enforce_class
- enforce_referral
- federal_tax_id
- id
- imexshopid
- inhousevendorid
- insurance_vendor_id
- intakechecklist
- jobsizelimit
- logo_img_path
- md_categories
- md_ccc_rates
- md_classes
- md_hour_split
- md_ins_cos
- md_labor_rates
- md_messaging_presets
- md_notes_presets
- md_order_statuses
- md_parts_locations
- md_payment_types
- md_rbac
- md_referral_sources
- md_responsibility_centers
- md_ro_statuses
- messagingservicesid
- phone
- prodtargethrs
- production_config
- region_config
- schedule_end_time
- schedule_start_time
- scoreboard_target
- shopname
- shoprates
- speedprint
- ssbuckets
- state
- state_tax_id
- stripe_acct_id
- sub_status
- target_touchtime
- template_header
- textid
- updated_at
- use_fippa
- workingdays
- zip_post
computed_fields: []
filter:
associations:
user:
authid:
_eq: X-Hasura-User-Id
role: user
table:
name: bodyshops
schema: public
type: create_select_permission

View File

@@ -0,0 +1,83 @@
- args:
role: user
table:
name: bodyshops
schema: public
type: drop_select_permission
- args:
permission:
allow_aggregations: false
columns:
- accountingconfig
- address1
- address2
- appt_alt_transport
- appt_colors
- appt_length
- bill_tax_rates
- city
- country
- created_at
- default_adjustment_rate
- deliverchecklist
- email
- enforce_class
- enforce_referral
- federal_tax_id
- id
- imexshopid
- inhousevendorid
- insurance_vendor_id
- intakechecklist
- jobsizelimit
- logo_img_path
- md_categories
- md_ccc_rates
- md_classes
- md_hour_split
- md_ins_cos
- md_labor_rates
- md_messaging_presets
- md_notes_presets
- md_order_statuses
- md_parts_locations
- md_payment_types
- md_rbac
- md_referral_sources
- md_responsibility_centers
- md_ro_statuses
- messagingservicesid
- phone
- prodtargethrs
- production_config
- region_config
- schedule_end_time
- schedule_start_time
- scoreboard_target
- shopname
- shoprates
- speedprint
- ssbuckets
- state
- state_tax_id
- stripe_acct_id
- sub_status
- target_touchtime
- template_header
- textid
- updated_at
- use_fippa
- website
- workingdays
- zip_post
computed_fields: []
filter:
associations:
user:
authid:
_eq: X-Hasura-User-Id
role: user
table:
name: bodyshops
schema: public
type: create_select_permission

View File

@@ -0,0 +1,76 @@
- args:
role: user
table:
name: bodyshops
schema: public
type: drop_update_permission
- args:
permission:
columns:
- accountingconfig
- address1
- address2
- appt_alt_transport
- appt_colors
- appt_length
- bill_tax_rates
- city
- country
- created_at
- default_adjustment_rate
- deliverchecklist
- email
- enforce_class
- enforce_referral
- federal_tax_id
- id
- inhousevendorid
- insurance_vendor_id
- intakechecklist
- logo_img_path
- md_categories
- md_ccc_rates
- md_classes
- md_hour_split
- md_ins_cos
- md_labor_rates
- md_messaging_presets
- md_notes_presets
- md_order_statuses
- md_parts_locations
- md_payment_types
- md_rbac
- md_referral_sources
- md_responsibility_centers
- md_ro_statuses
- phone
- prodtargethrs
- production_config
- schedule_end_time
- schedule_start_time
- scoreboard_target
- shopname
- shoprates
- speedprint
- ssbuckets
- state
- state_tax_id
- target_touchtime
- updated_at
- use_fippa
- workingdays
- zip_post
filter:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
set: {}
role: user
table:
name: bodyshops
schema: public
type: create_update_permission

View File

@@ -0,0 +1,77 @@
- args:
role: user
table:
name: bodyshops
schema: public
type: drop_update_permission
- args:
permission:
columns:
- accountingconfig
- address1
- address2
- appt_alt_transport
- appt_colors
- appt_length
- bill_tax_rates
- city
- country
- created_at
- default_adjustment_rate
- deliverchecklist
- email
- enforce_class
- enforce_referral
- federal_tax_id
- id
- inhousevendorid
- insurance_vendor_id
- intakechecklist
- logo_img_path
- md_categories
- md_ccc_rates
- md_classes
- md_hour_split
- md_ins_cos
- md_labor_rates
- md_messaging_presets
- md_notes_presets
- md_order_statuses
- md_parts_locations
- md_payment_types
- md_rbac
- md_referral_sources
- md_responsibility_centers
- md_ro_statuses
- phone
- prodtargethrs
- production_config
- schedule_end_time
- schedule_start_time
- scoreboard_target
- shopname
- shoprates
- speedprint
- ssbuckets
- state
- state_tax_id
- target_touchtime
- updated_at
- use_fippa
- website
- workingdays
- zip_post
filter:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
set: {}
role: user
table:
name: bodyshops
schema: public
type: create_update_permission

File diff suppressed because it is too large Load Diff