Skip to content

Commit

Permalink
add A/B testing feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ShireenMissi committed Sep 4, 2024
1 parent 35e6a87 commit 4035c44
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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"
Expand Down
7 changes: 6 additions & 1 deletion packages/editor-ui/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,13 +694,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 = {
Expand Down

0 comments on commit 4035c44

Please sign in to comment.