Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading