feat(editor): Add A/B testing feature flag for credential docs modal (#10664)

This commit is contained in:
Shireen Missi 2024-09-05 09:48:46 +01:00 committed by GitHub
parent d74f2a6dec
commit 899b0a19ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 3 deletions

View file

@ -13,7 +13,12 @@ import AuthTypeSelector from '@/components/CredentialEdit/AuthTypeSelector.vue';
import EnterpriseEdition from '@/components/EnterpriseEdition.ee.vue';
import { useI18n } from '@/composables/useI18n';
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 { addCredentialTranslation } from '@/plugins/i18n';
import { useCredentialsStore } from '@/stores/credentials.store';
@ -28,6 +33,7 @@ import GoogleAuthButton from './GoogleAuthButton.vue';
import OauthButton from './OauthButton.vue';
import CredentialDocs from './CredentialDocs.vue';
import { CREDENTIAL_MARKDOWN_DOCS } from './docs';
import { usePostHog } from '@/stores/posthog.store';
type Props = {
mode: string;
@ -162,6 +168,11 @@ const isMissingCredentials = computed(() => props.credentialType === null);
const isNewCredential = computed(() => props.mode === 'new' && !props.credentialId);
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 {
emit('update', event);
@ -335,7 +346,7 @@ watch(showOAuthSuccessBanner, (newValue, oldValue) => {
</EnterpriseEdition>
</div>
<CredentialDocs
v-if="docs"
v-if="showCredentialDocs"
:credential-type="credentialType"
:documentation-url="documentationUrl"
:docs="docs"

View file

@ -697,13 +697,18 @@ export const MORE_ONBOARDING_OPTIONS_EXPERIMENT = {
};
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 = [
ASK_AI_EXPERIMENT.name,
TEMPLATE_CREDENTIAL_SETUP_EXPERIMENT,
CANVAS_AUTO_ADD_MANUAL_TRIGGER_EXPERIMENT.name,
AI_ASSISTANT_EXPERIMENT.name,
MORE_ONBOARDING_OPTIONS_EXPERIMENT.name,
CREDENTIAL_DOCS_EXPERIMENT.name,
];
export const MFA_FORM = {