Merge pull request #9766 from uberbrady/livewire_integration_v6

Livewire integration for Snipe-IT v6
This commit is contained in:
snipe 2021-06-28 21:51:00 -07:00 committed by GitHub
commit ebb0aa5532
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 374 additions and 148 deletions

View file

@ -3,8 +3,12 @@
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use App\Helpers\Helper;
use Illuminate\Validation\ValidationException;
use Log;
use Throwable;
class Handler extends ExceptionHandler
{
/**
@ -17,6 +21,75 @@ class Handler extends ExceptionHandler
];
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Throwable $exception
* @return void
*/
public function report(Throwable $exception)
{
if ($this->shouldReport($exception)) {
Log::error($exception);
return parent::report($exception);
}
}
/**
* Render an exception into an HTTP response.
*
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Throwable $e)
{
// CSRF token mismatch error
if ($e instanceof \Illuminate\Session\TokenMismatchException) {
return redirect()->back()->with('error', trans('general.token_expired'));
}
// Handle Ajax requests that fail because the model doesn't exist
if ($request->ajax() || $request->wantsJson()) {
if ($e instanceof \Illuminate\Database\Eloquent\ModelNotFoundException) {
$className = last(explode('\\', $e->getModel()));
return response()->json(Helper::formatStandardApiResponse('error', null, $className . ' not found'), 200);
}
if ($this->isHttpException($e)) {
$statusCode = $e->getStatusCode();
switch ($e->getStatusCode()) {
case '404':
return response()->json(Helper::formatStandardApiResponse('error', null, $statusCode . ' endpoint not found'), 404);
case '405':
return response()->json(Helper::formatStandardApiResponse('error', null, 'Method not allowed'), 405);
default:
return response()->json(Helper::formatStandardApiResponse('error', null, $statusCode), 405);
}
}
}
if ($this->isHttpException($e) && (isset($statusCode)) && ($statusCode == '404' )) {
return response()->view('layouts/basic', [
'content' => view('errors/404')
],$statusCode);
}
return parent::render($request, $e);
}
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array

View file

@ -0,0 +1,41 @@
<?php
namespace App\Http\Livewire;
use Livewire\Component;
use App\Models\CustomFieldset;
use App\Models\AssetModel;
class CustomFieldSetDefaultValuesForModel extends Component
{
public $add_default_values;
public $fieldset_id;
public $fields;
public $model_id;
public function __construct()
{
\Log::info("INSTANTIATING A THING!!!"); // WORKS!
}
public function foo()
{
\Log::info("Uh, foo?");
}
public function mount()
{
$this->fieldset_id = AssetModel::find($this->model_id)->fieldset_id;
\Log::error("Mount at least fired, that's got to count for something, yeah?"); //WORKS! YAY!
}
public function render()
{
// return 'fart<div>Hi: {{ $this->add_default_values }} yeah?</div>';
return view('livewire.custom-field-set-default-values-for-model');
}
}

View file

@ -0,0 +1,21 @@
<?php
namespace App\Http\Livewire;
use Livewire\Component;
use App\Models\CustomFieldset;
class CustomFieldsForFieldset extends Component
{
public $fieldset_id;
public $fields;
public function render()
{
if($this->fieldset_id) {
$this->fields = CustomFieldset::find($this->fieldset_id)->fields()->get();
}
return view('livewire.custom-fields-for-fieldset');
}
}

View file

@ -107,7 +107,9 @@
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump"
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"@php artisan vendor:publish --force --tag=livewire:assets --ansi"
],
"post-create-project-cmd": [
"php artisan key:generate"
@ -120,4 +122,4 @@
"discard-changes": true,
"process-timeout": 3000
}
}
}

281
composer.lock generated
View file

@ -73,16 +73,16 @@
},
{
"name": "alek13/slack",
"version": "2.0.2",
"version": "2.1.0",
"source": {
"type": "git",
"url": "https://github.com/php-slack/slack.git",
"reference": "eec88af852b83a2eb992c61299ca2d92e805fb77"
"reference": "17c6cb05183bcdbddafc863e360afef1768e9dac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-slack/slack/zipball/eec88af852b83a2eb992c61299ca2d92e805fb77",
"reference": "eec88af852b83a2eb992c61299ca2d92e805fb77",
"url": "https://api.github.com/repos/php-slack/slack/zipball/17c6cb05183bcdbddafc863e360afef1768e9dac",
"reference": "17c6cb05183bcdbddafc863e360afef1768e9dac",
"shasum": ""
},
"require": {
@ -128,7 +128,7 @@
],
"support": {
"issues": "https://github.com/php-slack/slack/issues",
"source": "https://github.com/php-slack/slack/tree/2.0.2"
"source": "https://github.com/php-slack/slack/tree/2.1.0"
},
"funding": [
{
@ -136,7 +136,7 @@
"type": "custom"
}
],
"time": "2021-06-09T21:46:34+00:00"
"time": "2021-06-22T17:56:14+00:00"
},
{
"name": "asm89/stack-cors",
@ -196,16 +196,16 @@
},
{
"name": "aws/aws-sdk-php",
"version": "3.184.2",
"version": "3.185.3",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "78fe691ab466fecf195209672f6c00c5d4ed219a"
"reference": "e7a7d6b28b477a02a5625348995949c2dee7919a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/78fe691ab466fecf195209672f6c00c5d4ed219a",
"reference": "78fe691ab466fecf195209672f6c00c5d4ed219a",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/e7a7d6b28b477a02a5625348995949c2dee7919a",
"reference": "e7a7d6b28b477a02a5625348995949c2dee7919a",
"shasum": ""
},
"require": {
@ -280,9 +280,9 @@
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.184.2"
"source": "https://github.com/aws/aws-sdk-php/tree/3.185.3"
},
"time": "2021-06-11T18:20:15+00:00"
"time": "2021-06-28T18:15:17+00:00"
},
{
"name": "bacon/bacon-qr-code",
@ -336,16 +336,16 @@
},
{
"name": "barryvdh/laravel-debugbar",
"version": "v3.6.1",
"version": "v3.6.2",
"source": {
"type": "git",
"url": "https://github.com/barryvdh/laravel-debugbar.git",
"reference": "f6f0f895a33cac801286a74355d146bb5384a5da"
"reference": "70b89754913fd89fef16d0170a91dbc2a5cd633a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/f6f0f895a33cac801286a74355d146bb5384a5da",
"reference": "f6f0f895a33cac801286a74355d146bb5384a5da",
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/70b89754913fd89fef16d0170a91dbc2a5cd633a",
"reference": "70b89754913fd89fef16d0170a91dbc2a5cd633a",
"shasum": ""
},
"require": {
@ -405,15 +405,19 @@
],
"support": {
"issues": "https://github.com/barryvdh/laravel-debugbar/issues",
"source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.6.1"
"source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.6.2"
},
"funding": [
{
"url": "https://fruitcake.nl",
"type": "custom"
},
{
"url": "https://github.com/barryvdh",
"type": "github"
}
],
"time": "2021-06-02T06:42:22+00:00"
"time": "2021-06-14T14:29:26+00:00"
},
{
"name": "brick/math",
@ -953,34 +957,35 @@
},
{
"name": "doctrine/dbal",
"version": "3.1.0",
"version": "3.1.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "5ba62e7e40df119424866064faf2cef66cb5232a"
"reference": "8e0fde2b90e3f61361013d1e928621beeea07bc0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/5ba62e7e40df119424866064faf2cef66cb5232a",
"reference": "5ba62e7e40df119424866064faf2cef66cb5232a",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/8e0fde2b90e3f61361013d1e928621beeea07bc0",
"reference": "8e0fde2b90e3f61361013d1e928621beeea07bc0",
"shasum": ""
},
"require": {
"composer/package-versions-deprecated": "^1.11.99",
"doctrine/cache": "^1.0",
"doctrine/cache": "^1.0|^2.0",
"doctrine/deprecations": "^0.5.3",
"doctrine/event-manager": "^1.0",
"php": "^7.3 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "8.2.0",
"doctrine/coding-standard": "9.0.0",
"jetbrains/phpstorm-stubs": "2020.2",
"phpstan/phpstan": "0.12.81",
"phpstan/phpstan-strict-rules": "^0.12.2",
"phpunit/phpunit": "9.5.0",
"phpunit/phpunit": "9.5.5",
"psalm/plugin-phpunit": "0.13.0",
"squizlabs/php_codesniffer": "3.6.0",
"symfony/console": "^2.0.5|^3.0|^4.0|^5.0",
"symfony/cache": "^5.2|^6.0",
"symfony/console": "^2.0.5|^3.0|^4.0|^5.0|^6.0",
"vimeo/psalm": "4.6.4"
},
"suggest": {
@ -1041,7 +1046,7 @@
],
"support": {
"issues": "https://github.com/doctrine/dbal/issues",
"source": "https://github.com/doctrine/dbal/tree/3.1.0"
"source": "https://github.com/doctrine/dbal/tree/3.1.1"
},
"funding": [
{
@ -1057,7 +1062,7 @@
"type": "tidelift"
}
],
"time": "2021-04-19T17:51:23+00:00"
"time": "2021-06-19T17:59:55+00:00"
},
{
"name": "doctrine/deprecations",
@ -2289,16 +2294,16 @@
},
{
"name": "firebase/php-jwt",
"version": "v5.3.0",
"version": "v5.4.0",
"source": {
"type": "git",
"url": "https://github.com/firebase/php-jwt.git",
"reference": "3c2d70f2e64e2922345e89f2ceae47d2463faae1"
"reference": "d2113d9b2e0e349796e72d2a63cf9319100382d2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/3c2d70f2e64e2922345e89f2ceae47d2463faae1",
"reference": "3c2d70f2e64e2922345e89f2ceae47d2463faae1",
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/d2113d9b2e0e349796e72d2a63cf9319100382d2",
"reference": "d2113d9b2e0e349796e72d2a63cf9319100382d2",
"shasum": ""
},
"require": {
@ -2307,6 +2312,9 @@
"require-dev": {
"phpunit/phpunit": ">=4.8 <=9"
},
"suggest": {
"paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present"
},
"type": "library",
"autoload": {
"psr-4": {
@ -2337,9 +2345,9 @@
],
"support": {
"issues": "https://github.com/firebase/php-jwt/issues",
"source": "https://github.com/firebase/php-jwt/tree/v5.3.0"
"source": "https://github.com/firebase/php-jwt/tree/v5.4.0"
},
"time": "2021-05-20T17:37:02+00:00"
"time": "2021-06-23T19:00:23+00:00"
},
{
"name": "fruitcake/laravel-cors",
@ -2827,16 +2835,16 @@
},
{
"name": "laravel/framework",
"version": "v8.46.0",
"version": "v8.48.2",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "a18266c612e0e6aba5e0174b3c873d2d217dccfb"
"reference": "4c50ebbb7d1a66c5f3511261413cd499d30ba4cd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/a18266c612e0e6aba5e0174b3c873d2d217dccfb",
"reference": "a18266c612e0e6aba5e0174b3c873d2d217dccfb",
"url": "https://api.github.com/repos/laravel/framework/zipball/4c50ebbb7d1a66c5f3511261413cd499d30ba4cd",
"reference": "4c50ebbb7d1a66c5f3511261413cd499d30ba4cd",
"shasum": ""
},
"require": {
@ -2915,7 +2923,7 @@
"guzzlehttp/guzzle": "^6.5.5|^7.0.1",
"league/flysystem-cached-adapter": "^1.0",
"mockery/mockery": "^1.4.2",
"orchestra/testbench-core": "^6.8",
"orchestra/testbench-core": "^6.23",
"pda/pheanstalk": "^4.0",
"phpunit/phpunit": "^8.5.8|^9.3.3",
"predis/predis": "^1.1.2",
@ -2991,7 +2999,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2021-06-08T13:36:46+00:00"
"time": "2021-06-25T23:57:38+00:00"
},
{
"name": "laravel/helpers",
@ -3522,16 +3530,16 @@
},
{
"name": "league/commonmark",
"version": "1.6.2",
"version": "1.6.5",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
"reference": "7d70d2f19c84bcc16275ea47edabee24747352eb"
"reference": "44ffd8d3c4a9133e4bd0548622b09c55af39db5f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/7d70d2f19c84bcc16275ea47edabee24747352eb",
"reference": "7d70d2f19c84bcc16275ea47edabee24747352eb",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/44ffd8d3c4a9133e4bd0548622b09c55af39db5f",
"reference": "44ffd8d3c4a9133e4bd0548622b09c55af39db5f",
"shasum": ""
},
"require": {
@ -3549,7 +3557,7 @@
"github/gfm": "0.29.0",
"michelf/php-markdown": "~1.4",
"mikehaertl/php-shellcommand": "^1.4",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan": "^0.12.90",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.2",
"scrutinizer/ocular": "^1.5",
"symfony/finder": "^4.2"
@ -3619,7 +3627,7 @@
"type": "tidelift"
}
],
"time": "2021-05-12T11:39:41+00:00"
"time": "2021-06-26T11:57:13+00:00"
},
{
"name": "league/csv",
@ -3761,16 +3769,16 @@
},
{
"name": "league/flysystem",
"version": "1.1.3",
"version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "9be3b16c877d477357c015cec057548cf9b2a14a"
"reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9be3b16c877d477357c015cec057548cf9b2a14a",
"reference": "9be3b16c877d477357c015cec057548cf9b2a14a",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3ad69181b8afed2c9edf7be5a2918144ff4ea32",
"reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32",
"shasum": ""
},
"require": {
@ -3786,7 +3794,6 @@
"phpunit/phpunit": "^8.5.8"
},
"suggest": {
"ext-fileinfo": "Required for MimeType",
"ext-ftp": "Allows you to use FTP server storage",
"ext-openssl": "Allows you to use FTPS server storage",
"league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
@ -3844,7 +3851,7 @@
],
"support": {
"issues": "https://github.com/thephpleague/flysystem/issues",
"source": "https://github.com/thephpleague/flysystem/tree/1.x"
"source": "https://github.com/thephpleague/flysystem/tree/1.1.4"
},
"funding": [
{
@ -3852,7 +3859,7 @@
"type": "other"
}
],
"time": "2020-08-23T07:39:11+00:00"
"time": "2021-06-23T21:56:05+00:00"
},
{
"name": "league/flysystem-aws-s3-v3",
@ -4101,16 +4108,16 @@
},
{
"name": "livewire/livewire",
"version": "v2.4.4",
"version": "v2.5.1",
"source": {
"type": "git",
"url": "https://github.com/livewire/livewire.git",
"reference": "33101c83b75728651b9e668a4559f97def7c9138"
"reference": "a4ffb135693e7982e5b982ca203f5dc7a7ae1126"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/livewire/livewire/zipball/33101c83b75728651b9e668a4559f97def7c9138",
"reference": "33101c83b75728651b9e668a4559f97def7c9138",
"url": "https://api.github.com/repos/livewire/livewire/zipball/a4ffb135693e7982e5b982ca203f5dc7a7ae1126",
"reference": "a4ffb135693e7982e5b982ca203f5dc7a7ae1126",
"shasum": ""
},
"require": {
@ -4161,7 +4168,7 @@
"description": "A front-end framework for Laravel.",
"support": {
"issues": "https://github.com/livewire/livewire/issues",
"source": "https://github.com/livewire/livewire/tree/v2.4.4"
"source": "https://github.com/livewire/livewire/tree/v2.5.1"
},
"funding": [
{
@ -4169,7 +4176,7 @@
"type": "github"
}
],
"time": "2021-04-28T15:31:15+00:00"
"time": "2021-06-15T13:24:48+00:00"
},
{
"name": "maatwebsite/excel",
@ -4715,16 +4722,16 @@
},
{
"name": "mtdowling/jmespath.php",
"version": "2.6.0",
"version": "2.6.1",
"source": {
"type": "git",
"url": "https://github.com/jmespath/jmespath.php.git",
"reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb"
"reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/42dae2cbd13154083ca6d70099692fef8ca84bfb",
"reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb",
"url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/9b87907a81b87bc76d19a7fb2d61e61486ee9edb",
"reference": "9b87907a81b87bc76d19a7fb2d61e61486ee9edb",
"shasum": ""
},
"require": {
@ -4732,7 +4739,7 @@
"symfony/polyfill-mbstring": "^1.17"
},
"require-dev": {
"composer/xdebug-handler": "^1.4",
"composer/xdebug-handler": "^1.4 || ^2.0",
"phpunit/phpunit": "^4.8.36 || ^7.5.15"
},
"bin": [
@ -4770,9 +4777,9 @@
],
"support": {
"issues": "https://github.com/jmespath/jmespath.php/issues",
"source": "https://github.com/jmespath/jmespath.php/tree/2.6.0"
"source": "https://github.com/jmespath/jmespath.php/tree/2.6.1"
},
"time": "2020-07-31T21:01:56+00:00"
"time": "2021-06-14T00:11:39+00:00"
},
{
"name": "myclabs/php-enum",
@ -5026,16 +5033,16 @@
},
{
"name": "nunomaduro/collision",
"version": "v5.4.0",
"version": "v5.5.0",
"source": {
"type": "git",
"url": "https://github.com/nunomaduro/collision.git",
"reference": "41b7e9999133d5082700d31a1d0977161df8322a"
"reference": "b5cb36122f1c142c3c3ee20a0ae778439ef0244b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nunomaduro/collision/zipball/41b7e9999133d5082700d31a1d0977161df8322a",
"reference": "41b7e9999133d5082700d31a1d0977161df8322a",
"url": "https://api.github.com/repos/nunomaduro/collision/zipball/b5cb36122f1c142c3c3ee20a0ae778439ef0244b",
"reference": "b5cb36122f1c142c3c3ee20a0ae778439ef0244b",
"shasum": ""
},
"require": {
@ -5110,7 +5117,7 @@
"type": "patreon"
}
],
"time": "2021-04-09T13:38:32+00:00"
"time": "2021-06-22T20:47:22+00:00"
},
{
"name": "nyholm/psr7",
@ -5890,16 +5897,16 @@
},
{
"name": "phpseclib/phpseclib",
"version": "3.0.8",
"version": "3.0.9",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
"reference": "d9615a6fb970d9933866ca8b4036ec3407b020b6"
"reference": "a127a5133804ff2f47ae629dd529b129da616ad7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/d9615a6fb970d9933866ca8b4036ec3407b020b6",
"reference": "d9615a6fb970d9933866ca8b4036ec3407b020b6",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/a127a5133804ff2f47ae629dd529b129da616ad7",
"reference": "a127a5133804ff2f47ae629dd529b129da616ad7",
"shasum": ""
},
"require": {
@ -5981,7 +5988,7 @@
],
"support": {
"issues": "https://github.com/phpseclib/phpseclib/issues",
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.8"
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.9"
},
"funding": [
{
@ -5997,7 +6004,7 @@
"type": "tidelift"
}
],
"time": "2021-04-19T03:20:48+00:00"
"time": "2021-06-14T06:54:45+00:00"
},
{
"name": "phpspec/prophecy",
@ -7687,16 +7694,16 @@
},
{
"name": "symfony/console",
"version": "v5.3.0",
"version": "v5.3.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "058553870f7809087fa80fa734704a21b9bcaeb2"
"reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/058553870f7809087fa80fa734704a21b9bcaeb2",
"reference": "058553870f7809087fa80fa734704a21b9bcaeb2",
"url": "https://api.github.com/repos/symfony/console/zipball/649730483885ff2ca99ca0560ef0e5f6b03f2ac1",
"reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1",
"shasum": ""
},
"require": {
@ -7765,7 +7772,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v5.3.0"
"source": "https://github.com/symfony/console/tree/v5.3.2"
},
"funding": [
{
@ -7781,7 +7788,7 @@
"type": "tidelift"
}
],
"time": "2021-05-26T17:43:10+00:00"
"time": "2021-06-12T09:42:48+00:00"
},
{
"name": "symfony/css-selector",
@ -8358,16 +8365,16 @@
},
{
"name": "symfony/http-foundation",
"version": "v5.3.1",
"version": "v5.3.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "8827b90cf8806e467124ad476acd15216c2fceb6"
"reference": "7b6dd714d95106b831aaa7f3c9c612ab886516bd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/8827b90cf8806e467124ad476acd15216c2fceb6",
"reference": "8827b90cf8806e467124ad476acd15216c2fceb6",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/7b6dd714d95106b831aaa7f3c9c612ab886516bd",
"reference": "7b6dd714d95106b831aaa7f3c9c612ab886516bd",
"shasum": ""
},
"require": {
@ -8411,7 +8418,7 @@
"description": "Defines an object-oriented layer for the HTTP specification",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-foundation/tree/v5.3.1"
"source": "https://github.com/symfony/http-foundation/tree/v5.3.2"
},
"funding": [
{
@ -8427,20 +8434,20 @@
"type": "tidelift"
}
],
"time": "2021-06-02T09:32:00+00:00"
"time": "2021-06-12T10:15:17+00:00"
},
{
"name": "symfony/http-kernel",
"version": "v5.3.1",
"version": "v5.3.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "74eb022e3bac36b3d3a897951a98759f2b32b864"
"reference": "e7021165d9dbfb4051296b8de827e92c8a7b5c87"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/74eb022e3bac36b3d3a897951a98759f2b32b864",
"reference": "74eb022e3bac36b3d3a897951a98759f2b32b864",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/e7021165d9dbfb4051296b8de827e92c8a7b5c87",
"reference": "e7021165d9dbfb4051296b8de827e92c8a7b5c87",
"shasum": ""
},
"require": {
@ -8523,7 +8530,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-kernel/tree/v5.3.1"
"source": "https://github.com/symfony/http-kernel/tree/v5.3.2"
},
"funding": [
{
@ -8539,20 +8546,20 @@
"type": "tidelift"
}
],
"time": "2021-06-02T10:07:12+00:00"
"time": "2021-06-17T14:18:27+00:00"
},
{
"name": "symfony/mime",
"version": "v5.3.0",
"version": "v5.3.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/mime.git",
"reference": "ed710d297b181f6a7194d8172c9c2423d58e4852"
"reference": "47dd7912152b82d0d4c8d9040dbc93d6232d472a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/mime/zipball/ed710d297b181f6a7194d8172c9c2423d58e4852",
"reference": "ed710d297b181f6a7194d8172c9c2423d58e4852",
"url": "https://api.github.com/repos/symfony/mime/zipball/47dd7912152b82d0d4c8d9040dbc93d6232d472a",
"reference": "47dd7912152b82d0d4c8d9040dbc93d6232d472a",
"shasum": ""
},
"require": {
@ -8606,7 +8613,7 @@
"mime-type"
],
"support": {
"source": "https://github.com/symfony/mime/tree/v5.3.0"
"source": "https://github.com/symfony/mime/tree/v5.3.2"
},
"funding": [
{
@ -8622,7 +8629,7 @@
"type": "tidelift"
}
],
"time": "2021-05-26T17:43:10+00:00"
"time": "2021-06-09T10:58:01+00:00"
},
{
"name": "symfony/polyfill-ctype",
@ -9355,16 +9362,16 @@
},
{
"name": "symfony/process",
"version": "v5.3.0",
"version": "v5.3.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "53e36cb1c160505cdaf1ef201501669c4c317191"
"reference": "714b47f9196de61a196d86c4bad5f09201b307df"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/53e36cb1c160505cdaf1ef201501669c4c317191",
"reference": "53e36cb1c160505cdaf1ef201501669c4c317191",
"url": "https://api.github.com/repos/symfony/process/zipball/714b47f9196de61a196d86c4bad5f09201b307df",
"reference": "714b47f9196de61a196d86c4bad5f09201b307df",
"shasum": ""
},
"require": {
@ -9397,7 +9404,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/process/tree/v5.3.0"
"source": "https://github.com/symfony/process/tree/v5.3.2"
},
"funding": [
{
@ -9413,7 +9420,7 @@
"type": "tidelift"
}
],
"time": "2021-05-26T12:52:38+00:00"
"time": "2021-06-12T10:15:01+00:00"
},
{
"name": "symfony/psr-http-message-bridge",
@ -9674,16 +9681,16 @@
},
{
"name": "symfony/string",
"version": "v5.3.0",
"version": "v5.3.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "a9a0f8b6aafc5d2d1c116dcccd1573a95153515b"
"reference": "0732e97e41c0a590f77e231afc16a327375d50b0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/a9a0f8b6aafc5d2d1c116dcccd1573a95153515b",
"reference": "a9a0f8b6aafc5d2d1c116dcccd1573a95153515b",
"url": "https://api.github.com/repos/symfony/string/zipball/0732e97e41c0a590f77e231afc16a327375d50b0",
"reference": "0732e97e41c0a590f77e231afc16a327375d50b0",
"shasum": ""
},
"require": {
@ -9737,7 +9744,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v5.3.0"
"source": "https://github.com/symfony/string/tree/v5.3.2"
},
"funding": [
{
@ -9753,20 +9760,20 @@
"type": "tidelift"
}
],
"time": "2021-05-26T17:43:10+00:00"
"time": "2021-06-06T09:51:56+00:00"
},
{
"name": "symfony/translation",
"version": "v5.3.0",
"version": "v5.3.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "251de0d921c42ef0a81494d8f37405421deefdf6"
"reference": "7e2603bcc598e14804c4d2359d8dc4ee3c40391b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/251de0d921c42ef0a81494d8f37405421deefdf6",
"reference": "251de0d921c42ef0a81494d8f37405421deefdf6",
"url": "https://api.github.com/repos/symfony/translation/zipball/7e2603bcc598e14804c4d2359d8dc4ee3c40391b",
"reference": "7e2603bcc598e14804c4d2359d8dc4ee3c40391b",
"shasum": ""
},
"require": {
@ -9832,7 +9839,7 @@
"description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/translation/tree/v5.3.0"
"source": "https://github.com/symfony/translation/tree/v5.3.2"
},
"funding": [
{
@ -9848,7 +9855,7 @@
"type": "tidelift"
}
],
"time": "2021-05-29T22:28:28+00:00"
"time": "2021-06-06T09:51:56+00:00"
},
{
"name": "symfony/translation-contracts",
@ -9930,16 +9937,16 @@
},
{
"name": "symfony/var-dumper",
"version": "v5.3.0",
"version": "v5.3.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "1d3953e627fe4b5f6df503f356b6545ada6351f3"
"reference": "905a22c68b292ffb6f20d7636c36b220d1fba5ae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/1d3953e627fe4b5f6df503f356b6545ada6351f3",
"reference": "1d3953e627fe4b5f6df503f356b6545ada6351f3",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/905a22c68b292ffb6f20d7636c36b220d1fba5ae",
"reference": "905a22c68b292ffb6f20d7636c36b220d1fba5ae",
"shasum": ""
},
"require": {
@ -9998,7 +10005,7 @@
"dump"
],
"support": {
"source": "https://github.com/symfony/var-dumper/tree/v5.3.0"
"source": "https://github.com/symfony/var-dumper/tree/v5.3.2"
},
"funding": [
{
@ -10014,7 +10021,7 @@
"type": "tidelift"
}
],
"time": "2021-05-27T12:28:50+00:00"
"time": "2021-06-06T09:51:56+00:00"
},
{
"name": "tecnickcom/tc-lib-barcode",
@ -12034,16 +12041,16 @@
},
{
"name": "phpunit/phpunit",
"version": "8.5.16",
"version": "8.5.17",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "cc66f2fc61296be66c99931a862200e7456b9a01"
"reference": "79067856d85421c56d413bd238d4e2cd6b0e54da"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/cc66f2fc61296be66c99931a862200e7456b9a01",
"reference": "cc66f2fc61296be66c99931a862200e7456b9a01",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/79067856d85421c56d413bd238d4e2cd6b0e54da",
"reference": "79067856d85421c56d413bd238d4e2cd6b0e54da",
"shasum": ""
},
"require": {
@ -12115,7 +12122,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.16"
"source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.17"
},
"funding": [
{
@ -12127,7 +12134,7 @@
"type": "github"
}
],
"time": "2021-06-05T04:46:20+00:00"
"time": "2021-06-23T05:12:43+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
@ -12845,16 +12852,16 @@
},
{
"name": "symfony/yaml",
"version": "v5.3.0",
"version": "v5.3.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "3bbcf262fceb3d8f48175302e6ba0ac96e3a5a11"
"reference": "71719ab2409401711d619765aa255f9d352a59b2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/3bbcf262fceb3d8f48175302e6ba0ac96e3a5a11",
"reference": "3bbcf262fceb3d8f48175302e6ba0ac96e3a5a11",
"url": "https://api.github.com/repos/symfony/yaml/zipball/71719ab2409401711d619765aa255f9d352a59b2",
"reference": "71719ab2409401711d619765aa255f9d352a59b2",
"shasum": ""
},
"require": {
@ -12900,7 +12907,7 @@
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/yaml/tree/v5.3.0"
"source": "https://github.com/symfony/yaml/tree/v5.3.2"
},
"funding": [
{
@ -12916,7 +12923,7 @@
"type": "tidelift"
}
],
"time": "2021-05-26T17:43:10+00:00"
"time": "2021-06-06T09:51:56+00:00"
},
{
"name": "theseer/tokenizer",

14
public/vendor/livewire/livewire.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
public/vendor/livewire/manifest.json vendored Normal file
View file

@ -0,0 +1 @@
{"/livewire.js":"/livewire.js?id=e6704f81026a73a52725"}

View file

@ -20,6 +20,7 @@
}
};
</script>
@livewireStyles
@if (($snipeSettings) && ($snipeSettings->header_color))
@ -74,6 +75,7 @@
@stack('js')
@livewireScripts
</body>
</html>

View file

@ -80,6 +80,7 @@
<script src="{{ url(asset('js/html5shiv.js')) }}" nonce="{{ csrf_token() }}"></script>
<script src="{{ url(asset('js/respond.js')) }}" nonce="{{ csrf_token() }}"></script>
@livewireStyles
</head>
@ -926,6 +927,6 @@
@endif
@livewireScripts
</body>
</html>

View file

@ -0,0 +1,25 @@
<div>
<div class="form-group {{ $errors->has('custom_fieldset') ? ' has-error' : '' }}">
<label for="custom_fieldset" class="col-md-3 control-label">{{ trans('admin/models/general.fieldset') }}</label>
<div class="col-md-7">
{{ Form::select('custom_fieldset', \App\Helpers\Helper::customFieldsetList(),old('custom_fieldset', 0000 /*$item->fieldset_id*/), array('class'=>'select2 js-fieldset-field', 'style'=>'width:350px', 'aria-label'=>'custom_fieldset', 'wire:model' => 'fieldset_id')) }}
{!! $errors->first('custom_fieldset', '<span class="alert-msg" aria-hidden="true"><br><i class="fa fa-times"></i> :message</span>') !!}
<label class="m-l-xs">
{{-- {{ Form::checkbox('add_default_values', 1, Request::old('add_default_values'), ['class' => 'js-default-values-toggler']) }} --}}
{{-- I'm not sure that *this* checkboxy thing will render right, because of things. It's not *in* its own view, right? So that's a problem --}}
<input wire:click="foo" wire:model="add_default_values" type='checkbox' name='add_default_values' value='1' class='js-default-values-toggler'{{ Request::old('add_default_values')? " checked='checked'" : "" }} />
{{ trans('admin/models/general.add_default_values') }}
</label>
</div>
</div>
@if($this->add_default_values) {{-- 'if the checkbox is enabled *AND* there are more than 0 fields in the fieldsset' --}}
<div>
<div class="form-group">
<fieldset>
<legend class="col-md-3 control-label">Default Values</legend>
@livewire('custom-fields-for-fieldset',['fieldset_id' => $fieldset_id])
</fieldset>
</div>
</div>
@endif
</div>

View file

@ -0,0 +1,34 @@
<div class="col-sm-8 col-xl-7">
@empty($fields) {{-- There was an error? --}}
<p>
There was a problem retrieving the fields for this fieldset.
</p>
@else
{{-- NOTE: This stuff could work well also for the 'view this asset and do its custom fields' thing --}}
{{-- I don't know if we break *here* or if we break per field element? --}}
@foreach($fields as $field)
<div class="row">
<div class="col-sm-12 col-lg-6">
<label class="control-label" for="default-value{{ $field->id }}">{{ $field->name }}</label>
</div>
<div class="col-sm-12 col-lg-6">
@if($field->element == "text")
<input b-if="field.type == 'text'" class="form-control m-b-xs" type="text" :value="getValue(field)" :id="'default-value' + field.id" :name="'default_values[' + field.id + ']'">
@elseif($field->element == "textarea")
<textarea x-if="field.type == 'textarea'" class="form-control" :value="getValue(field)" :id="'default-value' + field.id" :name="'default_values[' + field.id + ']'"></textarea><br>
@elseif($field->element == "listbox")
<select Z-if="field.element == 'listbox'" class="form-control m-b-xs" :name="'default_values[' + field.id + ']'">
<option value=""></option>
@foreach($field->field_values as $field_value)
<option Q-for="field_value in field.field_values_array" :value="field_value" :selected="getValue(field) == field_value">{{ $field_value }}</option>
@endforeach
</select>
@else
Unknonown field element: {{ $field->element }}
@endif
</div>
</div>
@endforeach
@endif
</div>

View file

@ -34,24 +34,28 @@
</div>
<!-- Custom Fieldset -->
<div id="app">
<div class="form-group {{ $errors->has('custom_fieldset') ? ' has-error' : '' }}">
<div>
{{-- <div class="form-group {{ $errors->has('custom_fieldset') ? ' has-error' : '' }}">
<label for="custom_fieldset" class="col-md-3 control-label">{{ trans('admin/models/general.fieldset') }}</label>
<div class="col-md-7">
{{ Form::select('custom_fieldset', \App\Helpers\Helper::customFieldsetList(),old('custom_fieldset', $item->fieldset_id), array('class'=>'select2 js-fieldset-field', 'style'=>'width:350px', 'aria-label'=>'custom_fieldset')) }}
{!! $errors->first('custom_fieldset', '<span class="alert-msg" aria-hidden="true"><br><i class="fa fa-times"></i> :message</span>') !!}
<label class="m-l-xs">
{{ Form::checkbox('add_default_values', 1, Request::old('add_default_values'), ['class' => 'js-default-values-toggler']) }}
{{-- {{ Form::checkbox('add_default_values', 1, Request::old('add_default_values'), ['class' => 'js-default-values-toggler']) }} --}}
{{-- I'm not sure that *this* checkboxy thing will render right, because of things. It's not *in* its own view, right? So that's a problem --}}
{{-- <input wire:click="foo" wire:model="add_default_values" type='checkbox' name='add_default_values' value='1' class='js-default-values-toggler'{{ Request::old('add_default_values')? " checked='checked'" : "" }} />
{{ trans('admin/models/general.add_default_values') }}
</label>
</div>
</div>
</div> --}}
<fieldset-default-values
{{-- <fieldset-default-values
model-id="{{ $item->id ?: '' }}"
fieldset-id="{{ !empty($item->fieldset) ? $item->fieldset->id : Request::old('custom_fieldset') }}"
previous-input="{{ json_encode(Request::old('default_values')) }}">
</fieldset-default-values>
</fieldset-default-values> --}}
@livewire('custom-field-set-default-values-for-model',["model_id" => $item->id])
</div>
@include ('partials.forms.edit.notes')
@ -78,10 +82,10 @@
@stop
@section('moar_scripts')
{{-- @section('moar_scripts')
<script nonce="{{ csrf_token() }}">
new Vue({
el: '#app'
});
</script>
@endsection
@endsection --}}