From 19207013e2487f09178414f724f167e6e791176f Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Wed, 24 Feb 2021 10:38:55 -0800
Subject: [PATCH] Tech login and checklist fixes.
---
.../job-checklist-form.component.jsx | 2 +-
.../shop-info/shop-info.component.jsx | 24 --------------
.../shop-info/shop-info.intake.component.jsx | 32 ++++++++++++++++---
.../tech-login/tech-login.component.jsx | 25 ++++++++-------
client/src/index.js | 1 +
.../jobs-checklist-view.page.jsx | 10 +++---
client/src/redux/tech/tech.reducer.js | 1 +
client/src/redux/tech/tech.sagas.js | 21 ++++--------
8 files changed, 56 insertions(+), 60 deletions(-)
diff --git a/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx b/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx
index d12760daa..49c2e0f61 100644
--- a/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx
+++ b/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx
@@ -64,7 +64,7 @@ export function JobChecklistForm({
[(type === "intake" && "intakechecklist") ||
(type === "deliver" && "deliverchecklist")]: {
...values,
- formItems: formItems.map((fi) => {
+ form: formItems.map((fi) => {
return {
...fi,
value: values[fi.name],
diff --git a/client/src/components/shop-info/shop-info.component.jsx b/client/src/components/shop-info/shop-info.component.jsx
index 27ba83dc3..4c5218217 100644
--- a/client/src/components/shop-info/shop-info.component.jsx
+++ b/client/src/components/shop-info/shop-info.component.jsx
@@ -611,12 +611,6 @@ export default function ShopInfoComponent({ form, saveLoading }) {
label={t("bodyshop.fields.md_ins_co.street1")}
key={`${index}street1`}
name={[field.name, "street1"]}
- rules={[
- {
- required: true,
- message: t("general.validation.required"),
- },
- ]}
>
@@ -633,12 +627,6 @@ export default function ShopInfoComponent({ form, saveLoading }) {
label={t("bodyshop.fields.md_ins_co.city")}
key={`${index}city`}
name={[field.name, "city"]}
- rules={[
- {
- required: true,
- message: t("general.validation.required"),
- },
- ]}
>
@@ -647,12 +635,6 @@ export default function ShopInfoComponent({ form, saveLoading }) {
label={t("bodyshop.fields.md_ins_co.state")}
key={`${index}state`}
name={[field.name, "state"]}
- rules={[
- {
- required: true,
- message: t("general.validation.required"),
- },
- ]}
>
@@ -661,12 +643,6 @@ export default function ShopInfoComponent({ form, saveLoading }) {
label={t("bodyshop.fields.md_ins_co.zip")}
key={`${index}zip`}
name={[field.name, "zip"]}
- rules={[
- {
- required: true,
- message: t("general.validation.required"),
- },
- ]}
>
diff --git a/client/src/components/shop-info/shop-info.intake.component.jsx b/client/src/components/shop-info/shop-info.intake.component.jsx
index ef38f181c..f43549819 100644
--- a/client/src/components/shop-info/shop-info.intake.component.jsx
+++ b/client/src/components/shop-info/shop-info.intake.component.jsx
@@ -40,7 +40,6 @@ export default function ShopInfoIntakeChecklistComponent({ form }) {
>
-
-
-
-
+
+
+
+
+
+
{
remove(field.name);
diff --git a/client/src/components/tech-login/tech-login.component.jsx b/client/src/components/tech-login/tech-login.component.jsx
index 4d5854b4e..6aed768bb 100644
--- a/client/src/components/tech-login/tech-login.component.jsx
+++ b/client/src/components/tech-login/tech-login.component.jsx
@@ -36,39 +36,42 @@ export function TechLogin({
};
return (
-
+
);
}
diff --git a/client/src/index.js b/client/src/index.js
index 6e7bbbc71..112d08d40 100644
--- a/client/src/index.js
+++ b/client/src/index.js
@@ -11,6 +11,7 @@ import "./index.css";
import { persistor, store } from "./redux/store";
//import * as serviceWorker from "./serviceWorker"; //This is registered in a separate component to track notifications.
import "./translations/i18n";
+import "./utils/CleanAxios";
require("dotenv").config();
diff --git a/client/src/pages/jobs-checklist-view/jobs-checklist-view.page.jsx b/client/src/pages/jobs-checklist-view/jobs-checklist-view.page.jsx
index 8f063577e..01306b1a1 100644
--- a/client/src/pages/jobs-checklist-view/jobs-checklist-view.page.jsx
+++ b/client/src/pages/jobs-checklist-view/jobs-checklist-view.page.jsx
@@ -1,5 +1,6 @@
import { useQuery } from "@apollo/client";
import { Col, Row, Typography } from "antd";
+import moment from "moment";
import React, { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -15,7 +16,6 @@ import {
setSelectedHeader,
} from "../../redux/application/application.actions";
import { selectBodyshop } from "../../redux/user/user.selectors";
-import moment from "moment";
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
bodyshop: selectBodyshop,
@@ -78,12 +78,12 @@ export function JobsChecklistViewContainer({
{t("jobs.labels.intakechecklist")}
{data.jobs_by_pk.intakechecklist &&
- data.jobs_by_pk.intakechecklist.formItems && (
+ data.jobs_by_pk.intakechecklist.form && (
<>
{data.jobs_by_pk.deliverchecklist &&
- data.jobs_by_pk.deliverchecklist.formItems && (
+ data.jobs_by_pk.deliverchecklist.form && (
<>
{
return {
...state,
technician: null,
+ loginError: null,
};
case TechActionTypes.TECH_LOGIN_START:
return {
diff --git a/client/src/redux/tech/tech.sagas.js b/client/src/redux/tech/tech.sagas.js
index 0f4300526..0c748a7f5 100644
--- a/client/src/redux/tech/tech.sagas.js
+++ b/client/src/redux/tech/tech.sagas.js
@@ -1,6 +1,6 @@
import axios from "axios";
import { all, call, put, select, takeLatest } from "redux-saga/effects";
-import { auth, logImEXEvent } from "../../firebase/firebase.utils";
+import { logImEXEvent } from "../../firebase/firebase.utils";
import { selectBodyshop } from "../user/user.selectors";
import { techLoginFailure, techLoginSuccess } from "./tech.actions";
import TechActionTypes from "./tech.types";
@@ -13,20 +13,11 @@ export function* signInStart({ payload: { employeeid, pin } }) {
logImEXEvent("redux_tech_sign_in");
const bodyshop = yield select(selectBodyshop);
- const response = yield call(
- axios.post,
- "/tech/login",
- {
- shopid: bodyshop.id,
- employeeid: employeeid,
- pin: pin,
- },
- {
- headers: {
- Authorization: `Bearer ${yield auth.currentUser.getIdToken()}`,
- },
- }
- );
+ const response = yield call(axios.post, "/tech/login", {
+ shopid: bodyshop.id,
+ employeeid: employeeid,
+ pin: pin,
+ });
const { valid, technician, error } = response.data;