-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Admin] Open edit and new forms in dialog with turbo frame #6046
base: main
Are you sure you want to change the base?
Conversation
22f5345
to
5e2c4da
Compare
3.21.0 introduced a bug with testing view components.
5e2c4da
to
909607d
Compare
354c7c2
to
a1e9278
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6046 +/- ##
==========================================
+ Coverage 87.82% 89.59% +1.77%
==========================================
Files 477 791 +314
Lines 11670 18254 +6584
==========================================
+ Hits 10249 16355 +6106
- Misses 1421 1899 +478 ☔ View full report in Codecov by Sentry. |
162d93c
to
ca8ae78
Compare
@tvdeyen i've checked out your branch and here's the screen recording of the "issues" i mentioned. You can see when I open the edit page in the new tab and click outside, it makes a request to However, I guess I understood it incorrectly what you meant about being able to visit the edit page. In my PR I have done it in a way that the underlying table is still rendered on edit page which I thought was your goal. Screen.Recording.2024-12-20.at.23.38.25.movThough there's one more thing I discovered, not related to visiting edit page, but opening a modal with "turbo-framed" link and clicking outside: Screen.Recording.2024-12-20.at.23.50.35.movas you can see it makes a request to |
admin/app/components/solidus_admin/adjustment_reasons/index/component.rb
Show resolved
Hide resolved
3776427
to
6b476d4
Compare
If a table has no rowUrl defined we currently redirect to root path. Which is not preferable. We should do nothing instead.
We do not want to render the whole layout if the request is a turbo frame request. We just want to render the component's html.
f566aa1
to
fd5cbe3
Compare
@chaimann Now, I understand what you meant. Thanks for the screen recording. This helps to understand the issue.
Yeah, I think that we do not display the index table on the The same is true for the redirect after successful form submission.
This is how |
We don't want to deal with Turbo caching issues in the new admin. The content a customer agent or product administrator should always be the latest and most accurate version. Prefetching is a performance nightmare for an admin interface like ours. Co-authored-by: Eugene Chaikin <[email protected]>
This is actual links to open the new and edit forms in the modal dialog remotely.
fd5cbe3
to
0e5c4dc
Compare
That way we can disdplay the modal on an edit/new route but prevent the modal from being closed by the user.
6770fa3
to
3995aa3
Compare
In order to make redirects to the index route from an edit or new form and being able to re-display the form with errors in case of failed validation, we need to explicitely set the request format to html, otherwise turbo will refresh the edit/new page.
3995aa3
to
05dabbd
Compare
Depends on #6048
Summary
Opens new and edit forms of Admin resources in dialogs with Turbo Frames.
Removing the need of rendering the index table again on the form components.
Also handles the layout toggle for all turbo frame requests.
Includes the ground work from #6045
Closes #5944
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: