From c7e4c3d8391abebe07030d0dd4776eb9a507fe07 Mon Sep 17 00:00:00 2001 From: Amit Sharma Date: Wed, 30 Jul 2025 16:02:30 -0700 Subject: [PATCH] fix: resolved linting and prettier issues for formating --- ui/components/auth/oss/auth-form.tsx | 6 +++++- .../workflow/forms/test-connection-form.tsx | 2 +- ui/lib/analytics.ts | 14 +++++++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ui/components/auth/oss/auth-form.tsx b/ui/components/auth/oss/auth-form.tsx index 25791f6cbf..32f2746190 100644 --- a/ui/components/auth/oss/auth-form.tsx +++ b/ui/components/auth/oss/auth-form.tsx @@ -21,7 +21,11 @@ import { FormField, FormMessage, } from "@/components/ui/form"; -import { initializeSession, trackUserLogin, trackUserRegistration } from "@/lib/analytics"; +import { + initializeSession, + trackUserLogin, + trackUserRegistration, +} from "@/lib/analytics"; import { ApiError, authFormSchema } from "@/types"; export const AuthForm = ({ diff --git a/ui/components/providers/workflow/forms/test-connection-form.tsx b/ui/components/providers/workflow/forms/test-connection-form.tsx index b0d6f8f532..fbb0ca68fd 100644 --- a/ui/components/providers/workflow/forms/test-connection-form.tsx +++ b/ui/components/providers/workflow/forms/test-connection-form.tsx @@ -17,9 +17,9 @@ import { scanOnDemand, scheduleDaily } from "@/actions/scans"; import { getTask } from "@/actions/task/tasks"; import { CheckIcon, RocketIcon } from "@/components/icons"; import { useToast } from "@/components/ui"; -import { trackCloudConnectionSuccess } from "@/lib/analytics"; import { CustomButton } from "@/components/ui/custom"; import { Form } from "@/components/ui/form"; +import { trackCloudConnectionSuccess } from "@/lib/analytics"; import { checkTaskStatus } from "@/lib/helper"; import { ProviderType } from "@/types"; import { ApiError, testConnectionFormSchema } from "@/types"; diff --git a/ui/lib/analytics.ts b/ui/lib/analytics.ts index 30727c5904..32397b8739 100644 --- a/ui/lib/analytics.ts +++ b/ui/lib/analytics.ts @@ -101,7 +101,10 @@ export const trackCloudConnectionSuccess = ({ }; // Generic event tracking function for custom events -export const trackEvent = (eventName: string, properties?: Record): void => { +export const trackEvent = ( + eventName: string, + properties?: Record, +): void => { try { posthog.capture(eventName, { ...properties, @@ -113,7 +116,10 @@ export const trackEvent = (eventName: string, properties?: Record): }; // Track page view -export const trackPageView = (pageName: string, properties?: Record): void => { +export const trackPageView = ( + pageName: string, + properties?: Record, +): void => { try { posthog.capture("$pageview", { $current_url: window.location.href, @@ -137,7 +143,9 @@ export const setUserProperties = (properties: Record): void => { // Check if PostHog is initialized and ready export const isAnalyticsReady = (): boolean => { try { - return typeof posthog !== "undefined" && posthog._isIdentified !== undefined; + return ( + typeof posthog !== "undefined" && posthog._isIdentified !== undefined + ); } catch { return false; }