From f1bbddcce6bd6363267e3bc8a8eff03f41357213 Mon Sep 17 00:00:00 2001 From: Milorad Filipovic Date: Wed, 14 Feb 2024 11:44:10 +0100 Subject: [PATCH] feat: Add telemetry event when users click on templates link --- packages/editor-ui/src/components/MainSidebar.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/editor-ui/src/components/MainSidebar.vue b/packages/editor-ui/src/components/MainSidebar.vue index 6eb77c2883f6f..583c6aabf815b 100644 --- a/packages/editor-ui/src/components/MainSidebar.vue +++ b/packages/editor-ui/src/components/MainSidebar.vue @@ -388,6 +388,9 @@ export default defineComponent({ workflow_id: this.workflowsStore.workflowId, }); }, + trackTemplatesClick() { + this.$telemetry.track('User clicked on templates', {}); + }, async onUserActionToggle(action: string) { switch (action) { case 'logout': @@ -419,6 +422,14 @@ export default defineComponent({ }, async handleSelect(key: string) { switch (key) { + case 'templates': + if ( + this.settingsStore.isTemplatesEnabled && + !this.templatesStore.hasCustomTemplatesHost + ) { + this.trackTemplatesClick(); + } + break; case 'about': { this.trackHelpItemClick('about'); this.uiStore.openModal(ABOUT_MODAL_KEY);