2021-10-18 20:57:49 -07:00
|
|
|
<template>
|
|
|
|
<Modal
|
|
|
|
:name="PERSONALIZATION_MODAL_KEY"
|
2021-12-15 04:16:53 -08:00
|
|
|
:title="!submitted? $locale.baseText('personalizationModal.getStarted') : $locale.baseText('personalizationModal.thanks')"
|
|
|
|
:subtitle="!submitted? $locale.baseText('personalizationModal.theseQuestionsHelpUs') : ''"
|
2021-10-18 20:57:49 -07:00
|
|
|
:centerTitle="true"
|
|
|
|
:showClose="false"
|
|
|
|
:eventBus="modalBus"
|
|
|
|
:closeOnClickModal="false"
|
|
|
|
:closeOnPressEscape="false"
|
|
|
|
width="460px"
|
|
|
|
@enter="save"
|
|
|
|
>
|
|
|
|
<template v-slot:content>
|
|
|
|
<div v-if="submitted" :class="$style.submittedContainer">
|
|
|
|
<img :class="$style.demoImage" :src="baseUrl + 'suggestednodes.png'" />
|
2021-12-15 04:16:53 -08:00
|
|
|
<n8n-text>{{ $locale.baseText('personalizationModal.lookOutForThingsMarked') }}</n8n-text>
|
2021-10-18 20:57:49 -07:00
|
|
|
</div>
|
|
|
|
<div :class="$style.container" v-else>
|
2021-12-15 04:16:53 -08:00
|
|
|
<n8n-input-label :label="$locale.baseText('personalizationModal.howAreYourCodingSkills')">
|
|
|
|
<n8n-select :value="values[CODING_SKILL_KEY]" :placeholder="$locale.baseText('personalizationModal.select')" @change="(value) => values[CODING_SKILL_KEY] = value">
|
2021-10-18 20:57:49 -07:00
|
|
|
<n8n-option
|
2022-01-07 11:41:28 -08:00
|
|
|
:label="$locale.baseText('personalizationModal.neverCoded')"
|
2021-10-18 20:57:49 -07:00
|
|
|
value="0"
|
|
|
|
/>
|
|
|
|
<n8n-option
|
2022-01-07 11:41:28 -08:00
|
|
|
:label="$locale.baseText('personalizationModal.iGetStuckTooQuicklyToAchieveMuch')"
|
2021-10-18 20:57:49 -07:00
|
|
|
value="1"
|
|
|
|
/>
|
|
|
|
<n8n-option
|
2022-01-07 11:41:28 -08:00
|
|
|
:label="$locale.baseText('personalizationModal.iCanCodeSomeUsefulThingsBut')"
|
2021-10-18 20:57:49 -07:00
|
|
|
value="2"
|
|
|
|
/>
|
|
|
|
<n8n-option
|
2022-01-07 11:41:28 -08:00
|
|
|
:label="$locale.baseText('personalizationModal.iKnowEnoughToBeDangerousBut')"
|
2021-10-18 20:57:49 -07:00
|
|
|
value="3"
|
|
|
|
/>
|
|
|
|
<n8n-option
|
2022-01-07 11:41:28 -08:00
|
|
|
:label="$locale.baseText('personalizationModal.iCanFigureMostThingsOut')"
|
2021-10-18 20:57:49 -07:00
|
|
|
value="4"
|
|
|
|
/>
|
|
|
|
<n8n-option
|
2022-01-07 11:41:28 -08:00
|
|
|
:label="$locale.baseText('personalizationModal.iCanDoAlmostAnythingIWant')"
|
2021-10-18 20:57:49 -07:00
|
|
|
value="5"
|
|
|
|
/>
|
|
|
|
</n8n-select>
|
|
|
|
</n8n-input-label>
|
|
|
|
|
2022-01-07 11:41:28 -08:00
|
|
|
<n8n-input-label :label="$locale.baseText('personalizationModal.whichAreasDoYouMainlyWorkIn')">
|
2021-12-15 04:16:53 -08:00
|
|
|
<n8n-select :value="values[WORK_AREA_KEY]" multiple :placeholder="$locale.baseText('personalizationModal.select')" @change="(value) => onMultiInput(WORK_AREA_KEY, value)">
|
|
|
|
<n8n-option :value="FINANCE_WORK_AREA" :label="$locale.baseText('personalizationModal.finance')" />
|
|
|
|
<n8n-option :value="HR_WORK_AREA" :label="$locale.baseText('personalizationModal.hr')" />
|
|
|
|
<n8n-option :value="IT_ENGINEERING_WORK_AREA" :label="$locale.baseText('personalizationModal.itEngineering')" />
|
|
|
|
<n8n-option :value="LEGAL_WORK_AREA" :label="$locale.baseText('personalizationModal.legal')" />
|
|
|
|
<n8n-option :value="MARKETING_WORK_AREA" :label="$locale.baseText('personalizationModal.marketing')" />
|
|
|
|
<n8n-option :value="OPS_WORK_AREA" :label="$locale.baseText('personalizationModal.operations')" />
|
|
|
|
<n8n-option :value="PRODUCT_WORK_AREA" :label="$locale.baseText('personalizationModal.product')" />
|
|
|
|
<n8n-option :value="SALES_BUSINESSDEV_WORK_AREA" :label="$locale.baseText('personalizationModal.salesBizDev')" />
|
|
|
|
<n8n-option :value="SECURITY_WORK_AREA" :label="$locale.baseText('personalizationModal.security')" />
|
|
|
|
<n8n-option :value="SUPPORT_WORK_AREA" :label="$locale.baseText('personalizationModal.support')" />
|
|
|
|
<n8n-option :value="EXECUTIVE_WORK_AREA" :label="$locale.baseText('personalizationModal.executiveTeam')" />
|
|
|
|
<n8n-option :value="OTHER_WORK_AREA_OPTION" :label="$locale.baseText('personalizationModal.otherPleaseSpecify')" />
|
|
|
|
<n8n-option :value="NOT_APPLICABLE_WORK_AREA" :label="$locale.baseText('personalizationModal.imNotUsingN8nForWork')" />
|
2021-12-03 04:19:23 -08:00
|
|
|
</n8n-select>
|
|
|
|
</n8n-input-label>
|
|
|
|
<n8n-input
|
|
|
|
v-if="otherWorkAreaFieldVisible"
|
|
|
|
:value="values[OTHER_WORK_AREA_KEY]"
|
2021-12-15 04:16:53 -08:00
|
|
|
:placeholder="$locale.baseText('personalizationModal.specifyYourWorkArea')"
|
2021-12-15 03:59:32 -08:00
|
|
|
@input="(value) => values[OTHER_WORK_AREA_KEY] = value"
|
2021-12-03 04:19:23 -08:00
|
|
|
/>
|
|
|
|
|
|
|
|
<section v-if="showAllIndustryQuestions">
|
2021-12-15 04:16:53 -08:00
|
|
|
<n8n-input-label :label="$locale.baseText('personalizationModal.whichIndustriesIsYourCompanyIn')">
|
|
|
|
<n8n-select :value="values[COMPANY_INDUSTRY_KEY]" multiple :placeholder="$locale.baseText('personalizationModal.select')" @change="(value) => onMultiInput(COMPANY_INDUSTRY_KEY, value)">
|
|
|
|
<n8n-option :value="E_COMMERCE_INDUSTRY" :label="$locale.baseText('personalizationModal.eCommerce')" />
|
|
|
|
<n8n-option :value="AUTOMATION_CONSULTING_INDUSTRY" :label="$locale.baseText('personalizationModal.automationConsulting')" />
|
|
|
|
<n8n-option :value="SYSTEM_INTEGRATION_INDUSTRY" :label="$locale.baseText('personalizationModal.systemsIntegration')" />
|
|
|
|
<n8n-option :value="GOVERNMENT_INDUSTRY" :label="$locale.baseText('personalizationModal.government')" />
|
|
|
|
<n8n-option :value="LEGAL_INDUSTRY" :label="$locale.baseText('personalizationModal.legal')" />
|
|
|
|
<n8n-option :value="HEALTHCARE_INDUSTRY" :label="$locale.baseText('personalizationModal.healthcare')" />
|
|
|
|
<n8n-option :value="FINANCE_INDUSTRY" :label="$locale.baseText('personalizationModal.finance')" />
|
|
|
|
<n8n-option :value="SECURITY_INDUSTRY" :label="$locale.baseText('personalizationModal.security')" />
|
|
|
|
<n8n-option :value="SAAS_INDUSTRY" :label="$locale.baseText('personalizationModal.saas')" />
|
|
|
|
<n8n-option :value="OTHER_INDUSTRY_OPTION" :label="$locale.baseText('personalizationModal.otherPleaseSpecify')" />
|
2021-12-03 04:19:23 -08:00
|
|
|
</n8n-select>
|
|
|
|
</n8n-input-label>
|
|
|
|
<n8n-input
|
|
|
|
v-if="otherCompanyIndustryFieldVisible"
|
|
|
|
:value="values[OTHER_COMPANY_INDUSTRY_KEY]"
|
2021-12-15 04:16:53 -08:00
|
|
|
:placeholder="$locale.baseText('personalizationModal.specifyYourCompanysIndustry')"
|
2021-12-15 03:59:32 -08:00
|
|
|
@input="(value) => values[OTHER_COMPANY_INDUSTRY_KEY] = value"
|
2021-12-03 04:19:23 -08:00
|
|
|
/>
|
|
|
|
|
2021-12-15 04:16:53 -08:00
|
|
|
<n8n-input-label :label="$locale.baseText('personalizationModal.howBigIsYourCompany')">
|
2021-12-15 03:59:32 -08:00
|
|
|
<n8n-select :value="values[COMPANY_SIZE_KEY]" placeholder="Select..." @change="(value) => values[COMPANY_SIZE_KEY] = value">
|
2021-10-18 20:57:49 -07:00
|
|
|
<n8n-option
|
2021-12-15 04:16:53 -08:00
|
|
|
:label="$locale.baseText('personalizationModal.lessThan20People')"
|
2021-10-18 20:57:49 -07:00
|
|
|
:value="COMPANY_SIZE_20_OR_LESS"
|
|
|
|
/>
|
|
|
|
<n8n-option
|
2021-12-15 04:16:53 -08:00
|
|
|
:label="`20-99 ${$locale.baseText('personalizationModal.people')}`"
|
2021-10-18 20:57:49 -07:00
|
|
|
:value="COMPANY_SIZE_20_99"
|
|
|
|
/>
|
|
|
|
<n8n-option
|
2021-12-15 04:16:53 -08:00
|
|
|
:label="`100-499 ${$locale.baseText('personalizationModal.people')}`"
|
2021-10-18 20:57:49 -07:00
|
|
|
:value="COMPANY_SIZE_100_499"
|
|
|
|
/>
|
|
|
|
<n8n-option
|
2021-12-15 04:16:53 -08:00
|
|
|
:label="`500-999 ${$locale.baseText('personalizationModal.people')}`"
|
2021-10-18 20:57:49 -07:00
|
|
|
:value="COMPANY_SIZE_500_999"
|
|
|
|
/>
|
|
|
|
<n8n-option
|
2021-12-15 04:16:53 -08:00
|
|
|
:label="`1000+ ${$locale.baseText('personalizationModal.people')}`"
|
2021-10-18 20:57:49 -07:00
|
|
|
:value="COMPANY_SIZE_1000_OR_MORE"
|
|
|
|
/>
|
|
|
|
<n8n-option
|
2021-12-15 04:16:53 -08:00
|
|
|
:label="$locale.baseText('personalizationModal.imNotUsingN8nForWork')"
|
2021-10-18 20:57:49 -07:00
|
|
|
:value="COMPANY_SIZE_PERSONAL_USE"
|
|
|
|
/>
|
|
|
|
</n8n-select>
|
|
|
|
</n8n-input-label>
|
2021-12-03 04:19:23 -08:00
|
|
|
|
|
|
|
</section>
|
2021-10-18 20:57:49 -07:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<template v-slot:footer>
|
|
|
|
<div>
|
2021-12-15 04:16:53 -08:00
|
|
|
<n8n-button v-if="submitted" @click="closeDialog" :label="$locale.baseText('personalizationModal.getStarted')" float="right" />
|
|
|
|
<n8n-button v-else @click="save" :loading="isSaving" :label="$locale.baseText('personalizationModal.continue')" float="right" />
|
2021-10-18 20:57:49 -07:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</Modal>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import mixins from "vue-typed-mixins";
|
|
|
|
|
|
|
|
import {
|
2021-12-03 04:19:23 -08:00
|
|
|
AUTOMATION_CONSULTING_INDUSTRY,
|
|
|
|
CODING_SKILL_KEY,
|
|
|
|
COMPANY_INDUSTRY_KEY,
|
|
|
|
COMPANY_SIZE_100_499,
|
|
|
|
COMPANY_SIZE_1000_OR_MORE,
|
|
|
|
COMPANY_SIZE_20_OR_LESS,
|
|
|
|
COMPANY_SIZE_20_99,
|
|
|
|
COMPANY_SIZE_500_999,
|
|
|
|
COMPANY_SIZE_KEY,
|
|
|
|
COMPANY_SIZE_PERSONAL_USE,
|
|
|
|
E_COMMERCE_INDUSTRY,
|
|
|
|
EXECUTIVE_WORK_AREA,
|
|
|
|
FINANCE_INDUSTRY,
|
2021-10-18 20:57:49 -07:00
|
|
|
FINANCE_WORK_AREA,
|
2021-12-03 04:19:23 -08:00
|
|
|
GOVERNMENT_INDUSTRY,
|
|
|
|
HEALTHCARE_INDUSTRY,
|
2021-10-18 20:57:49 -07:00
|
|
|
HR_WORK_AREA,
|
|
|
|
IT_ENGINEERING_WORK_AREA,
|
2021-12-03 04:19:23 -08:00
|
|
|
LEGAL_INDUSTRY,
|
2021-10-18 20:57:49 -07:00
|
|
|
LEGAL_WORK_AREA,
|
|
|
|
MARKETING_WORK_AREA,
|
2021-12-03 04:19:23 -08:00
|
|
|
NOT_APPLICABLE_WORK_AREA,
|
|
|
|
OPS_WORK_AREA,
|
|
|
|
OTHER_COMPANY_INDUSTRY_KEY,
|
|
|
|
OTHER_INDUSTRY_OPTION,
|
|
|
|
OTHER_WORK_AREA_KEY,
|
|
|
|
OTHER_WORK_AREA_OPTION,
|
|
|
|
PERSONALIZATION_MODAL_KEY,
|
2021-10-18 20:57:49 -07:00
|
|
|
PRODUCT_WORK_AREA,
|
2021-12-03 04:19:23 -08:00
|
|
|
SAAS_INDUSTRY,
|
2021-10-18 20:57:49 -07:00
|
|
|
SALES_BUSINESSDEV_WORK_AREA,
|
2021-12-03 04:19:23 -08:00
|
|
|
SECURITY_INDUSTRY,
|
2021-10-18 20:57:49 -07:00
|
|
|
SECURITY_WORK_AREA,
|
|
|
|
SUPPORT_WORK_AREA,
|
2021-12-03 04:19:23 -08:00
|
|
|
SYSTEM_INTEGRATION_INDUSTRY,
|
2021-10-18 20:57:49 -07:00
|
|
|
WORK_AREA_KEY,
|
|
|
|
} from "../constants";
|
|
|
|
import { workflowHelpers } from "@/components/mixins/workflowHelpers";
|
|
|
|
import { showMessage } from "@/components/mixins/showMessage";
|
|
|
|
import Modal from "./Modal.vue";
|
|
|
|
import { IPersonalizationSurveyAnswers, IPersonalizationSurveyKeys } from "@/Interface";
|
|
|
|
import Vue from "vue";
|
|
|
|
import { mapGetters } from "vuex";
|
|
|
|
|
2021-12-07 07:14:40 -08:00
|
|
|
export default mixins(showMessage, workflowHelpers).extend({
|
2021-10-18 20:57:49 -07:00
|
|
|
components: { Modal },
|
|
|
|
name: "PersonalizationModal",
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
submitted: false,
|
|
|
|
isSaving: false,
|
|
|
|
PERSONALIZATION_MODAL_KEY,
|
|
|
|
otherWorkAreaFieldVisible: false,
|
2021-12-03 04:19:23 -08:00
|
|
|
otherCompanyIndustryFieldVisible: false,
|
|
|
|
showAllIndustryQuestions: true,
|
2021-10-18 20:57:49 -07:00
|
|
|
modalBus: new Vue(),
|
|
|
|
values: {
|
2021-12-15 03:59:32 -08:00
|
|
|
[WORK_AREA_KEY]: [],
|
2021-10-18 20:57:49 -07:00
|
|
|
[COMPANY_SIZE_KEY]: null,
|
|
|
|
[CODING_SKILL_KEY]: null,
|
|
|
|
[OTHER_WORK_AREA_KEY]: null,
|
2021-12-15 03:59:32 -08:00
|
|
|
[COMPANY_INDUSTRY_KEY]: [],
|
2021-12-03 04:19:23 -08:00
|
|
|
[OTHER_COMPANY_INDUSTRY_KEY]: null,
|
2021-10-18 20:57:49 -07:00
|
|
|
} as IPersonalizationSurveyAnswers,
|
|
|
|
FINANCE_WORK_AREA,
|
|
|
|
HR_WORK_AREA,
|
|
|
|
IT_ENGINEERING_WORK_AREA,
|
|
|
|
LEGAL_WORK_AREA,
|
|
|
|
MARKETING_WORK_AREA,
|
|
|
|
PRODUCT_WORK_AREA,
|
|
|
|
SALES_BUSINESSDEV_WORK_AREA,
|
|
|
|
SECURITY_WORK_AREA,
|
2021-12-03 04:19:23 -08:00
|
|
|
EXECUTIVE_WORK_AREA,
|
2021-10-18 20:57:49 -07:00
|
|
|
SUPPORT_WORK_AREA,
|
|
|
|
OPS_WORK_AREA,
|
|
|
|
OTHER_WORK_AREA_OPTION,
|
2021-12-03 04:19:23 -08:00
|
|
|
NOT_APPLICABLE_WORK_AREA,
|
2021-10-18 20:57:49 -07:00
|
|
|
COMPANY_SIZE_20_OR_LESS,
|
|
|
|
COMPANY_SIZE_20_99,
|
|
|
|
COMPANY_SIZE_100_499,
|
|
|
|
COMPANY_SIZE_500_999,
|
|
|
|
COMPANY_SIZE_1000_OR_MORE,
|
|
|
|
COMPANY_SIZE_PERSONAL_USE,
|
2021-12-03 04:19:23 -08:00
|
|
|
E_COMMERCE_INDUSTRY,
|
|
|
|
AUTOMATION_CONSULTING_INDUSTRY,
|
|
|
|
SYSTEM_INTEGRATION_INDUSTRY,
|
|
|
|
GOVERNMENT_INDUSTRY,
|
|
|
|
LEGAL_INDUSTRY,
|
|
|
|
HEALTHCARE_INDUSTRY,
|
|
|
|
FINANCE_INDUSTRY,
|
|
|
|
SECURITY_INDUSTRY,
|
|
|
|
SAAS_INDUSTRY,
|
|
|
|
OTHER_INDUSTRY_OPTION,
|
2021-10-18 20:57:49 -07:00
|
|
|
WORK_AREA_KEY,
|
|
|
|
COMPANY_SIZE_KEY,
|
|
|
|
CODING_SKILL_KEY,
|
2021-12-03 04:19:23 -08:00
|
|
|
COMPANY_INDUSTRY_KEY,
|
2021-10-18 20:57:49 -07:00
|
|
|
OTHER_WORK_AREA_KEY,
|
2021-12-03 04:19:23 -08:00
|
|
|
OTHER_COMPANY_INDUSTRY_KEY,
|
2021-10-18 20:57:49 -07:00
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters({
|
|
|
|
baseUrl: 'getBaseUrl',
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
closeDialog() {
|
|
|
|
this.modalBus.$emit('close');
|
|
|
|
},
|
2021-12-15 03:59:32 -08:00
|
|
|
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;
|
2021-12-03 04:19:23 -08:00
|
|
|
}
|
2021-12-15 03:59:32 -08:00
|
|
|
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;
|
2021-12-03 04:19:23 -08:00
|
|
|
}
|
|
|
|
|
2021-10-18 20:57:49 -07:00
|
|
|
},
|
|
|
|
async save(): Promise<void> {
|
|
|
|
this.$data.isSaving = true;
|
|
|
|
|
|
|
|
try {
|
|
|
|
await this.$store.dispatch('settings/submitPersonalizationSurvey', this.values);
|
|
|
|
|
|
|
|
if (this.values[WORK_AREA_KEY] === null && this.values[COMPANY_SIZE_KEY] === null && this.values[CODING_SKILL_KEY] === null) {
|
|
|
|
this.closeDialog();
|
|
|
|
}
|
|
|
|
|
|
|
|
this.submitted = true;
|
|
|
|
} catch (e) {
|
2021-12-15 03:59:32 -08:00
|
|
|
this.$showError(e, 'Error while submitting results');
|
2021-10-18 20:57:49 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
this.$data.isSaving = false;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.container {
|
2021-12-03 04:19:23 -08:00
|
|
|
> div, section > div:not(:last-child) {
|
2021-10-18 20:57:49 -07:00
|
|
|
margin-bottom: var(--spacing-m);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.submittedContainer {
|
|
|
|
* {
|
|
|
|
margin-bottom: var(--spacing-2xs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.demoImage {
|
|
|
|
border-radius: var(--border-radius-large);
|
|
|
|
border: var(--border-base);
|
|
|
|
width: 100%;
|
|
|
|
height: 140px;
|
|
|
|
}
|
|
|
|
|
2021-12-03 04:19:23 -08:00
|
|
|
|
2021-10-18 20:57:49 -07:00
|
|
|
</style>
|