Skip to content

Conversation

@akemidx
Copy link
Member

@akemidx akemidx commented Apr 10, 2025

Default Location was overwriting the Current Location of an asset when editing that asset.

Our code was always resetting the location of an asset to the Default Location on any update. Current Location is NOT an editable field when editing an asset; it can only be done during an audit.

Screenshot 2025-04-10 at 2 48 36 PM (The location updates, even when a user doesn't have the ability to even see the current location field) Screenshot 2025-04-10 at 2 52 39 PM (Asset Checked Out) Screenshot 2025-04-10 at 2 52 53 PM Screenshot 2025-04-10 at 2 53 05 PM (Asset Checked in and set to its new current location) Screenshot 2025-04-10 at 3 00 00 PM Screenshot 2025-04-10 at 3 01 13 PM (Now updating an asset will not update that current location)

@what-the-diff
Copy link

what-the-diff bot commented Apr 10, 2025

PR Summary

  • Simplified Asset Update Mechanism
    Previously, when editing asset details in our system, the location was getting updated which was not ideal. We've removed this automatic update mechanism to ensure that changing asset details does not inadvertently alter an asset's assigned location.

  • Additional Test for Asset Editing
    To ensure this change functions as desired, a new test has been added. This will verify that the location does not get updated when an asset's details are edited — be it the name or other properties. This helps maintain accuracy in our asset tracking process.

@akemidx akemidx requested review from marcusmoore and snipe and removed request for snipe April 10, 2025 20:07
Copy link
Collaborator

@marcusmoore marcusmoore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Paired on this 👍🏾

@snipe snipe merged commit c7e89ff into grokability:develop Apr 14, 2025
9 checks passed
@snipe
Copy link
Member

snipe commented Apr 14, 2025

Wait, but we did that on purpose, IIRC.

@akemidx
Copy link
Member Author

akemidx commented Apr 14, 2025

Wait, but we did that on purpose, IIRC.

Yea, we saw that it was an older few lines. We may be able to rework/improve this PR in another.

I do believe that the current location should not be overwritten by the default location if a current location is filled in.
What is happening under the hood, is that when you edit an asset, you can NOT edit the current location, and as such we were NEVER passign the current location in the edit asset workflow. Therefore, it would ALWAYS return null, and then ALWAYS overwrite the current location with the default location.

@snipe
Copy link
Member

snipe commented Apr 14, 2025

I do believe that the current location should not be overwritten by the default location if a current location is filled in.

Agreed

What is happening under the hood, is that when you edit an asset, you can NOT edit the current location

You can via checkin, audit, and bulk edit, FYI.

@akemidx
Copy link
Member Author

akemidx commented Apr 15, 2025

You can via checkin, audit, and bulk edit, FYI.

tyty. ya, I know, I meant specifically the edit button for per asset

@snipe snipe mentioned this pull request Apr 16, 2025
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.

3 participants