refactor(telemetry): Fix metadata on personalization survey (#4123)

🐛 Fix metadata on personalization survey
This commit is contained in:
Iván Ovejero 2022-09-20 08:55:12 +02:00 committed by GitHub
parent 5f4830b275
commit 479f78b3bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -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,

View file

@ -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<string, GenericValue> = {
...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);