Compare commits

...

52 Commits

Author SHA1 Message Date
snipe dc7b9315b5 Merge remote-tracking branch 'origin/develop' 2024-06-19 10:35:54 +01:00
snipe 6c17b141db Removed duplicate locations_id search
Signed-off-by: snipe <snipe@snipe.net>
2024-06-19 10:35:21 +01:00
snipe 5d2cca855e Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2024-06-19 10:31:04 +01:00
snipe 61e10be04d Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2024-06-19 10:29:50 +01:00
snipe 20d5587851 Merge remote-tracking branch 'origin/develop' 2024-06-19 10:23:18 +01:00
snipe d8eccf03f1 Merge pull request #14896 from snipe/fixes/tls_loading
Possible fix for proxy/reverse proxy
2024-06-19 10:22:36 +01:00
snipe 6e40b58dc5 Merge remote-tracking branch 'origin/develop' 2024-06-19 01:21:52 +01:00
snipe b8882fa00e Merge pull request #14900 from marcusmoore/fixes/81-install
Fixed unable to install on PHP 8.1
2024-06-18 21:53:30 +01:00
Marcus Moore af337b7018 Move debugbar back to dev dependencies but without updating other packages 2024-06-18 09:46:08 -07:00
Marcus Moore f60267d208 Revert "Reverted debugbar back into require vs require-dev"
This reverts commit ce338c632d.
2024-06-18 09:42:21 -07:00
snipe a0c844f4f6 Merge remote-tracking branch 'origin/develop' 2024-06-18 16:12:20 +01:00
snipe 7b84b92e72 Merge pull request #14899 from snipe/fixes/revert_debugbar_dev
Fixed #14898 - (regression) Reverted debugbar back into require vs require-dev
2024-06-18 16:09:51 +01:00
snipe ce338c632d Reverted debugbar back into require vs require-dev
Signed-off-by: snipe <snipe@snipe.net>
2024-06-18 16:06:38 +01:00
snipe d9f70c16f7 Possible fix proxy/reverse proxy
Signed-off-by: snipe <snipe@snipe.net>
2024-06-18 14:44:35 +01:00
snipe d0299de898 Merge remote-tracking branch 'origin/develop' 2024-06-18 11:25:55 +01:00
snipe 9380c9ec81 Merge pull request #14894 from snipe/fixes/14882_archived_scoping_on_models
Fixed #14882 - Properly scope archived based on settings
2024-06-18 11:24:55 +01:00
snipe 941582ac2a Properly scope archived based on settings
Signed-off-by: snipe <snipe@snipe.net>
2024-06-18 10:27:11 +01:00
snipe 04560b4475 Merge remote-tracking branch 'origin/develop' 2024-06-18 10:13:57 +01:00
snipe 0b30ad0da2 Removed test file - #14890
Signed-off-by: snipe <snipe@snipe.net>
2024-06-18 10:12:57 +01:00
snipe cb6ea2c6fb Merge remote-tracking branch 'origin/develop' 2024-06-18 09:59:43 +01:00
snipe 89a5bbb10e Merge pull request #14893 from snipe/fixes/rb_3792_ambiguous_query
Prefaced fields with “users” for clarity
2024-06-18 09:58:44 +01:00
snipe 2f59bb74cd Prefaced fields with “users” for clarity
Signed-off-by: snipe <snipe@snipe.net>
2024-06-18 09:52:41 +01:00
snipe 6c6a3649ea Production assets
Signed-off-by: snipe <snipe@snipe.net>
2024-06-18 09:33:07 +01:00
snipe 05b97db747 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2024-06-18 09:32:30 +01:00
snipe 543e4c0666 Bumped version file
Signed-off-by: snipe <snipe@snipe.net>
2024-06-18 09:31:49 +01:00
snipe e28619f769 Bumped papaparse library
Signed-off-by: snipe <snipe@snipe.net>
2024-06-18 09:30:24 +01:00
snipe 4d8c2d3f4e Merge pull request #14886 from marcusmoore/fixes/debugbar
Bumped debugbar from v3.13.0 to v3.13.5 to fix issue with session messages
2024-06-18 09:22:18 +01:00
snipe f53eeb8b33 Merge pull request #14887 from marcusmoore/fixes/fix-test-namespace
Fixed namespace for ViewUserTest
2024-06-18 09:20:58 +01:00
snipe aba6d9b338 Merge pull request #14885 from marcusmoore/tests/asset-model-test-improvements
Added more tests around Asset Model
2024-06-18 09:20:45 +01:00
snipe cd5bef414c Merge pull request #14884 from marcusmoore/fix/actionlogcontroller-fix
Fixed missing `}`
2024-06-18 09:20:26 +01:00
Marcus Moore 4f2d2ae4b8 Fix namespace for ViewUserTest 2024-06-17 16:37:24 -07:00
Marcus Moore 1bd0ab7389 Move barryvdh/laravel-debugbar from require to require-dev 2024-06-17 16:28:08 -07:00
Marcus Moore 8799276c6e Bump debugbar from v3.13.0 to v3.13.5 2024-06-17 16:25:39 -07:00
Marcus Moore 672aabf4ac Add more tests for Asset Model index and store methods 2024-06-17 14:51:59 -07:00
Marcus Moore 796d6909d5 Add missing } 2024-06-17 14:40:06 -07:00
snipe cbb5b6e846 Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2024-06-17 15:58:27 +01:00
snipe 08bd39dbba Bumped version
Signed-off-by: snipe <snipe@snipe.net>
2024-06-17 15:57:32 +01:00
snipe 430808e180 Merge remote-tracking branch 'origin/develop' 2024-06-17 15:52:13 +01:00
snipe 6976dc2b26 Merge pull request #14879 from snipe/fixes/better_ui_for_oauth
Fixed weird layout in admin oauth [sc-25673]
2024-06-17 15:51:11 +01:00
snipe 27063d5bae Fix weird layout in admin oauth [sc-25673]
Signed-off-by: snipe <snipe@snipe.net>
2024-06-17 15:44:07 +01:00
snipe 5be86b9dbb Merge remote-tracking branch 'origin/develop' 2024-06-17 13:43:45 +01:00
snipe afc78524fc Merge pull request #14877 from snipe/fixes/spatie-backup-config
Updated config
2024-06-17 13:42:02 +01:00
snipe eb33a2451f Updated config
Signed-off-by: snipe <snipe@snipe.net>
2024-06-17 13:36:52 +01:00
snipe 891a0a0965 Merge branch 'develop' of https://github.com/snipe/snipe-it into develop 2024-06-17 13:05:31 +01:00
snipe 50f0797850 Added aria hidden to icon
Signed-off-by: snipe <snipe@snipe.net>
2024-06-17 13:05:27 +01:00
snipe 36cdf0e0be Merge pull request #14876 from snipe/fixes/small_footer_issues
Fixed small footer issues
2024-06-17 12:53:52 +01:00
snipe d9cc3c3ec7 Removed extra divs
Signed-off-by: snipe <snipe@snipe.net>
2024-06-17 12:52:23 +01:00
snipe 069a1608de Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net>

