From 8e2191b6339e27777ab29f11459dcfaa4a0a4157 Mon Sep 17 00:00:00 2001 From: Elvina Valieva Date: Fri, 10 Dec 2021 18:53:31 +0100 Subject: [PATCH] :bug: Fix recommendation logic (#2543) * fix: expect multiple answers for survey * chore: refactor survey input methods * fix error; fix tracking Co-authored-by: Mutasem --- packages/cli/src/Interfaces.ts | 6 ++- packages/cli/src/InternalHooks.ts | 2 + packages/editor-ui/src/Interface.ts | 7 ++- .../src/components/PersonalizationModal.vue | 46 ++++++++----------- packages/editor-ui/src/modules/helper.ts | 32 ++++++++----- 5 files changed, 51 insertions(+), 42 deletions(-) diff --git a/packages/cli/src/Interfaces.ts b/packages/cli/src/Interfaces.ts index 30cd03b8b0..8559dd4968 100644 --- a/packages/cli/src/Interfaces.ts +++ b/packages/cli/src/Interfaces.ts @@ -406,10 +406,12 @@ export interface IN8nUISettings { } export interface IPersonalizationSurveyAnswers { - companySize: string | null; codingSkill: string | null; - workArea: string | null; + companyIndustry: string[]; + companySize: string | null; + otherCompanyIndustry: string | null; otherWorkArea: string | null; + workArea: string[] | string | null; } export interface IPersonalizationSurvey { diff --git a/packages/cli/src/InternalHooks.ts b/packages/cli/src/InternalHooks.ts index fc67a3634e..a2e1ae54d2 100644 --- a/packages/cli/src/InternalHooks.ts +++ b/packages/cli/src/InternalHooks.ts @@ -45,6 +45,8 @@ export class InternalHooksClass implements IInternalHooksClass { coding_skill: answers.codingSkill, work_area: answers.workArea, other_work_area: answers.otherWorkArea, + company_industry: answers.companyIndustry, + other_company_industry: answers.otherCompanyIndustry, }); } diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index 5248c17bd9..a625f6c75b 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -473,7 +473,12 @@ export interface IVersionNotificationSettings { export type IPersonalizationSurveyKeys = 'codingSkill' | 'companyIndustry' | 'companySize' | 'otherCompanyIndustry' | 'otherWorkArea' | 'workArea'; export type IPersonalizationSurveyAnswers = { - [key in IPersonalizationSurveyKeys]: string | null + codingSkill: string | null; + companyIndustry: string[]; + companySize: string | null; + otherCompanyIndustry: string | null; + otherWorkArea: string | null; + workArea: string[] | string | null; }; export interface IPersonalizationSurvey { diff --git a/packages/editor-ui/src/components/PersonalizationModal.vue b/packages/editor-ui/src/components/PersonalizationModal.vue index 37727a4ccc..124e7ea04c 100644 --- a/packages/editor-ui/src/components/PersonalizationModal.vue +++ b/packages/editor-ui/src/components/PersonalizationModal.vue @@ -10,7 +10,6 @@ :closeOnPressEscape="false" width="460px" @enter="save" - @input="onInput" >