From 479f78b3bcee799c426c3dcef6ca1899710614aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 20 Sep 2022 08:55:12 +0200 Subject: [PATCH] refactor(telemetry): Fix metadata on personalization survey (#4123) :bug: Fix metadata on personalization survey --- packages/cli/src/InternalHooks.ts | 3 --- .../editor-ui/src/components/PersonalizationModal.vue | 8 +++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/InternalHooks.ts b/packages/cli/src/InternalHooks.ts index 1c11a07019..fe98bc6428 100644 --- a/packages/cli/src/InternalHooks.ts +++ b/packages/cli/src/InternalHooks.ts @@ -70,9 +70,6 @@ export class InternalHooksClass implements IInternalHooksClass { personalizationSurveyData[snakeCase(camelCaseKey)] = answers[camelCaseKey]; }); - personalizationSurveyData.personalization_survey_submitted_at = new Date().toISOString(); - personalizationSurveyData.personalization_survey_n8n_version = this.versionCli; - return this.telemetry.track( 'User responded to personalization questions', personalizationSurveyData, diff --git a/packages/editor-ui/src/components/PersonalizationModal.vue b/packages/editor-ui/src/components/PersonalizationModal.vue index 3e14fc3f1e..46d3c39111 100644 --- a/packages/editor-ui/src/components/PersonalizationModal.vue +++ b/packages/editor-ui/src/components/PersonalizationModal.vue @@ -120,6 +120,7 @@ import { IFormInputs, IPersonalizationLatestVersion } from '@/Interface'; import Vue from 'vue'; import { mapGetters } from 'vuex'; import { getAccountAge } from '@/modules/userHelpers'; +import { GenericValue } from 'n8n-workflow'; export default mixins(showMessage, workflowHelpers).extend({ components: { Modal }, @@ -465,7 +466,12 @@ export default mixins(showMessage, workflowHelpers).extend({ this.$data.isSaving = true; try { - const survey = { ...values, version: SURVEY_VERSION }; + const survey: Record = { + ...values, + version: SURVEY_VERSION, + personalization_survey_submitted_at: new Date().toISOString(), + personalization_survey_n8n_version: this.$store.getters.versionCli, + }; this.$externalHooks().run('personalizationModal.onSubmit', survey);