🐛 Fix personalization survey merge

This commit is contained in:
Iván Ovejero 2021-12-15 12:59:32 +01:00
parent f2242be787
commit 9f5f32ea87
4 changed files with 167 additions and 241 deletions

236
package-lock.json generated
View file

@ -13524,6 +13524,15 @@
"resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz",
"integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw=="
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"array-union": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
@ -13559,6 +13568,21 @@
}
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"optional": true
},
"commander": {
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
@ -13621,6 +13645,58 @@
"worker-rpc": "^0.1.0"
}
},
"fork-ts-checker-webpack-plugin-v5": {
"version": "npm:fork-ts-checker-webpack-plugin@5.2.1",
"resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-5.2.1.tgz",
"integrity": "sha512-SVi+ZAQOGbtAsUWrZvGzz38ga2YqjWvca1pXQFUArIVXqli0lLoDQ8uS0wg0kSpcwpZmaW5jVCZXQebkyUQSsw==",
"optional": true,
"requires": {
"@babel/code-frame": "^7.8.3",
"@types/json-schema": "^7.0.5",
"chalk": "^4.1.0",
"cosmiconfig": "^6.0.0",
"deepmerge": "^4.2.2",
"fs-extra": "^9.0.0",
"memfs": "^3.1.2",
"minimatch": "^3.0.4",
"schema-utils": "2.7.0",
"semver": "^7.3.2",
"tapable": "^1.0.0"
},
"dependencies": {
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"optional": true,
"requires": {
"lru-cache": "^6.0.0"
}
}
}
},
"fs-extra": {
"version": "9.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
"integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
"optional": true,
"requires": {
"at-least-node": "^1.0.0",
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^2.0.0"
}
},
"glob-parent": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz",
@ -13655,6 +13731,12 @@
"slash": "^2.0.0"
}
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"optional": true
},
"ignore": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
@ -13683,6 +13765,16 @@
"resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
"integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8="
},
"jsonfile": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
"optional": true,
"requires": {
"graceful-fs": "^4.1.6",
"universalify": "^2.0.0"
}
},
"micromatch": {
"version": "3.1.10",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
@ -13718,6 +13810,17 @@
}
}
},
"schema-utils": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz",
"integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==",
"optional": true,
"requires": {
"@types/json-schema": "^7.0.4",
"ajv": "^6.12.2",
"ajv-keywords": "^3.4.1"
}
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
@ -13728,6 +13831,15 @@
"resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz",
"integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A=="
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"to-regex-range": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
@ -13821,6 +13933,12 @@
"requires": {
"tslib": "^1.8.1"
}
},
"universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"optional": true
}
}
},
@ -23308,124 +23426,6 @@
}
}
},
"fork-ts-checker-webpack-plugin-v5": {
"version": "npm:fork-ts-checker-webpack-plugin@5.2.1",
"resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-5.2.1.tgz",
"integrity": "sha512-SVi+ZAQOGbtAsUWrZvGzz38ga2YqjWvca1pXQFUArIVXqli0lLoDQ8uS0wg0kSpcwpZmaW5jVCZXQebkyUQSsw==",
"optional": true,
"requires": {
"@babel/code-frame": "^7.8.3",
"@types/json-schema": "^7.0.5",
"chalk": "^4.1.0",
"cosmiconfig": "^6.0.0",
"deepmerge": "^4.2.2",
"fs-extra": "^9.0.0",
"memfs": "^3.1.2",
"minimatch": "^3.0.4",
"schema-utils": "2.7.0",
"semver": "^7.3.2",
"tapable": "^1.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"optional": true
},
"fs-extra": {
"version": "9.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
"integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
"optional": true,
"requires": {
"at-least-node": "^1.0.0",
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^2.0.0"
}
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"optional": true
},
"jsonfile": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
"optional": true,
"requires": {
"graceful-fs": "^4.1.6",
"universalify": "^2.0.0"
}
},
"schema-utils": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz",
"integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==",
"optional": true,
"requires": {
"@types/json-schema": "^7.0.4",
"ajv": "^6.12.2",
"ajv-keywords": "^3.4.1"
}
},
"semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"optional": true,
"requires": {
"lru-cache": "^6.0.0"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"optional": true
}
}
},
"form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",

View file

