-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(dashboard): add missing payload on activity feed #7883
base: next
Are you sure you want to change the base?
fix(dashboard): add missing payload on activity feed #7883
Conversation
❌ Deploy Preview for dashboard-v2-novu-staging failed. Why did it fail? →
|
✅ Deploy Preview for dashboard-v2-novu-staging canceled.
|
…ayload-in-activity-feed-item # Conflicts: # libs/application-generic/src/usecases/message-template/create-message-template/create-message-template.usecase.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why i got formatting changes on the template store template in this PR ..
toast.error('Failed to trigger resend workflow', { | ||
description: e instanceof Error ? e.message : 'There was an error triggering the resend workflow.', | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use showErrorToast
toast.success('Notification resent successfully', { | ||
description: `A new notification has been triggered with transaction ID: ${newTransactionId}`, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use showSuccessToast
const setIsFullscreenOpen = useCallback((isOpen: boolean) => { | ||
if (isOpen && popoverCloseRef.current) { | ||
popoverCloseRef.current.click(); | ||
} | ||
|
||
setIsFullscreenOpenState(isOpen); | ||
}, []); | ||
|
||
const closePopover = useCallback(() => { | ||
if (popoverCloseRef.current) { | ||
popoverCloseRef.current.click(); | ||
} | ||
|
||
setIsPopoverOpen(false); | ||
}, []); | ||
|
||
const handleResend = useCallback(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you pass these handlers to "simple" components (without deep tree and useMemo), then there is not much sense in memoization and useCallback
variant="secondary" | ||
mode="ghost" | ||
size="sm" | ||
onClick={handleResend} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be allowed on deleted workflows, please do it in both places
<span className="text-foreground-950 text-sm font-medium">Logs</span> | ||
</div> | ||
|
||
{payload && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't the payload
always available?
return showToast({ | ||
variant: 'lg', | ||
children: ({ close }) => ( | ||
<> | ||
<ToastIcon variant="error" /> | ||
<div className="flex flex-col gap-2"> | ||
<span className="font-medium">Test workflow failed</span> | ||
<span className="text-foreground-600 inline"> | ||
Workflow <span className="font-bold">{activity.template?.name}</span> cannot be triggered. Ensure that | ||
it is active and requires not further actions. | ||
</span> | ||
</div> | ||
<ToastClose onClick={close} /> | ||
</> | ||
), | ||
options: { | ||
position: 'bottom-right', | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be an error or warning toast, please check showErrorToast
setIsPopoverOpen(false); | ||
}, []); | ||
|
||
const handleResend = useCallback(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use the useMutation
from @tanstack/react-query
then you won't need to handle the loading flag and you will have onSuccess
and onError
callbacks to handle
@@ -55,33 +57,48 @@ export const TestWorkflowLogsSidebar = ({ transactionId, workflow }: TestWorkflo | |||
} | |||
}, [activityId]); | |||
|
|||
// Reset refetch when transaction ID changes | |||
const handleTransactionIdChange = useCallback((newTransactionId: string) => { | |||
setIsTransactionChanging(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that this flag is needed, because the useFetchActivities
query should be triggered and areActivitiesPending
should be true
resulting in the skeleton
<ActivityLogs | ||
activity={activity} | ||
onActivitySelect={setParentActivityId} | ||
onTransactionIdChange={handleTransactionIdChange} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm missing the similar handling logic in the subscriber-activity-drawer.tsx
} | ||
}; | ||
|
||
setTimeout(checkAndUpdateTransaction, 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is a bit hacky, what if I have the other activities triggered at the same time? it might pick a wrong one
What changed? Why was the change needed?
Can be tested in preview deployment.
Screenshots
Expand for optional sections
Related enterprise PR
Special notes for your reviewer