Skip to content

Conversation

@marcusmoore
Copy link
Collaborator

This PR fixes a bug when checking in an asset where the asset's current location is pre-populated in the Location select:

image

Users then have to click the x so the location is not explicitly set.

The issue stems from $item being passed from the controller and the variable being brought into scope within the location-select partial (@\include brings parent variables into scope within it).

Instead of writing additional logic in the existing partial to ignore $item in this specific context (the partial is already noisy with conditionals), I created a location-select blade component to bypass the scoping issue completely. (The component is mostly copy/paste/modify from the location-select partial).

This component is mainly focused on handling this specific screen but can probably replace the partial uses without much modification if the need arises down the line. I fought the desire to create a agnostic ajax-select component that the location-select extended but I can see that appearing in the future.

Also, I included the radio options "Update Asset Location" and "Update default location AND actual location" in the parent checkin.blade.php since, I believe, that is the only place it is used so it doesn't need to be in the location-select component.

Copy/paste/modify from partials.forms.edit.location-select
@what-the-diff
Copy link

what-the-diff bot commented Mar 11, 2025

PR Summary

  • Implemented a New Interface Component: A new reusable component for selecting locations was added, improving efficiency and code reusability.
  • Refined Hardware Check-in Interface: Upgraded the hardware check-in view by integrating the newly added component to make the location selection process more efficient.
  • User Interaction Boost: We've added a section for updating default locations in the check-in view, which now includes radio buttons, making interactions more intuitive.
  • Improved Usability: The new location-input component has built-in error messages and help text, enhancing user experience by guiding them through the process and handling possible mistakes.

@snipe snipe merged commit c711278 into grokability:develop Mar 12, 2025
9 checks passed
@marcusmoore marcusmoore deleted the bug/sc-28639 branch March 12, 2025 23:26
snipe added a commit that referenced this pull request Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants