3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-08-18 11:15:42 +00:00
Commit Graph

71 Commits

Author SHA1 Message Date
d85c4feddb Added simple lock mutex to importer to prevent duplicate imports 2026-08-13 10:19:39 +01:00
1125e595b4 License Importer: Do not require seats if just assigning licenses 2026-08-12 12:46:10 +01:00
b7d1f84adb Update license importer to look for pre-existing license 2026-08-11 22:02:12 +01:00
747655a706 Merge pull request #19432 from TowyTowy/fix/category-importer-alert-on-response
Fixed category importer silently ignoring the alert_on_response column
2026-08-08 10:20:00 +01:00
94869caaee More importer fixes and test fixes 2026-08-05 22:46:24 +01:00
3503dc7ee7 Updated importer tests 2026-08-05 22:37:14 +01:00
beee855a6c Updated test 2026-08-05 22:26:52 +01:00
80925cd430 And more tests 2026-08-05 22:22:13 +01:00
0544d1519a More tests 2026-08-05 11:29:36 +01:00
c5bded7238 Fixed category importer silently ignoring the alert_on_response column
The importer UI offers "Alert on Response" as a mappable column for
category imports (app/Livewire/Importer.php, categories_fields), but
CategoryImporter only ever read use_default_eula, require_acceptance
and checkin_email. Anything the user mapped to alert_on_response was
dropped: new categories were always created with the column default,
and update-mode imports could never change it.

alert_on_response was added to the Category model in #17116, four days
after the category importer landed in #17062, and the importer's flag
list was never extended to match.

Adds it to the existing boolean-flag loop so it gets the same
fetchHumanBoolean handling and the same present/absent CSV semantics
as its three siblings.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-04 20:02:21 +02:00
ce01114c2d Updated tests 2026-08-03 18:55:44 +01:00
02bb0356a6 Updated tests 2026-08-03 13:43:28 +01:00
a53928e1a4 Replenish/remove for consumables, accessories, components 2026-08-03 13:07:59 +01:00
ce670d654f Added loss ratio safety net for *sort of* okay files 2026-08-03 12:15:02 +01:00
500861f82f Fixed #19414 - mojibake fix 2026-08-03 12:02:08 +01:00
cea409fbc7 Fixed importer tests 2026-07-31 05:12:17 +01:00
bc3cde5e97 Importer improvements 2026-07-31 04:16:03 +01:00
006afa3473 Codacy fix 2026-07-29 16:25:50 +01:00
e770e955a6 Added test 2026-07-29 16:10:10 +01:00
03053d4d52 Added tests 2026-07-25 23:59:45 +01:00
bc148ebe2b CSV Import: update mode silently resets requestable and cannot clear byod
In update mode, AssetImporter::createAssetIfNotExists() always coerces the
requestable CSV value to a boolean and assigns it directly to the model. When
the import file has no requestable column, that coerces null to 0 and resets
the flag on every asset the update touches. The existing test suite documented
this ("RequestAble is always updated regardless of initial value.") by
commenting out the assertion instead of failing.

byod has the mirror problem: the value is coerced to int 0 before
sanitizeItemForUpdating(), which strips falsy values in update mode, so an
explicit byod=FALSE in the CSV is silently dropped and the flag can never be
cleared through an update import.

Fix: in update mode only touch either flag when the CSV actually provides a
non-blank value, and assign the coerced value directly to the model (as the
requestable line already did) so an explicit falsy value survives the
empty-value stripping. Create-mode behavior is unchanged (missing/blank still
defaults to 0).

Adds regression tests for both directions and restores the previously
commented-out assertion in update_asset_from_import().

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-18 12:10:11 +02:00
0249be3b7c CSV Import: User importer rejects entire row when start/end dates are not exactly Y-m-d
Sibling follow-up to #19306/#19310. UserImporter passed start_date and end_date raw
from the CSV into the User model, whose validation rules require the exact format
Y-m-d ('nullable|date_format:Y-m-d'). Any other representation of a perfectly valid
date - '07/28/2025', '28-12-2025', '2025-07-28 00:00:00' - failed validation and the
whole user row was rejected, while the same date imports fine for assets, licenses,
accessories, consumables and components.