@ -483,7 +483,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 {

View file

@ -10,7 +10,6 @@
:closeOnPressEscape="false"
width="460px"
@enter="save"
@input="onInput"
>
<template v-slot:content>
<div v-if="submitted" :class="$style.submittedContainer">
@ -19,7 +18,7 @@
</div>
<div :class="$style.container" v-else>
<n8n-input-label :label="$i.baseText('personalizationModal.howAreYourCodingSkills')">
<n8n-select :value="values[CODING_SKILL_KEY]" :placeholder="$i.baseText('personalizationModal.select')" @change="(value) => onInput(CODING_SKILL_KEY, value)">
<n8n-select :value="values[CODING_SKILL_KEY]" :placeholder="$i.baseText('personalizationModal.select')" @change="(value) => values[CODING_SKILL_KEY] = value">
<n8n-option
:label="baseText('personalizationModal.neverCoded')"
value="0"
@ -48,123 +47,53 @@
</n8n-input-label>
<n8n-input-label :label="$i.baseText('personalizationModal.whichOfTheseAreasDoYouMainlyWorkIn')">
<n8n-select :value="values[WORK_AREA_KEY]" :placeholder="$i.baseText('personalizationModal.select')" @change="(value) => onInput(WORK_AREA_KEY, value)">
<n8n-option
:value="FINANCE_WORK_AREA"
:label="$i.baseText('personalizationModal.finance')"
/>
<n8n-option
:value="HR_WORK_AREA"
:label="$i.baseText('personalizationModal.hr')"
/>
<n8n-option
:value="IT_ENGINEERING_WORK_AREA"
:label="$i.baseText('personalizationModal.itEngineering')"
/>
<n8n-option
:value="LEGAL_WORK_AREA"
:label="$i.baseText('personalizationModal.legal')"
/>
<n8n-option
:value="MARKETING_WORK_AREA"
:label="$i.baseText('personalizationModal.marketing')"
/>
<n8n-option
:value="OPS_WORK_AREA"
:label="$i.baseText('personalizationModal.operations')"
/>
<n8n-option
:value="PRODUCT_WORK_AREA"
:label="$i.baseText('personalizationModal.product')"
/>
<n8n-option
:value="SALES_BUSINESSDEV_WORK_AREA"
:label="$i.baseText('personalizationModal.salesBizDev')"
/>
<n8n-option
:value="SECURITY_WORK_AREA"
:label="$i.baseText('personalizationModal.security')"
/>
<n8n-option
:value="SUPPORT_WORK_AREA"
:label="$i.baseText('personalizationModal.support')"
/>
<n8n-option
:value="EXECUTIVE_WORK_AREA"
:label="$i.baseText('personalizationModal.executiveTeam')"
/>
<n8n-option
:value="OTHER_WORK_AREA_OPTION"
:label="$i.baseText('personalizationModal.otherPleaseSpecify')"
/>
<n8n-option
:value="NOT_APPLICABLE_WORK_AREA"
:label="$i.baseText('personalizationModal.imNotUsingN8nForWork')"
/>
<n8n-select :value="values[WORK_AREA_KEY]" multiple :placeholder="$i.baseText('personalizationModal.select')" @change="(value) => onMultiInput(WORK_AREA_KEY, value)">
<n8n-option :value="FINANCE_WORK_AREA" :label="$i.baseText('personalizationModal.finance')" />
<n8n-option :value="HR_WORK_AREA" :label="$i.baseText('personalizationModal.hr')" />
<n8n-option :value="IT_ENGINEERING_WORK_AREA" :label="$i.baseText('personalizationModal.itEngineering')" />
<n8n-option :value="LEGAL_WORK_AREA" :label="$i.baseText('personalizationModal.legal')" />
<n8n-option :value="MARKETING_WORK_AREA" :label="$i.baseText('personalizationModal.marketing')" />
<n8n-option :value="OPS_WORK_AREA" :label="$i.baseText('personalizationModal.operations')" />
<n8n-option :value="PRODUCT_WORK_AREA" :label="$i.baseText('personalizationModal.product')" />
<n8n-option :value="SALES_BUSINESSDEV_WORK_AREA" :label="$i.baseText('personalizationModal.salesBizDev')" />
<n8n-option :value="SECURITY_WORK_AREA" :label="$i.baseText('personalizationModal.security')" />
<n8n-option :value="SUPPORT_WORK_AREA" :label="$i.baseText('personalizationModal.support')" />
<n8n-option :value="EXECUTIVE_WORK_AREA" :label="$i.baseText('personalizationModal.executiveTeam')" />
<n8n-option :value="OTHER_WORK_AREA_OPTION" :label="$i.baseText('personalizationModal.otherPleaseSpecify')" />
<n8n-option :value="NOT_APPLICABLE_WORK_AREA" :label="$i.baseText('personalizationModal.imNotUsingN8nForWork')" />
</n8n-select>
</n8n-input-label>
<n8n-input
v-if="otherWorkAreaFieldVisible"
:value="values[OTHER_WORK_AREA_KEY]"
:placeholder="$i.baseText('personalizationModal.specifyYourWorkArea')"
@input="(value) => onInput(OTHER_WORK_AREA_KEY, value)"
@input="(value) => values[OTHER_WORK_AREA_KEY] = value"
/>
<section v-if="showAllIndustryQuestions">
<n8n-input-label :label="$i.baseText('personalizationModal.whichIndustriesIsYourCompanyIn')">
<n8n-select :value="values[COMPANY_INDUSTRY_KEY]" multiple :placeholder="$i.baseText('personalizationModal.select')" @change="(value) => onInput(COMPANY_INDUSTRY_KEY, value)">
<n8n-option
:value="E_COMMERCE_INDUSTRY"
:label="$i.baseText('personalizationModal.eCommerce')"
/>
<n8n-option
:value="AUTOMATION_CONSULTING_INDUSTRY"
:label="$i.baseText('personalizationModal.automationConsulting')"
/>
<n8n-option
:value="SYSTEM_INTEGRATION_INDUSTRY"
:label="$i.baseText('personalizationModal.systemsIntegration')"
/>
<n8n-option
:value="GOVERNMENT_INDUSTRY"
:label="$i.baseText('personalizationModal.government')"
/>
<n8n-option
:value="LEGAL_INDUSTRY"
:label="$i.baseText('personalizationModal.legal')"
/>
<n8n-option
:value="HEALTHCARE_INDUSTRY"
:label="$i.baseText('personalizationModal.healthcare')"
/>
<n8n-option
:value="FINANCE_INDUSTRY"
:label="$i.baseText('personalizationModal.finance')"
/>
<n8n-option
:value="SECURITY_INDUSTRY"
:label="$i.baseText('personalizationModal.security')"
/>
<n8n-option
:value="SAAS_INDUSTRY"
:label="$i.baseText('personalizationModal.saas')"
/>
<n8n-option
:value="OTHER_INDUSTRY_OPTION"
:label="$i.baseText('personalizationModal.otherPleaseSpecify')"
/>
<n8n-select :value="values[COMPANY_INDUSTRY_KEY]" multiple :placeholder="$i.baseText('personalizationModal.select')" @change="(value) => onMultiInput(COMPANY_INDUSTRY_KEY, value)">
<n8n-option :value="E_COMMERCE_INDUSTRY" :label="$i.baseText('personalizationModal.eCommerce')" />
<n8n-option :value="AUTOMATION_CONSULTING_INDUSTRY" :label="$i.baseText('personalizationModal.automationConsulting')" />
<n8n-option :value="SYSTEM_INTEGRATION_INDUSTRY" :label="$i.baseText('personalizationModal.systemsIntegration')" />
<n8n-option :value="GOVERNMENT_INDUSTRY" :label="$i.baseText('personalizationModal.government')" />
<n8n-option :value="LEGAL_INDUSTRY" :label="$i.baseText('personalizationModal.legal')" />
<n8n-option :value="HEALTHCARE_INDUSTRY" :label="$i.baseText('personalizationModal.healthcare')" />
<n8n-option :value="FINANCE_INDUSTRY" :label="$i.baseText('personalizationModal.finance')" />
<n8n-option :value="SECURITY_INDUSTRY" :label="$i.baseText('personalizationModal.security')" />
<n8n-option :value="SAAS_INDUSTRY" :label="$i.baseText('personalizationModal.saas')" />
<n8n-option :value="OTHER_INDUSTRY_OPTION" :label="$i.baseText('personalizationModal.otherPleaseSpecify')" />
</n8n-select>
</n8n-input-label>
<n8n-input
v-if="otherCompanyIndustryFieldVisible"
:value="values[OTHER_COMPANY_INDUSTRY_KEY]"
:placeholder="$i.baseText('personalizationModal.specifyYourCompanysIndustry')"
@input="(value) => onInput(OTHER_COMPANY_INDUSTRY_KEY, value)"
@input="(value) => values[OTHER_COMPANY_INDUSTRY_KEY] = value"
/>
<n8n-input-label :label="$i.baseText('personalizationModal.howBigIsYourCompany')">
<n8n-select :value="values[COMPANY_SIZE_KEY]" :placeholder="$i.baseText('personalizationModal.select')" @change="(value) => onInput(COMPANY_SIZE_KEY, value)">
<n8n-select :value="values[COMPANY_SIZE_KEY]" placeholder="Select..." @change="(value) => values[COMPANY_SIZE_KEY] = value">
<n8n-option
:label="$i.baseText('personalizationModal.lessThan20People')"
:value="COMPANY_SIZE_20_OR_LESS"
@ -265,11 +194,11 @@ export default mixins(showMessage, workflowHelpers).extend({
showAllIndustryQuestions: true,
modalBus: new Vue(),
values: {
[WORK_AREA_KEY]: null,
[WORK_AREA_KEY]: [],
[COMPANY_SIZE_KEY]: null,
[CODING_SKILL_KEY]: null,
[OTHER_WORK_AREA_KEY]: null,
[COMPANY_INDUSTRY_KEY]: null,
[COMPANY_INDUSTRY_KEY]: [],
[OTHER_COMPANY_INDUSTRY_KEY]: null,
} as IPersonalizationSurveyAnswers,
FINANCE_WORK_AREA,
@ -318,28 +247,19 @@ export default mixins(showMessage, workflowHelpers).extend({
closeDialog() {
this.modalBus.$emit('close');
},
onInput(name: IPersonalizationSurveyKeys, value: string) {
if (name === WORK_AREA_KEY && value.includes(OTHER_WORK_AREA_OPTION)) {
this.otherWorkAreaFieldVisible = true;
onMultiInput(name: IPersonalizationSurveyKeys, value: string[]) {
if (name === WORK_AREA_KEY) {
this.otherWorkAreaFieldVisible = value.includes(OTHER_WORK_AREA_OPTION);
this.showAllIndustryQuestions = !value.includes(NOT_APPLICABLE_WORK_AREA);
this.values[OTHER_WORK_AREA_KEY] = value.includes(OTHER_WORK_AREA_OPTION) ? this.values[OTHER_WORK_AREA_KEY] : null;
this.values[WORK_AREA_KEY] = value;
}
else if (name === WORK_AREA_KEY && value.includes(NOT_APPLICABLE_WORK_AREA)) {
this.showAllIndustryQuestions = false;
}
else if (name === WORK_AREA_KEY) {
this.otherWorkAreaFieldVisible = false;
this.showAllIndustryQuestions = true;
this.values[OTHER_WORK_AREA_KEY] = null;
if (name === COMPANY_INDUSTRY_KEY) {
this.otherCompanyIndustryFieldVisible = value.includes(OTHER_INDUSTRY_OPTION);
this.values[OTHER_COMPANY_INDUSTRY_KEY] = value.includes(OTHER_INDUSTRY_OPTION) ? this.values[OTHER_COMPANY_INDUSTRY_KEY] : null;
this.values[COMPANY_INDUSTRY_KEY] = value;
}
if (name === COMPANY_INDUSTRY_KEY && value.includes(OTHER_INDUSTRY_OPTION)) {
this.otherCompanyIndustryFieldVisible = true;
}
else if (name === COMPANY_INDUSTRY_KEY) {
this.otherCompanyIndustryFieldVisible = false;
this.values[OTHER_COMPANY_INDUSTRY_KEY] = null;
}
this.values[name] = value;
},
async save(): Promise<void> {
this.$data.isSaving = true;
@ -353,7 +273,7 @@ export default mixins(showMessage, workflowHelpers).extend({
this.submitted = true;
} catch (e) {
this.$showError(e, this.$i.baseText('personalizationModal.errorWhileSubmittingResults'));
this.$showError(e, 'Error while submitting results');
}
this.$data.isSaving = false;

View file

@ -132,3 +132,4 @@ export const CODING_SKILL_KEY = 'codingSkill';
export const OTHER_WORK_AREA_KEY = 'otherWorkArea';
export const OTHER_COMPANY_INDUSTRY_KEY = 'otherCompanyIndustry';
export const VALID_EMAIL_REGEX = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;