-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Admin] Open edit and new forms in dialog with turbo frame #6046
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
Conversation
22f5345 to
5e2c4da
Compare
5e2c4da to
909607d
Compare
354c7c2 to
a1e9278
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6046 +/- ##
==========================================
- Coverage 89.58% 89.47% -0.12%
==========================================
Files 801 805 +4
Lines 18275 17875 -400
==========================================
- Hits 16371 15993 -378
+ Misses 1904 1882 -22 ☔ 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
Outdated
Show resolved
Hide resolved
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 |
3995aa3 to
05dabbd
Compare
97b06a3 to
bc0f636
Compare
c771be0 to
9f5d275
Compare
mamhoff
left a comment
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.
Very nice, especially that it turns our test suite green.
cd4d4de to
bb0ff87
Compare
After some research I decided to not tackle this in this PR as this would mean to make things dependent on the referrer and |
bb0ff87 to
2d6d261
Compare
This controller and components should be used for the Solidus Admin RESTful resource views. It handles Turbo Frame requests from the forms inside the modal dialog and redirects or rerenders via turbo stream accordingly. That way we can use normal links and form submits for our resource views without the need for custom JS.
This tells turbo to reload the page if we redirect from a turbo frame request. No need to respond with a turbo refresh stream.
a56cac7 to
f128ab6
Compare
f128ab6 to
ec72503
Compare
|
@solidusio/core-team can I got some eyes on this one before we proceed with the new admin? |
kennyadsl
left a comment
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.
Thanks for this abstraction, made at the right time Thomas. It will be easier now to add more pages. 🙏
|
Nice work :) |
Introduces changes to legacy promotions UI based on solidusio#6046
Introduces changes to new solidus promotions UI based on solidusio#6046. Had to override few methods in controller and components due to differences in routing and naming in solidus_promotions. Copied capybara driver setup from legacy_promotions.
This brings the index component to the new style introduced in solidusio#6046. Co-authored-by: Nick Van Doorn <[email protected]> Co-authored-by: Andrew Stewart <[email protected]>
This brings the index component to the new style introduced in solidusio#6046. Co-authored-by: Nick Van Doorn <[email protected]> Co-authored-by: Andrew Stewart <[email protected]>
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: