-
Notifications
You must be signed in to change notification settings - Fork 1
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
262 show template errors #271
Conversation
const isInvalid = | ||
!draft.title || | ||
// nothing selected | ||
!isValidTemplate(draft.subjectTemplate) || | ||
!isValidTemplate(draft.bodyTemplate) || |
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.
Would we ever send a notification with a subject but no body? Or a blank subject and just a body? i.e. do both subject and body need to exist, as well as being valid, or just that they need to be valid if they do exist?
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 we should always have a body.
Telegram only renders the body, subject is just for email in current design.
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.
Awesome! Love it.
const isInvalid = | ||
!draft.title || | ||
// nothing selected | ||
!isValidTemplate(draft.subjectTemplate) || | ||
!isValidTemplate(draft.bodyTemplate) || |
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 we should always have a body.
Telegram only renders the body, subject is just for email in current design.
Closes #262 (this PR is part 2)
π©π»βπ» What does this PR do?
Uses the tera-web package to validate whether the templates are parse-able, and displays an error state if not. Also prevents being able to save a broken template.
Makes subject and body template fields always full width too, to prevent their width jumping around as the error shows and hides:
i.e. this closes #214
π§ͺ How has/should this change been tested?
π Any notes for the reviewer?