-
Notifications
You must be signed in to change notification settings - Fork 0
Redirect back #17
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
Redirect back #17
Conversation
We should be able to pass the scope around instead of a specific cancel_to URL. This way, we can let everything in the view adopt to whatever scope it is being rendered in.
Relying on scopes only
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.
Pull Request Overview
This PR implements a "redirect back" functionality for the Uchi admin interface, allowing navigation between scoped and unscoped contexts when creating or editing records.
- Adds a
path_for_cancelmethod to intelligently redirect to the parent model when in a scoped context - Updates edit and new forms to use the new cancel path logic
- Adds comprehensive test coverage for edit and new actions in both scoped and unscoped repository controllers
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/controllers/uchi/scoped_repository_controller_test.rb | Adds test coverage for edit and new actions, including proper cancel link behavior |
| test/controllers/uchi/repository_controller_test.rb | Adds test coverage for edit and new actions in unscoped context |
| app/views/uchi/repository/new.html.erb | Updates cancel link to use new path_for_cancel helper |
| app/views/uchi/repository/edit.html.erb | Updates cancel link to use new path_for_cancel helper |
| app/controllers/uchi/repository_controller.rb | Implements path_for_cancel method and refactors scope handling |
| app/components/uchi/ui/index/records_table/records_table.html.erb | Updates edit link to pass scope parameter |
| app/components/uchi/ui/index/records_table.rb | Adds path_for_edit method to include scope in edit URLs |
| app/components/uchi/field/belongs_to.rb | Refactors collection mapping to use repository title method |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.