Skip to content
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

Use blade component for submit redirect on asset edit/create #15172

Merged
merged 19 commits into from
Jul 26, 2024

Conversation

snipe
Copy link
Owner

@snipe snipe commented Jul 25, 2024

This builds off the great work @Godmartinz did with the checkout/checkin options and extends it out to creating/editing assets as well.

I switched those redirects to ->to() and returning the route instead of doing the redirect right in the helper, since that makes it more flexible with confirmation messages. I also used slightly friendlier names for the types of things we can redirect to, so I don't have to remember what 0, 1, and 2 are :)

Thanks very much for your help with this, @uberbrady!

Copy link

what-the-diff bot commented Jul 25, 2024

PR Summary

  • Enhanced Code Readability in 'Helper' Class
    This PR adds 'return' statements to various switch cases within the getRedirectOption method of the Helper class. This change simplifies the readability of the code as routes are now directly returned instead of redirect responses.

  • Optimized Session Storage in Controller Classes
    There have been modifications in the way redirect options and checkout types are stored in session in store methods across AssetCheckinController, AssetCheckoutController, and AssetsController classes. The assignment operations in these controller classes have been replaced with the more efficient session()->put() function, enhancing security and performance.

  • File Structure Management and Material Reassignment
    A new file named redirect_submit_options.blade.php has been created in the resources/views/blade directory ensuring better file management. Meanwhile, the older redirect_submit_options.blade.php file from resources/views/partials/forms directory has been removed.

  • Layout Changes in Several Views
    The views checkout.blade.php and edit.blade.php have been enhanced by adding the x-redirect_submit_options component. The redundant redirect_submit_options include statement has also been removed from edit-form.blade.php layout.

  • Test Modification for Better Accuracy
    The getRedirectOptionMethod within the HelperTest class has been updated to use string values instead of numeric values for the redirect_option parameter to improve test accuracy.

Note: Any minor changes related to code formatting and indentation that do not have an impact on code logic have not been elaborated in this summary.

@snipe
Copy link
Owner Author

snipe commented Jul 25, 2024

Oops - just found a small bug on the back button. Will handle it.

Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
@snipe snipe merged commit e4a82ed into develop Jul 26, 2024
5 of 9 checks passed
@snipe snipe deleted the features/blade_component_for_submit branch July 26, 2024 14:13
@marcusmoore marcusmoore mentioned this pull request Aug 13, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant