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

Refactor of #15235 - accessory checkout to locations and assets #15913

Draft
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

snipe
Copy link
Owner

@snipe snipe commented Dec 2, 2024

The #15185 did not allow admins to see the accessories checked out to locations or assets on the location or asset pages themselves, which would make for a very confusing user experience. Unfortunately, this PR is big since there was a lot still left to do in that original (#15185) PR 😩

This introduces a more compact tabbed view on some screens, using icons and tooltips in order to prevent the icon tabs from wrapping and overwhelming the screen:

Screenshot 2024-12-03 at 8 05 02 PM

This is a rewrite of #15235, which probably also replaces/subsumes:

and partially covers:

New API Endpoints to add:

  • GET - /api/v1/locations/{:id}/assigned/accessories
  • GET - /api/v1/locations/{:id}/assigned/assets
  • GET - /api/v1/assets/{:id}/assigned/accessories
  • GET - /api/v1/assets/{:id}/assigned/assets?

Remaining To-Dos:

  • normalize the transformers a bit more - they're kind of all over the map
  • normalize the header -> icon tabs across more views
  • normalize the url structure of the new API endpoints
  • figure out why the created_by isn't being saved in the checkout anymore
  • add tests

Copy link

what-the-diff bot commented Dec 2, 2024

PR Summary

  • Added JsonResponse import
    The code now includes a more precise import command, improving the clarity of the data we’re working with.

  • Refactored checkedout method
    This change in the programming made data retrieval for the checkout functionality more efficient.

  • Modified return type documentation
    We've made some changes to make it clearer what kind of data is being returned by certain methods.

  • Added model relationship
    This addition helps us retrieve asset data more efficiently and provides more comprehensive data.

  • Updated the index method
    We've made a built-in calculator to give us more accurate asset tracking and management.

  • Introduced assignedAccessories method
    The asset management tasks related to specific locations will now be easier due to this new method.

  • Refactored transformCheckedoutAccessory method
    The checks are now handled more gracefully, providing a clean response structure.

  • Added transformUserCompact method
    The method translates into fewer unnecessary database queries for user data.

  • Updated AccessoryCheckout model
    The improved model now allows for enhanced interaction and assignment checking methods with accessories and users.

  • Introduced new private access methods
    We now have better type checking functions for assigned types.

  • Implemented assignedAccessories method
    This method will help keep track of accessories assigned to specific locations.

  • Renamed field and Added new method
    We provided a new data table layout specific to assigned accessories, including many key details.

  • Enhanced existing CSS
    The website style files are now easier to edit and understand, while still retaining their function.

  • Refactored CSS for Applying Different Themes
    The blanket restyling across the website's themes ensures consistent and intuitive visuals for the end-users. This leads to:

    • Improved color theme settings
    • Better button interaction
    • Customizable link colors
    • Adjustments for mobile menu
    • Overall enhancements and smoothness for sidebar
    • Removing redundant style rules
  • Changes to Various Skin Files
    We've reworked the theme files to ensure a cohesive look to match each theme's respective color, and made it easier to update color schemes and responsive design. This initiative is inclusive of maintaining consistent hover effects, fine-tuning responsiveness, clarifying color contrast, and enriching interaction on key UI elements.

  • Updated mix-manifest.json
    This change is a small administrative task, reflecting new build IDs after CSS and JavaScript updates.

  • Modified overrides.less
    The addition of new style rules and updates to existing ones ensure better website visual dynamics.

  • Updated general.php
    This update introduces the possibility of international language support, making the platform linguistically inclusive.

  • Enhanced checkout.blade.php
    A checkout selector was added to the checkout form, adding flexibility to user, asset, and location selection.

  • Modified view.blade.php
    Table handling changes enhanced the data layout, removing the footer from the location index table for a simpler presentation.

  • Updated view.blade.php (Tab Navigation)
    This update provides a notable enhancement on tabbed navigation for locations, using conditional rendering based on permission levels for added security, and introduced a dynamic way of fetching assigned accessories for specified locations.

@snipe snipe requested a review from uberbrady as a code owner December 3, 2024 21:29
@snipe snipe marked this pull request as draft December 4, 2024 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant