Commit graph

33 commits

Author SHA1 Message Date
Daniel Meltzer f432f98e12 Importer tests + Fixes (#3733)
* Fix Bug in User::generateFormattedNameFromFullName

In a name "John Doe", this method would split it into "John" and " Doe",
Leaving a space in the last name when importing to the database.  Strip
this space.

* Cleanup/fix some item mapping.

Also make some changes to the importer schema to allow for unit testing.
Generate a default item mapping, and then merge that with any custom
mappings.

* Beginning work on importer unit tests.

* Strip out testrun branches from importer.  It added a lot of complexity and was not terribly useful with web importer as it stood, might reconsider down the road however.

* Normalize the mapped keys when using custom field mappings.

* Add test for custom asset import mapping.

* Make all unit tests inherit from a new custom base.

This baseclass currently calls Artisan::migrate() and seeds a Settings
instance.  This fixes unit tests after the autoincrement bits.

* Store requestable as a boolean.  Fixes some import oddities

* Work on tests for accessory importer.

* Test for custom mapping of accessory import, also adjust the internal field for purchase date.

* Update default locale fallback for currency detection

* Fix Reassignable in consumable as well.

* More importer tests and fixes.
2017-07-11 20:37:02 -07:00
snipe 8aa920ca3a Update composer 2017-07-07 12:59:59 -07:00
snipe 9e0c5e50b6 Merge branch 'develop' of github.com:snipe/snipe-it into develop
# Conflicts:
#	composer.lock
2017-06-23 18:55:18 -07:00
snipe 95d1612234 Updated composer 2017-06-23 18:52:21 -07:00
Daniel Meltzer 61c6160b98 Importer mapping - v1 (#3677)
* Move importer to an inline-template, allows for translations and easier passing of data from laravel to vue.

* Pull the modal out into a dedicated partial, move importer to views/importer.

* Add document of CSV->importer mappings.  Reorganize some code.

Progress.

* Add header_row and first_row to imports table, and process upon uploading a file

* Use an expandable table row instead of a modal for import processing.  This should allow for field mapping interaction easier.

* Fix import processing after moving method.

* Frontend importer mapping improvements.

Invert display so we show found columns and allow users to select an
importer field to map to.  Also implement sample data based on first row
of csv.

* Update select2.  Maintain selected items properly.

* Backend support for importing.  Only works on the web importer currently.  Definitely needs testing and polish.

* We no longer use vue-modal plugin.

* Add a column to track field mappings to the imports table.

* Cleanup/rename methods+refactor

* Save field mappings and import type when attempting an import, and repopulate these values when returning to the page.

* Update debugbar to fix a bug in the debugbar code.

* Fix asset tag detection.

Also rename findMatch to be a bit clearer as to what it does.
  Remove logging to file of imports for http imports because
it eats an incredible amouint of memory.

This commit also moves imports out of the hardware namespace and into
their own webcontroller and route prefix, remove dead code from
AssetController as a result.

* Dynamically limit options for select2 based on import type selected, and group them by item type.

* Add user importer.

Still need to implement emailing of passwords to new users, and probably
test a bit more.

This also bumps the memory limit for web imports up as well, I need to
profile memory usage here before too long.

* Query the db to find user matches rather than search the array.  Performance is much much better.

* Speed/memory improvements in importers.

Move to querying the db rather than maintaining an array for all
importers.  Also only store the id of items when we import, rather than
the full model.  It saves a decent amount of memory.

* Remove grouping of items in select2

With the values being set dynamically, the grouping is redundant.  It
also caused a regression with automatically guessing/matching field
names.  This is starting to get close.

* Remove debug line on every create.

* Switch migration to be text field instead of json field for compatibility with older mysql/mariadb

* Fix asset import regression matching email address.

* Rearrange travis order in attempt to fix null settings.

* Use auth::id instead of fetching it off the user.  Fixes a null object reference during seeding.
2017-06-21 16:37:37 -07:00
snipe 9338b37b74 Try to fix the datepicker :(
Webpack has fucked everything. I hate everything.
2017-06-06 00:51:41 -07:00
snipe f6be7caaeb Updated composer to prevent ambiguous warnings 2017-04-27 18:50:00 -07:00
snipe 5ad9e8585d New composer options 2017-04-27 05:24:30 -07:00
snipe 6fbf45554b Updated phpunit, removed post install and post update commands to see if that fixes upgrade issues 2017-04-27 02:28:22 -07:00
snipe f4cdeaa956 Fixes #3514 - move tinker requirement out of dev 2017-04-25 07:46:56 -07:00
Daniel Meltzer 1bb89db451 A few fixes (#3437)
* This method was renamed, so we need to rename the eager load

* Readd tinker to the composer dev packages.

* Update sql dump for functional tests.
2017-03-31 13:48:31 -07:00
snipe 0469a44582 Bumped codeception version to fix travis breakage
Tests are still failing, but for the right reasons now
2017-03-11 17:12:21 -08:00
snipe 0c3840503e Laravel 5.4 2017-02-02 18:54:54 -08:00
snipe d02a7064e3 Added patchwork for fallback for systems without intl 2017-01-26 04:52:30 -08:00
snipe 481722507d Composer update 2017-01-25 21:33:11 -08:00
snipe dc47a0fad6 Fixes #2551 - use UTF-8 safe slugging for MySQL columns 2017-01-25 18:38:20 -08:00
snipe ca2fa3dab9 Added transformer autoload 2017-01-12 23:40:23 -08:00
snipe d1fecb6128 Added php codesniffer 2016-12-23 18:32:07 -08:00
snipe 030207d626 Downgrade laravel-backup for users not on PHP7 2016-12-14 11:11:48 -08:00
snipe 25f60264bd Passport scaffolding 2016-12-14 10:06:05 -08:00
snipe f6e567d5d4 Updated dependencies for 5.3 2016-12-14 04:32:34 -08:00
snipe cea255995c Fixes #106 - adds Google Authenticator support (#2842)
* refactor to clean up LDAP login, and make the login method easier to handle.

* Login refactor cleanup

* Google 2FA package

* Adds Google Authenticator two-factor

* Removed unused blade

* Added optin setting in profile

* Removed dumb comments

* Made lock_passwords check more consistent

* Additional two factor strings

* Lock passwords check

* Display feature disabled text if in demo mode

* Two factor admin reset options

* Translation strings
2016-10-29 05:50:55 -07:00
snipe e4dcd47d6c Fix UTF-8 issues in imports 2016-08-29 22:57:48 -07:00
snipe 4c787891e4 Use custom maintenance middleware 2016-08-11 19:22:26 -07:00
snipe ebc74a6530 [Security] Updating Guzzle to address CVE-2016-5385 2016-07-19 00:36:50 -07:00
snipe caee42e843 More valid composer name 2016-07-10 20:57:12 -07:00
snipe 6de943b226 Use latest spatie/laravel-backup 2016-07-07 05:04:45 -07:00
snipe 7ee135826f Updated composer with more accurate info 2016-07-07 02:07:42 -07:00
snipe 9144605b57 Updated php codesniffer 2016-07-01 01:05:32 -07:00
Nikolai Prokoschenko 8d03668d78 Fix reverse proxy support
Reintroducing trusted proxies via fideloper/proxy:

* Upgraded fideloper/proxy to 3.1
* Added fideloper/proxy to Http/Kernel.php
* Added fideloper/proxy to config/app.php
* Added environment variable APP_TRUSTED_PROXIES to env (with '*' being the default fallback)
2016-06-16 15:43:42 +02:00
snipe 9cfde523b0 Updated laravel-backup package
Files are still not being generated. Open a ticket with the package maintainer
2016-05-12 16:54:07 -07:00
snipe b9b8149234 Minor backups fixes 2016-05-12 16:20:23 -07:00
snipe fe00b0e401 Version 3 - hold onto your butts 2016-03-25 01:18:05 -07:00