Skip to content

Commit

Permalink
gerge branchevelop' into gh10191-css-dropdownmenu
Browse files Browse the repository at this point in the history
  • Loading branch information
Godmartinz committed Mar 3, 2022
2 parents 4435ea9 + 16fd109 commit 14bd07e
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -2514,7 +2514,7 @@
"code"
]
},
{
{
"login": "Haxatron",
"name": "Haxatron",
"avatar_url": "https://avatars.githubusercontent.com/u/76475453?v=4",
Expand All @@ -2541,7 +2541,7 @@
"code"
]
},
{
{
"login": "UniversalSuperBox",
"name": "Dalton Durst",
"avatar_url": "https://avatars.githubusercontent.com/u/21966173?v=4",
Expand Down
10 changes: 5 additions & 5 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/Importer/AssetImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function createAssetIfNotExists(array $row)
$this->log('No Matching Asset, Creating a new one');
$asset = new Asset;
}

$this->item['notes'] = $this->findCsvMatch($row, 'asset_notes');
$this->item['image'] = $this->findCsvMatch($row, 'image');
$this->item['requestable'] = $this->fetchHumanBoolean($this->findCsvMatch($row, 'requestable'));
$asset->requestable = $this->fetchHumanBoolean($this->findCsvMatch($row, 'requestable'));
Expand Down
2 changes: 2 additions & 0 deletions app/Importer/ItemImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ public function createOrFetchAssetModel(array $row)
$this->log('Matching Model found, updating it.');
$item = $this->sanitizeItemForStoring($asset_model, $editingModel);
$item['name'] = $asset_model_name;
$item['notes'] = $this->findCsvMatch($row, 'model_notes');

if(!empty($asset_modelNumber)){
$item['model_number'] = $asset_modelNumber;
Expand All @@ -238,6 +239,7 @@ public function createOrFetchAssetModel(array $row)
$item = $this->sanitizeItemForStoring($asset_model, $editingModel);
$item['name'] = $asset_model_name;
$item['model_number'] = $asset_modelNumber;
$item['notes'] = $this->findCsvMatch($row, 'model_notes');

$asset_model->fill($item);
$item = null;
Expand Down
21 changes: 15 additions & 6 deletions app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,21 @@ public function boot()
// to the logged in API user, but creating assets, licenses, etc won't work
// if the user can't view and interact with the select lists.
Gate::define('view.selectlists', function ($user) {
return $user->can(['create','update'], Asset::class)
|| $user->can(['create','update'], License::class)
|| $user->can(['create','update'], Component::class)
|| $user->can(['create','update'], Consumable::class)
|| $user->can(['create','update'], Accessory::class)
|| $user->can(['create','update'], User::class);
return $user->can('update', Asset::class)
|| $user->can('create', Asset::class)
|| $user->can('checkout', Asset::class)
|| $user->can('checkin', Asset::class)
|| $user->can('audit', Asset::class)
|| $user->can('update', License::class)
|| $user->can('create', License::class)
|| $user->can('update', Component::class)
|| $user->can('create', Component::class)
|| $user->can('update', Consumable::class)
|| $user->can('create', Consumable::class)
|| $user->can('update', Accessory::class)
|| $user->can('create', Accessory::class)
|| $user->can('update', User::class)
|| $user->can('create', User::class);
});
}
}
6 changes: 3 additions & 3 deletions database/factories/AssetFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use App\Models\Location;
use App\Models\Supplier;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\StatusLabel;

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -39,15 +38,16 @@ public function definition()
{
return [
'name' => null,
'rtd_location_id' => Location::factory()->create(),
'rtd_location_id' => Location::all()->random()->id,
'serial' => $this->faker->uuid,
'status_id' => $this->faker->numberBetween(1,5),
'status_id' => 1,
'user_id' => 1,
'asset_tag' => $this->faker->unixTime('now'),
'notes' => 'Created by DB seeder',
'purchase_date' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
'purchase_cost' => $this->faker->randomFloat(2, '299.99', '2999.99'),
'order_number' => $this->faker->numberBetween(1000000, 50000000),
'supplier_id' => Supplier::all()->random()->id,
'requestable' => $this->faker->boolean(),
'assigned_to' => null,
'assigned_type' => null,
Expand Down
21 changes: 18 additions & 3 deletions public/js/build/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,6 @@ __webpack_require__.r(__webpack_exports__);
}, {
id: 'manufacturer',
text: 'Manufacturer'
}, {
id: 'notes',
text: 'Notes'
}, {
id: 'order_number',
text: 'Order Number'
Expand Down Expand Up @@ -299,6 +296,9 @@ __webpack_require__.r(__webpack_exports__);
accessories: [{
id: 'model_number',
text: 'Model Number'
}, {
id: 'notes',
text: 'Notes'
}],
assets: [{
id: 'asset_tag',
Expand All @@ -318,6 +318,12 @@ __webpack_require__.r(__webpack_exports__);
}, {
id: 'model_number',
text: 'Model Number'
}, {
id: 'asset_notes',
text: 'Asset Notes'
}, {
id: 'model_notes',
text: 'Model Notes'
}, {
id: 'full_name',
text: 'Full Name'
Expand All @@ -343,6 +349,9 @@ __webpack_require__.r(__webpack_exports__);
}, {
id: 'min_amt',
text: "Minimum Quantity"
}, {
id: 'notes',
text: 'Notes'
}],
licenses: [{
id: 'asset_tag',
Expand All @@ -353,6 +362,9 @@ __webpack_require__.r(__webpack_exports__);
}, {
id: 'full_name',
text: 'Full Name'
}, {
id: 'notes',
text: 'Notes'
}, {
id: 'license_email',
text: 'Licensed To Email'
Expand Down Expand Up @@ -387,6 +399,9 @@ __webpack_require__.r(__webpack_exports__);
}, {
id: 'manager_first_name',
text: 'Manager First Name'
}, {
id: 'notes',
text: 'Notes'
}, {
id: 'manager_last_name',
text: 'Manager Last Name'
Expand Down
21 changes: 18 additions & 3 deletions public/js/dist/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -59403,9 +59403,6 @@ __webpack_require__.r(__webpack_exports__);
}, {
id: 'manufacturer',
text: 'Manufacturer'
}, {
id: 'notes',
text: 'Notes'
}, {
id: 'order_number',
text: 'Order Number'
Expand Down Expand Up @@ -59437,6 +59434,9 @@ __webpack_require__.r(__webpack_exports__);
accessories: [{
id: 'model_number',
text: 'Model Number'
}, {
id: 'notes',
text: 'Notes'
}],
assets: [{
id: 'asset_tag',
Expand All @@ -59456,6 +59456,12 @@ __webpack_require__.r(__webpack_exports__);
}, {
id: 'model_number',
text: 'Model Number'
}, {
id: 'asset_notes',
text: 'Asset Notes'
}, {
id: 'model_notes',
text: 'Model Notes'
}, {
id: 'full_name',
text: 'Full Name'
Expand All @@ -59481,6 +59487,9 @@ __webpack_require__.r(__webpack_exports__);
}, {
id: 'min_amt',
text: "Minimum Quantity"
}, {
id: 'notes',
text: 'Notes'
}],
licenses: [{
id: 'asset_tag',
Expand All @@ -59491,6 +59500,9 @@ __webpack_require__.r(__webpack_exports__);
}, {
id: 'full_name',
text: 'Full Name'
}, {
id: 'notes',
text: 'Notes'
}, {
id: 'license_email',
text: 'Licensed To Email'
Expand Down Expand Up @@ -59525,6 +59537,9 @@ __webpack_require__.r(__webpack_exports__);
}, {
id: 'manager_first_name',
text: 'Manager First Name'
}, {
id: 'notes',
text: 'Notes'
}, {
id: 'manager_last_name',
text: 'Manager Last Name'
Expand Down
7 changes: 6 additions & 1 deletion resources/assets/js/components/importer/importer-file.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
{id: 'location', text: 'Location' },
{id: 'maintained', text: 'Maintained' },
{id: 'manufacturer', text: 'Manufacturer' },
{id: 'notes', text: 'Notes' },
{id: 'order_number', text: 'Order Number' },
{id: 'purchase_cost', text: 'Purchase Cost' },
{id: 'purchase_date', text: 'Purchase Date' },
Expand All @@ -143,6 +142,7 @@
],
accessories:[
{id: 'model_number', text: 'Model Number'},
{id: 'notes', text: 'Notes' },
],
assets: [
{id: 'asset_tag', text: 'Asset Tag' },
Expand All @@ -151,6 +151,8 @@
{id: 'checkout_location', text: 'Checkout Location' },
{id: 'image', text: 'Image Filename' },
{id: 'model_number', text: 'Model Number' },
{id: 'asset_notes', text: 'Asset Notes' },
{id: 'model_notes', text: 'Model Notes' },
{id: 'full_name', text: 'Full Name' },
{id: 'status', text: 'Status' },
{id: 'warranty_months', text: 'Warranty Months' },
Expand All @@ -161,11 +163,13 @@
{id: 'item_no', text: "Item Number"},
{id: 'model_number', text: "Model Number"},
{id: 'min_amt', text: "Minimum Quantity"},
{id: 'notes', text: 'Notes' },
],
licenses: [
{id: 'asset_tag', text: 'Assigned To Asset'},
{id: 'expiration_date', text: 'Expiration Date' },
{id: 'full_name', text: 'Full Name' },
{id: 'notes', text: 'Notes' },
{id: 'license_email', text: 'Licensed To Email' },
{id: 'license_name', text: 'Licensed To Name' },
{id: 'purchase_order', text: 'Purchase Order' },
Expand All @@ -179,6 +183,7 @@
{id: 'last_name', text: 'Last Name' },
{id: 'phone_number', text: 'Phone Number' },
{id: 'manager_first_name', text: 'Manager First Name' },
{id: 'notes', text: 'Notes' },
{id: 'manager_last_name', text: 'Manager Last Name' },
{id: 'activated', text: 'Activated' },
{id: 'address', text: 'Address' },
Expand Down
4 changes: 2 additions & 2 deletions resources/views/hardware/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<li>
<a href="#components" data-toggle="tab">
<span class="hidden-lg hidden-md">
<i class="far fa-hdd" aria-hidden="true"></i>
<i class="far fa-hdd fa-2x" aria-hidden="true"></i>
</span>
<span class="hidden-xs hidden-sm">{{ trans('general.components') }}
{!! ($asset->components->count() > 0 ) ? '<badge class="badge badge-secondary">'.$asset->components->count().'</badge>' : '' !!}
Expand Down Expand Up @@ -315,7 +315,7 @@
</strong>
</div>
<div class="col-md-6">
<ul class="list-unstyled" style="line-height: 25px;">
<ul class="list-unstyled">
@can('view', \App\Models\Manufacturer::class)

<li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
@if ((isset($item->name)) && ($item->name!=''))
| **{{ trans('mail.asset_name') }}** | {{ $item->name }} |
@endif
@if (($item->name!=$item->asset_tag))
| **{{ trans('mail.asset_tag') }}** | {{ $item->asset_tag }} |
@endif
@if (isset($item->manufacturer))
| **{{ trans('general.manufacturer') }}** | {{ $item->manufacturer->name }} |
@endif
@if (isset($item->model))
| **{{ trans('general.asset_model') }}** | {{ $item->model->name }} |
@endif
@if (isset($item->model->model_number))
@if ((isset($item->model->model_number)) && ($item->model->name!=$item->model->model_number))
| **{{ trans('general.model_no') }}** | {{ $item->model->model_number }} |
@endif
@if (isset($item->serial))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
@if ((isset($item->name)) && ($item->name!=''))
| **{{ trans('mail.asset_name') }}** | {{ $item->name }} |
@endif
@if (($item->name!=$item->asset_tag))
| **{{ trans('mail.asset_tag') }}** | {{ $item->asset_tag }} |
@endif
@if (isset($item->manufacturer))
| **{{ trans('general.manufacturer') }}** | {{ $item->manufacturer->name }} |
@endif
@if (isset($item->model))
| **{{ trans('general.asset_model') }}** | {{ $item->model->name }} |
@endif
@if (isset($item->model->model_number))
@if ((isset($item->model->model_number)) && ($item->model->name!=$item->model->model_number))
| **{{ trans('general.model_no') }}** | {{ $item->model->model_number }} |
@endif
@if (isset($item->serial))
Expand Down

0 comments on commit 14bd07e

Please sign in to comment.