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

Closed
wants to merge 22 commits into 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
snipe added 9 commits December 4, 2024 22:14
Signed-off-by: snipe <[email protected]>
commit 01c18f6
Merge: 4d1d2fe c5e2aed
Author: snipe <[email protected]>
Date:   Thu Dec 12 17:40:40 2024 +0000

    Merge pull request #15962 from snipe/fixes_rb-18772

commit c5e2aed
Author: snipe <[email protected]>
Date:   Thu Dec 12 17:37:08 2024 +0000

    Check for assigned (not assigned_to) before trying to present() the name on bulk delete assets

    Signed-off-by: snipe <[email protected]>

commit 4d1d2fe
Merge: ab6363a a0e7dcf
Author: snipe <[email protected]>
Date:   Thu Dec 12 17:05:10 2024 +0000

    Merge pull request #15960 from uberbrady/improve_restore_cleaner_utf8

commit ab6363a
Merge: f089d1f da33f18
Author: snipe <[email protected]>
Date:   Thu Dec 12 16:53:15 2024 +0000

    Merge pull request #15959 from snipe/remove_settings_api_endpoints

commit a0e7dcf
Author: Brady Wetherington <[email protected]>
Date:   Thu Dec 12 16:50:36 2024 +0000

    Fixes to 'clean' mode to better handle character sets and zero-values

commit da33f18
Author: snipe <[email protected]>
Date:   Thu Dec 12 16:46:19 2024 +0000

    Removed index and destroy settinga API endpoints

    Signed-off-by: snipe <[email protected]>

commit f089d1f
Merge: 4bd6c21 67494c1
Author: snipe <[email protected]>
Date:   Thu Dec 12 01:42:26 2024 +0000

    Merge pull request #15944 from marcusmoore/bug/required-display-for-selects

commit 4bd6c21
Merge: a7e6b8e 3264149
Author: snipe <[email protected]>
Date:   Thu Dec 12 00:38:21 2024 +0000

    Merge pull request #15957 from Godmartinz/fix-checkout-notif-parameters

commit 67494c1
Author: Marcus Moore <[email protected]>
Date:   Wed Dec 11 16:26:23 2024 -0800

    Fix validation messages for select2 inputs

commit 3264149
Author: Godfrey M <[email protected]>
Date:   Wed Dec 11 16:26:18 2024 -0800

    fix other mailables

commit 8417fcb
Author: Marcus Moore <[email protected]>
Date:   Wed Dec 11 16:25:45 2024 -0800

    Revert "Show frontend "required" validation for model and status selects"

    This reverts commit 10a7ae8.

commit 400833f
Author: Godfrey M <[email protected]>
Date:   Wed Dec 11 16:14:06 2024 -0800

    reversed order of the acceptance and note paramter

commit a7e6b8e
Merge: b9a6606 6e31d0f
Author: snipe <[email protected]>
Date:   Wed Dec 11 23:52:33 2024 +0000

    Merge pull request #15956 from marcusmoore/bug/sc-27731

commit 6e31d0f
Author: Marcus Moore <[email protected]>
Date:   Wed Dec 11 15:39:41 2024 -0800

    Use appropriate category for licenses when seeding

commit b9a6606
Merge: 06a0ac8 014350a
Author: snipe <[email protected]>
Date:   Wed Dec 11 20:42:13 2024 +0000

    Merge pull request #15955 from ubc-cpsc/bugfix/GHSA-c2pc-g5qf-rfrf

commit 014350a
Author: Joël Pittet <[email protected]>
Date:   Wed Dec 11 12:04:45 2024 -0800

    Fix league/commonmark's quadratic complexity bugs may lead to a denial of service

commit 06a0ac8
Author: snipe <[email protected]>
Date:   Wed Dec 11 18:34:18 2024 +0000

    Fixed #15928 - updated method name to setCreatedBy from SetUserId

    Signed-off-by: snipe <[email protected]>

commit 34a47e9
Author: snipe <[email protected]>
Date:   Wed Dec 11 18:09:53 2024 +0000

    Add @sgross-emlix as a contributor

commit f5a9e4b
Author: snipe <[email protected]>
Date:   Wed Dec 11 18:09:19 2024 +0000

    Fixes #15952 - fixed typo in content-type

    Signed-off-by: snipe <[email protected]>

commit 6633948
Merge: 5014a95 2e97b56
Author: snipe <[email protected]>
Date:   Wed Dec 11 17:38:59 2024 +0000

    Merge pull request #15954 from Godmartinz/null_fix-for-reminder-command

commit 2e97b56
Author: Godfrey M <[email protected]>
Date:   Wed Dec 11 09:27:27 2024 -0800

    add null safe operator to acceptance reminder

commit 5014a95
Author: snipe <[email protected]>
Date:   Tue Dec 10 13:27:59 2024 +0000

    Updated supported versions

    Signed-off-by: snipe <[email protected]>

commit 10a7ae8
Author: Marcus Moore <[email protected]>
Date:   Mon Dec 9 16:09:51 2024 -0800

    Show frontend "required" validation for model and status selects

commit 5f0efd8
Merge: cc8f72c 31155b5
Author: snipe <[email protected]>
Date:   Mon Dec 9 19:35:31 2024 +0000

    Merge pull request #15940 from snipe/reove_gh_templates

commit 31155b5
Author: snipe <[email protected]>
Date:   Mon Dec 9 19:28:51 2024 +0000

    Removed issue/PR templates

    Signed-off-by: snipe <[email protected]>

