feat: Redirect users without feature flag from template cred setup (no-changelog) (#8302)
This commit is contained in:
@@ -1308,6 +1308,18 @@ export default defineComponent({
|
||||
return;
|
||||
}
|
||||
|
||||
this.$telemetry.track(
|
||||
'User inserted workflow template',
|
||||
{
|
||||
source: 'workflow',
|
||||
template_id: templateId,
|
||||
wf_template_repo_session_id: this.templatesStore.previousSessionId,
|
||||
},
|
||||
{
|
||||
withPostHog: true,
|
||||
},
|
||||
);
|
||||
|
||||
this.blankRedirect = true;
|
||||
await this.$router.replace({ name: VIEWS.NEW_WORKFLOW, query: { templateId } });
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, watch } from 'vue';
|
||||
import { computed, onBeforeMount, onMounted, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useSetupTemplateStore } from './setupTemplate.store';
|
||||
import N8nHeading from 'n8n-design-system/components/N8nHeading';
|
||||
@@ -7,14 +7,14 @@ import N8nLink from 'n8n-design-system/components/N8nLink';
|
||||
import AppsRequiringCredsNotice from './AppsRequiringCredsNotice.vue';
|
||||
import SetupTemplateFormStep from './SetupTemplateFormStep.vue';
|
||||
import TemplatesView from '../TemplatesView.vue';
|
||||
import { VIEWS } from '@/constants';
|
||||
import { TEMPLATE_CREDENTIAL_SETUP_EXPERIMENT, VIEWS } from '@/constants';
|
||||
import { useI18n } from '@/composables/useI18n';
|
||||
import { useTelemetry } from '@/composables/useTelemetry';
|
||||
import { usePostHog } from '@/stores/posthog.store';
|
||||
|
||||
// Store
|
||||
const setupTemplateStore = useSetupTemplateStore();
|
||||
const i18n = useI18n();
|
||||
const telemetry = useTelemetry();
|
||||
const posthogStore = usePostHog();
|
||||
|
||||
// Router
|
||||
const route = useRoute();
|
||||
@@ -79,6 +79,15 @@ const skipIfTemplateHasNoCreds = async () => {
|
||||
|
||||
setupTemplateStore.setTemplateId(templateId.value);
|
||||
|
||||
onBeforeMount(async () => {
|
||||
if (!posthogStore.isFeatureEnabled(TEMPLATE_CREDENTIAL_SETUP_EXPERIMENT)) {
|
||||
void router.replace({
|
||||
name: VIEWS.TEMPLATE_IMPORT,
|
||||
params: { id: templateId.value },
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await setupTemplateStore.init();
|
||||
await skipIfTemplateHasNoCreds();
|
||||
|
||||
@@ -153,16 +153,6 @@ export const useSetupTemplateStore = defineStore('setupTemplate', () => {
|
||||
wf_template_repo_session_id: templatesStore.currentSessionId,
|
||||
});
|
||||
|
||||
telemetry.track(
|
||||
'User inserted workflow template',
|
||||
{
|
||||
source: 'workflow',
|
||||
template_id: templateId.value,
|
||||
wf_template_repo_session_id: templatesStore.currentSessionId,
|
||||
},
|
||||
{ withPostHog: true },
|
||||
);
|
||||
|
||||
telemetry.track('User closed cred setup', {
|
||||
completed: false,
|
||||
creds_filled: 0,
|
||||
|
||||
Reference in New Issue
Block a user