mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 05:17:28 -08:00
feat(editor): Add A/B testing feature flag for credential docs modal (#10664)
This commit is contained in:
parent
d74f2a6dec
commit
899b0a19ef
|
@ -13,7 +13,12 @@ import AuthTypeSelector from '@/components/CredentialEdit/AuthTypeSelector.vue';
|
||||||
import EnterpriseEdition from '@/components/EnterpriseEdition.ee.vue';
|
import EnterpriseEdition from '@/components/EnterpriseEdition.ee.vue';
|
||||||
import { useI18n } from '@/composables/useI18n';
|
import { useI18n } from '@/composables/useI18n';
|
||||||
import { useTelemetry } from '@/composables/useTelemetry';
|
import { useTelemetry } from '@/composables/useTelemetry';
|
||||||
import { BUILTIN_CREDENTIALS_DOCS_URL, DOCS_DOMAIN, EnterpriseEditionFeature } from '@/constants';
|
import {
|
||||||
|
BUILTIN_CREDENTIALS_DOCS_URL,
|
||||||
|
CREDENTIAL_DOCS_EXPERIMENT,
|
||||||
|
DOCS_DOMAIN,
|
||||||
|
EnterpriseEditionFeature,
|
||||||
|
} from '@/constants';
|
||||||
import type { PermissionsRecord } from '@/permissions';
|
import type { PermissionsRecord } from '@/permissions';
|
||||||
import { addCredentialTranslation } from '@/plugins/i18n';
|
import { addCredentialTranslation } from '@/plugins/i18n';
|
||||||
import { useCredentialsStore } from '@/stores/credentials.store';
|
import { useCredentialsStore } from '@/stores/credentials.store';
|
||||||
|
@ -28,6 +33,7 @@ import GoogleAuthButton from './GoogleAuthButton.vue';
|
||||||
import OauthButton from './OauthButton.vue';
|
import OauthButton from './OauthButton.vue';
|
||||||
import CredentialDocs from './CredentialDocs.vue';
|
import CredentialDocs from './CredentialDocs.vue';
|
||||||
import { CREDENTIAL_MARKDOWN_DOCS } from './docs';
|
import { CREDENTIAL_MARKDOWN_DOCS } from './docs';
|
||||||
|
import { usePostHog } from '@/stores/posthog.store';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
mode: string;
|
mode: string;
|
||||||
|
@ -162,6 +168,11 @@ const isMissingCredentials = computed(() => props.credentialType === null);
|
||||||
const isNewCredential = computed(() => props.mode === 'new' && !props.credentialId);
|
const isNewCredential = computed(() => props.mode === 'new' && !props.credentialId);
|
||||||
|
|
||||||
const docs = computed(() => CREDENTIAL_MARKDOWN_DOCS[props.credentialType.name]);
|
const docs = computed(() => CREDENTIAL_MARKDOWN_DOCS[props.credentialType.name]);
|
||||||
|
const showCredentialDocs = computed(
|
||||||
|
() =>
|
||||||
|
usePostHog().getVariant(CREDENTIAL_DOCS_EXPERIMENT.name) ===
|
||||||
|
CREDENTIAL_DOCS_EXPERIMENT.variant && docs.value,
|
||||||
|
);
|
||||||
|
|
||||||
function onDataChange(event: IUpdateInformation): void {
|
function onDataChange(event: IUpdateInformation): void {
|
||||||
emit('update', event);
|
emit('update', event);
|
||||||
|
@ -335,7 +346,7 @@ watch(showOAuthSuccessBanner, (newValue, oldValue) => {
|
||||||
</EnterpriseEdition>
|
</EnterpriseEdition>
|
||||||
</div>
|
</div>
|
||||||
<CredentialDocs
|
<CredentialDocs
|
||||||
v-if="docs"
|
v-if="showCredentialDocs"
|
||||||
:credential-type="credentialType"
|
:credential-type="credentialType"
|
||||||
:documentation-url="documentationUrl"
|
:documentation-url="documentationUrl"
|
||||||
:docs="docs"
|
:docs="docs"
|
||||||
|
|
|
@ -697,13 +697,18 @@ export const MORE_ONBOARDING_OPTIONS_EXPERIMENT = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const EXECUTION_ANNOTATION_EXPERIMENT = '023_execution_annotation';
|
export const EXECUTION_ANNOTATION_EXPERIMENT = '023_execution_annotation';
|
||||||
|
export const CREDENTIAL_DOCS_EXPERIMENT = {
|
||||||
|
name: '024_credential_docs',
|
||||||
|
control: 'control',
|
||||||
|
variant: 'variant',
|
||||||
|
};
|
||||||
export const EXPERIMENTS_TO_TRACK = [
|
export const EXPERIMENTS_TO_TRACK = [
|
||||||
ASK_AI_EXPERIMENT.name,
|
ASK_AI_EXPERIMENT.name,
|
||||||
TEMPLATE_CREDENTIAL_SETUP_EXPERIMENT,
|
TEMPLATE_CREDENTIAL_SETUP_EXPERIMENT,
|
||||||
CANVAS_AUTO_ADD_MANUAL_TRIGGER_EXPERIMENT.name,
|
CANVAS_AUTO_ADD_MANUAL_TRIGGER_EXPERIMENT.name,
|
||||||
AI_ASSISTANT_EXPERIMENT.name,
|
AI_ASSISTANT_EXPERIMENT.name,
|
||||||
MORE_ONBOARDING_OPTIONS_EXPERIMENT.name,
|
MORE_ONBOARDING_OPTIONS_EXPERIMENT.name,
|
||||||
|
CREDENTIAL_DOCS_EXPERIMENT.name,
|
||||||
];
|
];
|
||||||
|
|
||||||
export const MFA_FORM = {
|
export const MFA_FORM = {
|
||||||
|
|
Loading…
Reference in a new issue