mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-18 13:20:43 +00:00
Merge branch 'main' into feature/CE-1107-add-day-by-day-views-for-the
This commit is contained in:
@ -82,7 +82,7 @@ function EntityForm(props: Props): JSX.Element
|
||||
const qController = Client.getInstance();
|
||||
const tableNameParam = useParams().tableName;
|
||||
const tableName = props.table === null ? tableNameParam : props.table.name;
|
||||
const {accentColor} = useContext(QContext);
|
||||
const {accentColor, recordAnalytics} = useContext(QContext);
|
||||
|
||||
const [formTitle, setFormTitle] = useState("");
|
||||
const [validations, setValidations] = useState({});
|
||||
@ -359,6 +359,7 @@ function EntityForm(props: Props): JSX.Element
|
||||
{
|
||||
const tableMetaData = await qController.loadTableMetaData(tableName);
|
||||
setTableMetaData(tableMetaData);
|
||||
recordAnalytics({location: window.location, title: (props.isCopy ? "Copy" : props.id ? "Edit" : "New") + ": " + tableMetaData.label});
|
||||
|
||||
const metaData = await qController.loadMetaData();
|
||||
setMetaData(metaData);
|
||||
@ -389,6 +390,7 @@ function EntityForm(props: Props): JSX.Element
|
||||
{
|
||||
record = await qController.get(tableName, props.id);
|
||||
setRecord(record);
|
||||
recordAnalytics({category: "tableEvents", action: props.isCopy ? "copy" : "edit", label: tableMetaData?.label + " / " + record?.recordLabel});
|
||||
|
||||
const titleVerb = props.isCopy ? "Copy" : "Edit";
|
||||
setFormTitle(`${titleVerb} ${tableMetaData?.label}: ${record?.recordLabel}`);
|
||||
@ -428,6 +430,7 @@ function EntityForm(props: Props): JSX.Element
|
||||
// else handle preparing to do an insert //
|
||||
///////////////////////////////////////////
|
||||
setFormTitle(`Creating New ${tableMetaData?.label}`);
|
||||
recordAnalytics({category: "tableEvents", action: "new", label: tableMetaData?.label});
|
||||
|
||||
if (!props.isModal)
|
||||
{
|
||||
@ -757,6 +760,8 @@ function EntityForm(props: Props): JSX.Element
|
||||
|
||||
if (props.id !== null && !props.isCopy)
|
||||
{
|
||||
recordAnalytics({category: "tableEvents", action: "saveEdit", label: tableMetaData?.label});
|
||||
|
||||
///////////////////////
|
||||
// perform an update //
|
||||
///////////////////////
|
||||
@ -799,6 +804,8 @@ function EntityForm(props: Props): JSX.Element
|
||||
}
|
||||
else
|
||||
{
|
||||
recordAnalytics({category: "tableEvents", action: props.isCopy ? "saveCopy" : "saveNew", label: tableMetaData?.label});
|
||||
|
||||
/////////////////////////////////
|
||||
// perform an insert //
|
||||
// todo - audit if it's a dupe //
|
||||
|
@ -23,8 +23,9 @@ import {QTableMetaData} from "@kingsrook/qqq-frontend-core/lib/model/metaData/QT
|
||||
import {QQueryFilter} from "@kingsrook/qqq-frontend-core/lib/model/query/QQueryFilter";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import {GridColDef, GridExportMenuItemProps} from "@mui/x-data-grid-pro";
|
||||
import React from "react";
|
||||
import QContext from "QContext";
|
||||
import ValueUtils from "qqq/utils/qqq/ValueUtils";
|
||||
import React, {useContext} from "react";
|
||||
|
||||
interface QExportMenuItemProps extends GridExportMenuItemProps<{}>
|
||||
{
|
||||
@ -43,6 +44,10 @@ export default function ExportMenuItem(props: QExportMenuItemProps)
|
||||
{
|
||||
const {format, tableMetaData, totalRecords, columnsModel, columnVisibilityModel, queryFilter, hideMenu} = props;
|
||||
|
||||
const {recordAnalytics} = useContext(QContext);
|
||||
|
||||
recordAnalytics({category: "tableEvents", action: "export", label: tableMetaData.label});
|
||||
|
||||
return (
|
||||
<MenuItem
|
||||
disabled={totalRecords === 0}
|
||||
|
Reference in New Issue
Block a user