-
Notifications
You must be signed in to change notification settings - Fork 0
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: better assessment editor loading state #585
Conversation
Visit the preview URL for this PR (updated for commit 60f7b4e): https://jump-math-staging--pr585-julian-better-editor-y6659jm8.web.app (expires Sat, 30 Sep 2023 20:18:28 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c42d8d0d853b05885664a2dd73f8245f4333ae51 |
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.
Also don't redirect away from the assessment-editor after saving.
Now that we stay on the editor page sometimes after submission, we need to fix the handling of the reload prompt (otherwise, it will never display after the form is submitted for the first time). To do this, we check if the form state has been touched (dirtied), and only allow reloading if it has not. We also have to reset the form default values as this is how `rhf` determines whether the form is dirty.
b9583b6
to
6d036ec
Compare
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.
frontend/src/components/admin/assessment-creation/AssessmentEditorHeader.tsx
Show resolved
Hide resolved
frontend/src/components/admin/assessment-creation/AssessmentEditorHeader.tsx
Outdated
Show resolved
Hide resolved
8f3a454
to
52da9eb
Compare
Notion ticket link
Improve save behaviour on admin assessments
Implementation description
Steps to test
What should reviewers focus on?
Checklist