Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
679 commits
Select commit Hold shift + click to select a range
15852d1
WIP refactor ByFilter()
JonasGoseberg Oct 27, 2025
a9ad0a9
Merge remote-tracking branch 'upstream/develop' into rebase-20251028
cz-lucas Oct 28, 2025
a71a2f5
Fixed LDAP testcase
cz-lucas Oct 28, 2025
13ded3f
Merge pull request #63 from imbus/rebase-20251028
cz-lucas Oct 28, 2025
fbe3ee1
Merge branch 'bugfix-date-filter-input' into pre-develop-Lc
cz-lucas Oct 28, 2025
8c07fef
Merge remote-tracking branch 'origin/refactor-SIT-99_ByFilter' into p…
cz-lucas Oct 28, 2025
132e393
Merge branch 'copilot/update-advanced-search-dropdown' into pre-devel…
cz-lucas Oct 28, 2025
07c9299
Merge pull request #60 from imbus/more-minor-ui-stuff
cz-lucas Oct 29, 2025
8394f82
Fixed failing testcases
cz-lucas Oct 29, 2025
7a80ed2
Merge pull request #64 from imbus/pre-develop-Lc
cz-lucas Oct 29, 2025
279aefe
Fixed that some dropdowns are expanded even ones that shouldn't
cz-lucas Oct 29, 2025
09c0ac8
Fixed that placeholder won't be shown completly in the dropdowns
cz-lucas Oct 29, 2025
3c8a4f7
Fixed failing datequery-tests
cz-lucas Oct 30, 2025
21c9ec9
Fixed failing datequery-tests
cz-lucas Oct 30, 2025
b660128
Skipping all date-query tests
cz-lucas Oct 30, 2025
3a4694d
Skipping all date-query tests
cz-lucas Oct 30, 2025
17b87d9
Skipping all date-query tests
cz-lucas Oct 30, 2025
d67d8fd
Merge pull request #66 from imbus/fix-taling-datequery-tests
cz-lucas Oct 30, 2025
ae7c8f2
Merge pull request #65 from imbus/bugfix-all-dropdowns-are-expanded
cz-lucas Oct 30, 2025
02aa72c
Merge remote-tracking branch 'upstream/develop' into rebase-20251030
cz-lucas Oct 30, 2025
7c0372c
Merge pull request #67 from imbus/rebase-20251030
cz-lucas Oct 30, 2025
7633955
Fixed that daterange is sent twice to the backend in a filter
cz-lucas Oct 30, 2025
0ef6004
Fixed datefilter
cz-lucas Oct 30, 2025
0addcf6
Fixed datequerytests
cz-lucas Oct 30, 2025
a811a2f
Fixed tests
cz-lucas Oct 30, 2025
cb0c55b
Merge pull request #69 from imbus/bugfix-date-filter-is-broken
cz-lucas Oct 30, 2025
6680864
Fixed that filter operators wont be applied on textfields
cz-lucas Oct 31, 2025
858fccc
Merge pull request #70 from imbus/bugfix-filters-operators-wont-be-ap…
cz-lucas Oct 31, 2025
3007419
Fixed that duplicate name warning is always shown when creating a filter
cz-lucas Oct 31, 2025
4e51fa5
Skipping failing tests in pipeline
cz-lucas Oct 31, 2025
8a0b53e
Data query tests fixed
Klausw-1 Oct 31, 2025
fc42a7b
filterservice fix
Klausw-1 Oct 31, 2025
8ca2003
fixed MySQLPHPVersion8.2
Klausw-1 Oct 31, 2025
3113361
company_id fail in tests fixed
Klausw-1 Oct 31, 2025
ee01ee1
fixed the date-filter-logic in the API-Layer
Klausw-1 Oct 31, 2025
8366e7d
stabilize DateQueryTest by scoping assets and using fixed date range
Klausw-1 Oct 31, 2025
35d786b
Fixed that date-input wont be cleared
cz-lucas Nov 3, 2025
1ffef44
Merge remote-tracking branch 'upstream/develop' into rebase-20251103
cz-lucas Nov 3, 2025
b096b15
Merge pull request #75 from imbus/rebase-20251103
cz-lucas Nov 3, 2025
49dd9ca
Merge pull request #71 from imbus/bugfix-duplicate-warning
cz-lucas Nov 3, 2025
e8a967d
Merge pull request #74 from imbus/bugfix-date-wont-be-cleared
cz-lucas Nov 3, 2025
9b26781
Showing visibility in predefined filter name
cz-lucas Nov 3, 2025
428afa1
SIT-125_hotfix language de-if
JonasGoseberg Nov 3, 2025
c04e148
Merge branch 'develop' of https://github.com/imbus/snipe-it into develop
JonasGoseberg Nov 3, 2025
fd1a1ac
fixed the EOL Date Query Test
Klausw-1 Nov 3, 2025
2c2ee8a
Started adding tests
cz-lucas Nov 3, 2025
17ae454
Foreign data records in scope fixed with three test assets with uniqu…
Klausw-1 Nov 3, 2025
8601136
Fixed the date input that somehow
cz-lucas Nov 3, 2025
e5ba5cc
Finally fixed it
cz-lucas Nov 3, 2025
f9591c5
Merge pull request #76 from imbus/hotfix-date-search-is-broken-again
JonasGoseberg Nov 3, 2025
f8d8592
Finished tests
cz-lucas Nov 3, 2025
e8dc2be
Merge branch 'develop' into fixes/datetests
Klausw-1 Nov 3, 2025
fd93b75
Merge pull request #73 from imbus/fixes/datetests
Klausw-1 Nov 3, 2025
2fa1a01
SU can now view private filters
JonasGoseberg Nov 3, 2025
944cd19
used UserHasPermission
JonasGoseberg Nov 3, 2025
9af3568
Merge pull request #77 from imbus/feature-show-more-in-predefined-fil…
cz-lucas Nov 3, 2025
6cf68f3
Merge pull request #78 from imbus/bugfix_SIT-107-SU-cannot-apply-priv…
JonasGoseberg Nov 3, 2025
b4af6e9
Date is now applied but isn't shown
cz-lucas Nov 3, 2025
0e05ae8
Changed stuff
cz-lucas Nov 3, 2025
04cb0cc
Merge pull request #79 from imbus/bugfix-predefined-filter-date-is-br…
cz-lucas Nov 3, 2025
d421fe8
Fixed that the date can be set (the clear button is currently broken)
cz-lucas Nov 4, 2025
64c50c9
Fixed that date can be cleared
cz-lucas Nov 4, 2025
963718a
Merge pull request #80 from imbus/bugfix-predefined-filter-date-is-br…
Klausw-1 Nov 4, 2025
4e94967
added the PermissionPart to the Updated version
JonasGoseberg Nov 5, 2025
0718bcc
added functionality for searching, sorting and pagination
JonasGoseberg Nov 6, 2025
01a2352
removed logs
JonasGoseberg Nov 6, 2025
bf26ca6
removed logs
JonasGoseberg Nov 6, 2025
8ebf309
WIP fixed behavior from floating buttons
JonasGoseberg Nov 6, 2025
6c2f415
used a different wording
JonasGoseberg Nov 7, 2025
d79478a
Merge pull request #81 from imbus/SIT-129-language_Bugs
JonasGoseberg Nov 7, 2025
0538b0a
Merge pull request #82 from imbus/SIT-125_bugfix-sorting-problem-on-s…
JonasGoseberg Nov 7, 2025
1adb16b
Merge remote-tracking branch 'upstream/develop' into rebase-20251107
cz-lucas Nov 7, 2025
4e38fea
Rebuild static assets
cz-lucas Nov 7, 2025
0ca84fd
Remove duplicate @ endif in hardware/view.blade.php
cz-lucas Nov 7, 2025
dd36633
Add example testing environment configuration
cz-lucas Nov 7, 2025
afafccd
Merge pull request #83 from imbus/rebase-20251107
cz-lucas Nov 7, 2025
3354412
WIP fixed bug with advancedSearchPanel
JonasGoseberg Nov 7, 2025
af49064
Merge remote-tracking branch 'origin/develop' 'into SIT-133-FloatingB…
JonasGoseberg Nov 7, 2025
9605ed2
fixed the overlapping bug entirely
JonasGoseberg Nov 7, 2025
155bed3
buttons stay centered in panel
JonasGoseberg Nov 7, 2025
dd0fdd1
changed width of select2 fields
JonasGoseberg Nov 7, 2025
6ef5594
removed logs
JonasGoseberg Nov 10, 2025
550af66
compiled files
JonasGoseberg Nov 10, 2025
1a26753
Fixed awkward looking field in the datepicker for 'to'
cz-lucas Nov 10, 2025
fef3159
Merge pull request #84 from imbus/SIT-133-FloatingButtons
JonasGoseberg Nov 10, 2025
52bdfb8
Merge branch 'develop' into feature-SIT112-to-field-looks-awkward
cz-lucas Nov 10, 2025
63f29b7
Merge pull request #85 from imbus/feature-SIT112-to-field-looks-awkward
cz-lucas Nov 10, 2025
d805167
Fixed that toggle filter button is shown on pages there it shouldn't
cz-lucas Nov 10, 2025
89e98d5
Merge pull request #86 from imbus/bugfix-SIT131-cant-open-advanced-se…
cz-lucas Nov 10, 2025
7c383dd
Moved filterUiController to it's own file
cz-lucas Nov 10, 2025
19cff31
Fixed translations for filterUiController.js
cz-lucas Nov 10, 2025
c5cefe0
Merge pull request #87 from imbus/refactor-filteruiController
cz-lucas Nov 10, 2025
c395219
fixed Bug with blinking filterSection
JonasGoseberg Nov 11, 2025
f32cce6
removed EditModalParameter
JonasGoseberg Nov 11, 2025
5e6b0d1
removed comments
JonasGoseberg Nov 11, 2025
3ba86d3
Merge SIT-138-ApplyingFilters in develop
cz-lucas Nov 11, 2025
06d5c0b
Merge pull request #88 from imbus/SIT-138-ApplyingFilters
cz-lucas Nov 11, 2025
14ef880
Started fixing the assignedTo-filter
cz-lucas Nov 11, 2025
ee29ea7
An eternity later ... still not working
cz-lucas Nov 12, 2025
ea4b9bc
More is now working...
cz-lucas Nov 12, 2025
3d23d1a
sidebar-fixes
JonasGoseberg Nov 12, 2025
58f17fb
Merge remote-tracking branch 'upstream/develop' into rebase-20251112
cz-lucas Nov 12, 2025
2988356
Merge pull request #89 from imbus/rebase-20251112
cz-lucas Nov 12, 2025
564467f
fixed formatting
JonasGoseberg Nov 13, 2025
b60ebc9
minor fixes
JonasGoseberg Nov 13, 2025
2a0b76a
Fixed assignedToLocation
cz-lucas Nov 13, 2025
145386f
Added assigntedTo for assignedToAsset-queryies
cz-lucas Nov 14, 2025
816907e
added notification for success when creating a filter
JonasGoseberg Nov 14, 2025
995358c
minor fixes
JonasGoseberg Nov 14, 2025
fe57538
Merge pull request #91 from imbus/SIT-106-bugfix-createSuccessMessage
JonasGoseberg Nov 14, 2025
20769f1
added and fixed l10n
JonasGoseberg Nov 14, 2025
70a9b75
fixed behavior of permissions (create / update)
JonasGoseberg Nov 14, 2025
5b28997
Added assignedToUser
cz-lucas Nov 14, 2025
1056c41
Merge pull request #90 from imbus/SIT-143-accessibility
JonasGoseberg Nov 17, 2025
8d0bcd4
Merge pull request #92 from imbus/SIT-146-permission_bug
JonasGoseberg Nov 17, 2025
c035268
Added assetQueryApiTests
cz-lucas Nov 17, 2025
8e23b56
Implemented frontend for assignedTo
cz-lucas Nov 17, 2025
f841fd0
Applied suggestion from @JonasGoseberg in imbus/snipe-it#93
cz-lucas Nov 17, 2025
e4bcb00
Merge pull request #93 from imbus/bugfix-SIT118-assignedTo
cz-lucas Nov 17, 2025
0df64df
Fixed that Select2-dropdown in advanced-search won't be over the navi…
cz-lucas Nov 17, 2025
266426e
Merge pull request #94 from imbus/bugfix-SIT145-select-menu-z-index
cz-lucas Nov 17, 2025
72f9eb2
Fixed that search always sents the assignedTo field
cz-lucas Nov 17, 2025
b85d2f2
Moved if-statement to fix failing test
cz-lucas Nov 17, 2025
751259d
Fixed that the group-select-dropdown is in the background
cz-lucas Nov 18, 2025
7ee5fff
Merge remote-tracking branch 'upstream/develop' into rebase-20251118
cz-lucas Nov 18, 2025
b6778bb
Merge pull request #96 from imbus/rebase-20251118
cz-lucas Nov 18, 2025
fc140a3
Filter dropdown is now set when applying a predefined filter over the…
cz-lucas Nov 18, 2025
c796cd4
adjusted parameters for UpdateModal in Settingspage
JonasGoseberg Nov 18, 2025
2229dd8
Build JS
cz-lucas Nov 18, 2025
f8101eb
Merge pull request #95 from imbus/bugfix-SIT159-wrong-zindex-modal-dr…
cz-lucas Nov 18, 2025
34b1a1d
Fixed failing test
cz-lucas Nov 18, 2025
3859235
Improved fix of failing test
cz-lucas Nov 18, 2025
e2b7f80
Merge pull request #97 from imbus/bugfix-SIT165-filter-dropdown-not-s…
cz-lucas Nov 18, 2025
f643ac1
Hotfix: predefinedfilter-dropdown won't be set
cz-lucas Nov 18, 2025
465867a
Merge pull request #98 from imbus/SIT-157-updateModalSettingsPage
JonasGoseberg Nov 19, 2025
abe1ec6
predefinedfilter update
Klausw-1 Nov 19, 2025
d5e0ad0
refactored predefinedFilterService
JonasGoseberg Nov 20, 2025
3997932
changed some formatting things to align with sonarqubes standard
JonasGoseberg Nov 20, 2025
a560e9e
Updated CSS-build so that there are only two css-files loaded
cz-lucas Nov 20, 2025
69994b3
Moved search-inouts-js in it's own file ouside of the blade
cz-lucas Nov 20, 2025
43117af
Merge pull request #99 from imbus/refactor-advanced-search-css-build
JonasGoseberg Nov 20, 2025
de6a353
refactored Modal.php
JonasGoseberg Nov 20, 2025
e229482
Moved CSS and JS from hardware/index in its own files
cz-lucas Nov 20, 2025
20d8094
Merge remote-tracking branch 'origin/develop' into refactor-js-build
cz-lucas Nov 20, 2025
39f4a27
Moved JS for the advanced search in its own file
cz-lucas Nov 20, 2025
dbc6e4e
Removed todo
cz-lucas Nov 20, 2025
11ad95d
refactored Filterservice
JonasGoseberg Nov 20, 2025
fcd6380
Some smaler improvements
cz-lucas Nov 20, 2025
29586c9
Merge pull request #100 from imbus/refactor-js-build
cz-lucas Nov 20, 2025
ec98755
Merge pull request #101 from imbus/SIT-72-cleanup-FilterService
JonasGoseberg Nov 20, 2025
aa459a4
made some formatting changes
JonasGoseberg Nov 21, 2025
8e19e08
Merge pull request #102 from imbus/SIT-149-changedVisibilityInSetting…
JonasGoseberg Nov 21, 2025
1222994
Merge remote-tracking branch 'upstream/develop' into rebase-20251121
cz-lucas Nov 21, 2025
a0af53c
Merge pull request #103 from imbus/rebase-20251121
cz-lucas Nov 21, 2025
f1f0f1d
factory rebuilding
Klausw-1 Nov 21, 2025
f5f6d45
cleancode
Klausw-1 Nov 21, 2025
12491f2
adjusted Tests
JonasGoseberg Nov 21, 2025
b9933cd
implemented LegacyAdvancedSearch again
JonasGoseberg Nov 21, 2025
6dac618
Added advanced search policy
cz-lucas Nov 21, 2025
11abcd7
Added permssion to view
cz-lucas Nov 21, 2025
fd76410
Merge pull request #105 from imbus/SIT-173-OldAdvancedSearchDoesntWor…
cz-lucas Nov 21, 2025
546b83f
Added advanced-search in selectlist-gate
cz-lucas Nov 24, 2025
5859377
Fixed that user without advanced-search permssions can view it using …
cz-lucas Nov 24, 2025
0cc0f67
adjusted l10n for advancedsearch
JonasGoseberg Nov 24, 2025
5b8b540
Updated frontend for new data structure
cz-lucas Nov 24, 2025
d0048d4
WIP adjusted Filter_data to show a name
JonasGoseberg Nov 24, 2025
39f2ca7
added functionality for missing models
JonasGoseberg Nov 24, 2025
3d07c38
adjusted to sonarQube Rules
JonasGoseberg Nov 24, 2025
cb52239
Added 404 for unkown predfined filters
cz-lucas Nov 24, 2025
fea2888
Merge remote-tracking branch 'upstream/develop' into rebase-20251124
cz-lucas Nov 24, 2025
d778a24
Merge pull request #108 from imbus/rebase-20251124
cz-lucas Nov 24, 2025
275b916
Merge pull request #107 from imbus/SIT174-advanced-search-permissions
JonasGoseberg Nov 25, 2025
d017f80
Delete on_decode($f->filter_data, true);
Klausw-1 Nov 25, 2025
624d183
Merge pull request #104 from imbus/feature/predefined-filter-seeder-u…
Klausw-1 Nov 25, 2025
102c2f0
some improvements to Sonarcube and artisan insights
JonasGoseberg Nov 25, 2025
f97e92f
Started with changes for better darkmode support
cz-lucas Nov 25, 2025
990fd03
Updated CSS for darkmode for floatingbutton-menu
cz-lucas Nov 26, 2025
17ea022
Updated CSS for darkmode for dropdowns
cz-lucas Nov 26, 2025
a401c19
Merge pull request #110 from imbus/bugfix-advancedsearch-darkmode
cz-lucas Nov 26, 2025
aafcf79
Delete PredefinedFilter::truncate();
cz-lucas Nov 26, 2025
e039740
removed unused keys
JonasGoseberg Nov 26, 2025
cc9d999
Merge pull request #109 from imbus/SIT-72-cleanup
JonasGoseberg Nov 27, 2025
19b5236
added a method to explicit return the name of the models
JonasGoseberg Nov 27, 2025
dc0d963
Merge pull request #112 from imbus/SIT-190-bugfix-failed-to-apply
cz-lucas Nov 27, 2025
74883dd
some change requests - typos
JonasGoseberg Nov 27, 2025
a3351bf
fixed some typos
JonasGoseberg Nov 27, 2025
16ea4e9
Merge pull request #111 from imbus/Sit72-unifyl10n
JonasGoseberg Nov 27, 2025
cf60d21
eol pipeline fail test fix
Klausw-1 Nov 27, 2025
e948836
eol customfieldtest fail fix
Klausw-1 Nov 27, 2025
bdaf5f4
PredefinedFilter fix
Klausw-1 Nov 27, 2025
99d2312
removed color:green
JonasGoseberg Nov 27, 2025
08b171a
removed outcommented code
JonasGoseberg Nov 28, 2025
f854af4
Merge pull request #113 from imbus/SIT-195-hotfix-green-text
JonasGoseberg Nov 28, 2025
28cb957
Merge branch 'develop' into Sit-72-remove-outcommented-code
JonasGoseberg Nov 28, 2025
b81c143
Merge remote-tracking branch 'upstream/develop' into develop
cz-lucas Nov 28, 2025
ea34021
translated german comments
JonasGoseberg Nov 28, 2025
919d393
Added length-limit for the predefinedfilter-name
cz-lucas Nov 28, 2025
9d968b0
added prevention to update or delete a deleted filter
JonasGoseberg Nov 28, 2025
0fb2cd3
Fixed broken test
cz-lucas Nov 28, 2025
0bf3937
Merge pull request #114 from imbus/Sit-72-remove-outcommented-code
JonasGoseberg Nov 28, 2025
37563af
Implemented improvments from @JonasGoseberg
cz-lucas Nov 28, 2025
99eb6e7
Merge pull request #115 from imbus/bugfix-SIT198-filter-length-limit
cz-lucas Nov 28, 2025
dd0079c
Merge branch 'develop' into sit-199-deleted-Filter-could-be-updated
JonasGoseberg Nov 28, 2025
6d222e5
Merge pull request #116 from imbus/sit-199-deleted-Filter-could-be-up…
JonasGoseberg Nov 28, 2025
128140b
Removed files
cz-lucas Nov 28, 2025
a89f75b
Removed uploads
cz-lucas Nov 28, 2025
618508e
fixed using undefined variable and removed some old stuff
JonasGoseberg Nov 28, 2025
dabd04e
Implemented some of the improvements from codacy
cz-lucas Nov 28, 2025
a17ad1f
adjusted Tests to fixed behavior
JonasGoseberg Nov 28, 2025
6829639
Merge branch 'pre-merge' into SIT-202-avoidUsingUndefinedVariables
JonasGoseberg Nov 28, 2025
4b56105
fix variable names to match other commits
JonasGoseberg Dec 1, 2025
23721e7
fixed race condition
JonasGoseberg Dec 1, 2025
70f25ec
Renamed variables in frontend
cz-lucas Dec 2, 2025
2d5f865
use logging
JonasGoseberg Dec 2, 2025
c249592
adjusted variable names accordingly to codacy
JonasGoseberg Dec 2, 2025
a1197ee
Some more changes
cz-lucas Dec 2, 2025
52e79f8
Build js
cz-lucas Dec 2, 2025
b0b9f5d
Added missing bracket
cz-lucas Dec 2, 2025
9bfed0e
Merge pull request #119 from imbus/some-more-renaming-stuff
cz-lucas Dec 2, 2025
54684f4
Merge pull request #117 from imbus/SIT-202-avoidUsingUndefinedVariables
JonasGoseberg Dec 2, 2025
339332c
Merge branch 'pre-merge' into SIT-213-bugfix-racecondition-filterinput
JonasGoseberg Dec 2, 2025
515b166
Merge pull request #118 from imbus/SIT-213-bugfix-racecondition-filte…
JonasGoseberg Dec 2, 2025
50b5375
Merge pull request #120 from imbus/Sit-202-use-logging-and-avoid-dupl…
JonasGoseberg Dec 2, 2025
bdb6a36
fixed generic onject injection sink warning
JonasGoseberg Dec 2, 2025
cf82c13
Renamed tests
cz-lucas Dec 2, 2025
106a93e
Some more minor changes
cz-lucas Dec 2, 2025
5bc8034
Merge pull request #121 from imbus/rename-testcases
cz-lucas Dec 2, 2025
44fbccf
run npm
JonasGoseberg Dec 2, 2025
c7b86aa
removed unused code
JonasGoseberg Dec 2, 2025
2a30ea2
And more code-style fixes
cz-lucas Dec 2, 2025
234da5a
refactored some testclasses
JonasGoseberg Dec 2, 2025
bf193f7
Decreased code-complxity
cz-lucas Dec 2, 2025
9b7d764
Fixed missing function
cz-lucas Dec 2, 2025
ee9a325
Merge pull request #122 from imbus/SIT-202-cleanup-codacy
JonasGoseberg Dec 2, 2025
9bb0c70
Added
cz-lucas Dec 2, 2025
01171a2
Merge branch 'pre-merge' into and-more-codestyle-improvements
cz-lucas Dec 2, 2025
3212a89
Merge pull request #123 from imbus/and-more-codestyle-improvements
cz-lucas Dec 2, 2025
7dce4aa
Fix comprehensibility issues
cz-lucas Dec 2, 2025
5a1d992
Merge remote-tracking branch 'upstream/develop' into more-minor-impro…
cz-lucas Dec 2, 2025
fe2030c
More formatting stuff later...
cz-lucas Dec 2, 2025
916aea1
next round of codacy improvements
JonasGoseberg Dec 2, 2025
70517a3
npm run prod
JonasGoseberg Dec 2, 2025
a8bd4ec
Merge pull request #124 from imbus/SIT-202-more-codacy-cleanup
JonasGoseberg Dec 2, 2025
77c9e9a
Added escaping
cz-lucas Dec 2, 2025
8422362
Merge branch 'pre-merge' of github.com:imbus/snipe-it into more-minor…
cz-lucas Dec 2, 2025
f2a5f4c
Fixed unresolved merged conflict
cz-lucas Dec 2, 2025
4a28351
Merge pull request #125 from imbus/more-minor-improvements
cz-lucas Dec 2, 2025
d7ae9e4
hotfix error on modal open
JonasGoseberg Dec 3, 2025
dd259cb
Fixed some more very minor issues
cz-lucas Dec 3, 2025
3bcbfdc
Merge pull request #126 from imbus/hotfix-modal-open
cz-lucas Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,4 @@ ARGON_TIME=2
# OPTIONAL: SCIM
# --------------------------------------------
SCIM_TRACE=false
SCIM_STANDARDS_COMPLIANCE=false
SCIM_STANDARDS_COMPLIANCE=false
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,7 @@ storage/ldap_client_tls.cert
storage/ldap_client_tls.key
/storage/framework/testing

