Add additional analytics.

This commit is contained in:
Patrick FIc
2025-09-25 09:29:02 -07:00
parent 9907c0896f
commit 2ee06878cc
5 changed files with 447 additions and 48 deletions

View File

@@ -4,7 +4,9 @@ import { connect } from "react-redux";
import { useNavigate } from "react-router-dom";
import { queryReportingData } from "../../../redux/reporting/reporting.actions";
import dayjs from "../../../util/day.js";
import ipcTypes from "../../../ipc.types";
import { duration } from "moment/moment.js";
const { ipcRenderer } = window;
const mapDispatchToProps = (dispatch) => ({
queryReportingData: (dates) => dispatch(queryReportingData(dates))
});
@@ -14,6 +16,10 @@ function QuickReportFloatButton({ queryReportingData }) {
const navigate = useNavigate();
const handleQuickReport = (startDate, endDate) => {
ipcRenderer.send(ipcTypes.app.toMain.track, {
event: "QUICK_REPORT",
duration: duration(endDate.diff(startDate)).asDays()
});
queryReportingData({
startDate,
endDate

View File

@@ -54,11 +54,18 @@ export function ShopSettingsOrganism({ setBodyshop }) {
// Create debounced auto-save function
const debouncedAutoSave = debounce(function (changed, values) {
// Only auto-save if data is loaded
console.log("Changed values:", changed);
if (
data &&
!loading &&
Object.keys(changed).some((key) => ["mpi_count_quantity", "accepted_ins_co"].includes(key))
) {
if (Object.keys(changed).includes("mpi_count_quantity")) {
ipcRenderer.send(ipcTypes.app.toMain.track, {
event: "TOGGLE_COUNT_PART_QUANTITY",
mpi_count_quantity: changed.mpi_count_quantity
});
}
//Prevent auto save on shop name.
form
.validateFields()