refactor(editor): Remove user activation modal (no-changelog) (#6361)
* Remove user activation modal * remove export from index.ts * Update pnpm-lock.yaml --------- Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -71,7 +71,6 @@ const defaultSettings: IN8nUISettings = {
|
||||
variables: {
|
||||
limit: -1,
|
||||
},
|
||||
userActivationSurveyEnabled: false,
|
||||
deployment: {
|
||||
type: 'default',
|
||||
},
|
||||
|
||||
@@ -31,7 +31,6 @@ export const waitAllPromises = async () => new Promise((resolve) => setTimeout(r
|
||||
|
||||
export const SETTINGS_STORE_DEFAULT_STATE: ISettingsState = {
|
||||
settings: {
|
||||
userActivationSurveyEnabled: false,
|
||||
allowedModules: {},
|
||||
communityNodesEnabled: false,
|
||||
defaultLocale: '',
|
||||
|
||||
@@ -91,10 +91,6 @@
|
||||
<ImportCurlModal />
|
||||
</ModalRoot>
|
||||
|
||||
<ModalRoot :name="USER_ACTIVATION_SURVEY_MODAL">
|
||||
<WorkflowSuccessModal />
|
||||
</ModalRoot>
|
||||
|
||||
<ModalRoot :name="COMMUNITY_PACKAGE_CONFIRM_MODAL_KEY">
|
||||
<template #default="{ modalName, activeId, mode }">
|
||||
<CommunityPackageManageConfirmModal
|
||||
@@ -149,7 +145,6 @@ import {
|
||||
IMPORT_CURL_MODAL_KEY,
|
||||
LOG_STREAM_MODAL_KEY,
|
||||
ASK_AI_MODAL_KEY,
|
||||
USER_ACTIVATION_SURVEY_MODAL,
|
||||
VERSION_CONTROL_PUSH_MODAL_KEY,
|
||||
} from '@/constants';
|
||||
|
||||
@@ -175,7 +170,6 @@ import ExecutionsModal from './ExecutionsModal.vue';
|
||||
import ActivationModal from './ActivationModal.vue';
|
||||
import ImportCurlModal from './ImportCurlModal.vue';
|
||||
import WorkflowShareModal from './WorkflowShareModal.ee.vue';
|
||||
import WorkflowSuccessModal from './UserActivationSurveyModal.vue';
|
||||
import EventDestinationSettingsModal from '@/components/SettingsLogStreaming/EventDestinationSettingsModal.ee.vue';
|
||||
import VersionControlPushModal from '@/components/VersionControlPushModal.ee.vue';
|
||||
|
||||
@@ -205,7 +199,6 @@ export default defineComponent({
|
||||
WorkflowShareModal,
|
||||
ImportCurlModal,
|
||||
EventDestinationSettingsModal,
|
||||
WorkflowSuccessModal,
|
||||
VersionControlPushModal,
|
||||
},
|
||||
data: () => ({
|
||||
@@ -231,7 +224,6 @@ export default defineComponent({
|
||||
WORKFLOW_ACTIVE_MODAL_KEY,
|
||||
IMPORT_CURL_MODAL_KEY,
|
||||
LOG_STREAM_MODAL_KEY,
|
||||
USER_ACTIVATION_SURVEY_MODAL,
|
||||
VERSION_CONTROL_PUSH_MODAL_KEY,
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -1,181 +0,0 @@
|
||||
<template>
|
||||
<Modal
|
||||
width="500px"
|
||||
:title="locale.baseText('userActivationSurveyModal.title')"
|
||||
:eventBus="modalBus"
|
||||
:name="USER_ACTIVATION_SURVEY_MODAL"
|
||||
:center="true"
|
||||
:beforeClose="beforeClosingModal"
|
||||
>
|
||||
<template #content>
|
||||
<div :class="$style.container">
|
||||
<div :class="$style.description">
|
||||
<i18n path="userActivationSurveyModal.description.workflowRan">
|
||||
<template #workflow>
|
||||
<n8n-text :bold="true"> {{ workflowName }} </n8n-text>
|
||||
</template>
|
||||
<template #ranSuccessfully>
|
||||
<n8n-text>
|
||||
{{
|
||||
locale.baseText('userActivationSurveyModal.description.workflowRanSuccessfully')
|
||||
}}
|
||||
</n8n-text>
|
||||
</template>
|
||||
<template #savedTime>
|
||||
<n8n-text>
|
||||
{{ locale.baseText('userActivationSurveyModal.description.savedTime') }}
|
||||
</n8n-text>
|
||||
</template>
|
||||
</i18n>
|
||||
</div>
|
||||
<div :class="$style.form">
|
||||
<n8n-input-label
|
||||
:label="$locale.baseText('userActivationSurveyModal.form.label')"
|
||||
color="text-dark"
|
||||
>
|
||||
<n8n-input
|
||||
type="textarea"
|
||||
:maxlength="FEEDBACK_MAX_LENGTH"
|
||||
:rows="3"
|
||||
v-model="feedback"
|
||||
@input="onInput"
|
||||
data-test-id="activation-feedback-input"
|
||||
/>
|
||||
</n8n-input-label>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #footer>
|
||||
<div :class="$style.modalFooter">
|
||||
<n8n-button
|
||||
size="large"
|
||||
type="secondary"
|
||||
data-test-id="skip-button"
|
||||
:label="locale.baseText('userActivationSurveyModal.form.button.skip')"
|
||||
@click="onSkip"
|
||||
/>
|
||||
<n8n-button
|
||||
:disabled="!hasAnyChanges"
|
||||
@click="onShareFeedback"
|
||||
size="large"
|
||||
float="right"
|
||||
:label="locale.baseText('userActivationSurveyModal.form.button.shareFeedback')"
|
||||
data-test-id="send-activation-feedback-button"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</Modal>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import Modal from '@/components/Modal.vue';
|
||||
import { USER_ACTIVATION_SURVEY_MODAL } from '@/constants';
|
||||
import { useUsersStore } from '@/stores/users.store';
|
||||
|
||||
import confetti from 'canvas-confetti';
|
||||
import { telemetry } from '@/plugins/telemetry';
|
||||
import { i18n as locale } from '@/plugins/i18n';
|
||||
import { Notification } from 'element-ui';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { createEventBus } from 'n8n-design-system';
|
||||
|
||||
const FEEDBACK_MAX_LENGTH = 300;
|
||||
|
||||
const userStore = useUsersStore();
|
||||
const workflowStore = useWorkflowsStore();
|
||||
|
||||
const hasAnyChanges = ref(false);
|
||||
const feedback = ref('');
|
||||
const modalBus = createEventBus();
|
||||
const workflowName = ref('');
|
||||
|
||||
onMounted(async () => {
|
||||
const currentSettings = getCurrentSettings();
|
||||
try {
|
||||
const { name } = await workflowStore.fetchWorkflow(
|
||||
currentSettings?.firstSuccessfulWorkflowId ?? '',
|
||||
);
|
||||
workflowName.value = name;
|
||||
setTimeout(showConfetti, 500);
|
||||
} catch (e) {}
|
||||
});
|
||||
|
||||
const onShareFeedback = () => {
|
||||
telemetry.track('User responded to activation modal', { response: getFeedback() });
|
||||
showSharedFeedbackSuccess();
|
||||
modalBus.emit('close');
|
||||
};
|
||||
|
||||
const onSkip = () => {
|
||||
modalBus.emit('close');
|
||||
};
|
||||
|
||||
const getCurrentSettings = () => {
|
||||
return userStore.currentUser?.settings;
|
||||
};
|
||||
|
||||
const getFeedback = () => {
|
||||
return feedback.value.slice(0, FEEDBACK_MAX_LENGTH);
|
||||
};
|
||||
|
||||
const beforeClosingModal = async () => {
|
||||
const currentUser = userStore.currentUser;
|
||||
if (currentUser) {
|
||||
try {
|
||||
await userStore.updateUserSettings({ showUserActivationSurvey: false });
|
||||
} catch {
|
||||
showSharedFeedbackError();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
const onInput = () => {
|
||||
hasAnyChanges.value = true;
|
||||
};
|
||||
|
||||
const showSharedFeedbackSuccess = () => {
|
||||
Notification.success({
|
||||
title: locale.baseText('userActivationSurveyModal.sharedFeedback.success'),
|
||||
message: '',
|
||||
position: 'bottom-right',
|
||||
});
|
||||
};
|
||||
|
||||
const showSharedFeedbackError = () => {
|
||||
Notification.error({
|
||||
title: locale.baseText('userActivationSurveyModal.sharedFeedback.error'),
|
||||
message: '',
|
||||
position: 'bottom-right',
|
||||
});
|
||||
};
|
||||
|
||||
const showConfetti = () => {
|
||||
void confetti({
|
||||
particleCount: 200,
|
||||
spread: 100,
|
||||
origin: { y: 0.6 },
|
||||
zIndex: 2050,
|
||||
colors: ['5C4EC2', 'D7E6F1', 'FF9284', '8D7FED', 'B8AFF9', 'FF6D5A'],
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style module lang="scss">
|
||||
.form {
|
||||
margin-top: var(--spacing-l);
|
||||
}
|
||||
|
||||
.description > * {
|
||||
font-size: var(--font-size-s);
|
||||
}
|
||||
|
||||
.container > * {
|
||||
margin-bottom: var(--spacing-s);
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -47,7 +47,6 @@ export const COMMUNITY_PACKAGE_INSTALL_MODAL_KEY = 'communityPackageInstall';
|
||||
export const COMMUNITY_PACKAGE_CONFIRM_MODAL_KEY = 'communityPackageManageConfirm';
|
||||
export const IMPORT_CURL_MODAL_KEY = 'importCurl';
|
||||
export const LOG_STREAM_MODAL_KEY = 'settingsLogStream';
|
||||
export const USER_ACTIVATION_SURVEY_MODAL = 'userActivationSurvey';
|
||||
|
||||
export const VERSION_CONTROL_PUSH_MODAL_KEY = 'versionControlPush';
|
||||
|
||||
|
||||
@@ -23,8 +23,7 @@ import { I18nPlugin, i18nInstance } from './plugins/i18n';
|
||||
|
||||
import { createPinia, PiniaVuePlugin } from 'pinia';
|
||||
|
||||
import { useWebhooksStore, useUsersStore } from '@/stores';
|
||||
import { VIEWS } from '@/constants';
|
||||
import { useWebhooksStore } from '@/stores';
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
@@ -43,10 +42,6 @@ new Vue({
|
||||
|
||||
router.afterEach((to, from) => {
|
||||
void runExternalHook('main.routeChange', useWebhooksStore(), { from, to });
|
||||
const userStore = useUsersStore();
|
||||
if (userStore.currentUser && to.name && to.name !== VIEWS.SIGNOUT && !to.name.includes('Modal')) {
|
||||
void userStore.showUserActivationSurveyModal();
|
||||
}
|
||||
});
|
||||
|
||||
if (!import.meta.env.PROD) {
|
||||
|
||||
@@ -1906,15 +1906,6 @@
|
||||
"settings.sso.actionBox.title": "Available on Enterprise plan",
|
||||
"settings.sso.actionBox.description": "Use Single Sign On to consolidate authentication into a single platform to improve security and agility.",
|
||||
"settings.sso.actionBox.buttonText": "See plans",
|
||||
"userActivationSurveyModal.title": "Congrats! Your workflow ran automatically 👏",
|
||||
"userActivationSurveyModal.description.workflowRan": "{workflow} {ranSuccessfully} {savedTime}",
|
||||
"userActivationSurveyModal.description.workflowRanSuccessfully": "ran successfully",
|
||||
"userActivationSurveyModal.description.savedTime": "for the first time. Looks like n8n just saved you some time! Can you help us make n8n even better and answer the following question?",
|
||||
"userActivationSurveyModal.form.label": "What almost stopped you from creating this workflow?",
|
||||
"userActivationSurveyModal.form.button.shareFeedback": "Share feedback",
|
||||
"userActivationSurveyModal.form.button.skip": "Skip",
|
||||
"userActivationSurveyModal.sharedFeedback.success": "Thanks for your feedback",
|
||||
"userActivationSurveyModal.sharedFeedback.error": "Problem sharing feedback, try again",
|
||||
"sso.login.divider": "or",
|
||||
"sso.login.button": "Continue with SSO",
|
||||
"executionUsage.currentUsage": "{text} {count}",
|
||||
|
||||
@@ -127,13 +127,6 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, {
|
||||
this.settings.personalizationSurveyEnabled
|
||||
);
|
||||
},
|
||||
isUserActivationSurveyEnabled(): boolean {
|
||||
return (
|
||||
this.settings.telemetry &&
|
||||
this.settings.telemetry.enabled &&
|
||||
this.settings.userActivationSurveyEnabled
|
||||
);
|
||||
},
|
||||
telemetry(): ITelemetrySettings {
|
||||
return this.settings.telemetry;
|
||||
},
|
||||
|
||||
@@ -30,7 +30,6 @@ import {
|
||||
WORKFLOW_ACTIVE_MODAL_KEY,
|
||||
WORKFLOW_SETTINGS_MODAL_KEY,
|
||||
WORKFLOW_SHARE_MODAL_KEY,
|
||||
USER_ACTIVATION_SURVEY_MODAL,
|
||||
VERSION_CONTROL_PUSH_MODAL_KEY,
|
||||
} from '@/constants';
|
||||
import type {
|
||||
@@ -135,9 +134,6 @@ export const useUIStore = defineStore(STORES.UI, {
|
||||
activeId: null,
|
||||
showAuthSelector: false,
|
||||
},
|
||||
[USER_ACTIVATION_SURVEY_MODAL]: {
|
||||
open: false,
|
||||
},
|
||||
[VERSION_CONTROL_PUSH_MODAL_KEY]: {
|
||||
open: false,
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
validatePasswordToken,
|
||||
validateSignupToken,
|
||||
} from '@/api/users';
|
||||
import { PERSONALIZATION_MODAL_KEY, USER_ACTIVATION_SURVEY_MODAL, STORES } from '@/constants';
|
||||
import { PERSONALIZATION_MODAL_KEY, STORES } from '@/constants';
|
||||
import type {
|
||||
ICredentialsResponse,
|
||||
IInviteResponse,
|
||||
@@ -321,16 +321,6 @@ export const useUsersStore = defineStore(STORES.USERS, {
|
||||
uiStore.openModal(PERSONALIZATION_MODAL_KEY);
|
||||
}
|
||||
},
|
||||
async showUserActivationSurveyModal() {
|
||||
const settingsStore = useSettingsStore();
|
||||
if (settingsStore.isUserActivationSurveyEnabled) {
|
||||
const currentUser = this.currentUser;
|
||||
if (currentUser?.settings?.showUserActivationSurvey) {
|
||||
const uiStore = useUIStore();
|
||||
uiStore.openModal(USER_ACTIVATION_SURVEY_MODAL);
|
||||
}
|
||||
}
|
||||
},
|
||||
async skipOwnerSetup(): Promise<void> {
|
||||
try {
|
||||
const rootStore = useRootStore();
|
||||
|
||||
Reference in New Issue
Block a user