From 50f05c0d2bdec407e1d52fa991262d605079a76e Mon Sep 17 00:00:00 2001 From: Herpaderp Aldent Date: Sun, 9 Dec 2018 15:52:05 +0100 Subject: [PATCH] Version 1.6.0 (#58) This version is suited for the latest release of eveseat/web 3.0.10 and higher. SeAT now uses a newer version of datatables and therefore raw columns need to be enabled to show its html content. Also the dependency on form generator in edit blade was removed. --- CHANGELOG.md | 4 +++ composer.json | 2 +- .../SeatGroupAffiliationController.php | 5 ++-- .../Logs/SeatGroupLogsController.php | 5 ++-- .../Controllers/SeatGroupUserController.php | 5 ++-- src/Http/routes.php | 2 +- src/config/seatgroups.config.php | 2 +- src/resources/views/edit.blade.php | 28 +++++++++---------- .../views/partials/managed-group.blade.php | 2 +- 9 files changed, 30 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a239dc3..33f4306 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# Version 1.6.0 +This version is suited for the latest release of eveseat/web 3.0.10 and higher. SeAT now uses a newer version of datatables and therefore raw columns need to be enabled to show its html content. +Also the dependency on form generator in edit blade was removed. + # Version 1.5.2 This is a minor usability update. All of the found improvements are based from @Eingang's Feedback. Whenever you find any issues please don't hesitate to open an issue. * Empty corporation affiliation request caused an error. This update adds validation to form request diff --git a/composer.json b/composer.json index 0e88478..f91c0eb 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "require": { "php": ">=7.1", "laravel/framework": "5.5.*", - "eveseat/web": "~3" + "eveseat/web": ">=3.0.10" }, "require-dev": { "orchestra/testbench": "3.5.*", diff --git a/src/Http/Controllers/Affiliation/SeatGroupAffiliationController.php b/src/Http/Controllers/Affiliation/SeatGroupAffiliationController.php index 8ae196e..9e77ca5 100644 --- a/src/Http/Controllers/Affiliation/SeatGroupAffiliationController.php +++ b/src/Http/Controllers/Affiliation/SeatGroupAffiliationController.php @@ -11,7 +11,7 @@ use Herpaderpaldent\Seat\SeatGroups\Actions\SeatGroups\GetCurrentAffiliationAction; use Herpaderpaldent\Seat\SeatGroups\Http\Validation\Affiliation\GetCurrentAffiliationsRequest; use Illuminate\Routing\Controller; -use Yajra\Datatables\Datatables; +use Yajra\DataTables\DataTables; class SeatGroupAffiliationController extends Controller { @@ -20,13 +20,14 @@ public function getCurrentAffiliations(GetCurrentAffiliationsRequest $request, G $affiliations = collect($action->execute($request->all())); - return Datatables::of($affiliations) + return DataTables::of($affiliations) ->addColumn('affiliation', function ($row) { return view('seatgroups::affiliation.partials.table-partials.affiliation', compact('row'))->render(); }) ->addColumn('remove', function ($row) { return view('seatgroups::affiliation.partials.table-partials.remove-button', compact('row'))->render(); }) + ->rawColumns(['affiliation', 'remove']) ->make(true); } diff --git a/src/Http/Controllers/Logs/SeatGroupLogsController.php b/src/Http/Controllers/Logs/SeatGroupLogsController.php index 1c6e614..5bc6a00 100644 --- a/src/Http/Controllers/Logs/SeatGroupLogsController.php +++ b/src/Http/Controllers/Logs/SeatGroupLogsController.php @@ -10,7 +10,7 @@ use Herpaderpaldent\Seat\SeatGroups\Models\SeatgroupLog; use Seat\Web\Http\Controllers\Controller; -use Yajra\Datatables\Datatables; +use Yajra\DataTables\DataTables; class SeatGroupLogsController extends Controller { @@ -26,13 +26,14 @@ public function getSeatGroupLogs() { $logs = SeatgroupLog::query(); - return Datatables::of($logs) + return DataTables::of($logs) ->editColumn('created_at', function ($row) { return view('seatgroups::logs.partials.date', compact('row')); }) ->editColumn('event', function ($row) { return view('seatgroups::logs.partials.event', compact('row')); }) + ->rawColumns(['created_at', 'event']) ->make(true); } diff --git a/src/Http/Controllers/SeatGroupUserController.php b/src/Http/Controllers/SeatGroupUserController.php index ca45e16..c7d9fa4 100644 --- a/src/Http/Controllers/SeatGroupUserController.php +++ b/src/Http/Controllers/SeatGroupUserController.php @@ -11,7 +11,7 @@ use Illuminate\Http\Request; use Seat\Web\Acl\AccessManager; use Seat\Web\Http\Controllers\Controller; -use Yajra\Datatables\Datatables; +use Yajra\DataTables\DataTables; class SeatGroupUserController extends Controller { @@ -226,13 +226,14 @@ public function getMembersTable($id) { $seatgroup_members = Seatgroup::find($id)->group; - return Datatables::of($seatgroup_members) + return DataTables::of($seatgroup_members) ->addColumn('name', function ($row) { return view('seatgroups::partials.modal-partials.modal-name', compact('row'))->render(); }) ->addColumn('actions', function ($row) { return view('seatgroups::partials.modal-partials.modal-actions', compact('row'))->render(); }) + ->rawColumns(['name', 'actions']) ->make(true); } } diff --git a/src/Http/routes.php b/src/Http/routes.php index 96e3241..7622630 100644 --- a/src/Http/routes.php +++ b/src/Http/routes.php @@ -156,7 +156,7 @@ 'uses' => 'SeatGroupsController@removeAffiliation', ]); - Route::delete('/{seat_group_id}/user/{group_id}', [ + Route::post('/{seat_group_id}/user/{group_id}', [ 'as' => 'seatgroupuser.removeGroupFromSeatGroup', 'middleware' => 'bouncer:seatgroups.create', 'uses' => 'SeatGroupUserController@removeGroupFromSeatGroup', diff --git a/src/config/seatgroups.config.php b/src/config/seatgroups.config.php index a32f224..88540f6 100644 --- a/src/config/seatgroups.config.php +++ b/src/config/seatgroups.config.php @@ -6,7 +6,7 @@ * Time: 10:24. */ return [ - 'version' => '1.5.2', + 'version' => '1.6.0', ]; //TODO: Update Version diff --git a/src/resources/views/edit.blade.php b/src/resources/views/edit.blade.php index 7827770..4cf5d22 100644 --- a/src/resources/views/edit.blade.php +++ b/src/resources/views/edit.blade.php @@ -63,15 +63,12 @@
- {{Form::select('type',[ - 'auto' => 'auto', - 'managed'=>[ - 'open'=>'open', - 'managed' => 'managed' - ], - 'hidden' => 'hidden' - ], $seatgroup->type,['class'=>'form-control'])}} - +
@@ -172,12 +169,13 @@ {{ $group->users->map(function($user) { return $user->name; })->implode(', ') }} - {!! Form::open(['method' => 'DELETE', - 'route' => ['seatgroupuser.removeGroupFromSeatGroup',$seatgroup->id,$group->id], - 'style'=>'display:inline' - ]) !!} - {!! Form::submit(trans('web::seat.remove'), ['class' => 'btn btn-danger btn-xs pull-right']) !!} - {!! Form::close() !!} + +
+ {{ csrf_field() }} + +
diff --git a/src/resources/views/partials/managed-group.blade.php b/src/resources/views/partials/managed-group.blade.php index 95a3dad..a82d9bf 100644 --- a/src/resources/views/partials/managed-group.blade.php +++ b/src/resources/views/partials/managed-group.blade.php @@ -15,7 +15,7 @@