Compare commits
1 Commits
feature/co
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7239698a21 |
@@ -1,9 +1,5 @@
|
||||
root = true
|
||||
|
||||
# NOTE: Keep only EditorConfig properties that Prettier actually respects.
|
||||
# Style choices (quotes, bracket spacing, print width, etc.) live in `.prettierrc.js`.
|
||||
# Removing pseudo/unsupported keys (quote_type, bracketSpacing, max_line_length) that
|
||||
# previously caused editor vs CLI confusion.
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
@@ -11,11 +7,14 @@ indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = false
|
||||
quote_type = single
|
||||
max_line_length = 100
|
||||
bracketSpacing = false
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*\.yml]
|
||||
[*.yml]
|
||||
indent_size = 2
|
||||
|
||||
[*.json]
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
# Folders & files to skip during formatting
|
||||
node_modules
|
||||
build
|
||||
dist
|
||||
dev-dist
|
||||
coverage
|
||||
logs
|
||||
*.log
|
||||
# Generated / compiled assets
|
||||
client/dev-dist
|
||||
client/dist
|
||||
10
.vscode/settings.json
vendored
10
.vscode/settings.json
vendored
@@ -39,13 +39,5 @@
|
||||
"timetickets",
|
||||
"touchtime"
|
||||
],
|
||||
"eslint.workingDirectories": ["./", "./client"],
|
||||
// Formatting alignment: ensure VS Code uses project Prettier config
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true,
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
// Disable eslint's fixAll on save if it causes style churn; turn back on once stylistic rules removed or using eslint-config-prettier
|
||||
"prettier.useEditorConfig": true
|
||||
"eslint.workingDirectories": ["./", "./client"]
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { getAuth, updatePassword, updateProfile } from "@firebase/auth";
|
||||
import { getFirestore } from "@firebase/firestore";
|
||||
import { getMessaging, getToken, onMessage } from "@firebase/messaging";
|
||||
import { store } from "../redux/store";
|
||||
//import * as amplitude from '@amplitude/analytics-browser';
|
||||
import * as amplitude from '@amplitude/analytics-browser';
|
||||
import posthog from 'posthog-js'
|
||||
|
||||
const config = JSON.parse(import.meta.env.VITE_APP_FIREBASE_CONFIG);
|
||||
@@ -91,14 +91,14 @@ export const logImEXEvent = (eventName, additionalParams, stateProp = null) => {
|
||||
// dbevent: false,
|
||||
// env: `master-AIO|${import.meta.env.VITE_APP_GIT_SHA_DATE}`
|
||||
// });
|
||||
// console.log(
|
||||
// "%c[Analytics]",
|
||||
// "background-color: green ;font-weight:bold;",
|
||||
// eventName,
|
||||
// eventParams
|
||||
// );
|
||||
console.log(
|
||||
"%c[Analytics]",
|
||||
"background-color: green ;font-weight:bold;",
|
||||
eventName,
|
||||
eventParams
|
||||
);
|
||||
logEvent(analytics, eventName, eventParams);
|
||||
//amplitude.track(eventName, eventParams);
|
||||
amplitude.track(eventName, eventParams);
|
||||
posthog.capture(eventName, eventParams);
|
||||
|
||||
} finally {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { persistor, store } from "./redux/store";
|
||||
import reportWebVitals from "./reportWebVitals";
|
||||
import "./translations/i18n";
|
||||
import "./utils/CleanAxios";
|
||||
//import * as amplitude from "@amplitude/analytics-browser";
|
||||
import * as amplitude from "@amplitude/analytics-browser";
|
||||
import { PostHogProvider } from "posthog-js/react";
|
||||
import posthog from "posthog-js";
|
||||
|
||||
@@ -26,23 +26,23 @@ registerSW({ immediate: true });
|
||||
// Dinero.globalLocale = "en-CA";
|
||||
Dinero.globalRoundingMode = "HALF_EVEN";
|
||||
|
||||
// amplitude.init(import.meta.env.VITE_APP_AMP_KEY, {
|
||||
// defaultTracking: true,
|
||||
// serverUrl: import.meta.env.VITE_APP_AMP_URL
|
||||
// // {
|
||||
// // attribution: {
|
||||
// // excludeReferrers: true,
|
||||
// // initialEmptyValue: true,
|
||||
// // resetSessionOnNewCampaign: true,
|
||||
// // },
|
||||
// // fileDownloads: true,
|
||||
// // formInteractions: true,
|
||||
// // pageViews: {
|
||||
// // trackHistoryChanges: 'all'
|
||||
// // },
|
||||
// // sessions: true
|
||||
// // }
|
||||
// });
|
||||
amplitude.init(import.meta.env.VITE_APP_AMP_KEY, {
|
||||
defaultTracking: true,
|
||||
serverUrl: import.meta.env.VITE_APP_AMP_URL
|
||||
// {
|
||||
// attribution: {
|
||||
// excludeReferrers: true,
|
||||
// initialEmptyValue: true,
|
||||
// resetSessionOnNewCampaign: true,
|
||||
// },
|
||||
// fileDownloads: true,
|
||||
// formInteractions: true,
|
||||
// pageViews: {
|
||||
// trackHistoryChanges: 'all'
|
||||
// },
|
||||
// sessions: true
|
||||
// }
|
||||
});
|
||||
|
||||
posthog.init(import.meta.env.VITE_PUBLIC_POSTHOG_KEY, {
|
||||
autocapture: false,
|
||||
|
||||
@@ -49,7 +49,7 @@ import {
|
||||
validatePasswordResetSuccess
|
||||
} from "./user.actions";
|
||||
import UserActionTypes from "./user.types";
|
||||
//import * as amplitude from '@amplitude/analytics-browser';
|
||||
import * as amplitude from '@amplitude/analytics-browser';
|
||||
import posthog from 'posthog-js';
|
||||
|
||||
const fpPromise = FingerprintJS.load();
|
||||
@@ -92,7 +92,7 @@ export function* isUserAuthenticated() {
|
||||
}
|
||||
|
||||
LogRocket.identify(user.email);
|
||||
//amplitude.setUserId(user.email);
|
||||
amplitude.setUserId(user.email);
|
||||
posthog.identify(user.email);
|
||||
|
||||
const eulaQuery = yield client.query({
|
||||
@@ -139,7 +139,7 @@ export function* signOutStart() {
|
||||
imexshopid: state.user.bodyshop.imexshopid,
|
||||
type: "messaging"
|
||||
});
|
||||
//amplitude.reset();
|
||||
amplitude.reset();
|
||||
} catch {
|
||||
console.log("No FCM token. Skipping unsubscribe.");
|
||||
}
|
||||
@@ -365,7 +365,7 @@ export function* SetAuthLevelFromShopDetails({ payload }) {
|
||||
}
|
||||
|
||||
try {
|
||||
//amplitude.setGroup('Shop', payload.shopname);
|
||||
amplitude.setGroup('Shop', payload.shopname);
|
||||
window.$crisp.push(["set", "user:company", [payload.shopname]]);
|
||||
if (authRecord[0] && authRecord[0].user.validemail) {
|
||||
window.$crisp.push(["set", "user:email", [authRecord[0].user.email]]);
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
"setup": "rm -rf node_modules && npm i && cd client && rm -rf node_modules && npm i",
|
||||
"setup:win": "rimraf node_modules && npm i && cd client && rimraf node_modules && npm i",
|
||||
"start": "node server.js",
|
||||
"makeitpretty": "npm run format",
|
||||
"format": "prettier --config .prettierrc.js --ignore-path .prettierignore --write .",
|
||||
"makeitpretty": "prettier --write \"**/*.{css,js,json,jsx,scss}\"",
|
||||
"lint": "eslint .",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"test:unit": "vitest run",
|
||||
|
||||
@@ -82,22 +82,35 @@ exports.partsScan = async function (req, res) {
|
||||
criticalIds.add(jobline.id);
|
||||
}
|
||||
if (update_field && update_value) {
|
||||
const result = await client.setHeaders({ Authorization: BearerToken }).request(queries.UPDATE_JOB_LINE, {
|
||||
lineId: jobline.id,
|
||||
line: { [update_field]: update_value, manual_line: true }
|
||||
});
|
||||
|
||||
const auditResult = await client
|
||||
.setHeaders({ Authorization: BearerToken })
|
||||
.request(queries.INSERT_AUDIT_TRAIL, {
|
||||
auditObj: {
|
||||
bodyshopid: data.jobs_by_pk.bodyshop.id,
|
||||
jobid,
|
||||
operation: `Jobline (#${jobline.line_no} ${jobline.line_desc}/${jobline.id}) ${update_field} updated from ${jobline[update_field]} to ${update_value}. Lined marked as manual line.`,
|
||||
type: "partscanupdate",
|
||||
useremail: req.user.email
|
||||
let actualUpdateField = update_field;
|
||||
if (update_field === "part_number") {
|
||||
// Determine which part number field to update based on the match
|
||||
if (!jobline.oem_partno) {
|
||||
actualUpdateField = "oem_partno";
|
||||
} else {
|
||||
if (regex) {
|
||||
actualUpdateField = regex.test(jobline.oem_partno || "") ? "oem_partno" : "alt_partno";
|
||||
} else {
|
||||
actualUpdateField = jobline.oem_partno === value ? "oem_partno" : "alt_partno";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (actualUpdateField) {
|
||||
await client.setHeaders({ Authorization: BearerToken }).request(queries.UPDATE_JOB_LINE, {
|
||||
lineId: jobline.id,
|
||||
line: { [actualUpdateField]: update_value, manual_line: true }
|
||||
});
|
||||
}
|
||||
|
||||
await client.setHeaders({ Authorization: BearerToken }).request(queries.INSERT_AUDIT_TRAIL, {
|
||||
auditObj: {
|
||||
bodyshopid: data.jobs_by_pk.bodyshop.id,
|
||||
jobid,
|
||||
operation: `Jobline (#${jobline.line_no} ${jobline.line_desc}/${jobline.id}) ${update_field} updated from ${jobline[update_field]} to ${update_value}. Lined marked as manual line.`,
|
||||
type: "partscanupdate",
|
||||
useremail: req.user.email
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//break; // No need to evaluate further rules for this jobline
|
||||
|
||||
Reference in New Issue
Block a user