Merge branch 'tusharnain4578/development' into development

This commit is contained in:
Dan Brown 2023-09-17 22:29:06 +01:00
commit 684a9dee8e
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 29 additions and 14 deletions

View File

@ -20,20 +20,22 @@
'label' => trans('preferences.notifications_opt_own_page_changes'), 'label' => trans('preferences.notifications_opt_own_page_changes'),
]) ])
</div> </div>
<div> @if (!setting('app-disable-comments'))
@include('form.toggle-switch', [ <div>
'name' => 'preferences[own-page-comments]', @include('form.toggle-switch', [
'value' => $preferences->notifyOnOwnPageComments(), 'name' => 'preferences[own-page-comments]',
'label' => trans('preferences.notifications_opt_own_page_comments'), 'value' => $preferences->notifyOnOwnPageComments(),
]) 'label' => trans('preferences.notifications_opt_own_page_comments'),
</div> ])
<div> </div>
@include('form.toggle-switch', [ <div>
'name' => 'preferences[comment-replies]', @include('form.toggle-switch', [
'value' => $preferences->notifyOnCommentReplies(), 'name' => 'preferences[comment-replies]',
'label' => trans('preferences.notifications_opt_comment_replies'), 'value' => $preferences->notifyOnCommentReplies(),
]) 'label' => trans('preferences.notifications_opt_comment_replies'),
</div> ])
</div>
@endif
</div> </div>
<div class="mt-auto"> <div class="mt-auto">

View File

@ -156,6 +156,19 @@ class UserPreferencesTest extends TestCase
$this->assertPermissionError($resp); $this->assertPermissionError($resp);
} }
public function test_notification_comment_options_only_exist_if_comments_active()
{
$resp = $this->asEditor()->get('/preferences/notifications');
$resp->assertSee('Notify upon comments');
$resp->assertSee('Notify upon replies');
setting()->put('app-disable-comments', true);
$resp = $this->get('/preferences/notifications');
$resp->assertDontSee('Notify upon comments');
$resp->assertDontSee('Notify upon replies');
}
public function test_update_sort_preference() public function test_update_sort_preference()
{ {
$editor = $this->users->editor(); $editor = $this->users->editor();