From 795f0be80e87b98dffca52ed208e2dfc214a1487 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Tue, 7 Oct 2025 17:40:01 +0530 Subject: [PATCH] chore: fix ui and add "Get Help" button (#27) * chore: fix ui and add "Get Help" button * fix: fix instrumentation client --- ui/sentry.edge.config.ts | 3 +- ui/sentry.server.config.ts | 3 +- ui/src/app/automation/page.tsx | 14 +++---- ui/src/app/campaigns/[campaignId]/page.tsx | 44 ++++++++++------------ ui/src/app/campaigns/new/page.tsx | 30 +++++++-------- ui/src/app/campaigns/page.tsx | 14 +++---- ui/src/app/superadmin/page.tsx | 14 +++---- ui/src/app/superadmin/runs/page.tsx | 16 ++++---- ui/src/app/usage/page.tsx | 16 ++++---- ui/src/components/header/BaseHeader.tsx | 31 ++++++++++----- ui/src/instrumentation-client.ts | 16 ++------ 11 files changed, 92 insertions(+), 109 deletions(-) diff --git a/ui/sentry.edge.config.ts b/ui/sentry.edge.config.ts index da0fc30..f49a964 100644 --- a/ui/sentry.edge.config.ts +++ b/ui/sentry.edge.config.ts @@ -6,8 +6,7 @@ import * as Sentry from "@sentry/nextjs"; // Only initialize Sentry if explicitly enabled and DSN is provided -const enableSentry = process.env.NEXT_PUBLIC_ENABLE_SENTRY === 'true' && - process.env.NEXT_PUBLIC_SENTRY_DSN; +const enableSentry = process.env.NEXT_PUBLIC_SENTRY_DSN; if (enableSentry) { Sentry.init({ diff --git a/ui/sentry.server.config.ts b/ui/sentry.server.config.ts index 6f4723d..11283fd 100644 --- a/ui/sentry.server.config.ts +++ b/ui/sentry.server.config.ts @@ -5,8 +5,7 @@ import * as Sentry from "@sentry/nextjs"; // Only initialize Sentry if explicitly enabled and DSN is provided -const enableSentry = process.env.NEXT_PUBLIC_ENABLE_SENTRY === 'true' && - process.env.NEXT_PUBLIC_SENTRY_DSN; +const enableSentry = process.env.NEXT_PUBLIC_SENTRY_DSN; if (enableSentry) { Sentry.init({ diff --git a/ui/src/app/automation/page.tsx b/ui/src/app/automation/page.tsx index cf97400..c87c60c 100644 --- a/ui/src/app/automation/page.tsx +++ b/ui/src/app/automation/page.tsx @@ -4,14 +4,13 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/com export default function AutomationPage() { return ( -
-
-
-

Automation

-

Automate your workflows and processes

-
+
+
+

Automation

+

Automate your workflows and processes

+
- + Coming Soon @@ -29,7 +28,6 @@ export default function AutomationPage() {
-
); } diff --git a/ui/src/app/campaigns/[campaignId]/page.tsx b/ui/src/app/campaigns/[campaignId]/page.tsx index 3cbd6e8..2763946 100644 --- a/ui/src/app/campaigns/[campaignId]/page.tsx +++ b/ui/src/app/campaigns/[campaignId]/page.tsx @@ -284,12 +284,10 @@ export default function CampaignDetailPage() { if (isLoadingCampaign) { return ( -
-
-
-
-
-
+
+
+
+
); @@ -297,29 +295,26 @@ export default function CampaignDetailPage() { if (!campaign) { return ( -
-
-

Campaign not found

-
+
+

Campaign not found

); } return ( -
-
-
- -
-
-

{campaign.name}

+
+
+ +
+
+

{campaign.name}

{campaign.state} @@ -457,7 +452,6 @@ export default function CampaignDetailPage() { )} -
); } diff --git a/ui/src/app/campaigns/new/page.tsx b/ui/src/app/campaigns/new/page.tsx index 07c18e4..5608450 100644 --- a/ui/src/app/campaigns/new/page.tsx +++ b/ui/src/app/campaigns/new/page.tsx @@ -121,22 +121,21 @@ export default function NewCampaignPage() { }; return ( -
-
-
- -

Create New Campaign

-

Set up a new campaign to execute workflows at scale

-
+
+
+ +

Create New Campaign

+

Set up a new campaign to execute workflows at scale

+
- + Campaign Details @@ -221,7 +220,6 @@ export default function NewCampaignPage() { -
); } diff --git a/ui/src/app/campaigns/page.tsx b/ui/src/app/campaigns/page.tsx index 00f48c4..ff69d12 100644 --- a/ui/src/app/campaigns/page.tsx +++ b/ui/src/app/campaigns/page.tsx @@ -97,13 +97,12 @@ export default function CampaignsPage() { }; return ( -
-
-
-
-

Campaigns

-

Manage your bulk workflow execution campaigns

-
+
+
+
+

Campaigns

+

Manage your bulk workflow execution campaigns

+
); } diff --git a/ui/src/app/superadmin/page.tsx b/ui/src/app/superadmin/page.tsx index b248ffb..dff2a22 100644 --- a/ui/src/app/superadmin/page.tsx +++ b/ui/src/app/superadmin/page.tsx @@ -49,14 +49,13 @@ export default function SuperadminPage() { return ( <> -
-
-
-

Superadmin Dashboard

-

Manage users and view system-wide data

-
+
+
+

Superadmin Dashboard

+

Manage users and view system-wide data

+
-
+
{/* User Impersonation Card */} @@ -126,7 +125,6 @@ export default function SuperadminPage() {
-
diff --git a/ui/src/app/superadmin/runs/page.tsx b/ui/src/app/superadmin/runs/page.tsx index 84273bd..02e66d5 100644 --- a/ui/src/app/superadmin/runs/page.tsx +++ b/ui/src/app/superadmin/runs/page.tsx @@ -316,7 +316,7 @@ export default function RunsPage() { if (isLoading && runs.length === 0) { return ( -
+
Loading workflow runs... @@ -326,14 +326,13 @@ export default function RunsPage() { } return ( -
-
-
-

Workflow Runs

-

View and manage all workflow runs across organizations

-
+
+
+

Workflow Runs

+

View and manage all workflow runs across organizations

+
- {error && ( + {error && (
{error}
@@ -671,7 +670,6 @@ export default function RunsPage() { {/* Media Preview Dialog */} {mediaPreview.dialog} -
); } diff --git a/ui/src/app/usage/page.tsx b/ui/src/app/usage/page.tsx index 5fb45cd..23f71d1 100644 --- a/ui/src/app/usage/page.tsx +++ b/ui/src/app/usage/page.tsx @@ -309,14 +309,13 @@ export default function UsagePage() { }; return ( -
-
-
-
-
-

Usage Dashboard

-

Monitor your Dograh Token usage and quota

-
+
+
+
+
+

Usage Dashboard

+

Monitor your Dograh Token usage and quota

+
@@ -569,7 +568,6 @@ export default function UsagePage() { {/* Media Preview Dialog */} {mediaPreview.dialog} -
); } diff --git a/ui/src/components/header/BaseHeader.tsx b/ui/src/components/header/BaseHeader.tsx index 26a2575..e0b7502 100644 --- a/ui/src/components/header/BaseHeader.tsx +++ b/ui/src/components/header/BaseHeader.tsx @@ -1,6 +1,6 @@ "use client"; -import { CircleDollarSign, Star } from 'lucide-react'; +import { CircleDollarSign, HelpCircle,Star } from 'lucide-react'; import Link from 'next/link'; import { usePathname, useRouter } from 'next/navigation'; import React from 'react'; @@ -133,15 +133,26 @@ export default function BaseHeader({ headerActions, backButton, showFeaturesNav /> ) : ( - - - Star us on GitHub - + <> + + + Get Help + + + + Star us on GitHub + + )}
diff --git a/ui/src/instrumentation-client.ts b/ui/src/instrumentation-client.ts index 3cae7ec..93d4349 100644 --- a/ui/src/instrumentation-client.ts +++ b/ui/src/instrumentation-client.ts @@ -7,18 +7,14 @@ import posthog from "posthog-js"; // Initialize Sentry - prioritize NEXT_PUBLIC env vars, fallback to API const initSentry = () => { - const hasPublicConfig = process.env.NEXT_PUBLIC_ENABLE_SENTRY === 'true' && - process.env.NEXT_PUBLIC_SENTRY_DSN; + const hasPublicConfig = process.env.NEXT_PUBLIC_SENTRY_DSN; + if (hasPublicConfig) { // Use client-side environment variables Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, - integrations: [Sentry.replayIntegration()], - replaysSessionSampleRate: 0.1, - replaysOnErrorSampleRate: 1.0, debug: false, - enabled: process.env.NEXT_PUBLIC_NODE_ENV === 'production' }); console.log('Sentry initialized from NEXT_PUBLIC config'); } else { @@ -29,11 +25,7 @@ const initSentry = () => { if (config.enabled && config.dsn) { Sentry.init({ dsn: config.dsn, - integrations: [Sentry.replayIntegration()], - replaysSessionSampleRate: 0.1, - replaysOnErrorSampleRate: 1.0, debug: false, - enabled: config.environment === 'production' }); console.log('Sentry initialized from API config'); } else { @@ -50,8 +42,8 @@ initSentry(); // Initialize PostHog - prioritize NEXT_PUBLIC env vars, fallback to API const initPostHog = () => { - const hasPublicConfig = process.env.NEXT_PUBLIC_ENABLE_POSTHOG === 'true' && - process.env.NEXT_PUBLIC_POSTHOG_KEY; + const hasPublicConfig = process.env.NEXT_PUBLIC_POSTHOG_KEY; + if (hasPublicConfig) { // Use client-side environment variables