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

Small UI tweaks and redirects when asset model is invalid #14808

Merged
merged 12 commits into from
May 31, 2024

Conversation

snipe
Copy link
Owner

@snipe snipe commented May 31, 2024

Building upon the great work by @Godmartinz in #14740 that allows users to now select their destination on checkout (which we should probably add to audit as well), I cleaned up that UI a little bit to make the drop-down a little more consistent with the rest of the UI, and also did some checks to make sure the model for the asset is valid. It has happened before that someone has manually edited the database data and the model_id is either blank or is invalid, so this throws a nice error message warning people that they have to update that, but also redirects them to the edit page. Belt and suspenders and all that.

The reason why this matters is because auditing, checking in and checking out all touch the asset's model (OOP model, not asset model), and we don't provide the asset model drop-down on those pages, so the user gets an error as it tries to update the asset on checkin/checkout/audit, but there's no meaningful error message on the screen since we have no asset model field displayed.

Current Checkin/Checkout Screen with the newly introduced "pick your destination"

Screenshot 2024-05-31 at 7 05 40 PM

Redirect page asset view

This hasn't changed much except for the greyed out buttons. These would always redirect if you clicked on them before, but this is better visual feedback

Screenshot 2024-05-31 at 6 28 36 PM

Checkin screen if model is invalid

I've centered this as well. We have the checkout screen on the left-side so that we can populate the right side with information on the other things checked out to that target, and I had originally made the container boxes left-aligned for consistency, but the layout looks much better centered here and we don't have any reason for right side content.

Screenshot 2024-05-31 at 6 29 18 PM

Normal Checkout Screen

Screenshot 2024-05-31 at 6 49 38 PM

Checkout screen if model is invalid

Screenshot 2024-05-31 at 6 50 25 PM

Audit screen when the asset model is invalid

Screenshot 2024-05-31 at 6 28 13 PM

My tooltips on the hardware view page are not showing up for some reason, but I'll look into that a bit later.

Copy link

what-the-diff bot commented May 31, 2024

PR Summary

  • Enhanced Security in Asset Handling
    Enhanced checks are now in place to ensure we're not processing requests for missing assets. This ensures the integrity and correctness of our data in AssetCheckinController.php and AssetCheckoutController.php.

  • Improved Error Messages for Invalid Models
    We've modified the error message that displays for invalid models in admin/hardware/general.php. This would provide users with more accurate information about the error that occurred.

  • Provided Error Resolution Steps
    New error messages have been incorporated in audit.blade.php, checkin.blade.php and checkout.blade.php. This new feature includes a link to edit the asset if the model is invalid, providing users with a convenient way of resolving the issue.

  • Enhanced UI Elements for Invalid Models
    We've highlighted checkin or checkout operations that are restricted due to invalid models by disabling the buttons in view.blade.php. This visual cue will help users understand when an operation is not possible and why.

  • Refactored Notifications File
    The notifications.blade.php file had its session management code modernized and a series of variable changes were implemented.

  • Improved Form Submission UI
    In redirect_submit_options.blade.php, we have revamped the layout of the cancel button and the submit button, enhanced the select options with new languages translations, incorporated disabled attribute logic, and cleaned up the HTML comments. These changes streamline the user interface and improve form submission user experience.

@snipe
Copy link
Owner Author

snipe commented May 31, 2024

Ah, right - the tooltips don't work because it's a link, not a button. Derp. I'll fix.

@snipe snipe merged commit 46be0f6 into develop May 31, 2024
8 checks passed
@snipe snipe deleted the fixes/small_redirect_tweaks branch May 31, 2024 19:47
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.

None yet

1 participant