IO-3020 IO-3036 Additional cleanup.
This commit is contained in:
@@ -173,9 +173,3 @@
|
||||
.muted-button:hover {
|
||||
color: darkgrey;
|
||||
}
|
||||
|
||||
.blur-feature {
|
||||
filter: blur(5px);
|
||||
user-select: none;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -4335,7 +4335,6 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
||||
</LayoutFormRow>
|
||||
|
||||
{InstanceRenderManager({
|
||||
promanager: "USE_ROME",
|
||||
rome: (
|
||||
<LayoutFormRow header={<div>Adjustments</div>} id="refund">
|
||||
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber ? (
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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: `
|
||||
// <p>Welcome to the ProManager platform. Please click the link below to reset your password:</p>
|
||||
// <p><a href="${resetLink}">Reset your password</a></p>
|
||||
// <p>User Details:</p>
|
||||
// <ul>
|
||||
// <li>Email: ${dbUser.email}</li>
|
||||
// </ul>
|
||||
// `
|
||||
// })
|
||||
// });
|
||||
// })
|
||||
// .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
|
||||
|
||||
Reference in New Issue
Block a user