From 1ff8e4e3e434b6edf86580dbc11f29edb58b981a Mon Sep 17 00:00:00 2001 From: Herpaderp Aldent Date: Thu, 29 Nov 2018 08:10:35 +0100 Subject: [PATCH 1/4] uncomment backend and added frontend validation of corporations affiliation --- .../Affiliation/AddCorporationAffiliationRequest.php | 4 ++-- .../views/affiliation/partials/corporation-form.blade.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Http/Validation/Affiliation/AddCorporationAffiliationRequest.php b/src/Http/Validation/Affiliation/AddCorporationAffiliationRequest.php index ec550eb..81aa759 100644 --- a/src/Http/Validation/Affiliation/AddCorporationAffiliationRequest.php +++ b/src/Http/Validation/Affiliation/AddCorporationAffiliationRequest.php @@ -32,8 +32,8 @@ public function rules() { return [ - //'corporation_ids.*'=>'required', - 'seatgroup_id'=>'required', + 'corporation_ids' => 'required|array', + 'seatgroup_id' => 'required', ]; } } diff --git a/src/resources/views/affiliation/partials/corporation-form.blade.php b/src/resources/views/affiliation/partials/corporation-form.blade.php index 31a6da2..f0eea4c 100644 --- a/src/resources/views/affiliation/partials/corporation-form.blade.php +++ b/src/resources/views/affiliation/partials/corporation-form.blade.php @@ -4,7 +4,7 @@
- @if(!$seatgroup->all_corporations) From 3dd5dc315556989d4df8d42373f007d8bc1288fa Mon Sep 17 00:00:00 2001 From: Herpaderp Aldent Date: Thu, 29 Nov 2018 08:27:58 +0100 Subject: [PATCH 2/4] Add corporation title frontend validation --- .../affiliation/partials/corporation-title-form.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resources/views/affiliation/partials/corporation-title-form.blade.php b/src/resources/views/affiliation/partials/corporation-title-form.blade.php index 7ee36c0..b290c30 100644 --- a/src/resources/views/affiliation/partials/corporation-title-form.blade.php +++ b/src/resources/views/affiliation/partials/corporation-title-form.blade.php @@ -5,7 +5,7 @@
- @if(!$seatgroup->all_corporations) @foreach($all_corporations_for_title as $corporation) @@ -17,7 +17,7 @@
-
From e780ee491ed9886a526cdf406495d85922a05727 Mon Sep 17 00:00:00 2001 From: Herpaderp Aldent Date: Thu, 29 Nov 2018 09:02:57 +0100 Subject: [PATCH 3/4] add multiple user groups to hidden seat-group solves: https://github.com/herpaderpaldent/seat-groups/issues/56 --- src/Http/Controllers/SeatGroupUserController.php | 8 ++++---- src/resources/views/edit.blade.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Http/Controllers/SeatGroupUserController.php b/src/Http/Controllers/SeatGroupUserController.php index 02aac77..ca45e16 100644 --- a/src/Http/Controllers/SeatGroupUserController.php +++ b/src/Http/Controllers/SeatGroupUserController.php @@ -169,16 +169,16 @@ public function update(Request $request, $id) //Handle hidden group if ($seatgroup->type == 'hidden') { - if(auth()->user()->hasRole('seatgroups.create')) { + if (auth()->user()->hasRole('seatgroups.create')) { $this->validate(request(), [ - 'groups'=>'required', + 'groups' => 'required|array', ]); $groups = $request->get('groups'); foreach ($groups as $group) { $seatgroup->group()->attach($group); - - return redirect()->back()->with('success', 'Updated'); } + + return redirect()->back()->with('success', 'Updated'); } } diff --git a/src/resources/views/edit.blade.php b/src/resources/views/edit.blade.php index b66b533..7827770 100644 --- a/src/resources/views/edit.blade.php +++ b/src/resources/views/edit.blade.php @@ -138,7 +138,7 @@
- @foreach($all_groups as $group) @if(!in_array($group->id,$seatgroup->member->pluck('id')->toArray()))) From aa2039e36da93aa84bf3795398f88b5bc3aec23f Mon Sep 17 00:00:00 2001 From: Herpaderp Aldent Date: Thu, 29 Nov 2018 09:24:20 +0100 Subject: [PATCH 4/4] Version bump and changelog --- CHANGELOG.md | 8 ++++++++ src/config/seatgroups.config.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8af40e2..a239dc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# 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 +* Added front end validation to corporation title affiliation +* Corrected an error preventing to add multiple user groups to hidden seatgroup. + +Thank you again for your feedback. + # Version 1.5.1 This is a security update including some smaller improvements: * MissingRefreshToken Exception removed, however potentially gained roles by missing character are seized until refresh token is provided. Thank you @fundaris for report this issue. diff --git a/src/config/seatgroups.config.php b/src/config/seatgroups.config.php index c2ee85a..a32f224 100644 --- a/src/config/seatgroups.config.php +++ b/src/config/seatgroups.config.php @@ -6,7 +6,7 @@ * Time: 10:24. */ return [ - 'version' => '1.5.1', + 'version' => '1.5.2', ]; //TODO: Update Version