mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-30 07:59:50 -08:00
Merge pull request #12958 from uberbrady/snipeit_v7_merge_develop_05_01_2022
Snipeit v7 merge develop 05 01 2022
This commit is contained in:
commit
31f1bce16b
|
@ -175,6 +175,15 @@ REQUIRE_SAML=false
|
|||
API_THROTTLE_PER_MINUTE=120
|
||||
CSV_ESCAPE_FORMULAS=true
|
||||
|
||||
# --------------------------------------------
|
||||
# OPTIONAL: HASHING
|
||||
# --------------------------------------------
|
||||
HASHING_DRIVER='bcrypt'
|
||||
BCRYPT_ROUNDS=10
|
||||
ARGON_MEMORY=1024
|
||||
ARGON_THREADS=2
|
||||
ARGON_TIME=2
|
||||
|
||||
# --------------------------------------------
|
||||
# OPTIONAL: SCIM
|
||||
# --------------------------------------------
|
||||
|
|
|
@ -38,6 +38,9 @@ class CategoriesTransformer
|
|||
case 'component':
|
||||
$category->item_count = $category->components_count;
|
||||
break;
|
||||
case 'license':
|
||||
$category->item_count = $category->licenses_count;
|
||||
break;
|
||||
default:
|
||||
$category->item_count = 0;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class Manufacturer extends SnipeModel
|
|||
'url' => 'url|nullable',
|
||||
'support_email' => 'email|nullable',
|
||||
'support_url' => 'nullable|url',
|
||||
'warranty_lookup_url' => 'starts_with:http://,https://,afp://,facetime://,file://,irc://','nullable'
|
||||
'warranty_lookup_url' => 'nullable|starts_with:http://,https://,afp://,facetime://,file://,irc://'
|
||||
];
|
||||
|
||||
protected $hidden = ['user_id'];
|
||||
|
|
|
@ -151,6 +151,21 @@ class LicensePresenter extends Presenter
|
|||
'visible' => false,
|
||||
'title' => trans('general.order_number'),
|
||||
], [
|
||||
'field' => 'created_at',
|
||||
'searchable' => false,
|
||||
'sortable' => true,
|
||||
'visible' => false,
|
||||
'title' => trans('general.created_at'),
|
||||
'formatter' => 'dateDisplayFormatter',
|
||||
], [
|
||||
'field' => 'updated_at',
|
||||
'searchable' => false,
|
||||
'sortable' => true,
|
||||
'visible' => false,
|
||||
'title' => trans('general.updated_at'),
|
||||
'formatter' => 'dateDisplayFormatter',
|
||||
],
|
||||
[
|
||||
'field' => 'notes',
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
|
|
|
@ -15,7 +15,7 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'driver' => 'bcrypt',
|
||||
'driver' => env('HASHING_DRIVER', 'bcrypt'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -44,9 +44,9 @@ return [
|
|||
*/
|
||||
|
||||
'argon' => [
|
||||
'memory' => 1024,
|
||||
'threads' => 2,
|
||||
'time' => 2,
|
||||
'memory' => env('ARGON_MEMORY', 1024),
|
||||
'threads' => env('ARGON_THREADS', 2),
|
||||
'time' => env('ARGON_TIME', 2),
|
||||
],
|
||||
|
||||
];
|
||||
|
|
|
@ -514,7 +514,7 @@
|
|||
|
||||
if (value) {
|
||||
if ((value.indexOf("{") === -1) || (value.indexOf("}") ===-1)) {
|
||||
return '<i class="fa fa-external-link"></i> <a href="' + value + '" target="_blank">' + value + '</a>';
|
||||
return '<nobr><a href="' + value + '" target="_blank" title="External link to ' + value + '" data-tooltip="true" ><i class="fa fa-external-link"></i> ' + value + '</a></nobr>';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
|
|
@ -2,12 +2,16 @@
|
|||
|
||||
namespace Tests\Support;
|
||||
|
||||
use App\Models\Setting;
|
||||
|
||||
trait InteractsWithSettings
|
||||
{
|
||||
protected Settings $settings;
|
||||
|
||||
public function setUpSettings()
|
||||
public function initializeSettings()
|
||||
{
|
||||
$this->settings = Settings::initialize();
|
||||
|
||||
$this->beforeApplicationDestroyed(fn() => Setting::$_cache = null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ abstract class TestCase extends BaseTestCase
|
|||
$this->withoutMiddleware($this->globallyDisabledMiddleware);
|
||||
|
||||
if (collect(class_uses_recursive($this))->contains(InteractsWithSettings::class)) {
|
||||
$this->setUpSettings();
|
||||
$this->initializeSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,10 +3,13 @@ namespace Tests\Unit;
|
|||
|
||||
use App\Models\AssetMaintenance;
|
||||
use Carbon\Carbon;
|
||||
use Tests\Support\InteractsWithSettings;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AssetMaintenanceTest extends TestCase
|
||||
{
|
||||
use InteractsWithSettings;
|
||||
|
||||
public function testZerosOutWarrantyIfBlank()
|
||||
{
|
||||
$c = new AssetMaintenance;
|
||||
|
|
|
@ -4,10 +4,13 @@ namespace Tests\Unit;
|
|||
use App\Models\Asset;
|
||||
use App\Models\Category;
|
||||
use App\Models\AssetModel;
|
||||
use Tests\Support\InteractsWithSettings;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AssetModelTest extends TestCase
|
||||
{
|
||||
use InteractsWithSettings;
|
||||
|
||||
public function testAnAssetModelZerosOutBlankEols()
|
||||
{
|
||||
$am = new AssetModel;
|
||||
|
|
|
@ -5,10 +5,13 @@ use App\Models\Asset;
|
|||
use App\Models\AssetModel;
|
||||
use App\Models\Category;
|
||||
use Carbon\Carbon;
|
||||
use Tests\Support\InteractsWithSettings;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AssetTest extends TestCase
|
||||
{
|
||||
use InteractsWithSettings;
|
||||
|
||||
// public function testAutoIncrementMixed()
|
||||
// {
|
||||
// $expected = '123411';
|
||||
|
|
|
@ -4,10 +4,13 @@ namespace Tests\Unit;
|
|||
use App\Models\Category;
|
||||
use App\Models\AssetModel;
|
||||
use App\Models\Asset;
|
||||
use Tests\Support\InteractsWithSettings;
|
||||
use Tests\TestCase;
|
||||
|
||||
class CategoryTest extends TestCase
|
||||
{
|
||||
use InteractsWithSettings;
|
||||
|
||||
public function testFailsEmptyValidation()
|
||||
{
|
||||
// An Asset requires a name, a qty, and a category_id.
|
||||
|
|
|
@ -5,10 +5,13 @@ use App\Models\Category;
|
|||
use App\Models\Company;
|
||||
use App\Models\Component;
|
||||
use App\Models\Location;
|
||||
use Tests\Support\InteractsWithSettings;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ComponentTest extends TestCase
|
||||
{
|
||||
use InteractsWithSettings;
|
||||
|
||||
public function testAComponentBelongsToACompany()
|
||||
{
|
||||
$component = Component::factory()
|
||||
|
|
|
@ -5,10 +5,13 @@ use App\Models\Depreciation;
|
|||
use App\Models\Category;
|
||||
use App\Models\License;
|
||||
use App\Models\AssetModel;
|
||||
use Tests\Support\InteractsWithSettings;
|
||||
use Tests\TestCase;
|
||||
|
||||
class DepreciationTest extends TestCase
|
||||
{
|
||||
use InteractsWithSettings;
|
||||
|
||||
public function testADepreciationHasModels()
|
||||
{
|
||||
$depreciation = Depreciation::factory()->create();
|
||||
|
|
|
@ -8,10 +8,13 @@ use App\Models\Category;
|
|||
use Carbon\Carbon;
|
||||
use App\Notifications\CheckoutAssetNotification;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Tests\Support\InteractsWithSettings;
|
||||
use Tests\TestCase;
|
||||
|
||||
class NotificationTest extends TestCase
|
||||
{
|
||||
use InteractsWithSettings;
|
||||
|
||||
public function testAUserIsEmailedIfTheyCheckoutAnAssetWithEULA()
|
||||
{
|
||||
$admin = User::factory()->superuser()->create();
|
||||
|
|
|
@ -2,10 +2,13 @@
|
|||
namespace Tests\Unit;
|
||||
|
||||
use App\Models\SnipeModel;
|
||||
use Tests\Support\InteractsWithSettings;
|
||||
use Tests\TestCase;
|
||||
|
||||
class SnipeModelTest extends TestCase
|
||||
{
|
||||
use InteractsWithSettings;
|
||||
|
||||
public function testSetsPurchaseDatesAppropriately()
|
||||
{
|
||||
$c = new SnipeModel;
|
||||
|
|
Loading…
Reference in a new issue