mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-23 11:22:33 +01:00
Notifications: Made improvements from manual testing
- Added titles for preference pages. - Added extra check for non-guest for notifications on preferences page.
This commit is contained in:
parent
565908ef52
commit
79470ea4b7
@ -33,6 +33,8 @@ class UserPreferencesController extends Controller
|
||||
$shortcuts = UserShortcutMap::fromUserPreferences();
|
||||
$enabled = setting()->getForCurrentUser('ui-shortcuts-enabled', false);
|
||||
|
||||
$this->setPageTitle(trans('preferences.shortcuts_interface'));
|
||||
|
||||
return view('users.preferences.shortcuts', [
|
||||
'shortcuts' => $shortcuts,
|
||||
'enabled' => $enabled,
|
||||
@ -70,6 +72,7 @@ class UserPreferencesController extends Controller
|
||||
$query = $permissions->restrictEntityRelationQuery($query, 'watches', 'watchable_id', 'watchable_type');
|
||||
$watches = $query->with('watchable')->paginate(20);
|
||||
|
||||
$this->setPageTitle(trans('preferences.notifications'));
|
||||
return view('users.preferences.notifications', [
|
||||
'preferences' => $preferences,
|
||||
'watches' => $watches,
|
||||
|
@ -13,7 +13,7 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@if(userCan('receive-notifications'))
|
||||
@if(signedInUser() && userCan('receive-notifications'))
|
||||
<section class="card content-wrap auto-height items-center justify-space-between gap-m flex-container-row">
|
||||
<div>
|
||||
<h2 class="list-heading">{{ trans('preferences.notifications') }}</h2>
|
||||
|
@ -15,13 +15,15 @@ class UserPreferencesTest extends TestCase
|
||||
$resp->assertSee('Edit Profile');
|
||||
}
|
||||
|
||||
public function test_index_view_accessible_but_without_profile_for_guest_user()
|
||||
public function test_index_view_accessible_but_without_profile_and_notifications_for_guest_user()
|
||||
{
|
||||
$this->setSettings(['app-public' => 'true']);
|
||||
$this->permissions->grantUserRolePermissions($this->users->guest(), ['receive-notifications']);
|
||||
$resp = $this->get('/preferences');
|
||||
$resp->assertOk();
|
||||
$resp->assertSee('Interface Keyboard Shortcuts');
|
||||
$resp->assertDontSee('Edit Profile');
|
||||
$resp->assertDontSee('Notification');
|
||||
}
|
||||
public function test_interface_shortcuts_updating()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user