Skip to content

Commit

Permalink
Send events for Building Firmware feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
yoichiro committed Nov 16, 2023
1 parent 9022550 commit 15bc284
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/components/catalog/keyboard/build/CatalogBuild.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ export default function CatalogBuild(props: CatalogBuildProps) {
};

const onClickFlash = (task: IFirmwareBuildingTask) => {
sendEventToGoogleAnalytics('catalog/build/flash_firmware', {
vendor_id: props.definitionDocument!.vendorId,
product_id: props.definitionDocument!.productId,
product_name: props.definitionDocument!.productName,
});
props.flashFirmware!(
props.definitionDocument!,
props.buildableFirmware!,
Expand All @@ -120,6 +125,11 @@ export default function CatalogBuild(props: CatalogBuildProps) {
};

const onClickDeleteYes = () => {
sendEventToGoogleAnalytics('catalog/build/delete_firmware', {
vendor_id: props.definitionDocument!.vendorId,
product_id: props.definitionDocument!.productId,
product_name: props.definitionDocument!.productName,
});
props.deleteFirmwareBuildingTask!(
props.definitionDocument!.id,
targetDeleteTask!
Expand Down Expand Up @@ -152,6 +162,11 @@ export default function CatalogBuild(props: CatalogBuildProps) {
};

const onClickBuildBuildParametersDialog = (description: string) => {
sendEventToGoogleAnalytics('catalog/build/build_firmware', {
vendor_id: props.definitionDocument!.vendorId,
product_id: props.definitionDocument!.productId,
product_name: props.definitionDocument!.productName,
});
setOpenBuildParametersDialog(false);
const parameterValues: {
keyboard: { [fileId: string]: { [parameterName: string]: string } };
Expand All @@ -176,6 +191,11 @@ export default function CatalogBuild(props: CatalogBuildProps) {
description: string
) => {
if (task.description !== description) {
sendEventToGoogleAnalytics('catalog/build/change_description', {
vendor_id: props.definitionDocument!.vendorId,
product_id: props.definitionDocument!.productId,
product_name: props.definitionDocument!.productName,
});
props.updateFirmwareBuildingTaskDescription!(task.id, description);
}
};
Expand Down
4 changes: 4 additions & 0 deletions src/utils/GoogleAnalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ type IActionName =
| 'catalog/apply_keymap'
| 'catalog/back_to_search'
| 'catalog/build'
| 'catalog/build/build_firmware'
| 'catalog/build/change_description'
| 'catalog/build/delete_firmware'
| 'catalog/build/download_firmware'
| 'catalog/build/flash_firmware'
| 'catalog/cheat_sheet'
| 'catalog/clear_search_condition'
| 'catalog/download_firmware'
Expand Down

0 comments on commit 15bc284

Please sign in to comment.