feat(editor): Show template credential setup based on feature flag (#7989)
Replace the local storage based feature flag with posthog feature flag. Also: - Fix bunch of eslint warnings in posthog store
This commit is contained in:
@@ -66,10 +66,9 @@ import type {
|
||||
} from '@/Interface';
|
||||
|
||||
import { setPageTitle } from '@/utils/htmlUtils';
|
||||
import { VIEWS } from '@/constants';
|
||||
import { TEMPLATE_CREDENTIAL_SETUP_EXPERIMENT, VIEWS } from '@/constants';
|
||||
import { useTemplatesStore } from '@/stores/templates.store';
|
||||
import { usePostHog } from '@/stores/posthog.store';
|
||||
import { FeatureFlag, isFeatureFlagEnabled } from '@/utils/featureFlag';
|
||||
import { openTemplateCredentialSetup } from '@/utils/templates/templateActions';
|
||||
import { useExternalHooks } from '@/composables/useExternalHooks';
|
||||
|
||||
@@ -129,7 +128,7 @@ export default defineComponent({
|
||||
this.navigateTo(event, VIEWS.TEMPLATE, id);
|
||||
},
|
||||
async onUseWorkflow({ event, id }: { event: MouseEvent; id: string }) {
|
||||
if (!isFeatureFlagEnabled(FeatureFlag.templateCredentialsSetup)) {
|
||||
if (this.posthogStore.isFeatureEnabled(TEMPLATE_CREDENTIAL_SETUP_EXPERIMENT)) {
|
||||
const telemetryPayload = {
|
||||
template_id: id,
|
||||
wf_template_repo_session_id: this.templatesStore.currentSessionId,
|
||||
@@ -142,6 +141,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
await openTemplateCredentialSetup({
|
||||
posthogStore: this.posthogStore,
|
||||
router: this.$router,
|
||||
templateId: id,
|
||||
inNewBrowserTab: event.metaKey || event.ctrlKey,
|
||||
|
||||
@@ -69,8 +69,8 @@ import { setPageTitle } from '@/utils/htmlUtils';
|
||||
import { useTemplatesStore } from '@/stores/templates.store';
|
||||
import { usePostHog } from '@/stores/posthog.store';
|
||||
import { openTemplateCredentialSetup } from '@/utils/templates/templateActions';
|
||||
import { FeatureFlag, isFeatureFlagEnabled } from '@/utils/featureFlag';
|
||||
import { useExternalHooks } from '@/composables/useExternalHooks';
|
||||
import { TEMPLATE_CREDENTIAL_SETUP_EXPERIMENT } from '@/constants';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'TemplatesWorkflowView',
|
||||
@@ -107,7 +107,7 @@ export default defineComponent({
|
||||
},
|
||||
methods: {
|
||||
async openTemplateSetup(id: string, e: PointerEvent) {
|
||||
if (!isFeatureFlagEnabled(FeatureFlag.templateCredentialsSetup)) {
|
||||
if (!this.posthogStore.isFeatureEnabled(TEMPLATE_CREDENTIAL_SETUP_EXPERIMENT)) {
|
||||
const telemetryPayload = {
|
||||
source: 'workflow',
|
||||
template_id: id,
|
||||
@@ -121,6 +121,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
await openTemplateCredentialSetup({
|
||||
posthogStore: this.posthogStore,
|
||||
router: this.$router,
|
||||
templateId: id,
|
||||
inNewBrowserTab: e.metaKey || e.ctrlKey,
|
||||
|
||||
Reference in New Issue
Block a user