commit cc8f72c
Merge: a0bab70 f6b9ae6
Author: snipe <[email protected]>
Date:   Mon Dec 9 19:23:13 2024 +0000

    Merge pull request #15914 from Godmartinz/send_reminder_emails

commit a0bab70
Merge: 0149ed7 b5c8251
Author: snipe <[email protected]>
Date:   Mon Dec 9 17:56:23 2024 +0000

    Merge pull request #15939 from uberbrady/fix_ldap_asset_location_updater

commit b5c8251
Author: Brady Wetherington <[email protected]>
Date:   Mon Dec 9 17:40:10 2024 +0000

    Only update asset locations to assets checked out to users.

commit 0149ed7
Merge: f726359 4f9f035
Author: snipe <[email protected]>
Date:   Mon Dec 9 17:00:10 2024 +0000

    Merge pull request #15565 from spencerrlongg/bug/sc-25921

commit f726359
Merge: a137e31 5120cdd
Author: snipe <[email protected]>
Date:   Mon Dec 9 16:40:21 2024 +0000

    Merge pull request #15925 from Godmartinz/refactor-unaccepted-assets-reminder-notif

commit 5120cdd
Author: Godfrey M <[email protected]>
Date:   Thu Dec 5 16:02:55 2024 -0800

    delete notification version of reminder

commit 97398f1
Author: Godfrey M <[email protected]>
Date:   Thu Dec 5 12:41:33 2024 -0800

    adds testing to unaccepted reminder command

commit 281ff6a
Author: Godfrey M <[email protected]>
Date:   Thu Dec 5 11:52:34 2024 -0800

    wrap comment

commit 9d49b01
Author: Godfrey M <[email protected]>
Date:   Thu Dec 5 11:46:56 2024 -0800

    cleans up the Unaccepted Asset reminder variables

commit 3f8916e
Author: Godfrey M <[email protected]>
Date:   Thu Dec 5 11:37:03 2024 -0800

    fix duplicate emails being sent in unaccepted reminder command

commit f6b9ae6
Author: Godfrey M <[email protected]>
Date:   Thu Dec 5 10:18:35 2024 -0800

    missed a spot

commit de41def
Author: Godfrey M <[email protected]>
Date:   Thu Dec 5 10:15:57 2024 -0800

    fixed conditionals

commit 52b051e
Author: Godfrey M <[email protected]>
Date:   Thu Dec 5 10:08:39 2024 -0800

    add mail class for unaccepted assets reminders

commit a137e31
Merge: 43d66a8 ca0f8ac
Author: snipe <[email protected]>
Date:   Wed Dec 4 21:46:43 2024 +0000

    Merge pull request #15920 from akemidx/asset-category-in-emails

commit ca0f8ac
Author: akemidx <[email protected]>
Date:   Tue Dec 3 16:57:28 2024 -0500

    fixed

commit 6252f0a
Author: akemidx <[email protected]>
Date:   Tue Dec 3 16:10:42 2024 -0500

    layout / added category id

commit 43d66a8
Merge: 2ad1407 e5284c0
Author: snipe <[email protected]>
Date:   Tue Dec 3 17:17:26 2024 +0000

    Merge pull request #15918 from Godmartinz/mail_name_fix

    Adds `MAIL_FROM_NAME` to mail envelope

commit e5284c0
Author: Godfrey M <[email protected]>
Date:   Tue Dec 3 09:10:50 2024 -0800

    fix typo

commit 16283b8
Author: Godfrey M <[email protected]>
Date:   Tue Dec 3 09:08:39 2024 -0800

    adds mail from name to mail envelope

commit 983b78e
Author: Godfrey M <[email protected]>
Date:   Mon Dec 2 14:27:04 2024 -0800

    add property check

commit 2ad1407
Merge: 1473018 99464fc
Author: snipe <[email protected]>
Date:   Mon Dec 2 22:03:32 2024 +0000

    Merge pull request #15909 from Godmartinz/checkin-out-notifications

    Fixed general webhook option notifications not firing

commit ab67c48
Author: Godfrey M <[email protected]>
Date:   Mon Dec 2 13:03:09 2024 -0800

    fix unaccepted assets report resend acceptance

commit 99464fc
Author: Godfrey M <[email protected]>
Date:   Mon Dec 2 10:19:24 2024 -0800

    fixes general webhook not firing

commit 4f9f035
Author: spencerrlongg <[email protected]>
Date:   Mon Sep 30 20:09:00 2024 -0500

    added a way to manipulate validator attribute names

commit cd3059f
Author: spencerrlongg <[email protected]>
Date:   Mon Sep 30 13:38:52 2024 -0500

    rm numbers too. :(

commit b69596a
Author: spencerrlongg <[email protected]>
Date:   Wed Sep 25 16:21:33 2024 -0500

    rm dump

commit d02b993
Author: spencerrlongg <[email protected]>
Date:   Wed Sep 25 15:38:40 2024 -0500

    rm comment

commit 852a56f
Author: spencerrlongg <[email protected]>
Date:   Wed Sep 25 15:30:41 2024 -0500

    should be all good now

commit 9df78a9
Author: spencerrlongg <[email protected]>
Date:   Wed Sep 25 14:00:50 2024 -0500

    working! need formatting for error messages etc

commit f3ad899
Author: spencerrlongg <[email protected]>
Date:   Wed Sep 25 13:00:35 2024 -0500

    hm ok this kind of works

commit 21906d8
Author: spencerrlongg <[email protected]>
Date:   Wed Sep 25 12:47:56 2024 -0500

    world set up and idea in place

Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
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