Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2025-04-22 11:42:49 +01:00
commit 90c1c0e655
4 changed files with 101 additions and 85 deletions

View file

@ -2,6 +2,7 @@
namespace App\Http\Transformers; namespace App\Http\Transformers;
use App\Helpers\Helper;
use App\Models\License; use App\Models\License;
use App\Models\LicenseSeat; use App\Models\LicenseSeat;
use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\Gate;
@ -26,6 +27,7 @@ class LicenseSeatsTransformer
$array = [ $array = [
'id' => (int) $seat->id, 'id' => (int) $seat->id,
'license_id' => (int) $seat->license->id, 'license_id' => (int) $seat->license->id,
'updated_at' => Helper::getFormattedDateObject($seat->updated_at, 'datetime'), // we use updated_at here because the record gets updated when it's checked in or out
'assigned_user' => ($seat->user) ? [ 'assigned_user' => ($seat->user) ? [
'id' => (int) $seat->user->id, 'id' => (int) $seat->user->id,
'name'=> e($seat->user->present()->fullName), 'name'=> e($seat->user->present()->fullName),
@ -36,14 +38,17 @@ class LicenseSeatsTransformer
'name' => e($seat->user->department->name), 'name' => e($seat->user->department->name),
] : null, ] : null,
'created_at' => Helper::getFormattedDateObject($seat->created_at, 'datetime'),
] : null, ] : null,
'assigned_asset' => ($seat->asset) ? [ 'assigned_asset' => ($seat->asset) ? [
'id' => (int) $seat->asset->id, 'id' => (int) $seat->asset->id,
'name'=> e($seat->asset->present()->fullName), 'name'=> e($seat->asset->present()->fullName),
'created_at' => Helper::getFormattedDateObject($seat->created_at, 'datetime'),
] : null, ] : null,
'location' => ($seat->location()) ? [ 'location' => ($seat->location()) ? [
'id' => (int) $seat->location()->id, 'id' => (int) $seat->location()->id,
'name'=> e($seat->location()->name), 'name'=> e($seat->location()->name),
'created_at' => Helper::getFormattedDateObject($seat->created_at, 'datetime'),
] : null, ] : null,
'reassignable' => (bool) $seat->license->reassignable, 'reassignable' => (bool) $seat->license->reassignable,
'notes' => e($seat->notes), 'notes' => e($seat->notes),

View file

