diff --git a/packages/editor-ui/src/components/JsEditor/JsEditor.vue b/packages/editor-ui/src/components/JsEditor/JsEditor.vue index 2c89c83e08..906a8476db 100644 --- a/packages/editor-ui/src/components/JsEditor/JsEditor.vue +++ b/packages/editor-ui/src/components/JsEditor/JsEditor.vue @@ -30,6 +30,7 @@ type Props = { isReadOnly?: boolean; fillParent?: boolean; rows?: number; + posthogCapture?: boolean; }; const props = withDefaults(defineProps(), { fillParent: false, isReadOnly: false, rows: 4 }); @@ -74,6 +75,10 @@ const jsEditorRef = ref(); const editor = ref(null); const editorState = ref(null); +const generatedCodeCapture = computed(() => { + return props.posthogCapture ? '' : 'ph-no-capture '; +}); + const extensions = computed(() => { const extensionsToApply: Extension[] = [ javascript(), @@ -119,7 +124,7 @@ const extensions = computed(() => { diff --git a/packages/editor-ui/src/components/ParameterInput.vue b/packages/editor-ui/src/components/ParameterInput.vue index 313f62fe33..2b71b523b3 100644 --- a/packages/editor-ui/src/components/ParameterInput.vue +++ b/packages/editor-ui/src/components/ParameterInput.vue @@ -40,6 +40,7 @@ import { hasExpressionMapping, isValueExpression } from '@/utils/nodeTypesUtils' import { isResourceLocatorValue } from '@/utils/typeGuards'; import { + AI_TRANSFORM_NODE_TYPE, APP_MODALS_ELEMENT_ID, CORE_NODES_CATEGORY, CUSTOM_API_CALL_KEY, @@ -541,6 +542,13 @@ const showDragnDropTip = computed( ndvStore.isInputParentOfActiveNode, ); +const shouldCaptureForPosthog = computed(() => { + if (node.value?.type) { + return [AI_TRANSFORM_NODE_TYPE].includes(node.value?.type); + } + return false; +}); + function isRemoteParameterOption(option: INodePropertyOptions) { return remoteParameterOptionsKeys.value.includes(option.name); } @@ -1124,6 +1132,7 @@ onUpdated(async () => { :model-value="modelValueString" :is-read-only="isReadOnly" :rows="editorRows" + :posthog-capture="shouldCaptureForPosthog" fill-parent @update:model-value="valueChangedDebounced" /> @@ -1223,6 +1232,7 @@ onUpdated(async () => { :model-value="modelValueString" :is-read-only="isReadOnly || editorIsReadOnly" :rows="editorRows" + :posthog-capture="shouldCaptureForPosthog" @update:model-value="valueChangedDebounced" >