From 5be2d7bd39ce568921414c397478bfcff4c2ac17 Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Wed, 23 Jun 2021 10:57:57 -0700
Subject: [PATCH] IO-233 WIP CDK.
---
bodyshop_translations.babel | 84 +++++++++++++++++++
.../chat-archive-button.component.jsx | 4 -
client/src/pages/cdk/cdk.container.jsx | 2 +-
client/src/translations/en_us/common.json | 4 +
client/src/translations/es/common.json | 4 +
client/src/translations/fr/common.json | 4 +
client/src/utils/TemplateConstants.js | 50 +++++++++++
server.js | 12 ++-
server/cdk/cdk-job-export.js | 20 ++++-
9 files changed, 177 insertions(+), 7 deletions(-)
diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel
index 1d18bd152..73f7047a6 100644
--- a/bodyshop_translations.babel
+++ b/bodyshop_translations.babel
@@ -32361,6 +32361,90 @@
+
+ production_by_last_name
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
+
+ production_by_repair_status
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
+
+ production_by_ro
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
+
+ production_by_target_date
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
purchases_by_cost_center_detail
false
diff --git a/client/src/components/chat-archive-button/chat-archive-button.component.jsx b/client/src/components/chat-archive-button/chat-archive-button.component.jsx
index dcda38860..fdcff6b90 100644
--- a/client/src/components/chat-archive-button/chat-archive-button.component.jsx
+++ b/client/src/components/chat-archive-button/chat-archive-button.component.jsx
@@ -5,10 +5,6 @@ import { useTranslation } from "react-i18next";
import { TOGGLE_CONVERSATION_ARCHIVE } from "../../graphql/conversations.queries";
export default function ChatArchiveButton({ conversation }) {
- console.log(
- "🚀 ~ file: chat-archive-button.component.jsx ~ line 6 ~ conversation",
- conversation
- );
const [loading, setLoading] = useState(false);
const { t } = useTranslation();
const [updateConversation] = useMutation(TOGGLE_CONVERSATION_ARCHIVE);
diff --git a/client/src/pages/cdk/cdk.container.jsx b/client/src/pages/cdk/cdk.container.jsx
index 67b240e66..79d5277d0 100644
--- a/client/src/pages/cdk/cdk.container.jsx
+++ b/client/src/pages/cdk/cdk.container.jsx
@@ -96,7 +96,7 @@ export function CdkContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) {
{logs.map((log, idx) => (
-
+
{log.level}
{moment(log.timestamp).format("MM/DD/YYYY HH:MM:ss")}
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index 87b2c0a25..d0cd83a08 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -1933,6 +1933,10 @@
"parts_backorder": "Backordered Parts",
"payments_by_date": "Payments by Date",
"payments_by_date_type": "Payments by Date and Type",
+ "production_by_last_name": "Production by Last Name",
+ "production_by_repair_status": "Production by Status",
+ "production_by_ro": "Production by RO",
+ "production_by_target_date": "Production by Target Date",
"purchases_by_cost_center_detail": "Purchases by Cost Center (Detail)",
"purchases_by_cost_center_summary": "Purchases by Cost Center (Summary)",
"purchases_by_date_range_detail": "Purchases by Date - Detail",
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index 90d2d814e..223b5772f 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -1933,6 +1933,10 @@
"parts_backorder": "",
"payments_by_date": "",
"payments_by_date_type": "",
+ "production_by_last_name": "",
+ "production_by_repair_status": "",
+ "production_by_ro": "",
+ "production_by_target_date": "",
"purchases_by_cost_center_detail": "",
"purchases_by_cost_center_summary": "",
"purchases_by_date_range_detail": "",
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index 1a39dcd12..08efbf140 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -1933,6 +1933,10 @@
"parts_backorder": "",
"payments_by_date": "",
"payments_by_date_type": "",
+ "production_by_last_name": "",
+ "production_by_repair_status": "",
+ "production_by_ro": "",
+ "production_by_target_date": "",
"purchases_by_cost_center_detail": "",
"purchases_by_cost_center_summary": "",
"purchases_by_date_range_detail": "",
diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js
index 567c484e7..c14a8fbba 100644
--- a/client/src/utils/TemplateConstants.js
+++ b/client/src/utils/TemplateConstants.js
@@ -1061,6 +1061,56 @@ export const TemplateList = (type, context) => {
field: i18n.t("jobs.fields.date_open"),
},
},
+ production_by_last_name: {
+ title: i18n.t("reportcenter.templates.production_by_last_name"),
+ description: "",
+ subject: i18n.t("reportcenter.templates.production_by_last_name"),
+ key: "production_by_last_name",
+ //idtype: "vendor",
+ disabled: false,
+ rangeFilter: {
+ object: i18n.t("reportcenter.labels.objects.jobs"),
+ field: i18n.t("jobs.fields.date_open"),
+ },
+ },
+ production_by_repair_status: {
+ title: i18n.t("reportcenter.templates.production_by_repair_status"),
+ description: "",
+ subject: i18n.t(
+ "reportcenter.templates.production_by_repair_status"
+ ),
+ key: "production_by_repair_status",
+ //idtype: "vendor",
+ disabled: false,
+ rangeFilter: {
+ object: i18n.t("reportcenter.labels.objects.jobs"),
+ field: i18n.t("jobs.fields.date_open"),
+ },
+ },
+ production_by_target_date: {
+ title: i18n.t("reportcenter.templates.production_by_target_date"),
+ description: "",
+ subject: i18n.t("reportcenter.templates.production_by_target_date"),
+ key: "production_by_target_date",
+ //idtype: "vendor",
+ disabled: false,
+ rangeFilter: {
+ object: i18n.t("reportcenter.labels.objects.jobs"),
+ field: i18n.t("jobs.fields.date_open"),
+ },
+ },
+ production_by_ro: {
+ title: i18n.t("reportcenter.templates.production_by_ro"),
+ description: "",
+ subject: i18n.t("reportcenter.templates.production_by_ro"),
+ key: "production_by_ro",
+ //idtype: "vendor",
+ disabled: false,
+ rangeFilter: {
+ object: i18n.t("reportcenter.labels.objects.jobs"),
+ field: i18n.t("jobs.fields.date_open"),
+ },
+ },
}
: {}),
...(!type || type === "courtesycarcontract"
diff --git a/server.js b/server.js
index a26bc207a..b17fc8b61 100644
--- a/server.js
+++ b/server.js
@@ -151,7 +151,17 @@ app.get("/", async function (req, res) {
const http = require("http");
const server = http.createServer(app);
const { Server } = require("socket.io");
-const io = new Server(server, { path: "/ws" });
+const io = new Server(server, {
+ path: "/ws",
+ cors: {
+ origin: [
+ "https://test.imex.online",
+ "http://localhost:3000",
+ "https://imex.online",
+ ],
+ methods: ["GET", "POST"],
+ },
+});
server.listen(port, (error) => {
if (error) throw error;
diff --git a/server/cdk/cdk-job-export.js b/server/cdk/cdk-job-export.js
index ecaf4d288..cb20ea6dd 100644
--- a/server/cdk/cdk-job-export.js
+++ b/server/cdk/cdk-job-export.js
@@ -7,16 +7,30 @@ require("dotenv").config({
});
const GraphQLClient = require("graphql-request").GraphQLClient;
const queries = require("../graphql-client/queries");
-
const CdkBase = require("./cdk");
+const IMEX_CDK_USER = process.env.IMEX_CDK_USER,
+ IMEX_CDK_PASSWORD = process.env.IMEX_CDK_PASSWORD;
+
exports.default = async function (socket, jobid) {
CdkBase.createLogEvent(
socket,
"DEBUG",
`Received Job export request for id ${jobid}`
);
+
const JobData = await QueryJobData(socket, jobid);
+
+ const DealerId = JobData.bodyshop.dealerid;
+
+ CdkBase.createLogEvent(
+ socket,
+ "TRACE",
+ `Dealer ID detected: ${JSON.stringify(DealerId)}`
+ );
+
+ await DetermineDMSVid(socket, JobData);
+ // Begin Calculate VID from DMS {1}
};
async function QueryJobData(socket, jobid) {
@@ -32,3 +46,7 @@ async function QueryJobData(socket, jobid) {
);
return result;
}
+
+async function DetermineDMSVid(socket, JobData) {
+ CdkBase.createLogEvent(socket, "TRACE", "{1} Begin Determine DMS VehicleID");
+}