@ -280,6 +280,14 @@ class LicensePresenter extends Presenter
'visible' => true, 'visible' => true,
'formatter' => 'locationsLinkObjFormatter', 'formatter' => 'locationsLinkObjFormatter',
], ],
[
'field' => 'updated_at',
'searchable' => false,
'sortable' => true,
'visible' => false,
'title' => trans('general.date'),
'formatter' => 'dateDisplayFormatter',
],
[ [
'field' => 'notes', 'field' => 'notes',
'searchable' => false, 'searchable' => false,

169
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "87742cc73d186f6f47627ad498cf0fe5", "content-hash": "2e91e2f670634312429f20fda573e6a1",
"packages": [ "packages": [
{ {
"name": "alek13/slack", "name": "alek13/slack",
@ -342,30 +342,30 @@
}, },
{ {
"name": "barryvdh/laravel-debugbar", "name": "barryvdh/laravel-debugbar",
"version": "v3.14.10", "version": "v3.15.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/barryvdh/laravel-debugbar.git", "url": "https://github.com/barryvdh/laravel-debugbar.git",
"reference": "56b9bd235e3fe62e250124804009ce5bab97cc63" "reference": "c0667ea91f7185f1e074402c5788195e96bf8106"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/56b9bd235e3fe62e250124804009ce5bab97cc63", "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/c0667ea91f7185f1e074402c5788195e96bf8106",
"reference": "56b9bd235e3fe62e250124804009ce5bab97cc63", "reference": "c0667ea91f7185f1e074402c5788195e96bf8106",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"illuminate/routing": "^9|^10|^11", "illuminate/routing": "^9|^10|^11|^12",
"illuminate/session": "^9|^10|^11", "illuminate/session": "^9|^10|^11|^12",
"illuminate/support": "^9|^10|^11", "illuminate/support": "^9|^10|^11|^12",
"maximebf/debugbar": "~1.23.0", "php": "^8.1",
"php": "^8.0", "php-debugbar/php-debugbar": "~2.1.1",
"symfony/finder": "^6|^7" "symfony/finder": "^6|^7"
}, },
"require-dev": { "require-dev": {
"mockery/mockery": "^1.3.3", "mockery/mockery": "^1.3.3",
"orchestra/testbench-dusk": "^5|^6|^7|^8|^9", "orchestra/testbench-dusk": "^7|^8|^9|^10",
"phpunit/phpunit": "^9.6|^10.5", "phpunit/phpunit": "^9.5.10|^10|^11",
"squizlabs/php_codesniffer": "^3.5" "squizlabs/php_codesniffer": "^3.5"
}, },
"type": "library", "type": "library",
@ -379,7 +379,7 @@
] ]
}, },
"branch-alias": { "branch-alias": {
"dev-master": "3.14-dev" "dev-master": "3.15-dev"
} }
}, },
"autoload": { "autoload": {
@ -404,13 +404,14 @@
"keywords": [ "keywords": [
"debug", "debug",
"debugbar", "debugbar",
"dev",
"laravel", "laravel",
"profiler", "profiler",
"webprofiler" "webprofiler"
], ],
"support": { "support": {
"issues": "https://github.com/barryvdh/laravel-debugbar/issues", "issues": "https://github.com/barryvdh/laravel-debugbar/issues",
"source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.14.10" "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.15.4"
}, },
"funding": [ "funding": [
{ {
@ -422,7 +423,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2024-12-23T10:10:42+00:00" "time": "2025-04-16T06:32:06+00:00"
}, },
{ {
"name": "barryvdh/laravel-dompdf", "name": "barryvdh/laravel-dompdf",
@ -4609,74 +4610,6 @@
}, },
"time": "2024-03-31T07:05:07+00:00" "time": "2024-03-31T07:05:07+00:00"
}, },
{
"name": "maximebf/debugbar",
"version": "v1.23.5",
"source": {
"type": "git",
"url": "https://github.com/php-debugbar/php-debugbar.git",
"reference": "eeabd61a1f19ba5dcd5ac4585a477130ee03ce25"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/eeabd61a1f19ba5dcd5ac4585a477130ee03ce25",
"reference": "eeabd61a1f19ba5dcd5ac4585a477130ee03ce25",
"shasum": ""
},
"require": {
"php": "^7.2|^8",
"psr/log": "^1|^2|^3",
"symfony/var-dumper": "^4|^5|^6|^7"
},
"require-dev": {
"dbrekelmans/bdi": "^1",
"phpunit/phpunit": "^8|^9",
"symfony/panther": "^1|^2.1",
"twig/twig": "^1.38|^2.7|^3.0"
},
"suggest": {
"kriswallsmith/assetic": "The best way to manage assets",
"monolog/monolog": "Log using Monolog",
"predis/predis": "Redis storage"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.23-dev"
}
},
"autoload": {
"psr-4": {
"DebugBar\\": "src/DebugBar/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Maxime Bouroumeau-Fuseau",
"email": "maxime.bouroumeau@gmail.com",
"homepage": "http://maximebf.com"
},
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"description": "Debug bar in the browser for php application",
"homepage": "https://github.com/maximebf/php-debugbar",
"keywords": [
"debug",
"debugbar"
],
"support": {
"issues": "https://github.com/php-debugbar/php-debugbar/issues",
"source": "https://github.com/php-debugbar/php-debugbar/tree/v1.23.5"
},
"time": "2024-12-15T19:20:42+00:00"
},
{ {
"name": "monolog/monolog", "name": "monolog/monolog",
"version": "3.9.0", "version": "3.9.0",
@ -6004,6 +5937,76 @@
}, },
"time": "2024-04-08T12:52:34+00:00" "time": "2024-04-08T12:52:34+00:00"
}, },
{
"name": "php-debugbar/php-debugbar",
"version": "v2.1.6",
"source": {
"type": "git",
"url": "https://github.com/php-debugbar/php-debugbar.git",
"reference": "16fa68da5617220594aa5e33fa9de415f94784a0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/16fa68da5617220594aa5e33fa9de415f94784a0",
"reference": "16fa68da5617220594aa5e33fa9de415f94784a0",
"shasum": ""
},
"require": {
"php": "^8",
"psr/log": "^1|^2|^3",
"symfony/var-dumper": "^4|^5|^6|^7"
},
"require-dev": {
"dbrekelmans/bdi": "^1",
"phpunit/phpunit": "^8|^9",
"symfony/panther": "^1|^2.1",
"twig/twig": "^1.38|^2.7|^3.0"
},
"suggest": {
"kriswallsmith/assetic": "The best way to manage assets",
"monolog/monolog": "Log using Monolog",
"predis/predis": "Redis storage"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-4": {
"DebugBar\\": "src/DebugBar/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Maxime Bouroumeau-Fuseau",
"email": "maxime.bouroumeau@gmail.com",
"homepage": "http://maximebf.com"
},
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"description": "Debug bar in the browser for php application",
"homepage": "https://github.com/php-debugbar/php-debugbar",
"keywords": [
"debug",
"debug bar",
"debugbar",
"dev"
],
"support": {
"issues": "https://github.com/php-debugbar/php-debugbar/issues",
"source": "https://github.com/php-debugbar/php-debugbar/tree/v2.1.6"
},
"time": "2025-02-21T17:47:03+00:00"
},
{ {
"name": "phpdocumentor/reflection-common", "name": "phpdocumentor/reflection-common",
"version": "2.2.0", "version": "2.2.0",

View file

@ -132,8 +132,8 @@ class ImportAssetModelsTest extends ImportDataTestCase implements TestsPermissio
$this->assertEquals($row['model_number'], $updatedAssetmodel->model_number); $this->assertEquals($row['model_number'], $updatedAssetmodel->model_number);
$this->assertEquals( $this->assertEquals(
Arr::except($assetmodel->attributesToArray(), $updatedAttributes), Arr::except($assetmodel->attributesToArray(), array_merge($updatedAttributes, $assetmodel->getDates())),
Arr::except($updatedAssetmodel->attributesToArray(), $updatedAttributes), Arr::except($updatedAssetmodel->attributesToArray(), array_merge($updatedAttributes, $assetmodel->getDates())),
); );
} }