feat: Update NPS Value Survey (#9638)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
Co-authored-by: Tomi Turtiainen <10324676+tomi@users.noreply.github.com>
This commit is contained in:
Mutasem Aldmour
2024-06-11 10:23:30 +02:00
committed by GitHub
parent aaa78435b0
commit 50bd5b9080
58 changed files with 1416 additions and 497 deletions

View File

@@ -33,20 +33,27 @@
</template>
<script lang="ts">
import type { PropType } from 'vue';
import { defineComponent } from 'vue';
import { mapStores } from 'pinia';
import type { IN8nPromptResponse } from '@/Interface';
import type { IN8nPromptResponse, ModalKey } from '@/Interface';
import { VALID_EMAIL_REGEX } from '@/constants';
import Modal from '@/components/Modal.vue';
import { useSettingsStore } from '@/stores/settings.store';
import { useRootStore } from '@/stores/n8nRoot.store';
import { createEventBus } from 'n8n-design-system/utils';
import { useToast } from '@/composables/useToast';
import { useNpsSurveyStore } from '@/stores/npsSurvey.store';
export default defineComponent({
name: 'ContactPromptModal',
components: { Modal },
props: ['modalName'],
props: {
modalName: {
type: String as PropType<ModalKey>,
required: true,
},
},
setup() {
return {
...useToast(),
@@ -59,17 +66,17 @@ export default defineComponent({
};
},
computed: {
...mapStores(useRootStore, useSettingsStore),
...mapStores(useRootStore, useSettingsStore, useNpsSurveyStore),
title(): string {
if (this.settingsStore.promptsData && this.settingsStore.promptsData.title) {
return this.settingsStore.promptsData.title;
if (this.npsSurveyStore.promptsData?.title) {
return this.npsSurveyStore.promptsData.title;
}
return 'Youre a power user 💪';
},
description(): string {
if (this.settingsStore.promptsData && this.settingsStore.promptsData.message) {
return this.settingsStore.promptsData.message;
if (this.npsSurveyStore.promptsData?.message) {
return this.npsSurveyStore.promptsData.message;
}
return 'Your experience with n8n can help us improve — for you and our entire community.';