-
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
feat(dashboard): delete step editor functionality #6860
Conversation
|
||
const onDeleteStep = () => { | ||
deleteStep(stepSlug); | ||
navigate(buildRoute(ROUTES.EDIT_WORKFLOW, { environmentSlug: currentEnvironment?.slug ?? '', workflowSlug })); |
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.
Focus back to workflow after opened step is deleted, otherwise the sidebar with deleted step will remain opened with undefined data.
stepName: string; | ||
}; | ||
|
||
export const DeleteStepModal = ({ open, onOpenChange, onConfirm, stepName }: DeleteStepModalProps) => { |
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'll create a generic confirmation-modal
in separate PR, since we use this same modal also for promotion and probably it will be used in other places.
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.
const checkStepsDeleted = useCallback(() => { | ||
const currentStepsLength = watchedData.steps?.length ?? 0; | ||
const wasDeleted = previousStepsLength.current !== null && currentStepsLength < previousStepsLength.current; | ||
|
||
previousStepsLength.current = currentStepsLength; | ||
|
||
return wasDeleted; | ||
}, [watchedData]); |
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.
Logic to determine if step was deleted in order to not use debounced save.
If we used debounced save for deletion, user could potentially refresh in the 500ms time window and the step wouldn't be deleted, although I'm not sure if its worth the additional logic.
✅ Deploy Preview for novu-stg-vite-dashboard-poc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
What changed? Why was the change needed?
delete_step_1.mp4