Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dashboard): revert trigger success toast #6987

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
import { Link, useNavigate, useParams } from 'react-router-dom';
import { Link, useParams } from 'react-router-dom';
import { RiPlayCircleLine, RiProgress1Fill } from 'react-icons/ri';
import { useForm } from 'react-hook-form';
// eslint-disable-next-line
Expand All @@ -15,11 +15,10 @@ import { useTriggerWorkflow } from '@/hooks/use-trigger-workflow';
import { showToast } from '../../primitives/sonner-helpers';
import { buildDynamicFormSchema, makeObjectFromSchema, TestWorkflowFormType } from '../schema';
import { TestWorkflowForm } from './test-workflow-form';
import { SuccessButtonToast } from '@/components/success-button-toast';
import { toast } from 'sonner';
import { ToastClose, ToastIcon } from '@/components/primitives/sonner';

export const TestWorkflowTabs = ({ testData }: { testData: WorkflowTestDataResponseDto }) => {
const navigate = useNavigate();
const { environmentSlug = '', workflowSlug = '' } = useParams<{ environmentSlug: string; workflowSlug: string }>();
const { workflow } = useFetchWorkflow({
workflowSlug,
Expand Down Expand Up @@ -51,16 +50,21 @@ export const TestWorkflowTabs = ({ testData }: { testData: WorkflowTestDataRespo
showToast({
variant: 'lg',
children: ({ close }) => (
<SuccessButtonToast
title="Test workflow triggered successfully"
description={`Test workflow ${workflowSlug} was triggered successfully`}
actionLabel="View activity feed"
onAction={() => {
close();
navigate(buildRoute(LEGACY_ROUTES.ACTIVITY_FEED, { transactionId }));
Copy link
Contributor Author

@LetItRock LetItRock Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The navigate here works like an internal routing, there is no option to do a full page reload on navigate, which is something we want because we navigate to a different "app" served by "legacy" folder.

}}
onClose={close}
/>
<>
<ToastIcon variant="default" />
<div className="flex flex-col gap-2">
<span className="font-medium">Test workflow triggered successfully</span>
<span className="text-foreground-600">{`Test workflow ${workflowSlug} was triggered successfully`}</span>
<Link
to={`${LEGACY_ROUTES.ACTIVITY_FEED}?transactionId=${transactionId}`}
reloadDocument
className="text-foreground-950 flex items-center gap-1 text-sm font-medium"
>
View activity feed
</Link>
</div>
<ToastClose onClick={close} />
</>
),
options: {
position: 'bottom-right',
Expand Down
Loading