Commit graph

338 commits

Author SHA1 Message Date
Spencer Long ba31a33290
Merge branch 'develop' into refactor/asset-action 2025-01-23 12:58:01 -06:00
snipe d5309c7d94 Added fragment to uploads for redirect
Signed-off-by: snipe <snipe@snipe.net>
2025-01-21 18:06:00 +00:00
snipe bbc9ed5778 Fixed audit date default on bulk audit
Some checks are pending
CodeQL Security Scan / CodeQL Security Scan (javascript) (push) Waiting to run
Codacy Security Scan / Codacy Security Scan (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
Signed-off-by: snipe <snipe@snipe.net>
2025-01-15 22:28:50 +00:00
Godfrey M 833af55806 Merge branch 'develop' into barcode_settings_hide 2024-12-12 12:05:29 -08:00
spencerrlongg 38d8d3076d Refactor asset handling and streamline code
This refactoring introduces helper methods for handling image uploads, custom fields, and checkouts, improving code organization and readability. Unnecessary imports, comments, and unused variables were removed for cleaner code. Error handling was also improved with additional exception reporting in the asset update flow.
2024-12-04 21:43:47 -06:00
spencerrlongg 19771d26fb formatting 2024-12-03 14:46:32 -06:00
spencerrlongg 5e475c3558 Remove unused imports from AssetsController files.
Simplify the code by cleaning up unused import statements in both `AssetsController.php` and `Api/AssetsController.php`. This reduces potential confusion and helps maintain cleaner code for future development and maintenance.
2024-12-03 14:41:30 -06:00
spencerrlongg bdf1033277 Merge remote-tracking branch 'upstream/develop' into refactor/asset-action
# Conflicts:
#	app/Http/Controllers/Api/AssetsController.php
#	app/Http/Controllers/Assets/AssetsController.php
#	app/Http/Controllers/Assets/BulkAssetsController.php
#	resources/lang/en-US/admin/hardware/message.php
2024-12-03 14:31:50 -06:00
spencerrlongg 16740b41e4 Simplify asset handling logic for creation and update
Refactor asset creation and update processes by removing redundant save checks and organizing error handling logic. Enhance success and failure feedback in the asset creation flow to improve clarity and user experience. Add support for detailed multi-success and partial failure messages to alert users of outcomes.
2024-12-03 13:50:30 -06:00
spencerrlongg 0a1aba5406 a little work for conflicts 2024-11-29 14:32:19 -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 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 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 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 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 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 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
snipe 47b2cdb846 Allow user to specify null for calculation or explicit on bulk edit
Signed-off-by: snipe <snipe@snipe.net>
2024-11-10 18:04:13 +00:00
snipe 6928b1b273 Added eol date to bulk asset edit
Signed-off-by: snipe <snipe@snipe.net>
2024-11-10 17:47:10 +00: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
snipe dfc63641dc
Merge pull request #15550 from uberbrady/fix_multi_create_partial_failure
Some checks failed
Crowdin Action / upload-sources-to-crowdin (push) Has been cancelled
Docker images (Alpine) / docker (push) Has been cancelled
Docker images / docker (push) Has been cancelled
Tests in MySQL / PHP ${{ matrix.php-version }} (8.1) (push) Has been cancelled
Tests in MySQL / PHP ${{ matrix.php-version }} (8.2) (push) Has been cancelled
Tests in MySQL / PHP ${{ matrix.php-version }} (8.3) (push) Has been cancelled
Tests in SQLite / PHP ${{ matrix.php-version }} (8.1.1) (push) Has been cancelled
Fix multi create partial failure (fixes: [RB-18591])
2024-10-24 11:40:50 +01: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 a05c33febf Squashed commit of the following:
commit 147fcfb8eb
Merge: 58a3d09b5 fdcc17ca2
Author: snipe <snipe@snipe.net>
Date:   Tue Oct 22 15:12:55 2024 +0100

    Merge pull request #15676 from Toreg87/fixes/api_create_user_fmcs

    Fix user creation with FullMultipleCompanySupport enabled over API

commit 58a3d09b5f
Merge: 30a06a594 867fa2f36
Author: snipe <snipe@snipe.net>
Date:   Tue Oct 22 14:55:42 2024 +0100

    Merge pull request #15703 from marcusmoore/bug/sc-27188

    Linked accessory files in activity report

commit 30a06a5942
Merge: 6c6af78e0 ce3086317
Author: snipe <snipe@snipe.net>
Date:   Tue Oct 22 11:47:06 2024 +0100

    Merge pull request #15693 from marcusmoore/chore/remove-parallel-testing

    Removed brianium/paratest

commit 6c6af78e08
Merge: 9b06bbb6c 3f79fd7ea
Author: snipe <snipe@snipe.net>
Date:   Tue Oct 22 11:46:04 2024 +0100

    Merge pull request #15705 from marcusmoore/tests/icon-component-test

    Added test to ensure icon component does not end in newline

commit 3f79fd7ea7
Author: Marcus Moore <contact@marcusmoore.io>
Date:   Mon Oct 21 17:07:40 2024 -0700

    Add test to ensure icon component does not end in newline

commit 9b06bbb6c3
Merge: 46ad1d072 d7f70146f
Author: snipe <snipe@snipe.net>
Date:   Mon Oct 21 22:38:26 2024 +0100

    Merge pull request #15704 from marcusmoore/bug/remove-extra-icon

    Removed second icon in accessory file list

commit ce30863177
Author: Marcus Moore <contact@marcusmoore.io>
Date:   Mon Oct 21 13:57:04 2024 -0700

    Remove brianium/paratest dependency

commit d7f70146f4
Author: Marcus Moore <contact@marcusmoore.io>
Date:   Mon Oct 21 13:48:25 2024 -0700

    Remove extra icon in accessory file upload list

commit 867fa2f36e
Author: Marcus Moore <contact@marcusmoore.io>
Date:   Mon Oct 21 12:40:24 2024 -0700

    Display file in activity report for accessories

commit 0933a2d4ea
Author: Marcus Moore <contact@marcusmoore.io>
Date:   Thu Oct 17 18:01:48 2024 -0700

    Remove --parallel flag

commit 46ad1d072f
Merge: bcb4bd9eb 3cf746d7d
Author: snipe <snipe@snipe.net>
Date:   Thu Oct 17 15:29:47 2024 +0100

    Merge pull request #15680 from uberbrady/bulk_checkout_to_bulk_actions

    Bulk checkout to bulk actions

commit bcb4bd9eb4
Merge: 250037540 f50ccbcc4
Author: snipe <snipe@snipe.net>
Date:   Thu Oct 17 10:20:13 2024 +0100

    Merge pull request #15683 from Toreg87/fixes/outdated_comment

    Fix outdated comment in CompanyableTrait

commit f50ccbcc49
Author: Tobias Regnery <tobias.regnery@gmail.com>
Date:   Thu Oct 17 11:07:28 2024 +0200

    Fix outdated comment in CompanyableTrait

    As of commit 5800e8d the user model uses CompanyableTrait so remove this clearly outdated comment

commit 3cf746d7df
Author: Brady Wetherington <bwetherington@grokability.com>
Date:   Wed Oct 16 23:13:32 2024 +0100

    Rework the bulk checkout to not change how all checkouts work

commit 6b7af802af
Author: Brady Wetherington <bwetherington@grokability.com>
Date:   Thu Oct 10 13:28:23 2024 +0100

    Add 'bulk checkout' as one of the bulk actions in the bulk actions toolbar

commit fdcc17ca2c
Author: Tobias Regnery <tobias.regnery@gmail.com>
Date:   Wed Oct 16 11:18:24 2024 +0200

    Fix user creation with FullMultipleCompanySupport enabled over API

    It is currently possible as a non-superuser to create a new user or patch an existing user with arbitrary company over the API if FullMultipleCompanySupport is enabled.
    Altough a highly unlikely scenario as the user needs permission to create API keys and new users, it is a bug that should get fixed.

    Add a call to getIdForCurrentUser() to normalize the company_id if FullMultipleCompanySupport is enabled.

Signed-off-by: snipe <snipe@snipe.net>
2024-10-22 15:43:19 +01:00
snipe 787e651778 Fixed todos with log message
Signed-off-by: snipe <snipe@snipe.net>
2024-10-21 16:52:21 +01:00
snipe ef9b6e3b07 Code cleanup
Signed-off-by: snipe <snipe@snipe.net>
2024-10-21 16:34:54 +01:00
snipe 5823197e6f Added checkin action on delete for checked out assets
Signed-off-by: snipe <snipe@snipe.net>
2024-10-01 14:29:02 +01:00
Godfrey M 44447b85c9 Merge branch 'develop' into barcode_settings_hide 2024-09-26 11:27:05 -07:00
Brady Wetherington b6340532d7 Improve the error and success messages and linking 2024-09-24 17:15:39 +01:00
Brady Wetherington c71411465a First pass at better-handling those annoying Rollbars we keep getting 2024-09-24 15:17:35 +01:00
snipe bc540b6564 Requestable status not saving with manual [sc-26848]
Signed-off-by: snipe <snipe@snipe.net>
2024-09-20 14:02:28 +01:00
snipe b21c303e56 Merge remote-tracking branch 'origin/develop' into features/add_created_at_created_by 2024-09-20 13:43:50 +01:00
snipe 4f7c8e0c3d
Merge pull request #14671 from Robert-Azelis/patch-6
[FIX] Update EOL date when used bulk update of purchase date
2024-09-19 21:36:09 +01:00
Godfrey M b33c0fc4dd updates getbarcode method and labels view 2024-09-17 16:15:56 -07:00
snipe 1582d81e5b Change user_id to created_by
Signed-off-by: snipe <snipe@snipe.net>
2024-09-17 22:16:41 +01:00