-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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(web): fixed the template editor react-hook-form dirty state #2674
Changes from all commits
e7bf601
da53036
db75d1e
1bf7e81
38aa5c8
1628b13
d8fcb0b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -389,7 +389,8 @@ | |
"codesee", | ||
"ehlo", | ||
"logrocket", | ||
"backoff" | ||
"backoff", | ||
"isequal" | ||
], | ||
"flagWords": [], | ||
"patterns": [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ | |
"@emotion/react": "^11.7.1", | ||
"@emotion/styled": "^11.6.0", | ||
"@handlebars/parser": "^2.1.0", | ||
"@hookform/devtools": "^4.3.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added this library to debug the |
||
"@hookform/resolvers": "^2.9.1", | ||
"@mantine/core": "^5.7.1", | ||
"@mantine/dropzone": "^5.9.2", | ||
|
@@ -77,6 +78,7 @@ | |
"lodash.clonedeep": "^4.5.0", | ||
"lodash.get": "^4.3.2", | ||
"lodash.set": "^4.3.2", | ||
"lodash.isequal": "^4.5.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added this library to compare the variables arrays when parsing template fields, more about that later |
||
"logrocket": "^3.0.1", | ||
"logrocket-react": "^5.0.1", | ||
"polished": "^4.1.3", | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
import { useFormContext } from 'react-hook-form'; | ||
import { ChannelTypeEnum, StepTypeEnum } from '@novu/shared'; | ||
|
||
import { useActiveIntegrations } from '../../api/hooks'; | ||
import { EmailMessagesCards } from './email-editor/EmailMessagesCards'; | ||
import { TemplateInAppEditor } from './in-app-editor/TemplateInAppEditor'; | ||
import { TemplateSMSEditor } from './TemplateSMSEditor'; | ||
import { useTemplateController } from './useTemplateController'; | ||
import type { IForm } from './formTypes'; | ||
import { ActivePageEnum } from '../../pages/templates/editor/TemplateEditorPage'; | ||
import { TemplatePushEditor } from './TemplatePushEditor'; | ||
import { TemplateChatEditor } from './chat-editor/TemplateChatEditor'; | ||
|
||
export const TemplateEditor = ({ activePage, templateId, activeStep }) => { | ||
const { integrations } = useActiveIntegrations(); | ||
const { control, errors, watch } = useTemplateController(templateId); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refactored this hook, there is no sense to hold the |
||
const { | ||
control, | ||
formState: { errors }, | ||
watch, | ||
} = useFormContext<IForm>(); | ||
const steps = watch('steps'); | ||
|
||
return ( | ||
|
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.
template editor: renamed the
data-test-id
name for the Create/Update button