Skip to content

Commit

Permalink
fix: integration
Browse files Browse the repository at this point in the history
  • Loading branch information
scopsy committed Dec 9, 2024
1 parent ad52c52 commit 506679c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import { ActivityPanel } from '@/components/activity/activity-panel';
import { useActivities } from '@/hooks/use-activities';
import { useEffect, useState } from 'react';
import { JobStatusEnum } from '@novu/shared';
import { Loader2 } from 'lucide-react';

interface TestWorkflowLogsSidebarProps {
transactionId?: string;
}

export const TestWorkflowLogsSidebar = ({ transactionId }: TestWorkflowLogsSidebarProps) => {
const [shouldRefetch, setShouldRefetch] = useState(true);
const { activities, isLoading } = useActivities(
const { activities } = useActivities(
{
filters: transactionId ? { transactionId } : undefined,
},
Expand Down Expand Up @@ -39,9 +40,12 @@ export const TestWorkflowLogsSidebar = ({ transactionId }: TestWorkflowLogsSideb

return (
<aside className="flex h-full w-[500px] flex-col border-l">
{isLoading ? (
{transactionId && !activityId ? (
<div className="flex h-full items-center justify-center">
<div className="text-foreground-600 text-sm">Loading activity...</div>
<div className="flex flex-col items-center gap-4">
<Loader2 className="size-8 animate-spin text-neutral-500" />
<div className="text-foreground-600 text-sm">Waiting for activity...</div>
</div>
</div>
) : activityId ? (
<ActivityPanel activityId={activityId} onActivitySelect={() => {}} headerClassName="h-[49px]" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,6 @@ export const TestWorkflowTabs = ({ testData }: { testData: WorkflowTestDataRespo
});
}
setTransactionId(newTransactionId);
return showToast({
variant: 'lg',
children: ({ close }) => (
<>
<ToastIcon variant="success" />
<div className="flex flex-col gap-2">
<span className="font-medium">Test workflow succeeded</span>
<span className="text-foreground-600 inline">
Workflow <span className="font-bold">{workflow?.name}</span> was triggered successfully.
</span>
<Link
to={`${LEGACY_ROUTES.ACTIVITY_FEED}?transactionId=${newTransactionId}`}
reloadDocument
className="text-primary text-sm font-medium"
>
View activity feed
</Link>
</div>
<ToastClose onClick={close} />
</>
),
options: {
position: 'bottom-right',
},
});
} catch (e) {
toast.error('Failed to trigger workflow', {
description: e instanceof Error ? e.message : 'There was an error triggering the workflow.',
Expand Down

0 comments on commit 506679c

Please sign in to comment.