-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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): Open step template drawer on Add Step #7406
base: next
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for dev-web-novu ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for dashboard-v2-novu-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
4eb716f
to
07450dd
Compare
07450dd
to
7c4a43e
Compare
7c4a43e
to
5635caa
Compare
5635caa
to
5fa1330
Compare
@@ -28,6 +28,14 @@ export const STEP_TYPE_LABELS: Record<StepTypeEnum, string> = { | |||
[StepTypeEnum.CUSTOM]: 'Custom', | |||
}; | |||
|
|||
export const AUTO_OPEN_DRAWER_AFTER_CREATION_STEP_TYPES: StepTypeEnum[] = [ |
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.
Every TEMPLATE_CONFIGURABLE_STEP_TYPES should allow for the same behavior. So we don't need a separate enum for this.
Moreover, these enums have a bit of a code smell as the UI around drawers should work independently of the step types. We will get back to that soon; meanwhile, let's not add another constant array of array steps.
@@ -105,9 +111,13 @@ export const WorkflowProvider = ({ children }: { children: ReactNode }) => { | |||
const isUpdatePatchPending = isPatchPending || isUpdatePending || hasPendingItems; | |||
|
|||
const update = useCallback( | |||
(data: UpdateWorkflowDto) => { | |||
({ data, onSuccess }: { data: UpdateWorkflowDto; onSuccess?: (workflow: WorkflowResponseDto) => void }) => { |
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 think it would be better DX to do
(data: UpdateWorkflowDto, { onSuccess }: { onSuccess?: (workflow: WorkflowResponseDto) => void }) => {```
It's also a safer change and doesn't introduce the super generic data key across the board.
What changed? Why was the change needed?
To make sure that the user can focus on modifying the content immediately after adding a step and doesn't get distracted by errors for missing content, we are opening the configure drawer right after the step is added.
Screenshots
Screen.Recording.2024-12-30.at.12.09.33.PM.mov
Expand for optional sections
Related enterprise PR
Special notes for your reviewer