mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
add delete_column, delete_table analytics events
This commit is contained in:
@@ -37,6 +37,7 @@ import { getFieldProp } from "@src/components/fields";
|
||||
import { Column } from "react-data-grid";
|
||||
import { PopoverProps } from "@mui/material";
|
||||
import { useConfirmation } from "@src/components/ConfirmationDialog";
|
||||
import { analytics } from "@src/analytics";
|
||||
|
||||
const INITIAL_MODAL = { type: "", data: {} };
|
||||
|
||||
@@ -290,6 +291,7 @@ export default function ColumnMenu() {
|
||||
confirmColor: "error",
|
||||
handleConfirm: () => {
|
||||
actions.remove(column.key);
|
||||
await analytics.logEvent("delete_column", { type: column.type });
|
||||
handleClose();
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -9,6 +9,7 @@ import Confirmation from "@src/components/Confirmation";
|
||||
import { Table } from "@src/contexts/ProjectContext";
|
||||
import { routes } from "@src/constants/routes";
|
||||
import { db } from "@src/firebase";
|
||||
import { analytics } from "@src/analytics";
|
||||
import {
|
||||
SETTINGS,
|
||||
TABLE_SCHEMAS,
|
||||
@@ -40,13 +41,15 @@ export default function DeleteMenu({ clearDialog, data }: IDeleteMenuProps) {
|
||||
(table) => table.id !== data?.id || table.tableType !== data?.tableType
|
||||
);
|
||||
tablesDocRef.update({ tables: updatedTables });
|
||||
db.collection(
|
||||
data?.tableType === "primaryCollection"
|
||||
? TABLE_SCHEMAS
|
||||
: TABLE_GROUP_SCHEMAS
|
||||
)
|
||||
await db
|
||||
.collection(
|
||||
data?.tableType === "primaryCollection"
|
||||
? TABLE_SCHEMAS
|
||||
: TABLE_GROUP_SCHEMAS
|
||||
)
|
||||
.doc(data?.id)
|
||||
.delete();
|
||||
await analytics.logEvent("delete_table");
|
||||
clearDialog();
|
||||
history.push(routes.home);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user