-
Notifications
You must be signed in to change notification settings - Fork 76
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: 404 error when creating subform #13992
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13992 +/- ##
=======================================
Coverage 95.21% 95.21%
=======================================
Files 1756 1756
Lines 22984 22990 +6
Branches 2681 2684 +3
=======================================
+ Hits 21885 21891 +6
Misses 849 849
Partials 250 250 ☔ View full report in Codecov by Sentry. |
Great to have a spinner to indicate loading/slowness! Eventually, we’ll remove the button at the top in video 2. So we probably don’t need to make any more changes there? In the future, the user will only be able to add a subform from the component itself. In the first video, I can’t actually see where the subform is being added. It’s supposed to appear in the config panel, under Component ID. But maybe that hasn’t been implemented yet or isn’t part of this task either? |
It does appear in the config panel, but when a new subform is created, the user is automatically redirected to it. This might not be the intended behavior? If so, fixing it only requires removing one line of code (I think) 🙂 Edit: will fix it here #13999 |
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.
Lots of great code @lassopicasso 😄 Added some comments
...ditLayoutSetForSubform/EditLayoutSet/CreateNewSubformLayoutSet/CreateNewSubformLayoutSet.tsx
Show resolved
Hide resolved
frontend/packages/ux-editor/src/components/Elements/Subform/CreateSubformWrapper.tsx
Outdated
Show resolved
Hide resolved
...ditLayoutSetForSubform/EditLayoutSet/CreateNewSubformLayoutSet/CreateNewSubformLayoutSet.tsx
Outdated
Show resolved
Hide resolved
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.
Great job 🤩
Tested ok, see comment in issue for details #13967 (comment) |
Co-authored-by: Nina Kylstad <[email protected]>
Description
The 404 error occurred because the
useCreateSubform
hook was triggering theonSubformCreated
callback before the new subform was saved on the backend. This caused a validation check inuseSubformLayoutValidation
to attempt accessing layouts for the new layout set too soon.To address this,
useCreateSubform
now waits until the subform is successfully saved before callingonSubformCreated
.A spinner has also been added to indicate loading, improving the user experience, particularly for those with slower internet.
Below are videos from the two locations where users can create a subform, showing the spinner on a slow internet. @Annikenkbrathen, feel free to share any thoughts on the UX.
Video 1: Create subform in config
spinner-loading.mp4
Video 2: Create subform in subheader
spinner-loadingv2.mp4
Related Issue(s)
Verification
Documentation