Run both fields through the importer's existing parseOrNullDate() helper, which
parses with CarbonImmutable, normalizes to Y-m-d, logs on failure and returns null.
This also makes handleEmptyStringsForDates() (added in #19294 to fix the empty-string
symptom of the same validation failure, issue #15141) redundant - parseOrNullDate()
already returns null for empty input - so it is removed.

Adds regression tests: a non-ISO date imports as the normalized Y-m-d value, and an
unparseable date imports as null instead of rejecting the row.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-17 01:09:34 +02:00
115d1a4f5e Rename company_id on users table 2026-07-10 14:41:47 +01:00
5a2764b945 Small text fix 2026-07-02 14:40:44 +01:00
549fe60595 Merge remote-tracking branch 'origin/develop' into importer-scoping 2026-07-02 14:38:27 +01:00
2d19591888 Fixed factory for imports 2026-07-02 14:31:09 +01:00
26a534bd8b Importer: Fixed FD-56113 - scope to user who uploaded 2026-07-02 14:13:06 +01:00
d58e757d37 Reverter tighter scope, updated tests 2026-06-26 12:44:13 +01:00
b78aedeec2 Added stricter gate checks with FMCS and floater mode is on 2026-06-25 19:29:06 +01:00
d3f10ee776 Pint 2026-06-15 15:18:20 +01:00
a6c82eec7b Location Scoping: Fixed ordering for company check on user save
The model save fires before companies are synced, so company_id is stale data, which was causing it to erroneously fail validation. the rule was always wrong in that context for updates. The form request owns this check now.
2026-06-15 15:18:09 +01:00
e3a9872d28 Updated tests 2026-06-13 13:18:37 +01:00
7bf8fd5eeb Fixed #19106 - tighten up user accessor to treat null and empty string the same 2026-05-29 10:55:53 +01:00
e00f7b5b67 Added tests 2026-05-26 13:31:33 +01:00
6ae09e15fb Updated tests and transformers 2026-05-20 16:17:02 +01:00
aa0b491080 Added tests 2026-05-19 13:04:16 +01:00
01436d0532 Import the model in test 2026-05-13 12:06:39 +01:00
96bf7d0c2b Fixed FD-52058 - Importer using wrong created_at date 2026-05-13 12:06:13 +01:00
7ec60bc6f2 Same as #18808 but renamed assetstatus to status 2026-04-02 11:26:23 +01:00
f802ea4d38 Fixed tests 2026-03-25 09:20:51 +00:00
446f5f3cef Run pint on tests 2026-03-16 17:40:57 -07:00
d84eb43278 Snake case FMCS and permission methods in tests 2026-03-16 17:36:35 -07:00
b1b390febf Removed flaky test
Signed-off-by: snipe <snipe@snipe.net>
2025-09-04 16:30:02 +01:00
be451fa0c0 Removed asset model from original factory
Signed-off-by: snipe <snipe@snipe.net>
2025-09-04 16:14:27 +01:00
905f61371d Fixed tests
Signed-off-by: snipe <snipe@snipe.net>
2025-09-04 16:02:40 +01:00
3524e23e38 Fixed tests
Signed-off-by: snipe <snipe@snipe.net>
2025-08-25 17:17:45 +01:00
40108b196c Trying to fix import tests :(
Signed-off-by: snipe <snipe@snipe.net>
2025-08-25 15:28:43 +01:00
a02792e9bf Merge pull request #17300 from uberbrady/add_actionlog_tests
Fixed #17071 - Adding various tests of the contents of ActionLogs for lots of events
2025-07-22 10:51:30 +01:00
58759acfe4 Think I hit _all_ of the tests we need to mess with here 2025-07-17 20:15:01 +01:00
1e6cef52c9 Fixed tests
Signed-off-by: snipe <snipe@snipe.net>
2025-07-15 15:17:08 +01:00