Skip to content

Commit

Permalink
Users: Hid lanuage preference for guest user
Browse files Browse the repository at this point in the history
Hiding since it's not really used, and may mislead on how to set default
app language (which should be done via env options).
Updated test to cover.

For #5356
  • Loading branch information
ssddanbrown committed Dec 13, 2024
1 parent 7e1a8e5 commit a8ef820
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion resources/views/users/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class="setting-list-label">{{ trans('settings.users_avatar') }}</label>
</div>
</div>

@include('users.parts.language-option-row', ['value' => old('language') ?? $user->getLocale()->appLocale()])
@if(!$user->isGuest())
@include('users.parts.language-option-row', ['value' => old('language') ?? $user->getLocale()->appLocale()])
@endif
</div>

<div class="text-right">
Expand Down
6 changes: 5 additions & 1 deletion tests/User/UserManagementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,13 @@ public function test_delete_removes_user_preferences()
public function test_guest_profile_shows_limited_form()
{
$guest = $this->users->guest();

$resp = $this->asAdmin()->get('/settings/users/' . $guest->id);
$resp->assertSee('Guest');
$this->withHtml($resp)->assertElementNotExists('#password');
$html = $this->withHtml($resp);

$html->assertElementNotExists('#password');
$html->assertElementNotExists('[name="language"]');
}

public function test_guest_profile_cannot_be_deleted()
Expand Down

0 comments on commit a8ef820

Please sign in to comment.