-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix(dashboard): Sibling form structure and autosave #7149
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
Conversation
✅ Deploy Preview for novu-stg-vite-dashboard-poc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
e8ac59b to
f7daa4c
Compare
f7daa4c to
282191e
Compare
| debouncedUpdate({ ...workflow, ...data }); | ||
| }); | ||
|
|
||
| useFormAutosave(statusForm, (data) => { |
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 function is defined twice!
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.
Yeap, it's for two different "forms". One is for the patch endpoint (status form) and one for the update of the rest.
| patch(data); | ||
| }); | ||
|
|
||
| // const setIssuesFromWorkflow = (workflow: WorkflowResponseDto) => { |
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 remove this if not needed.
apps/dashboard/src/components/workflow-editor/configure-workflow-form.tsx
Outdated
Show resolved
Hide resolved
apps/dashboard/src/components/workflow-editor/configure-workflow-form.tsx
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,10 @@ | |||
| import { ConfigureStepTemplate } from '@/components/workflow-editor/steps/configure-step-template'; | |||
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.
Are these edit components necessary? I feel that we can move the wrapping into the Configure* components and remove two extra imports.
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.
The component is necessary because it wraps with the provider. The file isn't that much but I liked it separated as it's the entry point in main.tsx
| custom: 'Custom Step', | ||
| }; | ||
|
|
||
| export const createStep = (type: StepTypeEnum): Step => ({ |
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.
You can also add this function in the provider value and get it from via const { buildStep } = useStep() hook.
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.
It doesn't really depend on the context. At some point, I'd like for our canvas nodes to not use the context at all if possible so this would be imported.
|
|
||
| export type WorkflowContextType = { | ||
| isPending: boolean; | ||
| workflow?: WorkflowResponseDto; |
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.
Consider making the workflow DTO or null (when not loaded) instead of optional.
apps/dashboard/src/components/workflow-editor/workflow-tabs.tsx
Outdated
Show resolved
Hide resolved
282191e to
a68070e
Compare
a68070e to
55ca490
Compare
What changed? Why was the change needed?
Changes:
Screenshots
Expand for optional sections
Related enterprise PR
Special notes for your reviewer