From cc7cea71398381cf49162b00dd29d5f04c635c5e Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 6 Dec 2024 15:13:56 -0800 Subject: [PATCH] IO-3020 IO-3036 Additional cleanup. --- client/src/App/App.styles.scss | 6 - .../jobs-available-table.container.jsx | 33 ------ ...p-info.responsibilitycenters.component.jsx | 1 - server.js | 6 +- server/firebase/firebase-handler.js | 104 ------------------ 5 files changed, 5 insertions(+), 145 deletions(-) diff --git a/client/src/App/App.styles.scss b/client/src/App/App.styles.scss index 8d44de002..827d0dfc7 100644 --- a/client/src/App/App.styles.scss +++ b/client/src/App/App.styles.scss @@ -173,9 +173,3 @@ .muted-button:hover { color: darkgrey; } - -.blur-feature { - filter: blur(5px); - user-select: none; - pointer-events: none; -} diff --git a/client/src/components/jobs-available-table/jobs-available-table.container.jsx b/client/src/components/jobs-available-table/jobs-available-table.container.jsx index a847e33db..2cadc3c8c 100644 --- a/client/src/components/jobs-available-table/jobs-available-table.container.jsx +++ b/client/src/components/jobs-available-table/jobs-available-table.container.jsx @@ -586,42 +586,9 @@ function ResolveCCCLineIssues(estData, bodyshop) { }); }); - //Group by line no - // For everything but the first one, strip out the price number in - //TODO: How do we merge these 2 functions together and have it function properly for Rome? - // InstanceRenderManager({ - // executeFunction: true, - // args: [], - // promanager: () => { - // const groupedByLineRef = _.groupBy(estData.joblines.data, "line_ref"); - // Object.keys(groupedByLineRef).forEach((lineRef) => { - // let index0ActPrice; - // groupedByLineRef[lineRef].forEach((line, index) => { - // //Let the first one keep it - // if (index === 0) { - // index0ActPrice = line.act_price; - // return; - // } - // //Web Est seems to have additional costs with UNQ_SEQ 0. Keep them all? - // if (line.unq_seq === 0) return; - // if (index0ActPrice !== line.act_price) { - // // line.notes += ` | Price override.`; - // return; - // } - // const indexInEstData = estData.joblines.data.findIndex((l) => l.unq_seq === line.unq_seq); - // //estData.joblines.data[indexInEstData].notes += - // // ` | Act Price delete. (prev act price = ${estData.joblines.data[indexInEstData].act_price})`; - // estData.joblines.data[indexInEstData].act_price = 0; - // estData.joblines.data[indexInEstData].db_price = 0; - // }); - // }); - // } - // }); - InstanceRenderManager({ executeFunction: true, args: [], - promanager: null, //Require to prevent auto firing of Rome. rome: () => { //Generate the list of duplicated UNQ_SEQ that will feed into the next section to scrub the lines. const unqSeqHash = _.groupBy(estData.joblines.data, "unq_seq"); diff --git a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx index 1bcc05159..f0c3b0f35 100644 --- a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx +++ b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx @@ -4335,7 +4335,6 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) { {InstanceRenderManager({ - promanager: "USE_ROME", rome: ( Adjustments} id="refund"> {bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber ? ( diff --git a/server.js b/server.js index d37ef2b0e..5327d2998 100644 --- a/server.js +++ b/server.js @@ -58,7 +58,11 @@ const SOCKETIO_CORS_ORIGIN = [ "https://beta.test.imex.online", "https://www.beta.test.imex.online", "https://beta.imex.online", - "https://www.beta.imex.online", + "https://www.beta.imex.online", + "https://www.test.promanager.web-est.com", + "https://test.promanager.web-est.com", + "https://www.promanager.web-est.com", + "https://promanager.web-est.com", "https://old.imex.online", "https://www.old.imex.online", "https://wsadmin.imex.online", diff --git a/server/firebase/firebase-handler.js b/server/firebase/firebase-handler.js index 41b5b6c2b..c60a04fab 100644 --- a/server/firebase/firebase-handler.js +++ b/server/firebase/firebase-handler.js @@ -57,109 +57,6 @@ const createUser = async (req, res) => { } }; -// const sendPromanagerWelcomeEmail = (req, res) => { -// const { authid, email } = req.body; - -// // Fetch user from Firebase -// admin -// .auth() -// .getUser(authid) -// .then((userRecord) => { -// if (!userRecord) { -// return Promise.reject({ status: 404, message: "User not found in Firebase." }); -// } - -// // Fetch user data from the database using GraphQL -// return client.request( -// ` -// query GET_USER_BY_EMAIL($email: String!) { -// users(where: { email: { _eq: $email } }) { -// email -// validemail -// associations { -// id -// shopid -// bodyshop { -// id -// convenient_company -// } -// } -// } -// }`, -// { email: email.toLowerCase() } -// ); -// }) -// .then((dbUserResult) => { -// const dbUser = dbUserResult?.users?.[0]; -// if (!dbUser) { -// return Promise.reject({ status: 404, message: "User not found in database." }); -// } - -// // Validate email before proceeding -// if (!dbUser.validemail) { -// logger.log("admin-send-welcome-email-skip", "debug", req.user.email, null, { -// message: "User email is not valid, skipping email.", -// email -// }); -// return res.status(200).json({ message: "User email is not valid, email not sent." }); -// } - -// // Check if the user's company is ProManager -// const convenientCompany = dbUser.associations?.[0]?.bodyshop?.convenient_company; -// if (convenientCompany !== "promanager") { -// logger.log("admin-send-welcome-email-skip", "debug", req.user.email, null, { -// message: 'convenient_company is not "promanager", skipping email.', -// convenientCompany -// }); -// return res.status(200).json({ message: `convenient_company is not "promanager", email not sent.` }); -// } - -// // Generate password reset link -// return admin -// .auth() -// .generatePasswordResetLink(dbUser.email) -// .then((resetLink) => ({ dbUser, resetLink })); -// }) -// .then(({ dbUser, resetLink }) => { -// // Send welcome email (replace with your actual email-sending service) -// return sendProManagerWelcomeEmail({ -// to: dbUser.email, -// subject: "Welcome to the ProManager platform.", -// html: generateEmailTemplate({ -// header: "", -// subHeader: "", -// body: ` -//

Welcome to the ProManager platform. Please click the link below to reset your password:

-//

Reset your password

-//

User Details:

-// -// ` -// }) -// }); -// }) -// .then(() => { -// // Log success and return response -// logger.log("admin-send-welcome-email", "debug", req.user.email, null, { -// request: req.body, -// ioadmin: true, -// emailSentTo: email -// }); -// res.status(200).json({ message: "Welcome email sent successfully." }); -// }) -// .catch((error) => { -// logger.log("admin-send-welcome-email-error", "ERROR", req.user.email, null, { error }); - -// if (!res.headersSent) { -// res.status(error.status || 500).json({ -// message: error.message || "Error sending welcome email.", -// error -// }); -// } -// }); -// }; - const updateUser = (req, res) => { logger.log("admin-update-user", "debug", req.user.email, null, { request: req.body, @@ -309,7 +206,6 @@ module.exports = { createUser, updateUser, getUser, - //sendPromanagerWelcomeEmail, sendNotification, subscribe, unsubscribe