Commit graph

15728 commits

Author SHA1 Message Date
spencerrlongg ac1d09add0 Fix authorization check in AssetsController
Removed incorrect and commented-out authorization check in the destroy method. Ensured proper authorization by explicitly authorizing the asset instance before attempting deletion.
2024-11-26 14:49:50 -06:00
spencerrlongg e056da6b2a Add permissions checks to asset tests
Implement tests to ensure users without appropriate permissions are denied access to asset endpoints. Update tests to verify proper soft deletions and asset existence checks in delete scenarios.
2024-11-26 14:47:16 -06:00
spencerrlongg 09d4e0cb05 Remove unnecessary parameter and add delete asset tests
Removed the redundant $request parameter from the destroy method in AssetsController. Added feature tests to verify asset deletion functionality with proper permissions and ensure deletion is forbidden without permissions.
2024-11-26 14:37:45 -06:00
spencerrlongg 233656df01 Add tests for storing assets with all fields and multiple entries
Introduced StoreAssetTest to verify the handling of full asset records and multiple asset entries in the database. Updated StoreAssetAction and AssetsController to support next audit date validation and improved error handling.
2024-11-26 14:28:22 -06:00
spencerrlongg 233355ab48 Refactor UpdateAssetAction for clarity and remove comments
Removed outdated and redundant comments for improved code clarity and readability. Renamed `bulkUpdate` method to `bulkLocationUpdate` for better context and understanding.
2024-11-26 12:52:09 -06:00
spencerrlongg aeb5e90037 Add CheckoutNotAllowed exception in UpdateAssetAction
This change introduces the CheckoutNotAllowed exception to the UpdateAssetAction class. It ensures that the action can handle scenarios where checking out an asset is not permitted, improving the robustness of the application.
2024-11-26 12:40:53 -06:00
spencerrlongg 705a852d45 Refactor error handling and remove redundant code
Refactored error handling by replacing `\Exception` with `Exception` for consistency. Removed redundant comments and unused code to improve readability and maintainability of the `StoreAssetAction` class.
2024-11-25 20:09:30 -06:00
spencerrlongg 93e42ce939 Remove unused code from UpdateAssetAction.php
Removed commented-out code related to handling encrypted custom fields in UpdateAssetAction.php. This cleanup helps to maintain a more readable and maintainable codebase.
2024-11-25 15:50:47 -06:00
spencerrlongg 5aa2f307cd Remove debug dump statements
This commit removes various debug dump statements from BulkAssetsController and UpdateAssetAction. These changes clean up the code and improve readability by eliminating unnecessary debugging output. Maintaining clean code ensures better maintainability and performance.
2024-11-22 20:49:52 -06:00
spencerrlongg a4fefc2b5a get rid of comment 2024-11-21 11:30:27 -06:00
spencerrlongg a3cdb3b62f Fix error message format in BulkAssetsController
Previously, the error message was set as a string, which led to an inconsistency in how errors were handled. This change updates the error message to be an array, ensuring it aligns with the expected format.
2024-11-21 11:11:11 -06:00
spencerrlongg 10126b8362 Fix error handling in BulkAssetsController
Updated exception handling to capture detailed validation errors in BulkAssetsController. Corrected formatting in notifications view for displaying error messages.
2024-11-20 16:42:56 -06:00
spencerrlongg 6ddaa0bb3e Handle exceptions when saving assets in AssetImporter
Added try-catch blocks to manage ValidationException and generic exceptions during asset saving. This ensures proper logging of errors and reporting of unexpected issues, improving robustness and error handling in the asset import process.
2024-11-20 13:25:06 -06:00
spencerrlongg 617fe85699 Fix typos and use correct array notation in asset updates
Corrected spelling mistakes in test files and updated code to use the correct array notation in request validation for asset updates. This ensures better readability and consistency in the codebase while preventing potential errors related to incorrect data handling.
2024-11-20 13:11:03 -06:00
spencerrlongg 03d9f936ab Update asset model association and location logic handling
Refactor the asset update process to properly associate models and handle location ID changes based on request input. Introduce checks for model_id, company_id, and last_audit_date to ensure correct updates. Add commentary to clarify the handling of location ID logic and temporarily resolve issues with location assignment when requests do not expect JSON responses.
2024-11-20 10:17:35 -06:00
spencerrlongg 1704a07663 Allow null values for asset dates in update action
This commit improves the asset update functionality by allowing null values for purchase date, next audit date, and expected check-in date when specified in the request. Additionally, minor corrections were made in the test code to enhance readability and correctness.
2024-11-20 09:58:13 -06:00
spencerrlongg 94e7310cd9 Fix bulk asset update error handling and improve access checks
Improved the error handling in the BulkAssetsController by re-enabling custom field permission checks. Updated the UpdateAssetAction to better handle encrypted custom fields and streamlined user roles in the BulkEditAssetsTest.
2024-11-19 19:57:26 -06:00
spencerrlongg 0353c7a03b Fix error handling in BulkAssetsController
Updated error handling to ensure all exceptions are properly stored in the errors array and removed unused custom_field_problem variable. Also, uncommented location assignment code in UpdateAssetAction for clearer logic.
2024-11-19 17:56:56 -06:00
spencerrlongg 3cf583ab03 Add CustomFieldPermissionException handling 2024-11-19 17:45:35 -06:00
spencerrlongg 9f815996c7 tests 'n stuff 2024-11-19 14:45:54 -06:00
spencerrlongg 3e97f0274c rm extra code 2024-11-19 10:04:10 -06:00
spencerrlongg 6c1239eee5 cleaned - more work needs to happen 2024-11-19 10:02:04 -06:00
spencerrlongg dd8fb6ef4a fixed some things, made bulk progress, tests pass 2024-11-19 00:13:28 -06:00
spencerrlongg 7ab0b98ff2 var changes 2024-11-18 12:43:28 -06:00
spencerrlongg c91dfaf9df gui seemingly working, other good progress - api next 2024-11-14 16:54:23 -06:00
spencerrlongg 47d132703e some more good progress on UpdateAssetAction.php 2024-11-12 18:08:29 -06:00
spencerrlongg 916c0c0394 good progress on update action 2024-11-12 14:46:56 -06:00
spencerrlongg a57fffe696 a few fixes, tests pass 2024-11-04 13:39:42 -06:00
spencerrlongg b00f8b5c40 a couple more tests passing 2024-10-30 19:37:51 -05:00
spencerrlongg c0ea1fbe78 delete done 2024-10-30 15:19:34 -05:00
spencerrlongg 698434dcf8 no more base action, scaffolded update and delete 2024-10-30 13:48:14 -05:00
spencerrlongg 34886ee69a almost wrapped up StoreAssetAction.php 2024-10-29 19:04:57 -05:00
spencerrlongg eaa10249c2 alright, this mostly works. 2024-10-29 16:16:01 -05:00
spencerrlongg 6e8ab3723c bs 2024-10-23 13:56:01 -05:00
spencerrlongg 10d4c4b92e just a little scaffolding 2024-10-23 12:55:47 -05:00
snipe 5da3ce3564
Merge pull request #15711 from marcusmoore/fixes/custom-fieldset-checkboxes
Some checks are pending
Crowdin Action / upload-sources-to-crowdin (push) Waiting to run
Docker images (Alpine) / docker (push) Waiting to run
Docker images / docker (push) Waiting to run
Tests in MySQL / PHP ${{ matrix.php-version }} (8.1) (push) Waiting to run
Tests in MySQL / PHP ${{ matrix.php-version }} (8.2) (push) Waiting to run
Tests in MySQL / PHP ${{ matrix.php-version }} (8.3) (push) Waiting to run
Tests in SQLite / PHP ${{ matrix.php-version }} (8.1.1) (push) Waiting to run
Fixed custom field checkboxes on asset edit page
2024-10-22 22:10:20 +01:00
snipe c3bbca30ad
Merge pull request #15710 from snipe/fixes_lightbox_for_avif
Fixes #15701 - load avif files properly in lightbox
2024-10-22 22:07:50 +01:00
snipe 37f14fff3b Fixed typo
Signed-off-by: snipe <snipe@snipe.net>
2024-10-22 22:07:28 +01:00
snipe eb6c51fabd Fixes #15701 - load avif files properly in lightbox
Signed-off-by: snipe <snipe@snipe.net>
2024-10-22 22:04:57 +01:00
Marcus Moore 5ecd2b6293
Default checkbox elements to an empty array 2024-10-22 14:04:05 -07:00
snipe dccb788a88
Merge pull request #15691 from marcusmoore/fixes/get-id-for-current-user
Updated `Company::getIdForCurrentUser()` to return null in certain scenarios
2024-10-22 17:44:30 +01:00
Marcus Moore d10fe77ee7
Merge branch 'develop' into fixes/get-id-for-current-user 2024-10-22 09:38:31 -07:00
snipe 5e1d792bba
Merge pull request #15687 from NebelKreis/fix/dashboard-title-casing
Fixed #15686: Corrected capitalization for dashboard section titles by removing strtolower()
2024-10-22 16:52:28 +01:00
snipe 9cf71976f6 Fixed #15706 - Removed purchase order number from asset import
Signed-off-by: snipe <snipe@snipe.net>
2024-10-22 16:51:42 +01:00
snipe 15745d9737
Merge pull request #15566 from Godmartinz/status-label-error-message
Fixed Status Labels Error Message
2024-10-22 16:39:44 +01:00
snipe bd97955b9e Bumped hash
Signed-off-by: snipe <snipe@snipe.net>
2024-10-22 16:38:46 +01:00
snipe 252d99421c
Merge pull request #15689 from snipe/better_handle_inline_files
Better handle inline files in file listing
2024-10-22 16:26:48 +01:00
snipe 5767a98ad8
Merge pull request #15649 from bryanlopezinc/ImproveImporting
Improve import performance
2024-10-22 16:26:23 +01:00
snipe 0c820cbc0d
Merge pull request #15598 from spencerrlongg/bug/custom_field_validation_issue
Custom Field Existence Validation Issue
2024-10-22 15:56:12 +01:00
snipe db81701621
Merge branch 'develop' into better_handle_inline_files 2024-10-22 15:44:24 +01:00