/.phpunit.cache
/.phpunit.cache

#Ignore vscode AI rules
.github/instructions/codacy.instructions.md
9 changes: 9 additions & 0 deletions app/Console/Commands/Purge.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use App\Models\License;
use App\Models\Location;
use App\Models\Manufacturer;
use App\Models\PredefinedFilter;
use App\Models\Statuslabel;
use App\Models\Supplier;
use App\Models\User;
Expand Down Expand Up @@ -178,6 +179,14 @@ public function handle()
$this->info('- Status Label "'.$status_label->name.'" deleted.');
$status_label->forceDelete();
}

$predefinedFilters = PredefinedFilter::whereNotNull('deleted_at')->withTrashed()->get();
$this->info($predefinedFilters->count().' predefined filters purged.');
foreach ($predefinedFilters as $predefinedFilter) {
$this->info('- Predefined Filter "'.$predefinedFilter->name.'" deleted.');
$predefinedFilter->forceDelete();
}

} else {
$this->info('Action canceled. Nothing was purged.');
}
Expand Down
14 changes: 8 additions & 6 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,20 @@ public function render($request, Throwable $e)
// Sigh.
if ($route == 'assets.index') {
$route = 'hardware.index';
} elseif ($route == 'reporttemplates.index') {
} else if ($route == 'reporttemplates.index') {
$route = 'reports/custom';
} elseif ($route == 'assetmodels.index') {
} else if ($route == 'assetmodels.index') {
$route = 'models.index';
} elseif ($route == 'predefinedkits.index') {
} else if ($route == 'predefinedkits.index') {
$route = 'kits.index';
} elseif ($route == 'assetmaintenances.index') {
} else if ($route == 'assetmaintenances.index') {
$route = 'maintenances.index';
} elseif ($route === 'licenseseats.index') {
} else if ($route === 'licenseseats.index') {
$route = 'licenses.index';
} elseif (($route === 'customfieldsets.index') || ($route === 'customfields.index')) {
} else if (($route === 'customfieldsets.index') || ($route === 'customfields.index')) {
$route = 'fields.index';
} else if ($route === 'predefinedfilters.index') {
$route = 'predefined-filters.index';
}

