Add additional analytics.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user