# Conflicts:
#	config/version.php
2024-06-17 12:10:13 +01:00
snipe 60accfd601 Bumped version file
Signed-off-by: snipe <snipe@snipe.net>
2024-06-17 12:09:30 +01:00
snipe b1f2051b43 Merge remote-tracking branch 'origin/develop' 2024-06-17 11:58:11 +01:00
snipe 233e4af7f8 Added base asset models test
Signed-off-by: snipe <snipe@snipe.net>
2024-06-17 11:57:30 +01:00
snipe dc1b808a28 Fixed static request
Signed-off-by: snipe <snipe@snipe.net>
2024-06-17 11:47:21 +01:00
23 changed files with 237 additions and 146 deletions
+16 -14
View File
@@ -17,22 +17,24 @@ class ActionlogController extends Controller
$disk = config('filesystems.default');
switch (config("filesystems.disks.$disk.driver")) {
case 's3':
$file = 'private_uploads/signatures/'.$filename;
return redirect()->away(Storage::disk($disk)->temporaryUrl($file, now()->addMinutes(5)));
default:
$this->authorize('view', \App\Models\Asset::class);
$file = config('app.private_uploads').'/signatures/'.$filename;
$filetype = Helper::checkUploadIsImage($file);
case 's3':
$file = 'private_uploads/signatures/'.$filename;
return redirect()->away(Storage::disk($disk)->temporaryUrl($file, now()->addMinutes(5)));
default:
$this->authorize('view', \App\Models\Asset::class);
$file = config('app.private_uploads').'/signatures/'.$filename;
$filetype = Helper::checkUploadIsImage($file);
$contents = file_get_contents($file, false, stream_context_create(['http' => ['ignore_errors' => true]]));
if ($contents === false) {
Log::warning('File '.$file.' not found');
return false;
} else {
return Response::make($contents)->header('Content-Type', $filetype);
}
$contents = file_get_contents($file, false, stream_context_create(['http' => ['ignore_errors' => true]]));
if ($contents === false) {
Log::warning('File '.$file.' not found');
return false;
} else {
return Response::make($contents)->header('Content-Type', $filetype);
}
}
}
public function getStoredEula($filename){
$this->authorize('view', \App\Models\Asset::class);
$file = config('app.private_uploads').'/eula-pdfs/'.$filename;
@@ -203,9 +203,6 @@ class UsersController extends Controller
$users->where('autoassign_licenses', '=', $request->input('autoassign_licenses'));
}
if ($request->filled('location_id') != '') {
$users = $users->UserLocation($request->input('location_id'), $request->input('search'));
}
if (($request->filled('deleted')) && ($request->input('deleted') == 'true')) {
$users = $users->onlyTrashed();
@@ -85,7 +85,7 @@ class AssetModelsController extends Controller
$model->category_id = $request->input('category_id');
$model->notes = $request->input('notes');
$model->user_id = Auth::id();
$model->requestable = Request::has('requestable');
$model->requestable = $request->has('requestable');
if ($request->input('fieldset_id') != '') {
$model->fieldset_id = $request->input('fieldset_id');
@@ -288,7 +288,7 @@ class AssetModelsController extends Controller
public function show($modelId = null)
{
$this->authorize('view', AssetModel::class);
$model = AssetModel::withTrashed()->withCount('assets')->find($modelId);
$model = AssetModel::withTrashed()->find($modelId);
if (isset($model->id)) {
return view('models/view', compact('model'));
+10 -10
View File
@@ -827,16 +827,16 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
return $query->where('location_id','=', $location)
->where('first_name', 'LIKE', '%' . $search . '%')
->orWhere('email', 'LIKE', '%' . $search . '%')
->orWhere('last_name', 'LIKE', '%' . $search . '%')
->orWhere('permissions', 'LIKE', '%' . $search . '%')
->orWhere('country', 'LIKE', '%' . $search . '%')
->orWhere('phone', 'LIKE', '%' . $search . '%')
->orWhere('jobtitle', 'LIKE', '%' . $search . '%')
->orWhere('employee_num', 'LIKE', '%' . $search . '%')
->orWhere('username', 'LIKE', '%' . $search . '%')
->orwhereRaw('CONCAT(first_name," ",last_name) LIKE \''.$search.'%\'');
->where('users.first_name', 'LIKE', '%' . $search . '%')
->orWhere('users.email', 'LIKE', '%' . $search . '%')
->orWhere('users.last_name', 'LIKE', '%' . $search . '%')
->orWhere('users.permissions', 'LIKE', '%' . $search . '%')
->orWhere('users.country', 'LIKE', '%' . $search . '%')
->orWhere('users.phone', 'LIKE', '%' . $search . '%')
->orWhere('users.jobtitle', 'LIKE', '%' . $search . '%')
->orWhere('users.employee_num', 'LIKE', '%' . $search . '%')
->orWhere('users.username', 'LIKE', '%' . $search . '%')
->orwhereRaw('CONCAT(users.first_name," ",users.last_name) LIKE \''.$search.'%\'');
+14 -8
View File
@@ -21,6 +21,7 @@ use Illuminate\Routing\UrlGenerator;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\URL;
/**
* This service provider handles setting the observers on models
@@ -31,7 +32,7 @@ use Illuminate\Support\Facades\Log;
class AppServiceProvider extends ServiceProvider
{
/**
* Custom email array validation
* Bootstrap application services.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v3.0]
@@ -39,19 +40,24 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot(UrlGenerator $url)
{
if (env('APP_FORCE_TLS')) {
if (strpos(env('APP_URL'), 'https') === 0) {
$url->forceScheme('https');
} else {
Log::debug("'APP_FORCE_TLS' is set to true, but 'APP_URL' does not start with 'https://'. Will not force TLS on connections.");
}
/**
* This is a workaround for proxies/reverse proxies that don't always pass the proper headers.
*
* Here, we check if the APP_URL starts with https://, which we should always honor,
* regardless of how well the proxy or network is configured.
*
* We'll force the https scheme if the APP_URL starts with https://, or if APP_FORCE_TLS is set to true.
*
*/
if ((strpos(env('APP_URL'), 'https://') === 0) || (env('APP_FORCE_TLS'))) {
$url->forceScheme('https');
}
// TODO - isn't it somehow 'gauche' to check the environment directly; shouldn't we be using config() somehow?
if ( ! env('APP_ALLOW_INSECURE_HOSTS')) { // unless you set APP_ALLOW_INSECURE_HOSTS, you should PROHIBIT forging domain parts of URL via Host: headers
$url_parts = parse_url(config('app.url'));
if ($url_parts && array_key_exists('scheme', $url_parts) && array_key_exists('host', $url_parts)) { // check for the *required* parts of a bare-minimum URL
\URL::forceRootUrl(config('app.url'));
URL::forceRootUrl(config('app.url'));
} else {
Log::error("Your APP_URL in your .env is misconfigured - it is: ".config('app.url').". Many things will work strangely unless you fix it.");
}
+1 -1
View File
@@ -26,7 +26,7 @@
"alek13/slack": "^2.0",
"arietimmerman/laravel-scim-server": "dev-master",
"bacon/bacon-qr-code": "^2.0",
"barryvdh/laravel-debugbar": "^3.6",
"barryvdh/laravel-debugbar": "^3.13",
"barryvdh/laravel-dompdf": "^2.0",
"doctrine/cache": "^1.10",
"doctrine/dbal": "^3.1",
Generated
+7 -7
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "09b576ccf0db4a09af74bc9f95593c20",
"content-hash": "bc24b4f3399cb2119c0587e2e542d5ad",
"packages": [
{
"name": "alek13/slack",
@@ -340,16 +340,16 @@
},
{
"name": "barryvdh/laravel-debugbar",
"version": "v3.13.0",
"version": "v3.13.5",
"source": {
"type": "git",
"url": "https://github.com/barryvdh/laravel-debugbar.git",
"reference": "354a42f3e0b083cdd6f9da5a9d1c0c63b074547a"
"reference": "92d86be45ee54edff735e46856f64f14b6a8bb07"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/354a42f3e0b083cdd6f9da5a9d1c0c63b074547a",
"reference": "354a42f3e0b083cdd6f9da5a9d1c0c63b074547a",
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/92d86be45ee54edff735e46856f64f14b6a8bb07",
"reference": "92d86be45ee54edff735e46856f64f14b6a8bb07",
"shasum": ""
},
"require": {
@@ -408,7 +408,7 @@
],
"support": {
"issues": "https://github.com/barryvdh/laravel-debugbar/issues",
"source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.13.0"
"source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.13.5"
},
"funding": [
{
@@ -420,7 +420,7 @@
"type": "github"
}
],
"time": "2024-04-01T16:39:30+00:00"
"time": "2024-04-12T11:20:37+00:00"
},
{
"name": "barryvdh/laravel-dompdf",
+6 -6
View File
@@ -121,12 +121,12 @@ return [
'notifications' => [
'notifications' => [
\Spatie\Backup\Notifications\Notifications\BackupHasFailed::class => [env('MAIL_BACKUP_NOTIFICATION_DRIVER', null)],
\Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFound::class => [env('MAIL_BACKUP_NOTIFICATION_DRIVER', null)],
\Spatie\Backup\Notifications\Notifications\CleanupHasFailed::class => [env('MAIL_BACKUP_NOTIFICATION_DRIVER', null)],
\Spatie\Backup\Notifications\Notifications\BackupWasSuccessful::class => [env('MAIL_BACKUP_NOTIFICATION_DRIVER', null)],
\Spatie\Backup\Notifications\Notifications\HealthyBackupWasFound::class => [env('MAIL_BACKUP_NOTIFICATION_DRIVER', null)],
\Spatie\Backup\Notifications\Notifications\CleanupWasSuccessful::class => [env('MAIL_BACKUP_NOTIFICATION_DRIVER', null)],
\Spatie\Backup\Notifications\Notifications\BackupHasFailedNotification::class => [env('MAIL_BACKUP_NOTIFICATION_DRIVER', null)],
\Spatie\Backup\Notifications\Notifications\UnhealthyBackupWasFoundNotification::class => [env('MAIL_BACKUP_NOTIFICATION_DRIVER', null)],
\Spatie\Backup\Notifications\Notifications\CleanupHasFailedNotification::class => [env('MAIL_BACKUP_NOTIFICATION_DRIVER', null)],
\Spatie\Backup\Notifications\Notifications\BackupWasSuccessfulNotification::class => [env('MAIL_BACKUP_NOTIFICATION_DRIVER', null)],
\Spatie\Backup\Notifications\Notifications\HealthyBackupWasFoundNotification::class => [env('MAIL_BACKUP_NOTIFICATION_DRIVER', null)],
\Spatie\Backup\Notifications\Notifications\CleanupWasSuccessfulNotification::class => [env('MAIL_BACKUP_NOTIFICATION_DRIVER', null)],
],
/*
+5 -5
View File
@@ -1,10 +1,10 @@
<?php
return array (
'app_version' => 'v7.0.0',
'full_app_version' => 'v7.0.0 - build 13553-g9fccafa3a',
'build_version' => '13553',
'app_version' => 'v7.0.4',
'full_app_version' => 'v7.0.4 - build 14011-g20d558785',
'build_version' => '14011',
'prerelease_version' => '',
'hash_version' => 'g9fccafa3a',
'full_hash' => 'v7.0.0-51-g9fccafa3a',
'hash_version' => 'g20d558785',
'full_hash' => 'v7.0.4-18-g20d558785',
'branch' => 'master',
);
+4 -4
View File
@@ -31,7 +31,7 @@
"less-loader": "^6.0",
"list.js": "^1.5.0",
"morris.js": "github:morrisjs/morris.js",
"papaparse": "5.2.0",
"papaparse": "5.4.1",
"select2": "4.0.13",
"sheetjs": "^2.0.0",
"signature_pad": "^4.2.0",
@@ -8347,9 +8347,9 @@
"license": "(MIT AND Zlib)"
},
"node_modules/papaparse": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.2.0.tgz",
"integrity": "sha512-ylq1wgUSnagU+MKQtNeVqrPhZuMYBvOSL00DHycFTCxownF95gpLAk1HiHdUW77N8yxRq1qHXLdlIPyBSG9NSA=="
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.4.1.tgz",
"integrity": "sha512-HipMsgJkZu8br23pW15uvo6sib6wne/4woLZPlFf3rpDyMe9ywEXUsuD7+6K9PRkJlVT51j/sCOYDKGGS3ZJrw=="
},
"node_modules/param-case": {
"version": "3.0.4",
+1 -1
View File
@@ -51,7 +51,7 @@
"less-loader": "^6.0",
"list.js": "^1.5.0",
"morris.js": "github:morrisjs/morris.js",
"papaparse": "5.2.0",
"papaparse": "5.4.1",
"select2": "4.0.13",
"sheetjs": "^2.0.0",
"signature_pad": "^4.2.0",
-3
View File
@@ -1,3 +0,0 @@
GIF89a
<?php echo "Hello, the date is: " . date('c');

Before

Width:  |  Height:  |  Size: 55 B

@@ -287,8 +287,18 @@ return [
'zerofill_count' => 'Length of asset tags, including zerofill',
'username_format_help' => 'This setting will only be used by the import process if a username is not provided and we have to generate a username for you.',
'oauth_title' => 'OAuth API Settings',
'oauth_clients' => 'OAuth Clients',
'oauth' => 'OAuth',
'oauth_help' => 'Oauth Endpoint Settings',
'oauth_no_clients' => 'You have not created any OAuth clients yet.',
'oauth_secret' => 'Secret',
'oauth_authorized_apps' => 'Authorized Applications',
'oauth_redirect_url' => 'Redirect URL',
'oauth_name_help' => ' Something your users will recognize and trust.',
'oauth_scopes' => 'Scopes',
'oauth_callback_url' => 'Your application authorization callback URL.',
'create_client' => 'Create Client',
'no_scopes' => 'No scopes',
'asset_tag_title' => 'Update Asset Tag Settings',
'barcode_title' => 'Update Barcode Settings',
'barcodes' => 'Barcodes',
+1 -1
View File
@@ -473,7 +473,7 @@
</div><!-- /.box-body -->
</div> <!-- /.box -->
</div>
</div>
@endif
@@ -1,79 +1,84 @@
<div>
<div class="panel panel-default">
<div class="panel-heading">
<div style="display: flex; justify-content: space-between; align-items: center;">
<h2>
OAuth Clients
<div class="box box-default">
<div class="box-header">
<h2 class="box-title">
{{ trans('admin/settings/general.oauth_clients') }}
</h2>
@if($authorizationError)
@if ($authorizationError)
<div class="alert alert-danger">
<p><strong>Whoops!</strong> Something went wrong!</p>
<p>{{ trans('admin/users/message.insufficient_permissions') }}
<br>
{{ $authorizationError }}
</p>
</div>
@endif
<a class="button button-small"
wire:click="$emit('openModal')"
onclick="$('#modal-create-client').modal('show');"
>
Create New Client
</a>
<div class="box-tools pull-right">
<a class="btn btn-primary"
wire:click="$emit('openModal')"
onclick="$('#modal-create-client').modal('show');">
{{ trans('general.create') }}
</a>
</div>
</div>
</div>
<div class="panel-body">
<!-- Current Clients -->
@if($clients->count() === 0)
<p class="m-b-none">
You have not created any OAuth clients.
</p>
@endif
<div class="box-body">
<!-- Current Clients -->
@if($clients->count() === 0)
<p>
{{ trans('admin/settings/general.oauth_no_clients') }}
</p>
@endif
@if($clients->count() > 0)
<table class="table table-borderless m-b-none">
@if ($clients->count() > 0)
<table class="table table-striped snipe-table">
<thead>
<tr>
<th>Client ID</th>
<th>Name</th>
<th>Secret</th>
<th><span class="sr-only">Edit</span></th>
<th><span class="sr-only">Delete</span></th>
<th>{{ trans('general.id') }}</th>
<th>{{ trans('general.name') }}</th>
<th>{{ trans('admin/settings/general.oauth_redirect_url') }}</th>
<th>{{ trans('admin/settings/general.oauth_secret') }}</th>
<th><span class="sr-only">{{ trans('general.actions') }}</span></th>
</tr>
</thead>
<tbody>
@foreach($clients as $client)
<tr>
<!-- ID -->
<td style="vertical-align: middle;">
<td>
{{ $client->id }}
</td>
<!-- Name -->
<td style="vertical-align: middle;">
<td>
{{ $client->name }}
</td>
<!-- Redirect -->
<td>
{{ $client->redirect }}
</td>
<!-- Secret -->
<td style="vertical-align: middle;">
<td>
<code>{{ $client->secret }}</code>
</td>
<!-- Edit Button -->
<td style="vertical-align: middle;">
<a class="action-link btn"
wire:click="editClient('{{ $client->id }}')"
onclick="$('#modal-edit-client').modal('show');"
>
Edit
</a>
</td>
<!-- Edit / Delete Button -->
<td class="text-right">
<a class="action-link btn btn-sm btn-warning"
wire:click="editClient('{{ $client->id }}')"
onclick="$('#modal-edit-client').modal('show');">
<i class="fas fa-pencil-alt" aria-hidden="true"></i><span class="sr-only">{{ trans('general.update') }}</span>
</a>
<!-- Delete Button -->
<td style="vertical-align: middle;" class="text-right">
<a class="action-link btn btn-danger btn-sm" wire:click="deleteClient('{{ $client->id }}')">
<i class="fas fa-trash"></i>
<i class="fas fa-trash" aria-hidden="true"></i>
<span class="sr-only">
{{ trans('general.delete') }}
</span>
</a>
</td>
</tr>
@@ -82,20 +87,28 @@
</table>
@endif
</div>
</div>
<div>
@if ($authorized_tokens->count() > 0)
<div>
<div class="panel panel-default">
<h2 class="panel-heading">Authorized Applications</h2>
<div class="box box-default">
<div class="box-header">
<h2>
{{ trans('admin/settings/general.oauth_authorized_apps') }}
</h2>
</div>
<div class="panel-body">
<div class="box-body">
<!-- Authorized Tokens -->
<table class="table table-borderless m-b-none">
<table class="table table-striped snipe-table">
<thead>
<tr>
<th>Name</th>
<th>Scopes</th>
<th><span class="sr-only">Delete</span></th>
<th>{{ trans('general.name') }}</th>
<th>{{ trans('admin/settings/general.oauth_scopes') }}</th>
<th></th>
</tr>
</thead>
@@ -103,23 +116,28 @@
@foreach($authorized_tokens as $token)
<tr>
<!-- Client Name -->
<td style="vertical-align: middle;">
<td>
{{ $token->client->name }}
</td>
<!-- Scopes -->
<td style="vertical-align: middle;">
<td>
@if(!$token->scopes)
<span class="label label-default">No Scopes</span>
<span class="label label-default">
{{ trans('admin/settings/general.no_scopes') }}
</span>
@endif
</td>
<!-- Revoke Button -->
<td style="vertical-align: middle;">
<a class="btn btn-sm btn-danger"
<td>
<a class="btn btn-sm btn-danger pull-right"
wire:click="deleteToken('{{ $token->id }}')"
>
<i class="fas fa-trash"></i>
<i class="fas fa-trash" aria-hidden="true"></i>
<span class="sr-only">
{{ trans('general.delete') }}
</span>
</a>
</td>
</tr>
@@ -130,8 +148,10 @@
</div>
</div>
@endif
</div>
</div>
<!-- Create Client Modal -->
<div class="modal fade" id="modal-create-client" tabindex="-1" role="dialog" wire:ignore.self>
@@ -141,7 +161,7 @@
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h2 class="modal-title">
Create Client
{{ trans('admin/settings/general.create_client') }}
</h2>
</div>
@@ -166,7 +186,9 @@
<form class="form-horizontal" role="form">
<!-- Name -->
<div class="form-group">
<label class="col-md-3 control-label" for="create-client-name">Name</label>
<label class="col-md-3 control-label" for="create-client-name">
{{ trans('general.name') }}
</label>
<div class="col-md-7">
<input id="create-client-name"
@@ -175,18 +197,17 @@
class="form-control"
wire:model="name"
wire:keydown.enter="createClient"
autofocus
>
autofocus>
<span class="help-block">
Something your users will recognize and trust.
{{ trans('admin/settings/general.oauth_name_help') }}
</span>
</div>
</div>
<!-- Redirect URL -->
<div class="form-group">
<label class="col-md-3 control-label" for="redirect">Redirect URL</label>
<label class="col-md-3 control-label" for="redirect">{{ trans('admin/settings/general.oauth_redirect_url') }}</label>
<div class="col-md-7">
<input type="text"
@@ -198,7 +219,7 @@
>
<span class="help-block">
Your application's authorization callback URL.
{{ trans('admin/settings/general.oauth_callback_url') }}
</span>
</div>
</div>
@@ -218,6 +239,8 @@
</div>
</div>
</div>
</div>
<!-- Edit Client Modal -->
<div class="modal fade" id="modal-edit-client" tabindex="-1" role="dialog" wire:ignore.self>
@@ -225,9 +248,8 @@
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">
Edit Client
{{ trans('general.update') }}
</h4>
</div>
@@ -268,14 +290,14 @@
>
<span class="help-block">
Something your users will recognize and trust.
{{ trans('admin/settings/general.oauth_name_help') }}
</span>
</div>
</div>
<!-- Redirect URL -->
<div class="form-group">
<label class="col-md-3 control-label" for="redirect">Redirect URL</label>
<label class="col-md-3 control-label" for="redirect">{{ trans('admin/settings/general.oauth_redirect_url') }}</label>
<div class="col-md-7">
<input
@@ -288,7 +310,7 @@
>
<span class="help-block">
Your application's authorization callback URL.
{{ trans('admin/settings/general.oauth_callback_url') }}
</span>
</div>
</div>
@@ -330,4 +352,5 @@
</script>
</div>
</div>
+1 -1
View File
@@ -35,7 +35,7 @@
</td>
<td class="col-md-1"><i class="fas fa-barcode" aria-hidden="true"></i></td>
<td class="col-md-10">Name</td>
<td class="col-md-10">{{ trans('general.name') }}</td>
</tr>
</thead>
<tbody>
+2 -2
View File
@@ -42,8 +42,8 @@
<i class="fas fa-barcode fa-2x"></i>
</span>
<span class="hidden-xs hidden-sm">
{{ trans('general.assets') }}
{!! ($model->assets_count > 0 ) ? '<badge class="badge badge-secondary">'.number_format($model->assets_count).'</badge>' : '' !!}
{{ trans('general.assets') }}
{!! ($model->assets()->AssetsForShow()->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($model->assets()->AssetsForShow()->count()).'</badge>' : '' !!}
</span>
</a>
</li>
+1 -1
View File
@@ -17,7 +17,7 @@
<livewire:oauth-clients />
</div>
@else
<p class="text-warning"><i class="fas fa-lock"></i> {{ trans('general.feature_disabled') }}</p>
<p class="text-warning"><i class="fas fa-lock" aria-hidden="true"></i> {{ trans('general.feature_disabled') }}</p>
@endif
@stop
+1 -2
View File
@@ -194,8 +194,7 @@
</div> <!-- end col-md-12 form div -->
</div> <!-- end form group div -->
</div> <!-- end col-md-3 div -->
</div> <!-- end row div -->
@stop
+1 -1
View File
@@ -390,7 +390,7 @@
</div> <!-- /box -->
</div> <!-- /.col-md-8-->
</div> <!-- /.row-->
{{ Form::close() }}
@@ -0,0 +1,23 @@
<?php
namespace Tests\Feature\AssetModels\Ui;
use App\Models\User;
use Tests\TestCase;
class AssetModelIndexTest extends TestCase
{
public function testPermissionRequiredToViewAssetModelList()
{
$this->actingAs(User::factory()->create())
->get(route('models.index'))
->assertForbidden();
}
public function testUserCanListAssetModels()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('models.index'))
->assertOk();
}
}
@@ -0,0 +1,35 @@
<?php
namespace Tests\Feature\AssetModels\Ui;
use App\Models\AssetModel;
use App\Models\Category;
use App\Models\User;
use Tests\TestCase;
class AssetModelStoreTest extends TestCase
{
public function testPermissionRequiredToStoreAssetModel()
{
$this->actingAs(User::factory()->create())
->post(route('models.store'), [
'name' => 'Test Model',
'category_id' => Category::factory()->create()->id
])
->assertForbidden();
}
public function testUserCanCreateAssetModels()
{
$this->assertFalse(AssetModel::where('name', 'Test Model')->exists());
$this->actingAs(User::factory()->superuser()->create())
->post(route('models.store'), [
'name' => 'Test Model',
'category_id' => Category::factory()->create()->id
])
->assertRedirect(route('models.index'));
$this->assertTrue(AssetModel::where('name', 'Test Model')->exists());
}
}
+1 -2
View File
@@ -1,6 +1,6 @@
<?php
namespace Feature\Users\Ui;
namespace Tests\Feature\Users\Ui;
use App\Models\Company;
use App\Models\User;
@@ -80,5 +80,4 @@ class ViewUserTest extends TestCase
[$user], CurrentInventory::class
);
}
}