return redirect()
Expand Down
101 changes: 68 additions & 33 deletions app/Http/Controllers/Api/AssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use App\Models\License;
use App\Models\LicenseSeat;
use App\Models\Location;
use App\Models\PredefinedFilter;
use App\Models\Setting;
use App\Models\User;
use App\View\Label;
Expand Down Expand Up @@ -57,7 +58,7 @@ class AssetsController extends Controller
* @param int $assetId
* @since [v4.0]
*/
public function index(FilterRequest $request, $action = null, $upcoming_status = null) : JsonResponse | array
public function index(FilterRequest $request, $action = null, $upcoming_status = null):JsonResponse|array
{


Expand Down Expand Up @@ -134,7 +135,7 @@ public function index(FilterRequest $request, $action = null, $upcoming_status =
'created_by',

];

$all_custom_fields = CustomField::all(); //used as a 'cache' of custom fields throughout this page load

foreach ($all_custom_fields as $field) {
Expand All @@ -145,13 +146,20 @@ public function index(FilterRequest $request, $action = null, $upcoming_status =

if ($request->filled('filter')) {
$filter = json_decode($request->input('filter'), true);
}

$filter = array_filter($filter, function ($key) use ($allowed_columns) {
if (!isset($filter[0]['field'])) {
$filter = array_filter($filter, function ($key) use ($allowed_columns){
return in_array($key, $allowed_columns);
}, ARRAY_FILTER_USE_KEY);
}

$all_custom_fields = CustomField::all(); //used as a 'cache' of custom fields throughout this page load
foreach ($all_custom_fields as $field) {
$allowed_columns[] = $field->db_column_name();
}


$assets = Asset::select('assets.*')
->with(
'model',
Expand Down Expand Up @@ -188,7 +196,7 @@ public function index(FilterRequest $request, $action = null, $upcoming_status =
}
}

if ((! is_null($filter)) && (count($filter)) > 0) {
if ((!is_null($filter)) && (count($filter)) > 0) {
$assets->ByFilter($filter);
} elseif ($request->filled('search')) {
$assets->TextSearch($request->input('search'));
Expand All @@ -199,7 +207,7 @@ public function index(FilterRequest $request, $action = null, $upcoming_status =
* Handle due and overdue audits and checkin dates
*/
switch ($action) {
// Audit (singular) is left over from earlier legacy APIs
// Audit (singular) is left over from earlier legacy APIs
case 'audits':
switch ($upcoming_status) {
case 'due':
Expand Down Expand Up @@ -292,7 +300,7 @@ public function index(FilterRequest $request, $action = null, $upcoming_status =
break;
default:

if ((! $request->filled('status_id')) && ($settings->show_archived_in_list != '1')) {
if ((!$request->filled('status_id')) && ($settings->show_archived_in_list != '1')) {
// terrible workaround for complex-query Laravel bug in fulltext
$assets->join('status_labels AS status_alias', function ($join) {
$join->on('status_alias.id', '=', 'assets.status_id')
Expand Down Expand Up @@ -324,7 +332,7 @@ public function index(FilterRequest $request, $action = null, $upcoming_status =
if ($request->input('requestable') == 'true') {
$assets->where('assets.requestable', '=', '1');
}

if ($request->filled('model_id')) {
// If model_id is already an array, just use it as-is
if (is_array($request->input('model_id'))) {
Expand Down Expand Up @@ -409,6 +417,7 @@ public function index(FilterRequest $request, $action = null, $upcoming_status =
break;
case 'location':
$assets->OrderLocation($order);
break;
case 'rtd_location':
$assets->OrderRtdLocation($order);
break;
Expand Down Expand Up @@ -453,6 +462,18 @@ public function index(FilterRequest $request, $action = null, $upcoming_status =
break;
}

// Filter with predefinedFilter if one is given
if (isset($request->predefinedFilter)) {
$id = $request->predefinedFilter;
$predefinedFilters = PredefinedFilter::where('id', $id)
->where('created_by', auth()->user()->id)
->first();

if ($predefinedFilters) {
$assets = $predefinedFilters->filterAssets($assets);
}
}


// Make sure the offset and limit are actually integers and do not exceed system limits
$offset = ($request->input('offset') > $assets->count()) ? $assets->count() : app('api_offset_value');
Expand All @@ -466,9 +487,11 @@ public function index(FilterRequest $request, $action = null, $upcoming_status =
* Include additional associated relationships
*/
if ($request->input('components')) {
$assets->loadMissing(['components' => function ($query) {
$query->orderBy('created_at', 'desc');
}]);
$assets->loadMissing([
'components' => function ($query) {
$query->orderBy('created_at', 'desc');
}
]);
}

return (new $transformer)->transformAssets($assets, $total, $request);
Expand Down Expand Up @@ -561,11 +584,18 @@ public function showBySerial(Request $request, $serial): JsonResponse | array
* @since [v4.0]
* @return \Illuminate\Http\JsonResponse
*/
public function show(Request $request, $id): JsonResponse | array
public function show(Request $request, $id): JsonResponse|array
{
if ($asset = Asset::with('assetstatus')
->with('assignedTo')->withTrashed()
->withCount('checkins as checkins_count', 'checkouts as checkouts_count', 'userRequests as user_requests_count')->find($id)
if (
$asset = Asset::with('assetstatus')
->with('assignedTo')
->withTrashed()
->withCount(
'checkins as checkins_count',
'checkouts as checkouts_count',
'userRequests as user_requests_count'
)
->find($id)
) {
$this->authorize('view', $asset);

Expand Down Expand Up @@ -606,7 +636,7 @@ public function selectlist(Request $request): array
])->with('model', 'assetstatus', 'assignedTo')
->NotArchived();

if ((Setting::getSettings()->full_multiple_companies_support=='1') && ($request->filled('companyId'))) {
if ((Setting::getSettings()->full_multiple_companies_support=='1') && ($request->filled('companyId'))) {
$assets->where('assets.company_id', $request->input('companyId'));
}

Expand Down Expand Up @@ -657,7 +687,7 @@ public function store(StoreAssetRequest $request): JsonResponse
$asset->model()->associate(AssetModel::find((int) $request->get('model_id')));

$asset->fill($request->validated());
$asset->created_by = auth()->id();
$asset->created_by = auth()->id();

/**
* this is here just legacy reasons. Api\AssetController
Expand Down Expand Up @@ -1101,7 +1131,6 @@ public function checkinByTag(Request $request, $tag = null): JsonResponse
* @since [v4.0]
*/
public function audit(Request $request, Asset $asset): JsonResponse

{
$this->authorize('audit', Asset::class);

Expand Down Expand Up @@ -1144,7 +1173,7 @@ public function audit(Request $request, Asset $asset): JsonResponse
* Update custom fields in the database.
* Validation for these fields is handled through the AssetRequest form request
* $model = AssetModel::find($request->get('model_id'));
*/
*/
if (($asset->model) && ($asset->model->fieldset)) {
$payload['custom_fields'] = [];
foreach ($asset->model->fieldset->fields as $field) {
Expand All @@ -1164,7 +1193,7 @@ public function audit(Request $request, Asset $asset): JsonResponse
$asset->{$field->db_column} = $request->input($field->db_column);
}
}
$payload['custom_fields'][$field->db_column] = $request->input($field->db_column);
$payload['custom_fields'][$field->db_column] = $request->input($field->db_column);
}

}
Expand All @@ -1175,7 +1204,7 @@ public function audit(Request $request, Asset $asset): JsonResponse

// Validate the rest of the data before we turn off the event dispatcher
if ($asset->isInvalid()) {
return response()->json(Helper::formatStandardApiResponse('error', ['asset_tag' => $asset->asset_tag], $asset->getErrors()));
return response()->json(Helper::formatStandardApiResponse('error', ['asset_tag' => $asset->asset_tag], $asset->getErrors()));
}


Expand All @@ -1196,7 +1225,7 @@ public function audit(Request $request, Asset $asset): JsonResponse
* @see \App\Models\Asset::save()
*/

$asset->unsetEventDispatcher();
$asset->unsetEventDispatcher();


/**
Expand All @@ -1212,7 +1241,7 @@ public function audit(Request $request, Asset $asset): JsonResponse


// No matching asset for the asset tag that was passed.
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')), 200);
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/hardware/message.does_not_exist')), 200);

}

Expand Down Expand Up @@ -1367,20 +1396,26 @@ public function getLabels(Request $request): JsonResponse
try {
$this->authorize('view', Asset::class);

// Validate that asset tags were provided in the request
// Validate that asset tags were provided in the request
if (!$request->filled('asset_tags')) {
return response()->json(Helper::formatStandardApiResponse('error', null,
trans('admin/hardware/message.no_assets_selected')), 400);
return response()->json(Helper::formatStandardApiResponse(
'error',
null,
trans('admin/hardware/message.no_assets_selected')
), 400);
}

// Convert asset tags from request into collection and fetch matching assets
// Convert asset tags from request into collection and fetch matching assets
$asset_tags = collect($request->input('asset_tags'));
$assets = Asset::whereIn('asset_tag', $asset_tags)->get();

// Return error if no assets were found for the provided tags
// Return error if no assets were found for the provided tags
if ($assets->isEmpty()) {
return response()->json(Helper::formatStandardApiResponse('error', null,
trans('admin/hardware/message.does_not_exist')), 404);
return response()->json(Helper::formatStandardApiResponse(
'error',
null,
trans('admin/hardware/message.does_not_exist')
), 404);
}

try {
Expand All @@ -1392,17 +1427,17 @@ public function getLabels(Request $request): JsonResponse


$label = new Label();

if (!$label) {
throw new \Exception('Label object could not be created');
}

// Configure label with assets and settings
// bulkedit=false and count=0 are default values for label generation
$label = $label->with('assets', $assets)
->with('settings', $settings)
->with('bulkedit', false)
->with('count', 0);
->with('settings', $settings)
->with('bulkedit', false)
->with('count', 0);

// Generate PDF using callback function
// The callback captures the PDF content in $pdf_content variable
Expand Down
Loading