diff --git a/CHANGELOG.md b/CHANGELOG.md index 706af0715..bbed28aac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,15 @@ This file is a running track of new features and fixes to each version of the pa This project follows [Semantic Versioning](http://semver.org) guidelines. +## v0.7.4 (Derelict Dermodactylus) +### Fixed +* Fixes a bug when reinstalling a server that would not mark the server as installing, resulting in some UI issues. + ## v0.7.3 (Derelict Dermodactylus) ### Fixed * Fixes server creation API endpoint not passing the provided `external_id` to the creation service. +* Fixes a bug causing users to be un-editable on new installations once more than one user exists. +* Fixes default order of buttons in certain parts of the panel that would default to 'Delete' rather than 'Save' when pressing enter. ### Added * Adds ability to modify the external ID for a server through the API. diff --git a/app/Models/User.php b/app/Models/User.php index 10c710f19..aff4f3287 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -121,6 +121,7 @@ class User extends Model implements * @var array */ protected $attributes = [ + 'external_id' => null, 'root_admin' => false, 'language' => 'en', 'use_totp' => false, diff --git a/app/Services/Servers/ReinstallServerService.php b/app/Services/Servers/ReinstallServerService.php index 682813e36..85800473f 100644 --- a/app/Services/Servers/ReinstallServerService.php +++ b/app/Services/Servers/ReinstallServerService.php @@ -66,7 +66,7 @@ class ReinstallServerService $this->database->beginTransaction(); $this->repository->withoutFreshModel()->update($server->id, [ 'installed' => 0, - ]); + ], true, true); try { $this->daemonServerRepository->setServer($server)->reinstall(); diff --git a/database/migrations/2018_02_25_160152_remove_default_null_value_on_table.php b/database/migrations/2018_02_25_160152_remove_default_null_value_on_table.php new file mode 100644 index 000000000..6469867f2 --- /dev/null +++ b/database/migrations/2018_02_25_160152_remove_default_null_value_on_table.php @@ -0,0 +1,38 @@ +string('external_id')->default(null)->change(); + }); + + DB::transaction(function () { + DB::table('users')->where('external_id', '=', 'NULL')->update([ + 'external_id' => null, + ]); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // This should not be rolled back. + } +} diff --git a/database/migrations/2018_02_25_160604_define_unique_index_on_users_external_id.php b/database/migrations/2018_02_25_160604_define_unique_index_on_users_external_id.php new file mode 100644 index 000000000..0a9b8afe2 --- /dev/null +++ b/database/migrations/2018_02_25_160604_define_unique_index_on_users_external_id.php @@ -0,0 +1,32 @@ +index(['external_id']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + $table->dropIndex(['external_id']); + }); + } +} diff --git a/resources/themes/pterodactyl/admin/databases/view.blade.php b/resources/themes/pterodactyl/admin/databases/view.blade.php index db7db1c48..41a2d7901 100644 --- a/resources/themes/pterodactyl/admin/databases/view.blade.php +++ b/resources/themes/pterodactyl/admin/databases/view.blade.php @@ -79,8 +79,8 @@ diff --git a/resources/themes/pterodactyl/admin/eggs/variables.blade.php b/resources/themes/pterodactyl/admin/eggs/variables.blade.php index bd18e05cf..40ee82c8b 100644 --- a/resources/themes/pterodactyl/admin/eggs/variables.blade.php +++ b/resources/themes/pterodactyl/admin/eggs/variables.blade.php @@ -86,8 +86,8 @@ diff --git a/resources/themes/pterodactyl/admin/eggs/view.blade.php b/resources/themes/pterodactyl/admin/eggs/view.blade.php index 2e0fdcc83..c2f687799 100644 --- a/resources/themes/pterodactyl/admin/eggs/view.blade.php +++ b/resources/themes/pterodactyl/admin/eggs/view.blade.php @@ -31,7 +31,7 @@
-
+
Notice: Editing an Egg or any of the Process Management fields requires that each Daemon be rebooted in order to apply the changes.
@@ -159,14 +159,19 @@
+
+
+ Notice: Editing an Egg or any of the Process Management fields requires that each Daemon be rebooted in order to apply the changes. +
+
@endsection diff --git a/resources/themes/pterodactyl/admin/locations/view.blade.php b/resources/themes/pterodactyl/admin/locations/view.blade.php index fdb791754..2264ee694 100644 --- a/resources/themes/pterodactyl/admin/locations/view.blade.php +++ b/resources/themes/pterodactyl/admin/locations/view.blade.php @@ -39,8 +39,8 @@ diff --git a/resources/themes/pterodactyl/admin/packs/modal.blade.php b/resources/themes/pterodactyl/admin/packs/modal.blade.php index 2ce57f2b1..dbf2044e0 100644 --- a/resources/themes/pterodactyl/admin/packs/modal.blade.php +++ b/resources/themes/pterodactyl/admin/packs/modal.blade.php @@ -38,8 +38,8 @@ diff --git a/resources/themes/pterodactyl/admin/packs/view.blade.php b/resources/themes/pterodactyl/admin/packs/view.blade.php index 0f4a38e7b..e530bc9c4 100644 --- a/resources/themes/pterodactyl/admin/packs/view.blade.php +++ b/resources/themes/pterodactyl/admin/packs/view.blade.php @@ -98,8 +98,8 @@ diff --git a/resources/themes/pterodactyl/server/schedules/view.blade.php b/resources/themes/pterodactyl/server/schedules/view.blade.php index 87b15ad5f..370b4f0b0 100644 --- a/resources/themes/pterodactyl/server/schedules/view.blade.php +++ b/resources/themes/pterodactyl/server/schedules/view.blade.php @@ -122,14 +122,14 @@

@lang('server.schedule.task_help')

-
- -
{!! csrf_field() !!}
+
+ +
diff --git a/tests/Unit/Services/Servers/ReinstallServerServiceTest.php b/tests/Unit/Services/Servers/ReinstallServerServiceTest.php index 349aa571a..f00614f77 100644 --- a/tests/Unit/Services/Servers/ReinstallServerServiceTest.php +++ b/tests/Unit/Services/Servers/ReinstallServerServiceTest.php @@ -81,10 +81,9 @@ class ReinstallServerServiceTest extends TestCase $this->repository->shouldNotReceive('find'); $this->database->shouldReceive('beginTransaction')->withNoArgs()->once()->andReturnNull(); - $this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf() - ->shouldReceive('update')->with($this->server->id, [ - 'installed' => 0, - ])->once()->andReturnNull(); + $this->repository->shouldReceive('withoutFreshModel->update')->with($this->server->id, [ + 'installed' => 0, + ], true, true)->once()->andReturnNull(); $this->daemonServerRepository->shouldReceive('setServer')->with($this->server)->once()->andReturnSelf() ->shouldReceive('reinstall')->withNoArgs()->once()->andReturn(new Response); @@ -101,10 +100,9 @@ class ReinstallServerServiceTest extends TestCase $this->repository->shouldReceive('find')->with($this->server->id)->once()->andReturn($this->server); $this->database->shouldReceive('beginTransaction')->withNoArgs()->once()->andReturnNull(); - $this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf() - ->shouldReceive('update')->with($this->server->id, [ - 'installed' => 0, - ])->once()->andReturnNull(); + $this->repository->shouldReceive('withoutFreshModel->update')->with($this->server->id, [ + 'installed' => 0, + ], true, true)->once()->andReturnNull(); $this->daemonServerRepository->shouldReceive('setServer')->with($this->server)->once()->andReturnSelf() ->shouldReceive('reinstall')->withNoArgs()->once()->andReturn(new Response); @@ -121,10 +119,9 @@ class ReinstallServerServiceTest extends TestCase public function testExceptionThrownByGuzzleShouldBeReRenderedAsDisplayable() { $this->database->shouldReceive('beginTransaction')->withNoArgs()->once()->andReturnNull(); - $this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf() - ->shouldReceive('update')->with($this->server->id, [ - 'installed' => 0, - ])->once()->andReturnNull(); + $this->repository->shouldReceive('withoutFreshModel->update')->with($this->server->id, [ + 'installed' => 0, + ], true, true)->once()->andReturnNull(); $this->daemonServerRepository->shouldReceive('setServer')->with($this->server)->once()->andThrow($this->exception); @@ -139,10 +136,9 @@ class ReinstallServerServiceTest extends TestCase public function testExceptionNotThrownByGuzzleShouldNotBeTransformedToDisplayable() { $this->database->shouldReceive('beginTransaction')->withNoArgs()->once()->andReturnNull(); - $this->repository->shouldReceive('withoutFreshModel')->withNoArgs()->once()->andReturnSelf() - ->shouldReceive('update')->with($this->server->id, [ - 'installed' => 0, - ])->once()->andReturnNull(); + $this->repository->shouldReceive('withoutFreshModel->update')->with($this->server->id, [ + 'installed' => 0, + ], true, true)->once()->andReturnNull(); $this->daemonServerRepository->shouldReceive('setServer')->with($this->server)->once()->andThrow(new Exception());